]> git.saurik.com Git - bison.git/blame - ChangeLog
variables: use `parse.assert' instead of `assert'.
[bison.git] / ChangeLog
CommitLineData
0c90a1f5
AD
12009-04-14 Akim Demaille <demaille@gostai.com>
2
3 variables: use `parse.assert' instead of `assert'.
4 * TODO (assert): Remove.
5 * data/bison.m4 (b4_assert_if): Replace with...
6 (b4_parse_assert_if): this.
7 * data/lalr1.cc, data/variant.hh, tests/c++.at: Adjust.
8 * doc/bison.texinfo (Decl Summary): Document parse.assert.
9
fa819509
AD
102009-04-14 Akim Demaille <demaille@gostai.com>
11
12 variables: use `parse.assert' instead of `debug'.
13 * src/getargs.c (getargs): Map -t to %define trace.parse.
14 * src/scan-gram.l (%debug): Map to %define trace.parse.
15 * data/bison.m4 (b4_percent_define_if_define): Map `.' in variable
16 names to `_' in macro names.
17 (b4_debug_if): Replace with...
18 (b4_parse_trace_if): this.
19 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
20 * data/yacc.c: Adjust.
21 * doc/bison.texinfo (Decl Summary): Document %debug as obsoleted.
22 Use @code to label the variable list.
23 Document the variable parse.trace.
24 (Tracing): Promote the parse.trace variable.
25 * TODO: %printer is not documented.
26
f7dae1ea
AD
272009-04-14 Akim Demaille <demaille@gostai.com>
28
29 doc: minor fixes.
30 * doc/bison.texinfo (Decl Summary): Fix entry about %debug.
31 (Table of Symbols): Remove duplicate entry for %debug.
32
3535c071
EB
332009-04-10 Eric Blake <ebb9@byu.net>
34
35 submodules: update to latest
36 * submodules/autoconf: Use latest upstream Autoconf.
37
cf48f675
EB
382009-04-06 Eric Blake <ebb9@byu.net>
39
40 Work around autoconf 2.63b bug in testsuite.
41 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Avoid tripping
42 autoconf bug related to # in test.
43
50cca368
JD
442009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
45
46 * NEWS (2.5): New section. Describe new -D/--define feature.
47
3583d96b
AD
482009-04-06 Akim Demaille <demaille@gostai.com>
49
50 Regen.
51 * src/parse-gram.h, src/parse-gram.c: Regen.
52
00f5d575
AD
532009-04-06 Akim Demaille <demaille@gostai.com>
54
55 rename muscle_tab.* as muscle-tab.* for consistency.
56 * src/muscle_tab.h, src/muscle_tab.c: Rename as...
57 * src/muscle-tab.h, src/muscle-tab.c: these.
58 * src/getargs.c, src/local.mk, src/main.c, src/output.c,
59 * src/parse-gram.y, src/reader.c, src/scan-code.l: Adjust.
60
76bf5102
AD
612009-04-06 Akim Demaille <demaille@gostai.com>
62
63 Makefile: introduce $(BISON).
64 * src/local.mk (BISON): New.
65 (YACC): Use it.
66
bc0f5737
AD
672009-04-06 Akim Demaille <demaille@gostai.com>
68
69 parser: handle %locations as %define locations.
70 * src/getargs.h, src/getargs.c (locations_flag): Remove.
71 * src/getargs.c, src/scan-code.l: Use muscle_percent_define_ensure
72 to set "locations" to true.
73 * src/output.c (prepare): Don't output "locations".
74 * src/scan-gram.l (%locations): Handle it as a %<flag>.
75 * src/parse-gram.y: It's no longer a token.
76 Don't handle it.
77 * data/bison.m4 (b4_locations_if): Define it with
78 b4_percent_define_if_define.
79 * data/c.m4, data/glr.cc: Adjust.
80
697c912f
AD
812009-04-06 Akim Demaille <demaille@gostai.com>
82
83 Regen.
84 * src/parse-gram.c: Regen.
85
4920ae8b
AD
862009-04-06 Akim Demaille <demaille@gostai.com>
87
88 muscle: factor the handling of obsolete of obsolete directives.
89 Suggested by Joel E. Denny.
50cca368 90
4920ae8b
AD
91 * src/muscle_tab.h, src/muscle_tab.c (muscle_percent_define_ensure):
92 New, extracted from...
93 * src/parse-gram.y (prologue_declaration: pure-parser): here.
94 Remove it.
95 (prologue_declaration: "%<flag>"): Use
96 muscle_percent_define_ensure.
97 (%error-verbose, %pure-parser): No longer tokens.
98 * src/scan-gram.l (pure-parser): Return as a %<flag>.
99
1d5b3c08
JD
1002009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
101
102 Fix options documentation.
103 * build-aux/cross-options.pl: As in --help output, write optional
104 arguments as [=ARG] not =[ARG].
105 * doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
106
62c99cf4
JD
1072009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
108
109 Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4.
110 If the first m4 in $PATH is wrong, it keeps looking. Moreover, its
111 requirements for a correct m4 are stricter.
112 * m4/m4.m4: Make it a symbolic link to submodules/autoconf/m4/m4.m4.
113 * configure.ac: Update to use AC_PROG_GNU_M4.
114 Reported by Eric Blake.
115
1c93f35b
JD
1162009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
117
118 Help with updating web manual.
119 * HACKING: Incorporate instructions from gnulib/doc/README.
120 * bootstrap.conf (gnulib_modules): Add gendocs.
121
86cfae0a
AD
1222009-04-03 Akim Demaille <demaille@gostai.com>
123
124 Regen.
125 * src/parse-gram.h, src/parse-gram.c: Regen.
126
ba061fa6
AD
1272009-04-03 Akim Demaille <demaille@gostai.com>
128
129 Factor %FLAG at scan level.
130 * src/parse-gram.y (PERCENT_DEBUG, PERCENT_ERROR_VERBOSE): Token
131 definitions and associated rules, replaced by....
132 (PERCENT_FLAG): this new token type, and rule.
133 * src/scan-gram.l (RETURN_PERCENT_FLAG): New.
134 Use it for %debug and %error-verbose.
135
b19ebeb3
AD
1362009-04-03 Akim Demaille <demaille@gostai.com>
137
138 Regen.
139 * src/parse-gram.h, src/parse-gram.c: Regen.
140
001a16a9
AD
1412009-04-03 Akim Demaille <demaille@gostai.com>
142
143 Treat %debug as %define debug.
144 * data/bison.m4 (b4_debug_if): New.
145 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c,
146 * data/lalr1.java: Use it instead of b4_debug_flag.
147 * src/getargs.h, src/getargs.c (debug_flag): Remove.
148 * src/output.c (prepare): Don't output it.
149 * src/parse-gram.y: Treat %debug as %define debug.
150
1512009-04-03 Akim Demaille <demaille@gostai.com>
152
153 Treat %error-verbose as %define error_verbose.
154 This allows to pass -Derror_verbose on the command line. Better
155 yet, it allows to pass -Derror_verbose=$(ERROR_VERBOSE), with
156 ERROR_VERBOSE being defined as false or true.
157 * data/bison.m4 (b4_percent_define_if_define): Instead of relying
158 on b4_percent_define_ifdef, for does not check the defined value,
159 but only whether the symbol is defined, rely on
160 b4_percent_define_flag_if, so that a value of "false" is processed
161 as a false.
162 If not defined, define the flag to "false".
163 (b4_error_verbose_if): New.
164 * data/glr.c, data/lalr1.cc, data/yacc.c: Use it instead of
165 b4_error_verbose_flag.
166 * src/getargs.h, src/getargs.c (error_verbose_flag): Remove.
167 * src/output.c (prepare): Don't output it.
168 * src/parse-gram.y (%error-verbose): Treat as %define error_verbose.
169
92822aff
JD
1702009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
171
172 Fix strange %define locations for default values.
173 Reported by Akim Demaille at
174 <http://lists.gnu.org/archive/html/bug-bison/2007-12/msg00001.html>
175 and discussed again starting at
176 <http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00102.html>.
177 * data/bison.m4 (b4_percent_define_default): Leave syncline blank
178 because location information is bogus.
179 Use angle brackets to delimit fake file name because square brackets
180 look like underexpanded m4. Choose a better fake file name.
181 Use negative line numbers.
182 * src/muscle_tab.c (muscle_percent_define_default): Likewise.
183 * src/location.c (location_print): If line for a boundary is negative,
184 only print that boundary's file name.
185 * src/location.h: Document that.
186 * tests/skeletons.at (%define Boolean variables: invalid skeleton
187 defaults): Update output.
188
e021191b
JD
1892009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
190
191 Pacify ./configure --enable-gcc-warnings.
192 * Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS) because many files
193 in lib won't compile with it.
194 * src/local.mk (src_bison_CFLAGS): Use $(WERROR_CFLAGS) here only.
195
78f65418
AD
1962009-03-31 Akim Demaille <demaille@gostai.com>
197
198 bootstrap: --help to stdout.
199 * bootstrap (usage): Don't send --help to stderr.
200 Use a here doc instead of a long string.
201
f7e241f4
AD
2022009-03-31 Akim Demaille <demaille@gostai.com>
203
204 bootstrap: README-hacking no longer exists
205 * bootstrap (checkout_only_file): Set to HACKING.
206
31d3e510
AD
2072009-03-26 Akim Demaille <demaille@gostai.com>
208
209 doc: merge HACKING and README-hacking.
210 Two files is confusing.
211 Reported by Alexandre Duret-Lutz.
1f9d8248 212
31d3e510
AD
213 * README-hacking: Merge into...
214 * HACKING (Working from the repository): here.
215
81535bfa
AD
2162009-03-26 Akim Demaille <demaille@gostai.com>
217
218 doc: update README-hacking.
219 * README-hacking: We now use git and git submodules.
220 Reported by Ralf Wildenhues and Alexandre Duret-Lutz.
221
56f772e9
AD
2222009-03-26 Akim Demaille <demaille@gostai.com>
223
224 lalr1.cc: avoid GCC 4.3 warnings.
225 GCC 4.3 now warns about "a || b && c" and asks for explicit
226 parentheses.
227 Reported by Alexandre Duret-Lutz.
228 * data/location.cc: Update copyright years.
229 (Position::operator==): Use parens to make precedence explicit.
230 Compare lines and columns first, as they are more likely to be
231 different, and they are faster to compare.
232
11c073b7
AD
2332009-03-26 Akim Demaille <demaille@gostai.com>
234
235 gnulib: update.
236 * gnulib: Update to latest.
237 * src/local.mk (AM_CFLAGS): Move to...
238 * Makefile.am: here.
239 * etc/prefix-gnulib-mk (prefix_assignment): Also transform
240 AM_CFLAGS.
241
91be6b28
AD
2422009-03-02 Akim Demaille <demaille@gostai.com>
243
244 Comment changes.
245
cbf25ce7
AD
2462009-03-02 Akim Demaille <demaille@gostai.com>
247
248 Share b4_yytranslate_define.
249 * data/lalr1.cc (b4_yytranslate_define): Move to...
250 * data/c++.m4: here.
251
882f02ed
AD
2522009-03-02 Akim Demaille <demaille@gostai.com>
253
254 Use locations in the variant example.
1f9d8248
AD
255 Yes, this obfuscates the point of this example, variants only.
256 But glr.cc cannot work (yet?) without locations. This change
257 makes it easier to use this example with glr.cc.
11c073b7 258
882f02ed
AD
259 * examples/variant.yy (assert): %define it.
260 (locations): Request them.
261 (yylex): Bind the location to the stage.
262
0623bacc
AD
2632009-03-02 Akim Demaille <demaille@gostai.com>
264
265 Dub make_TOKEN as a public type interface.
266 * data/c++.m4 (b4_symbol_constructor_declare)
267 (b4_symbol_constructor_define): New empty stubs.
268 (b4_public_types_declare, b4_public_types_define): Use them.
269 * data/lalr1.cc (b4_symbol_constructor_declare)
270 (b4_symbol_constructor_declare_)
271 (b4_symbol_constructor_define_, b4_symbol_constructor_define):
272 Move to...
273 * data/variant.hh: here.
274 Remove the "b4_variant_if" parts, as variant.hh is loaded only if
275 needed.
276 * data/lalr1.cc: No longer invoke b4_symbol_constructor_define and
277 b4_symbol_constructor_declare, as it is now done by
278 b4_public_types_define and b4_public_types_declare.
279
5f5a90df
AD
2802009-03-02 Akim Demaille <demaille@gostai.com>
281
282 Coding style changes.
283 * data/lalr1.cc (b4_symbol_constructor_declaration_)
284 (b4_symbol_constructor_declarations)
285 (b4_symbol_constructor_definition_)
286 (b4_symbol_constructor_definitions)
287 (b4_yytranslate_definition): Rename as...
288 (b4_symbol_constructor_declare_)
289 (b4_symbol_constructor_declare)
290 (b4_symbol_constructor_define_)
291 (b4_symbol_constructor_define)
292 (b4_yytranslate_define): these.
293 * data/variant.hh (b4_variant_definition): Rename as...
294 (b4_variant_define): this.
295
b47b6ff7
AD
2962009-03-02 Akim Demaille <demaille@gostai.com>
297
298 Factor b4_assert_if, b4_lex_symbol_if, and b4_variant_if.
299 * data/bison.m4 (b4_percent_define_if_define): New.
300 * data/c++.m4 (b4_variant_if): Move to...
301 * data/bison.m4: Here, using b4_percent_define_if_define.
302 * data/lalr1.cc (b4_assert_if, b4_lex_symbol_if): Move to...
303 * data/bison.m4: Here, using b4_percent_define_if_define.
304
1d6b689b
AD
3052009-03-02 Akim Demaille <demaille@gostai.com>
306
307 Dub symbol_type_base as a public type.
308 * data/c++.m4 (b4_public_types_declare): Now define
309 symbol_type_base and symbol_type.
310 (b4_public_types_define): New.
311 In both cases, the definitions are taken verbatim from lalr1.cc.
312 * data/lalr1.cc: Adjust.
313
4f84717d
AD
3142009-03-02 Akim Demaille <demaille@gostai.com>
315
316 b4_public_types_declare.
317 * data/c++.m4 (b4_public_types_declare): New.
318 * data/glr.cc, data/lalr1.cc: Use it.
319
b9e4eb5b
AD
3202009-03-02 Akim Demaille <demaille@gostai.com>
321
322 b4_semantic_type_declare.
323 * data/c++.m4 (b4_semantic_type_declare): New.
324 Factors and generalizes what was in glr.cc and lalr1.cc.
325 * data/variant.hh (b4_semantic_type_declare): Redefine it for
326 variants.
327 * data/lalr1.cc, data/glr.cc: Use it.
328
6a6e7f0c
AD
3292009-02-26 Akim Demaille <demaille@gostai.com>
330
331 Upgrade gnulib.
332 * gnulib: Upgrade from master.
333 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore, m4/.gitignore:
334 Regen.
335
e9e61b00
AD
3362009-02-25 Akim Demaille <demaille@gostai.com>
337
338 Remove useless arguments.
339 * data/glr.c (yy_reduce_print): $$ and @$ are not used and not
340 relevant.
341
3eead995
AD
3422009-02-25 Akim Demaille <demaille@gostai.com>
343
344 Comment changes.
345 * data/lalr1.cc: here.
346
87f28efe
AD
3472009-02-25 Akim Demaille <demaille@gostai.com>
348
349 Fix glr.cc's debug level handling.
350 * data/glr.cc (yydebug_): Remove, as it is actually yydebug from
351 glr.c which is used.
352 (debug_level, set_debug_level): Adjust.
353
9be2a009
AD
3542009-02-25 Akim Demaille <demaille@gostai.com>
355
356 Copyright years.
357 * data/glr.c: Add 2007 and 2008 here, consistenly with the comments.
358
07a6e87d
AD
3592009-02-25 Akim Demaille <demaille@gostai.com>
360
361 Style changes.
362 * etc/bench.pl.in (generate_grammar_list): Consitently use
363 location_type, not yy::location.
364
33c78bd2
AD
3652009-02-25 Akim Demaille <demaille@gostai.com>
366
367 Comment change.
368 * data/lalr1.cc: here.
369
49572920
AD
3702009-02-19 Akim Demaille <demaille@gostai.com>
371
372 Make yyparser::error public.
373 * data/lalr1.cc: here.
374 There is no good reason to keep it private (and it is convenient
375 to use it from the scanner for instance). It is already public in
376 glr.cc.
377
88654b47
AD
3782009-02-19 Akim Demaille <demaille@gostai.com>
379
380 Comment changes.
381 * data/glr.cc: here.
382
4524c55b
AD
3832009-02-19 Akim Demaille <demaille@gostai.com>
384
385 Remove trailing blanks.
6a6e7f0c
AD
386 The epilogue has its own ending \n, no need to add another.
387
4524c55b
AD
388 * data/glr.c, data/lalr1.java, data/yacc.c: dnl when outputing the
389 epilogue.
390 * data/glr.cc: dnl when extending the epilogue.
391 Remove stray "private:".
392
6ceccee8
AD
3932009-02-19 Akim Demaille <demaille@gostai.com>
394
395 Use b4_c_modern.
396 * data/c.m4 (b4_c_function_decl): Here.
397
9c6a8966
AD
3982009-02-19 Akim Demaille <demaille@gostai.com>
399
400 Comment changes.
401 * data/lalr1.cc: here.
402
507aa0e2
AD
4032009-02-19 Akim Demaille <demaille@gostai.com>
404
405 Extract variant.hh
406 * data/variant.hh: New, extracted from...
407 * data/lalr1.cc: here.
408 Adjust.
409 * data/local.mk: Adjust.
410
51bacae6
AD
4112009-02-19 Akim Demaille <demaille@gostai.com>
412
413 Extract stack.hh from lalr1.cc.
414 * data/stack.hh: New.
415 * data/lalr1.cc: Extract from here.
416 * data/local.mk: Adjust.
417
06c3084f
JD
4182009-02-03 Joel E. Denny <jdenny@ces.clemson.edu>
419
420 Add reminder about uploading public key to keys.gnupg.net.
421 * HACKING (Release Procedure): Here.
422
0ea583d2
AD
4232009-01-28 Akim Demaille <demaille@gostai.com>
424
425 * NEWS: Update information about 2.4.1 and 2.4.2.
426
402b123d
AD
4272008-11-04 Akim Demaille <demaille@gostai.com>
428
429 Reformat NEWS.
430 * NEWS: Use more outline-mode markup.
431 Suggested by Jim Meyering.
432
74553c98
AD
4332009-01-08 Akim Demaille <demaille@gostai.com>
434
435 Fix grep portability issues.
436 Grep on Solaris does not support -q.
437 Reported by Summum Bonum.
438
439 * NEWS: Add a stub for 2.4.2.
440 * THANKS: Add Summum Bonum.
441 * tests/atlocal.in (EGREP): New.
442 (CC, CXX, XSLTPROC): Make it possible to override them via
443 envvars.
444 * tests/java.at: Use $EGREP instead of egrep.
445 Use AT_CHECK's ignore instead of grep's -q.
446
84eedf86
AD
4472008-12-11 Akim Demaille <demaille@gostai.com>
448
449 Pass the token type to yysyntax_error.
450 * data/yacc.c (yysyntax_error): Take the transated token instead
451 of the raw number.
452 Adjust callers.
453 * TODO: Update.
454
5860cc8c
AD
4552008-12-11 Akim Demaille <demaille@gostai.com>
456
457 Formatting changes.
458 * data/glr.c: Formatting changes.
459
2b008529
AD
4602008-12-11 Akim Demaille <demaille@gostai.com>
461
462 Propagate i18n changes into glr.c.
463 * TODO: Update.
464 * data/glr.c (yyreportSyntaxError): Use "switch" instead of
465 building the error message format dynamically.
466 * data/lalr1.java: Formatting changes.
467
2cd1af95
AD
4682008-12-11 Akim Demaille <demaille@gostai.com>
469
470 Use testsuite -C.
471 * tests/local.mk: Replace "cd && testsuite" by "testsuite -C".
472 Solves problems when top_srcdir is an absolute path.
473 Suggested by Eric Blake.
474 * configure.ac: Require Autoconf 2.62.
475
eeb29422
AD
4762008-12-11 Akim Demaille <demaille@gostai.com>
477
478 Simplify the i18n of the error messages.
479 * data/lalr1.cc: Comment changes.
480 * data/yacc.c (yysyntax_error): Rewrite, using a switch as in
481 lalr1.cc instead of building dynamically the format string.
482
6617622c
AD
4832008-12-08 Akim Demaille <demaille@gostai.com>
484
485 Fix portability issue in the test suite.
486 * tests/local.at (AT_MATCHES_CHECK): New.
487 Based on Perl instead of Sed. Sed has too many portability
488 pitfalls, not ever Sed is GNU Sed.
489 * tests/actions.at (Fix user actions without a trailing semicolon):
490 Use it.
491
2ca1136c
AD
4922008-12-08 Akim Demaille <demaille@gostai.com>
493
494 Update data/README.
495 * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
496
6c63b895
AD
4972008-12-08 Akim Demaille <demaille@gostai.com>
498
499 Install autoconf as a submodule to get m4sugar.
500 * .gitmodules: Add submodules/autoconf.
501 * data/m4sugar/foreach.m4, data/m4sugar/m4sugar.m4: Now links into
502 submodules/autoconf.
503
417e31d2
AD
5042008-12-08 Akim Demaille <demaille@gostai.com>
505
506 Test token.prefix in all the skeletons.
507 * data/java.m4 (b4_token_enum): Use the token.prefix.
508 * tests/local.at (AT_BISON_OPTION_PUSHDEFS): Define AT_TOKEN_PREFIX.
509 * tests/calc.at (_AT_DATA_CALC_Y): Use it.
510 Add checks for yacc.c, glr.c, lalr1.cc and glr.cc.
511 * tests/java.at: Comment changes.
512 (AT_CHECK_JAVA_MINIMAL): Define the END token.
513 (Java parser class and package names): Add token.prefix check.
514
97abf544
AD
5152008-12-08 Akim Demaille <demaille@gostai.com>
516
517 Fix regeneration of atconfig.
518 * tests/local.mk (tests/atconfig): The rule was incorrect, but
519 remove it: now that there is no tests/Makefile.am, the top-level
520 Makefile properly updates atconfig when needed.
521
e8cd1ad6
DJ
5222008-12-07 Di-an Jan <dianj@freeshell.org>
523
524 Implement the FIXME that ends an user action with a semicolon
525 if it seems necessary.
526 * src/scan-code.l (flex rules section): Flag cpp directive from
527 any `#' to the first unescaped end-of-line. Semicolon is not
528 needed after `;', `{', '}', or cpp directives and is needed after
529 any other token (whitespaces and comments have no effect).
530 * tests/actions.at (Fix user actions without a trailing semicolon):
531 New test.
532 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to
533 to make user actions complete statements.
534 Adjust column numbers in error messages.
535 * tests/regression.at (Fix user actions without a trailing semicolon):
536 Remove. Covered by new test.
537
ce9447fc
AD
5382008-12-07 Akim Demaille <demaille@gostai.com>
539
540 Update gnulib.
541 * gnulib: Update from master.
542
d333175f
EB
5432008-12-05 Eric Blake <ebb9@byu.net>
544
545 Avoid compiler warning.
546 * src/output.c (muscle_insert_item_number_table): Delete unused
547 function.
548
215b40ac
EB
5492008-12-02 Eric Blake <ebb9@byu.net>
550
551 Build testsuite with newer autoconf.
552 * tests/output.at (m4_expand): Don't override in newer autoconf,
553 where the underlying implementation changed.
554 * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
555 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
556 (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
557 (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
558 since some of them contain unbalanced ')'.
559
3bb21113
AD
5602008-12-01 Akim Demaille <demaille@gostai.com>
561
562 Use b4_symbol for printers and destructors everywhere.
563 * data/bison.m4 (b4_symbol_action_location): New.
564 * data/c.m4 (b4_symbol_actions): Remove.
565 Adjust all callers to use by b4_symbol_foreach and the corresponding
566 b4_symbol_printer/destructor macro.
567 * data/glr.cc: Adjust.
568 * data/lalr1.java: Adjust the %destructor sanity check.
569 * src/output.c (symbol_code_props_output): Remove, we no longer
570 need the b4_symbol_printers/destructors tables.
571
fb7c5b1f
AD
5722008-12-01 Akim Demaille <demaille@gostai.com>
573
574 Use b4_symbol_case_.
575 * data/lalr1.cc, data/bison.m4 (b4_symbol_action): Use
576 b4_symbol_case_.
577
cf6fb222
AD
5782008-12-01 Akim Demaille <demaille@gostai.com>
579
580 Move b4_symbol based macro to bison.m4.
581 * data/lalr1.cc (b4_symbol_, b4_symbol, b4_symbol_if)
582 (b4_symbol_action, b4_symbol_destructor, b4_symbol_printer)
583 (b4_symbol_case_, b4_symbol_foreach, b4_type_action_)
584 (b4_type_foreach): Move to...
585 * data/bison.m4: Here.
586 * data/lalr1.cc (b4_symbol_action): Specialize for C++: use
587 b4_symbol_value_template instead of b4_symbol_value.
cf6fb222 588
e3c52a63
AD
5892008-12-01 Akim Demaille <demaille@gostai.com>
590
591 b4_symbol/type_foreach.
592 * data/lalr1.cc (b4_symbol_foreach, b4_type_foreach): New.
593 Use them.
594
2bde9113
AD
5952008-12-01 Akim Demaille <demaille@gostai.com>
596
597 Use the symbol properties to output the printer/destructor for lalr1.cc.
30c10faf
AD
598 Instead of defining complex list of tuples to define various
599 properties of the symbols, we now prefer to define symbols as
600 "structs" in m4: using the symbol key (its number), and the
601 property name, b4_symbol gives it value. Use this to handle
602 destructors and printers.
603
2bde9113
AD
604 * src/output.c (CODE_PROP): New.
605 (prepare_symbol_definitions): Use it to define the printer and
606 destructor related attributes of the symbols.
607 * data/lalr1.cc (b4_symbol_actions): Rename as...
608 (b4_symbol_action): this.
609 Use b4_symbol instead of 6 arguments.
610 (b4_symbol_printer, b4_symbol_destructor): New.
611 Use them instead of b4_symbol_actions.
612
44494bf6
AD
6132008-12-01 Akim Demaille <demaille@gostai.com>
614
615 Avoid capturing variables too easily.
616 * src/muscle_tab.h (MUSCLE_INSERT_BOOL, MUSCLE_OBSTACK_SGROW): Use
617 v__ and p__ instead of v and p.
618
fad814bd
AD
6192008-12-01 Akim Demaille <demaille@gostai.com>
620
621 Remove spurious empty line before syncline.
622 * data/bison.m4 (b4_syncline): Don't output an empty line before
623 the output.
624
feda5527
AD
6252008-11-26 Akim Demaille <demaille@gostai.com>
626
627 Convert lib/Makefile.am into lib/local.mk.
628 The real problem is rather gnulib.mk, which itself is extracted
629 from a Makefile.am that gnulib expects to the "recursive". The
630 tool prefix-gnulib-mk converts such a gnulib.mk to be
631 non-recursive. Also, some AC_SUBST variables need to be adjusted.
632
633 * etc/prefix-gnulib-mk: New.
634 * bootstrap (slurp): Use it to convert further gnulib.mk.
635 No longer try to avoid re-creation of lib/gnulib.mk as the changes
636 are deeper.
637 * lib/Makefile.am: Rename as...
638 * lib/local.mk: this.
639 Adjust to be prefixed.
640 * Makefile.am, configure.ac: Adjust.
641 * src/local.mk (AM_CPPFLAGS): Extend it, don't define it.
642
56ddee7f
AD
6432008-11-26 Akim Demaille <demaille@gostai.com>
644
645 s/_FLAGS/FLAGS/.
646 * tests/local.mk (TESTSUITE_FLAGS, AUTOTEST_FLAGS): Rename as...
647 (TESTSUITEFLAGS, AUTOTESTFLAGS): these to compy with the GCS.
648 Reported by Eric Blake.
649
728e89a0
AD
6502008-11-26 Akim Demaille <demaille@gostai.com>
651
652 Use b4_parser_tables_define in glr.cc.
653 * data/glr.c: Use b4_parser_tables_define instead of defining the
654 (deterministic integral) tables by hand.
655
2c1bf9bd
AD
6562008-11-26 Akim Demaille <demaille@gostai.com>
657
658 Use b4_parser_tables_define in Java.
659 * data/java.m4 (b4_typed_parser_table): Rename as...
660 (b4_typed_parser_table_define): this, for consistency.
661 Accept a comment as $4.
662 Move $2 into yy*_.
663 (b4_integral_parser_table): Rename as...
664 (b4_integral_parser_table_define): this.
665 * data/lalr1.java: Adjust all uses.
666 Use b4_parser_tables_define instead of generation by hand.
667
ba206cf4
AD
6682008-11-26 Akim Demaille <demaille@gostai.com>
669
670 Prepare the convergence bw C style and Java table generation.
671 * data/bison.m4 (b4_tables_map, b4_tables_declare)
672 (b4_tables_define): Rename as...
673 (b4_integral_parser_tables_map, b4_parser_tables_declare)
674 (b4_parser_tables_define): these.
675 * data/c.m4 (b4_table_define): Rename as...
676 (b4_integral_parser_table_define): this.
677 * data/lalr1.cc: Adjust.
678 (b4_table_define, b4_table_declare): Rename as...
679 (b4_integral_parser_table_define)
680 (b4_integral_parser_table_declare): these.
681 (yyrline_): Move the comment where it is actually used.
682 * data/yacc.c: Adjust.
683 (yyrline): Use b4_integral_parser_table_define.
684
d12f8e49
AD
6852008-11-26 Akim Demaille <demaille@gostai.com>
686
687 Regen.
688 * src/parse-gram.h, src/parse-gram.c: Regen.
689
0991e29b
AD
6902008-11-26 Akim Demaille <demaille@gostai.com>
691
692 Factor the generation of the (integral) tables bw yacc.c and lalr1.cc.
693 * data/lalr1.cc (b4_tables_map): Move to...
694 * data/bison.m4: here.
695 Update the comment for yytable during the flight.
696 (b4_tables_declare, b4_tables_define): New.
697 * data/lalr1.cc: Use them.
698 * data/c.m4 (b4_table_define): New.
699 * data/yacc.c: Use b4_tables_define instead of output the tables
700 by hand.
701 * tests/regression.at (Web2c Actions): Adjust the expected output,
702 the order of the tables changed.
703
3d3bc1fe
AD
7042008-11-26 Akim Demaille <demaille@gostai.com>
705
706 Get rid of (yy)rhs and (yy)prhs.
707 These tables are no longer needed in the parsers, and they don't seem to
708 be useful. They are not documented either.
feda5527 709
3d3bc1fe
AD
710 * src/output.c (prepare_rules): Get rid of rhs and prhs.
711 Adjust the computation of (yy)r2.
712
08c81469
AD
7132008-11-26 Akim Demaille <demaille@gostai.com>
714
715 Rule length is unsigned.
716 * src/gram.h, src/gram.c (rule_rhs_length): Return a size_t.
717
932b0c96
AD
7182008-11-26 Akim Demaille <demaille@gostai.com>
719
720 Get rid of lalr1-split.cc.
721 It was no longer maintainer.
feda5527 722
932b0c96
AD
723 * data/lalr1-split.cc: Remove.
724 * etc/bench.pl.in (bench_fusion_parser): Remove.
725 Adjust.
726
8452c667
AD
7272008-11-26 Akim Demaille <demaille@gostai.com>
728
729 Use yy* consistently.
730 * data/glr.c: Now that yyrhs no longer exists as a global
731 variable, rename local "rhs" variables into "yyrhs" for
732 consistency.
733
783aa653
AD
7342008-11-25 Akim Demaille <demaille@gostai.com>
735
736 Get rid of yyrhs and yyprhs in glr.c.
737 * data/glr.c (yyrhs, yyprhs): Remove.
738 Instead, use the state stack and yystos.
739
6130b755
AD
7402008-11-25 Akim Demaille <demaille@gostai.com>
741
742 Flag glr tests.
743 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): If glr, declare it
744 as an Autotest keyword.
745
95a7b1c9
AD
7462008-11-25 Akim Demaille <demaille@gostai.com>
747
748 Prefer TESTSUITE_FLAGS.
749 TESTSUITEFLAGS is barely readable.
feda5527 750
95a7b1c9
AD
751 * tests/local.mk (TESTSUITE_FLAGS): Default to $(TESTSUITEFLAGS)
752 for backward compatibility.
753 Use the former instead of the latter.
754
b4f18401
AD
7552008-11-25 Akim Demaille <demaille@gostai.com>
756
757 Get rid of yyrhs and yyprhs in larl1.java.
758 * data/lalr1.java (yyrhs_, yyprhs_): Remove.
759 (yy_reduce_print): Rather, use yystos_ and the state stack.
760
c265fd6b
AD
7612008-11-25 Akim Demaille <demaille@gostai.com>
762
763 Formatting changes.
764
68dbdee8
AD
7652008-11-25 Akim Demaille <demaille@gostai.com>
766
767 Get rid of yyrhs and yyprhs in yacc.c.
30c10faf
AD
768 They were used to get the symbol types, given a rule number, when
769 displaying the top of the stack before a reduction. But the
770 symbol type is available from the state stack. This has two be
771 benefits: two tables less in the parser (making it smaller), and a
772 more consistent use of the three stacks which will help to fuse
773 them.
feda5527 774
68dbdee8
AD
775 * data/yacc.c (yyprhs, yyrhs): Remove.
776 (YY_REDUCE_PRINT): Pass yyssp to yy_reduce_print.
777 (yy_reduce_print): Take yyssp as argument.
778 Use it, together with yystos, to get the symbol type.
779 * tests/regression.at (Web2c Report): Remove these tables from the
780 expected output.
781
6ab1adbe
AD
7822008-11-25 Akim Demaille <demaille@gostai.com>
783
784 b4_tables_map.
785 The point is to factor the generation of the tables across skeletons.
786 This is language dependant.
feda5527 787
6ab1adbe
AD
788 * data/c.m4 (b4_comment_): New.
789 Should be usable to define how to generate tables independently of
790 the language.
791 (b4_c_comment): New.
792 (b4_comment): Bounce to b4_c_comment.
793 Now support $2 = [PREFIX] for indentation.
794 * data/lalr1.cc (b4_table_declare): Don't output a comment if
795 there is no comment.
796 Indent it properly when there is one.
797 Output the ending semicolon.
798 (b4_table_define): Space changes.
799 Output the ending semicolon.
800 (b4_tables_map): New.
801 Use it twice instead of declaring and defining the (integral)
802 tables by hand.
803
0fddb3d5
AD
8042008-11-25 Akim Demaille <demaille@gostai.com>
805
806 b4_table_declare.
807 * data/lalr1.cc (b4_table_declare): New.
808 Use it to declare the tables defined with b4_table_define.
809 (b4_table_define): Declare a third arg to match b4_table_declare
810 signature.
811 Move all the comments around invocations of b4_table_define into
812 the invocations itselves.
813 Move things around to have the order for declarations and
814 definitions.
815
c4ddc0fb
AD
8162008-11-25 Akim Demaille <demaille@gostai.com>
817
818 Formatting changes.
819 * data/lalr1.java: here.
820
e0c653e7
AD
8212008-11-25 Akim Demaille <demaille@gostai.com>
822
823 b4_args is more general than only C++.
824 * data/lalr1.cc (b4_args, _b4_args): Move to...
825 * data/bison.m4: here.
826
4182a0a1
DJ
8272008-11-21 Di-an Jan <dianj@freeshell.org>
828
829 Implement no-XXX arguments for --warnings, --report, --trace.
830 * src/getargs.c (flags_argmatch): Handles no-XXX.
831 Fix typo in doxygen comment.
832
01466c3e
AD
8332008-11-21 Akim Demaille <demaille@gostai.com>
834
835 Display the changes in cross-options.texi.
836 * build-aux/cross-options.pl ($sep): New, to separate items.
837 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Use diff to display the
838 changes.
839
a7c09cba
DJ
8402008-11-20 Di-an Jan <dianj@freeshell.org>
841
842 Improves options in the manual.
843 * doc/bison.texinfo (-g, -x): Add space before argument.
844 (Option Cross Key): Implement FIXME: listing directives also.
845 * build-aux/cross-options.pl: Read from <STDIN> rather than <>.
846 (Short Option): Special case -d. Put arguments inside @option.
feda5527 847 (Bison Directive): Add column, automatically extracted from
a7c09cba
DJ
848 src/scan-gram.l (actual name passed as the first argument)
849 with special case for %define.
850 * doc/local.mk (doc/cross-options.texi): Pass src/scan-gram.l
851 to build-aux/cross-options.pl.
852 * src/getargs.c (usage): Document limitations of cross-options.pl.
853 * src/scan-gram.l: Likewise.
854
6c88b51e
JD
8552008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
856
857 Fix unexpanded macros in GLR defines file.
858 Reported by Csaba Raduly at
859 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
860 * THANKS (Csaba Raduly): Add.
861 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
862 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
863 lexer in a separate module that includes the defines file.
864 (AT_CHECK_CALC): From AT_FULL_COMPILE, request compilation of lexer
865 source.
866 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
867 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
868 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
869 (AT_DATA_SOURCE_PROLOGUE): New.
870 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
871 (AT_DATA_SOURCE): New.
872 (AT_FULL_COMPILE): Extend to support an additional source file.
873
1e034807
AD
8742008-11-18 Akim Demaille <demaille@gostai.com>
875
876 More TODO.
877 * TODO: More short term issues.
878
e3dda35c
AD
8792008-11-18 Akim Demaille <demaille@gostai.com>
880
881 Regen.
882 * src/parse-gram.h, src/parse-gram.c: Regen.
883
bd187d7b
AD
8842008-11-18 Akim Demaille <demaille@gostai.com>
885
886 Use b4_subtract where possible.
887 * data/lalr1.cc (b4_subtract): Move to...
888 * data/bison.m4: here.
889 * data/glr.c (b4_rhs_data): Use it.
890 * data/yacc.c (b4_rhs_value, b4_rhs_location): Use it.
891
6085ab0d
AD
8922008-11-18 Akim Demaille <demaille@gostai.com>
893
894 Remove incorrect mode specification.
895 * data/glr.cc: Don't pretend it's C code.
896
9ce405ce
JD
8972008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
898
899 Simplify last patch slightly.
900 * src/getargs.c (getargs): Here.
901
a8beef7e
JD
9022008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
903
904 Fix last warning from --enable-gcc-warnings.
905 * src/getargs.c (getargs): Don't assign const address to non-const
906 pointer.
907
d50eea6d
JD
9082008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
909
910 Don't let maintainer-*-check targets force a version update.
911 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
912 handled.
913
f5f419de
DJ
9142008-11-17 Di-an Jan <dianj@freeshell.org>
915
916 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
917 Align menus. Adjust word wrapping. Use node names for menu names.
918 (Examples): Don't abbreviate node names.
919 (LocalWords): Remove abbreviations.
920 (Copying): Make description a sentence.
d50eea6d 921 (Java Action Features): Remove period to match the rest of menu.
f5f419de 922
d73e55e0
DJ
9232008-11-17 Di-an Jan <dianj@freeshell.org>
924
925 Handles several --enable-gcc-warnings.
926 * src/getargs.c (command_line_location): Set parameters to void.
927 * src/output.c (symbol_type_name_cmp): Make static.
928 (symbols_by_type_name): Set parameters to void.
929 (symbol_definitions_output): Remove unused parameter. Rename as...
930 (prepare_symbol_definitions): this.
931 (muscles_output): Move symbol_definitions_output to...
932 (output): here as prepare_symbol_definitions.
933 * tests/c++.at (AT_CHECK_VARIANTS): Remove unused parameters of main.
d50eea6d 934 (AT_CHECK_NAMESPACE): Make unused parameter lloc unnamed.
d73e55e0 935
68c989de
DJ
9362008-11-17 Di-an Jan <dianj@freeshell.org>
937
938 * tests/c++.at (AT_CHECK_VARIANTS): Fixes tests 198-202.
939 Use AT_DATA_GRAMMAR instead of AT_DATA for compiled tests.
940
23ce6f4c
AD
9412008-11-16 Akim Demaille <demaille@gostai.com>
942
943 Add missing $(EXEEXT).
944 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): The target is
945 "src/bison$(EXEEXT)".
946 Reported by Di-an Jan.
947
dd704c35
AD
9482008-11-15 Akim Demaille <demaille@gostai.com>
949
950 * TODO: Update.
951
dab244d5
AD
9522008-11-15 Akim Demaille <demaille@gostai.com>
953
954 Formatting changes.
955 * tests/input.at: here.
956
4b4da9fb
AD
9572008-11-15 Akim Demaille <demaille@gostai.com>
958
959 Remove duplicate header inclusion.
960 * src/LR0.c: here.
961
4ea3f53d
AD
9622008-11-15 Akim Demaille <demaille@gostai.com>
963
964 * src/parse-gram.h, src/parse-gram.c: Regen.
965
cb823b6f
AD
9662008-11-15 Akim Demaille <demaille@gostai.com>
967
968 Support parametric types.
b06df3c2
AD
969
970 There are two issues to handle: first scanning nested angle
971 bracket pairs to support types such as std::pair< std::string,
972 std::list<std::string> > >.
973
974 Another issue is to address idiosyncracies of C++: do not glue two
975 closing angle brackets together (otherwise it's operator>>), and
976 avoid sticking blindly a TYPE to the opening <, as it can result
977 in '<:' which is a digraph for '['.
978
cb823b6f
AD
979 * src/scan-gram.l (brace_level): Rename as...
980 (nesting): this.
981 (SC_TAG): New.
982 Implement support for complex tags.
b06df3c2 983 (tag): Accept
cb823b6f
AD
984 , but not <.
985 * data/lalr1.cc (b4_symbol_value, b4_symbol_value_template)
986 (b4_symbol_variant): Leave space around types as parameters.
987 * examples/variant.yy: Use nested template types and leading ::.
988 * src/parse-gram.y (TYPE, TYPE_TAG_ANY, TYPE_TAG_NONE, type.opt):
989 Rename as...
990 (TAG, TAG_ANY, TAG_NONE, tag.opt): these.
991 * tests/c++.at: Test parametric types.
992
7b6e6753
AD
9932008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
994
995 Test token.prefix.
996 This is not sufficient, but we test at least that the make_SYMBOL
997 interface is not affected by token.prefix. A more general test
998 will be implemented when the support of token.prefix is generalized
999 to more skeletons.
b06df3c2 1000
7b6e6753
AD
1001 * tests/c++.at: One more variant test, using token.prefix.
1002
dddec537
AD
10032008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
1004
1005 Test the make_TOKEN interface.
1006 * tests/c++.at (AT_CHECK_VARIANTS): Require and use locations.
1007 Factor the common code in yylex.
1008 Use it to test "%define lex_symbol".
1009
7d3e21ba
AD
10102008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
1011
1012 Formatting change.
1013
4fc55348
AD
10142008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
1015
1016 Simplify code for variants bench marks.
1017 * etc/bench.pl.in (&generate_grammar_list): Define and use
1018 location_type.
1019 Factor the common code in yylex.
1020
070e6509
AD
10212008-11-15 Akim Demaille <demaille@gostai.com>
1022
1023 Better error message.
1024 * bootstrap (find_tool): Fix the error message.
1025
0078681b
AD
10262008-11-15 Akim Demaille <demaille@gostai.com>
1027
1028 Update variant.yy to newest interface.
1029 * examples/variant.yy: Define lex_symbol.
1030 Adjust.
1031
ff084799
AD
10322008-11-15 Akim Demaille <demaille@gostai.com>
1033
1034 Don't use locations in variant.yy.
1035 * examples/variant.yy: Adjust to not using locations.
1036
b0d79ec6
AD
10372008-11-15 Akim Demaille <demaille@gostai.com>
1038
1039 Comment changes.
1040 * data/local.mk, etc/local.mk, examples/local.mk: Use Automake
1041 comments for the license.
1042
d4977ce3
AD
10432008-11-15 Akim Demaille <demaille@gostai.com>
1044
1045 Remove tests/Makefile.am.
1046 * tests/Makefile.am: Rename as...
1047 * tests/local.mk: this.
1048 * Makefile.am, configure.ac: Adjust.
1049 * Makefile.am (DISTCLEANFILES): Define.
1050 (maintainer-check, maintainer-xml-check, maintainer-push-check):
1051 Remove, we no longer need to bounce to the real targets.
1052
87f1149a
AD
10532008-11-15 Akim Demaille <demaille@gostai.com>
1054
1055 Comment changes.
1056
36415906
AD
10572008-11-15 Akim Demaille <demaille@gostai.com>
1058
1059 djgpp/local.mk.
1060 * Makefile.am (EXTRA_DIST): Move djgpp related part to...
1061 * djgpp/local.mk: this new file.
1062
e2c2f696
AD
10632008-11-15 Akim Demaille <demaille@gostai.com>
1064
1065 Remove doc/Makefile.am.
1066 * doc/Makefile.am: Rename as...
1067 * doc/local.mk: this.
1068 Adjust paths
1069 * Makefile.am, configure.ac: Adjust.
1070 * Makefile.am (MOSTLYCLEANFILES): New.
1071 * src/local.mk: Adjust.
1072
2ead32e6
AD
10732008-11-15 Akim Demaille <demaille@gostai.com>
1074
1075 Move sc_tight_scope into maint.mk.
b06df3c2
AD
1076 It does not work, and I don't know how it was supposed to work: it
1077 seems to be looking for sources in the build tree. I just moved
1078 it at a better place, fixing it is still required.
1079
2ead32e6
AD
1080 * src/local.mk (echo): Remove.
1081 (sc_tight_scope): Move to...
1082 * maint.mk: here.
1083
2df9ec37
AD
10842008-11-15 Akim Demaille <demaille@gostai.com>
1085
1086 Regen.
1087 * src/parse-gram.h, src/parse-gram.h: Regen.
1088
0305d25e
AD
10892008-11-15 Akim Demaille <demaille@gostai.com>
1090
1091 Remove src/Makefile.am.
1092 * src/Makefile.am: Rename as...
1093 * src/local.mk: this.
1094 Prefix all the paths with src/.
1095 (AUTOMAKE_OPTIONS): Build object files in the sub dirs.
1096 (AM_CPPFLAGS): Find find in builddir/src.
1097 (YACC): Move the flags into...
1098 (AM_YFLAGS): here.
1099 * maint.mk (sc_tight_scope): Disable.
1100 It used to bounce to the version in src/Makefile.am which is now
1101 part of this very Makefile.
1102 * Makefile.am, configure.ac: Adjust.
1103 * src/scan-code-c.c, src/scan-code.l: We can no longer rely on
1104 include "..." to find files "here": we are no longer in src/, so
1105 qualify the includes with src/.
1106 * doc/Makefile.am (PREPATH): No longer include the top_builddir
1107 prefix.
1108 (.x.1): Adjust to be able to create src/foo from the top level
1109 Makefile, instead of going bounce to src/Makefile the creation of
1110 foo.
1111
5277c0a3
AD
11122008-11-15 Akim Demaille <demaille@gostai.com>
1113
1114 Remove useless variable.
1115 * doc/Makefile.am (srcsrcdir): Remove.
1116
6a5aa0cd
AD
11172008-11-15 Akim Demaille <demaille@gostai.com>
1118
1119 Remove data/Makefile.am.
1120 * data/Makefile.am: Rename as...
1121 * data/local.mk: this.
1122 Adjust paths.
1123 * Makefile.am, configure.ac: Adjust.
1124
7cb794dc
AD
11252008-11-15 Akim Demaille <demaille@gostai.com>
1126
1127 Remove etc/Makefile.am.
1128 * etc/Makefile.am: Rename as...
1129 * etc/local.mk: this.
1130 Adjust.
1131 * Makefile.am, configure.ac: Adjust.
1132
cd409e3b
AD
11332008-11-15 Akim Demaille <demaille@gostai.com>
1134
1135 Remove examples/local.mk.
1136 examples/calc++/Makefile.am might be interesting to keep as is, since
1137 it is an example in itself.
2df9ec37 1138
cd409e3b
AD
1139 * examples/Makefile.am: Rename as...
1140 * examples/local.mk: this.
1141 Adjust.
1142 * Makefile.am, configure.ac: Adjust.
1143
9a1e4214
AD
11442008-11-15 Akim Demaille <demaille@gostai.com>
1145
1146 Remove build-aux/Makefile.am.
1147 Recursive Makefiles are really way too slow, let's get rid of some of
1148 them.
2df9ec37 1149
9a1e4214
AD
1150 * build-aux/Makefile.am: Rename as...
1151 * build-aux/local.mk: this.
1152 Adjust paths.
1153 * Makefile.am, configure.ac: Adjust.
1154
0634493c
AD
11552008-11-15 Akim Demaille <demaille@gostai.com>
1156
1157 Provide convenience constructors for locations and positions.
1158 * data/location.cc (position::position): Accept file, line and
1159 column as arguments with default values.
1160 Always qualify initial line and column literals as unsigned.
1161 (location::location): Provide convenience constructors.
1162
fe1b448a
AD
11632008-11-15 Akim Demaille <demaille@gostai.com>
1164
b06df3c2
AD
1165 Instead of using make_symbol<TOK_FOO>, generate make_FOO for each
1166 token type.
fe1b448a
AD
1167 Using template buys us nothing, and makes it uselessly complex to
1168 construct a symbol. Besides, it could not be generalized to other
1169 languages, while make_FOO would work in C/Java etc.
2df9ec37 1170
fe1b448a
AD
1171 * data/lalr1.cc (b4_symbol_): New.
1172 (b4_symbol): Use it.
1173 (b4_symbol_constructor_declaration_)
1174 (b4_symbol_constructor_definition_): Instead of generating
1175 specializations of an overloaded template function, just generate
1176 several functions whose names are forged from the token names
1177 without the token.prefix.
1178 (b4_symbol_constructor_declarations): Generate them for all the
1179 symbols, not just by class of symbol type, now that instead of
1180 specializing a function template by the token, we generate a
1181 function named after the token.
1182 (b4_symbol_constructor_specialization_)
1183 (b4_symbol_constructor_specializations): Remove.
1184 * etc/bench.pl.in: Adjust to this new API.
1185
5679f311
AD
11862008-11-13 Akim Demaille <demaille@gostai.com>
1187
1188 %define token.prefix.
b06df3c2
AD
1189 Provide a means to add a prefix to the name of the tokens as
1190 output in the generated files. Because of name clashes, it is
1191 good to have such a prefix such as TOK_ that protects from names
1192 such as EOF, FILE etc. But it clutters the grammar itself.
2df9ec37 1193
5679f311
AD
1194 * data/bison.m4 (token.prefix): Empty by default.
1195 * data/c.m4 (b4_token_enum, b4_token_define): Use it.
1196 * data/lalr1.cc (b4_symbol): Ditto.
1197
3204049e
AD
11982008-11-13 Akim Demaille <demaille@gostai.com>
1199
1200 Compute at M4 time some of the subtractions.
90290ce5 1201 * data/lalr1.cc (b4_subtract): New.
3204049e
AD
1202 (b4_rhs_data): Use it.
1203
202598d3
AD
12042008-11-13 Akim Demaille <demaille@gostai.com>
1205
1206 symbol::token.
b06df3c2 1207 This allows the user to get the type of a token returned by yylex.
2df9ec37 1208
202598d3
AD
1209 * data/lalr1.cc (symbol::token): New.
1210 (yytoknum_): Define when %define lex_symbol, independently of
1211 %debug.
1212 (yytoken_number_): Move into...
1213 (symbol::token): here, since that's the only use.
1214 The other one is YYPRINT which was not officially supported
1215 by lalr1.cc, and anyway it did not work since YYPRINT uses this
1216 array under a different name (yytoknum).
1217
fc2476c7
AD
12182008-11-13 Akim Demaille <demaille@gostai.com>
1219
1220 YYERRCODE.
1221 * TODO (YYERRCODE): Mention the case of $undef.
1222
865f1e9f
AD
12232008-11-13 Akim Demaille <demaille@gostai.com>
1224
1225 TODO: YYPRINT.
1226 * TODO (YYPRINT): New.
1227
cb0b136a
AD
12282008-11-13 Akim Demaille <demaille@gostai.com>
1229
1230 Comment changes.
1231 * data/lalr1.cc, data/yacc.c: Fix the description of the
1232 yytranslate and yytoknum tables.
1233
2c086d29
AD
12342008-11-13 Akim Demaille <demaille@gostai.com>
1235
1236 Define make_symbol in the header.
b06df3c2
AD
1237 To reach good performances these functions should be inlined (yet
1238 this is to measure precisely). To this end they must be available
1239 to the caller.
2df9ec37 1240
2c086d29
AD
1241 * data/lalr1.cc (b4_symbol_constructor_definition_): Qualify
1242 location_type with the class name.
1243 Since will now be output in the header, declare "inline".
1244 No longer use b4_symbol_constructor_specializations, but
1245 b4_symbol_constructor_definitions in the header.
1246 Don't call it in the *.cc file.
1247
1c4af381
AD
12482008-11-13 Akim Demaille <demaille@gostai.com>
1249
1250 Define yytranslate in the header for lex_symbol.
1251 * data/lalr1.cc: Move the invocation of b4_yytranslate_definition
1252 into the header file when using %define lex_symbol.
1253 (yytranslate_): Declare inline.
1254
e51b0a82
AD
12552008-11-13 Akim Demaille <demaille@gostai.com>
1256
b06df3c2
AD
1257 Define the constructors of symbol_type in
1258 b4_symbol_constructor_definitions.
e51b0a82 1259 The constructors are called by the make_symbol functions, which a
b06df3c2
AD
1260 forthcoming patch will move elsewhere. Hence the interest of
1261 putting them together.
2df9ec37 1262
b06df3c2
AD
1263 The stack_symbol_type does not need to be moved, it is used only
1264 by the parser.
2df9ec37 1265
e51b0a82
AD
1266 * data/lalr1.cc: Move symbol_type and symbol_base_type
1267 constructors into...
1268 (b4_symbol_constructor_definitions): here.
1269 Adjust.
1270
78835571
AD
12712008-11-13 Akim Demaille <demaille@gostai.com>
1272
1273 Make it easier to move the definition of yytranslate_.
1274 Forthcoming changes will make it possible to use yytranslate_
1275 from outside the parser implementation file.
2df9ec37 1276
78835571
AD
1277 * data/lalr1.cc (b4_yytranslate_definition): New.
1278 Use it.
1279
c1e6c88c
AD
12802008-11-13 Akim Demaille <demaille@gostai.com>
1281
1282 Remove useless class specification.
1283 * data/lalr1.cc (b4_symbol_constructor_specialization_): No need
1284 to refer to the class name to use a type defined by the class for
1285 arguments of member functions.
1286
4654b0c0
AD
12872008-11-13 Akim Demaille <demaille@gostai.com>
1288
1289 Finer input type for yytranslate.
1290 This patch is debatable: the tradition expects yylex to return an int
1291 which happens to correspond to token_number (which is an enum). This
1292 allows for instance to return characters (such as '*' etc.). But this
1293 goes against the stronger typing I am trying to have with the new
1294 lex interface which return a symbol_type. So in this case, feed
1295 yytranslate_ with a token_type.
2df9ec37 1296
4654b0c0
AD
1297 * data/lalr1.cc (yytranslate_): When in %define lex-symbol,
1298 expect a token_type.
1299
dd735e4e
AD
13002008-11-13 Akim Demaille <demaille@gostai.com>
1301
1302 Honor lex-params in %define lex_symbol mode.
1303 * data/lalr1.cc: Use b4_lex_param.
1304
6659366c
AD
13052008-11-13 Akim Demaille <demaille@gostai.com>
1306
1307 Simplify names.
1308 * src/output.c (symbol_definitions_output): Rename symbol
1309 attributes type_name and has_type_name as type and has_type.
1310 * data/lalr1.cc: Adjust uses.
1311
e9805e57
AD
13122008-11-13 Akim Demaille <demaille@gostai.com>
1313
1314 Use b4_type_names for the union type.
b06df3c2
AD
1315 The union used to compute the size of the variant used to iterate
1316 over the type of all the symbols, with a lot of redundancy. Now
1317 iterate over the lists of symbols having the same type-name.
2df9ec37 1318
e9805e57
AD
1319 * data/lalr1.cc (b4_char_sizeof_): New.
1320 (b4_char_sizeof): Use it.
1321 Adjust to be called with a list of numbers instead of a single
1322 number.
1323 Adjust its caller for new-line issues.
1324
aea10ef4
AD
13252008-11-13 Akim Demaille <demaille@gostai.com>
1326
1327 Define the "identifier" of a symbol.
b06df3c2
AD
1328 Symbols may have several string representations, for instance if
1329 they have an alias. What I call its "id" is a string that can be
1330 used as an identifier. May not exist.
2df9ec37 1331
b06df3c2
AD
1332 Currently the symbols which have the "tag_is_id" flag set are
1333 those that don't have an alias. Look harder for the id.
2df9ec37 1334
aea10ef4
AD
1335 * src/output.c (is_identifier): Move to...
1336 * src/symtab.c (is_identifier): here.
1337 * src/symtab.h, src/symtab.c (symbol_id_get): New.
1338 * src/output.c (symbol_definitions_output): Use it to define "id"
1339 and "has_id".
1340 Remove the definition of "tag_is_id".
1341 * data/lalr1.cc: Use the "id" and "has_id" whereever "tag" and
1342 "tag_is_id" were used to produce code.
1343 We still use "tag" for documentation.
1344
2ea7730c
AD
13452008-11-11 Akim Demaille <demaille@gostai.com>
1346
1347 Locations are no longer required by lalr1.cc.
1348 * data/lalr1.cc (_b4_args, b4_args): New.
1349 Adjust all uses of locations to make them optional.
1350 * tests/c++.at (AT_CHECK_VARIANTS): No longer use the locations.
1351 (AT_CHECK_NAMESPACE): Check the use of locations.
1352 * tests/calc.at (_AT_DATA_CALC_Y): Adjust to be usable with or
1353 without locations with lalr1.cc.
1354 Test these cases.
1355 * tests/output.at: Check lalr1.cc with and without location
1356 support.
1357 * tests/regression.at (_AT_DATA_EXPECT2_Y, _AT_DATA_DANCER_Y):
1358 Don't use locations.
1359
7ca2266a
AD
13602008-11-11 Akim Demaille <demaille@gostai.com>
1361
1362 AT_FULL_COMPILE.
1363 * tests/local.at (AT_FULL_COMPILE): New.
1364 * tests/actions.at, tests/calc.at, tests/regression.at: Use it.
1365
1a7a65f9
AD
13662008-11-11 Akim Demaille <demaille@gostai.com>
1367
1368 Support parens in calc++.
1369 * doc/bison.texinfo (Calc++ Scanner, Calc++ Parser): Support parens.
1370 * examples/calc++/test (run): Check the expected output.
1371 Adjust callers.
1372 Check parens too.
1373
c944f7f2
AD
13742008-11-11 Akim Demaille <demaille@gostai.com>
1375
1376 Simplify lalr1.cc since %defines is mandatory.
1377 * data/lalr1.cc: Remove useless calls to b4_defines_if.
1378
dada3cd1
AD
13792008-11-11 Akim Demaille <demaille@gostai.com>
1380
1381 TODO: yyfmt.
1382 * TODO (yysyntax_error): New item.
1383
422c18f4
AD
13842008-11-11 Akim Demaille <demaille@gostai.com>
1385
1386 Prefer M4 to CPP.
1387 * data/lalr1.cc: Use b4_error_verbose_if instead of #if
1388 YYERROR_VERBOSE.
1389
a0ffc175
AD
13902008-11-11 Akim Demaille <demaille@gostai.com>
1391
1392 Support i18n of the parse error messages.
1393 * TODO (lalr1.cc/I18n): Remove.
1394 * data/lalr1.cc (yysyntax_error_): Support the translation of the
1395 error messages, as done in yacc.c.
1396 Stay within the yy* pseudo namespace.
1397
00a8a083
AD
13982008-11-11 Akim Demaille <demaille@gostai.com>
1399
1400 More TODO.
1401 * TODO (single stack, yysyntax_error): New.
1402
09277875
AD
14032008-11-11 Akim Demaille <demaille@gostai.com>
1404
1405 Make it possible to return a symbol_type from yylex.
1406 * data/lalr1.cc (b4_lex_symbol_if): New.
1407 (parse): When lex_symbol is defined, expected yylex to return the
1408 complete lookahead.
1409 * etc/bench.pl.in (generate_grammar_list): Extend to support this
1410 yylex interface.
1411 (bench_variant_parser): Exercise it.
1412
64c1b92a
AD
14132008-11-11 Akim Demaille <demaille@gostai.com>
1414
1415 Remove useless bench case.
1416 * etc/bench.pl.in (bench_variant_parser): VARIANT_DESTROY is
1417 no longer used.
1418
2722aa42
AD
14192008-11-11 Akim Demaille <demaille@gostai.com>
1420
1421 Improve display of directives.
1422 * etc/bench.pl.in (parse_term): Don't add useless eol.
1423
918eb7c5
AD
14242008-11-11 Akim Demaille <demaille@gostai.com>
1425
1426 Use string_cast in the bench.
1427 * etc/bench.pl.in (generate_grammar_list): Define and use
1428 string_cast.
1429
39be9022
AD
14302008-11-11 Akim Demaille <demaille@gostai.com>
1431
1432 Replace yychar with a Boolean.
1433 * data/lalr1.cc (parse::yychar): Replace by...
1434 (parse::yyempty): this.
1435
a2e3fa77
AD
14362008-11-11 Akim Demaille <demaille@gostai.com>
1437
1438 Factor the tables.
1439 * TODO: New item.
1440
aba12ad1
AD
14412008-11-11 Akim Demaille <demaille@gostai.com>
1442
1443 Let yytranslate handle the eof case.
1444 * data/lalr1.cc (yytranslate_): Handle the EOF case.
1445 Adjust callers.
1446 No longer expect yychar to be equal to yyeof_, rather, test the
1447 lookahead's (translated) kind.
1448
27cb5b59
AD
14492008-11-11 Akim Demaille <demaille@gostai.com>
1450
1451 yychar cannot be empty in yyerrlab.
1452 * TODO (yychar == yyempty_): New.
1453 * data/lalr1.cc: Remove the handling of this case.
1454 This eases forthcoming changes related to yychar and yytranslate.
1455
fce629c0
AD
14562008-11-11 Akim Demaille <demaille@gostai.com>
1457
1458 Bench: syntactic sugar for %define/#define.
1459 * etc/bench.pl.in (parse_dirs): Support %d and #d with arguments.
1460 (&bench_push_parser, bench_variant_parser): Use this feature.
1461 (&eat): New.
1462 Use it.
1463
ce671960
AD
14642008-11-11 Akim Demaille <demaille@gostai.com>
1465
1466 Less memory pressure on the "list" bench.
1467 * etc/bench.pl.in (generate_grammar_list): Do not accumulate all
1468 the values, to limit memory pressure.
1469
2873fdf8
AD
14702008-11-11 Akim Demaille <demaille@gostai.com>
1471
1472 Introduce make_symbol.
b06df3c2
AD
1473 make_symbol provides a means to construct a full symbol (kind,
1474 value, location) in a single shot. It is meant to be a Symbol
1475 constructor, parameterized by the symbol kind so that overloading
1476 would prevent incorrect kind/value pairs. Unfortunately
1477 parameterized constructors do not work well in C++ (unless the
1478 parameter also appears as an argument, which is not acceptable),
1479 hence the use of a function instead of a constructor.
2df9ec37 1480
2873fdf8
AD
1481 * data/lalr1.cc (b4_symbol_constructor_declaration_)
1482 (b4_symbol_constructor_declarations)
1483 (b4_symbol_constructor_specialization_)
1484 (b4_symbol_constructor_specializations)
1485 (b4_symbol_constructor_definition_)
1486 (b4_symbol_constructor_definitions): New.
1487 Use them where appropriate to generate declaration, declaration of
1488 the specializations, and implementations of the templated
1489 overloaded function "make_symbol".
1490 (variant::variant): Always define a default ctor.
1491 Also provide a copy ctor.
1492 (symbol_base_type, symbol_type): New ctor overloads for value-less
1493 symbols.
1494 (symbol_type): Now public, so that functions such as yylex can use
1495 it.
1496
8be046d7
AD
14972008-11-11 Akim Demaille <demaille@gostai.com>
1498
1499 Inform m4 whether a tag is a valid id.
1500 * src/output.c (is_identifier): New.
1501 (symbol_definitions_output): Use it to define tag_is_id.
1502 But maybe this should be done at m4 level?
1503
de62edee
AD
15042008-11-11 Akim Demaille <demaille@gostai.com>
1505
1506 Test 214 was failing: it greps with a pattern containing [ ]*
1507 which obviously meant to catch spaces and tabs, but contained only
1508 spaces. Tabulations in sources are a nuisance, so to simplify the
1509 matter, get rid of all the tabulations in the Java sources. The
1510 other skeletons will be treated equally later.
1511
1512 * data/java.m4, data/lalr1.java: Untabify.
1513 * tests/java.at: Simplify AT_CHECK_JAVA_GREP invocations:
1514 tabulations are no longer generated.
1515
905f0697
PB
15162008-11-11 Paolo Bonzini <bonzini@gnu.org>
1517
1518 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
1519 * configure.ac: Adjust usage.
1520 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
1521 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
1522 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
1523
09ccae9b
DJ
15242008-11-10 Di-an Jan <dianj@freeshell.org>
1525
1526 Workaround Java's ``code too large'' problem for parser tables
1527 in most cases, by using one function per initialization.
1528 * data/java.m4 (b4_typed_parser_table, b4_integral_parser_table): New.
1529 * data/lalr1.java (yypact_, yydefact_, yypgoto_, yydefgoto_,
1530 yytable_, yycheck_, yystos_, yytoken_number_, yyr1_, yyr2_, yyrhs_
1531 yyprhs_, yyrline_, yytranslate_table_): Use b4_integral_parser_table.
1532 (yytname_): Use b4_typed_parser_table.
1533 * doc/bison.texinfo (Java Bison Interface): Add note on Java's
1534 ``code too large'' error.
1535
1979121c
DJ
15362008-11-10 Di-an Jan <dianj@freeshell.org>
1537
1538 * NEWS: Document them.
de62edee 1539
1979121c
DJ
1540 General Java skeleton improvements.
1541 * configure.ac (gt_JAVACOMP): Request target of 1.4, which allows
1542 using gcj < 4.3 in the testsuite, according to comments in
1543 gnulib/m4/javacomp.m4.
1544 * data/java.m4 (stype, parser_class_name, lex_throws, throws,
1545 location_type, position_type): Remove extraneous brackets from
1546 b4_percent_define_default.
1547 (b4_lex_param, b4_parse_param): Remove extraneous brackets from
1548 m4_define and m4_define_default.
1549 * data/lalr1.java (b4_pre_prologue): Change to b4_user_post_prologue,
1550 which marks the end of user code with appropriate syncline, like all
1551 the other skeletons.
1552 (b4_user_post_prologue): Add. Don't silently drop.
1553 (yylex): Remove.
1554 (parse): Inline yylex.
1555 * doc/bison.texinfo (bisonVersion, bisonSkeleton): Document.
1556 (%{...%}): Fix typo of %code imports.
1557 * tests/java.at (AT_JAVA_COMPILE): Add "java" keyword.
1558
1559 Support annotations on parser class with %define annotations.
1560 * data/lalr1.java (annotations): Add to parser class modifier.
1561 * doc/bison.texinfo (Java Parser Interface): Document
1562 %define annotations.
1563 (Java Declarations Summary): Document %define annotations.
1564 * tests/java.at (Java parser class modifiers): Test annotations.
1565
1566 Do not generate code for %error-verbose unless requested.
1567 * data/lalr1.java (errorVerbose): Rename to yyErrorVerbose.
1568 Make private. Make conditional on %error-verbose.
1569 (getErrorVerbose, setErrorVerbose): New.
1570 (yytnamerr_): Make conditional on %error-verbose.
1571 (yysyntax_error): Make some code conditional on %error-verbose.
1572 * doc/bison.texinfo (Java Bison Interface): Remove the parts
1573 about %error-verbose having no effect.
1574 (getErrorVerbose, setErrorVerbose): Document.
1575
1576 Move constants for token names to Lexer interface.
1577 * data/lalr1.java (Lexer): Move EOF, b4_token_enums(b4_tokens) here.
1578 * data/java.m4 (b4_token_enum): Indent for move to Lexer interface.
1579 (parse): Qualify EOF to Lexer.EOF.
1580 * doc/bison.texinfo (Java Parser Interface): Move documentation of
1581 EOF and token names to Java Lexer Interface.
1582 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove Calc qualifier.
1583
1584 Make yyerror public.
1585 * data/lalr1.java (Lexer.yyerror): Use longer parameter name.
1586 (yyerror): Change to public. Add Javadoc comments. Use longer
1587 parameter names. Make the body rather than the declarator
1588 conditional on %locations.
1589 * doc/bison.texinfo (yyerror): Document. Don't mark as protected.
1590
1591 Allow user to add code to the constructor with %code init.
1592 * data/java.m4 (b4_init_throws): New, for %define init_throws.
1593 * data/lalr1.java (YYParser.YYParser): Add b4_init_throws.
1594 Add %code init to the front of the constructor body.
1595 * doc/bison.texinfo (YYParser.YYParser): Document %code init
1596 and %define init_throws.
1597 (Java Declarations Summary): Document %code init and
1598 %define init_throws.
1599 * tests/java.at (Java %parse-param and %lex-param): Adjust grep.
1600 (Java constructor init and init_throws): Add tests.
de62edee 1601
42f832d6
AD
16022008-11-10 Akim Demaille <demaille@gostai.com>
1603
1604 Update TODO.
1605 * TODO (-D): is implemented.
1606 (associativity): Same precedence must have the same associativity.
1607 For instance, how can a * b / c be parsed if * is %left and / is
1608 %right?
1609 (YYERRORCODE, YYFAIL, YYBACKUP): New.
1610
247efe34
AD
16112008-11-10 Akim Demaille <demaille@gostai.com>
1612
1613 Formatting changes.
1614
5d731440
AD
16152008-11-10 Akim Demaille <demaille@gostai.com>
1616
1617 More information about the symbols.
1618 * src/output.c (type_names_output): Document all the symbols,
1619 including those that don't have a type-name.
1620 (symbol_definitions_output): Define "is_token" and
1621 "has_type_name".
1622 * data/lalr1.cc (b4_type_action_): Skip symbols that have an empty
1623 type-name, now that they are defined too in b4_type_names.
1624
21db118b
AD
16252008-11-10 Akim Demaille <demaille@gostai.com>
1626
1627 Regen.
1628
6ed15cde
AD
16292008-11-10 Akim Demaille <demaille@gostai.com>
1630
1631 Make parser::yytranslate static.
b06df3c2
AD
1632 Small speedup (1%) on the list grammar. And makes yytranslate_
1633 available in non member functions.
de62edee 1634
6ed15cde
AD
1635 * data/lalr1.cc (yytranslate_): Does not need to be a instance
1636 function.
1637
30bb2edc
AD
16382008-11-10 Akim Demaille <demaille@gostai.com>
1639
1640 Avoid trailing spaces.
1641 * data/c.m4: b4_comment(TEXT): Don't indent empty lines.
1642 * data/lalr1.cc: Don't indent before rule and symbol actions, as
1643 they can be empty, and anyway this incorrectly indents the first
1644 action.
1645
b3a28fd4
AD
16462008-11-10 Akim Demaille <demaille@gostai.com>
1647
1648 Comment changes.
1649
914202bd
AD
16502008-11-10 Akim Demaille <demaille@gostai.com>
1651
1652 Use "enum" for integral constants.
1653 This is just nicer to read, I observed no speedup.
de62edee 1654
914202bd
AD
1655 * data/lalr1.cc (yyeof_, yylast_, yynnts_, yyempty_, yyfinal_)
1656 (yterror_, yyerrcode_, yyntokens_): Define as members of an enum.
1657 (yyuser_token_number_max_, yyundef_token_): Move into...
1658 (yytranslate_): here.
1659
c17f9a4a
AD
16602008-11-10 Akim Demaille <demaille@gostai.com>
1661
1662 Shortcuts in bench directives.
1663 * etc/bench.pl.in (parse_dirs): New.
1664 Use it.
1665 (bench_variant_parser, bench_fusion_parser): Use %s and %d.
1666 Create the benches in "benches/".
1667
b9855ea5
AD
16682008-11-10 Akim Demaille <demaille@gostai.com>
1669
1670 Formatting changes.
1671 * data/lalr1.cc: here.
1672
6e097787
AD
16732008-11-10 Akim Demaille <demaille@gostai.com>
1674
1675 Adjust verbose message to using emacs.
1676 * etc/bench.pl.in: Inform compilation-mode when we change the
1677 directory.
1678 (generate_grammar_list): Recognize %define "variant" in addition
1679 to %define variant.
1680
4c3cc7da
AD
16812008-11-10 Akim Demaille <demaille@gostai.com>
1682
1683 Classify symbols by type-name.
1684 * src/uniqstr.h (UNIQSTR_CMP): New.
1685 * src/output.c (symbol_type_name_cmp, symbols_by_type_name)
1686 (type_names_output): New.
1687 (muscles_output): Use it.
1688 * data/lalr1.cc (b4_symbol_action_): Remove.
1689 (b4_symbol_case_, b4_type_action_): New.
1690 Adjust uses of b4_symbol_action_ to use b4_type_action_.
1691
d69c9694
AD
16922008-11-10 Akim Demaille <demaille@gostai.com>
1693
1694 Change the handling of the symbols in the skeletons.
1695 Before we were using tables which lines were the symbols and which
1696 columns were things like number, tag, type-name etc. It is was
1697 difficult to extend: each time a column was added, all the numbers had
1698 to be updated (you asked for colon $2, not for "tag"). Also, it was
1699 hard to filter these tables when only a subset of the symbols (say the
1700 tokens, or the nterms, or the tokens that have and external number
1701 *and* a type-name) was of interest.
de62edee 1702
d69c9694
AD
1703 Now instead of monolithic tables, we define one macro per cell. For
1704 instance "b4_symbol(0, tag)" is a macro name which contents is
1705 self-decriptive. The macro "b4_symbol" provides easier access to
1706 these cells.
de62edee 1707
d69c9694
AD
1708 * src/output.c (type_names_output): Remove.
1709 (symbol_numbers_output, symbol_definitions_output): New.
1710 (muscles_output): Call them.
1711 (prepare_symbols): Define b4_symbols_number.
1712
5263bea9
AD
17132008-11-10 Akim Demaille <demaille@gostai.com>
1714
1715 --trace=muscles
1716 * src/getargs.h, src/getargs.c (trace_muscle): New.
1717 (trace_types, trace_args): Support it.
1718 * src/output.c (output_skeleton): Use it.
1719
4175f6bb
AD
17202008-11-10 Akim Demaille <demaille@gostai.com>
1721
1722 muscles_output.
1723 * src/output.c (muscles_output): New, extracted from...
1724 (output_skeleton): here.
1725 Adjust.
1726
1de69d6a
AD
17272008-11-10 Akim Demaille <demaille@gostai.com>
1728
1729 Formatting changes.
1730
36db78a7
AD
17312008-11-10 Akim Demaille <demaille@gostai.com>
1732
1733 Update the variant example.
1734 * examples/variant.yy: Formatting changes.
1735 One stage build.
1736
e5eb92e7
AD
17372008-11-10 Akim Demaille <demaille@gostai.com>
1738
1739 Support constructor with an argument.
1740 This improves the "list" bench by 2%.
de62edee 1741
e5eb92e7
AD
1742 * data/lalr1.cc (variant::build): Add an overloaded version with
1743 an argument.
1744 * tests/c++.at (AT_CHECK_VARIANT): Check it.
1745
76307410
AD
17462008-11-10 Akim Demaille <demaille@gostai.com>
1747
1748 Test variants.
1749 * tests/c++.at (AT_CHECK_VARIANTS): New.
1750 Use it with and without %define assert.
1751
d78f0ac9
AD
17522008-11-10 Akim Demaille <demaille@gostai.com>
1753
1754 Add %precedence support.
1755 Unfortunately it is not possible to reuse the %prec directive. This
1756 is because to please POSIX, we do not require to end the rules with a
1757 semicolon. As a result,
de62edee 1758
d78f0ac9 1759 foo: bar %prec baz
de62edee 1760
d78f0ac9
AD
1761 is ambiguous: either a rule which precedence is that of baz, or a rule,
1762 and then a declaration of the precedence of the token baz.
de62edee 1763
d78f0ac9
AD
1764 * doc/bison.texinfo: Document %precedence.
1765 (Precedence Only): New.
1766 * src/assoc.h, src/assoc.c (precedence_assoc): New.
1767 * src/conflicts.c (resolve_sr_conflict): Support it.
1768 * src/scan-gram.l, src/parse-gram.y (%precedence): New token.
1769 Parse it.
1770 * tests/calc.at: Use %precedence for NEG.
1771 * tests/conflicts.at (%precedence does not suffice)
1772 (%precedence suffices): New tests.
1773
c85be41a
AD
17742008-11-09 Akim Demaille <demaille@gostai.com>
1775
1776 Make benches in a sub dirs.
1777 * etc/bench.pl.in ($dir): New.
1778 Use it.
1779 Check the use of constructors with an argument.
1780 (bench_variant_parser): Fix.
1781
db65ca1f
AD
17822008-11-09 Akim Demaille <demaille@gostai.com>
1783
1784 fix eof condition
1785
9b0efa5b
AD
17862008-11-09 Akim Demaille <demaille@gostai.com>
1787
1788 Fix --help.
1789
432ac57a
AD
17902008-11-09 Akim Demaille <demaille@gostai.com>
1791
1792 Require the generation of parse-gram.output.
1793 * src/Makefile.am (YACC): Pass --report=all.
1794
deef2a0a
AD
17952008-11-09 Akim Demaille <demaille@gostai.com>
1796
1797 Formatting changes.
1798
df72984a
AD
17992008-11-09 Akim Demaille <demaille@gostai.com>
1800
1801 Update TODO.
1802 * TODO: Remove obsolete items.
1803 Update others.
1804
f10e19fd
AD
18052008-11-09 Akim Demaille <demaille@gostai.com>
1806
1807 Enhance bench.pl.
1808 * etc/bench.pl.in (parse, parse_expr, parse_term, parse_fact)
1809 (@token, $grammar, $bench): New.
1810 (generate_grammar_variant): Rename as...
1811 (generate_grammar_list): this.
1812 (generate_grammar): Adjust.
1813 (bench_grammar): Rename as...
1814 (bench): this.
1815 Use it in the various bench-marking routines.
1816 (-b, -g): New options.
1817
5de9c593
AD
18182008-11-09 Akim Demaille <demaille@gostai.com>
1819
1820 Use a static hierarchy for symbols in the C++ parser.
1821 * data/lalr1.cc (symbol_base_type, symbol_type)
1822 (stack_symbol_type): Make it a static hierarchy.
1823 Adjust dependencies.
1824
757f8f98
AD
18252008-11-09 Akim Demaille <demaille@gostai.com>
1826
1827 bench.pl -d, --directive.
1828 * etc/bench.pl.in (@directive): New.
1829 (&bench_grammar): Use it.
1830 (&bench_list_grammar): New, to provide access to the "variant"
1831 grammar.
1832 Use it.
1833 (getopts): Support -d, --directive.
1834
d3be4f6d
AD
18352008-11-09 Akim Demaille <demaille@gostai.com>
1836
1837 Use inline for small operations.
1838 * data/lalr1.cc (symbol_base_type, symbol_type)
1839 (stack_symbol_type): Declare constructor and other operations as
1840 inline.
1841 (yy_destroy_): Inline.
1842
1f7d007b
AD
18432008-11-09 Akim Demaille <demaille@gostai.com>
1844
1845 Introduce a hierarchy for symbols.
1846 * data/lalr1.cc (symbol_base_type, symbol_type): New.
1847 (data_type): Rename as...
1848 (stack_symbol_type): this.
1849 Derive from symbol_base_type.
1850 (yy_symbol_value_print_): Merge into...
1851 (yy_symbol_print_): this.
1852 Rename as...
1853 (yy_print_): this.
1854 (yydestruct_): Rename as...
1855 (yy_destroy_): this.
1856 (b4_symbols_actions, YY_SYMBOL_PRINT): Adjust.
1857 (parser::parse): yyla is now of symbol_type.
1858 Use its type member instead of yytoken.
1859
bc0b0477
AD
18602008-11-09 Akim Demaille <demaille@gostai.com>
1861
1862 Rename data_type and stack_symbol_type.
1863 * data/lalr1.cc (data_type): Rename as...
1864 (stack_symbol_type): this.
1865
57295d14
AD
18662008-11-09 Akim Demaille <demaille@gostai.com>
1867
1868 Handle semantic value and location together.
1869 * data/lalr1.cc (b4_symbol_actions): Bounce $$ and @$ to
1870 yydata.value and yydata.location.
1871 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_)
1872 (YY_SYMBOL_PRINT): Now take semantic value and location as a
1873 single arg.
1874 Adjust all callers.
1875 (yydestruct_): New overload for a stack symbol.
1876
e9b0834e
AD
18772008-11-09 Akim Demaille <demaille@gostai.com>
1878
1879 Push a complete symbol, not connected parts.
1880 * data/lalr1.cc (yypush_): Take a data_type&, not disconnected
1881 state, value and location.
1882 Adjust callers.
1883
6082531a
AD
18842008-11-09 Akim Demaille <demaille@gostai.com>
1885
1886 Agregate yylval and yylloc.
1887 * data/lalr1.cc (parser::yylval, parser::yylloc): Replace by...
1888 (parser::yyla): this.
1889
33c195cc
AD
18902008-11-09 Akim Demaille <demaille@gostai.com>
1891
1892 Rely on the state stack to display reduction traces.
b06df3c2
AD
1893 To display rhs symbols before a reduction, we used information
1894 about the rule reduced, which required the tables yyrhs and
1895 yyprhs. Now use rely only on the state stack to get the same
1896 information.
de62edee 1897
33c195cc
AD
1898 * data/lalr1.cc (b4_rhs_data, b4_rhs_state): New.
1899 Use them.
1900 (parser::yyrhs_, parser::yyprhs_): Remove.
1901 (parser::yy_reduce_print_): Use the state stack.
1902
e1f93869
AD
19032008-11-09 Akim Demaille <demaille@gostai.com>
1904
1905 Fuse yyval and yyloc into yylhs.
1906 * data/lalr1.cc (b4_lhs_value, b4_lhs_location): Adjust to using
1907 yylhs.
1908 (parse): Replace yyval and yyloc with yylhs.value and
1909 yylhs.location.
1910 After a user action, compute yylhs.state earlier.
1911 (yyerrlab1): Do not play tricks with yylhs.location, rather, use a
1912 fresh error_token.
1913
2935744b
DJ
19142008-11-09 Di-an Jan <dianj@freeshell.org>
1915
1916 Remove unused variable.
1917 * src/output.c (type_names_output): Remove unused variable sep.
1918
bbf9ca37
PB
19192008-11-09 Paolo Bonzini <bonzini@gnu.org>
1920
1921 Change tests/output.at quoting.
1922 * tests/output.at (AT_CHECK_OUTPUT): Use conventional m4 quoting when
1923 expanding arguments.
1924
d9a9b96b
JD
19252008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
1926
1927 Don't add a semicolon to actions for %skeleton or %language.
1928 It breaks Java test cases as reported by Akim Demaille.
1929 * src/scan-code.l: Implement.
1930
51365192
JD
19312008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
1932
1933 Clean up %skeleton and %language priority implementation.
1934 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
1935 remove static qualifier because others will soon need to see it.
1936 (language_prio): Likewise.
1937 (getargs): Use command_line_prio rather than 0.
1938 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
1939 enum fields.
1940 (skeleton_prio): Extern it.
1941 (language_prio): Extern it.
1942 * src/parse-gram.y: Use grammar_prio rather than 1.
1943
9380cfd0
AD
19442008-11-07 Akim Demaille <demaille@gostai.com>
1945
1946 Moving push traces into yypush_.
1947 * data/lalr1.cc (yypush_): Now takes a optional trace message.
1948 Adjust all uses.
1949
8901f32e
AD
19502008-11-07 Akim Demaille <demaille@gostai.com>
1951
1952 The single-stack C++ parser is now the standard one.
1953 * data/lalr1.cc: Rename as...
1954 * data/lalr1-split.cc: this.
1955 * data/lalr1-fusion.cc: Rename as...
1956 * data/lalr1.cc: this.
1957 * etc/bench.pl.in: Adjust.
1958
8cdabf02
AD
19592008-11-07 Akim Demaille <demaille@gostai.com>
1960
1961 Avoid empty-if warnings.
1962 Reported by Quentin Hocquet.
de62edee 1963
8cdabf02
AD
1964 * data/lalr1-fusion.cc (YY_SYMBOL_PRINT, YY_REDUCE_PRINT)
1965 (YY_STACK_PRINT): Provide some contents even when !YYDEBUG.
1966
5a893c2b
AD
19672008-11-07 Akim Demaille <demaille@gostai.com>
1968
1969 Pass command line location to skeleton_arg and language_argmatch.
1970 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
1971 The location argument is now mandatory.
1972 Adjust all dependencies.
1973 (getargs): Use command_line_location.
1974
58697c6d
AD
19752008-11-07 Akim Demaille <demaille@gostai.com>
1976
1977 -D, --define.
1978 * src/getargs.c (usage): Document -D.
1979 Fix help string for --locations.
1980 (command_line_location): New.
1981 (short_options, long_options, getargs): Support -D, --define.
1982 (getargs): Move -d support at the right place.
1983 * doc/bison.texinfo (Bison Options): Update.
1984 * tests/input.at (%define, --define): New.
1985
9fe5a457
AD
19862008-11-07 Akim Demaille <demaille@gostai.com>
1987
1988 Initialize the muscle table before parsing the command line.
1989 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
1990 (getargs): Define file_name.
1991 * src/main.c (main): Initialize muscle_tab before calling
1992 getargs.
1993 * src/muscle_tab.c (muscle_init): No longer define file_name, as
1994 its value is not available yet.
1995
56c5eca9
AD
19962008-11-07 Akim Demaille <demaille@gostai.com>
1997
1998 Locations without columns for command line arguments.
1999 * src/location.c (location_print): Don't display negative columns.
2000 * src/location.h: Document this.
2001
9b9e0a7d
AD
20022008-11-07 Akim Demaille <demaille@gostai.com>
2003
2004 Fix --help.
2005 * src/getargs.c (usage): Fix help string for -W.
2006
74eae918
AD
20072008-11-07 Akim Demaille <demaille@gostai.com>
2008
2009 Handle more general types of option arguments.
2010 * build-aux/cross-options.pl: The argument ends at the first
2011 space, not the first non-symbol character.
2012 Use @var for each word appearing the argument description.
2013
a3d4c6fb
AD
20142008-11-07 Akim Demaille <demaille@gostai.com>
2015
2016 Destroy the variants that remain on the stack in case of error.
2017 * data/lalr1-fusion.cc (yydestruct_): Invoke the variant's
2018 destructor.
2019 Display the value only if yymsg is nonnull.
2020 (yyreduce): Invoke yydestruct_ when popping lhs symbols.
2021
2d32fc9f
AD
20222008-11-07 Akim Demaille <demaille@gostai.com>
2023
2024 Add "%define assert" to variants.
2025 This is used to help the user catch cases where some value gets
2026 ovewritten by a new one. This should not happen, as this will
2027 probably leak.
de62edee 2028
2d32fc9f
AD
2029 Unfortunately this uncovered a bug in the C++ parser itself: the
2030 lookahead value was not destroyed between two calls to yylex. For
2031 instance if the previous lookahead was a std::string, and then an int,
2032 then the value of the std::string was correctly taken (i.e., the
2033 lookahead was now an empty string), but std::string structure itself
2034 was not reclaimed.
de62edee 2035
2d32fc9f
AD
2036 This is now done in variant::build(other&) (which is used to take the
2037 value of the lookahead): other is not only stolen from its value, it
2038 is also destroyed. This incurs a new performance penalty of a few
2039 percent, and union becomes faster again.
de62edee 2040
2d32fc9f
AD
2041 * data/lalr1-fusion.cc (variant::build(other&)): Destroy other.
2042 (b4_variant_if): New.
2043 (variant::built): New.
2044 Use it whereever the status of the variant changes.
2045 * etc/bench.pl.in: Check the penalty of %define assert.
2046
f6038cb8
AD
20472008-11-07 Akim Demaille <demaille@gostai.com>
2048
2049 Use "%define variant" in bench.pl.
2050 * etc/bench.pl.in: No longer use the pseudo directive %variants,
2051 just use %define variants.
2052
ccde1f98
AD
20532008-11-07 Akim Demaille <demaille@gostai.com>
2054
2055 Regen.
2056 * src/parse-gram.h, src/parse-gram.c: Regen.
2057
58bd33b7
JD
20582008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
2059
2060 Fix user actions without a trailing semicolon.
2061 Reported by Sergei Steshenko at
2062 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
2063 * THANKS (Sergei Steshenko): Add.
2064 * src/scan-code.l (SC_RULE_ACTION): Fix it.
2065 * tests/regression.at (Fix user actions without a trailing semicolon):
2066 New test case.
2067
639867b5
AD
20682008-11-04 Akim Demaille <demaille@gostai.com>
2069
2070 Use b4_copyright_years.
2071 * data/yacc.c (b4_copyright_years): New.
2072 Fix its value according to the comments in the file.
2073 Use it and undefine it.
2074
3c262606
AD
20752008-11-04 Akim Demaille <demaille@gostai.com>
2076
2077 Formatting changes.
2078 * data/lalr1-fusion.cc, src/parse-gram.y: here.
2079
a2b93d52
AD
20802008-11-04 Akim Demaille <demaille@gostai.com>
2081
2082 Formatting changes.
2083 * data/lalr1-fusion.cc: here.
2084
3a2803df
AD
20852008-11-04 Akim Demaille <demaille@gostai.com>
2086
2087 Use strict on bench.pl.
2088 * etc/bench.pl.in (&run, &generate_grammar): New.
2089 Rename the grammar generating functions for consistency.
2090 Change the interface so that the list of benches to run is passed
2091 as (optionless) arguments.
2092 (&compile): Use &run.
2093
a0d4650a
AD
20942008-11-04 Akim Demaille <demaille@gostai.com>
2095
2096 Remove spurious initial empty lines.
2097 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
2098 * data/yacc.c: End the @output lines with an @.
2099
cac9e09b
AD
21002008-11-04 Akim Demaille <demaille@gostai.com>
2101
2102 Improve the display of sizes.
2103 * etc/bench.p.in: Higher precision.
2104 Sort by decreasing size.
2105
4af4348a
AD
21062008-11-04 Akim Demaille <demaille@gostai.com>
2107
2108 Don't memcpy C++ structures.
2109 * data/lalr1-fusion.cc (b4_symbol_variant): Adjust additional
2110 arguments.
2111 (variant::build): New overload for
2112 copy-construction-that-destroys.
2113 (variant::swap): New.
2114 (parser::yypush_): Use it in variant mode.
2115
ef05c4d6
AD
21162008-11-04 Akim Demaille <demaille@gostai.com>
2117
2118 Better defaults for bench.pl.
2119 * etc/bench.pl.in ($verbose, $cflags, $iterations): Change the
2120 default values.
2121 Adjust &verbose uses.
2122 (-q, --quiet): New.
2123
9718cfa9
AD
21242008-11-04 Akim Demaille <demaille@gostai.com>
2125
2126 Make variant.yy more complex.
2127 std::list cannot be copied via memcpy, they are more demanding than
2128 std::string. Use one std::list to strengthen the test.
de62edee 2129
9718cfa9
AD
2130 * examples/variant.yy: Use lalr1-fusion.cc, not lalr1.cc.
2131 Adjust.
2132 Create a list of strings, instead of a single large string.
2133
a6df593d
AD
21342008-11-04 Akim Demaille <demaille@gostai.com>
2135
2136 bench.pl --bench.
2137 * etc/bench.pl.in (--bench, $bench): New.
2138
006a0303
AD
21392008-11-04 Akim Demaille <demaille@gostai.com>
2140
2141 Sort methods.
2142 * data/lalr1-fusion.cc (destroy): Use as() in its definition.
2143 Define it after as().
2144
faef3466
AD
21452008-11-04 Akim Demaille <demaille@gostai.com>
2146
2147 Useless parens.
2148 * data/lalr1-fusion.cc (b4_rhs_location): Remove useless parens.
2149
2141aded
AD
21502008-11-04 Akim Demaille <demaille@gostai.com>
2151
2152 Issue missing synclines after user actions.
2153 * data/c.m4 (b4_case): Issue synclines on the output file.
2154
e426d17b
AD
21552008-11-04 Akim Demaille <demaille@gostai.com>
2156
2157 Remove trailing empty line.
2158 * data/lalr1-fusion.cc: Don't add an empty line after the user's
2159 epilogue.
2160
a9ce3f54
AD
21612008-11-04 Akim Demaille <demaille@gostai.com>
2162
2163 Fix output of copyright years.
2164 * data/bison.m4 (b4_copyright): Fix the indentation of the
2165 copyright year paragraph.
2166 Use b4_copyright_years when no years are given.
2167 * data/lalr1.cc, data/lalr1-fusion.cc, data/location.cc
2168 (b4_copyright_years): New.
2169 Use it.
2170
59c544c2
AD
21712008-11-04 Akim Demaille <demaille@gostai.com>
2172
2173 Avoid the spurious initial empty line.
2174 * data/lalr1-fusion.cc, data/location.cc: Put a trailing "@" at
2175 the end of @output request to suppress the empty line that
2176 results.
2177
96b15448
AD
21782008-11-04 Akim Demaille <demaille@gostai.com>
2179
2180 Remove parser::rhs_number_type.
2181 * data/lalr1-fusion.cc (rhs_number_type): No longer define it.
2182 (yyrhs_): Use b4_table_define.
2183
f0633174
AD
21842008-11-04 Akim Demaille <demaille@gostai.com>
2185
2186 Fix iteration type.
2187 * data/lalr1-fusion.cc: Use an int to iterate up to an int.
2188
417b8004
AD
21892008-11-04 Akim Demaille <demaille@gostai.com>
2190
2191 Factor the declaration of the integer tables.
2192 * data/lalr1-fusion.cc (b4_table_define): New.
2193 Use it.
2194
1a5246c6
AD
21952008-11-03 Akim Demaille <demaille@gostai.com>
2196
2197 Fix indentation of tables in lalr1.cc
2198 * data/lalr1-fusion.cc: Fix the indentation.
2199
f8a95c9c
AD
22002008-11-03 Akim Demaille <demaille@gostai.com>
2201
2202 Destroy the lhs symbols after reduction.
2203 * data/lalr1-fusion.cc (parse): After the user action, when in
2204 variant mode, destroy the lhs symbols.
2205
d7f4d823
AD
22062008-11-03 Akim Demaille <demaille@gostai.com>
2207
2208 Simplify yysyntax_error_ use.
2209 * data/lalr1-fusion.cc (yysyntax_error_): Always pass it the token
2210 type, but make it unnamed in the declaration when it is not used.
2211
8b9c89fb
AD
22122008-11-03 Akim Demaille <demaille@gostai.com>
2213
2214 Let yy::variant::build return an lvalue.
2215 * data/lalr1-fusion.cc (variant::build): Return a reference to the
2216 object.
2217
83243c24
AD
22182008-11-03 Akim Demaille <demaille@gostai.com>
2219
2220 Define yy::variant only when needed.
2221 * data/lalr1-fusion.cc (yy::variant): Define only if variants are
2222 used.
2223
429b4848
AD
22242008-11-03 Akim Demaille <demaille@gostai.com>
2225
2226 Bench the three-stack lalr1.cc.
2227 * etc/bench.pl.in: Bench the three-stack lalr1.cc vs. the
2228 one-stack one.
2229
414c76a4
AD
22302008-11-03 Akim Demaille <demaille@gostai.com>
2231
2232 Fail on parse error in calc++.
2233 * doc/bison.texinfo (calc++.cc): Propagate failures to the exit
2234 status.
2235 * examples/calc++/test ($me, $number, $exit, run): New.
2236 Use them to propagate errors to the exit status.
2237
8a5783fd
AD
22382008-11-03 Akim Demaille <demaille@gostai.com>
2239
2240 Don't specify the skeleton twice in the example.
2241 * examples/calc++/Makefile.am: Don't pass -S to Bison, the grammar
2242 file does what is needed.
2243
0cc5bead
AD
22442008-11-03 Akim Demaille <demaille@gostai.com>
2245
2246 bench: Improve output.
2247 * etc/bench.pl.in (bench_grammar): Tune the printf format.
2248
5b421a4e
AD
22492008-11-03 Akim Demaille <demaille@gostai.com>
2250
2251 bench: check impact of %debug on variants.
2252 * etc/bench.pl.in (variant_grammar): Fix the computation of
2253 $variant.
2254 Generate a grammar file that can work with or without %debug.
2255 Do use the @directive.
2256 (bench_variant_parser): Check impact of %debug.
2257 (@directives): Rename all the occurrences to...
2258 (@directive): this, for consistency.
2259
d11ee647
AD
22602008-11-03 Akim Demaille <demaille@gostai.com>
2261
2262 bench: report the size too.
2263 * etc/bench.pl.in ($iterations): Defaults to -3.
2264 (&bench_grammar): Require hireswallclock.
2265 Compute and display the size of the result.
2266 More comments.
2267
e1b74b92
AD
22682008-11-03 Akim Demaille <demaille@gostai.com>
2269
2270 bench: More use of the verbosity level.
2271 * etc/bench.pl.in ($verbose, &verbose): New.
2272 Use them.
2273 More POD documentation.
2274
7e5f9c54
AD
22752008-11-03 Akim Demaille <demaille@gostai.com>
2276
2277 bench.pl: a command line interface
2278 * etc/bench.pl.in: More doc.
2279 Some fixes in the documentation.
2280 ($cflags, $iterations, &help, &getopt): New.
2281 Use them.
2282 (&variant_grammar): Let the number of stages be 10 times what is
2283 specified.
2284
7109a18d
AD
22852008-11-03 Akim Demaille <demaille@gostai.com>
2286
2287 Bench the use of Boost.Variants.
2288 * etc/bench.pl.in ($cxx, &variant_grammar, &bench_variant_parser):
2289 New.
2290 (&compile): Be ready to compile C++ parsers.
2291 (&bench_push_parser): Move debug information to the outermost
2292 level.
2293 * THANKS: Add Michiel De Wilde.
2294
922730fe
AD
22952008-11-03 Akim Demaille <demaille@gostai.com>
2296
2297 bench.pl: Pass directives as a list instead of as a string.
2298 * etc/bench.pl.in (&directives): New.
2299 (&triangular_grammar, &calc_grammar): Use it to format the Bison
2300 directives.
2301 (&triangular_grammar): Do use the directives (were ignored).
2302 (&bench_grammar, &bench_push_parser): Adjust to pass lists of
2303 directives.
2304
7484f1d4
AD
23052008-11-03 Akim Demaille <demaille@gostai.com>
2306
2307 Improve genericity of bench.pl.
2308 * etc/bench.pl.in (&bench_grammar): Take the set of benches as
2309 argument.
2310 (&bench_push_parser): New.
2311 Call it.
2312
15129f25
AD
23132008-11-03 Akim Demaille <demaille@gostai.com>
2314
2315 Add documentation to bench.pl.
2316 * etc/bench.pl.in: Comment changes.
2317
0e0ed236
AD
23182008-11-03 Akim Demaille <demaille@gostai.com>
2319
2320 Fuse the three stacks into a single one.
de62edee 2321
b06df3c2
AD
2322 In order to make it easy to perform benchmarks to ensure that
2323 there are no performance loss, lalr1.cc is forked into
2324 lalr1-fusion.cc. Eventually, lalr1-fusion.cc will replace
2325 lalr1.cc.
2326
2327 Meanwhile, to make sure that lalr1-fusion.cc is correctly
2328 exercized by the test suite, the user must install a symbolic link
2329 from lalr1.cc to it.
de62edee 2330
b06df3c2
AD
2331 Instead of having three stacks (state, value, location), use a
2332 stack of triples. This considerably simplifies the code (and it
2333 will be easier not to require locations as currently does the C++
2334 parser), and also gives a 10% speedup according to
2335 etc/bench (probably mainly since memory allocation is done once
2336 instead of three times).
de62edee 2337
0e0ed236
AD
2338 Another motivation is to make it easier to destruct properly
2339 semantic values: now that they are bound to their state (hence
2340 symbol type) it will be easier to call the appropriate destructor.
de62edee 2341
0e0ed236 2342 These changes should probably benefit the C parser too.
de62edee 2343
b06df3c2
AD
2344 * data/lalr1.cc: Copy as...
2345 * data/lalr1-fusion.cc: this new file.
0e0ed236
AD
2346 (b4_rhs_value, b4_rhs_location): New definitions overriding those
2347 from c++.m4.
2348 (state_stack_type, semantic_stack_type, location_stack_type)
2349 (yystate_stack_, yysemantic_stack_, yylocation_stack_): Remove.
2350 (data_type, stack_type, yystack_): New.
2351 (YYLLOC_DEFAULT, yypush_): Adjust.
2352 (yyerror_range): Now based on data_type, not location_type.
2353
7dedf26e
AD
23542008-11-03 Akim Demaille <demaille@gostai.com>
2355
2356 Push the state, value, and location at the same time.
2357 This is needed to prepare a forthcoming patch that fuses the three
2358 stacks into one.
de62edee 2359
7dedf26e
AD
2360 * data/lalr1.cc (parser::yypush_): New.
2361 (parser::yynewstate): Change the semantics: instead of arriving to
2362 this label when value and location have been pushed, but yystate
2363 is to be pushed on the state stack, now the three of them must
2364 have been pushed before. yystate still must be the new state.
2365 This allows to use yypush_ everywhere instead of individual
2366 handling of the stacks.
2367
c4585f1e
AD
23682008-11-03 Akim Demaille <demaille@gostai.com>
2369
2370 Prefer references to pointers.
2371 * data/lalr1.cc (b4_symbol_actions): New, overrides the default C
2372 definition to use references instead of pointers.
2373 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_):
2374 Take the value and location as references.
2375 Adjust callers.
2376
56017c17
AD
23772008-11-03 Akim Demaille <demaille@gostai.com>
2378
2379 stack::size instead of stack::height.
2380 * data/lalr1.cc (stack::height): Rename as...
2381 (stack::size): this.
2382 Fix the output type.
2383 Comment changes.
2384
5ab8c47b
AD
23852008-11-03 Akim Demaille <demaille@gostai.com>
2386
2387 Use variants to support objects as semantic values.
b06df3c2
AD
2388 This patch was inspired by work by Michiel De Wilde. But he used
2389 Boost variants which (i) requires Boost on the user side, (ii) is
2390 slow, and (iii) has useless overhead (the parser knows the type of
2391 the semantic value there is no reason to duplicate this
2392 information as Boost.Variants do).
2393
2394 This implementation reserves a buffer large enough to store the
2395 largest objects. yy::variant implements this buffer. It was
2396 implemented with Quentin Hocquet.
de62edee 2397
5ab8c47b
AD
2398 * src/output.c (type_names_output): New.
2399 (output_skeleton): Invoke it.
2400 * data/c++.m4 (b4_variant_if): New.
2401 (b4_symbol_value): If needed, provide a definition for variants.
2402 * data/lalr1.cc (b4_symbol_value, b4_symbol_action_)
2403 (b4_symbol_variant, _b4_char_sizeof_counter, _b4_char_sizeof_dummy)
2404 (b4_char_sizeof, yy::variant): New.
2405 (parser::parse): If variants are requested, define
2406 parser::union_type, parser::variant, change the definition of
2407 semantic_type, construct $$ before running the user action instead
2408 of performing a default $$ = $1.
2409 * examples/variant.yy: New.
2410 Based on an example by Michiel De Wilde.
2411
1fa5d8bb
AD
24122008-11-03 Akim Demaille <demaille@gostai.com>
2413
2414 Parameterize the extraction of semantic values.
2415 To make future changes easier, no longer rely on ".TYPE" being the
2416 way to get a semantic value.
de62edee 2417
1fa5d8bb
AD
2418 * data/c.m4 (b4_symbol_value): New.
2419 Use it.
2420 * data/c++.m4, data/yacc.c: Use it.
2421 * data/glr.c: Use b4_symbol_value.
2422 (b4_rhs_data): New.
2423 Use it.
2424
91ba8a55
AD
24252008-11-03 Akim Demaille <demaille@gostai.com>
2426
2427 Prepare easier M4 changes.
2428 * data/lalr1.cc: Use escaped [] instead of literals to prepare
2429 future changes.
2430
c9ba9e59
JD
24312008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
2432
2433 Initiate further development.
2434 * NEWS: Create an empty section for new entries.
2435 * gnulib: Update submodule to HEAD.
2436
bfb40910
JD
24372008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
2438
2439 * NEWS: Version 2.4.
2440
241fda7a
JD
24412008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
2442
2443 Prepare for next release.
2444 * NEWS: Briefly mention changes since 2.3b.
2445 * README: Say GNU m4 1.4.6, which we've been requiring in release
2446 announcements already, not 1.4.3, which breaks the build.
2447
ed4d67dc
JD
24482008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
2449
2450 Say %language is experimental.
2451 We're thinking of extending it's effect on output file naming. See the
2452 thread at
2453 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
2454 * NEWS: Say it's experimental.
2455 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
2456 recommend it over %skeleton for now.
2457 (Bison Options): Likewise.
2458 (C++ Bison Interface): Use %skeleton not %language.
2459 (Calc++ Parser): Use %skeleton not %language.
2460 * src/getargs.c (usage): Say it's experimental.
2461
e254a580
DJ
24622008-11-01 Di-an Jan <dianj@freeshell.org>
2463 Paolo Bonzini <bonzini@gnu.org>
2464
2465 Support all Java parser class modifiers.
2466 * data/java.m4 (b4_percent_define_get3): New.
2467 (b4_final_if, b4_strictfp_if): New.
2468 * data/lalr1.java (final, strictfp, extends, implements): Support.
2469 * doc/bison.texinfo (final, strictfp, extends, implements): Add
2470 documentation.
2471 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
2472 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
2473 (AT_CHECK_JAVA_GREP): New.
2474 (Java parser class modifiers): New test.
2475 (Java parser class extends and implements): New test.
2476
2477 Model exception propagation better with throws and lex_throws.
2478 * data/java.m4 (b4_list2): New.
2479 (throws): Change default.
2480 * data/lalr1.java (yyaction): Add throws.
2481 (parse): Add lex_throws in addition to throws.
2482 * doc/bison.texinfo (throws, lex_throws): Add documentation.
2483 * tests/java.at (Java throws specifications): New test.
2484
2485 Improve documentation for Java parsers.
2486 * doc/bison.texinfo (Java Parsers): Add subsections.
2487 Don't quote first argument of %define.
2488 (Java Bison Interface): Document output files. Move documentation
2489 of parser class and merge into Java Parser Interface. Document
2490 features that error out. Document directives with no effect.
2491 Move note about Javadoc higher.
2492 (Java Semantic Values): Explicitly mention stype.
2493 Document that generic types cannot be used.
2494 (Java Location Values): Use @deftypeivar. Document constructors.
2495 Correct return value for toString.
2496 (Java Parser Interface): List undocumented constants/fields.
2497 Move documentation of fields added by %parse-param closer to list
2498 of members. Document that token names are added as fields.
2499 Document constructors accurately. Remove error method.
2500 (Java Scanner Interface): Move note on %pure-parser to Java Bison
2501 Interface. Describe %code lexer and yylex accutately.
2502 Remove documentation that does not match the code.
2503 (Java Action Features): New.
2504 (Java Differences): Add reference. Add item on semantic values.
2505 Add note about @{ ... @}. Clarify %% epilogue placement.
2506 (Java Declarations Summary): New.
2507
2508 Fix Java skeleton.
2509 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
2510 (b4_remove_comma): Quote test argument.
2511 (b4_identification): Remove "bison" field.
2512 * tests/java.at (Java parser class and package names): New test.
2513 (Java %parse-param and %lex-param): New test.
2514 (Java stype, position_class and location_class): New test.
2515
f259e4e6
PB
25162008-10-31 Di-an Jan <dianj@freeshell.org>
2517
2518 * data/lalr1.jave: Update copyright years.
2519 (YYParser): Correct name of "generated from" file in Javadoc:
2520 use b4_file_name instead of @ofile@.
2521 (Location constructor): Correct Javadoc parameter name.
2522 (yylloc): Add missing opening m4 quote after b4_location_if.
2523 This removes a stray [ in the Javadoc of Lexer.getStartPos.
2524 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
2525 (YYParser constructor): Correct Javadoc parameter name.
2526
cae5057f
JD
25272008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
2528
2529 Always put auxiliary code files in the same dir as other output files.
2530 * src/files.c (compute_file_name_parts): When the user specifies
2531 --output but not --file-prefix, extract the directory prefix from the
2532 file prefix not from the grammar file name. This affects the location
2533 of files like location.hh generated by the C++ skeleton. The includes
2534 in the other output files require this fix.
2535 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
2536 for expected output files.
2537 (Output files): Add a test for the above.
2538
4af432ba
JD
25392008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
2540
2541 * gnulib: Update submodule to HEAD.
2542
e26d4e43
JD
25432008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
2544
2545 Update copyright year.
2546 * src/files.c: Here.
2547
c0ee9e21
DJ
25482008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
2549
2550 Don't overwrite the input file.
2551 * src/files.c (output_file_name_check): Fatal error if using input file
2552 for output.
2553 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
2554 argument.
2555 (Conflicting output files): Add test.
2556
482dc52f
AD
25572008-10-28 Akim Demaille <demaille@gostai.com>
2558
2559 Space changes.
2560 * data/lalr1.cc: Formatting changes.
2561
52cbbe84
AD
25622008-10-28 Akim Demaille <demaille@gostai.com>
2563
2564 Don't define debugging functions when !YYDEBUG.
2565 * data/lalr1.cc (debug_stream, set_debug_stream)
2566 (debug_level_type, debug_level, set_debug_level): Don't
2567 declare them when YYDEBUG is not defined.
2568 The implementation are already YYDEBUG-aware.
2569
0925d5bf
AD
25702008-10-28 Akim Demaille <demaille@gostai.com>
2571
2572 Prefer "continue" for empty loop bodies.
2573 * etc/bench.pl.in: Use "continue" instead of {}.
2574
cf98343c
AD
25752008-10-28 Akim Demaille <demaille@gostai.com>
2576
2577 Space and comments changes.
2578 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
2579 * data/c.m4, data/lalr1.cc: Space changes.
2580
9f467b7d
AD
25812008-10-28 Akim Demaille <demaille@gostai.com>
2582
2583 Make gnulib a submodule.
2584 * gnulib: New.
2585 * .gitmodules (gnulib): New.
2586
0f0e1ace
JD
25872008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
2588
2589 Fix yyerror_range for user-defined location type in C++. Reported by
2590 Georg Sauthoff at
2591 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
2592 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
2593 * THANKS (Georg Sauthoff): Add.
2594
548e2104
JD
25952008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
2596
2597 Update several administrative files mainly to facilitate releasing.
2598 * HACKING (Administrivia): Make the git-merge-changelog notes more
2599 helpful.
2600 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
2601 (Release Procedure): Update for git and add numerous details that were
2602 previously missing.
2603 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
2604 * maint.mk (announcement): Don't list bison as a bootstrap tool so
2605 that announcements don't claim we bootstrapped with whatever bison
2606 happened to be in PATH. Add flex as a bootstrap tool.
2607 * Makefile.maint: Remove, previously replaced by maint.mk.
2608 * Makefile.cfg: Remove, and migrate settings to...
2609 * cfg.mk: ... here for the sake of `make announcement'.
2610 * bootstrap.conf (gnulib_modules): Add announce-gen.
2611 * README: Say GNU Bison instead of just Bison. Suggested by Karl
2612 Berry.
2613
ddf17a6e
PB
26142008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
2615
2616 Small but important bugfixes for the Java skeleton.
2617 * data/lalr1.java (yyerror): Change Location to b4_location_type.
2618 (yy_symbol_print): Call toString on yyvaluep.
2619
e1145ad8
AD
26202008-08-29 Akim Demaille <demaille@gostai.com>
2621
2622 Clarify UPDATED use.
215b40ac 2623 * doc/bison.texinfo: It refers to the last edition of this file,
e1145ad8 2624 not to the release date of Bison.
215b40ac 2625 Reported by Joel E. Denny.
e1145ad8 2626
0df72d78
AD
26272008-08-29 Akim Demaille <demaille@gostai.com>
2628
2629 * README: Update FAQ pointer.
2630 Reported by Joel E. Denny.
2631
9a90b6bb
EB
26322008-08-27 Eric Blake <ebb9@byu.net>
2633
2634 Resync m4sugar from autoconf.
2635 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
2636 (m4_init): Adjust to latest m4.git changes.
2637 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
2638 effects.
2639 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
2640 (_m4_list_cmp): Reduce side effects.
2641
65015668
AD
26422008-08-27 Akim Demaille <demaille@gostai.com>
2643
2644 Check yyerrok in calc.at.
215b40ac
EB
2645 * tests/calc.at (calc.y): Use yyerrok on "( error )".
2646 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
2647 expected.
65015668 2648
98e26a92
AD
26492008-08-27 Akim Demaille <demaille@gostai.com>
2650
2651 Support yyerrok in lalr1.cc.
2652 YYBACKUP is still to import back into lalr1.cc.
215b40ac 2653 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
98e26a92 2654
86c0e784
JD
26552008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
2656
2657 For maintainer-check*, don't recompile for a $(VERSION) update.
2658 * cfg.mk: New file.
2659 (_is-dist-target): Override the one in GNUmakefile.
2660 * Makefile.am (EXTRA_DIST): Add cfg.mk.
2661
88511166
JD
26622008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
2663
2664 Update for recent change to gnulib.
2665 * src/parse-gram.y: Don't include strverscmp.h. It comes from
2666 string.h now.
2667
6bbb2ed5
EB
26682008-08-15 Eric Blake <ebb9@byu.net>
2669
d67c52e8
EB
2670 Remaining m4sugar merge from autoconf.
2671 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
2672 * data/m4sugar/foreach.m4: New file, copied from autoconf.
2673 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
2674 * src/output.c (output_skeleton): Tell m4 how to find it.
2675
6bbb2ed5
EB
2676 Partial m4sugar merge from autoconf: m4_map.
2677 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
2678 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
2679 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
2680 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
2681 for empty list.
2682 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
2683 Likewise.
2684 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
2685 declares it.
2686
8dce3875
JD
26872008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
2688
2689 Keep .version and PACKAGE_VERSION in sync.
2690 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
2691 dependency, and add comments justifying this in more detail. Discussed
2692 starting at
2693 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
2694
882a1fbf
EB
26952008-08-06 Eric Blake <ebb9@byu.net>
2696
a3764451
EB
2697 Partial m4sugar merge from autoconf: m4_shiftn.
2698 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
2699 (m4_shift2, m4_shift3): New macros.
2700 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
2701 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
2702 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
2703 * data/java.m4 (b4_remove_comma): Likewise.
2704
882a1fbf
EB
2705 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
2706 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
2707 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
2708 (m4_init): Consolidate wrapped text into single m4_wrap.
2709 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
2710 in wrapped text.
2711
a30e920d
EB
27122008-08-05 Eric Blake <ebb9@byu.net>
2713
dfcc5959
EB
2714 Partial m4sugar merge from autoconf: builtins, version.m4.
2715 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
2716 (m4_prepend): Remove, as it is unused and inherently quadratic,
2717 whereas m4_append is linear in newer m4.
2718 (m4_mkstemp): New builtin.
2719 (m4_symbols): Make rename conditional.
2720 (m4_version_prereq): Ensure fatal error if used in bison, which
2721 intentionally lacks version.m4.
2722
a30e920d
EB
2723 Fix comments in m4sugar.
2724 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
2725
445b7470
JD
27262008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
2727
2728 Update for recent .gitignore fix in Gnulib.
2729 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
2730 anchored .gitignore entries.
2731
a1e50014
JD
27322008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
2733
2734 Set gnu or gnits strictness.
2735 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
2736 development and gnits strictness for releases. Based on Eric Blake's
2737 suggestion at
2738 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
2739
d43f77e7
PB
27402008-07-31 Paolo Bonzini <bonzini@gnu.org>
2741
2742 * NEWS: Clarify documentation of %language.
2743
fee2ed87
PB
27442008-07-31 Paolo Bonzini <bonzini@gnu.org>
2745
2746 Support usage of git-merge-changelog.
2747 * .gitattributes: New.
2748 * HACKING: Document usage of git-merge-changelog.
2749 * bootstrap: Install git-merge-changelog entries in .git/config
2750 if appropriate.
2751
78029cd5
JD
27522008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
2753
2754 Remove remaining dependence on CVS Id keyword.
2755 * ChangeLog: For the sake of people still using CVS, don't use dollars
2756 when mentioning Id.
2757 * data/xslt/bison.xsl: Remove Id from header comments, where it was
2758 unusual anyway.
2759 * data/xslt/xml2dot.xsl: Likewise.
2760 * data/xslt/xml2text.xsl: Likewise.
2761 * data/xslt/xml2xhtml.xsl: Likewise.
2762 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
2763 * doc/Makefile.am (neutralize): Remove, no longer needed.
2764 (.x.1): Don't use neutralize.
2765 (edit): Don't substitute for ID.
2766 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
2767
c53d18b1
JD
27682008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
2769
2770 Fix dependence on computed configure variables.
2771 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
2772 $(top_srcdir)/configure.ac so that changes to computed variables, such
2773 as PACKAGE_VERSION, are seen.
2774 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
2775
5523ac79
JD
27762008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
2777
2778 Update copyright dates for recent changes.
2779 * Makefile.am: Here.
2780 * src/Makefile.am: Here.
2781 * src/reduce.c: Here.
2782 * tests/reduce.at: Here.
2783
8fa36911
JD
27842008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
2785
2786 Use git-version-gen for version names between releases.
2787 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
2788 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
2789 * .prev-version: New.
2790 * .version.in: Remove.
78029cd5 2791 * ChangeLog: Remove the Id previously used for capturing the CVS
8fa36911
JD
2792 revision.
2793 * GNUmakefile: Remove, now copied from Gnulib.
2794 * Makefile.am: Add code suggested by comments in
2795 build-aux/git-version-gen.
2796 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
2797 .prev-version, and .version.
2798 * NEWS (2.3b+): Rename to...
2799 (?.?): ... this because we're dropping the "+" version naming scheme,
2800 but, in general, we still can't be sure of our next release name.
2801 * bootstrap: Add a quick hack to remove from .gitignore the
2802 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
2803 entry. This should really be fixed in gnulib instead.
2804 * bootstrap.conf (gnulib_modules): Add gnumakefile.
2805 * configure.ac (AC_INIT): Set version name by invoking
2806 build-aux/git-version-gen.
2807 (AC_CONFIG_FILES): Remove .version, now generated by
2808 build-aux/git-version-gen.
2809 * maint.mk: New, copied from coreutils.
2810 * doc/.cvsignore (bison.1): Add.
2811 * doc/.gitignore (/bison.1): Add.
2812 * doc/bison.1: Remove, generated.
2813 * src/.cvsignore (revision.c): Remove.
2814 * src/.gitignore (/revision.c): Remove.
2815 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
2816 (BUILT_SOURCES): Remove revision.c.
2817 (revision.c): Remove.
2818 * src/getargs.c (version): Don't print revision after the VERSION.
2819 * src/revision.h: Remove.
2820
bcf07cb7
JD
28212008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
2822
2823 Fix untranslatable composition of sentences. Reported by Goran
2824 Uddeborg at
2825 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
2826 * THANKS (Goran Uddeborg): Add.
2827 * src/reduce.c (reduce_print): Report the number of nonterminals and
2828 rules useless in the grammar in separate sentences.
2829 * tests/reduce.at (Useless Rules): Update output.
2830 (Reduced Automaton): Likewise.
2831 (Underivable Rules): Likewise.
2832 (Empty Language): Likewise.
2833
9aacab9a
JD
28342008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
2835
2836 Fix some .gitignore and .cvsignore problems.
2837 * bootstrap (insert_sorted_if_absent): Replace all uses with...
2838 (insert_vc_ignore): ... this new function, which prepends `/' to all
2839 .gitignore entries before passing them to insert_sorted_if_absent.
2840 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
2841 .cvsignore files are maintained even though Bison developers run
2842 bootstrap while using Git.
2843 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
2844 unneeded by Bison.
2845 (gnulib): Add.
2846 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
2847 unneeded. Reported by Eric Blake.
2848 * lib/.gitignore (/*~): Add.
2849 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
2850 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
2851 Blake.
2852 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
2853
a9fc7990
JD
28542008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
2855
2856 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
2857 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
2858 * bootstrap.conf (gnulib_modules): Add unsetenv.
2859 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
2860 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
2861 (/setenv.m4): Add.
2862 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
2863 the first argument because it may become position-dependent, and unset
2864 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
2865 Add comments explaining these issues in more detail.
2866
0f1d6f10
JD
28672008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
2868
2869 Add .gitignore everywhere based on .cvsignore.
2870 * .gitignore: New.
2871 * build-aux/.gitignore: New.
2872 * data/.gitignore: New.
2873 * doc/.gitignore: New.
2874 * etc/.gitignore: New.
2875 * examples/.gitignore: New.
2876 * examples/calc++/.gitignore: New.
2877 * lib/.gitignore: New.
2878 * m4/.gitignore: New.
2879 * po/.gitignore: New.
2880 * runtime-po/.gitignore: New.
2881 * src/.gitignore: New.
2882 * tests/.gitignore: New.
2883
7bd1665a
JD
28842008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
2885
2886 * NEWS (2.3b+): New section, empty for now.
2887 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
2888
72c5b982
JD
28892008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
2890
2891 * NEWS (2.3b): Update release date since there has been a delay in
2892 getting the announcements and tarballs out.
2893
bd02cd5d
JD
28942008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
2895
2896 * NEWS: Version 2.3b.
2897 * configure.ac (AC_INIT): Likewise.
2898 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
2899
9126263e
JD
29002008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
2901
2902 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
2903 been doing it for years.
2904 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
2905 (Release Procedure): Add FIXME about make alpha being unmaintained.
2906
fa6aa7b3
JD
29072008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
2908
2909 * data/yacc.c: Reformat m4 a little for readability.
2910 * src/lalr.c (build_relations): Correct comment.
2911
d30b312d
JMG
29122008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2913
2914 DJGPP specific issue.
2915 * djgpp/config.sed: Fixes required to run configure scripts generated
2916 by autoconf 2.62.
2917
138d4cd9
JD
29182008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
2919
2920 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
2921 coordinator@translationproject.org.
2922
8f7e2e1f
JD
29232008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
2924
2925 * THANKS: Add Eric Blake.
2926
f55efa38
JD
29272008-04-23 Eric Blake <ebb9@byu.net>
2928
2929 Revert prior patch, by working around autoconf regression.
2930 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
2931 ("Output file name: ("): Uncomment test.
2932 ("Output file name: )"): Likewise.
2933 Based on an idea from Noah Misch.
2934
096c9f9d
JD
29352008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2936
2937 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
2938 2.61. Reported by Juan Manuel Guerrero at
2939 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
2940 * tests/output.at ("Output file name: ("): Comment out test case for
2941 now.
2942 ("Output file name: )"): Likewise.
2943
0f664b89
JD
29442008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2945
2946 * GNUmakefile: Update git-version-gen invocation so make dist
2947 succeeds.
2948
1cfe6375
JD
29492008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2950
2951 Update to the current gnulib CVS repository, and fix trigraph handling
2952 in Bison.
2953 * bootstrap: Update gnulib CVS repository URL.
2954 (symlink_to_dir): Encapsulate the code that guarantees the destination
2955 directory exists into...
2956 (check_dst_dir): ... this new function, and...
2957 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
2958 fail when copying files into lib/uniwidth/.
2959 * src/output.c (prepare_symbols): When writing yytname muscles, where
2960 symbol names will be encoded in C-string literals, tell quotearg to
2961 escape trigraphs. This used to be the default in gnulib.
2962 * tests/regression.at (Token definitions): Because of the change in
2963 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
2964 escapes trigraphs in symbol names. Thus, yytname no longer has
2965 trigraphs unnecessarily doubly escaped. Update test case output.
2966 Extend test case to be sure Bison's own error messages will no longer
2967 have trigraphs in symbol names unnecessarily escaped once.
2968
74c52fc8
JD
29692008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
2970
2971 Fix make dist infinite loop reported by Juan Manuel Guerrero at
2972 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
2973 * .cvsignore: Add .version.
2974 * .version.in: New.
2975 * bootstrap.conf (gnulib_modules): Add git-version-gen.
2976 * configure.ac (AC_CONFIG_FILES): Add .version.
2977 * build-aux/.cvsignore: Add git-version-gen.
2978
8e55b3aa
JD
29792008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
2980
2981 * NEWS (2.3a+): Mention that -g now takes an argument.
2982 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
2983 consistency. Update the -g and -x entries now that they take
2984 arguments. Use brackets to indicate optional arguments.
2985 * src/getargs.c (usage): Explain the relationship between arguments of
2986 long and short options more completely. Document --defines and -d
2987 separately since the former takes an argument but, for POSIX Yacc, the
2988 latter does not.
2989 (short_options): Let -W take an optional argument like --warnings.
8452fdd9 2990 (getargs): Sort cases.
8e55b3aa 2991
59c5ac72
AD
29922008-02-28 Akim Demaille <demaille@gostai.com>
2993
2994 * doc/bison.texinfo: Fix a few typos.
2995
118d4978
AD
29962008-02-28 Akim Demaille <akim@epita.fr>
2997
2998 * doc/bison.texinfo (Bison Options): Document -W.
2999 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
3000
7020f1e9
AD
30012008-02-28 Akim Demaille <akim@epita.fr>
3002
3003 * src/getargs.c (short_options): Split and sort for readability.
3004 -g and -x take optional arguments, just like their long options.
3005 * build-aux/cross-options.pl: Use /x to make the regexp easier to
3006 understand.
3007 Fix the handling of $opt which resulted in all the argument to be
3008 considered as optional.
3009
59da312b
JD
30102008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
3011
3012 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
3013 say its interface is experimental.
3014 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
3015 Java.
3016 (Bison Options): In the -L and --language entry, mention Java.
3017 (Java Bison Interface): Say the interface is experimental.
3018 * src/getargs.c (usage): Mention -L and --language.
3019
3020 * NEWS (2.3a+): Say the push parsing interface is experimental.
3021 * doc/bison.texinfo (Push Decl): Likewise.
3022 (Decl Summary): Likewise in the "%define api.push_pull" entry.
3023 (Push Parser Function): Likewise.
3024 (Pull Parser Function): Likewise.
3025 (Parser Create Function): Likewise.
3026 (Parser Delete Function): Likewise.
3027 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
3028 yypull_parse, and yypush_parse entries.
3029
3030 * NEWS (2.3a+): Mention XML support, and say the schema is
3031 experimental.
3032 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
3033 * src/getargs.c (usage): Say the XML schema is experimental.
3034
3035 * NEWS (2.3a+): Say option instead of flag.
3036
2bb3ebec
WP
30372008-02-21 Wojciech Polak <polak@gnu.org>
3038
3039 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
3040 text.
3041
333e670c
JD
30422008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
3043
3044 Fix impure push parser compile error reported by Bob Rossi at
3045 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
3046 * data/yacc.c: Clean up whitespace in the output a little.
3047 (yypstate_allocated): Define for impure push parsers regardless of
3048 whether the pull interface is also requested.
3049 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
3050 check impure push parsers without the pull interface.
3051
3052 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
3053 yyerror takes arguments specified by %parse-param while yypstate_new
3054 does not.
3055 * doc/bison.texinfo (Parser Create Function): Document that
3056 yypstate_new returns 0 for multiple impure parser instances.
3057 * tests/push.at (Push Parsing: Multiple impure instances): Update
3058 expected stderr output.
3059
798096e1
JD
30602008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
3061
3062 * runtime-po/POTFILES.in (push.c): Remove.
3063
9ca7f077
JD
30642008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
3065
3066 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
3067 * data/push.c: Rename to...
3068 * data/yacc.c: ... this, overwriting it.
3069 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
3070 `%push-pull-parser' -> `%define api.push_pull "both"'.
3071 Remove old yacc.c tests, and update push.c tests to yacc.c.
3072
42ee26bb
JD
30732008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
3074
3075 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
3076 `"%code top" blocks' instead of `%code "top" blocks'.
3077 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
3078 Clean up whitespace in the output a little.
3079
b1cc23c4
JD
30802008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
3081
3082 Fix documentation problems reported by Tim Josling at
3083 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
3084 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
3085 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
3086 integers. Explain the effect of literal string aliases on error
3087 messages. Copy token 0 documentation from the C++ skeleton
3088 documentation.
3089
ab7f29f8
JD
30902008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
3091
3092 Accept a token number in a %left, %right, or %nonassoc for POSIX
3093 conformance. Reported by Tim Josling at
3094 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
3095 * NEWS (2.3a+): Mention.
3096 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
3097 and code numbers are treated by precedence declarations.
3098 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
3099 of symbols.1.
3100 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
3101 of symbol.
3102 (symbol.prec): New, just like symbol but allows INT.
3103 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
3104 longer holds.
3105 * tests/regression.at (Token number in precedence declaration): New
3106 test case.
3107
a924ef36
JMG
31082008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3109
3110 DJGPP specific issues.
3111 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
3112 be changed. Copyright timestamp adjusted.
3113 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
3114 be changed. Copyright timestamp adjusted.
3115 * djgpp/config.site: Copyright timestamp adjusted.
3116 * djgpp/config_h.sed: Copyright timestamp adjusted.
3117 * djgpp/djunpack.bat: Copyright timestamp adjusted.
3118 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
3119 filename translation list.
3120 * djgpp/subpipe.c (init_subpipe): Check the environment variables
3121 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
3122 files shall be created. Before trying to use the temp dir where the
3123 environment variable points to check that the dir really exists. If
3124 not default to the cwd as temp dir. Copyright timestamp adjusted.
3125 * djgpp/subpipe.h: Copyright timestamp adjusted.
3126 * djgpp/testsuite.sed: Copyright timestamp adjusted.
3127
389c8cfd
PE
31282008-01-30 Paul Eggert <eggert@cs.ucla.edu>
3129
3130 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
3131
5d1cfef4
PE
31322008-01-09 Paul Eggert <eggert@cs.ucla.edu>
3133
3134 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
3135 Problem reported by Claudio Saavedra in
3136 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
3137
e2dcf996
WP
31382008-01-05 Wojciech Polak <polak@gnu.org>
3139
3140 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
3141 document's title with the input grammar file name.
3142
da730230
JD
31432007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
3144
3145 Automate regression testing of the XML/XSLT implementation. Discussed
3146 starting at
3147 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
3148 * configure.ac (XSLTPROC): New substitution.
3149 * Makefile.am (maintainer-xml-check): New phony target invoking...
3150 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
3151 invoking make maintainer-check with BISON_TEST_XML=1.
3152 * tests/atlocal.in (XSLTPROC): New.
3153 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
3154 not to report reachable memory when Bison is expected to have a
3155 non-zero exit status and (2) to compare XML/XSLT output with --graph
3156 and --report=all output for every working grammar when
3157 BISON_TEST_XML=1.
3158 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
3159 (AT_BISON_CHECK_XML): New.
3160 (AT_QUELL_VALGRIND): New.
3161 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
3162 (AT_CHECK): ... don't redefine this since this was the old way to
3163 quell Valgrind.
3164 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
3165 AT_BISON_CHECK invocations.
3166 * tests/c++.at: Likewise.
3167 * tests/calc.at: Likewise.
3168 * tests/conflicts.at: Likewise.
3169 * tests/cxx-type.at: Likewise.
3170 * tests/existing.at: Likewise.
3171 * tests/glr-regression.at: Likewise.
3172 * tests/headers.at: Likewise.
3173 * tests/input.at: Likewise.
3174 * tests/java.at: Likewise.
3175 * tests/output.at: Likewise.
3176 * tests/push.at: Likewise.
3177 * tests/reduce.at: Likewise.
3178 * tests/regression.at: Likewise.
3179 * tests/sets.at: Likewise.
3180 * tests/skeletons.at: Likewise.
3181 * tests/synclines.at: Likewise.
3182 * tests/torture.at: Likewise.
3183 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
3184 tends to hang xsltproc.
3185 (Big horizontal): Likewise.
3186
408476bc
JD
31872007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
3188
3189 In XML output, remove redundant class attribute on symbol element.
3190 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
3191 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
3192 look up a symbol to determine whether it's a nonterminal or terminal.
3193 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
3194 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
3195
3196 Add prec/assoc information to XML output.
3197 * src/gram.c (grammar_rules_print_xml): For each rule that has a
3198 %prec, add a percent_prec attribute.
3199 * src/print-xml.c (print_grammar): For each terminal that has a
3200 precedence or associativity, add a prec or assoc attribute.
3201 (xml_indent): New.
3202 (xml_puts): Use xml_indent.
3203 (xml_printf): Use xml_indent.
3204 * src/print-xml.h (xml_indent): Prototype.
3205
3206 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
3207 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
3208
d4a26c48
JD
32092007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
3210
3211 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
3212 (bison:ruleByNumber): ... this for clarity.
3213 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
3214 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
3215 (xsl:template match="reduction"): Update.
3216 (xsl:template match="item"): Update.
3217 (xsl:template match="reduction"): Update.
3218
3219 In the XML output, don't print the list of rules where symbols appear.
3220 Compute it in XSLT instead. Discussed at
3221 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
3222 * data/xslt/bison.xsl (bison:ruleByLhs): New.
3223 (bison:ruleByRhs): New.
3224 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
3225 bison:ruleByRhs.
3226 (xsl:template match="terminal/rule"): Remove.
3227 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
3228 bison:ruleByRhs.
3229 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
3230 Remove.
3231 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
3232 bison:ruleByRhs and mode="number-link" for rule template.
3233 (xsl:template match="terminal/rule"): Remove.
3234 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
3235 bison:ruleByRhs and mode="number-link" for rule template.
3236 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
3237 Rewrite as...
3238 (xsl:template match="rule" mode="number-link"): ... this.
3239 * src/print-xml.c (print_grammar): Don't print the list of rules.
3240
ef1b4273
JD
32412007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
3242
3243 Don't let --report affect XML output; always print all information.
3244 Discussed at
3245 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
3246 * src/conflicts.c (log_resolution): Implement.
3247 * src/print-xml.c (print_core): Implement.
3248 (print_state): Implement.
3249 (print_xml): Implement.
3250
3251 * NEWS (2.3a+): Fix quotes.
3252 * src/parse-gram.y (prologue_declaration): For consistency with -v,
3253 don't let %verbose clear the list specified by --report.
3254
0f6cd9e3
AD
32552007-11-26 Akim Demaille <akim@epita.fr>
3256
3257 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
3258
d80fb37a
JD
32592007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
3260
3261 In the XML output, list useless and unused symbols and rules with the
3262 useful ones and add a "usefulness" attribute. Discussed starting at
3263 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
3264 * src/gram.c (grammar_rules_partial_print_xml): Remove.
3265 (grammar_rules_print_xml): Print all rules instead of just those
3266 useful in the grammar, and add a "usefulness" attribute.
3267 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
3268 * src/print-xml.c (print_rules_useless_in_parser): Remove.
3269 (print_grammar): Print all nonterminals instead of just useful ones,
3270 and add a "usefulness" attribute to nonterminals and terminals.
3271 (print_xml): Don't print a separate "reductions" or
3272 "rules-useless-in-parser" element.
3273 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
3274 (reduce_xml): Remove.
3275 (reduce_token_unused_in_grammar): New.
3276 (reduce_nonterminal_useless_in_grammar): New.
3277 * src/reduce.h (reduce_xml): Remove prototype.
3278 (reduce_token_unused_in_grammar): Add prototype.
3279 (reduce_nonterminal_useless_in_grammar): Add prototype.
3280 * data/xslt/xml2text.xsl: Update for XML changes.
3281 * data/xslt/xml2xhtml.xsl: Update for XML changes.
3282 * tests/reduce.at (Useless Terminals): Update output.
3283 (Useless Rules): Update output.
3284 (Reduced Automaton): Update output.
3285
3286 Say "Terminals unused in grammar" instead of "Unused terminals".
3287 * NEWS (2.3a+): Update.
3288 * doc/bison.texinfo (Understanding): Update example output.
3289 * src/reduce.c (reduce_output): Implement.
3290 * data/xslt/xml2text.xsl: Implement.
3291 * data/xslt/xml2xhtml.xsl: Implement.
3292
1bb2bd75
JD
32932007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
3294
3295 Accept --report-file=FILE to override the default `.output' filename.
3296 * NEWS (2.3a+): Mention.
3297 * doc/bison.texinfo (Bison Options): Add an entry.
3298 * src/files.c (compute_output_file_names): Don't override
3299 spec_verbose_file if already set.
3300 * src/getargs.c (usage): Document --report-file.
3301 (REPORT_FILE_OPTION): New anonymous enum member.
3302 (long_options): Add entry for it.
3303 (getargs): Add case for it setting spec_verbose_file.
3304
3305 * build-aux/cross-options.pl: Don't record a short option just because
3306 there's an arg.
3307 * doc/.cvsignore: Add yacc.1.
3308
a005a9c4
AD
33092007-11-14 Akim Demaille <akim@epita.fr>
3310
3311 * doc/yacc.1.in: New.
3312 * configure.ac, doc/Makefile.am: Adjust.
3313 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
3314 config.h symbol.
3315 Use AC_SUBST for assignments too.
3316 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
3317
cff03fb2
JD
33182007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
3319
3320 * src/gram.c: Remove comments that duplicate comments in gram.h.
3321
3322 When reporting useless rules and nonterminals, say "useless in grammar"
3323 instead of "useless", and say "useless in parser" instead of "never
3324 reduced". Discussed starting at
3325 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
3326 * NEWS (2.3a+): Mention this change.
3327 * data/xslt/xml2text.xsl: Update output text and expected input XML
3328 element names to match changes below.
3329 * data/xslt/xml2xhtml.xsl: Likewise.
3330 (xsl:template match="bison-xml-report"): Add missing entry in Table of
3331 Contents: "Rules useless in parser due to conflicts".
3332 * doc/bison.texinfo (Decl Summary): Reword a little.
3333 (Understanding): Update example output for changes below.
3334 * src/gram.c: (rule_useful_p): Rename to...
3335 (rule_useful_in_grammar_p): ... this.
3336 (rule_useless_p): Rename to...
3337 (rule_useless_in_grammar_p): ... this.
3338 (rule_never_reduced_p): Rename to...
3339 (rule_useless_in_parser_p): ... this.
3340 (grammar_rules_print): Update for renames.
3341 (grammar_rules_print_xml): Update for renames.
3342 (grammar_rules_never_reduced_report): Rename to...
3343 (grammar_rules_useless_report): ... this since it is used for either
3344 kind of useless rule.
3345 * src/gram.h: Reword comments and update function names in prototypes.
3346 * src/main.c (main): Say "rule useless in parser due to conflicts".
3347 * src/print-xml.c (print_rules_never_reduced): Rename to...
3348 (print_rules_useless_in_parser): ... this, and rename output XML
3349 element "rules-never-reduced" to "rules-useless-in-parser".
3350 (print_xml): Update for rename.
3351 * src/print.c (print_results): Say "Rules useless in parser due to
3352 conflicts".
3353 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
3354 (nonterminals_reduce): Say "nonterminal useless in grammar".
3355 (reduce_output): Say "Nonterminals useless in grammar".
3356 Say "Rules useless in grammar".
3357 (reduce_xml): Rename output XML element "useless" to
3358 "useless-in-grammar".
3359 (reduce_print): Don't report the count of grammatically useless rules
3360 as "rules never reduced" just because %yacc is specified.
3361 In the correct report of this count, say nonterminal(s) and rule(s)
3362 "useless in grammar".
3363 * tests/conflicts.at (S/R in initial): Update expected output.
3364 (Defaulted Conflicted Reduction): Likewise.
3365 (Unreachable States After Conflict Resolution): Likewise.
3366 * tests/existing.at (GNU pic Grammar): Likewise.
3367 * tests/reduce.at (Useless Nonterminals): Likewise.
3368 (Useless Rules): Likewise.
3369 (Reduced Automaton): Likewise.
3370 (Underivable Rules): Likewise.
3371 (Empty Language): Likewise.
3372
66f0441d
JD
33732007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
3374
3375 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
3376 here document and before the EOF so that BSD's implementation of Bourne
3377 shell doesn't parse the delimiter as part of the here document.
3378 * doc/.cvsignore: Add cross-options.texi.
3379 * src/getargs.c (usage): Add a blank line after the warning categories.
3380
d0ee4105
PB
33812007-11-08 Paolo Bonzini <bonzini@gnu.org>
3382
3383 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
3384
e8b1fb9b
AD
33852007-11-05 Akim Demaille <akim@epita.fr>
3386
3387 Remove Id: from bison.1.
3388 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
3389 (perl -0777 -pi -e 's/\.PP\nId): New.
3390 (.x.1): Use it to ignore the version control revision.
3391
2f7a96b5
AD
33922007-11-05 Akim Demaille <demaille@gostai.com>
3393
3394 * build-aux/Makefile.am: Ship cross-options.pl.
3395 * doc/Makefile.am: Always refer to cross-options.texi with
3396 $(srcdir).
3397 (MAINTAINERCLEANFILES): Add it.
3398
f4101aa6
AD
33992007-11-04 Akim Demaille <demaille@gostai.com>
3400
3401 Generate the long/short option cross-table.
3402 * build-aux/cross-options.pl: New.
3403 * doc/Makefile.am (cross-options.texi): New.
3404 * doc/bison.texinfo: Use it.
3405
727a1401
AD
34062007-11-04 Akim Demaille <demaille@gostai.com>
3407
3408 Generate bison.1 using help2man.
3409 * doc/common.x, doc/bison.x: New.
3410 * doc/Makefile.am (bison.1, .x.1): New.
3411 The code is taken from autoconf-2.61/man/Makefile.am.
3412 * configure.ac: Look for help2man.
3413
6aeb9c57
AD
34142007-11-04 Akim Demaille <demaille@gostai.com>
3415
3416 Complete --help.
3417 * src/getargs.c (usage): Document -W, make it clear that -d,
3418 -g and -x have optional arguments.
3419
d7be4085
AD
34202007-11-04 Akim Demaille <demaille@gostai.com>
3421
3422 Find sha1sum when named gsha1sum.
3423 * bootstrap (find_tool): New.
3424 ($SHA1SUM): New.
3425
d9df47b6
JD
34262007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
3427
3428 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
3429 at
3430 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
3431 * NEWS (2.3a+): Mention.
3432 * data/bison.m4 (b4_pure_if): Don't define it here.
3433 * data/c.m4 (b4_identification): Depend on individual skeletons to
3434 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
3435 values of the %define variables api.pure or api.push_pull. Define
3436 YYPURE, YYPUSH, and YYPULL accordingly.
3437 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
3438 glr.cc has already defined b4_pure_flag.
3439 * data/push.c: Define b4_pure_if based on `%define api.pure'.
3440 Remove YYPUSH and YYPULL since they're back in b4_identification again.
42ee26bb 3441 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
d9df47b6
JD
3442 * doc/bison.texinfo (Pure Decl): Update.
3443 (Push Decl): Update.
3444 (Decl Summary): Add api.pure to %define entry.
3445 In %pure-parser entry, say it's deprecated and reference %define.
3446 (Pure Calling): Update.
3447 (Error Reporting): Update.
3448 (C++ Scanner Interface): Update.
3449 (How Can I Reset the Parser): Update.
3450 (Table of Symbols): In %pure-parser entry, say it's deprecated and
3451 reference %define.
3452 * src/getargs.c (pure_parser): Remove global variable.
3453 * src/getargs.h (pure_parser): Remove extern.
3454 * src/output.c (prepare): Don't define pure_flag muscle.
3455 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
3456 wrapper around `%define api.pure'.
3457 * tests/calc.at (Simple LALR Calculator): Update.
3458 (Simple GLR Calculator): Update.
3459 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
3460 Update.
3461 (GLR: Resolve ambiguity, pure, locations): Update.
3462 (GLR: Merge conflicting parses, pure, no locations): Update.
3463 (GLR: Merge conflicting parses, pure, locations): Update.
3464 * tests/glr-regression.at (Uninitialized location when reporting
3465 ambiguity): Update
3466 * tests/input.at (Unused %define api.pure): New test case.
3467 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
3468 AT_PURE_IF and AT_PURE_AND_LOC_IF.
3469 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
3470
c373bf8b
JD
34712007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
3472
3473 %define push_pull -> %define api.push_pull. Discussed starting at
3474 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
3475 * data/push.c: Expect the new name.
3476 * data/yacc.c: Likewise.
3477 * doc/bison.texinfo (Push Decl): Update.
3478 (Decl Summary): Update %define entry.
3479 (Push Parser Function): Update.
3480 (Pull Parser Function): Update.
3481 (Parser Create Function): Update.
3482 (Parser Delete Function): Update.
3483 * tests/calc.at (Simple LALR Calculator): Update.
3484 * tests/input.at (%define enum variables): Update.
3485 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
3486 (Push Parsing: Multiple impure instances): Update.
3487 (Push Parsing: Unsupported Skeletons): Update.
3488 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
3489 (Exploding the Stack Size with Malloc): Update.
3490
3491 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
3492 other entries some.
3493
32f19b6b
JD
34942007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
3495
3496 For the XML output's terminal element, rename @number to @token-number,
3497 and add @symbol-number. In the nonterminal element, rename @number to
3498 @symbol-number. Discussed starting at
3499 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
3500 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
3501 renames.
3502 (xsl:template match="nonterminal"): Likewise.
3503 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
3504 (xsl:template match="nonterminal"): Likewise.
3505 * src/print-xml.c (print_grammar): Implement.
3506
255a6b90
JD
35072007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
3508
3509 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
3510 2007-10-11 change, the child elements here are items not rules.
408476bc 3511 (xsl:template match="item"): New.
255a6b90
JD
3512 (xsl:template match="rule"): Update for new reduced itemset.
3513 (xsl:template match="point"): Remove.
3514 (xsl:template match="empty"): For consistency with --graph, don't
3515 output "/* empty */".
3516 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
3517 line-wrap, don't pass a negative value as first-line-length since this
3518 won't work with the following changes.
3519 (xsl:template name="line-wrap"): Simplify slightly.
3520 (xsl:template name="ws-search"): Eliminate recursion.
3521 * src/print_graph.c (print_core): Don't print a reduction's lookahead
3522 set next to an item whose dot is not at the end of the RHS even if it
3523 happens to be associated with the same rule.
3524
88c78747
JD
35252007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
3526
31984206
JD
3527 Add %define lr.keep_unreachable_states.
3528 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
3529 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
3530 * src/main.c (main): Implement it.
3531 * tests/conflicts.at (Unreachable States After Conflict Resolution):
3532 Extend to test it, and fix a typo.
3533
35342007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
3535
3536 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
88c78747
JD
3537 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
3538 the example .output text.
3539 * tests/regression.at (Extra lookahead sets in report): Improve wording
3540 of comments.
3541
b7a70162
WP
35422007-10-17 Wojciech Polak <polak@gnu.org>
3543
3544 * src/print-xml.c (print_grammar): Renamed
3545 <terminal> and <nonterminal> attributes:
3546 "type" to "number" and "symbol" to "name".
3547 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
3548 Use new attribute names.
3549 (xsl:template match="nonterminal"): Likewise.
3550 * data/xslt/xml2xhtml.xsl: Likewise.
3551
a0de5091
JD
35522007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
3553
3554 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
3555 (Option Cross Key): Likewise.
3556
3557 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
3558 next to an item whose dot is not at the end of the RHS even if it
3559 happens to be associated with the same rule.
3560 * src/print.c (print_core): Likewise.
3561 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
3562 (Resolved SR Conflicts): Update output.
3563 * tests/regression.at (Extra lookahead sets in report): New test case.
3564
4c20d18d
WP
35652007-10-11 Wojciech Polak <polak@gnu.org>
3566
3567 * src/print-xml.c (print_core): Remove item set
3568 redundancy.
3569 * data/xslt/bison.xsl (bison:ruleNumber): New key.
3570 Improve processing time. Suggested by Joel E. Denny.
3571 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
3572 Write xsl:param "required" attribute as comment.
3573 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
3574 (xsl:template match="rule"): Support new reduced itemset.
3575 (xsl:template match="point"): Remove.
3576 * data/xslt/xml2xhtml.xsl: Likewise.
3577
f506ad1c
JD
35782007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
3579
3580 * src/getargs.c (version): Update copyright year.
3581
21f1b063
JD
35822007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
3583
3584 Make xml2dot.xsl and --graph produce the same output.
3585 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
3586 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
3587 escaped later.
3588 (xsl:template name="output-node"): Use the new escape template instead
3589 of the string-replace template directly.
3590 (xsl:template name="output-edge"): Likewise.
3591 (xsl:template name="escape"): New, escapes backslashes and newlines in
3592 addition to quotation marks.
3593 * src/graphviz.c (start_graph, output_node, output_edge): Add
3594 whitespace to output for legibility.
3595
3596 Make xml2text.xsl and --report produce the same output, and remove the
3597 XML "conflicts" element since a conflict summary is easily extracted
3598 from the automaton.
3599 * data/xslt/bison.xsl: New.
3600 (xsl:template match="state" mode="bison:count-conflicts): New.
3601 * data/xslt/xml2text.xsl: Import bison.xsl.
3602 (xsl:template match="bison-xml-report"): Instead of styling the
3603 "conflicts" element, style the "automaton" element with mode
3604 "conflicts". Unlike the former, the latter lists S/R and R/R
3605 conflicts for a state on the same line.
3606 (xsl:template match="conflicts"): Remove.
3607 (xsl:template match="conflict"): Remove.
3608 (xsl:template match="terminal"): Line-wrap the list of rules in which
3609 the terminal is used.
3610 (xsl:template match="nonterminal"): Likewise for nonterminals.
3611 (xsl:template match="automaton" mode="conflicts"): New.
3612 (xsl:template match="state" mode="conflicts"): New.
3613 (xsl:template name="line-wrap"): New.
3614 (xsl:template name="ws-search"): New.
3615 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
3616 (xsl:template match="bison-xml-report"): Instead of styling the
3617 "conflicts" element, style the "automaton" element with mode
3618 "conflicts."
3619 (xsl:template match="conflicts"): Remove.
3620 (xsl:template match="conflict"): Remove.
3621 (xsl:template match="automaton" mode="conflicts"): New.
3622 (xsl:template match="state" mode="conflicts): New.
3623 * src/conflicts.c (conflicts_output_xml): Remove.
3624 * src/conflicts.h (conflicts_output_xml): Remove prototype.
3625 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
3626 * src/print.c (print_grammar): Consistently wrap at the 66th column so
3627 the corresponding XSLT is easier. Also, never wrap between a word and
3628 the comma that follows it.
3629
793fbca5
JD
36302007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
3631
3632 Improve C++ namespace support. Discussed starting at
3633 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
3634 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
3635 b4_namespace_close): New macros that interpret the %define variable
3636 "namespace" so its value can contain "::" to indicate nested
3637 namespaces.
3638 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
3639 the above macros.
3640 * data/lalr1.cc (b4_namespace): Likewise.
3641 * data/location.cc (b4_namespace): Likewise.
3642 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
3643 inside a new table in the general %define entry. Document `%define
3644 namespace' there as well. Point the %name-prefix entry to it since it
3645 explains it more completely in the case of C++.
3646 (C++ Bison Interface): Mention `%define namespace' instead of
3647 %name-prefix.
3648 (Table of Symbols): Remove the `%define push_pull' entry. The %define
3649 entry suffices.
3650 * tests/c++.at (Relative namespace references): New test case.
3651 (Absolute namespace references): New test case.
3652 (Syntactically invalid namespace references): New test case.
3653 * tests/input.at (C++ namespace reference errors): New test case.
3654
35b8730d
JD
36552007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
3656
3657 Add syncline support and location accessor to internal %define
3658 interfaces.
3659 * data/bison.m4 (b4_percent_define_get_loc): New.
3660 (b4_percent_define_get_syncline): New.
3661 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
3662 (b4_percent_define_default): Record defining location as line 1 rather
3663 than 0 for the sake of synchronizing #line's, and define
3664 b4_percent_define_syncline(VARIABLE).
3665 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
3666 * src/muscle_tab.c (muscle_syncline_grow): New.
3667 (muscle_code_grow): Use muscle_syncline_grow.
3668 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
3669 define b4_percent_define_syncline(VARIABLE).
3670 (muscle_percent_define_get_loc): New.
3671 (muscle_percent_define_get_syncline): New.
3672 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
3673 remove some unused variables.
3674 (muscle_percent_define_default): Record defining location as line 1
3675 rather than 0 for the sake of synchronizing #line's, and define
3676 b4_percent_define_syncline(VARIABLE).
3677 (muscle_percent_define_check_values): Use
3678 muscle_percent_define_get_loc.
3679 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
3680 (muscle_percent_define_get_syncline): Prototype.
3681 * tests/skeletons.at (%define Boolean variables: invalid skeleton
3682 defaults): Update output for location change.
3683 (Complaining during macro argument expansion): Extend to test
3684 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
3685
7dc4a694
JD
36862007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
3687
3688 Fix some error-reporting macro bugs.
3689 * data/bison.m4 (b4_cat): New.
3690 (b4_error, b4_error_at): Use b4_cat to send error directives directly
3691 to stdout so they don't become arguments to other macros. Update
3692 comments and add examples.
3693 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
3694 add examples.
3695 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
3696 after printing the error directive so that M4 doesn't report subsequent
3697 problems that are induced by this problem.
3698 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
3699 instead of just in them. Recognize @\n in both places. Both expand to
3700 the empty string. Needed by b4_cat.
3701 * tests/skeletons.at (Complaining during macro argument expansion):
3702 New test case.
3703 (Fatal errors make M4 exit immediately): New test case.
3704
d4bd2295
JD
37052007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
3706
3707 Implement --print-datadir.
3708 * src/getargs.c (usage): Mention.
3709 (PRINT_DATADIR_OPTION): New anonymous enum member.
3710 (long_options): Add entry for it.
3711 (getargs): Add case for it calling compute_pkgdatadir.
3712 * src/output.c (output_skeleton): Encapsulate data directory
3713 computation from here...
3714 (prepare): ... and from here...
3715 (compute_pkgdatadir): ... into this new function.
3716 * src/output.h (compute_pkgdatadir): Prototype.
3717
34cdeddf
JD
37182007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
3719
3720 * src/print-xml.c (escape_bufs): New static global variable
3721 replacing...
3722 (xml_escape_n): ... the static local variable buf here.
3723 (print_xml): Free memory for escape_bufs.
3724 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
3725
d782395d
JD
37262007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
3727
3728 Replace `%push-parser' and `%push-pull-parser' with
3729 `%define push_pull "push"' and `%define push_pull "both"'.
3730 `%define push_pull "pull"' is the default.
3731 * doc/bison.texinfo (Push Decl, Push Parser Function,
3732 Pull Parser Function, Parser Create Function, Parser Delete Function):
3733 Update declarations.
3734 (Decl Summary, Table of Symbols): Replace %push-parser and
3735 %push-pull-parser entries with a %define push_pull entry.
3736 * data/bison.m4 (b4_percent_define_check_values): New macro.
3737 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
3738 definitions...
3739 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
3740 definitions...
3741 * data/push.c: ... to here and compute them from the value of the
3742 %define variable push_pull.
3743 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
3744 parsing requests here...
3745 * data/yacc.c: ... hack this to switch to push.c any time
3746 b4_use_push_pull_flag or the %define variable push_pull is set. This
3747 will go away when we mv push.c yacc.c.
3748 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
3749 push parsing is not supported since unused %define variables are
3750 reported anyway.
3751 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
3752 * src/muscle_tab.h (muscle_percent_define_check_values): Update
3753 comments for consistency with b4_percent_define_check_values.
3754 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
3755 muscles.
3756 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
3757 Remove.
3758 (prologue_declaration): Remove %push-parser and %push-pull-parser
3759 rules.
3760 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
3761 * tests/calc.at: Update declarations.
3762 * tests/input.at (%define enum variables): New test case.
3763 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
3764 declaration.
3765 (Push Parsing: Multiple impure instances): Update declaration.
3766 (Push Parsing: Unsupported Skeletons): New test case.
3767 * tests/torture.at (Exploding the Stack Size with Alloca): Update
3768 declaration.
3769 (Exploding the Stack Size with Malloc): Update declaration.
3770
3f999f78
WP
37712007-09-24 Wojciech Polak <polak@gnu.org>
3772
3773 Add XSLT transformations.
3774
3775 * data/xslt/xml2dot.xsl: Transform XML into DOT.
3776 * data/xslt/xml2text.xsl: Transform XML into plain text.
3777 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
3778 * data/Makefile.am (xsltdir): New variable.
3779 (dist_xslt_DATA): Add xslt/*.xsl files.
3780
a4f75309
PE
37812007-09-23 Paul Eggert <eggert@cs.ucla.edu>
3782
3783 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
3784 Problem reported by Wojciech Polak.
3785 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
3786 (xml_printf): Undo change I made on 21 September; that is,
3787 indent 2 spaces, not 1.
3788
ad5feac4
JD
37892007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
3790
3791 Pacify ./configure --enable-gcc-warnings.
3792 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
3793 `char const *' instead of `char *'.
3794 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
3795 local variable `sep'.
3796
41d7a5f2
PE
37972007-09-21 Paul Eggert <eggert@cs.ucla.edu>
3798
3799 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
3800 elsewhere.
3801 * src/print-xml.c: Prefer "const" after types; that's more consistent.
3802 (xml_printf): Indent just 1 space for level.
3803 (e_char, xlate_char): Remove.
3804 (xml_escape_string): Rewrite to avoid undefined behavior (used
3805 storage that was freed from the stack).
3806 (xml_escape_n): Don't bother checking for subscript error.
3807
3f999f78
WP
38082007-09-21 Wojciech Polak <polak@gnu.org>
3809
3810 Add Bison XML Automaton Report.
41d7a5f2
PE
3811
3812 Add support for an -x option to generate an XML report.
3813 It is not documented yet.
3814 * src/print-xml.c: New file.
3815 * src/print-xml.h: Likewise.
3816 * lib/timevar.def (TV_XML): New var.
3817 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
3818 * src/conflicts.c: Include print-xml.h.
3819 (solved_conflicts_xml_obstack): New var.
3820 (log_resolution, conflicts_solve, conflicts_free):
3821 Add support for XML report.
3822 (conflicts_output_val): New function.
3823 * src/conflicts.h (conflicts_output_val): New decl.
3824 * src/files.c (spec_xml_file): New var.
3825 (compute_output_file_names, output_file_names_free): Add XML support.
3826 * src/files.h (spec_xml_file): New decl.
3827 * src/getargs.c (xml_flag): New var.
3828 (usage, short_options, long_options, getargs): Add XML support.
3829 * src/getargs.h (xml_flag): New decl.
3830 * src/gram.c: Include print-xml.h.
3831 (rule_lhs_print_xml, rule_rhs_print_xml):
3832 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
3833 New functions.
3834 * src/gram.h: Declare external ones.
3835 * src/main.c: Include print-xml.h.
3836 (main): Add XML support.
3837 * src/reduce.c: Include print-xml.h.
3838 (reduce_xml): New function.
3839 * src/reduce.h: Declare it.
3840 * src/state.c: Include print-xml.h.
3841 (state_new): Add XML support.
3842 (state_rule_lookahead_tokens_print_xml): New function.
3843 * src/state.h: Declare it.
3844 (struct state): New member solved_conflicts_xml.
3845 * src/symtab.c (symbol_class_get_string): New function.
3846 * src/symtab.h: Declare it.
3847
6d8e724d
PE
38482007-09-21 Paul Eggert <eggert@cs.ucla.edu>
3849
3850 * GNUmakefile: Switch to coreutils's version.
3851 * bootstrap: Likewise.
3852 * Makefile.cfg: Adjust to new GNUmakefile.
3853 * README-hacking: Likewise.
3854
3855 Import from gnulib:
3856
3857 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
3858 Bruno Haible <bruno@clisp.org>
3859
3860 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
3861 and is a script that invokes bison. Tighten the code. Add comments.
3862
922bdd7f
JD
38632007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
3864
3865 Spell "boolean" as "Boolean". Reported by Akim Demaille.
3866 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
3867 * doc/bison.texinfo (Decl Summary): Fix.
3868 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
3869 * tests/input.at (Boolean %define variables): Update output.
3870 * tests/skeletons.at (%define boolean variables: invalid skeleton
3871 defaults): Rename to...
3872 (%define Boolean variables: invalid skeleton defaults): ... this and
3873 update output.
3874
1b17b01d
JD
38752007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
3876
3877 In impure push mode, don't allow more than one yypstate to be allocated
3878 since multiple impure parsers would corrupt yynerrs.
3879 * data/push.c (yypstate_allocated): New static global variable
3880 initialized to 0.
3881 (yypull_parse): If yypstate_new returns 0, don't report it as memory
3882 exhaustion if yypstate_allocated is 1, but still return 2.
3883 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
3884 already 1. Otherwise, set it to 1.
3885 (yypstate_delete): Set it to 0.
3886 * tests/push.at (Push Parsing: Multiple impure instances): New test
3887 case.
3888
9987d1b3
JD
38892007-08-17 Bob Rossi <bob@brasko.net>
3890
3891 * doc/bison.texinfo (Push Decl): Document the push parser.
3892 (Table of Symbols): Ditto.
3893 (Pure Decl): Ditto.
3894 (Decl Summary): Ditto.
3895 (Multiple Parsers, Push Parser Function, Pull Parser Function,
3896 Parser Create Function, Parser Delete Function):
3897 Add new push parser symbols.
3898 (Table of Symbols): Document push-parser, push-pull-parser,
3899 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
3900
f16b0819
PE
39012007-08-15 Paul Eggert <eggert@cs.ucla.edu>
3902
3903 Update to GPLv3.
3904 * doc/gpl-3.0.texi: New file.
3905 * doc/gpl.texi: Remove.
3906 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
3907 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
3908 * README-hacking, TODO, bootstrap, bootstrap.conf:
3909 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
3910 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
3911 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
3912 * data/lalr1.cc, data/lalr1.java, data/location.cc:
3913 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
3914 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
3915 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
3916 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
3917 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
3918 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
3919 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
3920 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
3921 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
3922 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
3923 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
3924 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
3925 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
3926 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
3927 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
3928 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
3929 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
3930 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
3931 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
3932 * src/complain.c, src/complain.h, src/conflicts.c:
3933 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
3934 * src/files.h, src/flex-scanner.h, src/getargs.c:
3935 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
3936 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
3937 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
3938 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
3939 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
3940 * src/print.c, src/print.h, src/print_graph.c:
3941 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
3942 * src/reduce.h, src/relation.c, src/relation.h:
3943 * src/revision.h, src/scan-code.h, src/scan-code.l:
3944 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
3945 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
3946 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
3947 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
3948 * tests/Makefile.am, tests/actions.at, tests/c++.at:
3949 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
3950 * tests/existing.at, tests/glr-regression.at:
3951 * tests/headers.at, tests/input.at, tests/java.at:
3952 * tests/local.at, tests/output.at, tests/push.at:
3953 * tests/reduce.at, tests/regression.at, tests/sets.at:
3954 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
3955 * tests/torture.at:
3956 Update to GPLv3.
3957
728c4be2
JD
39582007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
3959
3960 Get rid of broken %no-parser, -n, and --no-parser implementation and
3961 documentation.
3962 * TODO: Don't mention them.
3963 * doc/bison.1: Likewise.
3964 * doc/bison.texinfo (Decl Summary): Likewise.
3965 (Bison Options): Likewise.
3966 (Option Cross Key): Likewise.
3967 * src/getargs.c (no_parser_flag): Remove global variable.
3968 (usage): Don't print description of -n and --no-parser.
3969 (long_options): Remove --no-parser entry here.
3970 (getargs): Remove -n case in the switch here.
3971 * src/getargs.h (no_parser_flag): Remove extern.
3972 * tests/regression.at (Web2c Actions): Remove comment that mentions
3973 --no-parser.
3974
5d31a216
JD
39752007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
3976
3977 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
3978 name user variables starting with `yy'. Just pass NULL instead of a
3979 dummy local &yylval to yypush_parse.
3980 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
3981 starting with `yy'.
3982
a2ea208d
JD
39832007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
3984
3985 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
3986 true since it's then always used regardless of whether yyoverflow is
3987 defined. Reported by Christian Burger at
3988 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
3989 * THANKS: Add Christian Burger.
3990
91661ebb
JD
3991 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
3992 node names: say "Decl Summary" not "Bison Declaration Summary".
3993
cbd50549
JD
39942007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
3995
3996 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
3997 determine whether this function has already complained about an invalid
3998 value for a %define boolean variable, don't check whether Bison has
3999 ever examined the value. As written, the check was a tautology.
4000 Instead, record and check for this complaint using a separate muscle.
4001
eb1b0740
JD
40022007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
4003
4004 Fix push parsing memory leak reported by Brandon Lucia at
4005 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
4006 * THANKS: Add Brandon Lucia.
4007 * data/push.c (yypstate_delete): Free the stack if it was reallocated
4008 but the parse never completed and thus freed it.
4009 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
4010 * tests/testsuite.at: Include push.at.
4011 * test/push.at: New.
4012 (Push Parsing: Memory Leak for Early Deletion): New test case.
4013
9d774aff
JD
40142007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
4015
4016 Improve handling of multiple S/R conflicts in the same state and of S/R
4017 conflicts involving multiple reductions.
4018 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
4019 set for a state here or Bison will abort if it is reassigned on a
4020 later conflicted reduction in the same state.
4021 Similarly, don't finalize and assign the solved conflicts report here
4022 or it will be lost if it is reassigned on a later conflicted reduction
4023 in the same state.
4024 (set_conflicts): Instead, assign them both here after all S/R conflicts
4025 in the state have been fully examined.
4026 * src/print.c (shift_set): Rename to...
4027 (no_reduce_set): ... this.
4028 (print_reductions): Update for rename, and add %nonassoc error action
4029 tokens to no_reduce_set so that, when printing the first remaining
4030 reduction on an error action token, the reduction is enclosed in
4031 brackets.
4032 (print_results): Update for rename.
4033 * tests/conflicts.at (Solved conflicts report for multiple reductions
4034 in a state): New test case.
4035 (%nonassoc error actions for multiple reductions in a state): New test
4036 case.
4037
4038 * src/main.c (main): Don't depend on C99 features.
4039
10159d2a
JD
40402007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
4041
4042 * build-aux/.cvsignore: Add compile.
b541ffdf
JD
4043 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
4044 uniwidth.
10159d2a 4045
953b3935
JD
40462007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
4047
4048 * bootstrap (slurp): Create target directories that don't exist.
4049 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
4050
6ce2d93a
JD
40512007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
4052
4053 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
4054 than item number.
4055 * closure.c (closure): Likewise.
4056 * state.h (reductions): Comment sorting of rules.
4057 (state): Comment sorting of items.
4058
ce3448d5
JD
40592007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
4060
4061 Fix C++ test cases after recent Gnulib changes. Discussed starting at
4062 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
4063 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
4064 definition in order to avoid Gnulib headers since we don't use config.h
4065 here.
4066 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
4067 rather than AT_DATA so that config.h is included.
4068
8a86eef0
JD
40692007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
4070
4071 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
4072 instead of fprintf. Guard these functions with #if YYDEBUG instead of
4073 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
4074 and so that YYFPRINTF is guaranteed to be defined here.
4075
b1a81613
JD
40762007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
4077
4078 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
4079 with...
4080 (muscle_percent_define_check_values): ... this more helpful function.
4081 Again, it's not used yet, but it will be.
4082 * src/muscle_tab.h: Likewise.
4083
71b61d4d
JD
4084 Improve some comments in parser table construction.
4085 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
4086 (generate_states): Don't mention ruleset, which is internal to closure.
4087 * src/closure.c (closure): Explain sorting of core and itemset, which
4088 is required for this function to behave correctly.
4089 * src/closure.h (closure): Mention sorting.
4090
2a6b783d
JD
40912007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
4092
4093 * src/lalr.c (state_lookahead_tokens_count): For code readability,
4094 move the check for disabled transitions to an aver since conflict
4095 resolution hasn't happened yet.
4096
4097 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
4098 labels a state as inconsistent just because it has error transitions.
4099 The original form of this check appeared in revision 1.1 of lalr.c,
4100 which was committed on 1991-12-21. Now (at least), changing the
4101 consistency label on such a state appears to have no useful effect in
4102 any of the places it is examined, which I enumerate below. The key
4103 point to understanding each item in this enumeration is that a state
4104 with an error transition is labelled consistent in the first place only
4105 if it has no rules, so the check cannot matter for states that have
4106 rules. (1) Labelling a state as inconsistent will cause set_conflicts
4107 to try to identify its conflicts, and a state must have *rules* to have
4108 conflicts. (2) Labelling a state as inconsistent will affect how
4109 action_row sets the default *rule* for the state. (3) Labelling a
4110 state as inconsistent will cause build_relations to add lookback edges
4111 to *rules* in that state.
4112 * src/state.h (struct state): Word the comment for member consistent
4113 more carefully.
4114
14462c2b
JD
41152007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
4116
4117 Don't depend on C99 features.
4118 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
4119 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
4120 * src/reader.c (check_and_convert_grammar): Fix for-loop.
4121 * src/state.c (state_mark_reachable_states): Fix for-loop.
4122 (state_remove_unreachable_states): Fix for-loop.
4123
4124 Don't widen struct state with member reachable just to temporarily
4125 record reachability. Instead, use a local bitset.
4126 * src/state.h (struct state): Remove member.
4127 * src/state.c (state_new): Don't initialize it.
4128 (state_mark_reachable_states): Rename to...
4129 (state_record_reachable_states): ... this, and use bitset.
4130 (state_remove_unreachable_states): Use bitset.
4131
5a43d418
JD
41322007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
4133
4134 * src/Makefile.am (yacc): Quote target action commands properly so
4135 that the yacc script isn't corrupt. Reported by Hans Aberg at
4136 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
4137
0c650a20
JD
4138 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
4139 the case of pure parsers. Reported by Frans Englich at
4140 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
4141 * THANKS: Add Frans Englich.
4142
61fee93e
JD
4143 * NEWS (2.3a+): In the %code entry, reference section `Bison
4144 Declaration Summary' from the manual now since the %code summary has
4145 moved there.
4146 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
4147 in the rules section must be terminated by semicolons.
4148
f124d423
JD
41492007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
4150
4151 Extend the front-end API for %define variables to more completely
4152 mirror the back-end. This will be useful in the future.
4153 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
4154 Update comments to mention the new front-end counterparts of these
4155 macros.
4156 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
4157 for muscle_string_decode and muscle_location_decode.
4158 (muscle_string_decode): New static function.
4159 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
4160 (muscle_percent_define_get, muscle_percent_define_ifdef): New
4161 functions.
4162 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
4163 muscle_percent_define_get to mimic the b4_percent_define_flag_if
4164 implementation more closely.
4165 (muscle_percent_define_invalid_value): New function.
4166 * src/muscle_tab.h (muscle_percent_define_get,
4167 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
4168 Prototype.
4169
75ad86ee
JD
41702007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
4171
4172 * NEWS (2.3a+): Mention yesterday's state-removal change.
4173 (2.3a): Remove the %language entry, which was added after 2.3a.
4174 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
4175 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
4176 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
4177 tests/existing.at: Update copyright date.
4178
5967f0cf
JD
41792007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
4180
4181 If conflict resolution makes states unreachable, remove those states,
4182 report rules that are then unused, and don't report conflicts in those
4183 states.
4184 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
4185 New global function.
4186 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
4187 function.
4188 * src/main.c (main): After conflict resolution, remove the unreachable
4189 states and update all data structures that reference states by number.
4190 * src/state.c (state_new): Initialize each state's reachable member to
4191 false.
4192 (state_mark_reachable_states): New static function.
4193 (state_remove_unreachable_states): New global function.
4194 * src/state.h (struct state): Add member bool reachable.
4195 (state_remove_unreachable_states): Prototype.
4196 * tests/conflicts.at (Unreachable States After Conflict Resolution):
4197 New test case.
4198 * tests/existing.at (GNU pic Grammar): Update test case output now that
4199 an unused rule is discovered.
4200
b09f4f48
JD
42012007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
4202
4203 Minor code cleanup in parser table construction.
4204 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
4205 (new_itemsets, save_reductions): Update for rename to nitemset.
4206 * src/closure.c (nritemset): Rename to...
4207 (nitemset): ... this since the "r" appears to meaningless and isn't
4208 used in the comments.
4209 (closure): Update for rename.
4210 * src/closure.h (nritemset): Update extern to...
4211 (nitemset): ... this.
4212 * src/lalr.c (LA): Fix a typo in comments.
4213 * src/print.c (print_core): Update for rename to nitemset.
4214 * src/print_graph.c (print_graph): Likewise.
4215 * src/state.h: Fix some typos in header comments.
4216
bbb44d83
PE
42172007-04-04 Paul Eggert <eggert@cs.ucla.edu>
4218
9b33de72
PE
4219 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
4220 still sticks to ASCII. Sorry!
4221
bbb44d83
PE
4222 * README-hacking: New file, taken mostly from coreutils, with changes
4223 for Bison. Contains much of the contents of:
4224 * README-cvs: Remove.
4225 * bootstrap: Sync from gnulib.
4226 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
4227 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
4228
29553547
JD
42292007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
4230
4231 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
4232 Setzer.
4233 (Java Differences): Fix some typos.
4234 * THANKS: Add Sebastian Setzer.
4235
01b477c6
PB
42362007-03-07 Paolo Bonzini <bonzini@gnu.org>
4237
730739e4
AD
4238 * data/java.m4 (b4_single_class_if): Remove.
4239 (b4_abstract_if): Look at "%define abstract".
4240 (b4_lexer_if): New.
4241 (b4_union_name): Rename...
4242 (b4_yystype): ... to this. Map to "%define stype".
4243 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
4244 b4_maybe_throws): Fix quoting.
4245 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
4246 * data/lalr1.java (Lexer interface): Always define.
4247 (Lexer interface within parser class): Remove.
4248 (YYLexer class): New, used when "%code lexer" is present.
4249 (constructor): When "%code lexer" is used, pass %lex-param
4250 to the lexer constructor.
4251 (yylex, yyparse): Remove %lex-param from method invocations
4252 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
4253
4254 * doc/bison.texinfo (Java Bison Interface): Mention "%define
4255 abstract". Rename "%define union_name" to "%define stype".
4256 Rename method names according to previous patch.
4257 (Java Scanner Interface): Describe "%code lexer" instead of
4258 "%pure-parser" and "%define single_class".
4259 (Java Differences): Mention "%code lexer".
4260
4261 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
4262 Include scanner here, using macros from tests/local.at.
4263 (AT_DATA_CALC_Y): Remove final argument.
4264 (_AT_CHECK_JAVA_CALC): Likewise.
4265 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
4266 of %locations and %error-verbose.
4267 (main): Test with and without %lex-param.
4268 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
4269 (AT_BISON_OPTION_POPDEFS): Pop it.
01b477c6 4270
122bea3a
JMG
42712007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4272
4273 DJGPP spefic issue. Inhibit the use of disallowed characters for
4274 file name genertion on Win98, WinXP, etc. These are |<>":?*\
4275 and concern testsuite case 46.
4276 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
4277 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
4278 * djgpp/config.bat: Inhibit the use of disallowed characters.
4279
9611cfa2
JD
42802007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
4281
4282 Miscellaneous %define and %code cleanup.
4283 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
4284 values are interpreted.
4285 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
4286 documentation a little more.
4287 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
4288 muscle_percent_define_insert, muscle_percent_code_grow): New
4289 functions/macros.
4290 * src/muscle_tab.h (muscle_percent_define_insert,
4291 muscle_percent_code_grow): Prototype.
4292 * src/parse-gram.y (prologue_declaration): Use
4293 muscle_percent_define_insert and muscle_percent_code_grow when parsing
4294 %define and %code directives.
4295
4296 Make it easy to share %define boolean variables between the front-end
4297 and back-end. Though not used yet, this will be useful in the future.
4298 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
4299 Bison uses of names rather than just skeleton uses of names.
4300 (b4_percent_define_get, b4_percent_define_ifdef): Rename
4301 b4_percent_define_skeleton_variables(VARIABLE) to
4302 b4_percent_define_bison_variables(VARIABLE).
4303 (b4_percent_code_get, b4_percent_code_ifdef): Rename
4304 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
4305 b4_percent_code_bison_qualifiers(QUALIFIER).
4306 (b4_check_user_names_wrap): Update for renames.
4307 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
4308 muscle_percent_define_default): New functions mimicking
4309 b4_percent_define_flag_if and b4_percent_define_default.
4310
4311 For %define variables, report locations for invalid values and
bbb44d83 4312 redefinitions.
9611cfa2
JD
4313 * data/bison.m4 (b4_percent_define_flag_if): Read
4314 b4_percent_define_loc(VARIABLE) to report the location of an invalid
4315 value for VARIABLE.
4316 (b4_percent_define_default): Save a special location in
4317 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
4318 must later be reported as invalid.
4319 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
4320 functions.
4321 (muscle_percent_define_insert): Record the location of VARIABLE in
4322 muscle percent_define_loc(VARIABLE), and use it to report the previous
4323 location for a redefinition.
4324 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
4325 (muscle_percent_define_default): Update like b4_percent_define_default.
4326 (muscle_grow_user_name_list): Rename to...
4327 (muscle_user_name_list_grow): ... this for consistency and use
4328 muscle_location_grow.
4329 * src/muscle_tab.h (muscle_location_grow): Prototype.
4330 * tests/input.at (%define errors): Update expected output.
4331 * tests/skeletons.at (%define boolean variables: invalid skeleton
4332 defaults): New test case.
4333
0bf92491
JD
43342007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
4335
4336 * src/print.c (lookahead_set, state_default_rule): Remove.
4337 (print_reductions): Replace state_default_rule invocation with
4338 equivalent use of yydefact, which was computed in token_actions in
4339 tables.c.
4340 (print_results): Don't allocate lookahead_set.
4341
d3b12988
PB
43422007-02-27 Paolo Bonzini <bonzini@gnu.org>
4343
4344 * data/lalr1.java: Prefix all private members with yy.
4345
f57a7536
JD
43462007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
4347
4348 Use YYFPRINTF instead of fprintf where appropriate. Reported by
9b33de72 4349 Sebastien Fricker at
f57a7536 4350 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
9b33de72 4351 * THANKS: Add Sebastien Fricker.
f57a7536
JD
4352 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
4353 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
4354 accept a variable number of arguments.
4355
6404a5bf
JD
43562007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
4357
4358 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
4359
e4e09639
JMG
43602007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4361
4362 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
4363 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
4364 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
4365
d7e0a1a7
PE
43662007-02-11 Paul Eggert <eggert@cs.ucla.edu>
4367
4368 Undo my 2007-02-07 change, switching back to the c-strcase module
4369 introduced in the 2007-02-03 change. Bruno Haible reported that
4370 the 2007-02-07 change would be dangerous in Turkish if we add a
4371 language whose name contains "i", since "i" is not lowercase "I"
4372 in Turkish.
4373 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
4374 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
4375 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
4376 * m4/.cvsignore: Remove strcase.m4.
4377 * src/getargs.c: Revert 2007-02-07 change, as follows.
4378 Include c-strcase.h.
4379 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
4380
deee93a1
JD
43812007-02-11 Bruno Haible <bruno@clisp.org>
4382
4383 Enable the Java related testsuite tests when the only Java compiler
4384 found is a gcj < 4.3. Discussed at
4385 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
4386 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
4387
574add85
JD
43882007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
4389
4390 * data/Makefile.am: Update copyright date.
4391 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
4392 yypstate_new returns NULL.
4393 (yypstate_new): Return NULL if malloc does.
4394 * src/reader.c (packgram): Move translation of rule actions from the
4395 beginning of packgram to...
4396 (check_and_convert_grammar): ... here right before packgram is invoked
4397 so it's easier to write more complete comments, and remove redundant
4398 code.
4399
e785ccf7
JD
44002007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
4401
4402 As in semantic actions, make @$ in %initial-action, %destructor, and
4403 %printer imply %locations.
4404 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
4405 scanning @$.
4406 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
4407 (@$ in %initial-action implies %locations,
4408 @$ in %destructor implies %locations,
4409 @$ in %printer implies %locations): ... these new test cases.
4410
1cfe1ed7
PE
44112007-02-07 Paul Eggert <eggert@cs.ucla.edu>
4412
4413 Undo most of the 2007-02-03 change, switching to the strcase module
4414 now that gnulib strcase has been fixed.
4415 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
4416 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
4417 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
4418 * m4/.cvsignore: Add strcase.m4.
4419 * src/getargs.c: Revert 2007-02-03 change, as follows.
4420 Don't include c-strcase.h.
4421 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
4422 strcasecmp has "unspecified behavior" outside the POSIX locale,
4423 but it works fine in practice if at least one argument is ASCII,
4424 as is the case in Bison.
4425
0049ec86
PB
44262007-02-07 Paolo Bonzini <bonzini@gnu.org>
4427
4428 * tests/java.at: Skip tests if only one of javac/java is present.
4429 Reported by Joel E. Denny.
4430 * tests/atlocal.in: Adjust copyright years.
4431
44322007-02-05 Paolo Bonzini <bonzini@gnu.org>
4433
4434 * data/lalr1.java (Stack): Work around old verifiers that disallow
4435 access to the private fields of an inner class, from the outer class.
4436 We can make Stack's fields public because user code doesn't have access
4437 to the instance of Stack used by parse(). Reported by Paul Eggert.
4438
2c2b7220
PE
44392007-02-03 Paul Eggert <eggert@cs.ucla.edu>
4440
4441 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
4442 the right spot for these files?
4443 * bootstrap.conf (gnulib_modules): Add c-strcase.
4444 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
4445 c-strncasecmp.c.
4446 * src/getargs.c: Include c-strcase.h.
4447 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
4448 to avoid unspecified behavior.
4449
b2b81dae
JD
44502007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
4451
4452 * doc/bison.texinfo (Decl Summary): Correct typo.
4453
c1d19e10
PB
44542007-01-30 Paolo Bonzini <bonzini@gnu.org>
4455
4456 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
4457 Complain if the value does not match empty, "true" or "false".
4458 * data/c++.m4: Adjust default definitions of %define variables.
4459 * data/java.m4: Adjust default definitions of %define variables.
4460 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
4461 to above behavior.
4462 * tests/input.at (Boolean %define variables): Test new behavior.
4463
8405b70c
PB
44642007-01-29 Paolo Bonzini <bonzini@gnu.org>
4465
4466 * NEWS: Mention java.
4467 * TODO: Remove things that are done.
4468 * bootstrap.conf: Add javacomp-script and javaexec-script.
4469 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
4470
4471 * data/Makefile.am: Add new files.
4472 * data/java-skel.m4: New.
4473 * data/java.m4: New.
4474 * data/lalr1.java: New.
4475
4476 * doc/bison.texinfo: Put "A Complete C++ Example" under
4477 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
4478 under Other Languages.
4479
4480 * src/getargs.c (valid_languages): Add Java.
4481 * src/getargs.h (struct bison_language): Update size of string fields.
4482
4483 * tests/Makefile.am: Add java.at.
4484 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
4485 * tests/java.at: New.
4486 * tests/testsuite.at: Include it.
4487
3eb82471
JD
44882007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
4489
4490 Clean up.
4491 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
4492 at_directive_argv arguments so these no longer have to be global
4493 variables. Also, update the implementation for the following changes.
4494 (fail_for_at_directive_too_many_args,
4495 fail_for_at_directive_too_few_args): Add at_directive_name argument.
4496 (at_directive_name): Remove as at_directive_argv[0] will be used for
4497 this now.
4498 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
4499 for the directive name.
4500 (at_directive_argc, at_directive_argv): Make these local within
4501 skel_lex instead of global.
4502 (INITIAL): Update directive start action for above changes.
4503 (SC_AT_DIRECTIVE_ARG): Rename to...
4504 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
4505 (SC_AT_DIRECTIVE_SKIP_WS): Update.
4506 (scan_skel): Move yylex_destroy to...
4507 (skel_scanner_free): ... here.
4508 * tests/skeletons.at (installed skeleton file name): Rename to...
4509 (installed skeleton file names): ... this.
4510
148d66d8
JD
45112007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
4512
4513 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
4514 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
4515 Summary" not "Directives".
4516 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
4517 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
4518 since the former is now the more complete one.
4519 (Prologue Alternatives): Likewise and do the same for %defines.
4520 (Table of Symbols): Add summary of %code, add summary of %define, and
4521 move full %code documentation to...
4522 (Decl Summary): ... here for consistency with other entries in these
4523 sections.
4524 Move %define entry in order to keep this list alphabetized.
4525 Reword %define entry a little to put less emphasis on the skeleton
4526 concept, which most users shouldn't have to think about.
4527
665f0c24
PE
45282007-01-26 Paul Eggert <eggert@cs.ucla.edu>
4529
4530 Adjust to recent gnulib changes.
4531 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
4532 Add string.h, string_.h, unistd_.h, wchar_.h.
4533 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
4534 * src/system.h: Don't include <stpcpy.h>; this is now done by
4535 <string.h>.
4536
592d0b1e
PB
45372007-01-23 Paolo Bonzini <bonzini@gnu.org>
4538
4539 Simplify implementation of unqualified %code, implement macros for
4540 uniform treatment of boolean %define flags. Document %define.
4541 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
4542 b4_percent_code_ifdef): New.
4543 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
4544 * data/c++.m4: Define default value for global_tokens_and_yystype.
4545 * data/glr.cc: Likewise.
4546 * data/location.cc: Use b4_percent_define_flag_if.
4547
148d66d8 4548 * doc/bison.texinfo (Decl Summary): Document %define.
592d0b1e
PB
4549
4550 * src/parse-gram.y (Unqualified %code): Change muscle name to
4551 b4_percent_code().
4552 (content.opt): Default to empty.
4553
a7867f53
JD
45542007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
4555
4556 Implement support for relative and absolute skeleton file names.
4557 Discussed starting at
4558 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
4559 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
4560 (Bison Options): Document in --skeleton entry.
4561 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
4562 full_skeleton can't necessarily hold all of pkgdatadir.
4563 If the specified skeleton file name contains a `/', don't prepend
4564 pkgdatadir.
4565 * src/parse-gram.y (prologue_declaration): If the specified skeleton
4566 file name contains a `/', prepend the grammar file directory.
4567 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
4568 * skeletons.at: New file.
4569 (relative skeleton file names): New test case.
4570 (installed skeleton file names): New test case.
4571 * tests/testsuite.at: Include skeletons.at.
4572
4573 * bootstrap: Update copyright to 2007.
4574
830c9b18
PB
45752007-01-17 Paolo Bonzini <bonzini@gnu.org>
4576
4577 * bootstrap: Remove occurrences of .#bootmp from the files.
4578
a8c2e813
AD
45792007-01-17 Akim Demaille <akim@epita.fr>
4580
4581 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
4582 nonterminals.
4583 Use per-type %printer.
4584
279cabb6
JD
45852007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
4586
4587 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
4588 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
4589 djgpp/config.site, src/files.c, src/files.h, src/main.c,
4590 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
4591 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
4592 tests/glr-regression.at, tests/input.at, tests/local.at,
4593 tests/output.at, tests/torture.at: Update copyright to 2007.
4594
bb32f4f2
AD
45952007-01-16 Akim Demaille <akim@epita.fr>
4596
4597 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
4598 error code.
4599 (Calc++ Scanner): Exit with failure if we can't open the input
4600 file.
4601 Accept "-" standing for stdin.
4602 (Calc++ Top Level): Print the result only if the parsing was
4603 successful.
4604
7cff04b5
AD
46052007-01-16 Akim Demaille <akim@epita.fr>
4606
4607 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
4608
a4e25e1d
JD
46092007-01-15 Paolo Bonzini <bonzini@gnu.org>
4610 and Joel E. Denny <jdenny@ces.clemson.edu>
4611
4612 Clean up %define and %code implementation in M4 some. Most
4613 importantly, rename all related macros to be in the b4_percent_define
4614 and b4_percent_code namespaces. Also, complete support for `.' in
4615 %define variable names and %code qualifiers.
4616 * data/bison.m4 (b4_check_user_names): Check for special
4617 "SKELETON-NAMESPACE(name)" macros instead of using two nested
4618 m4_foreach loops.
4619 (b4_get_percent_define, b4_get_percent_code): Rename to...
4620 (b4_percent_define_get, b4_percent_code_get): ... these.
4621 Extend documentation with examples.
4622 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
4623 b4_percent_define_skeleton_variables and
4624 b4_percent_code_skeleton_qualifiers.
4625 Expect any value for the %define variable `foo' to be stored in the
4626 macro named `b4_percent_define(foo)'; expect any %code blocks for the
4627 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
4628 expect any unqualified %code blocks to be stored in a macro named
4629 `b4_percent_code_unqualified'.
4630 Use m4_indir so that %define variable names and %code qualifiers can
4631 contain `.', which is allowed by the grammar parser.
4632 (b4_percent_define_default): New macro to set a default value for a
4633 %define variable.
4634 (m4_wrap): Update wrapped code, and fix some underquoting.
4635 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
4636 Expect grammar uses of %define variables and %code qualifiers to be
4637 defined in b4_percent_define_user_variables and
4638 b4_percent_code_user_qualifiers.
4639 * data/c++.m4: Use b4_percent_define_default rather than
4640 m4_define_default. Fix some underquoting. Skeleton usage of %define
4641 variable define_location_comparison now implies skeleton usage of
4642 %define variable filename_type.
4643 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
4644 data/push.c, data/yacc.c: Update macro names.
4645 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
4646 muscle names.
4647
e37c665c
JMG
46482007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4649
4650 DJGPP specific issues.
4651
4652 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
4653 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
4654
7d2d521f
JD
46552007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
4656
4657 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
4658 run parsers in all tests so that Valgrind is invoked during
4659 maintainer-check-valgrind.
4660 (Duplicate representation of merged trees): Free all semantic values.
4661 (Duplicated user destructor for lookahead): Likewise.
4662
e0ac9b4b
JD
46632007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
4664
4665 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
4666 command-line prefix.
4667 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
4668 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
4669 miss Valgrind messages.
4670 (Exploding the Stack Size with Malloc): Likewise.
4671
78143faa
JD
46722007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
4673
4674 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
4675 locals. Reported by Juan Manuel Guerrero at
4676 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
4677 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
4678 Fix some indentation also.
4679 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
4680 explaining this issue.
4681
7ecec4dd
JD
46822007-01-09 Paolo Bonzini <bonzini@gnu.org>
4683 and Joel E. Denny <jdenny@ces.clemson.edu>
4684
4685 Simplify union and prologue handling, and escape union and lex/parse
4686 params with digraphs.
4687 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
4688 values to the empty string since these are no longer guaranteed
4689 initialized by the front-end.
4690 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
4691 braces around b4_user_stype since this is no longer done by the
4692 front-end.
4693 * src/files.c, src/files.h (pre_prologue_obstack,
4694 post_prologue_obstack): Remove.
4695 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
4696 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
4697 with digraphs. This fixes lex params and parse params.
4698 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
4699 * src/output.c (prepare): Remove muscle insertion of the prologues.
4700 (output): Remove freeing of pre_prologue_obstack and
4701 post_prologue_obstack.
4702 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
4703 than prologue_augment for prologue parsing so you don't need prologue
4704 obstacks.
5c80250c
JD
4705 (grammar_declaration): For %union RHS, use `braceless' instead of
4706 "{...}" so that braces are already stripped and code is escaped with
4707 digraphs.
7ecec4dd
JD
4708 * src/reader.c (prologue_augment): Remove.
4709 (reader): Remove initialization of pre_prologue_obstack and
4710 post_prologue_obstack.
4711 * src/reader.h (prologue_augment): Remove.
4712
4713 * data/c.m4: Remove stray parenthesis.
4714
16dc6a9e
JD
47152007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
4716
4717 Remove quotes from variables names in %define directives and from
4718 qualifiers in %code directives, and restrict the characters that are
4719 allowed in them to M4-friendly ones. For %define, continue to support
4720 the quoted form as a deprecated feature. Discussed starting at
4721 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
4722 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
4723 %code.
4724 * doc/bison.texinfo (Prologue Alternatives): Update.
91661ebb
JD
4725 (Decl Summary): In %defines entry, update mention of `%code requires'
4726 and `%code provides'.
16dc6a9e
JD
4727 (C++ Location Values): Update %define uses.
4728 (Calc++ Parser Interface): Likewise.
4729 (Calc++ Parser): Likewise, and update `%code requires' uses.
148d66d8 4730 (Table of Symbols): Update %code documentation.
16dc6a9e
JD
4731 * src/parse-gram.y (prologue_declaration): For %define variables, use
4732 `variable' instead of `STRING'.
4733 (grammar_declaration): For %code qualifiers, use `ID' instead of
4734 `STRING'.
4735 (variable): New nonterminal that takes an `ID' or a `STRING'.
4736 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
4737 and %define uses.
4738 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
4739 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
4740 (%define errors): Update %define uses.
4741
e9813cd4
JD
47422007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
4743
4744 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
4745 instead of muscle_insert for %define values so that M4-special
4746 characters are replaced with digraphs.
4747 * tests/input.at (%define errors): Extend to check weird values.
4748
6afc30cc
JD
47492007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
4750
4751 Instead of having skeletons declare all valid %define variables and
4752 %code qualifiers, provide macros that retrieve the associated values
4753 and build these lists automatically. Thus Bison will now warn when a
4754 variable or qualifier is not used by the skeleton in the current
4755 invocation regardless of whether it might sometimes be used by that
4756 skeleton in other invocations. Also, move all %define value macros to
4757 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
4758 form, which is replaced by %code.
4759 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
4760 (b4_check_user_names): ... this, and change the series of valid name
4761 arguments to a single list argument for names used in the skeleton
4762 similar to the existing list argument for names used in the grammar.
4763 Warn instead of complaining.
4764 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
4765 values and %code code, to format %code code properly, and to build
4766 lists of all %define variables and %code qualifiers used in the
4767 skeleton: b4_skeleton_percent_define_variables and
4768 b4_skeleton_percent_code_qualifiers.
4769 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
4770 Remove, and...
4771 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
4772 the skeleton names lists can finish building first. In place of
4773 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
4774 expect the lists b4_user_percent_define_variables and
4775 b4_user_percent_code_qualifiers.
4776 * data/c++.m4: Where setting default values for b4_parser_class_name,
4777 b4_location_type, b4_filename_type, b4_namespace, and
4778 b4_define_location_comparison, update their names to the
4779 b4_percent_define_ namespace.
4780 * data/glr.c: Don't use b4_check_percent_define_variables and
4781 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
4782 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
4783 (b4_parser_class_name, b4_namespace): Define these using
a4e25e1d 4784 b4_get_percent_define for parser_class_name and namespace.
6afc30cc
JD
4785 * data/location.cc: Use b4_get_percent_define.
4786 * data/push.c: Don't use b4_check_percent_define_variables and
4787 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
4788 * data/yacc.c: Likewise, and don't call m4_exit in
4789 b4_use_push_for_pull_if or m4_wrap code will never execute.
4790 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
4791 Rename to...
4792 (muscle_grow_user_name_list): ... this for consistency with the
4793 terminology used in bison.m4.
4794 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
4795 %define variable names, and rename muscle used_percent_define_variables
4796 to user_percent_define_variables.
4797 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
4798 user_percent_code_qualifiers.
4799 (content): Remove.
4800 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
4801 {CODE} form is no longer accepted.
4802 * tests/input.at (Reject bad %code qualifiers): Rename to...
4803 (Reject unused %code qualifiers): ... this, and update test output.
4804 (%define error): Update test output.
4805
7eb8a0bc
JD
48062007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
4807
4808 Check for unrecognized %define variables similar to checking for
4809 unrecognized %code qualifiers. Check for redefined %define variables.
4810 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
4811 generalizes...
4812 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
4813 (b4_check_percent_define_variables): New, also wraps it.
4814 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
4815 variables using b4_check_percent_define_variables.
4816 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
4817 all those exercised in the test suite and all those listed in the
4818 `Default values' section of c++.m4. Are there others?
4819 * data/push.c, data/yacc.c: Declare no valid %define variables.
4820 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
4821 similar to muscle_find, but it works even when the muscle stores a
4822 const value.
4823 (muscle_grow_used_name_list): New function for constructing the used
4824 name list muscles that b4_check_for_unrecognized_names requires.
4825 * src/parse-gram.y (prologue_declaration): Warn if a variable is
4826 %define'd more than once. Define the b4_used_percent_define_variables
4827 muscle with muscle_grow_used_name_list.
4828 (grammar_declaration): Abbreviate %code code with
4829 muscle_grow_used_name_list.
4830 * tests/input.at (%define errors): New.
4831
3fc65ead
JD
48322007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
4833
4834 Provide warn_at, complain_at, and fatal_at function callbacks to the
4835 skeletons, and use this for %code qualifier complaints.
4836 * data/bison.m4 (b4_error_at): New, invoked by...
4837 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
4838 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
4839 @fatal_at(...@) directives.
4840 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
4841 qualifiers in b4_used_percent_code_qualifiers and to use
4842 b4_complain_at.
4843 * src/location.c, src/location.h (boundary_set_from_string): New global
4844 function.
4845 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
4846 function.
4847 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
4848 to b4_used_percent_code_qualifiers.
4849 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
4850 function.
4851 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
4852 (lineno): Rename to...
4853 (out_lineno): ... this so I don't misunderstand it again.
4854 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
4855 here; these newlines are in the input but not the output file.
4856 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
4857 (at_directive_perform): ... this new static function, and add handling
4858 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
4859 directives.
4860 * tests/input.at (Reject bad %code qualifiers): Update test output with
4861 locations and extend.
4862
4863 * tests/output.at (Output file name: [, Output file name: ]): Remove
4864 bogus comment about these tests failing.
4865
1c7b7e1d
JD
48662007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
4867
4868 Clean up b4_check_percent_code_qualifiers a little.
4869 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
4870 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
4871 documentation and add examples.
4872 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
4873 qualifiers here.
4874
08af01c2
JD
48752007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
4876
4877 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
4878 unreliable -- especially when they're hidden inside another macro.
4879 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
4880 data/c.m4: Remove m4_divert(-1).
4881 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
4882 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
4883 m4_divert_push(0) and m4_divert_pop(0).
279cabb6 4884 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
08af01c2
JD
4885 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
4886 pushed and popped by m4sugar, should be first on the stack.
4887
4888 Provide warn, complain, and fatal function callbacks to the skeletons.
4889 This provides more flexibility than m4_fatal, improves the error
4890 message format, and captures messages for translation. Discussed
4891 starting at
4892 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
4893 * data/bison.m4 (b4_error): New, invoked by...
4894 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
4895 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
4896 directives. Because these M4 macros might be called when the current
4897 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
4898 the previous removal of uses of m4_divert, which caused trouble.
4899 (b4_check_percent_code_qualifiers): Use b4_complain instead of
4900 m4_fatal to report unrecognized %code qualifiers.
4901 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
4902 push parser requests.
4903 * data/glr.c: Use b4_complain instead of m4_fatal to report
4904 non-deterministic push parser requests.
4905 Update @output usage to @output(...@) form.
4906 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
4907 report missing %defines. Update @output usage to @output(...@) form.
4908 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
4909 @output(...@) form.
4910 * src/main.c (main): Invoke skel_scanner_free.
4911 * src/scan-skel.h (skel_scanner_free): Prototype new function.
4912 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
4913 obstack_for_string from flex-scanner.h.
4914 (YY_DECL): Use to declare skel_lex static.
4915 (decode_at_digraphs): Remove; now handled in the new
4916 SC_AT_DIRECTIVE_ARG start condition.
4917 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
4918 functions.
4919 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
4920 at_directive_argv): New static globals.
4921 (INITIAL): Use fail_for_invalid_at.
4922 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
4923 recognize the start of a generalized `@directive(...@)' form and
4924 start...
4925 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
4926 directive args (using the new obstack_for_string), to decode the
4927 contained @ diagraphs, and to perform the directive. It recognizes
4928 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
4929 @output(...@).
4930 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
4931 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
4932 `@,'.
4933 (scan_skel): Initialize obstack_for_string on the first call.
4934 (skel_scanner_free): New function to free obstack_for_string.
4935 * tests/input.at (Reject bad %code qualifiers): Update test output.
4936
8e0a5e9e
JD
49372007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
4938
4939 Consolidate the 4 prologue alternative directives (%code, %requires,
4940 %provides, and %code-top) into a single %code directive with an
4941 optional qualifier field. Discussed at
4942 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
4943 * NEWS (2.3a+): Rewrite the existing entry for the prologue
4944 alternatives.
4945 * doc/bison.texinfo (Prologue Alternatives): Update.
4946 (Decl Summary): Update to %code "requires" and %code "provides".
4947 (Calc++ Parser): Update to %code "requires".
148d66d8 4948 (Table of Symbols): Remove entries for %requires, %provides, and
8e0a5e9e
JD
4949 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
4950 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
4951 are replaced by b4_percent_code_provides and b4_percent_code_requires,
4952 which are skeleton-specific.
4953 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
4954 declare what %code qualifiers it supports and to complain if any other
4955 qualifiers were used in the grammar.
4956 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
4957 and b4_user_code([b4_percent_code_provides]) in place of
4958 b4_user_requires and b4_user_provides.
4959 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
4960 Add b4_user_code([b4_percent_code_top]) and
4961 b4_user_code([b4_percent_code]).
4962 Invoke b4_check_percent_code_qualifiers.
4963 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
4964 PERCENT_REQUIRES): Remove.
4965 (grammar_declaration): Remove RHS's for %code-top, %provides, and
4966 %requires. Rewrite the %code RHS as the unqualified form defining the
4967 muscle b4_percent_code. Add another RHS for the qualified %code form,
4968 which defines muscles of the form b4_percent_code_QUALIFIER and the
4969 b4_used_percent_code_qualifiers muscle.
4970 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
4971 PERCENT_REQUIRES): Remove.
4972 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
4973 %code "requires" and %code "provides".
4974 * tests/input.at (Reject bad %code qualifiers): New.
4975
95021767
JD
49762007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
4977
4978 Use the new code_props interface for destructors and printers.
4979 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
4980 printer_location members, and change the type of the destructor and
4981 printer members to code_props.
4982 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
4983 symbol_printer_get, semantic_type_destructor_set,
4984 semantic_type_printer_set, default_tagged_destructor_set,
4985 default_tagless_destructor_set, default_tagged_printer_set,
4986 default_tagless_printer_set): Use code_props in arguments and return
4987 types in place of char const * and location.
4988 (symbol_destructor_location_get, symbol_printer_location_get): Remove
4989 since the locations are now contained in the return of
4990 symbol_destructor_get and symbol_printer_get.
4991 * src/output.c (symbol_destructors_output, symbol_printers_output):
4992 Replace with...
4993 (symbol_code_props_output): ... this to eliminate duplicate code.
4994 (output_skeleton): Update to use symbol_code_props_output.
4995 * src/reader.c (symbol_should_be_used): Update use of
4996 symbol_destructor_get.
4997 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
4998 Update uses of the various _destructor_set and _printer_set functions.
4999 * src/symtab.c: (default_tagged_destructor_location,
5000 default_tagless_destructor_location, default_tagged_printer_location,
5001 default_tagless_printer_location): Remove since we...
5002 (default_tagged_destructor, default_tagless_destructor,
5003 default_tagged_printer, default_tagless_printer): ... change the type
5004 of these to code_props.
5005 (symbol_new, semantic_type_new, symbol_destructor_set,
5006 semantic_type_destructor_set, symbol_destructor_get,
5007 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
5008 symbol_check_alias_consistency, default_tagged_destructor_set,
5009 default_tagless_destructor_set, default_tagged_printer_set,
5010 default_tagless_printer_set): Update.
5011 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
5012 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
5013 code_props members.
5014 (symbol_print): Use SYMBOL_CODE_PRINT.
5015
f6857bbf
JD
50162007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
5017
5018 Use the new code_props interface for rule actions.
5019 * src/symlist.h (symbol_list): Replace action, action_location, and
5020 used members with a code_props action_props member.
5021 * src/reader.c (symbol_should_be_used, grammar_rule_check,
5022 grammar_midrule_action, grammar_current_rule_merge_set,
5023 grammar_current_rule_symbol_append, packgram): Update.
5024 * src/scan-code.h (translate_rule_action): Remove, no longer used.
5025 * src/scan-code.l (handle_action_dollar): Update.
5026 (translate_rule_action): Remove, no longer used.
5027 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
5028
7c0c6181
JD
50292007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
5030
5031 Use the new code_props interface in parse-gram.y.
5032 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
5033 Update all uses of translate_* functions to use the new code_props
5034 interface and to use gram_scanner_last_string_free and
5035 code_scanner_last_string_free where possible.
5036 (grammar_declaration): symbol_list_destructor_set and
5037 symbol_list_printer_set now perform the translation, so don't do it
5038 here. Use gram_scanner_last_string_free where possible.
5039 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
5040 translate_code): Remove, no longer used.
5041 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
5042 symbol_list_printer_set): Perform code translation here rather than
5043 depending on the caller to do so.
5044
5045 * src/symlist.h (struct symbol_list): Correct some documentation typos.
5046 * src/scan-gram.h (gram_last_string): Remove declaration.
5047 * src/scan-gram.l (last_string): Declare it static.
5048
28e52c0d
JD
50492007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
5050
5051 Encapsulate code properties and related functionality for the various
5052 destructors, printers, and actions into a code_props structure and
5053 interface. This patch merely implements code_props in scan-code.h and
5054 scan-code.l. Future patches will rewrite other modules to use it.
5055 Discussed starting at
5056 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
5057 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
5058 consistently initialize const structs that have an empty location
5059 field.
5060 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
5061 to ensure consistency.
5062 * src/scan-code.h (code_props): New structure.
5063 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
5064 function, macro, and const global variable for initializing a
5065 code_props with no code.
5066 (code_props_plain_init, code_props_symbol_action_init,
5067 code_props_rule_action_init, code_props_translate_code): The rest of
5068 the new code_props functional interface. Among other things, the init
5069 functions set the code_props kind field so that
5070 code_props_translate_code will know whether to behave like
5071 translate_symbol_action, translate_rule_action, or translate_code.
5072 These old translate functions must remain until all other modules are
5073 updated to use the new code_props interface.
5074 (code_scanner_last_string_free): New function similar to
5075 gram_scanner_last_string_free.
5076 (code_scanner_free): Add documentation.
5077 * src/scan-code.l: Implement the new interface.
5078 (code_lex): Make it static, add a code_props* argument, and remove the
5079 rule argument.
5080 (last_string): New static global similar to the one in scan-gram.l.
5081 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
5082 instead of rule.
5083 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
5084 code_props since Bison may one day use this information for destructors
5085 and printers.
5086 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
5087 (handle_action_dollar): Use symbol_list_n_get and set used flag
5088 directly since symbol_list_n_used_set is removed.
5089 (translate_action): Add a code_props* argument and remove the rule,
5090 action, and location arguments. Pass the code_props* on to code_lex.
5091 (translate_rule_action, translate_symbol_action, translate_code):
5092 Rewrite as wrappers around the new code_props interface.
5093 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
5094 it would eventually need to break the encapsulation of code_props.
5095
96034983
JD
50962007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
5097
5098 * etc/.cvsignore: New.
5099
945e396c
JD
51002007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
5101
5102 Add maintainer-push-check to run maintainer-check using push parsing in
5103 place of pull parsing where available.
5104 * Makefile.am (maintainer-push-check): New.
5105 * data/bison.m4 (b4_use_push_for_pull_if): New.
5106 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
5107 appropriately based on their existing values.
5108 (yypush_parse): Don't print push-parser-specific diagnostics if push
5109 parsing is being used in place of pull parsing.
5110 * data/yacc.c: If push parsing should replace pull parsing, redirect to
5111 push.c.
5112 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
5113 variable, and insert b4_use_push_for_pull_flag into muscles.
5114 * tests/Makefile.am (maintainer-push-check): New.
5115
7d596384
JD
51162006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
5117
5118 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
5119 (whether successful or failed) so that yypush_parse can be invoked
5120 again to start a new parse using the same yypstate.
5121 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
5122 check multiple yypull_parse invocations on the same yypstate. For pull
5123 mode, extend to check multiple yyparse invocations.
5124 (Exploding the Stack Size with Alloca): Extend to try with
5125 %push-pull-parser.
5126 (Exploding the Stack Size with Malloc): Likewise.
5127
5128 * tests/calc.at (Simple LALR Calculator): Don't specify
5129 %skeleton "push.c" since %push-pull-parser implies that now.
5130 * tests/headers.at (export YYLTYPE): Don't check for the push
5131 declarations. Otherwise, this test case can't be used to see if push
5132 mode can truly emulate pull mode.
5133 * tests/input.at (Torturing the Scanner): Likewise.
5134 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
5135 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
5136 AT_YACC_IF, which now includes the case of push mode since %skeleton
5137 need not be used for push mode. This will be more intuitive once
5138 push.c is renamed to yacc.c.
5139
7172e23e
JD
51402006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
5141
5142 For push mode, convert yyparse from a macro to a function, invoke yylex
5143 instead of passing a yylexp argument to yypull_parse, and don't
5144 generate yypull_parse or yyparse unless %push-pull-parser is declared.
5145 Discussed starting at
5146 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
5147 * data/bison.m4 (b4_pull_if): New.
5148 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
5149 * data/push.c: Improve M4 quoting a little.
5150 (b4_generate_macro_args, b4_parenthesize): Remove.
5151 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
5152 any time a pull parser is requested.
5153 Don't #define this as a wrapper around yypull_parse. Instead, when
5154 both push and pull are requested, make it a function that does that
5155 same thing.
5156 (yypull_parse): If there's a b4_prefix, #define this to
5157 b4_prefix[pull_parse] when both push and pull are requested.
5158 Don't define this as a function unless both push and pull are
5159 requested.
5160 Remove the yylexp argument and hard-code yylex invocation instead.
5161 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
5162 %push-parser.
5163 * src/getargs.c (pull_parser): New global initialized to true.
5164 * getargs.h (pull_parser): extern it.
5165 * src/output.c (prepare): Insert pull_flag muscle.
5166 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
5167 (prologue_declaration): Set both push_parser and pull_parser = true for
5168 %push-pull-parser. Set push_parser = true and pull_parser = false for
5169 %push-parser.
5170 * src/scan-gram.l: Don't accept %push_parser as an alternative to
5171 %push-parser since there's no backward-compatibility concern here.
5172 Scan %push-pull-parser.
5173 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
5174 instead of %push-parser.
5175 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
5176 prototype it in the module that calls yyparse.
5177 * tests/input.at (Torturing the Scanner): Likewise.
5178 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
5179
2e7944cb
JD
51802006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
5181
5182 Update etc/bench.pl. Optimize push mode a little (the yyn change
5183 deserves most of the credit).
5184 * Makefile.am (SUBDIRS): Add etc subdirectory.
5185 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
5186 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
5187 yytoken, yyval, and yyloc declarations to...
5188 (yyparse or yypush_parse): ... here to improve performance. For
5189 yypush_parse invocations after the first, be sure to assign yyn its old
5190 value again.
5191 (yypstate_new): Don't bother initializing the yyresult field since the
5192 initial value isn't used.
5193 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
5194 remove the #define that, in push mode, set it to yyps->NAME.
5195 * etc/Makefile.am: New.
5196 * etc/bench.pl: Remove and build it instead from...
5197 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
5198 "tests/bison" from the build directory by default rather than just
5199 invoking "bison" from $PATH.
5200 (calc_grammar): Update push parser code: don't declare yylval globally,
5201 don't define yyparse_wrapper, and don't #define yyparse.
5202 (bench_grammar): Update to check all working combinations of yacc.c,
5203 push.c, impure, pure, pull, and push.
5204
c3d50342
JD
52052006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
5206
5207 For push mode, add pull wrappers around yypush_parse.
5208 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
5209 (yypull_parse): New function wrapping yypush_parse.
5210 (yyparse): New #define wrapping yypull_parse.
5211 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
5212 is declared.
5213 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
5214 prototype yylex in the module that calls yyparse, and don't prototype
5215 yyparse there. Otherwise, the yyparse expansion won't compile.
5216 * tests/input.at (Torturing the Scanner): Likewise.
5217
94ebeba5
JD
52182006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
5219
5220 Enable push parsers to operate in impure mode. Thus, %push-parser no
5221 longer implies %pure-parser. The point of this change is to move
5222 towards being able to test the push parser code by running the entire
5223 test suite as if %push-parser had been declared.
5224 * data/push.c (yypush_parse): For impure mode, remove the
5225 yypushed_char, yypushed_val, and yypushed_loc arguments.
5226 Instead, declare these as local variables initialized to the global
5227 yychar, yylval, and yylloc.
5228 For the first yypush_parse invocation only, restore the initial values
5229 of these global variables when it's time to read a token since they
5230 have been overwritten.
5231 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
5232 %push-parser.
5233 * tests/calc.at (Simple LALR(1) Calculator): Always declare
5234 %pure-parser along with %push-parser since this test case was designed
5235 for pure push parsers.
5236 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
5237 (AT_YACC_OR_PUSH_IF): New.
5238 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
5239 add a note that it's still wrong for some cases (as it has been for a
5240 while).
5241 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
5242 %push-parser no longer implies %pure-parser.
5243
a0633178
JD
52442006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
5245
5246 Remove some unnecessary differences between the pull parser code and
5247 the push parser code. This patch enables yynerrs in push mode.
5248 * data/push.c: Reformat M4 a little.
5249 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
5250 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
5251 because push mode is on. Instead, if pure mode is on, move yynerrs
5252 to...
5253 (b4_declare_parser_state_variables): ... here.
5254 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
5255 to yyps->NAME so it can be used in yypush_parse.
5256 (yypush_parse): Don't omit uses of yynerrs in push mode.
5257
8646b6a3
JD
52582006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
5259
5260 Fix bug such that the first pushed token's value and location are
5261 sometimes overwritten (sometimes by %initial-action) before being used.
5262 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
5263 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
5264 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
5265 more closely mimic the pull parser logic.
5266 Don't copy the pushed token to yychar, yylval, and yylloc until it's
5267 time to read a token, which is after any initialization of yylval and
5268 yylloc.
5269 (gottoken): Rename label to...
5270 (yyread_pushed_token): ... for clarity and to avoid infringing on the
5271 user namespace.
5272
9baf4d74
JD
52732006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
5274
5275 Rearrange initialization of the parser state variables so that the
5276 skeleton doesn't have to have a copy for pull mode and another for push
5277 mode. This patch also fixes at least a bug such that yylloc was not
5278 initialized (with b4_location_initial_line and
5279 b4_location_initial_column) upon calling yypush_parse. However, that
5280 initialization now overwrites the first token's location;
5281 %initial-action assigning @$ already did the same thing, and both bugs
5282 will be fixed in a later patch.
5283 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
5284 (b4_declare_parser_state_variables): Remove initialization of yytoken,
5285 yyss, yyvs, yyls, and yystacksize.
5286 (yypstate_new): Remove initialization of some yypstate fields: yystate,
5287 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
5288 yylsp.
5289 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
5290 yyps->NAME so it can be used in yypush_parse.
5291 (yyparse or yypush_parse): For yypush_parse, don't print the
5292 "Starting parse" diagnostic for invocations after the first.
5293 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
5294 yypush_parse, only do it for the first invocation.
5295 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
5296 initialization to occur in yypush_parse but only on the first
5297 invocation.
5298
23522164
JD
52992006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
5300
5301 * data/push.c: Add CPP guards around push parser declarations in both
5302 the header and the code file.
5303 In the code file, move the push parser declarations to the same place
5304 they appear in the header file.
5305 Clean up the M4 some, especially the inconsistent underquoting in
5306 some b4_c_function_def and b4_c_function_decl uses.
5307
bb010fe5
JD
53082006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
5309
5310 Encapsulate the push parser state variables into an M4 macro so the
5311 push skeleton doesn't have to list them again for pull mode's yyparse.
5312 For push mode, remove yypush_parse's local equivalents of these
5313 variables to eliminate unnecessary copying between the two sets at
5314 run-time. This patch also fixes at least a bug related to multiple
5315 %initial-action invocations in push mode.
5316 * data/push.c (b4_declare_parser_variables): Rename to...
5317 (b4_declare_scanner_communication_variables): ... this for clarity and
5318 update both uses.
5319 (b4_declare_yyparse_variables): Remove and move its contents to the one
5320 spot where it was invoked.
5321 (b4_declare_parser_state_variables): New macro containing the parser
5322 state variables required by push mode.
5323 (struct yypstate): Replace all fields but yynew with
5324 b4_declare_parser_state_variables.
5325 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
5326 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
5327 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
5328 (yyparse or yypush_parse): For yyparse in pull mode, replace local
5329 parser state variable declarations with
5330 b4_declare_parser_state_variables.
5331 Don't initialize parser state variables when calling yypush_parse since
5332 yypstate_new already does that.
5333 Invoke the user's initial action only upon the first yypush_parse
5334 invocation.
5335 Remove all code that copies between the local parser state variables
5336 and the yypstate.
5337
2d212f8c
JD
53382006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
5339
5340 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
5341 prevent a name collision in a future patch where these names will
5342 sometimes be #define'd.
5343 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
5344 since it no longer has the same name as the existing argument.
5345 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
5346
e6e704dc
JD
53472006-12-19 Paolo Bonzini <bonzini@gnu.org>
5348 and Joel E. Denny <jdenny@ces.clemson.edu>
5349
5350 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
5351 that the argument is case-insensitive, and there's no `=' here.
5352 For the %skeleton entry, mention that %language is better.
5353 (Bison Options): Likewise for --language and --skeleton. Move the
5354 --skeleton entry so that the `Tuning the parser' section is sorted
5355 alphabetically on long options.
5356 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
5357 %language directive in detail here; cross-reference the %language
5358 documentation instead.
5359 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
5360 `%require "2.3b"' so that the example is always up-to-date.
148d66d8 5361 (Table of Symbols): Add entries for %language and %skeleton.
e6e704dc
JD
5362 * examples/extexi (normalize): Instead of replacing every %require
5363 argument with the current Bison version, just substitute for
5364 `@value{VERSION}'. This guarantees that we're testing what actually
5365 appears in the documentation.
5366 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
5367 rather than `@VERSION@'.
5368
0e021770
PE
53692006-12-18 Paul Eggert <eggert@cs.ucla.edu>
5370
fd575f05
PE
5371 * NEWS: Reword the %language news a bit, and put it earlier.
5372
0e021770
PE
5373 * src/getargs.c (skeleton_arg): Last arg is now location const *.
5374 Rewrite to simplify the logic.
5375 (language_argmatch): Likewise.
fd575f05
PE
5376 (program_name): We now own this var.
5377 * src/getargs.h (struct bison_language): Use char[] rather than
5378 const char *.
0e021770
PE
5379
5380 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
5381 Java is supported.
5382 * src/complain.c (program_name): Remove decl; no longer needed.
5383 * src/main.c (program_name): Remove; now belongs to getargs.
5384
53852006-12-18 Paolo Bonzini <bonzini@gnu.org>
5386
5387 * NEWS: Document %language.
5388
5389 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
5390
5391 * data/c-skel.m4, data/c++-skel.m4: New files.
5392 * data/glr.c: Complain on push parsers.
5393
5394 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
5395 over %skeleton.
148d66d8 5396 (Decl Summary): Document %language and %skeleton.
0e021770
PE
5397 (Command line): Document -L.
5398
5399 * examples/extexi: Rewrite %require directive.
5400 * examples/calc++/Makefile.am: Pass VERSION to extexi.
5401
5402 * src/files.c (compute_exts_from_gc): Look in language structure
5403 for .y extension.
5404 (compute_file_name_parts): Check whether .tab should be added.
5405 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
5406 (language, skeleton_arg, language_argmatch): New.
5407 (long_options): Add --language.
5408 (getargs): Use skeleton_arg, add -L/--language.
5409 * src/getargs.h: Include location.h.
5410 (struct bison_language, language, skeleton_arg, language_argmatch): New.
5411 * src/output.c (prepare): Pick default skeleton from struct language.
5412 Don't dispatch C skeletons here.
5413 * src/parse-gram.y (PERCENT_LANGUAGE): New.
5414 (prologue_declaration): Add "%language" rule, use skeleton_arg.
5415 * src/scan-gram.l ("%language"): New rule.
5416
5417 * tests/calc.at: Test %skeleton and %language.
5418 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
5419 (AT_GLR_IF): Look for %skeleton "glr.cc".
5420 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
5421 (AT_YACC_IF): Reject %language.
5422
5691bf57
PE
54232006-12-18 Paul Eggert <eggert@cs.ucla.edu>
5424
db06f0ce
PE
5425 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
5426 since it wasn't used; only the typedef name 'semantic_type' is needed.
5427 Also, omit trailing white space.
5428
5691bf57
PE
5429 * bootstrap: Sync from coreutils.
5430 (gnulib_extra_files): Add build-aux/announce.gen.
5431 (slurp): Adjust .gitignore files like .cvsignore files.
5432 * build-aux/announce-gen: Remove from CVS, since bootstrap
5433 now creates this.
5434
791934e4
JD
54352006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
5436
5437 Make %push-parser imply %pure-parser. This fixes several bugs; see
5438 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
5439 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
5440 pure_parser = true.
5441 * data/push.c: Don't bother testing b4_push_if when deciding whether
5442 to expand b4_declare_parser_variables globally.
5443 (yypush_parse): Likewise in here.
5444
5445 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
5446 (yy_reduce_print): Reformat M4 for readability.
5447
ee5abb37
JD
54482006-12-15 Bob Rossi <bob@brasko.net>
5449 and Joel Denny <jdenny@ces.clemson.edu>
5450
5451 * data/push.c (yypstate): Add typedef, and update all uses of
5452 struct yypstate to just yypstate.
5453 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
5454
16ca01f9
JD
54552006-12-14 Bob Rossi <bob@brasko.net>
5456
5457 * data/push.c (yypush_parse): Declare prototype regardless of
5458 %locations option.
5459
ab8e7e1a
JD
54602006-12-14 Bob Rossi <bob@brasko.net>
5461
5462 * data/push.c (yyparse): Remove the prototype and the #define when in
5463 push-parser mode.
5464
9bf32be3
JD
54652006-12-13 Bob Rossi <bob@brasko.net>
5466
5467 * data/push.c (yypstate_init): Rename to...
5468 (yypstate_new): ... this and use b4_c_function_def.
5469 (yypstate_delete): New.
5470 (yypush_parse): Change parameters yynval and yynlloc to be const.
5471 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
5472 yypstate_delete functions.
5473
f02e2948
JD
54742006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
5475
5476 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
5477 strange test case titles. Reported by Bob Rossi.
5478
38eb7751
PE
54792006-12-13 Paul Eggert <eggert@cs.ucla.edu>
5480
5481 * TODO: Add pointer to Sylvain Schmitz's work on static detection
5482 of potential ambiguities in GLR grammers.
5483
bd9d212b
JD
54842006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
5485
5486 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
5487 `bison ', use m4_index instead of m4_substr since chopping up a string
5488 containing M4-special characters causes problems here.
5489
5490 Fix a couple of bugs related to special characters in user-specified
5491 file names, and make it easier for skeletons to compute output file
5492 names with the same file name prefix as Bison-computed output file
5493 names.
5494 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
5495 b4_parser_file_name and b4_spec_defines_file instead of
5496 @output_parser_name@ and @output_header_name@, which are now redundant.
5497 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
5498 b4_parser_file_name, b4_spec_defines_file, and the new
5499 @basename(FILENAME@) instead of @output_parser_name@ and
5500 @output_header_name@, which inappropriately escaped the file names as
5501 C string literals.
5502 * src/files.c (all_but_ext): Remove static qualifier.
5503 (compute_output_file_names): Move `free (all_but_ext)' to...
5504 (output_file_names_free): ... here since all_but_ext is needed later.
5505 * src/files.h (all_but_ext): Extern.
5506 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
5507 exactly what MUSCLE_INSERT_STRING used to do.
5508 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
5509 characters are escaped properly.
5510 * src/output.c (prepare): Define muscle file_name_all_but_ext as
5511 all_but_ext.
5512 For pkgdatadir muscle, maintain previous functionality by using
5513 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
5514 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
5515 digraphs would never be expanded. Hopefully no one has M4-special
5516 characters in his Bison installation path.
5517 * src/scan-skel.l: Don't parse @output_header_name@ and
5518 @output_parser_name@ anymore since they're now redundant.
5519 In @output, use decode_at_digraphs.
5520 Parse a new @basename command that invokes last_component.
5521 (decode_at_digraphs): New.
5522 (BASE_QPUTS): Remove unused.
5523 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
5524 (Output file name): New tests.
5525
3f7ca628
JD
55262006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
5527
5528 Warn about output files that are generated by the skeletons and that
5529 conflict with other output files.
5530 * data/glr.c: Don't generate the header file here when glr.cc does.
5531 * src/files.c (file_names, file_names_count): New static globals.
5532 (compute_output_file_names): Invoke output_file_name_check for files
5533 not generated by the skeletons and remove existing checks.
5534 (output_file_name_check): New function that warns about conflicting
5535 output file names.
5536 (output_file_names_free): Free file_names.
5537 * src/files.h (output_file_name_check): Declare.
5538 * src/scan-skel.l: Invoke output_file_name_check for files generated by
5539 the skeletons.
5540 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
5541 (Conflicting output files): New tests.
5542
178e123e
PE
55432006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5544
5545 * doc/bison.texinfo: Fix a couple of typos.
5546
55472006-12-08 Bob Rossi <bob@brasko.net>
8def5cd0
JD
5548
5549 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
5550 Rename to...
5551 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
5552 update all uses.
5553 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
5554 (yypush_parse): Rename yypvars argument to yyps and remove redundant
5555 local pv.
5556 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
5557 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
5558
ea17f233
JD
55592006-12-07 Bob Rossi <bob@brasko.net>
5560 and Joel Denny <jdenny@ces.clemson.edu>
5561
5562 * data/push.c (yypvarsinit): Change return type from void* to struct
5563 yypvars*. No longer cast to void* on return.
5564 (struct yypvars): Remove yylen since it need not be remembered between
5565 yypushparse invocations.
5566 (yypushparse): Don't copy between yylen and pv->yylen.
5567
55a30bda
JD
55682006-12-05 Bob Rossi <bob@brasko.net>
5569
5570 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
5571 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
5572 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
5573 (struct yypvars): Remove b4_declare_parser_variables.
5574 (yypvarsinit): Remove init code for removed variables.
5575 (global scope): Do not declare b4_declare_parser_variables if
5576 push or pure mode.
5577 (yypushparse): Add b4_declare_parser_variables.
5578 Init new local variables, and remove init code for removed
5579 yypvars variables.
5580 (yyparse): Delete.
5581 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
5582 and yyparse for other modes.
5583 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
5584 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
5585 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
5586 (AT_PURE_LEX_IF): True if pure or push parser.
5587
85894313
JD
55882006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
5589
5590 Document Yacc prologue alternatives and default %destructor's and
5591 %printer's as experimental. Don't mention Java yet. Discussed at
5592 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
5593 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
5594 (2.3a): Annotate this entry to say the old forms of these features were
5595 also experimental.
5596 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
148d66d8 5597 Table of Symbols): Say they're experimental. Comment out any mention
85894313
JD
5598 of Java (we'll want this back eventually).
5599
02975b9a
JD
56002006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
5601
5602 Support a file name argument to %defines. Deprecate `=' in
5603 %file-prefix, %name-prefix, and %output. Discussed at
5604 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
5605 * NEWS (2.3a+): Mention.
148d66d8 5606 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
02975b9a
JD
5607 form of %defines, and remove `=' from entries for %file-prefix,
5608 %name-prefix, and %output.
5609 * src/parse-gram.y (prologue_declaration): Implement.
5610 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
5611 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
5612 all but one occurrence of %name-prefix.
5613 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
5614 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
5615 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
5616 occurrence of each of %file-prefix and %output. Add check for %defines
5617 with argument.
5618 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
5619 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
5620 Remove the `=' from %output.
5621
287b314e
JD
56222006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
5623
5624 Don't escape $ in test case titles since Autoconf 2.61 now does that
5625 correctly.
5626 * tests/actions.at (Default %printer and %destructor are not for error
5627 or $undefined): Here.
5628 (Default %printer and %destructor are not for $accept): Here.
5629 * tests/input.at (Invalid $n and @n): Here.
5630
3ebecc24
JD
56312006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
5632
5633 Rename <!> to <>. Discussed starting at
5634 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
5635 * NEWS (2.3a+): Update.
148d66d8 5636 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
3ebecc24
JD
5637 Update.
5638 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
5639 * src/scan-gram.l (INITIAL): Implement.
5640 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
5641 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
5642 comment.
5643 * tests/actions.at (Default tagless %printer and %destructor,
5644 Default tagged and per-type %printer and %destructor,
5645 Default %printer and %destructor are not for error or $undefined,
5646 Default %printer and %destructor are not for $accept,
5647 Default %printer and %destructor for mid-rule values): Update.
5648 * tests/input.at (Default %printer and %destructor redeclared,
5649 Unused values with default %destructor): Update.
5650
26b8a438
JD
56512006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
5652
5653 Don't let %prec take a nonterminal.
5654 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
5655 token.
5656 * tests/input.at (%prec takes a token): New test checking that %prec
5657 won't take a nonterminal.
5658
07c39ae9
JD
56592006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
5660
405d53b7
JD
5661 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
5662 it was double-quoted.
07c39ae9
JD
5663 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
5664 grammar is maintained with Bison's highest standards.
5665 * src/getargs.c: Fix some typos in Doxygen comments.
5666
580b8926
JD
56672006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
5668
5669 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
5670 later. Reported by Paul Eggert in
5671 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
5672 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
5673 * src/scan-code.l (translate_action): Don't bother invoking
5674 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
5675 (code_scanner_free): Instead of invoking
5676 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
5677 which frees more.
5678 * src/scan-gram.l (gram_scanner_free): Likewise.
5679 * src/scan-skel.l (scan_skel): Likewise.
5680
4502eadc
JD
56812006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
5682
5683 * src/files.c (tr): Change return type to void.
5684 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
5685 has been called previously for the same key.
5686 (muscle_find): Return storage instead of value so that
5687 --enable-gcc-warnings doesn't produce warnings that the return discards
5688 const. aver that the value and storage are the same since storage
5689 could potentially be NULL when value is not.
5690 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
5691 same as 0.
5692
7746c8f6
PE
56932006-11-08 Paul Eggert <eggert@cs.ucla.edu>
5694
5695 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
5696 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
5697 us a slightly cleaner distribution, and also works.
5698 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
5699 gnulib changes.
5700
eb095650
PE
57012006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
5702 and Paul Eggert <eggert@cs.ucla.edu>
5703
5704 Don't let Bison leak memory except when it complains.
5705 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
5706 (spec_defines_file, dir_prefix): Now char *, not const char *,
5707 since they are freed.
5708 * src/files.c: Likewise.
5709 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
5710 Likewise.
5711 (tr): Now operates in-place. All uses changed.
5712 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
5713 values.
5714 (compute_file_name_parts, compute_output_file_names): Don't store
5715 read-only data in variables that will be freed.
5716 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
5717 src_extension, and header_extension.
5718 (output_file_names_free): New public function to free
5719 spec_verbose_file, spec_graph_file, spec_defines_file,
5720 parser_file_name, and dir_prefix.
5721 * src/getargs.c (getargs): Don't store read-only data in variables that
5722 will be freed.
5723 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
5724 (which previously existed but was unused), and quotearg_free.
5725 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
5726 * src/muscle_tab.c: Likewise.
5727 (muscle_entry): Make the value char const *,
5728 and add a new storage member that is char * and can be freed.
5729 (muscle_entry_free): New private function.
5730 (muscle_init): Use it instead of free.
5731 (muscle_insert, muscle_grow): Update and use new storage member.
5732 (muscle_code_grow): Free the string passed to muscle_grow
5733 since it's not needed anymore.
5734 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
5735 add a new `char *code' member.
5736 ("{...}"): Declare semantic type as code.
5737 * src/scan-code.h (translate_rule_action):
5738 (translate_symbol_action, translate_code, translate_action): Return
5739 `char const *' rather than `char *' since external code should not free
5740 these strings.
5741 * src/scan-code.l: Likewise.
5742 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
5743 which is "{...}" in the parser.
5744 * tests/Makefile.am (maintainer-check-valgrind): Set
5745 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
5746 Valgrind.
5747 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
5748 complain.
5749 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
5750 expecting a non-zero exit status sets --leak-check=summary and
5751 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
5752 this case, and we don't want to hear about it.
5753
ac564be4
PE
57542006-11-08 Paul Eggert <eggert@cs.ucla.edu>
5755
5756 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
5757 instead of from the template, to simplify configuration a bit.
5758 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
5759 and m4/wint_t.m4, as they are needed with the latest gnulib.
5760
17bd8a73
JD
57612006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
5762
5763 Disable unset/unused mid-rule value warnings by default, and recognize
5764 --warnings=midrule-values to enable them. Discussed starting at
5765 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
5766 * NEWS (2.3a+): Mention.
5767 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
5768 warnings): Add entry for midrule-values subargument.
5769 * src/reader.c (symbol_should_be_used): Don't return true just because
5770 the value is a set/used mid-rule value unless
5771 --warnings=midrule-values was specified.
5772 * tests/input.at (Unused values, Unused values before symbol
5773 declarations): Run tests with and without --warnings=midrule-values.
5774
5775 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
5776 than LIST_FREE directly.
5777
89eb3c76
JD
57782006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
5779
5780 Finish implementing --warnings=error, which should not be implied by
5781 --warnings=all (or by its synonyms -W and --warnings without
5782 subarguments).
5783 * src/complain.c (set_warning_issued): New function to report that
5784 warnings are being treated as errors and to record an error if so.
5785 Invoke...
5786 (warn_at, warn): ... here.
5787 * src/getargs.c (warnings_args, warnings_types): Reorder so that
5788 "error - warnings are errors" does not appear above "all - all of the
5789 above".
5790 (getargs): For -W and --warnings without subarguments, don't let
5791 FLAGS_ARGMATCH set warnings_error in warnings_flag.
5792 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
5793
ba7560e2
JD
57942006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
5795
5796 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
5797 empty subargument list. For example: `bison --warnings= parser.y'.
5798
31283fc3
JD
57992006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
5800
5801 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
5802 the parser header file so that gcc doesn't warn.
5803
12e35840
JD
58042006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
5805
5806 Split the default %destructor/%printer into two kinds: <*> and <!>.
5807 Discussed starting at
5808 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
5809 * NEWS (2.3a+): Mention.
5810 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
5811 previous change today related to mid-rules.
148d66d8 5812 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
3ebecc24 5813 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
12e35840
JD
5814 (TYPE_TAG_ANY): Add as <*>.
5815 (TYPE_TAG_NONE): Add as <!>.
5816 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
5817 for <*> and <!>.
5818 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
5819 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
5820 * src/symlist.c (symbol_list_default_new): Split into tagged and
5821 tagless versions.
5822 (symbol_list_destructor_set, symbol_list_printer_set): Split
5823 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
5824 SYMLIST_DEFAULT_TAGLESS.
5825 * src/symlist.h: Update symbol_list_default*_new prototypes.
5826 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
5827 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
5828 * src/symtab.c (default_destructor, default_destructor_location,
5829 default_printer, default_printer_location): Split each into tagged and
5830 tagless versions.
5831 (symbol_destructor_get, symbol_destructor_location_get,
5832 symbol_printer_get, symbol_printer_location_get): Implement tagged
5833 default and tagless default cases.
5834 (default_destructor_set, default_printer_set): Split each into tagged
5835 and tagless versions.
5836 * src/symtab.h: Update prototypes.
5837 * tests/actions.at (Default %printer and %destructor): Rename to...
5838 (Default tagless %printer and %destructor): ... this, and extend.
5839 (Per-type %printer and %destructor): Rename to...
5840 (Default tagged and per-type %printer and %destructor): ... this, and
5841 extend.
5842 (Default %printer and %destructor for user-defined end token): Extend.
5843 (Default %printer and %destructor are not for error or $undefined):
5844 Update.
5845 (Default %printer and %destructor are not for $accept): Update.
5846 (Default %printer and %destructor for mid-rule values): Extend.
5847 * tests/input.at (Default %printer and %destructor redeclared): Extend.
5848 (Unused values with default %destructor): Extend.
5849
f91b1629
JD
58502006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
5851
5852 Don't apply the default %destructor/%printer to an unreferenced midrule
5853 value. Mentioned at
5854 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
5855 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
5856 like $@n instead of just @n so that the default %destructor/%printer
5857 logic doesn't see them as user-defined symbols.
5858 (symbol_is_dummy): Check for both forms of the name.
5859 * src/reader.c (packgram): Remove the `$' from each midrule symbol
5860 name for which the midrule value is referenced in any action.
5861 * tests/actions.at (Default %printer and %destructor for mid-rule
5862 values): New test.
5863 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
5864 for change to dummy symbol names.
5865
519d0004
JD
58662006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
5867
5868 Warn about unset midrule $$ if the corresponding $n is used.
5869 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
5870 $n usage.
5871 (packgram): Before invoking grammar_rule_check on any rule, make sure
5872 all actions have already been scanned in order to set `used' flags.
5873 Otherwise, checking that a midrule's $$ is set will not always work
5874 properly because the midrule check must forward-reference the midrule's
5875 parent rule.
5876 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
5877 warning.
5878
a501eca9
JD
58792006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
5880
5881 More improvements to the documentation of the prologue alternatives:
5882 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
5883 Bison manual.
5884 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
5885 some text to clarify the relative importance of the new directives and
5886 to show how these directives may be viewed as code labels.
5887
2cbe6b7f
JD
58882006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
5889
5890 Similar to the recently removed %before-header, add %code-top as the
5891 alternative to the pre-prologue. Mentioned at
5892 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
5893 Also, let the prologue alternatives appear in the grammar section.
5894 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
5895 (prologue_declaration): Move the existing prologue alternatives to...
5896 (grammar_declaration): ... here and add %code-top.
5897 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
5898
5899 Clean up and extend documentation for the prologue alternatives.
5900 * NEWS (2.3a+): Describe prologue alternatives.
5901 * doc/bison.texinfo (Prologue): Move discussion of prologue
5902 alternatives to...
5903 (Prologue Alternatives): ... this new section, and extend it to discuss
5904 all 4 directives in detail.
148d66d8
JD
5905 (Table of Symbols): Clean up discussion of prologue alternatives and
5906 add %code-top.
2cbe6b7f 5907
e557d3ea
JMG
59082006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5909
5910 DJGPP specific issues.
5911
5912 * djgpp/config.bat: config.hin has been moved to lib. Adjust
5913 config.bat accordingly.
5914 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
5915 * djgpp/config.site: Likewise.
5916
136a0f76
PB
59172006-10-16 Paolo Bonzini <bonzini@gnu.org>
5918
27bd5d67
PB
5919 Replace %*-header with %provides, %requires, %code. See discussion at
5920 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
5921
136a0f76
PB
5922 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
5923 (b4_user_start_header): Remove.
5924 * data/glr.c: Use new macros instead of b4_*start_header
5925 and b4_*end_header.
5926 * data/glr.cc: Likewise.
5927 * data/lalr1.cc: Likewise.
5928 * data/push.c: Likewise.
5929 * data/yacc.c: Likewise.
5930
5931 * doc/bison.texinfo: Remove %before-header, rename
5932 %{start,end,after}-header to %requires, %provides, %code.
5933
5934 * src/parse-gram.y: Likewise (also rename token names accordingly).
5935 * src/scan-gram.l: Likewise.
5936 * tests/actions.at: Likewise.
5937
10f429ef
PE
59382006-10-14 Paul Eggert <eggert@cs.ucla.edu>
5939
5940 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
5941 Problem reported by Joel E. Denny.
5942
59432006-10-14 Jim Meyering <jim@meyering.net>
5944
5945 (Sync from coreutils.)
5946 Work also when the working directory (with e.g. coreutils sources)
5947 is version controlled with git, rather than CVS.
5948 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
5949 rather than CVS.
5950 In messages and comments, say e.g., "checked-out sources",
5951 rather than "CVS sources".
5952 (version_controlled_file): New function. Work for git as well as
5953 for CVS. Don't use grep's -q option.
5954 (slurp): Call it here, in place of CVS-specific code.
5955
c4bd5bf7
JD
59562006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
5957
5958 Fix testsuite for ./configure --enable-gcc-warnings:
5959 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
5960 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
5961 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
5962 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
5963 * test/regression.at (Diagnostic that expects two alternatives):
5964 Likewise.
5965
46356ea4
PE
59662006-10-12 Paul Eggert <eggert@cs.ucla.edu>
5967
231ed89a
PE
5968 * bootstrap.conf (gnulib_modules): Add config-h.
5969 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
5970 worry about HAVE_CONFIG_H.
5971 * lib/abitset.c: Likewise.
5972 * lib/bitset.c: Likewise.
5973 * lib/bitset_stats.c: Likewise.
5974 * lib/bitsetv-print.c: Likewise.
5975 * lib/bitsetv.c: Likewise.
5976 * lib/ebitset.c: Likewise.
5977 * lib/get-errno.c: Likewise.
5978 * lib/lbitset.c: Likewise.
5979 * lib/subpipe.c: Likewise.
5980 * lib/timevar.c: Likewise.
5981 * lib/vbitset.c: Likewise.
5982 * lib/bitset.c: Include "bitset.h" first, to test interface.
5983 * lib/bitset_stats.c: Include "bitset_stats.h" first.
5984 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
5985 * lib/bitsetv.c: Include "bitsetv.h" first.
5986 * lib/get-errno.c: Include "get-errno.h" first.
5987 * m4/.cvsignore: Add config-h.m4.
5988 * tests/actions.at (Default %printer and %destructor for ...):
5989 Adjust expected line numbers in output to reflect removal of #if
5990 HAVE_CONFIG_H lines.
5991 * tests/glr-regression.at (Missed %merge type warnings when ...):
5992 Likewise.
5993 * tests/regression.at (Braced code in declaration in rules section):
5994 Likewise.
5995 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
5996 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
5997 Include <config.h> unconditionally.
5998
46356ea4
PE
5999 * bootstrap: Sync from coreutils, as follows:
6000
6001 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
6002
6003 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
6004 variable was sometimes used without being initialized. This
6005 messed up the installation of the INSTALL file in some cases.
6006
6007 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
6008
6009 * bootstrap (usage, main program, symlink_to_gnulib): Add option
6010 --copy. Inspired by a suggestion from Bruno Haible.
6011
6012 2006-10-03 Jim Meyering <jim@meyering.net>
6013
6014 * bootstrap: Undo last change to this file, since now gnulib-tool
6015 sticks with the automake default in generating dependencies.
6016
dd4bf078
PE
60172006-10-12 Paul Eggert <eggert@cs.ucla.edu>
6018
cf2a5f7c
PE
6019 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
6020 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
6021
6022 * doc/bison.1: Add copyright notice.
6023
6024 * data/glr.c: Don't include <stdarg.h>; not used.
6025
35fe0834
PE
6026 * NEWS: The -g and --graph options now output graphs in Graphviz
6027 DOT format, not VCG format.
6028 * doc/bison.1: Likewise.
6029 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
fcab4a2e
PE
6030 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
6031 of this change in
6032 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
35fe0834
PE
6033 * TODO: Remove Graphviz entry.
6034 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
6035 remove vcg.c, vcg.h, vcg_defaults.h.
6036 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
6037 * src/graphviz.c, src/graphviz.h: New files.
6038 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
6039 * src/files.h: Make comment more generic.
6040 * src/main.c (main): Likewise.
6041 * src/print_graph.h: Likewise.
6042 * src/getargs.c (usage): Make usage description more generic.
6043 * src/print_graph.c: Include graphviz.h rather than vcg.h.
6044 (static_graph, fgraph): Remove. All uses changed to pass
6045 arguments instead of sharing a static var.
6046 (print_core, print_actions, print_state, print_graph):
6047 Output graphviz format rather than VCG format.
6048 * tests/.cvsignore: Remove *.vcg; add *.dot.
6049 * tests/output.at: Expect *.dot files, not *.vcg files.
6050
dd4bf078
PE
6051 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
6052 accommodates the 2006-10-08 change.
6053
efdd7421
PE
60542006-10-11 Bob Rossi <bob@brasko.net>
6055
6056 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
6057 (b4_yyssa, b4_yyerror_range): New macros.
6058 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
6059 (yypvarsinit): Remove init of removed fields.
6060 (yypushparse): Remove use of removed fields; use new macros instead.
6061
96a1981a
PE
60622006-10-11 Paul Eggert <eggert@cs.ucla.edu>
6063
6064 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
6065 in a push parser. Reindent slightly to match yacc.c better.
6066
60672006-10-11 Bob Rossi <bob@brasko.net>
6068
46356ea4
PE
6069 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
6070 yymsg_alloc fields.
6071 (yypvarsinit, yypushparse): Remove init of removed fields.
6072 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
96a1981a 6073
c1630a8b
PE
60742006-10-09 Paul Eggert <eggert@cs.ucla.edu>
6075
6076 * THANKS: Add Paolo Bonzini and Bob Rossi.
6077
90b9908d
PB
60782006-10-08 Paolo Bonzini <bonzini@gnu.org>
6079
6080 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
6081 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
6082 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
6083 b4_define_user_cde and uses): Remove.
6084 (b4_comment, b4_prefix, b4_sync_start): New.
6085 * data/bison.m4: New file, with most of the content removed from c.m4.
6086 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
6087 * src/output.c (output_skeleton): Pass bison.m4.
6088 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
6089 only if specified.
6090
cf806753
PE
60912006-10-05 Paul Eggert <eggert@cs.ucla.edu>
6092
6093 Fix test failure reported by Tom Lane in
6094 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
6095 and try to make such failures easier to catch in the future.
6096 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
6097 that's now the caller's responsibility.
6098 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
6099 Set yychar = YYEOF if it's negative.
6100 * tests/actions.at (yylex): Abort if asked to read past EOF.
6101 * tests/conflicts.at (yylex): Likewise.
6102 * tests/cxx-type.at (yylex): Likewise.
6103 * tests/glr-regression.at (yylex): Likewise.
6104 * tests/input.at (yylex): Likewise.
6105 * tests/regression.at (yylex): Likewise.
6106 * tests/torture.at (yylex): Likewise.
6107
0e2f006a
PE
61082006-10-01 Paul Eggert <eggert@cs.ucla.edu>
6109
6110 Fix problems with translating English-language diagnostics.
6111 * bootstrap: Fix bug introduced in recent bootstrap changes, with
6112 respect to bison-runtime pot generation. The YY_ stuff
6113 wasn't being captured.
6114 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
6115 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
6116 * runtime-po/POTFILES.in: Add data/push.c.
6117
e3ddc1e3
PE
61182006-09-29 Paul Eggert <eggert@cs.ucla.edu>
6119
6120 Merge bootstrap changes from coreutils.
6121
6122 2006-09-28 Jim Meyering <jim@meyering.net>
6123
6124 Automatically generated dependencies are important even
6125 when all of the sources in a directory come from gnulib.
6126 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
6127 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
6128
6129 2006-09-23 Jim Meyering <jim@meyering.net>
6130
6131 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
6132
6133 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
6134
6135 * bootstrap: Add support for --force.
6136 (usage): New function. Describe usage less tersely.
6137 (CVS_only_file): New var.
6138
01e972b3
PE
61392006-09-21 Paul Eggert <eggert@cs.ucla.edu>
6140
6141 * data/push.c (YYPUSH_MORE): Make it an enum instead.
6142 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
6143 Adjust white space and comments to match GNU style better.
6144
c63d3e90
PE
61452006-09-20 Bob Rossi <bob@brasko.net>
6146
6147 * data/push.c (yyresult_get): Remove function.
6148 (YYPUSH_MORE): Add #define.
6149 (yypushparse): Modify return value.
6150
e70f46d1
PE
61512006-09-20 Paul Eggert <eggert@cs.ucla.edu>
6152
6153 * stamp-h.in: Remove; no longer needed.
6154 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
6155 Remove config.h, config.hin, intl (no longer created).
6156 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
6157 stamp-h1.
6158
6159 Sync bootstrap from coreutils, as follows:
6160
6161 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
6162
6163 * bootstrap (symlink_to_gnulib): New function.
6164 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
6165 to copies-of-gnulib.
6166 (cp_mark_as_generated, slurp, gnulib_files):
6167 Avoid making a copy if it's the same as the old version.
6168 (gnulib_files): Add support for this variable (used by Bison).
6169
a92be413
PE
61702006-09-20 Paul Eggert <eggert@cs.ucla.edu>
6171
6172 * src/getargs.c (usage): Rework to use conventions similar to
6173 coreutils, to make translation a bit easier and the code a bit
6174 smaller. Problem reported by Tim Van Holder.
6175
4f82b42a
PE
61762006-09-15 Paul Eggert <eggert@cs.ucla.edu>
6177
3b2942e6
PE
6178 Use some of gnulib's new modules, taken from coreutils.
6179
6180 * bootstrap: Sync from coreutils, except add support for gnulib_files.
6181 * bootstrap.conf: New file.
6182 (gnulib_modules): Add configmake, inttypes, unistd.
6183 (XGETTEXT_OPTIONS): Add complain, complain_at,
6184 fatal, fatal_at, warn, warn_at, unexpected_end.
6185 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
6186 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
6187 (gl_EARLY): Add.
6188 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
6189 (gl_INIT): Add
6190 (GNULIB_AUTOCONF_SNIPPET): Remove.
6191 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
6192 the pickiest.
6193 * lib/.cvsignore: Add inttypes_.h.
6194 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
6195 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
6196 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
6197 no-longer-necessary initializations.
6198 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
6199 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
6200 use the unistd module.
6201 * src/system.h: Likewise.
6202 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
6203 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
6204 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
6205 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
6206 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
6207 * src/system.h: Include inttypes.h unconditionally, now that we
6208 use the inttypes module. Don't bother to include stdint.h, since
6209 inttypes.h now does that for us.
6210 (LOCALEDIR): Remove, now that we use the configmake module.
6211 * src/getargs.c: Include configmake.h.
6212 * src/main.c: Likewise.
6213 * src/output.c: Likewise.
6214 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
6215 not from $abs_top_builddir, since config.h moved.
6216
6217
4f82b42a
PE
6218 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
6219 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
6220
6221 * src/parse-gram.y (symbol_declaration): Don't put statements
6222 before declarations; it's not portable to C89.
6223 * src/scan-code.l (handle_action_at): Likewise.
6224
6225 * src/scan-code.l: Always initialize braces_level; the old code
6226 left it uninitialized and therefore had undefined behavior.
6227
6228 Don't attempt to redefine 'assert', since it runs afoul of
6229 systems where standard headers (mistakenly) include <assert.h>.
6230 Instead, define and use our own alternative, called 'aver'.
6231 * src/reader.c: Don't include assert.h, since we no longer
6232 use assert.
6233 * src/scan-code.l: Likewise.
6234 * src/system.h (assert): Remove, replacing with....
6235 (aver): New function, taking a bool arg. All uses changed.
6236 * src/tables.c (pack_vector): Ensure that aver arg is bool,
6237 not merely an integer.
6238
31c10e38
PE
62392006-09-15 Bob Rossi <bob@brasko.net>
6240
6241 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
6242 * data/c.m4 (YYPUSH): New.
6243 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
6244 * src/getargs.c (push_parser): New var.
6245 * src/getargs.h (push_parser): New declaration.
6246 * src/output.c (prepare): Add macro insertion of `push_flag'.
6247 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
6248 (prologue_declaration): Parse %push-parser.
6249 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
6250 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
6251 list of removed lines from the traces observed.
6252 (AT_CHECK_CALC_LALR): Added push parser tests.
6253
fa7b79c0
PE
62542006-09-13 Paul Eggert <eggert@cs.ucla.edu>
6255
21fe08ca
PE
6256 * NEWS: Version 2.3a.
6257 * configure.ac (AC_INIT): Likewise.
6258
e8ec4d9b
PE
6259 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
6260 "#define YYSTYPE int" that caused "make maintainer-check" to fail
6261 due to header ordering dependencies. I don't know why the #define
6262 was there.
6263
fa7b79c0
PE
6264 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
6265 runtime cost when YYDEBUG is not defined, and so that some tests
6266 that used to fail now work. Problem and initial suggestion by
6267 Paolo Bonzini.
6268 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
6269 * data/glr.cc (b4_parser_class_name):
6270 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
6271 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
6272 (yydebug_) [YYDEBUG]: New member.
6273 (yycdebug_): Now defined only if YYDEBUG.
6274 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
6275 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
6276 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
6277 if YYYDEBUG.
6278 (debug_stream, set_debug_stream, debug_level, set_debug_level):
6279 Define only if YYDEBUG.
6280 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
6281 set_debug_level.
6282 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
6283 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
6284 AT_CHECK_CALC_GLR_CC that are working now.
6285
4ec13d60
PE
62862006-09-12 Paul Eggert <eggert@cs.ucla.edu>
6287
6288 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
6289 We don't need them in glr.cc, and glr.c defines them.
6290 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
6291 assumes that defining it to anything is the same as defining
6292 it to 1. Problem reported by Paolo Bonzini.
6293
8e1687ae
PE
62942006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
6295
6296 * data/c.m4 (b4_null, b4_case): Define.
6297 * src/output.c (prepare_symbols): Use b4_null.
6298 (user_actions_output): Use b4_case.
6299
3dc5e96b
PE
63002006-09-11 Paul Eggert <eggert@cs.ucla.edu>
6301
aef3da86
PE
6302 * data/glr.c (b4_shared_declarations): Put start-header first,
6303 before any #includes that we generate, so that feature-test
6304 macros work. Problem reported by Michael Deutschmann in
6305 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
6306 * data/lalr1.cc: Likewise.
6307 * doc/bison.texinfo (Prologue): Document that feature-test macros
6308 should be defined before any Bison declarations.
6309 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
6310 that depend on location.hh after, not before, Bison decls, since
6311 we now include location.hh after the first user prologue.
6312
3dc5e96b
PE
6313 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
6314 Sander Brandenburg in
6315 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
6316 Also, fix minor white space and comment issues.
aef3da86
PE
6317 (Prologue): Mention that it's better to define feature-test macros
6318 before Bison declarations. Problem reported by Michael Deutschmann.
6319
6320 * README-cvs: Fix typo: "&" should be "&&". Problem reported
6321 by Jim Meyering.
6322 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
6323 This adjusts to recent gnulib changes.
3dc5e96b 6324
b2a0b7ca
JD
63252006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
6326
6327 Finish implementation of per-type %destructor/%printer. Discussed
6328 starting at
6329 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
6330 and
6331 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
6332 * NEWS (2.3+): Add a description of this feature to the default
6333 %destructor/%printer description.
6334 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
6335 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
6336 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
6337 list node contains a semantic type.
6338 * src/symtab.c, src/symtab.h: Extend with a table that associates
6339 semantic types with their %destructor's and %printer's.
6340 (semantic_type_from_uniqstr, semantic_type_get,
6341 semantic_type_destructor_set, semantic_type_printer_set): New functions
6342 composing the public interface of that table.
6343 (symbol_destructor_get, symbol_destructor_location_get,
6344 symbol_printer_get, symbol_printer_location_get): If there's no
6345 per-symbol %destructor/%printer, look up the per-type before trying
6346 the default.
6347 * tests/actions.at (Per-type %printer and %destructor): New test case.
6348 * tests/input.at (Default %printer and %destructor redeclared):
6349 Extend to check that multiple occurrences of %symbol-default in a
6350 single %destructor/%printer declaration is an error.
6351 (Per-type %printer and %destructor redeclared, Unused values with
6352 per-type %destructor): New test cases.
6353
3be03b13
JD
63542006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
6355
6356 Require default %destructor/%printer to be declared using
6357 %symbol-default instead of an empty symbol list, and start working on
6358 new per-type %destructor/%printer. Discussed at
6359 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
6360 * NEWS (2.3+): Add %symbol-default to example.
6361 * bison.texinfo (Freeing Discarded Symbols): Likewise.
148d66d8 6362 (Table of Symbols): Add entry for %symbol-default.
3be03b13
JD
6363 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
6364 (generic_symlist, generic_symlist_item): New nonterminals for creating
6365 a list in which each item is a symbol, semantic type, or
6366 %symbol-default.
6367 (grammar_declaration): Use generic_symlist in %destructor and %printer
6368 declarations instead of symbols.1 or an empty list.
6369 (symbol_declaration, precedence_declaration, symbols.1): Update actions
6370 for changes to symbol_list.
6371 * src/reader.c: Update for changes to symbol_list.
6372 * src/scan-code.l: Likewise.
6373 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
6374 * src/symlist.c, src/symlist.h: Extend such that a list node may
6375 represent a semantic type or a %symbol-default in addition to just an
6376 ordinary symbol. Add switched functions for setting %destructor's and
6377 %printer's.
6378 * tests/actions.at, tests/input.at: Add %symbol-default to all default
6379 %destructor/%printer declarations.
6380
3508ce36
JD
63812006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
6382
6383 Whether the default %destructor/%printer applies to a particular symbol
6384 isn't a question of whether the user *declares* that symbol (in %token,
6385 for example). It's a question of whether the user by any means
6386 *defines* the symbol at all (by simply using a char token, for
6387 example). $end is defined by Bison whereas any other token with token
6388 number 0 is defined by the user. The error token is always defined by
6389 Bison regardless of whether the user declares it with %token, but we
6390 may one day let the user define error as a nonterminal instead.
6391 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
6392 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
6393 the meaning of "user-defined".
6394 * tests/actions.at (Default %printer and %destructor for user-declared
6395 end token): Rename to...
6396 (Default %printer and %destructor for user-defined end token): ...
6397 this.
6398
6399 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
6400 computation of whether to apply the default, don't maintain a list of
6401 every Bison-defined symbol. Instead, just check for a first character
6402 of '$', which a user symbol cannot have, and check for the error token.
6403
9350499c
JD
64042006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
6405
6406 Don't apply the default %destructor or %printer to the error token,
6407 $undefined, or $accept. This change fits the general rule that the
6408 default %destructor and %printer are only for user-declared symbols,
6409 and it solves several difficulties that are described in the new test
6410 cases listed below.
6411 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
6412 * tests/actions.at (Default %printer and %destructor are not for error
6413 or $undefined, Default %printer and %destructor are not for $accept):
6414 New test cases.
6415
4d7370cb
JD
64162006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
6417
6418 Allow %start after the first rule.
6419 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
6420 when parsing the first rule.
6421 (check_and_convert_grammar): Search for it here after all grammar
6422 declarations have been parsed. Skip midrules, which have dummy LHS
6423 nonterminals.
6424 * src/symtab.c (symbol_is_dummy): New function.
6425 * src/symtab.h (symbol_is_dummy): Declare it.
6426 * tests/input.at (%start after first rule): New test.
6427
6d0ef4ec
JD
64282006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
6429
6430 Redo some of the previous commit: add back the ability to use
6431 non-aliased/undeclared string literals since it might be useful to
6432 those declaring %token-table.
6433 * src/reader.c (check_and_convert_grammar): Undo changes in previous
6434 commit: don't worry about complaints from symbols_pack.
6435 * src/symtab.c (symbol_new, symbol_class_set,
6436 symbol_check_alias_consistency): Undo changes in previous commit: count
6437 each string literal as a new symbol and token, assign it a symbol
6438 number, and don't complain about non-aliased string literals.
6439 (symbols_pack): Since symbol_make_alias still does not decrement symbol
6440 and token counts but does still set aliased tokens to the same number,
6441 symbol_pack_processor now leaves empty slots in the symbols array.
6442 Remove those slots.
6443 * tests/regression.at (Undeclared string literal): Remove test case
6444 added in previous commit since non-aliased string literals are allowed
6445 again.
6446 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
6447 remove unnecessary string literal declarations.
6448 * tests/sets.at (Firsts): Likewise.
6449
965537bc
JD
64502006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
6451
6452 Don't allow an undeclared string literal, but allow a string literal to
6453 be used before its declaration.
6454 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
6455 symbols_pack complained.
6456 * src/symtab.c (symbol_new): Don't count a string literal as a new
6457 symbol.
6458 (symbol_class_set): Don't count a string literal as a new token, and
6459 don't assign it a symbol number since symbol_make_alias does that.
6460 (symbol_make_alias): It's not necessary to decrement the symbol and
6461 token counts anymore. Don't assume that an alias declaration occurs
6462 before any uses of the identifier or string, and thus don't assert that
6463 one of them has the highest symbol number so far.
6464 (symbol_check_alias_consistency): Complain if there's a string literal
6465 that wasn't declared as an alias.
6466 (symbols_pack): Bail if symbol_check_alias_consistency failed since
6467 symbol_pack asserts that every token has been assigned a symbol number
6468 although undeclared string literals have not.
6469 * tests/regression.at (String alias declared after use, Undeclared
6d0ef4ec 6470 string literal): New test cases.
965537bc
JD
6471 (Characters Escapes, Web2c Actions): Declare string literals as
6472 aliases.
6473 * tests/sets.at (Firsts): Likewise.
6474
47aee066
JD
64752006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
6476
6477 In the grammar scanner, STRING_FINISH unclosed constructs and return
6478 them to the parser in order to improve error messages.
6479 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
6480 SC_BRACED_CODE, SC_PROLOGUE): Implement.
6481 * tests/input.at (Unclosed constructs): New test case.
6482 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
6483 seen.
6484
6485 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
6486 unused global.
6487
1f6b3679
JD
64882006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
6489
6490 Handle string aliases for character tokens correctly.
6491 * src/symtab.c (symbol_user_token_number_set): If the token has an
6492 alias, check and set its alias's user token number instead of its own,
6493 which is set to indicate the alias. Previously, every occurrence of
6494 the character token in the grammar overwrote that alias indicator with
6495 the character code.
6496 * tests/input.at (String aliases for character tokens): New test.
6497
219741d8
JD
64982006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
6499
6500 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
6501
11daa4e7
PE
65022006-08-11 Paul Eggert <eggert@cs.ucla.edu>
6503
6504 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
6505 to prevent failures when building on older platforms.
6506 Check for autopoint failure.
6507 Set XGETTEXT_OPTIONS to values that check for C format strings,
6508 so that translators are warned about them (this also helps
6509 prevent core dumps).
6510
6511 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
6512 function, since it simplifies our code a bit.
6513
6514 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
6515 rather than -W, so we don't get bogus warnings about sign comparisons.
6516 Add -Wpointer-arith, since that warning is useful (it reports code
6517 that does not conform to C89 and that some compilers reject).
6518 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
6519 since it's no longer needed.
6520
f9bfc42a
JD
65212006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
6522
6523 Clean up scanners a bit.
6524 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
6525 definitions so gcc won't warn when obstack_for_string is unused.
6526 * src/scan-code.l: config.h and system.h are already #include'd by
6527 scan-code-c.c, so get rid of them here.
6528 * src/scan-gram.l: Likewise.
6529 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
6530 definitions rather than duplicating the rest of it.
6531 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
6532
06e8700a
JD
65332006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
6534
6535 Suppress signed/unsigned comparison warnings for yycheck.
6536 * data/c.m4 (b4_safest_int_type): New macro.
6537 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
6538 a signed int type, cast it to b4_safest_int_type first.
6539 * data/yacc.c: Likewise.
6540 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
6541 also overwritten.
6542
9c437126
PE
65432006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
6544
6545 * doc/bison.texinfo: Fix some typos.
6546
284d8a13
PE
65472006-08-02 Paul Eggert <eggert@cs.ucla.edu>
6548
6549 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
6550 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
6551
6552 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
6553 the latest gnulib does this a different way.
6554 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
6555 translation was patched, so stop omitting it.
6556
ec5479ce
JD
65572006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
6558
6559 Enable declaration of default %printer/%destructor. Make the parser
6560 use these for all user-declared grammar symbols for which the user does
6561 not declare a specific %printer/%destructor. Thus, the parser uses it
6562 for token 0 if the user declares it but not if Bison generates it as
6563 $end. Discussed starting at
6564 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
6565 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
6566 and
6567 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
6568 * NEWS (2.3+): Mention.
6569 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
6570 declare a %destructor for a mid-rule's semantic value. It's just
6571 impossible to declare one specific to it.
6572 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
6573 code. Describe default %destructor form.
6574 * src/parse-gram.y (grammar_declaration): Parse default
6575 %printer/%destructor declarations.
6576 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
6577 and symbol_destructor_location_get rather than accessing the destructor
6578 and destructor_location members of struct symbol.
6579 (symbol_printers_output): Likewise but for %printer's.
6580 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
6581 again.
6582 * src/symtab.c (default_destructor, default_destructor_location,
6583 default_printer, default_printer_location): New static global
6584 variables to record the default %destructor and %printer.
6585 (symbol_destructor_get, symbol_destructor_location_get,
6586 symbol_printer_get, symbol_printer_location_get): New functions to
6587 compute the appropriate %destructor and %printer for a symbol.
6588 (default_destructor_set, default_printer_set): New functions to set the
6589 default %destructor and %printer.
6590 * src/symtab.h: Prototype all those new functions.
6591 * tests/actions.at (Default %printer and %destructor): New test to
6592 check that the right %printer and %destructor are called, that they're
6593 not called for $end, and that $$ and @$ work correctly.
6594 (Default %printer and %destructor for user-declared end token): New
6595 test to check that the default %printer and %destructor are called for
6596 a user-declared end token.
6597 * tests/input.at (Default %printer and %destructor redeclared, Unused
6598 values with default %destructor): New tests to check related grammar
6599 warnings and errors.
6600
868d2d96
JD
66012006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
6602
6603 Clean up handling of %destructor for the end token (token 0).
6604 Discussed starting at
6605 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
6606 and
6607 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
6608
6609 Make the skeletons consistent in how they pop the end token and invoke
6610 its %destructor.
6611 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
6612 state, which has token number 0, since this would invoke the
6613 %destructor for the end token.
6614 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
6615 until after shifting the end token, or else it won't be popped.
6616 * data/yacc.c (yyparse): Likewise.
6617
6618 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
6619 it's the end token. Upon termination, destroy an unshifted lookahead
6620 even when it's the end token.
6621 * data/lalr1.cc (yy::parser::parse): Likewise.
6622 * data/yacc.c (yyparse): Likewise.
6623
6624 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
6625 value warnings for the end token when the user gives the end token a
6626 %destructor.
6627
6628 * tests/actions.at (Printers and Destructors): Test all the above.
6629
62a9592d
PE
66302006-07-24 Paul Eggert <eggert@cs.ucla.edu>
6631
6632 Update to latest gnulib and gettext versions.
6633 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
6634 Add fopen-safer.
6635 (gnulib_files): Add m4/warning.m4. Don't worry about files
6636 overwritten by autopoint.
6637 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
6638 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
6639 rejects them.
6640 Don't use autoreconf; instead, invoke autopoint etc. by hand,
6641 so that we can remove the intl files at a better time.
6642 (intl_files_to_remove): Remove aclocal.m4, since it gets
6643 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
6644 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
6645 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
6646 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
6647 Remove datarootdir hack; no longer needed.
6648 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
6649 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
6650 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
6651 strdup.h.
6652 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
6653 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
6654
10d6970f
PE
66552006-07-20 Paul Eggert <eggert@cs.ucla.edu>
6656
6657 * bootstrap: Adjust to today's change to gnulib-tool by invoking
6658 it with --assume-autoconf='latest-stable'.
6659
50a33993
JD
66602006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
6661
6662 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
6663 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
6664 YYSTYPE' and `{'.
6665 * src/muscle_tab.h (muscle_grow): Replace the header comments with
6666 those from muscle_tab.c since the old ones are misleading.
6667
2ce4ed68
AD
66682006-07-13 Akim Demaille <akim@epita.fr>
6669
6670 Support %define "KEY" {VALUE}.
6671 * src/scan-code.h, src/scan-code.l (translate_action)
6672 (translate_rule_action, translate_symbol_action, translate_code):
6673 Return char *, not const char *.
6674 * src/parse-gram.y (declaration): Rename as...
6675 (prologue_declaration): this.
6676 (string_content): Remove this nonterminal, use STRING.
6677 (braceless, content, content.opt): New nonterminal.
6678 Use them.
6679 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
6680 as value.
6681 * src/scan-gram.l (getargs.h): Don't include it.
6682
db7e5eb5
PE
66832006-07-12 Paul Eggert <eggert@cs.ucla.edu>
6684
6685 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
6686 rather than a for-loop that declares a local bool variable. This
6687 should work around a compatibility problem with a Cray x1e C++
6688 compiler reported by Hung Nguyen in
6689 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
6690 The for-loop was introduced in the 2004-11-17 change but I don't
6691 know why it was needed.
6692
a5d80ba5
AD
66932006-07-12 Akim Demaille <akim@epita.fr>
6694
6695 * data/c.m4: Comment changes.
6696
23eb2a69
AD
66972006-07-10 Akim Demaille <akim@lrde.epita.fr>
6698
6699 * src/complain.c (error_message, ERROR_MESSAGE): New.
6700 To factor...
6701 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
6702 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
6703
ddc8ede1
PE
67042006-07-09 Paul Eggert <eggert@cs.ucla.edu>
6705
6706 * NEWS: Instead of %union, you can define and use your own union type
6707 YYSTYPE if your grammar contains at least one <type> tag.
6708 Your YYSTYPE need not be a macro; it can be a typedef.
6709 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
6710 (Union Decl, Decl Summary): Document this.
6711 * data/glr.c (YYSTYPE): Implement this.
6712 * data/glr.cc (YYSTYPE): Likewise.
6713 * data/lalr1.cc (YYSTYPE): Likewise.
6714 * data/yacc.c (YYSTYPE): Likewise.
6715 * src/output.c (prepare): Output tag_seen_flag.
6716 * src/parse-gram.y (declaration, grammar_declaration):
6717 Use 'union_seen' rather than 'typed' to determine whether
6718 %union has been seen, since grammars can now be typed without
6719 %union.
6720 (symbol_declaration, type.opt, symbol_def):
6721 Keep track of whether a tag has been seen.
6722 * src/reader.c (union_seen, tag_seen): New vars.
6723 (typed): remove.
6724 * src/reader.h (union_seen, tag_seen, typed): Likewise.
6725 * src/scan-code.l (untyped_var_seen): New variable.
6726 (handle_action_dollar): Adjust to above changes.
6727 (handle_action_dollar, handle_action_at):
6728 Improve overflow checking for outlandish numbers.
6729 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
6730 avoid new diagnostics generated by above changes.
6731 * tests/regression.at (YYSTYPE typedef): Add test to check
6732 for type tags without %union.
6733
6734 * src/symlist.c (symbol_list_length): Return int, not unsigned
6735 int, since callers expect int. This may need to get revisited
6736 once we have proper integer overflow checking.
6737
6738 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
6739 object is now static.
6740
6741 * src/getargs.c (flags_argmatch): Return void, not int,
6742 to pacify ./configure --enable-gcc-warnings.
6743
6744 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
6745 since last_string is already defined to FLEX_PREFIX (last_string).
6746
7b42569e
AD
67472006-07-09 Akim Demaille <akim@lrde.epita.fr>
6748
6749 Implement --warnings/-W.
6750 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
6751 replaced by...
6752 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
6753 Adjust callers.
6754 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
6755 (warnings_args, warnings_types): New.
6756 (getargs, short_options, long_options): Accept -W/--warnings.
6757 Sort the options by alphabetical order, upper case letter right
6758 before its lower case.
6759
3b452f4e
JD
67602006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
6761
6762 Change %merge result type clash warnings to errors. Discussed at
6763 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
6764 * src/reader.c (record_merge_function_type): Use complain_at.
6765 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
6766 declared later): Update test case results.
6767
b8a41559
AD
67682006-07-09 Akim Demaille <akim@lrde.epita.fr>
6769
6770 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
6771 to be in alphabetical order.
6772 (trace_args): Spelling fixes.
6773
cd9e1ba2
PE
67742006-07-09 Paul Eggert <eggert@cs.ucla.edu>
6775
6776 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
6777 so they don't collide with user-defined macros.
6778 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
6779 this was never guaranteed, and now that we're using gnulib stdint,
6780 which defines int_fast16_t to long int, the problem is exposed.
6781
cb48f191
PE
67822006-07-08 Paul Eggert <eggert@cs.ucla.edu>
6783
b8445a15
PE
6784 * data/c.m4 (b4_basename): Simplify a bit, since we don't
6785 need the full POSIX semantics (and weren't implementing them
6786 anyway).
6787
cb48f191
PE
6788 Adjust to Autoconf 2.60 and today's gnulib.
6789 * bootstrap (gnulib_modules): Add stdint.
6790 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
6791 no longer copies it.
6792 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
6793 since stdint needs the former and wcwidth (which is now required
6794 by mbswidth) needs the latter.
6795 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
6796 work around a compatibility glitch between gettext 0.14.6 and
6797 Autoconf 2.60.
6798 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
6799 Do not check for uintptr_t, since new stdint module does the right
6800 thing.
6801 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
6802 Add stdint.h, stdint_.h, wcwidth.h.
6803 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
6804 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
6805 stdint.m4, wchar_t.m4, wcwidth.m4.
6806 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
6807 usual order for ../lib/*.h files.
6808 (file_name_split): Use last_component, not base_name, to adjust
6809 to gnulib changes.
6810 * src/parse-gram.h: Include <strverscmp.h> in the usual order
6811 for ../lib/*.h files.
6812 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
6813 Define unconditionally, since we now assume the stdint module.
6814 * src/scan-skel.l: Include <dirname.h>.
6815 (BASE_QPUTS): Use last_component, not base_name.
6816 * src/system.h: Include <unlocked-io.h> in the usual order
6817 for ../lib/*.h files. Include <stdint.h> unconditionally,
6818 since we now use the stdint module.
6819 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
6820 HAVE_UINTPTR_T, since we now use the stdint module.
6821 (base_name): Remove decl, since files now include <dirname.h>
6822 to get the decl.
6823
cd48d21d
AD
68242006-07-08 Akim Demaille <akim@lrde.epita.fr>
6825
6826 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
6827 New, default to 1.
6828 * data/yacc.c, data/glr.c, data/location.cc: Use them.
6829 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
6830 default.
6831 * tests/calc.at: Adjust.
6832
8ec0a172
AD
68332006-07-08 Akim Demaille <akim@lrde.epita.fr>
6834
b8445a15 6835 * data/c.m4 (b4_basename): New.
8ec0a172
AD
6836 (b4_syncline): Also output the location of its invocation (from
6837 the skeleton).
6838 (b4_user_action, b4_define_user_action, b4_user_actions)
6839 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
6840 (b4_user_stype): New.
6841 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
6842
4a678af8
JD
68432006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
6844
6845 In the grammar file, the first column is 1 not 0 on the first line as
6846 on every other line.
6847 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
6848 * tests/input.at (Torturing the Scanner): Update output.
6849
6850 * src/scan-gram.l (scanner_cursor): Declare it static.
6851
dd60572a
JD
68522006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
6853
6854 In warnings, say "previous declaration" rather than "first
6855 declaration".
6856 * src/symtab.c (redeclaration): Do that here.
6857 * src/reader.c (record_merge_function_type): In the case of a result
6858 type clash, report the previous declaration rather than the very first
6859 one in the grammar file.
6860 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
6861 declared later): Add a third declaration to check this behavior.
6862 * tests/input.at (Incompatible Aliases): Update output.
6863
2073e1b6
AD
68642006-06-27 Akim Demaille <akim@epita.fr>
6865
6866 * doc/Doxyfile.in: New.
6867 * doc/Makefile.am: Use it.
6868 * src/lalr.h, src/symtab.h: Initial doxygenation.
6869
8ee5b538
JD
68702006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
6871
6872 Don't miss %merge result type warnings just because the LHS types are
fab044e6
JD
6873 declared after the %merge. This continues the effort of the previous
6874 patch.
8ee5b538
JD
6875 * src/reader.c (get_merge_function): Don't set the merger type yet.
6876 (record_merge_function_type): New function for setting the merger type
6877 and checking for clashes.
6878 (grammar_current_rule_merge_set): Set the location of the %merge for
6879 the current rule.
6880 (packgram): Invoke record_merge_function_type for each rule now that
6881 all symbol type declarations have been parsed.
6882 * src/reader.h (merger_list.type_declaration_location): New member
6883 storing the location of the first %merge from which the type for this
6884 merging function was derived.
6885 * src/symlist.h (symbol_list.merger_declaration_location): New member
6886 storing the location of a rule's %merge, if any.
6887 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
6888 declared later): New test to catch the error fixed by the above patch.
6889
ffa4ba3a
JD
68902006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
6891
6892 Get action warnings (grammar_rule_check) right even when symbol
fab044e6
JD
6893 declarations appear after the rules. Discussed at
6894 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
6895 and
6896 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
6897 Don't mistake the type of $$ in a midrule to be that of its parent
6898 rule's $$.
ffa4ba3a
JD
6899 * src/reader.c (grammar_current_rule_end): Don't invoke
6900 grammar_rule_check yet since not all symbol declarations may have been
6901 parsed yet.
6902 (grammar_midrule_action): Likewise.
6903 Don't record whether the midrule's $$ has been used yet since actions
6904 haven't been translated yet.
6905 Record the midrule's parent rule and its RHS index within the parent
6906 rule.
6907 (grammar_current_rule_action_append): Don't translate the action yet
6908 since not all symbol declarations may have been parsed yet and, thus,
6909 warnings about types for $$, $n, @$, and @n can't be reported yet.
6910 (packgram): Translate the action and invoke grammar_rule_check now that
6911 all symbol declarations have been parsed.
6912 * src/scan-code.l (handle_action_dollar): Now that this is invoked
6913 after parsing the entire grammar file, the symbol list here in the case
6914 of a midrule is actually the midrule's empty RHS, so reference its
6915 parent rule's RHS where necessary.
6916 On the other hand, now that you can already know it's a midrule, you
6917 aren't forced to think $$ has the same type as its parent rule's $$.
6918 (handle_action_at): In the case of a midrule, reference the parent rule
6919 where necessary.
6920 * src/symlist.c (symbol_list_new): Initialize new midrule-related
6921 members.
6922 (symbol_list_length): Now that this is invoked after all rules have
6923 been parsed, a NULL symbol (rather than a NULL symbol list node)
6924 terminates a rule. symbol_list_print already does this correctly.
6925 * src/symlist.h (symbol_list.midrule_parent_rule,
6926 symbol_list.midrule_parent_rhs_index): New members so that midrules can
6927 remember their relationships with their parents.
6928 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
6929 fixed by the above patch.
6930 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
6931 implementing...
6932 (Unused values): ... this old test case and...
6933 (Unused values before symbol declarations): ... this new test case.
6934 This one is the same as `Unused values' except that all symbol
6935 declarations appear after the rules in order to catch the rest of the
6936 errors fixed by the above patch.
6937
e256e17f
JD
69382006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
6939
300a1930
JD
6940 More cleanup.
6941 * src/reader.c (current_rule): Declare it static since it's no longer
6942 used outside this file.
6943 (grammar_current_rule_action_append): Remove redundant arguments from
6944 translate_rule_action invocation.
6945 * src/reader.h (current_rule): Remove this unused extern.
6946 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
6947 * src/scan-code.l (translate_rule_action): Likewise.
e256e17f 6948
381ecb06
JD
69492006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
6950
6951 Clean up yesterday's patch.
6952 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
6953 to...
6954 * src/reader.c (grammar_current_rule_action_append): ... here for
6955 consistency with grammar_current_rule_symbol_append.
6956 * tests/regression.at (Braced code in declaration in rules section):
6957 Make yyerror and yylex static as usual.
6958
4210cd0b
JD
69592006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
6960
6961 Fix bug that mistakes braced code in a declaration in the rules section
6962 to be a rule action. Mentioned at
6963 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
6964 * src/scan-gram.l: Move midrule action detection from the start of the
6965 scanning of any braced code to...
6966 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
6967 action. For readability, use $2 and @2 rather than the equivalent
6968 global variables.
6969 * tests/regression.at (Braced code in declaration in rules section):
6970 New test to catch the error fixed by the above patch.
6971
6972 Work on code readability some.
6973 * src/scan-code.l (current_rule): Get rid of this misleading and
6974 redundant declaration: it's actually extern'ed in reader.h.
6975 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
6976 translate_action): Add a rule argument and use it instead of the global
6977 current_rule.
6978 (translate_rule_action): This already receives current_rule through an
6979 argument, so pass it on to translate_action instead of assigning
6980 current_rule to current_rule.
6981 (translate_symbol_action, translate_code): Pass rule = NULL to
6982 translate_action.
6983
34f98f46
JD
69842006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
6985
6986 Rename %before-definitions to %start-header and %after-definitions to
6987 %end-header. Don't use these declarations to separate pre-prologue
6988 blocks from post-prologue blocks. Add new order-independent
6989 declarations %before-header and %after-header as alternatives to the
6990 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
6991 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
6992 * NEWS (2.3+): Update for these changes.
6993 * data/glr.c (b4_before_definitions): Update to...
6994 (b4_start_header): ... this.
6995 (b4_after_definitions): Update to...
6996 (b4_end_header): ... this.
6997 * data/glr.cc: Likewise.
6998 * data/lalr1.cc: Likewise.
6999 * data/yacc.c: Likewise.
7000 * doc/bison.texinfo (The prologue): Update names, and replace remaining
7001 prologue blocks with %*-header declarations.
7002 (Calc++ Parser): Likewise.
91661ebb 7003 (Decl Summary): Update names.
148d66d8 7004 (Table of Symbols): Update description.
34f98f46
JD
7005 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
7006 (PERCENT_END_HEADER): ... this.
7007 (PERCENT_BEFORE_DEFINITIONS): Update to...
7008 (PERCENT_START_HEADER): ... this.
7009 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
7010 (declaration): Update token names and m4 macro names.
7011 When parsing %end-header and %start-header, invoke translate_code
7012 before muscle_code_grow, and no longer set global booleans to remember
7013 whether these declarations have been seen.
7014 Parse new %after-header and %before-header.
7015 * src/reader.c (before_definitions, after_definitions): Remove.
7016 (prologue_augment): Accept a new bool argument to specify whether to
7017 augment the pre-prologue or post-prologue.
7018 * src/reader.h (before_definitions, after_definitions): Remove these
7019 extern's.
7020 (prologue_augment): Add new bool argument.
7021 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
7022 (PERCENT_END_HEADER): ... this.
7023 (PERCENT_BEFORE_DEFINITIONS): Update to...
7024 (PERCENT_START_HEADER): ... this.
7025 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
7026 * tests/actions.at (Printers and Destructors): Update names.
7027
31b2b07e
JD
70282006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
7029
7030 Add comparison operators for C++ location classes. Discussed at
7031 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
7032 * data/c++.m4 (b4_define_location_comparison): New boolean %define
7033 declaration indicating whether filename_type has an operator==. If
7034 filename_type is `std::string', it defaults to `1', `0' otherwise.
7035 * data/location.cc: Iff b4_define_location_comparison is `1', add
7036 operator== and operator!= for class position and for class location.
7037
7038 Some minor fixes.
7039 * src/scan-action.l: Remove unused file.
7040 * src/symtab.c (symbol_printer_set): Use printer_location not
7041 destructor_location.
7042 * src/symtab.h (struct symbol): Replace incorrect source comment for
7043 printer members.
7044 * tests/input.at (Incompatible Aliases): Update output with correct
7045 printer location.
7046
9bc0dd67
JD
70472006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
7048
7049 Don't put the pre-prologue in the header file. For the yacc.c code
7050 file and the glr.c header and code files, move the pre-prologue before
7051 the token definitions. Add new %before-definitions and
7052 %after-definitions to declare code that will go in both the header file
7053 and code file. Discussed at
7054 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
7055 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
7056 and
7057 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
7058 * NEWS (2.3+): Describe these changes.
7059 * data/glr.c (b4_pre_prologue): Move from within to before...
7060 (b4_shared_declarations): ... this.
7061 Add new b4_before_definitions before b4_token_enums.
7062 Add new b4_after_definitions at the end.
7063 * data/glr.cc (b4_pre_prologue): Replace with...
7064 (b4_before_definitions): ... this in the header file.
7065 (b4_after_definitions): New near the end of the header file.
7066 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
7067 code file right before including the header file.
7068 (b4_before_definitions): New in the previous position of
7069 b4_pre_prologue in the header file.
7070 (b4_after_definitions): New near the end of the header file.
7071 * data/yacc.c: Clean up some m4 quoting especially in the header file.
7072 (b4_token_enums_defines): In the code file, move to right before
7073 YYSTYPE for consistency with the header file.
7074 (b4_before_definitions): New right before b4_token_enums_defines in
7075 both the header and code file.
7076 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
7077 header and code file.
7078 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
7079 of prologues for %union dependencies.
91661ebb
JD
7080 (Decl Summary): In %defines description, mention the effect of
7081 %before-definitions and %after-definitions on the header file.
9bc0dd67
JD
7082 (Calc++ Parser): Forward declare driver in a %before-definitions rather
7083 than in the pre-prologue so that make check succeeds.
148d66d8 7084 (Table of Symbols): Add entries for %before-definitions and
9bc0dd67
JD
7085 %after-definitions.
7086 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
7087 %before-definitions.
7088 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
7089 (declaration): Parse those declarations and append to
7090 b4_before_definitions and b4_after_definitions, respectively.
7091 * src/reader.c (before_definitions, after_definitions): New bools to
7092 track whether those declarations have been seen.
7093 (prologue_augment): Add to the post-prologue if %union,
7094 %before-definitions, or %after-definitions has been seen.
7095 * src/reader.h (before_definitions, after_definitions): New extern's.
7096 * src/scan-gram.l: Scan the new declarations.
7097 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
7098 prologue block in a %before-definitions or a %after-definitions based
7099 on whether the %union is declared.
7100 * tests/regression.at (Early token definitions with --yacc, Early token
7101 definitions without --yacc): Move tests for token definitions into the
7102 post-prologue since token names are no longer defined in the
7103 pre-prologue.
7104
203b9274
AD
71052006-06-20 Akim Demaille <akim@epita.fr>
7106
7107 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
7108 (symbol_get): Use it.
7109 * src/parse-gram.y: Use it.
7110
a7ee59cf
JD
71112006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
7112
7113 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
7114 build succeeds when configured with --enable-gcc-warnings.
7115
5a2baae7
PE
71162006-06-19 Paul Eggert <eggert@cs.ucla.edu>
7117
33ad1a9c
PE
7118 * src/parse-gram.y (char_name): New function.
7119 (CHAR, STRING, string_content): For %printer, properly escape.
7120 (ID): Prefer fputs to fprintf.
7121 (id): Reindent to be consistent with other rules.
7122 Properly quote char.
7123
5a2baae7
PE
7124 The Translation Project changed its way of publishing translations
7125 to maintainers. I haven't received any responses to my request
7126 for supporting the old way, or for documenting the new way. I
7127 have modified 'bootstrap' to use screen scraping
7128 (in this case, HTML scraping). This is unreliable and inelegant,
7129 but I don't see any better way. Yuck.
7130 * bootstrap (TP_URL, WGET_COMMAND): New vars.
7131 (get_translations): New function, which uses HTML scraping to
7132 deduce locations of latest translations.
7133 Use this function to grab both bison and bison-runtime .po files.
7134 Don't bother priming the pump for the runtime-po domain any more,
7135 as it's now translated better than bison is.
7136
58d7a1a1
AD
71372006-06-19 Akim Demaille <akim@epita.fr>
7138
7139 * src/scan-gram.l: No longer "parse" things after `%union' until
7140 `{'. Rather, return a single "%union" token.
7141 No longer make symbols: return strings, and leave the conversion
7142 to symbols to the parser.
7143 (SC_PRE_CODE, token_type): Remove.
7144 * src/parse-gram.y (%union): New field `character'.
7145 Sort tokens.
7146 (CHAR): New token.
7147 (ID, ID_COLON): Now that the scanner no longer makes them
7148 identifiers, adjust all uses to invoke symbol_get.
7149 (id_colon): New, wraps the conversion from string to symbol.
7150 (%union): Accept a possible union_name.
7151 (symbol): Now can be a char.
7152 * data/c.m4 (b4_union_name): Leave a default value.
7153 * data/glr.c, data/yacc.c: Use it.
7154
b931235e
JD
71552006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
7156
7157 For associating token numbers with token names for "yacc.c", don't use
7158 #define statements unless `--yacc' is specified; always use enum
7159 yytokentype. Most important discussions start at:
7160 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
7161 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
7162 and
7163 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
7164 * NEWS (2.3+): Mention.
7165 * data/c.m4 (b4_yacc_if): New.
7166 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
7167 token #define's.
7168 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
7169 on token name definitions.
7170 * src/getargs.c (usage): Capitalize `Yacc' in English.
7171 * src/output.c (prepare): Define b4_yacc_flag.
7172 * tests/regression.at (Early token definitions): Test that tokens names
7173 are defined before the pre-prologue not just before the post-prologue.
7174 Remove this test case and copy to...
7175 (Early token definitions with --yacc): ... this to test #define's.
7176 (Early token definitions without --yacc): ... and this to test enums.
7177
9e6e7ed2
PE
71782006-06-11 Paul Eggert <eggert@cs.ucla.edu>
7179
7180 * NEWS: Reword the post-2.3 change to not be so optimistic about
7181 removing the old "look-ahead" spelling.
7182 Update previous look-ahead/lookahead change reports.
7183 * REFERENCES: look-ahead -> lookahead (since that's
7184 what he actually wrote).
7185 * doc/refcard.tex: look ahead -> lookahead,
7186 look-ahead -> lookahead
7187
742e4900
JD
71882006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
7189
7190 For consistency, use `lookahead' instead of `look-ahead' or
7191 `look_ahead'. Discussed starting at
7192 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
7193 and then at
7194 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
7195 * NEWS: For the next release, note the change to `--report'.
7196 * TODO, doc/bison.1: Update English.
7197 * doc/bison.texinfo: Update English.
7198 (Understanding Your Parser, Bison Options): Document as
7199 `--report=lookahead' rather than `--report=look-ahead'.
7200 * src/conflicts.c: Update English in comments.
7201 (lookahead_set): Rename from look_ahead_set.
7202 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
7203 (resolve_sr_conflict): Rename local look_ahead_tokens to
7204 lookahead_tokens, and update other uses.
7205 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
7206 count_rr_conflicts, conflicts_free): Update uses.
7207 * src/getargs.c (report_args): Move "lookahead" before alternate
7208 spellings.
7209 (report_types): Update uses.
7210 (usage): For `--report' usage description, state `lookahead' spelling
7211 rather than `look-ahead'.
7212 * src/getargs.h (report.report_lookahead_tokens): Rename from
7213 report_look_ahead_tokens.
7214 * src/lalr.c: Update English in comments.
7215 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
7216 (state_lookahead_tokens_count): Rename from
7217 state_look_ahead_tokens_count.
7218 Rename local n_look_ahead_tokens to n_lookahead_tokens.
7219 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
7220 Rename local n_look_ahead_tokens to n_lookahead_tokens.
7221 Update other uses.
7222 Update English in output.
7223 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
7224 * src/print.c: Update English in comments.
7225 (lookahead_set): Rename from look_ahead_set.
7226 (print_reduction): Rename argument lookahead_token from
7227 look_ahead_token.
7228 (print_core, state_default_rule, print_reductions, print_results):
7229 Update uses.
7230 * src/print_graph.c: Update English in comments.
7231 (print_core): Update uses.
7232 * src/state.c: Update English in comments.
7233 (reductions_new): Update uses.
7234 (state_rule_lookahead_tokens_print): Rename from
7235 state_rule_look_ahead_tokens_print, and update other uses.
7236 * src/state.h: Update English in comments.
7237 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
7238 (state_rule_lookahead_tokens_print): Rename from
7239 state_rule_look_ahead_tokens_print.
7240 * src/tables.c: Update English in comments.
7241 (conflict_row, action_row): Update uses.
7242 * tests/glr-regression.at
7243 (Incorrect lookahead during deterministic GLR,
7244 Incorrect lookahead during nondeterministic GLR): Rename
7245 print_look_ahead to print_lookahead.
7246 * tests/torture.at: Update English in comments.
7247 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
7248 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
7249 (Many lookahead tokens): Update uses.
7250 * data/glr.c: Update English in comments.
7251 * lalr1.cc: Likewise.
7252 * yacc.c: Likewise.
7253 * src/conflicts.h: Likewise.
7254 * src/lalr.h: Likewise.
7255 * src/main.c: Likewise.
7256 * src/output.c: Likewise.
7257 * src/parse-gram.c: Likewise.
7258 * src/tables.h: Likewise.
7259 * tests/calc.at: Likewise.
7260
3c40d0b5
JD
72612006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
7262
7263 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
7264
5d278082
PE
72652006-06-07 Paul Eggert <eggert@cs.ucla.edu>
7266
7267 * TODO: Add request from Nelson H. F. Beebe to be able to install
7268 Bison without installing the yacc script.
7269
9e668899
JD
72702006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
7271
7272 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
7273 and yytext if they're already #define'd.
7274 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
7275 * src/scan-code-c.c: ... here.
7276 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
7277 <config.h>.
7278
0c8e079f
JD
72792006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
7280
7281 Get Bison to build again when configured with --enable-gcc-warnings.
7282 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
7283 missing #include's.
7284 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
7285 loc argument as it shadows a global.
7286 * src/scan-gram.l: Remove stray comma that prevents boundary_set
7287 invocation.
7288
7289 * src/.cvsignore: Add scan-code.c.
7290
2346344a
AD
72912006-06-07 Akim Demaille <akim@epita.fr>
7292
7293 * src/scan-gram.l: Move the "add a trailing ; to actions" code
7294 to...
7295 * src/scan-code.l: here.
7296 * tests/input.at (Torturing the Scanner): Fix another location
7297 error.
7298
4862bdfd
AD
72992006-06-07 Akim Demaille <akim@epita.fr>
7300
7301 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
7302
e9071366
AD
73032006-06-06 Akim Demaille <akim@epita.fr>
7304
7305 Extract the parsing of user actions from the grammar scanner.
7306 As a consequence, the relation between the grammar scanner and
7307 parser is much simpler. We can also split "composite tokens" back
7308 into simple tokens.
7309 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
7310 * src/scan-gram.l (add_column_width, adjust_location): Move to and
7311 rename as...
7312 * src/location.h, src/location.c (add_column_width)
7313 (location_compute): these.
7314 Fix the column count: the initial column is 0.
7315 (location_print): Be robust to ending column being 0.
7316 * src/location.h (boundary_set): New.
7317 * src/main.c: Adjust to scanner_free being renamed as
7318 gram_scanner_free.
7319 * src/output.c: Include scan-code.h.
7320 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
7321 Use boundary_set.
7322 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
7323 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
7324 which is now, again, a separate token.
7325 Adjust all dependencies.
7326 Whereever actions with $ and @ are used, use translate_code.
7327 (action): Remove this nonterminal which is now useless.
7328 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
7329 (grammar_current_rule_action_append): Use translate_code.
7330 (packgram): Bound check ruleno, itemno, and rule_length.
7331 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
7332 (last_string, last_braced_code_loc, max_left_semantic_context)
7333 (scanner_initialize, scanner_free, scanner_last_string_free)
7334 (gram_out, gram_lineno, YY_DECL_): Move to...
7335 * src/scan-gram.h: this new file.
7336 (YY_DECL): Rename as...
7337 (GRAM_DECL): this.
7338 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
7339 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
7340 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
7341 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
7342 Move these declarations, and...
7343 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
7344 these to...
7345 * src/flex-scanner.h: this new file.
7346 * src/scan-gram.l (rule_length, rule_length_overflow)
7347 (increment_rule_length): Remove.
7348 (last_braced_code_loc): Rename as...
7349 (gram_last_braced_code_loc): this.
7350 Adjust to the changes of the parser.
7351 Move all the handling of $ and @ into...
7352 * src/scan-code.l: here.
7353 * src/scan-gram.l (handle_dollar, handle_at): Remove.
7354 (handle_action_dollar, handle_action_at): Move to...
7355 * src/scan-code.l: here.
7356 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
7357 scan-code.h, scan-code-c.c, scan-gram.h.
7358 (EXTRA_bison_SOURCES): Add scan-code.l.
7359 (BUILT_SOURCES): Add scan-code.c.
7360 (yacc): Be robust to white spaces.
7361
7362 * tests/conflicts.at, tests/input.at, tests/reduce.at,
7363 * tests/regression.at: Adjust the column numbers.
7364 * tests/regression.at: Adjust the error message.
7891a7c4 7365
184e42f0
JD
73662006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
7367
7368 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
7369 Use Akim's wording from
7370 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
7371
7891a7c4
JD
73722006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
7373
7374 Between Bison releases, manually append `+' to the previous Bison
7375 release number, and use that as a signal to automatically print the
7376 ChangeLog's CVS Id keyword from --version. Discussed starting at
7377 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
7378 * ChangeLog: Add Id header.
7379 * configure.ac (AC_INIT): Append `+' to `2.3'.
7380 * src/.cvsignore: Add revision.c.
7381 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
7382 (BUILT_SOURCES): Add revision.c.
7383 (revision.c): New target rule. This file defines a new global variable
7384 named revision. It initializes it with either the Id from ChangeLog
7385 or, if VERSION doesn't contain `+', with the empty string.
7386 * src/getargs.c (version): Print the value of revision.
7387 * src/revision.h: Extern revision.
7388
4ad3ed84
PE
73892006-06-05 Paul Eggert <eggert@cs.ucla.edu>
7390
7391 * NEWS: Version 2.3.
7392 * configure.ac (AC_INIT): Likewise.
7393
02103984
PE
73942006-05-30 Paul Eggert <eggert@cs.ucla.edu>
7395
7396 * data/glr.c (YYRECOVERING): Define to be a function-like macro
7397 with no arguments, not as an object-like macro. This is for
7398 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
7399 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
7400 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
7401 Document this.
7402
2c08afa5
JD
74032006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
7404
7405 * src/getargs.c (usage): Back out yesterday's modification of the
7406 --help output so that we don't have to wait for translation before
7407 releasing 2.3.
7408
6077da58
PE
74092006-05-29 Paul Eggert <eggert@cs.ucla.edu>
7410
7411 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
7412 Problem reported by Akim Demaille.
7413
2a26b6c2
JD
74142006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
7415
7416 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
7417
aefef0d6
PE
74182006-05-26 Paul Eggert <eggert@cs.ucla.edu>
7419
7420 * data/yacc.c (yy_reduce_print): Omit trailing white space in
7421 generated source code. Problem reported by Frans Englich in
7422 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
7423
fcd8e201
PE
74242006-05-22 Paul Eggert <eggert@cs.ucla.edu>
7425
7426 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
7427 shell, not within 'make', so that 'make' by an ordinary builder
7428 (using GNU make) does not worry about configuring gzip. This also
7429 works around a bug reported independently by Keith Thompson and by
7430 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
7431 stderr rather than stdout, messing up the build logs.
7432
7b5cdcbd
JD
74332006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
7434
7435 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
7436 to make sure that YYID will never be unused. This fixes a 'make
7437 maintainer-check' failure caused by the recent changes to the 'Trivial
7438 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
7439 not used.
7440 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
7441
5ad0a449
JD
74422006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
7443
7444 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
7445 state before an empty RHS is always resolved here. Only the location
7446 of that state is guaranteed to be resolved, and that's enough. This
7447 fixes the remaining bug reported by Derek M. Jones in
7448 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
7449 * tests/glr-regression.at (Uninitialized location when reporting
7450 ambiguity): Test the above case.
7451 Also, the embedded comments in this test case claim it checks the case
7452 of an empty RHS that has inherited the initial location. However, the
7453 corresponding LHS was already resolved, so yyresolveLocations didn't
7454 actually have reason to modify it. Fix this by forcing
7455 nondeterministic operation at the beginning of the parse.
7456
50cce58e
PE
74572006-05-20 Paul Eggert <eggert@cs.ucla.edu>
7458
7459 * data/c.m4 (b4_yy_symbol_print_generate):
7460 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
7461 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
7462 of the bugs reported today by Derek M Jones in
7463 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
7464 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
7465 defined to be a type name without parens or brackets.
7466 (Location Type): Similarly for YYLTYPE.
7467 * tests/regression.at (Trivial grammars): Put in a test for this
7468 bug that will be caught by 'make maintainer-check' (though not,
7469 alas, by 'make check' unless your compiler is picky).
7470
ab8d9dc5
PE
74712006-05-19 Paul Eggert <eggert@cs.ucla.edu>
7472
0d2c8934 7473 * NEWS: Version 2.2.
ab8d9dc5
PE
7474 * configure.ac (AC_INIT): Likewise.
7475
9138c575
JD
74762006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
7477
7478 * data/glr.c (yyreportTree): Make room in yystates for the state
7479 preceding the RHS. This fixes the segmentation fault reported by Derek
7480 M. Jones in
7481 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
7482 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
7483 to the user. Reported for yyreportTree by Derek M. Jones later in the
7484 same thread.
7485 * THANKS: Add Derek M. Jones.
7486 Update my email address.
7487 Fix typo in Steve Murphy's name.
7488
276f48df
PE
74892006-05-14 Paul Eggert <eggert@cs.ucla.edu>
7490
d6645148
PE
7491 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
7492 checking against YYLAST that caused the parser to miss a potential
7493 alternative in its diagnostic.
7494 Problem reported by Maria Jose Moron Fernandez in
7495 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
7496 * data/lalr1.cc (yysyntax_error_): Likewise.
7497 * data/yacc.c (yysyntax_error): Likewise.
7498 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
7499 tokens, in case we run into an older C compiler.
7500 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
7501 Use them to check for the off-by-one error fixed above.
7502
276f48df
PE
7503 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
7504 YYSIZE_T, not size_t.
7505 * tests/regression.at (Trivial grammars): New test, to catch
7506 the error fixed by the above patch.
7507
cd8b5791
AD
75082006-05-14 Akim Demaille <akim@lrde.epita.fr>
7509
7510 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
7511 scheme.
7512 Reported by Steve Murphy.
7513
34376418
AD
75142006-05-14 Akim Demaille <akim@lrde.epita.fr>
7515
7516 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
7517 * data/glr.cc: b4_location_flag is now b4_locations_flag.
7518
327afc7c
AD
75192006-05-14 Akim Demaille <akim@lrde.epita.fr>
7520
7521 Implement --trace=m4.
7522 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
7523 * src/output.c (output_skeleton): When set, pass -dV to m4.
7524
7525 Factor the handling of flags in m4.
7526 * src/output.c (prepare): Rename the muscle names debug, defines,
7527 error_verbose to debug_flag, defines_flag, error_verbose_flag.
7528 * data/c.m4: Adjust.
7529 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
7530 Use b4_define_flag_if to define other b4_FLAG_if macros.
7531 (b4_location_if): As a consequence, rename as...
7532 (b4_locations_if): this, for consistency.
7533 Adjust all the skeletons.
7534
ba9ecd19
AD
75352006-05-14 Akim Demaille <akim@lrde.epita.fr>
7536
7537 * etc/bench.pm: Shorten bench names.
7538
4e83ea15
AD
75392006-05-14 Akim Demaille <akim@lrde.epita.fr>
7540
7541 * src/output.h, src/output.c (error_verbose): Move to...
7542 * src/getargs.h, src/getargs.c: here.
7543 Sort the flags.
7544 Adjust dependencies.
7545
6e93d810
PE
75462006-05-13 Paul Eggert <eggert@cs.ucla.edu>
7547
7548 * data/c.m4 (b4_copyright): Put the special exception for Bison
7549 skeletons here, so we don't have to put it in each skeleton. All
b15296ff
PE
7550 uses changed. Suggested by Akim Demaille. Also, wrap the
7551 copyright notice, in case it is longer than 80 columns. Replace
7552 comma by newline after title.
6e93d810 7553
eaea13f5
PE
75542006-05-11 Paul Eggert <eggert@cs.ucla.edu>
7555
7556 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
7557 incompatibility, not a bug. Mention that it wasn't fixed as of
7558 flex 2.5.33.
7559
3cf084ec
AD
75602006-05-11 Akim Demaille <akim@lrde.epita.fr>
7561
7562 * examples/extexi: Enforce the precedence of concatenation over
7563 >>.
0a9f1c7d 7564 Reported by Tommy Nordgren.
3cf084ec 7565
32c96bd7
AD
75662006-05-11 Akim Demaille <akim@lrde.epita.fr>
7567
7568 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
7569 with the member "token".
f94705b2 7570 Reported by Martin Nylin.
32c96bd7 7571
eaea13f5
PE
75722006-05-08 Paul Eggert <eggert@cs.ucla.edu>
7573
7574 * data/glr.c: Switch to Bison 2.2 special-exception language in
7575 the copyright notice. Use more-regular format for titles and
7576 copyright notices.
7577 * data/glr.cc: Likewise.
7578 * data/location.cc: Likewise.
7579 * data/yacc.cc: Likewise.
7580 * doc/bison.texinfo (Conditions): Document this.
7581 * NEWS: likewise. Upgrade version to 2.2.
7582
6e2d1146
AD
75832006-04-27 Akim Demaille <akim@lrde.epita.fr>
7584
7585 * data/glr.cc: Remove dead code.
7586
47671055
PE
75872006-04-25 Paul Eggert <eggert@cs.ucla.edu>
7588
7589 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
7590 that variable and the line breaks the bootstrap. Problem reported
7591 by Juan M. Guerrero.
7592
ed2e6384
AD
75932006-04-24 Akim Demaille <akim@lrde.epita.fr>
7594
7595 * doc/bison.texinfo (Multiple start-symbols): New.
7596
3cedc2dc
AD
75972006-04-24 Akim Demaille <akim@lrde.epita.fr>
7598
7599 * etc/README, etc/bench.pl: New.
7600
b2ddc3f3
AD
76012006-04-03 Akim Demaille <akim@lrde.epita.fr>
7602
7603 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
7604 rule.
7605 Reported by Mickael Labau.
7606 * tests/input.at (Torturing the Scanner): Test it.
7607
91e3ac9a
PE
76082006-03-16 Paul Eggert <eggert@cs.ucla.edu>
7609
7610 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
7611 Problem reported by Bob Rossi.
7612
76132006-03-13 Paul Eggert <eggert@cs.ucla.edu>
7614
7615 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
7616 and didn't really work.
7617 For the index, use @ifnotinfo, not @iftex.
7618 Minor cleanups of spacing and terminology.
7619
5cf61e93
AD
76202006-03-12 Akim Demaille <akim@lrde.epita.fr>
7621
7622 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
7623 of AT_NAME_PREFIX when %name-prefix is not used.
7624
aa08666d
AD
76252006-03-12 Akim Demaille <akim@lrde.epita.fr>
7626
7627 Apply --prefix to C++ skeletons too: they change the namespace.
7628 The test suite already exercize these cases.
7629 * data/c++.m4 (b4_namespace): New.
7630 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
7631 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
7632 * data/yacc.c, data/glr.c: Remove a useless `[]'.
7633 * doc/bison.texinfo: Document it.
7634 (Option Cross Key): Use @multitable in all formats. It looks
7635 nicer, even in TeX outputs.
7636 (Rules): Use the same code whatever the output type is.
7637 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
7638 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
7639 * tests/calc.at: Use it, instead of hard coding `yy'.
91e3ac9a 7640
45567173
AD
76412006-03-10 Akim Demaille <akim@lrde.epita.fr>
7642
7643 * TODO: Remove dead items.
7644
e9d8f881 76452006-03-10 Akim Demaille <akim@lrde.epita.fr>
55ba27be
AD
7646
7647 * doc/FAQ: Remove, merged into...
7648 * doc/bison.texinfo (FAQ): this.
7649 * doc/Makefile.am (EXTRA_DIST): Adjust.
7650
c095d689
AD
76512006-03-10 Akim Demaille <akim@lrde.epita.fr>
7652
7653 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
7654 even if empty.
7655 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
7656 * doc/bison.texinfo (Calc++ Scanner): Use it.
7657
6e0f8287
PE
76582006-03-09 Paul Eggert <eggert@cs.ucla.edu>
7659
7660 Fix two nits reported by twlevo, plus one more that I discovered.
7661
7662 * src/assoc.h (assoc_to_string): Give a name to the arg, as
7663 this is the usual Bison style.
7664 * src/location.h (location_print): Likewise.
7665
7666 * src/reader.h (token_name): Likewise.
7667
d6b771c3
PE
76682006-03-08 Paul Eggert <eggert@cs.ucla.edu>
7669
7670 Fix some nits reported by twlevo.
7671 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
7672 and "POSIX". Use more-modern syntax for URLs. Mention C++
7673 and ask for Java. Don't hardwire OS version numbers. Add
7674 copyright notice.
7675 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
7676 * src/conflicts.c (solved_conflicts_obstack): Now static.
7677
1e137b71
JD
76782006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
7679
7680 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
7681 page. Say "you can use it" not "you may use it" as on the web page;
7682 we're describing capabilities not granting permission.
7683
73f2e47e
PE
76842006-03-06 Paul Eggert <eggert@cs.ucla.edu>
7685
6d05403d
PE
7686 * data/glr.c (yyresolveLocations): Rename local variables to avoid
7687 shadowing warnings. Use usual patter for iterating through RHS.
7688 * tests/glr-regression.at
7689 (Uninitialized location when reporting ambiguity):
7690 Modify yylex so that it uses its argument, rather than trying
7691 to rely on ARGSUSED (which doesn't work for gcc with warnings).
7692 const char -> char const.
7693
73f2e47e
PE
7694 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
7695 Don't use tabs inside commands; it messes up 'ps'.
7696 Problem reported by twlevo.
7697
8710fc41
JD
76982006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
7699
7700 * tests/glr-regression.at (Uninitialized location when reporting
7701 ambiguity): New test case.
7702 * data/glr.c (yyresolveLocations): New function, which uses
7703 YYLLOC_DEFAULT.
7704 (yyresolveValue): Invoke yyresolveLocations before reporting an
7705 ambiguity.
7706 * doc/bison.texinfo (Default Action for Locations): Note
7707 YYLLOC_DEFAULT's usage for ambiguity locations.
7708 (GLR Semantic Actions): Cross-reference those notes.
7709
ae952af2
JD
77102006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
7711
7712 * tests/glr-regression.at (Leaked semantic values when reporting
7713 ambiguity): Remove unnecessary union and type declarations.
7714 (Leaked lookahead after nondeterministic parse syntax error): New test
7715 case.
7716 * data/glr.c (yyparse): Check for zero stacks remaining before
7717 attempting to shift the lookahead so that you don't lose it.
7718
35ee866a
JD
77192006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
7720
7721 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
7722 * tests/glr-regression.at (Leaked semantic values when reporting
7723 ambiguity): New test case.
7724 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
7725 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
7726 now unnecessary yystackp parameter.
7727 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
7728 destructors can be called.
7729
7730 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
7731 in existing testcases.
7732
520181ab
JD
77332006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
7734
7735 Don't leak semantic values for parent RHS when a user action cuts the
7736 parser, and clean up related code a bit.
7737 * tests/glr-regression.at (Leaked merged semantic value if user action
35ee866a
JD
7738 cuts parse): Rename to...
7739 (Leaked semantic values if user action cuts parse): ... this. Add check
520181ab
JD
7740 for leaked parent RHS values.
7741 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
7742 between an unresolved state (non-empty chain of semantic options) and
7743 an incomplete one (signaled by an empty chain).
ae952af2 7744 (yyresolveStates): Document the interface. Move all manipulation of a
520181ab
JD
7745 successfully or unsuccessfully resolved yyGLRState to...
7746 (yyresolveValue): ... here so that yyresolveValue always leaves a
7747 yyGLRState with consistent data and thus is easier to understand.
7748 Remove the yyvalp and yylocp parameters since they are always just
7749 taken from the yys parameter. When reporting a discarded merged value
7750 in debugging output, note that it is incompletely merged. Document the
7751 interface.
7752 (yyresolveAction): If resolving any of the RHS states fails, destroy
7753 them all rather than leaking them. Thus, as long as user actions are
7754 written to clean up the RHS correctly, yyresolveAction always cleans up
7755 the RHS of a semantic option. Document the interface.
7756
18d9185c
PE
77572006-02-27 Paul Eggert <eggert@cs.ucla.edu>
7758
7759 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
7760 led to a segmentation fault in GNU Pascal. Problem reported
7761 by Waldek Hebisch.
7762
841a7737
JD
77632006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
7764
7765 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
7766 mid-rule action inside a nonterminal symbol in order to declare a
7767 destructor for its semantic value.
7768
fc3f467f
PE
77692006-02-16 Paul Eggert <eggert@cs.ucla.edu>
7770
7771 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
7772 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
7773 __cplusplus && ! defined _STDLIB_H && !
7774 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
7775 defined free))]: Include <stdlib.h> rather than rolling our own
7776 declarations of malloc and free, to avoid problems with
7777 incompatible declarations (using 'throw') C++'s stdlib.h. This
7778 should fix Debian bug 340012
7779 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
7780 reported by Guillaume Melquiond.
7781
a3af26dd
PE
77822006-02-13 Paul Eggert <eggert@cs.ucla.edu>
7783
4d7bc38c
PE
7784 * NEWS: Clarify symbols versus types in unused-value warnings.
7785
a3af26dd
PE
7786 * configure.ac (AC_INIT): Bump version number.
7787
4e26c69e
PE
77882006-02-13 Paul Eggert <eggert@cs.ucla.edu>
7789
7790 * NEWS: Version 2.1a.
7791 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
7792 since C99 requires this.
7793
498e897c
PE
77942006-02-11 Paul Eggert <eggert@cs.ucla.edu>
7795
7796 * m4/c-working.m4: New file.
7797 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
7798
57bb17ca
PE
77992006-02-10 Paul Eggert <eggert@cs.ucla.edu>
7800
7801 * Makefile.maint: Merge from coreutils.
7802
0be105dc
PE
78032006-02-09 Paul Eggert <eggert@cs.ucla.edu>
7804
7805 More portability fixes for problems summarized by Nelson H. F. Beebe.
7806
7807 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
7808 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
7809 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
7810 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
7811 messes up because C++ code is compiled in 32-bit mode but linked
7812 in 64-bit mode.
7813
6fc0c024
PE
78142006-02-08 Paul Eggert <eggert@cs.ucla.edu>
7815
7816 More portability fixes for problems summarized by Nelson H. F. Beebe.
7817
7870f699
PE
7818 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
7819 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
7820
6fc0c024
PE
7821 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
7822 nodist_PROGRAMS, since we don't need to actually compile the
7823 example if we're just doing a plain 'make'. This avoids bothering
7824 the installer unnecessarily about problems due to weird C++
7825 compilers.
7826
fe6c2fde
PE
78272006-02-06 Paul Eggert <eggert@cs.ucla.edu>
7828
7829 More portability fixes for problems summarized by Nelson H. F. Beebe.
7830
7831 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
7832 than #include "...", and compile with -I'.'. The old method was
7833 not portable, according to Posix and the C standard, and it does
7834 not work with Sun C 5.7, where previous #line directives affect
7835 the working directory used in later #include "..." directives.
7836
927b425b
JMG
78372006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7838
7839 Various DJGGP specific issues in /djgpp
7840
d9735e9e
PE
78412006-02-02 Paul Eggert <eggert@cs.ucla.edu>
7842
7843 More portability fixes for problems summarized by Nelson H. F. Beebe.
7844
7845 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
7846 '#include <map>' works and that you can apply ++ to iterators.
7847
5a6755af
PE
78482006-02-01 Paul Eggert <eggert@cs.ucla.edu>
7849
67a0dc4f
PE
7850 Work around portability problems summarized by Nelson H. F. Beebe in
7851 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
7852
8c86f0ef
PE
7853 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
7854 that '#include <string>' works.
7855
de35dd59
PE
7856 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
7857 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
7858 "warning: sorry: semantics of inline function static data `const
7859 unsigned char translate_table[262]' are wrong (you'll wind up with
7860 multiple copies)".
7861
67a0dc4f
PE
7862 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
7863 or, xor to not_, and_, or_, and xor_, respectively. This works
7864 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
7865 random system header somewhere that includes the equivalent of
7866 <iso646.h>.
7867
5a6755af
PE
7868 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
7869 -E" works; it apparently doesn't work with PathScale EKO Compiler
67a0dc4f 7870 Suite Version 2.0.
5a6755af 7871
3f001415
JD
78722006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
7873
7874 During deterministic GLR operation, user actions should be able to
7875 influence the parse by changing yychar. To make this easier to fix and
7876 to make glr.c easier to evolve in general, don't maintain yytoken in
7877 parallel with yychar; just compute yytoken when needed.
7878 * tests/glr-regression.at (Incorrect lookahead during deterministic
7879 GLR): Check that setting yychar in a user action has the intended
7880 effect.
7881 * data/glr.c (yyGLRStack): Remove yytokenp member.
7882 (yyclearin): Don't set *yytokenp.
7883 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
7884 yychar rather than *yytokenp to determine the current lookahead.
7885 Compute yytoken locally when needed.
7886 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
7887 point to.
7888
7889 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
7890 after `--report' documentation.
7891
e2a8c0f5
PE
78922006-01-30 Paul Eggert <eggert@cs.ucla.edu>
7893
7894 * src/parse-gram.y (grammar_declaration): Location of printer
7895 symbol is @1, not list->location. Bug reported by twlevo.
7896 * tests/input.at (Incompatible Aliases): Adjust to above change.
7897
6b702268
PE
78982006-01-29 Paul Eggert <eggert@cs.ucla.edu>
7899
27622431
PE
7900 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
7901 all the test at once. This makes the output easier to read in the
7902 normal case.
7903
6b702268
PE
7904 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
7905 got from <http://bro-ids.org/download.html>. The bug is that
7906 when two actions appeared in succession, the second one was
7907 scanned before the first one was added to the grammar rule
7908 as a midrule action. Bison then output the incorrect warning
7909 "parse.y:905.17-906.36: warning: unused value: $3".
7910 * src/parse-gram.y (BRACED_CODE, action): These are no longer
7911 associated with a value.
7912 (rhs): Don't invoke grammar_current_rule_action_append.
7913 (action): Invoke it here instead.
7914 * src/reader.c (grammar_midrule_action): Now extern.
7915 (grammar_current_rule_action_append): Don't invoke
7916 grammar_midrule_action; that is now the scanner's job.
7917 * src/reader.h (last_string, last_braced_code_loc):
7918 (grammar_midrule_action): New decls.
7919 * src/scan-gram.l (last_string): Now extern, sigh.
7920 (last_braced_code_loc): New extern variable.
7921 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
7922 rule already has an action.
7923 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
7924 * tests/input.at (AT_CHECK_UNUSED_VALUES):
7925 Add some tests to check that the above changes fixed the bug.
7926
d40ba6c2
PE
79272006-01-27 Paul Eggert <eggert@cs.ucla.edu>
7928
7929 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
7930 All used changed. Check whether the symbol has a destructor,
7931 not whether it is typed.
7932 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
7933 that the values are still reported as unused. All line numbers
7934 adjusted.
7935
401aace6
PE
79362006-01-23 Paul Eggert <eggert@cs.ucla.edu>
7937
7938 Work around a bug in bro 0.8, which underparenthesizes its
7939 definition of YYLLOC_DEFAULT.
7940 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
7941 their arguments.
7942 * data/lalr1.cc: Likewise.
7943 * data/yacc.cc: Likewise.
7944
06f01bc4
PE
79452006-01-22 Paul Eggert <eggert@cs.ucla.edu>
7946
401aace6
PE
7947 Work around a bug in Pike 7.0, and give the Pike folks a
7948 better way to override the usual int widths.
7949 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
7950 user can override the types.
7951 (short): #undef, to work around a bug in Pike 7.0.
7952 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
7953 (union yyalloc.yyss): Use yytype_int16 rather than short.
7954 All uses changed.
7955 (yysigned_char): Remove.
7956 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
7957 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
7958 * tests/regression.at (Web2c Actions): Adjust to above changes.
7959
7960 * src/reader.c (check_and_convert_grammar): New function.
7961 (reader): Close the input file even if something went wrong during
7962 parsing. Minor file descriptor leak reported by twlevo.
7963
06f01bc4
PE
7964 * src/assoc.c (assoc_to_string): Use a default: abort (); case
7965 to pacify gcc -Wswitch-default.
7966 * src/scan-gram.l (adjust_location): Use a default: break; case
7967 to pacify gcc -Wswitch-default.
7968 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
7969 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
7970 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
7971 Move these decls to scan-skel.l, since they don't need to be
7972 visible elsewhere.
7973 * src/scan-skel.l: Accept the above decls.
7974 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
7975 is used.
7976
02650b7f
PE
79772006-01-21 Paul Eggert <eggert@cs.ucla.edu>
7978
7979 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
7980 since we don't want to insist on a version number at the start
7981 of the changelog every time.
7982 * Makefile.maint: Sync from coreutils a bit better.
7983 (sc_trailing_blank): Renamed from sc_trailing_space.
7984 All uses changed.
7985 (sc_no_if_have_config_h, sc_require_config_h):
7986 (sc_prohibit_assert_without_use): New rules.
7987 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
7988 (sc_dd_max_sym_length): Fix leading spaces in rule.
7989 (sc_system_h_headers): Prefix with @.
7990 (sc_useless_cpp_parens, m4-check): Output line numbers.
7991 (changelog-check): Allow version only in head.
7992 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
7993 satisfy new Makefile.maint rule.
7994 * data/glr.c: Likewise.
7995 * data/glr.cc: Likewise.
7996 * data/lalr1.cc: Likewise.
7997 * data/yacc.c: Likewise.
7998 * lib/ebitsetv.c: Likewise.
7999 * lib/lbitset.c: Likewise.
8000 * lib/subpipe.c: Likewise.
8001 * lib/timevar.c: Likewise.
8002 * src/system.h: Likewise.
8003 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
8004 * djgpp/Makefile.maint: Add copyright notice.
8005 * djgpp/README.in: Likewise.
8006 * djgpp/config.bat: Likewise.
8007 * djgpp/config.site: Likewise.
8008 * djgpp/config_h.sed: Likewise.
8009 * djgpp/djunpack.bat: Likewise.
8010 * djgpp/config.sed: Fix copyright notice to match standard format.
8011 * djgpp/subpipe.h: Likewise.
8012 * lib/bitsetv-print.c: Likewise.
8013 * lib/bitsetv.c: Likewise.
8014 * lib/subpipe.h: Likewise.
8015 * lib/timevar.c: Likewise.
8016 * lib/timevar.h: Likewise.
8017 * djgpp/subpipe.c: Use standard recipe for config.h.
8018 * lib/abitset.c: Likewise.
8019 * lib/bitset.c: Likewise.
8020 * lib/bitset_stats.c: Likewise.
8021 * lib/bitsetv-print.c: Likewise.
8022 * lib/bitsetv.c: Likewise.
8023 * lib/ebitsetv.c: Likewise.
8024 * lib/get-errno.c: Likewise.
8025 * lib/lbitset.c: Likewise.
8026 * lib/subpipe.c: Likewise.
8027 * lib/timevar.c: Likewise.
8028 * lib/vbitset.c: Likewise.
8029 * tests/local.at: Likewise.
8030 * src/scan-gram.l: Don't include verify.h, since system.h does
8031 that for us.
8032 * .x-sc_require_config_h: New file.
8033 * .x-sc_unmarked_diagnostics: New file.
8034
287c78f6
PE
80352006-01-20 Paul Eggert <eggert@cs.ucla.edu>
8036
287c78f6
PE
8037 Be a bit more systematic about using 'abort'.
8038 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
8039 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
8040 Put 'default: abort ();' before some other case, to satisfy older
8041 pedantic compilers.
8042 * lib/bitset_stats.c (bitset_stats_init): Likewise.
8043 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
8044 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
8045 * src/conflicts.c (resolve_sr_conflict): Likewise.
68cae94e
PE
8046 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
8047 (get_decision_str, get_orientation_str, get_node_alignment_str):
8048 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
8049 (get_linestyle_str, get_arrowstyle_str): Likewise.
8050 * src/conflicts.c (resolve_sr_conflict):
8051 Use a default case rather than one for the one remaining enum
8052 value, to catch invalid enum values as well.
8053 * src/lalr.c (set_goto_map, map_goto):
8054 Prefer "assert (FOO);" to "if (!FOO) abort ();".
8055 * src/nullable.c (nullable_compute, token_definitions_output):
8056 Likewise.
8057 * src/reader.c (packgram, reader): Likewise.
8058 * src/state.c (transitions_to, state_new, state_reduction_find):
8059 Likewise.
8060 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
8061 (symbol_pack): Likewise.
8062 * src/tables.c (conflict_row, pack_vector): Likewise.
287c78f6
PE
8063 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
8064 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
68cae94e
PE
8065 * src/system.h: Don't include <assert.h>.
8066 (assert): New macro.
8067
8068 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
8069 (Destructor Decl, Parser Function, Pure Calling):
8070 Describe rules for braces inside C code more carefully.
287c78f6 8071
c66dfadd
PE
80722006-01-19 Paul Eggert <eggert@cs.ucla.edu>
8073
c21493b8
PE
8074 Fix some porting glitches found by Nelson H. F. Beebe.
8075 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
8076 compilers that don't understand that abort () does not return.
8077 * src/state.c (transitions_to): Likewise.
8078 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
8079 that '#include <cstdlib>' works.
8080 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
8081 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
8082 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
8083 for the benefit of some pre-C99 compilers.
8084
b6e3facf
PE
8085 * bootstrap: Undo changes to gnulib files that autoreconf made.
8086
c66dfadd
PE
8087 Minor fixups to get 'make maintainer-check' to work.
8088 * configure.ac: Don't use -Wnested-externs, as it's incompatible
8089 with the new verify.h implementation.
8090 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
8091 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
8092 * data/yacc.c (YYUSE): Likewise.
8093 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
8094 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
8095 * src/parse-gram.y (declaration): Don't pass a string constant
8096 to a function that expects char *, since GCC might complain
8097 about the constant value.
8098 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
8099 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
8100 before #defining them.
8101 * tests/glr-regression.at
8102 (Incorrectly initialized location for empty right-hand side in GLR):
8103 In yyerror, use the msg arg.
8104 (Corrupted semantic options if user action cuts parse):
8105 (Incorrect lookahead during deterministic GLR):
8106 (Incorrect lookahead during nondeterministic GLR):
8107 Don't name a local var 'index'; it shadows string.h's 'index'.
8108
ed94ef2a
AD
81092006-01-19 Akim Demaille <akim@epita.fr>
8110
8111 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
8112 location, not just parts of it.
8113
e9ad4aec
PE
81142006-01-18 Paul Eggert <eggert@cs.ucla.edu>
8115
d6ca7905
PE
8116 * NEWS: Document the fact that multiple %unions are now allowed.
8117 * doc/bison.texinfo (Union Decl): Likewise.
51cbef6f
PE
8118 * TODO: This feature is now implemented, so remove it from
8119 the wishlist.
d6ca7905 8120
ef1b70e0
PE
8121 * Makefile.maint: Merge with coreutils Makefile.maint.
8122 (CVS_LIST): Use build-aux version if available.
8123 (VERSION_REGEXP): New macro.
8124 (syntax-check-rules): Add sc_no_if_have_config_h,
8125 sc_prohibit_assert_without_use, sc_require_config_h,
8126 sc_useless_cpp_parens.
8127 (sc_obsolete_symbols): Check for O_NDELAY.
8128 (sc_dd_max_sym_length): Track coreutils.
8129 (sc_unmarked_diagnostics): Look in all files, not just *.c.
8130 (sc_useless_cpp_parens): New rule.
8131 (news-date-check): Look for version or today's date.
8132 (changelog-check): Don't require version number near head.
8133 (copyright-check): Use current year instead of hardwiring 2005.
8134 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
8135 (announcement): Add --gpg-key-ID.
8136
8137 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
8138 with "file system".
8139
2073ce56 8140 Avoid undefined behavior that addressed just before the start of an
e9ad4aec
PE
8141 array. Problem reported by twlevo.
8142 * src/reader.c (packgram): Prepend a new sentinel before ritem.
8143 * src/lalr.c (build_relations): Rely on new sentinel.
8144 * src/gram.c (gram_free): Adjust to new sentinel.
8145
b7691f15
JD
81462006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
8147
8148 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
8149 yylookaheadNeeds. All uses updated.
8150 (yysplitStack): Rename local yynewLookaheadStatuses to
8151 yynewLookaheadNeeds.
8152 * data/glr-regression.at (Incorrect lookahead during nondeterministic
8153 GLR): In comments, change `lookahead status' to `lookahead need'.
8154
ddee1b06
PH
81552006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8156
8157 * data/glr.c (yysplitStack): A little stylistic rewrite.
8158
12f4614d
PH
81592006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8160
8161 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
8162
32c29292
JD
81632006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
8164
8165 * doc/bison.texinfo: Fix some typos.
8166 (GLR Semantic Actions): New subsection discussing special
8167 considerations because GLR semantic actions might be deferred.
8168 (Actions): Mention look-ahead usage of yylval.
8169 (Actions and Locations): Mention look-ahead usage of yylloc.
8170 (Special Features for Use in Actions): Add YYEOF entry and mention it
8171 in the yychar entry.
8172 In the yychar entry, remove mention of the local yychar case (pure
8173 parser) since this is irrelevant information when writing semantic
148d66d8 8174 actions and since it's already discussed in `Table of Symbols' where
32c29292
JD
8175 yychar is otherwise described as an external variable.
8176 In the yychar entry, don't call it the `current' look-ahead since it
8177 isn't when semantic actions are deferred.
8178 In the yychar and yyclearin entries, add note about deferred semantic
8179 actions.
8180 Add yylloc and yylval entries discussing look-ahead usage.
8181 (Look-Ahead Tokens): When discussing yychar, don't call it the
8182 `current' look-ahead, and do mention yylval and yylloc.
8183 (Error Recovery): Cross-reference `Action Features' when mentioning
8184 yyclearin.
148d66d8 8185 (Table of Symbols): In the yychar entry, don't call it the `current'
32c29292
JD
8186 look-ahead.
8187 In the yylloc and yylval entries, mention look-ahead usage.
8188
de366a2f 81892006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2781dbd1
JD
8190
8191 * tests/glr-regression.at: Update copyright year to 2006.
8192
bf70fa87
JD
81932006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
8194
8195 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
8196 use during nondeterministic operation to track which stacks have
8197 actually needed the current lookahead.
8198 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
8199 Allocate, deallocate, resize, and otherwise shuffle space for
8200 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
8201 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
8202 appropriately during nondeterministic operation.
8203 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
8204 members to store the current lookahead to be used by the deferred
8205 user action.
8206 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
8207 from which the RHS is taken. Set the lookahead members of the new
8208 yySemanticOption according to the lookahead status for stack yyk.
8209 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
8210 yyaddDeferredAction.
8211 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
8212 members of yySemanticOption before invoking yyuserAction, and then set
8213 them back to their current values afterward.
8214 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
8215 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
8216 * tests/glr-regression.at: Remove `.' from the ends of recent test case
8217 titles for consistency.
8218 (Leaked merged semantic value if user action cuts parse): In order to
8219 suppress lint warnings, use arguments in merge function, and assign
8220 char value < 128 in main.
8221 (Incorrect lookahead during deterministic GLR): New test case.
8222 (Incorrect lookahead during nondeterministic GLR): New test case.
8223
05449a2c
JD
82242006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
8225
de366a2f 8226 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
05449a2c
JD
8227 !yyvaluep as signal that no semantic value is available to print.
8228 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
8229 to print a semantic value.
8230
4158e0a1 82312006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
fd2493f7 8232
4158e0a1
JD
8233 * tests/glr-regression.at: For consistency with my newer test cases,
8234 don't thank myself.
8235
d659304d
JD
82362006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
8237
8238 * data/glr.c (yyresolveValue): When merging semantic options, if at
8239 least one user action succeeds but a later one cuts the parse, then
8240 destroy the semantic value before returning rather than leaking it.
8241 (yyresolveStates): If a user action cuts the parse and thus
8242 yyresolveValue fails, ignore the (unset) semantic value rather than
8243 corrupting the yyGLRState, and empty the semantic options list since
8244 the user actions should have called all necessary destructors.
8245 Simplify code with YYCHK.
8246 * tests/glr-regression.at (Corrupted semantic options if user action
8247 cuts parse): New test case.
8248 (Undesirable destructors if user action cuts parse): New test case.
8249 Before applying any of this patch, this test case never actually failed
8250 for me... but only because the corrupted semantic options usually
8251 masked this bug.
8252 (Leaked merged semantic value if user action cuts parse): New test
8253 case.
8254
6ec2c0f2
AD
82552006-01-05 Akim Demaille <akim@epita.fr>
8256
8257 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
8258
1b9c21fb
PE
82592006-01-04 Paul Eggert <eggert@cs.ucla.edu>
8260
8261 * data/c.m4 (b4_c_modern): New macro, with a new provision for
8262 _MSC_VER. Problem reported by Cenzato Marco.
8263 (b4_c_function_def): Use it.
8264 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
8265 b4_c_modern.
8266 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
8267 than rolling our own.
8268
84866159
AD
82692006-01-04 Akim Demaille <akim@epita.fr>
8270
8271 Also warn about non-used mid-rule values.
8272 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
8273 member.
8274 (symbol_list_new): Adjust.
8275 * src/reader.c (symbol_typed_p): New.
8276 (grammar_rule_check): Use it.
8277 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
8278 Check its rule.
8279 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
8280 Use it.
8281 * tests/actions.at (Exotic Dollars): Adjust.
8282
378f4bd8
AD
82832006-01-04 Akim Demaille <akim@epita.fr>
8284
8285 * src/reader.c (grammar_midrule_action): If $$ is set in a
8286 mid-rule, move the `used' bit to its lhs.
8287 * tests/input.at (Unused values): New.
8288 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
8289
e2a21b6f
PE
82902006-01-03 Paul Eggert <eggert@cs.ucla.edu>
8291
54662697
PE
8292 * doc/bison.texinfo (Bison Options): Say more accurately what
8293 --yacc does.
8294 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
8295 about declarations in the grammar when in Yacc mode, as POSIX does
8296 not require a diagnostic when the grammar uses extensions.
8297
8298 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
8299
073f9288
PE
8300 Warn about dubious constructions like "%token T T".
8301 Reported by twlevo.
8302 * src/symtab.h (struct symbol.declared): New member.
8303 * src/symtab.c (symbol_new): Initialize it to false.
8304 (symbol_class_set): New arg DECLARING, specifying whether
8305 this is a declaration that we want to warn about, if there
8306 is more than one of them. All uses changed.
8307
1221b78a
PE
8308 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
8309 Allow multiple %union directives, whose contents concatenate.
8310 * src/parse-gram.y (grammar_declaration): Likewise.
8311 Use muscle_code_grow, so that we don't need stype_line any more.
8312 All uses changed.
8313
8314 * src/muscle_tab.c (muscle_grow): Fix comment.
8315
e2a21b6f
PE
8316 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
8317 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
8318 Update copyright year to 2006.
8319
8f7e3cf9
AD
83202006-01-03 Akim Demaille <akim@epita.fr>
8321
8322 Have glr.cc pass (some of) the calc.at tests.
8323 * data/glr.cc (b4_parse_param_orig): New.
8324 (b4_parse_param): Improve its definition, and bound it more
8325 clearly in the skeleton.
8326 (b4_epilogue): Append, instead of prepending, in order to keep
8327 #line consistency.
8328 Simplify the generation of auxiliary functions: locations and
8329 purity are mandated.
8330 (b4_global_tokens_and_yystype): Honor it.
8331 * data/location.cc (c++.m4): Don't include it.
8332 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
8333 and AT_SKEL_CC_IF.
8334 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
8335 AT_LALR1_CC_IF.
8336 Be sure to initialize the first position's filename.
8337 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
8338 mandated anyway.
8339 (AT_CHECK_CALC_GLR_CC): New.
8340 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
8341
3953ed88
AD
83422006-01-02 Akim Demaille <akim@epita.fr>
8343
8344 * src/output.c (output_skeleton): Don't hard wire the inclusion of
8345 c.m4.
0a96ba81 8346 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3953ed88
AD
8347 * data/glr.cc: Do not include stack.hh.
8348
9ecafbbf
AD
83492006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
8350
8351 * data/glr.c: Reformat whitespace with tabs.
8352 (b4_lpure_formals): Remove this unused m4 macro.
8353 * tests/cxx-type.at: Reformat whitespace with tabs.
8354 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
8355 since it's a member. Rename type to isNterm for clarity.
8356
c4d497a0
AD
83572005-12-29 Akim <akim@sulaco.local>
8358
8359 Let glr.cc catch up with symbol_value_print.
8360 * data/glr.cc (b4_yysymprint_generate): Replace by...
8361 (b4_yy_symbol_print_generate): this.
8362 (yy_symbol_print, yy_symbol_value_print): Declare them.
8363
4517da37
PE
83642005-12-28 Paul Eggert <eggert@cs.ucla.edu>
8365
8366 * src/location.h (boundary): Note that a line or column equal
8367 to INT_MAX indicates an overflow.
8368 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
8369 (rule_length_overflow, increment_rule_length, add_column_width):
8370 New functions.
8371 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
8372 (<SC_BRACED_CODE>"}"):
8373 Use increment_rule_length rather than incrementing it by hand.
8374 (adjust_location, handle_syncline): Diagnose overflow.
8375 (handle_action_dollar, handle_action_at):
8376 Fix bug with monstrosities like $-2147483648.
8377 Remove now-unnecessary checks.
8378 (scan_integer): Verify assumptions and remove now-unnecessary checks.
8379 (convert_ucn_to_byte): Verify assumptions.
8380 (handle_syncline): New arg LOC. All callers changed.
8381 Don't store through a value derived from char const * pointer.
8382
8383 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
8384 GCC warnings.
8385
e3233bf6
PE
83862005-12-27 Paul Eggert <eggert@cs.ucla.edu>
8387
8388 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
8389 Remove unnecessary forward static decls.
8390
8f3596a6
AD
83912005-12-27 Akim Demaille <akim@epita.fr>
8392
8393 * src/reader.c (grammar_current_rule_check): Also check that $$
8394 is used.
8395 Take the rule to check as argument, hence rename as...
8396 (grammar_rule_check): this.
8397 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
8398 Rename as...
8399 (grammar_rule_begin, grammar_rule_end): these, for consistency.
8400 (grammar_midrule_action, grammar_symbol_append): Now static.
8401 * tests/torture.at (input): Don't rely on the default action
8402 being always performed.
8403 * tests/calc.at: "Set" $$ even when the action is "cut" with
8404 YYERROR or other.
8405 * tests/actions.at (Exotic Dollars): Instead of using unused
8406 values, check that the warning is issued.
8407
721be13c
PE
84082005-12-22 Paul Eggert <eggert@cs.ucla.edu>
8409
8410 * NEWS: Improve wording for unused-value warnings.
8411
a0af42fc
AD
84122005-12-22 Akim Demaille <akim@epita.fr>
8413
8414 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
8415 (b4_yysymprint_generate): Rename as...
8416 (b4_yy_symbol_print_generate): this.
8417 Generate yy_symbol_print instead of yysymprint.
8418 Generate also yy_symbol_value_print, and use it.
8419
affac613
AD
84202005-12-22 Akim Demaille <akim@epita.fr>
8421
721be13c 8422 * NEWS: Warn about unused values.
affac613
AD
8423 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
8424 a `used' member.
8425 (symbol_list_n_get, symbol_list_n_used_set): New.
8426 (symbol_list_n_type_name_get): Use symbol_list_n_get.
8427 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
8428 * src/reader.c (grammar_current_rule_check): Check that values are
8429 used.
8430 * src/symtab.c (symbol_print): Accept 0.
8431 * tests/existing.at: Remove the type information.
8432 Empty the actions.
8433 Remove useless actions (beware of mid-rule actions: perl -000
8434 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
8435 * tests/actions.at (Exotic Dollars): Use unused values.
8436 * tests/calc.at: Likewise.
8437 * tests/glr-regression.at (No users destructors if stack 0 deleted):
8438 Likewise.
8439
8440 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
8441 rule_useful_p.
8442
9d9b8b70
PE
84432005-12-21 Paul Eggert <eggert@cs.ucla.edu>
8444
8bb4c753
PE
8445 Undo 2005-12-01 tentative license wording change. The wording is
8446 still being reviewed by the lawyers, and we don't want to wait for
8447 them before publishing a test release. For now, revert to the
8448 previous wording.
8449 * NEWS: Undo 2005-12-01 change.
8450 * data/glr.c: Revert to previous license wording.
8451 * data/glr.cc: Likewise.
8452 * data/lalr1.cc: Likewise.
8453 * data/location.cc: Likewise.
8454 * data/yacc.c: Likewise.
8455
9d9b8b70
PE
8456 * NEWS: Reword %destructor vs YYABORT etc.
8457 * data/glr.c: Use American spacing, for consistency.
8458 * data/glr.cc: Likewise.
8459 * data/lalr1.cc: Likewise.
8460 * data/yacc.c: Likewise.
8461 * data/yacc.c: Reformat comments slightly.
8462 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
8463 for consistency. Fix some spelling errors and reword recently-included
8464 text slightly.
8465 * tests/cxx-type.at: Cast results of malloc, for C++.
8466
2c3b392a
AD
84672005-12-21 Joel E. Denny <address@hidden>
8468
8469 * tests/cxx-type.at: Construct a tree, count the parents of shared
8470 nodes, and free each node once and only once. Previously, the memory
8471 for semantic values was leaked instead.
8472
d6cff4dc
AD
84732005-12-21 Joel E. Denny <address@hidden>
8474
8475 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
8476 (yylval, yylloc): If pure, #define to yystackp->yyval and
8477 yystackp->yyloc similar to yychar and yynerrs.
8478 (yyparse): If pure, remove local yylval and yylloc. Add local
8479 yystackp to accommodate pure definitions of yylval and yylloc.
8480 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
8481 yylvalp and yyllocp to &yylval and &yylloc.
8482 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
8483 namespace. Previously, nerrs and char were missing, but lval and lloc
8484 weren't necessary.
8485 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
8486 yylvalp and yyllocp parameters since, if pure, these are now always
8487 accessible through yystackp. If not pure, they are still accessible
8488 globally.
8489 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
8490 `if (YYID (N))' to pacify lint.
8491
a85284cf
AD
84922005-12-21 Akim Demaille <akim@epita.fr>
8493
8494 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
8495 destroy the RHS symbols of a rule.
8496 * data/yacc.c (yylen): Initialize to 0.
8497 Keep its value to the number of items to possibly shift.
8498 In particular, a regular successful parse that ends on YYFINAL by
8499 a (internal) YYACCEPT must not have yylen != 0.
8500 (yyerrorlab, yyreturn): Pop the RHS.
8501 Reorder a bit to emphasize the `shifting' bits of code.
8502 (YYPOPSTACK): Now accept a number of items to pop.
8503 * data/lalr1.cc: Likewise.
8504 * data/glr.c: Formatting changes.
8505 Use goto instead of fall through.
8506 * doc/bison.texinfo (Destructor Decl): Complete.
8507
d508c281
JMG
85082005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8509
8510 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
8511 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
8512 * djgpp/config.bat: Replace every occurence of the file name
8513 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
8514 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
8515 * djgpp/config.sed: Replace every occurence of the file name
8516 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
8517 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
8518 * djgpp/djunpack.bat: DJGPP specific file.
8519 * djgpp/fnchange.lst: DJGPP specific file.
8520 * djgpp/README.in: Add new information about how to unpack the bison
8521 source on MSDOS and other systems which have 8.3 file name restrictions
8522 using djunpack.bat and fnchange.lst.
8523
3e7a2cd9
PE
85242005-12-12 Paul Eggert <eggert@cs.ucla.edu>
8525
8526 * bootstrap (build_cvs_prefix): Remove; unused.
8527 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
8528 when getting gnulib.
8529
85302005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
8531
8532 * data/glr.c: Reorder typedef declarations for structs to match order
8533 of struct declarations.
8534 Rename yystack everywhere to yystackp except in yyparse where it's not
8535 a pointer.
8536 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
8537 consistency.
8538 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
8539 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
8540 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
8541 lint.
8542
877519f8
PE
85432005-12-09 Paul Eggert <eggert@cs.ucla.edu>
8544
0eca5a39
PE
8545 * tests/sets.at (Accept): Fix typos in regular expression used to
8546 sed out the final state number.
8547
2cec9080
PE
8548 Work around portability problem on Solaris 10: flex-generated
8549 files include <stdio.h> before <config.h>, which messes up
8550 because the latter defines __EXTENSIONS__. Address the problem
8551 by creating two new little files that include <config.h> first,
8552 then include the flex-generated files. Rewrite everyone else
8553 to include <config.h> first, as well.
8554 * lib/timevar.c: Always include "config.h".
8555 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
8556 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
8557 (EXTRA_bison_SOURCES): New macro.
8558 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
8559 * src/system.h: Don't include config.h.
8560 * src/LR0.c: Include <config.h> first.
8561 * src/assoc.c: Likewise.
8562 * src/closure.c: Likewise.
8563 * src/complain.c: Likewise.
8564 * src/conflicts.c: Likewise.
8565 * src/derives.c: Likewise.
8566 * src/files.c: Likewise.
8567 * src/getargs.c: Likewise.
8568 * src/gram.c: Likewise.
8569 * src/lalr.c: Likewise.
8570 * src/location.c: Likewise.
8571 * src/main.c: Likewise.
8572 * src/muscle_tab.c: Likewise.
8573 * src/nullable.c: Likewise.
8574 * src/output.c: Likewise.
8575 * src/parse-gram.y: Likewise.
8576 * src/print.c: Likewise.
8577 * src/print_graph.c: Likewise.
8578 * src/reader.c: Likewise.
8579 * src/reduce.c: Likewise.
8580 * src/relation.c: Likewise.
8581 * src/state.c: Likewise.
8582 * src/symlist.c: Likewise.
8583 * src/symtab.c: Likewise.
8584 * src/tables.c: Likewise.
8585 * src/uniqstr.c: Likewise.
8586 * src/vcg.c: Likewise.
8587
877519f8
PE
8588 * src/parse-gram.y: Fix minor problems uncovered by lint.
8589 (current_lhs, current_lhs_location): Now static.
8590 (current_assoc): Remove unused variable.
8591
8592 Cleanups so that Bison-generated parsers have less lint.
8593 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
8594 Prepend /*ARGSUSED*/, for lint's sake.
8595 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
8596 definition if 'lint' is defined.
8597 (YYID): New macro (or function, if lint).
8598 All uses of /*CONSTCOND*/0 replaced by YYID(0).
8599 * data/yacc.c: Likewise.
8600 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
8601 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
8602 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
8603 is C++ only.
8604 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
8605 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
8606 Use YYID(0) rather than 0, for lint.
8607 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
8608 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
8609
f5228370
PE
86102005-12-07 Paul Eggert <eggert@cs.ucla.edu>
8611
8612 * tests/glr-regression.at
8613 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
8614 Close memory leak reported by twlevo.
8615
69ce078b
PE
86162005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
8617
6ff99711
PE
8618 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
8619 all stacks.
8620 (yyparse): Iterate another stack in order to call user destructors.
69ce078b
PE
8621 * tests/glr-regression.at (No users destructors if stack 0 deleted):
8622 New test case.
8623 (Duplicated user destructor for lookahead): This test now is expected
8624 to succeed.
8625
af3412cd
PE
86262005-12-01 Paul Eggert <eggert@cs.ucla.edu>
8627
32b5b719 8628 * NEWS: Document the following change.
af3412cd
PE
8629 * data/yacc.c: Say "parser skeleton" rather than "file", since
8630 it's no longer just a file.
8631 * data/glr.c: Grant a special exception for C GLR parsers, that
8632 reads like the already-existing exception for C LALR(1) parsers.
8633 * data/glr.cc: Likewise.
8634 * data/lalr1.cc: Likewise.
8635 * data/location.cc: Likewise.
8636 * data/yacc.c: Reword the "written by" statement to clarify that
8637 it was the parser skeleton, not the entire output file.
8638 * data/glr.c: Written by Paul Hilfinger.
8639 * data/glr.cc: Written by Akim Demaille.
8640 * data/lalr1.cc: Likewise.
8641
035aa4a0
PE
86422005-11-18 Paul Eggert <eggert@cs.ucla.edu>
8643
d9963c85
PE
8644 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
8645 Fix typos in previous change that broke 'make check'.
8646 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
8647 supported in C.
8648 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
8649 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
8650 We can revert this once things settle down.
8651
035aa4a0
PE
8652 * src/conflicts.c (conflicts_print): Don't print file name twice
8653 when %expect fails because there were no conflicts.
8654 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
8655 change.
8656 * tests/conflicts.at (%expect not enough, %expect too much):
8657 (%expect with reduce conflicts): Adjust to new behavior.
8658
86592005-11-18 Akim Demaille <akim@epita.fr>
8660
8661 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
8662 errors.
8663 * NEWS: Document this.
8664 * doc/bison.texinfo (Expect Decl): Likewise.
8665
d1ff7a7c
AD
86662005-11-16 Akim Demaille <akim@epita.fr>
8667
8668 Generalize the display of semantic values and locations in traces.
8669 * data/glr.c (yy_reduce_print): Fix indices (again).
8670 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
8671 literal integers.
8672 * data/lalr1.cc (yyreduce_print): Rename as...
8673 (yy_reduce_print): this.
8674 Display values and locations.
8675 * data/yacc.c (yy_reduce_print): Likewise.
8676 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
8677 (yysymprint): Move higher to be visible from yy_reduce_print).
8678 (yyparse): Adjust.
8679 * tests/calc.at: Adjust the expected length of the traces.
8680
6de5398d
AD
86812005-11-14 Akim Demaille <akim@epita.fr>
8682
8683 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
8684 from 1 to N, while values and location start at 0.
8685 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
8686
a1373f55
AD
86872005-11-14 Akim Demaille <akim@epita.fr>
8688
8689 * data/glr.c (yy_reduce_print): Fix the $ number.
8690
613d8952
AD
86912005-11-14 Akim Demaille <akim@epita.fr>
8692
8693 "Use" parse parameters.
8694 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
8695 * data/glr.c, data/glr.cc: Use them.
8696 * data/glr.c (YYUSE): Have a C++ definition that supports
8697 non-pointer types.
8698
b2741627
AD
86992005-11-14 Akim Demaille <akim@epita.fr>
8700
8701 * data/glr.c (yyexpandGLRStack): Declare only if defined.
8702
5059b5c8
AD
87032005-11-14 Akim Demaille <akim@epita.fr>
8704
42249483
AD
8705 * data/glr.cc: New.
8706 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5059b5c8 8707
4626a15d
AD
87082005-11-12 Akim Demaille <akim@epita.fr>
8709
8710 Let position and location be PODs.
8711 * data/location.cc (position::initialize, location::initialize): New.
8712 (position::position, location::location): Define only if
8713 b4_location_constructors is defined.
8714 * data/lalr1.cc (b4_location_constructors): Define it for backward
8715 compatibility.
8716 * doc/bison.texinfo (Initial Action Decl): Use initialize.
8717
87182005-11-12 Akim Demaille <akim@epita.fr>
98ae9643
AD
8719
8720 * data/lalr1.cc: Move the body of the ctor and dtor into the
8721 parser file (instead of the header).
8722 Wrap the implementations in a "namespace yy".
8723
87242005-11-12 Akim Demaille <akim@epita.fr>
8725
8726 Have glr.c include its header file when created.
8727 * data/glr.c (b4_shared_declarations): New.
8728 Output them verbatim in the parser if !%defines, otherwise
8729 output then in the header file, and include it instead.
8730
1989d947
AD
87312005-11-11 Akim Demaille <akim@epita.fr>
8732
8733 * data/glr.c: Comment changes.
8734
87352005-11-11 Akim Demaille <akim@epita.fr>
62b08cfc
AD
8736
8737 When yydebug, report semantic and location values for reductions.
8738 * data/glr.c (yy_reduce_print): Report the semantic values and the
8739 locations.
8740 (YY_REDUCE_PRINT): Adjust.
8741 (yyglrReduce): Use them.
8742 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
8743 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
8744 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
8745 traces.
8746
02998094
AD
87472005-11-10 Akim Demaille <akim@epita.fr>
8748
8749 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
8750 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
8751 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
8752
5210672f
PE
87532005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
8754
8755 * m4/cxx.m4, examples/Makefile.am: Don't build
8756 examples/calc++ if no C++ compiler is available. (trivial change)
8757
a8991a1d
AD
87582005-11-09 Akim Demaille <akim@epita.fr>
8759
8760 * src/scan-skel.l: Use a couple of asserts.
8761
36b5e963
AD
87622005-11-03 Akim Demaille <akim@epita.fr>
8763
8764 In some (weird) cases, the final state number is incorrect.
8765 Reported by Alexandre Duret-Lutz.
8766 * src/LR0.c (state_list_append): Remove the computation of
8767 final_state.
8768 (save_reductions): Do it here.
8769 (get_state): Alpha conversion.
8770 (generate_states): Use a for loop.
8771 * src/gram.h (item_number_is_rule_number)
8772 (item_number_is_symbol_number): New.
8773 * src/state.c: Use assert.
8774 * src/system.h: Include assert.h.
8775 * tests/sets.at (Accept): New.
8776
44e7ead1
PH
87772005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8778
8779 * data/glr.c (yyfill): Adjust comment.
36b5e963 8780 (yyresolveAction): Initialize default location properly
44e7ead1
PH
8781 for empty right-hand sides.
8782 (yydoAction): Ditto.
8783 Add comment explaining apparently dead code.
36b5e963
AD
8784 * tests/glr-regression.at
8785 (Incorrectly initialized location for empty right-hand side in GLR):
44e7ead1 8786 New test.
36b5e963 8787
e10a80ee
PE
87882005-10-30 Paul Eggert <eggert@cs.ucla.edu>
8789
8790 * bootstrap (cleanup_gnulib): New function. Use it to clean up
8791 gnulib when interrupted. This fixes some race conditions and
8792 works around some portability problems (one noted by Paul
8793 Hilfinger).
8794
067b32ee
AD
87952005-10-22 Akim <akim@epita.fr>
8796
8797 * Makefile.cfg: Adjust to config -> build-aux.
8798 Reported by twledo.
8799
4b367315
AD
88002005-10-21 Akim Demaille <akim@epita.fr>
8801
8802 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
8803 the %parse-params.
8804 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
8805 * data/yacc.c (b4_Pure_if): Rename as...
8806 (b4_yacc_pure_if): this.
8807 (YY_SYMBOL_PRINT, yyparse): Adjust.
8808 * doc/bison.texinfo: Formatting changes.
8809
24cc23d9
AD
88102005-10-21 Akim Demaille <akim@epita.fr>
8811
8812 Finish the transition config -> build-aux.
8813 * configure.ac, Makefile.am: Use build-aux.
8814 * config/prev-version, config/announce-gen, config/Makefile.am:
8815 Move to...
8816 * build-aux/prev-version, build-aux/announce-gen,
8817 * build-aux/Makefile.am: here.
8818
d4476375
AD
88192005-10-14 Akim Demaille <akim@epita.fr>
8820
8821 * examples/calc++/test: Use set -x only when VERBOSE.
8822
302c0aee
PE
88232005-10-13 Paul Eggert <eggert@cs.ucla.edu>
8824
8825 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
8826 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
8827
7625ec2c
AD
88282005-10-13 Akim Demaille <akim@epita.fr>
8829
8830 * src/scan-skel.l: Output the base name parts of the parser and
8831 header file names.
302c0aee 8832 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7625ec2c
AD
8833 additional checks.
8834 Use this to exercise C++ outputs in subdirs.
8835 Reported by Oleg Smolsky.
8836
ba0fe3c7
PE
88372005-10-12 Paul Eggert <eggert@cs.ucla.edu>
8838
8839 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
8840 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
8841 Problem reported by John P. Hartmann.
8842 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
8843 already defined it.
8844
9b8a5ce0
AD
88452005-10-12 Akim Demaille <akim@epita.fr>
8846
8847 * src/parse-gram.y (version_check): Exit 63 to please missing
8848 (stands for "version mismatch).
8849 * tests/input.at, doc/bison.texinfo: Adjust.
8850
4f6e011e
PE
88512005-10-10 Paul Eggert <eggert@cs.ucla.edu>
8852
8853 Work around portability problems with Visual Age C compiler
8854 (xlc and xlC_r) reported by John P. Hartmann.
8855 * data/location.cc (initial_column, initial_line): Remove.
8856 All uses replaced by 0 and 1.
8857 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
8858 that xlc complains about.
8859 * src/scan-skel.l (skel_wrap): Likewise.
4d7aa45e 8860 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
ba0fe3c7 8861 as __STDC__.
4d7aa45e
PE
8862 * data/yacc.c (YYMODERN_C): New macro, which also looks at
8863 __STDC_VERSION__. Use it everywhere instead of looking at
8864 __STDC__ and __cplusplus.
4f6e011e 8865
a1b3bf8c
AD
88662005-10-10 Akim Demaille <akim@epita.fr>
8867
8868 * examples/calc++/test: Be quiet unless VERBOSE.
8869
412e44aa
PE
88702005-10-05 Paul Eggert <eggert@cs.ucla.edu>
8871
2a4647a3
PE
8872 * data/c.m4 (yydestruct, yysymprint):
8873 Use YYUSE instead of casting to void.
8874 * data/glr.c (YYUSE): New macro.
8875 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
8876 Use it instead of rolling our own.
8877 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
8878 (YYCHK1):
8879 Use /*CONSTCOND*/ to suppress lint warnings.
8880 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
8881 (YY_STACK_PRINT): Use 'false' not '0'.
8882 (YYUSE): New macro.
8883 (yysymprint_, yydestruct_): Use it instead of rolling our own.
8884 * data/yacc.c (YYUSE): New macro.
8885 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
8886 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
8887 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
8888
8889
412e44aa
PE
8890 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
8891 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
8892
88c6637f
PE
88932005-10-04 Paul Eggert <eggert@cs.ucla.edu>
8894
2f4f028d
PE
8895 Undo the parts of the unlocked-I/O change that substituted
8896 putc or puts for printf. This might hurt performance a bit,
8897 but some people prefer the printf style.
8898 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
8899 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
8900 All uses replaced by YYFPRINTF and YYDPRINTF.
8901 * data/yacc.c: Likewise.
8902 * lib/bitset.c (bitset_print): Likewise.
8903 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
8904 putc and puts.
8905 * lib/lbitset.c (debug_lbitset): Likewise.
8906 * src/closure.c (print_firsts, print_fderives): Likewise.
8907 * src/gram.c (grammar_dump): Likewise.
8908 * src/lalr.c (look_ahead_tokens_print): Likewise.
8909 * src/output.c (escaped_output): Likewise.
8910 (user_actions_output): Break apart two printfs.
8911 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
8912 * src/reduce.c (reduce_print): Likewise.
8913 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
8914 * src/system.h: Include unlocked-io.h rathe than stdio.h.
8915
88c6637f
PE
8916 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
8917 Use assignments rather than casts-to-void to suppress
8918 unused-variable warnings. This pacifies 'lint'.
8919 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
8920 unused-variable warnings.
8921
fb32e373
JMG
89222005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8923
8924 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
8925
edb8f44f
PE
89262005-10-02 Paul Eggert <eggert@cs.ucla.edu>
8927
fb9c0b33
PE
8928 Use unlocked I/O for a minor performance improvement on hosts like
8929 GNU/Linux and Solaris that support unlocked I/O. The basic idea
8930 is to use the gnlib unlocked-io module, and to prefer putc and
8931 puts to printf when either will work (since the latter doesn't
8932 come in an unlocked flavor).
8933 * bootstrap (gnulib_modules): Add unlocked-io.
8934 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
8935 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
8936 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
8937 and similarly for puts and putc and printf.
8938 * data/yacc.c: Likewise.
8939 * lib/bitset.c (bitset_print): Likewise.
8940 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
8941 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
8942 to printf.
8943 * lib/lbitset.c (debug_lbitset): Likewise.
8944 * src/closure.c (print_firsts, print_fderives): Likewise.
8945 * src/gram.c (grammar_dump): Likewise.
8946 * src/lalr.c (look_ahead_tokens_print): Likewise.
8947 * src/output.c (escaped_output): Likewise.
8948 (user_actions_output): Coalesce two printfs.
2f4f028d 8949 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
fb9c0b33
PE
8950 * src/reduce.c (reduce_print): Likewise.
8951 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2f4f028d 8952 * src/system.h: Include unlocked-io.h rather than stdio.h.
fb9c0b33 8953
edb8f44f
PE
8954 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
8955 this confuses xgettext.
8956
b50d2359
AD
89572005-10-02 Akim Demaille <akim@epita.fr>
8958
8959 * bootstrap (gnulib_modules): Add strverscmp.
8960 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
8961 * m4/.cvsignore: Add strverscmp.m4.
8962 * src/parse-gram.y (%require): New token, new rule.
8963 (version_check): New.
8964 * src/scan-gram.l (%require): Adjust.
8965 * tests/input.at (AT_REQUIRE): New.
8966 Use it.
8967 * doc/bison.texinfo (Require Decl): New.
8968 (Calc++ Parser): Use %require.
8969
21667f64
AD
89702005-10-02 Akim Demaille <akim@epita.fr>
8971
8972 * data/location.cc: New.
8973
2b81e969
AD
89742005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
8975 Akim Demaille <akim@epita.fr>
8976
8977 Make sure -odir/foo.cc creates dir/location.hh etc.
8978 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
8979 (spec_file_prefix, spec_verbose_file, spec_graph_file)
8980 (spec_defines_file): Now const.
8981 (dir_prefix): New.
8982 (short_base_name): Remove.
8983 * src/files.c: Adjust.
8984 (dirname.h): Include.
8985 (base_name): Don't prototype it.
8986 (finput): Remove, duplicates gram_in.
8987 (full_base_name, short_base_name): Replace by...
8988 (all_but_ext, all_but_tab_ext): these.
8989 (compute_base_names): Rename as...
8990 (compute_file_name_parts): this.
8991 Update to compute the new variables, including dir_prefix.
8992 Adjust dependencies.
8993 * src/output.c (prepare): Output them.
8994 * src/reader.c: Adjust to use gram_in, not finput.
8995 * src/scan-skel.l (@dir_prefix@): New.
8996
ad6a9b97
JMG
89972005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8998
8999 * lib/subpipe.c: New function end_of_output_subpipe() added
9000 to allow support for non-posix systems. This is a no-op function
9001 for posix systems.
9002
9003 * lib/subpipe.h: New function end_of_output_subpipe() added
9004 to allow support for non-posix systems. This is a no-op function
9005 for posix systems.
9006
9007 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
9008 handle the lack of pipe/fork functionality on non-posix systems.
9009
9010 * djgpp/Makefile.maint: DJGPP specific file.
9011
9012 * djgpp/README.in: DJGPP specific file.
9013
9014 * djgpp/config.bat: DJGPP specific configuration file.
9015
9016 * djgpp/config.sed: DJGPP specific configuration file.
9017
9018 * djgpp/config.site: DJGPP specific configuration file.
9019
9020 * djgpp/config_h.sed: DJGPP specific configuration file.
9021
9022 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
9023
9024 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
9025
fc695704
AD
90262005-10-02 Akim Demaille <akim@epita.fr>
9027
9028 * data/location.cc: New, extract from...
9029 * data/lalr1.cc: here.
9030 (location.hh): Include it after the user prologue, in case the
9031 filename type is defined by the user.
9032 Forward declation location and position before the pre-prologue.
9033 (yyresult_): Rename as...
9034 (yyresult): this, it's a local variable, not an attribute.
9035 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
9036
90372005-10-01 Akim Demaille <akim@epita.fr>
5215c87f
AD
9038
9039 * examples/extexi: Restore the #line generation.
9040
fb9712a9
AD
90412005-09-30 Akim Demaille <akim@epita.fr>,
9042 Alexandre Duret-Lutz <adl@gnu.org>
9043
9044 Move the token type and YYSTYPE in the parser class.
9045 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
9046 (parser::token): New, from the moved free definition of tokens.
9047 (parser::semantic_value): Now a full definition instead of an
9048 indirection to YYSTYPE.
9049 (b4_post_prologue): No longer included in the header file, but
9050 in the implementation file.
9051 * doc/bison.texi (C+ Language Interface): Update.
9052 * src/parse-gram.y: Support unary %define.
9053 * tests/actions.at: Define global_tokens_and_yystype for backward
9054 compatibility until we update the tests.
9055 * tests/calc.at: Idem.
9056 (first_line, first_column, last_line, last_column): Define for lalr1.cc
9057 to simplify the code.
9058
55f0c7b1
PE
90592005-09-29 Paul Eggert <eggert@cs.ucla.edu>
9060
9061 Port to SunOS 4.1.4, which lacks strtoul and strerror.
9062 Ah, the good old days! Problem reported by Peter Klein.
9063 * bootstrap (gnulib_modules): Add strerror, strtoul.
9064 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
9065 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
9066
fb9712a9 90672005-09-29 Akim Demaille <akim@epita.fr>
d4fb5e3c
AD
9068
9069 * data/c.m4 (b4_error_verbose_if): New.
9070 * data/lalr1.cc: Use it.
9071 (YYERROR_VERBOSE_IF): Remove.
9072 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
9073 parser members, replaced by...
9074 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
9075 local variables.
9076 (yysyntax_error_): Takes the state number as argument.
9077 (yyreduce_print_): Use the argument yyrule, not the former
9078 attribute yyn_.
9079
8a6f72f3
PE
90802005-09-26 Paul Eggert <eggert@cs.ucla.edu>
9081
9082 * bootstrap (gnulib_modules): Add verify.
9083 * lib/.cvsignore: Add verify.h.
9084 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
9085 * src/system.h (verify): Remove.
9086 Include verify.h instead.
9087 * src/tables.c (tables_generate): Use new API for 'verify'.
9088
0d50976f
PE
90892005-09-21 Paul Eggert <eggert@cs.ucla.edu>
9090
ebc3737e
PE
9091 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
9092 local variables whose names begin with 'yy'.
9093 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
9094 Trivial changes from Joel E. Denny.
9095
0d50976f
PE
9096 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
9097 it itself.
9098 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
9099 don't use alloca any more.
9100
9101 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
9102 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
62c4328e 9103 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
0d50976f
PE
9104 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
9105 to match yacc.c, to test more hosts.
9106
a05b79df
PE
91072005-09-20 Paul Eggert <eggert@cs.ucla.edu>
9108
55289366
PE
9109 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
9110 doesn't affect behavior.
9111 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
9112 Solaris, AIX, MSC.
9113 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
9114 This works a bit better with glibc, if user code has already included
9115 stdlib.h.
9116 * doc/bison.texinfo (Bison Parser): Document that users can't
9117 arbitrarily use malloc and free for other purposes. Document
9118 that <alloca.h> and <malloc.h> might be included.
9119 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
9120 user must declare alloca.
9121
a05b79df
PE
9122 * HACKING (release): Forwarn the Translation Project about
9123 stable releses.
9124
3ab2ca22
AD
91252005-09-20 Akim Demaille <akim@epita.fr>
9126
9127 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
9128
a9739e7c
PE
91292005-09-19 Paul Eggert <eggert@cs.ucla.edu>
9130
a702593e
PE
9131 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
9132 (YYSTACK_ALLOC_MAXIMUM): Use it.
9133 (yysyntax_error): New function.
9134 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
9135 multiple syntax errors are reported, and alloca is being used.
9136 Instead, reallocate buffers twice as big each time, so that
9137 we waste at most half the allocated memory. Start with a small
9138 (128-byte) buffer that will suffice in most cases anyway.
9139 Use yysyntax_error to do most of the work.
9140
9141 * doc/bison.texinfo (Error Reporting, Table of Symbols):
9142 yynerrs is the number of errors reported, not the number of
9143 errors encountered.
9144
a9739e7c
PE
9145 * tests/glr-regression.at (Duplicated user destructor for lookahead):
9146 Mark it as expected to fail.
9147 Cast result of malloc; problem reported by twlevo@xs4all.nl.
9148 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
9149 Don't start user-code symbols with "yy", to avoid name space problems.
9150
f479c6c6
AD
91512005-09-19 Akim Demaille <akim@epita.fr>
9152
9153 Remove the traits, failed experiment.
9154 It never proved useful, and anyway because of the current
9155 definition, it was not possible to have several specialization of
9156 this traits, making it useless.
9157 * data/lalr1.cc (yy:traits): Remove.
9158 Inline its definitions in the parser class.
9159
e2586f82
AD
91602005-09-19 Akim Demaille <akim@epita.fr>
9161
9162 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
9163 least Mac OSX with a /usr/local install of gettext.
9164
2e8cf949
AD
91652005-09-19 Akim Demaille <akim@epita.fr>
9166
9167 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
9168 and yytoken for similarity with the other skeletons.
9169
c7fb0b90
AD
91702005-09-19 Akim Demaille <akim@epita.fr>
9171
4e26c69e 9172 * NEWS, configure.ac: update version number to 2.1a.
c7fb0b90 9173
1bd0deda
PE
91742005-09-16 Paul Eggert <eggert@cs.ucla.edu>
9175
9176 * NEWS: Version 2.1.
9177
9178 * NEWS: Remove notice of yytname change, since it was never in an
9179 official release.
9180 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
9181 diagnostic.
9182 * src/output.c (prepare): Likewise.
9183 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
9184 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
9185 is not defined. This is an awful hack, but it's enough for now.
9186 All callers changed.
9187 * tests/glr-regression-at (make_value): Args are const pointers now,
9188 to avoid GCC warning.
9189 (Duplicated user destructor for lookahead): New test. Currently
9190 skipped. It fails on my host but I'm not sure it'll always fail.
9191
91922005-09-16 Akim Demaille <akim@epita.fr>
c1432f65
AD
9193
9194 * src/symtab.h (struct symbol): Declare the printer and destructor
9195 as const, to avoid accidental calls to free.
9196 (symbol_destructor_set, symbol_printer_set): Adjust.
9197 * src/symtab.c: Adjust.
9198
1bd0deda 91992005-09-16 Akim Demaille <akim@epita.fr>
cf147260
AD
9200
9201 * data/c.m4 (b4_token_enums): New.
9202 (b4_token_defines): Rename as...
9203 (b4_token_enums_defines): this.
9204 (b4_token_defines): New, output only the #defines.
9205 * data/yacc.c, data/glr.c: Adjust.
9206 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
9207 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
9208 as default values.
9209
dbcdae2d
AD
92102005-09-16 Akim Demaille <akim@epita.fr>
9211
9212 * data/lalr1.cc (yylex_): Remove, inline its code.
9213 (yyreport_syntax_error_): Remove, replaced by...
9214 (yysyntax_error_): this which returns a string and leaves to the
9215 caller the call to the users' error function.
9216 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
9217 Move from members of the parser object...
9218 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
9219 to local variables of the parse function.
9220
70d8f291
AD
92212005-09-16 Akim Demaille <akim@epita.fr>
9222
9223 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
9224 since it's in Bison's name space.
9225
b47dbebe
PE
92262005-09-15 Paul Eggert <eggert@cs.ucla.edu>
9227
ae199bf1
PE
9228 * data/glr.c (yyresolveValue): Add default case to pacify
9229 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
9230
b47dbebe
PE
9231 * NEWS: Document when yyparse started to return 2.
9232 * doc/bison.texinfo (Parser Function): Document when yyparse
9233 returns 2.
9234
9235 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
9236 (b4_filename_type): Renamed back from b4_file_name_type. All uses
9237 changed.
9238 (class position): file_name -> filename (reverting). All uses changed.
9239
92402005-09-14 Paul Eggert <eggert@cs.ucla.edu>
9241
9242 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
9243 do anything if $@ exists. This reverts part of the 2005-07-07
9244 patch.
9245
00292f66
PE
92462005-09-11 Paul Eggert <eggert@cs.ucla.edu>
9247
9248 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
9249 contains obsolete information and isn't worth distributing as a
9250 separate file anyway.
9251 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
9252 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
9253 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
9254 (yyparse): Abort if user code uses longjmp to throw an unexpected
9255 value.
9256
a420f962
PE
92572005-09-09 Paul Eggert <eggert@cs.ucla.edu>
9258
00292f66
PE
9259 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
9260 Suggested by twlevo@xs4all.nl.
9261
127287e9
PE
9262 * data/glr.c (YYCHK1): Do not assume YYE is in range.
9263 This avoids a diagnostic from gcc -Wswitch-enum.
9264 Problem reported by twlevo@xs4all.nl.
9265
a420f962
PE
9266 * doc/bison.texinfo: Don't use "filename", as per GNU coding
9267 standards. Use "file name" or "file" or "name", depending on
9268 the context.
9269 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
9270 not to hack/foo.tab.c.
9271 (Calc++ Top Level): 2nd arg of main is not const.
48b16bbc
PE
9272 * data/glr.c: b4_filename -> b4_file_name.
9273 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
9274 All uses changed.
9275 (class position): filename -> file_name. All uses changed.
9276 * data/yacc.c: b4_filename -> b4_file_name.
9277 * lib/bitset.h: filename -> file_name in local vars.
9278 * lib/bitset_stats.c: Likewise.
9279 * src/files.c: Likewise.
9280 * src/scan-skel.l ("@output ".*\n): Likewise.
9281 * src/files.c (file_name_split): Renamed from filename_split.
9282 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
a420f962
PE
9283
92842005-09-08 Paul Eggert <eggert@cs.ucla.edu>
9285
9286 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
9287 to accommodate latest gnulib.
9288
9289 * tests/glr-regression.at (Duplicate representation of merged trees):
9290 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
9291
9292 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
9293 needed.
9294
42a6501d
PE
92952005-08-26 Paul Eggert <eggert@cs.ucla.edu>
9296
9297 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
9298 All uses changed. Invoke user destructor after an error during a
9299 split parse (trivial change from Joel E. Denny).
9300
9301 * tests/glr-regression.at
9302 (User destructor after an error during a split parse): New test case.
9303 Problem reported by Joel E. Denny in:
9304 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
9305
ef9a1faf
PE
93062005-08-25 Paul Eggert <eggert@cs.ucla.edu>
9307
5b4aaf78
PE
9308 * README-cvs: Give URLs for recommended tools.
9309 Mention Gzip version problem, and bootstrapping issues.
9310 Remove troubleshooting section, as it's somewhat obsolete.
9311
b5240ba5
PE
9312 * bootstrap (no_cache): New var, to accommodate different wget
9313 variants. Use it instead of '-C off'. Problem reported by
9314 twlevo@xs4all.nl.
9315
ef9a1faf
PE
9316 * data/glr.c (yydestroyStackItem): New function.
9317 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
9318 debugging information. Problem reported by Joel E. Denny.
9319
e6efa9da
AD
93202005-08-25 Akim Demaille <akim@epita.fr>
9321
9322 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
9323
adc90f13
PE
93242005-08-24 Paul Eggert <eggert@cs.ucla.edu>
9325
9326 * data/glr.c (yyrecoverSyntaxError, yyreturn):
9327 Don't invoke destructor on unresolved entries.
9328 * tests/glr-regression.at
9329 (User destructor for unresolved GLR semantic value): New test case.
9330 Problem reported by Joel E. Denny in:
9331 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
9332
f9315de5
PE
93332005-08-21 Paul Eggert <eggert@cs.ucla.edu>
9334
15d29c1f
PE
9335 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
9336 Add strnlen.c.
9337 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
9338 lib-prefix.m4, po.m4.
9339
dd5f2af2
PE
9340 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
9341 in yydestruct diagnostic, since it might not be an error.
9342 Problem reported by Joel Denny near end of
9343 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6250acbd 9344 * data/lalr1.cc (yyerturn): Likewise.
dd5f2af2
PE
9345 * data/yacc.c (yyreturn): Likewise.
9346 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
9347
9348 * src/files.c: Remove obsolete FIXME comment.
9349
9350 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
9351 with the other templates, and to fix bogus run-on messages such
9352 as the one reported at the end of
9353 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
9354 All callers changed to avoid the newline.
9355 (yyprocessOneStack): Output two lines rather than one, to accommodate
9356 the above change. This changes the debug output format slightly.
9357
f9315de5
PE
9358 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
9359 reported by Joel E. Denny in
9360 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
9361 (trivial change).
9362 * tests/glr-regression.at (Duplicate representation of merged trees):
9363 New test, from Joel E. Denny in:
9364 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
9365 * THANKS: Add Joel E. Denny.
9366
9367 * configure.ac (AC_INIT): Bump to 2.0c.
9368
04098407
PE
93692005-07-24 Paul Eggert <eggert@cs.ucla.edu>
9370
9371 * NEWS: Version 2.0b.
9372
ca5d2013
PE
9373 * Makefile.am (SUBDIRS): Put examples before tests, so that
9374 "make check" doesn't finish with "All 1 tests passed".
9375
3d54b576
PE
9376 * tests/regression.at (Token definitions): Don't rely on
9377 AT_PARSER_CHECK for data that contains backslashes. It currently
9378 uses 'echo', and 'echo' isn't portable if its argument contains
9379 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
9380 that the byte '\0xff' is not printable in the C locale; it is,
9381 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
9382 not printable, so use '\0x81' to test.
9383
d53ae497
PE
9384 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
9385 version of GCC, since the macro is used with non-GCC compilers.
9386
fc01665e
PE
9387 Fix core dump reported by Pablo De Napoli in
9388 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
9389 * tests/regression.at (Invalid inputs with {}): New test.
9390 * src/parse-gram.y (token_name): Translate type before using
9391 it as an index.
9392
04098407
PE
9393 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
9394 the user's name space. All uses changed to __attribute__
9395 ((__unused__)).
9396 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
9397 Add __attribute__ ((__noreturn__)).
9398
9399 * etc/clcommit: Remove. We weren't using it, and it failed
9400 "make maintainer-distcheck".
9401 * Makefile.maint: Merge from coreutils.
9402 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
9403 (syntax-check-rules): Change list of rules as described below.
9404 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
9405 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
9406 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
9407 (sc_trailing_space): New rules.
9408 (sc_xalloc_h_in_src): Remove.
9409 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
9410 (sc_space_tab, sc_error_exit_success, sc_changelog):
9411 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
9412 (makefile-check, po-check, author_mark_check):
9413 (makefile_path_separator_check, copyright-check):
9414 Use grep -n, to make it easier to find violations.
9415 Use CVS_LIST and CVS_LIST_EXCEPT.
9416 (header_regexp, h_re): Remove.
9417 (dd_c): New macro.
9418 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
9419 (my-distcheck): Use more-modern GCC flags.
9420 (signatures, %.asc): Remove.
9421 (rel-files, announcement): Remove signatures.
9422 Restore old updating code, even though we don't use it, so
9423 that we're the same as coreutils.
9424 (alpha, beta, major): Depend on news-date-check.
9425 Make the upload commands.
9426
9427 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
9428 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
9429 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
9430 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
9431 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
9432 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
9433 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
9434 * tests/sets.at: Likewise.
9435
9436 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
9437 we comment out the Autoconf version number.
9438 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
9439 it's error-prone and "make maintainer-distcheck" rejects it.
9440
9441 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
9442 Indent calls to "error" to pacify "make maintainer-distcheck",
9443 when the calls are not intended to be translated.
9444 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
9445
9446 * src/Makefile.am (DEFS): Use +=, to pacify
9447 "make maintainer-distcheck".
9448 (bison_SOURCES): Add scan-skel.h.
9449 (sc_tight_scope): New rule, from coreutils.
9450
9451 * src/files.c (src_extension, header_extension):
9452 Now static, not extern.
9453 * src/getargs.c (short_options): Likewise.
9454 * src/muscle_tab.c (muscle_table): Likewise.
9455 * src/parse-gram.y (current_class, current_type, current_prec):
9456 Likewise.
9457 * src/reader.c (grammar_end, previous_rule_end): Likewise.
9458 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
9459 * src/main.c (main): Cast bindtextdomain and textdomain calls to
9460 void, to avoid warning when NLS is disabled.
9461 * src/output.c: Include scan-skel.h.
9462 (scan_skel): Remove decl, since scan-skel.h does this.
9463 (output_skeleton):
9464 Indent calls to "error" to pacify "make maintainer-distcheck".
9465 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
9466 * src/reader.h (gram_end, gram_lineno): New decls to pacify
9467 "make maintainer-distcheck".
9468 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
9469 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
9470 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
9471 (skel_lex_destroy, scan_skel): Move these decls to...
9472 * src/scan-skel.h: New file.
9473 * src/uniqstr.c (uniqstr_assert):
9474 Indent calls to "error" to pacify "make maintainer-distcheck".
9475
9476 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
9477 not @VAR@.
9478
9479 * tests/torture.at: Revamp to avoid misuse of atoi that
9480 "make maintainer-distcheck" complained about.
9481
9482 * examples/extexi (message): Don't print a message more than once,
9483 and omit line-number decoration that makes Emacs compile think
9484 that informative messages are worth worrying about.
9485
94862005-07-22 Paul Eggert <eggert@cs.ucla.edu>
9487
9488 * configure.ac: Update version number.
9489
9490 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
9491 accidentally.
9492 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
9493 autogenerated by the maintainer.
9494 * examples/calc++/.cvsignore: Add *.yy.
9495
9496 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
9497 * lib/bitset_stats.c (bitset_stats_init): Likewise.
9498 * lib/bitsetv.c (bitsetv_alloc): Likewise.
9499
9500 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
9501
9502 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
9503 from maintainer-distcheck about casting the argument of 'free'.
9504
9505 * NEWS: Mention recent yytname changes.
9506 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
9507
9508 * bootstrap: For translations that have not yet been upgraded to
9509 the new runtime-po domain, prime the pump by extracting the
9510 relevant strings from the obsolete translations. This code can be
9511 removed once the bison-runtime domain has been translated by each
9512 team.
9513
9514 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
9515 now that token names are already quoted.
9516
9517 Fix problem reported by Anthony Heading.
9518 * data/glr.c (YYTOKEN_TABLE): New macro.
9519 (yytname): Define if YYTOKEN_TABLE.
9520 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
9521 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
9522 (YYERROR_VERBOSE): Define the same way the other skeletons do.
9523 * src/output.c (prepare_symbols): Output token_table_flag.
9524
0ffda363
PE
95252005-07-21 Paul Eggert <eggert@cs.ucla.edu>
9526
9527 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
9528 again if the first call fails.
9529
9530 * data/glr.c (yytnamerr): New function.
9531 (yyreportSyntaxError): Use it to dequote most string literals.
9532 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
9533 with other skeletons. All uses changed.
9534 (yytnameerr_): New function.
9535 (yyreport_syntax_error): Use it to dequote most string literals.
9536 * data/yacc.c (yytnamerr): New function.
9537 (yyerrlab): Use it to decode most string literals.
9538 * doc/bison.texinfo (Decl Summary, Calling Convention):
9539 Clarify quoting convention of yytname.
9540 * src/output.c (prepare_symbols): Quote all names. This undoes
9541 the 2005-04-17 change, which is now accomplished (mostly) via
9542 changes in the parsers as described above.
9543 * tests/regression.at (Token definitions, Web2c Actions):
9544 Undo most 2005-04-17 change here, too.
9545
95462005-07-20 Paul Eggert <eggert@cs.ucla.edu>
9547
9548 Fix more problems reported by twlevo@xs4all.nl.
9549 * tests/cxx-type.at: Don't pipe output of ./types through sed to
9550 remove trailing spaces. This loses the exit status of ./types,
9551 and isn't needed since ./types shouldn't be emitting trailing
9552 spaces.
9553 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
9554 as the stack isn't valid in that case.
9555
9556 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
9557 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
9558 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
9559 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
9560 is used.
9561 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
9562 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
9563 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
9564 Likewise.
9565
9566 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
9567 overly-picky compilers that reject 'char *foo = "bar";'.
9568
9569 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
9570 to FILE * parameter, not to stderr. This fixes a typo introduced
9571 in the 2005-07-12 change.
9572
9573 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
9574 warnings from GCC 4.
9575
9576 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
9577 (yyglrShiftDefer, yysplitStack):
9578 Remove unused parameters b4_pure_formals. All uses changed.
9579 (yyglrShift): Remove unused parameters b4_user_formals.
9580 All uses changed.
9581 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
9582
6100a9aa
PE
95832005-07-18 Paul Eggert <eggert@cs.ucla.edu>
9584
258b75ca
PE
9585 Destructor cleanups and regularization among the three skeletons.
9586 * NEWS: Document the behavior changes.
9587 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
9588 stack before failing, as the cleanup code will do it for us now.
9589 * data/lalr1.cc (yyerrlab): Likewise.
9590 * data/glr.c (yyparse): Pop everything off the stack before
9591 freeing it, so that destructors get called properly.
9592 * data/lalr1.cc (yyreturn): Likewise.
9593 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
9594 This is more consistent.
9595 * doc/bison.texinfo (Destructor Decl): Mention more reasons
9596 why destructors might be called. 1.875 -> 2.1.
9597 (Destructor Decl, Decl Summary, Table of Symbols):
9598 Some English-language cleanups for %destructor.
9599 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
9600 Add output line for destructor of start symbol.
9601 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
9602 because of that same extra output line.
9603
1a059451
PE
9604 * NEWS: Document minor wording changes in diagnostics of
9605 Bison-generated parsers.
9606 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
9607 Remove unused formals. All uses changed.
9608 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
9609 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
9610 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
9611 Rename yyoverflowab to yyexhaustedlab.
9612 When memory exhaustion occurs during syntax-error reporting,
9613 report it separately rather than in a single diagnostic; this
9614 eases translation.
9615 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
9616 (Memory Exhausted): Renamed from Parser Stack Overflow.
9617 Revamp wording slightly to prefer "memory exhaustion".
9618 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
9619
97460c78
PE
9620 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
9621
30757c8c
PE
9622 Add i18n support to the GLR skeleton. Partially fix the C++
9623 skeleton; a C++ expert needs to finish this. Remove debugging
9624 msgids; there's little point to having them translated, since they
9625 can be understood only by someone who can read the
9626 (English-language) source code.
9627
9628 Generate runtime-po/bison-runtime.pot automatically, so that we
9629 don't have to worry about garbage getting in that file. We'll
9630 make sure after the next official release that old msgids don't
9631 get lost. See
9632 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
9633
9634 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
9635 Now auto-generated.
9636 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
9637 Fix typos in explanations of the runtime file.
9638 * bootstrap: Change gettext keyword from YYI18N to YY_.
9639 Use standard Makefile.in.in in runtime-po, since we'll arrange
9640 for backward-compatible bison-runtime.po files in a different way.
9641 * data/glr.c (YY_): New macro, from yacc.c.
9642 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
9643 Translate messages intended for users.
9644 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
9645 the wording in the other skeletons. We don't know that the memory
9646 is virtual.
9647 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
9648 Use same method that yacc.c uses.
9649 Don't translate debugging messages.
9650 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
9651 it doesn't work (yet), and requires C++ expertise to fix.
9652 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
9653 Move defn to a more logical place, to be consistent with other
9654 skeletons.
9655 Don't translate debugging messages.
9656 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
9657 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
9658 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
9659 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
9660
ac8c5689
PE
9661 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
9662 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
9663 void, not int.
9664 * tests/glr-regression.at (Badly Collapsed GLR States):
9665 Likewise.
9666 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
9667 yylex should return 0 at EOF rather than aborting.
9668
6100a9aa
PE
9669 Improve tests for stack overflow in GLR parser.
9670 Problem reported by twlevo@xs4all.nl.
9671 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
9672 All uses removed.
9673 (yyStackOverflow): Just longjmp, but with value 2 so that caller
9674 can handle the problem.
9675 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
9676 (yyparse): New local variable yyresult to record the result.
9677 Use result of setjmp to set it, rather than storing itinto
9678 struct.
9679 (yyDone): Remove label.
9680 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
9681 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
9682 if YYABORT is used).
9683 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
9684 yyparse status; put status > 1 into diagnostic.
9685 Check that status==2 works.
9686 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
9687 Use exit status 3 for failure to open (which shouldn't happen).
9688
15f40952
PE
96892005-07-17 Paul Eggert <eggert@cs.ucla.edu>
9690
67fd79c4
PE
9691 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
9692 1 on syntax error; just let yyparse do its thing.
9693 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
9694 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
9695 (Exploding the Stack Size with Alloca):
9696 (Exploding the Stack Size with Malloc):
9697 Expect exit status 2, not 1, since the parser is supposed to blow
9698 its stack. Problem reported by twlevo@xs4all.nl.
9699
15f40952
PE
9700 * data/glr.c (yyparse): Don't assume that the initial calls
9701 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
9702 Print a stack-overflow message and fail instead.
9703 Initialize the line-number information before creating the stack,
9704 so that the stack-overflow message can report line zero safely.
9705
f32c66b5
PE
97062005-07-14 Paul Eggert <eggert@cs.ucla.edu>
9707
a22ff96f 9708 Fix problems reported by twlevo@xs4all.nl.
e2688cd9
PE
9709 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
9710 (yyuserMerge): Provide a default case if b4_mergers is empty.
9711 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
9712 * tests/glr-regression.at
9713 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
c70fdfcd 9714 Add casts to pacify C++ compilers.
1beb0b24
PE
9715 * tests/glr-regression.at (Improper merging of GLR delayed action
9716 sets): Declare yylex before using it.
f32c66b5 9717 * tests/Makefile.am (maintainer-check-g++): Fix a stray
a22ff96f
PE
9718 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
9719 test for valgrind; valgrind is independent of g++.
9720 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
9721 for compatibility with POSIX 1003.1-2001 (if running coreutils).
9722 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
9723 Use a destructor, so that we can expand the stack. Change
9724 YYSTYPE to char * so that we can free it. Cast result of malloc.
f32c66b5 9725
d741bd1b
PE
97262005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
9727
9728 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
9729 a valgrind failure. Problem reported by twlevo@xs4all.nl.
9730
0410a6e0
PE
97312005-07-13 Paul Eggert <eggert@cs.ucla.edu>
9732
9733 * PACKAGING: New file, suggested by Bruno Haible and taken from
9734 similar wording in gettext's PACKAGING file.
9735 * NEWS: Mention PACKAGING.
9736 * Makefile.am (EXTRA_DIST): Add PACKAGING.
9737
f7ab6a50
PE
97382005-07-12 Paul Eggert <eggert@cs.ucla.edu>
9739
baf785db 9740 * NEWS: Document recent i18n improvements.
f7ab6a50
PE
9741 * bootstrap: Get runtime translations into runtime-po.
9742 Create runtime-po files automatically, if possible.
9743 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
9744 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
9745 does not infringe on the user's name space.
9746 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
9747 * doc/bison.texinfo (Internationalization): Revamp the English
9748 and Texinfo syntax a bit, to try to make it clearer.
9749 (Bison Options, Option Cross Key): Mention --print-localedir.
9750 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
9751 YYENABLE_NLS. Quote a bit more.
9752 * runtime-po/.cvsignore: New file.
9753 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
9754 * runtime-po/Rules-quot: Remove; now created by bootstrap.
9755 * runtime-po/quot.sed: Likewise.
9756 * runtime-po/boldquot.sed: Likewise.
9757 * runtime-po/en@quot.header: Likewise.
9758 * runtime-po/en@boldquot.header: Likewise.
9759 * runtime-po/insert-header.sin: Likewise.
9760 * runtime-po/remove-potcdate.sin: Likewise.
9761 * runtime-po/Makevars: Likewise.
9762 * runtime-po/LINGUAS: Likewise.
9763 * runtime-po/de.po: Likewise; we will rely on the translation project
9764 to maintain this, so "bootstrap" should get it.
0410a6e0 9765 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
f7ab6a50
PE
9766 its value.
9767 * src/main.c (main): Bind the bison-runtime domain, too.
9768
97692005-07-12 Bruno Haible <bruno@clisp.org>
9770
9771 * data/yacc.c: Include <libintl.h> when NLS is enabled.
9772 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
9773 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
9774 * runtime-po: New directory.
9775 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
9776 $(DOMAIN).pot-update rule, so that old messages are never dropped.
9777 * runtime-po/Rules-quot: New file, copied from po/.
9778 * runtime-po/quot.sed: Likewise.
9779 * runtime-po/boldquot.sed: Likewise.
9780 * runtime-po/en@quot.header: Likewise.
9781 * runtime-po/en@boldquot.header: Likewise.
9782 * runtime-po/insert-header.sin: Likewise.
9783 * runtime-po/remove-potcdate.sin: Likewise.
9784 * runtime-po/Makevars: New file.
9785 * runtime-po/POTFILES.in: New file.
9786 * runtime-po/LINGUAS: New file.
9787 * runtime-po/bison-runtime.pot: New file.
9788 * runtime-po/de.po: New file.
9789 * m4/bison.m4: New file.
9790 * Makefile.am (SUBDIRS): Add runtime-po.
9791 (aclocaldir, aclocal_DATA): New variables.
9792 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
9793 Define aclocaldir.
9794 * src/getargs.c (usage): Document --print-localedir option.
9795 (PRINT_LOCALEDIR_OPTION): New enum item.
9796 (long_options): Add --print-localedir option.
9797 (getargs): Handle --print-localedir option.
9798 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
9799 (Internationalization): New section.
9800
22dda0f0
AD
98012005-07-12 Akim Demaille <akim@epita.fr>
9802
9803 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
9804 for consistency with the rest of the code.
9805 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
9806 Add separators.
9807
82b248ad
AD
98082005-07-12 Akim Demaille <akim@epita.fr>
9809
9810 * src/parse-gram.y: Use %printer instead of YYPRINT.
9811
fa0e9314
AD
98122005-07-12 Akim Demaille <akim@epita.fr>
9813
867a3e00
AD
9814 * src/symtab.h, src/symtab.c (symbol_print): New.
9815 * src/symlist.h, src/symlist.c (symbol_list_print): New.
9816 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
9817
98182005-07-12 Akim Demaille <akim@epita.fr>
9819
9820 * data/glr.c (b4_syncline): Fix (swap) the definitions of
fa0e9314
AD
9821 b4_at_dollar and b4_dollar_dollar.
9822
e054b190
PE
98232005-07-11 Paul Eggert <eggert@cs.ucla.edu>
9824
9825 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
9826 and Pennello's paper.
9827
34160ec4
PE
98282005-07-09 Paul Eggert <eggert@cs.ucla.edu>
9829
407d4a75
PE
9830 * data/yacc.c (yyparse): Undo previous patch. Instead,
9831 set yylsp[0] and yyvsp[0] only if the initial action
9832 sets yylloc and yylval, respectively.
9833
34160ec4
PE
9834 * data/yacc.c (yyparse): In the initial action, set
9835 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
9836 This avoids the use of undefined variables if the initial
9837 action does not set yylloc and/or yylval.
9838
c3d5a4a7
PE
98392005-07-07 Paul Eggert <eggert@cs.ucla.edu>
9840
b34d96c1
PE
9841 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
9842 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
9843 Remove from CVS. These files are automatically generated.
9844 * examples/extexi: Clarify that this file is now part of Bison,
9845 not GNU M4, and that it works with any POSIX-compatible Awk.
9846 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
9847 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
9848 so that we also get calc++-parser.yy. Geneate it.
9849 Use $(AWK), not gawk, since any conforming Awk will do.
9850 Put comment before action, since older 'make' can't handle comment
9851 in action.
9852 $(BUILT_SOURCES): List all built sources, not just some of them.
9853 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
9854 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
9855 $($(calc_sources_generated)): Remove unnecessary test for existence
9856 of target. (This had a shell syntax error anyway; a stray "x".)
9857 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
9858 calc++-parser.yy.
9859 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
9860
c3d5a4a7
PE
9861 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
9862 implied by the other modules.
9863
828c373b
AD
98642005-07-06 Akim Demaille <akim@epita.fr>
9865
9866 Bind examples/calc++ to the package.
9867 * examples/calc++/Makefile: Remove, replaced by...
9868 * examples/calc++/Makefile.am: ... this new file.
9869 * examples/calc++/test: Remove input.
9870 * examples/calc++/compile: Remove.
9871 * examples/Makefile.am: New.
9872 * configure.ac, Makefile.am: Adjust.
9873 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
9874
63cb01d6
PE
98752005-07-05 Paul Eggert <eggert@cs.ucla.edu>
9876
fd2df2ed
PE
9877 * data/glr.c (yyFail): Drastically simplify; since the format argument
9878 never had any % directives, we can simply pass it to yyerror.
9879 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
9880 be modified later, as that is the usual style in glr.c.
9881 Problems reported by Paul Hilfinger.
9882
63cb01d6
PE
9883 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
9884 and size overflow errors.
9885 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
9886 in case the user prolog sets feature-test macros like _GNU_SOURCE.
9887 (YYSIZEMAX): New macro.
9888 (yystpcpy): New function, taken from yacc.c.
9889 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
9890 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
9891 so that we don't have to maintain their signatures.
9892 (yyFail): Check for buffer overflow, by using vsnprintf rather
9893 than vsprintf. Allocate a bigger buffer if possible.
9894 Report an error if buffer allocation fails.
9895 (yyStackOverflow): New function.
9896 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
9897 the initialization was successful. It might fail if storage was
9898 exhausted.
9899 (yyexpandGLRStack): Add more checks for storage allocation failure.
9900 Use yyStackOverflow to report failures.
9901 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
9902 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
9903 Don't assume stack number fits in int.
9904 (yysplitStack): Check for storage allocation failure.
9905 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
9906 can print diagnostics on storage allocation failure. All callers
9907 changed.
9908 (yyresolveValue): Use yybool for boolean.
9909 (yyreportSyntaxError): Check for size-calculation overflow.
9910 This code is taken from yacc.c.
9911 (yyparse): Check for storage allocation errors when allocating
9912 the initial stack.
9913
1c59e0a1
AD
99142005-07-05 Akim Demaille <akim@epita.fr>
9915
9916 Extract calc++ from the documentation.
9917 * doc/bison.texinfo (Calc++): Add the extraction marks.
9918 * examples/extexi: New, from the aborted GNU Programming 2E.
9919 Separate the different paragraph of a file with empty lines.
9920 * examples/Makefile: Use it to extract the whole calc++ example.
9921
8a0adb01
AD
99222005-06-24 Akim Demaille <akim@epita.fr>
9923
9924 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
9925 class typedefs.
9926
12545799
AD
99272005-06-22 Akim Demaille <akim@epita.fr>
9928
9929 * doc/bison.texinfo (C++ Language Interface): First stab.
9930 (C++ Parsers): Remove.
9931
99be0235
AD
99322005-06-22 Akim Demaille <akim@epita.fr>
9933
9934 * data/lalr1.cc (yylex_): Honor %lex-param.
9935
0ffd4fd1
AD
99362005-06-22 Akim Demaille <akim@epita.fr>
9937
9938 Start a set of simple examples.
9939 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
9940 * examples/calc++/calc++-driver.hh,
9941 * examples/calc++/calc++-parser.yy,
9942 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
9943 * examples/calc++/compile, examples/calc++/test: New.
9944
0925ebb4
PE
99452005-06-09 Paul Eggert <eggert@cs.ucla.edu>
9946
9947 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
9948 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
9949 which stems from the 2005-05-27 patch.
9950
43d3b664
PH
99512005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
9952
9953 * data/glr.c: Modify treatment of unused parameters to permit use
9954 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
9955
3062864d
PE
99562005-05-30 Paul Eggert <eggert@cs.ucla.edu>
9957
9958 Fix infringement on user name space reported by Janos Zoltan Szabo.
9959 * data/yacc.c (yyparse): strlen -> yystrlen.
9960
989b5b8e
AD
99612005-05-30 Akim Demaille <akim@epita.fr>
9962
9963 * data/lalr1.cc (_): New.
9964 Translate the various messages.
9965
bedf57f5
PE
99662005-05-27 Paul Eggert <eggert@cs.ucla.edu>
9967
9968 Fix infringement on user name space reported by Bruno Haible.
9969 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
9970 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
9971 the user's name space.
9972 (alloca): Include <stdlib.h> to get it, if it's not built in.
9973 (YYMALLOC, YYFREE): Define only if needed.
9974 (malloc, free): Declare, but only if needed, as this infringes on
9975 the user name space.
9976
4d1801f1
PE
99772005-05-25 Paul Eggert <eggert@cs.ucla.edu>
9978
9979 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
9980 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
9981 with %d format.
9982 * lib/ebitset.c (min, max): Undef before defining.
9983 * lib/vbitset.c (min, max): Likewise.
9984 * lib/subpipe.c (create_subpipe): Save local variables in case
9985 vfork clobbers them.
9986
99872005-05-24 Bruno Haible <bruno@clisp.org>
9988
9989 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
9990 error message syntax used by gcc-4.0.
9991
b94a9e1e
PE
99922005-05-23 Paul Eggert <eggert@cs.ucla.edu>
9993
85ac3861
PE
9994 * README: Mention m4 1.4.3. Remove obsolete advice about
9995 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
9996
b94a9e1e
PE
9997 * bootstrap: Remove workaround for problem I encountered with
9998 gettext 0.14.1; it seems to be fixed now.
9999
51c30d21
PE
100002005-05-22 Paul Eggert <eggert@cs.ucla.edu>
10001
009ce67d
PE
10002 * NEWS: Version 2.0a.
10003
f2a97c62
PE
10004 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
10005 the previous change.
10006
c8775f93
PE
10007 Various maintainer cleanups.
10008 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
10009 conftest*, for benefit of CVS commands run at the same time as
10010 "configure". Add build-aux, since "bootstrap" now creates it and
10011 its subfiles.
10012 * Makefile.cfg (move_if_change): Remove.
10013 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
10014 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
10015 (po_repo, do-po-update, po-update, wget_files, get-targets):
10016 (config.guess-url_prefix, config.sub-url_prefix):
10017 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
10018 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
10019 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
10020 Remove.
10021 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
10022 this is now the recommended name.
10023 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
10024 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
10025 ylwrap. These files now go into build-aux.
10026 * config/move-if-change: Remove.
10027 * config/prev-version.txt: Bump from 1.75 to 2.0.
10028
3ea5f0ec
PE
10029 * bootstrap: Add stdio-safer, unistd-safer modules.
10030 Remove m4/glibc2.m4 (introduced by latest gnulib, but
10031 we don't need it).
10032 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
10033 fopen-safer.c, stdio-safer.h, unistd-safer.h.
10034 * lib/subpipe.c: Include "unistd-safer.h".
10035 (create_subpipe): Make sure all the newly-created
10036 file descriptors are > 2, so that diagnostics don't
10037 get sent down them (which might cause Bison to hang, in theory).
10038 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
10039 * src/files.c (xfopen): Use fopen_safer, not fopen.
10040
51c30d21
PE
10041 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
10042 yesterday's yacc.c fix.
10043
cea1469d
PE
100442005-05-21 Paul Eggert <eggert@cs.ucla.edu>
10045
3ea5f0ec
PE
10046 * data/glr.c, data/lalr1.cc: Update copyright date.
10047
cea1469d
PE
10048 Fix a destructor bug reported by Wolfgang Spraul in
10049 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
10050 * data/yacc.c (yyabortlab): Don't call destructor, and
10051 don't set yychar to EMPTY.
10052 (yyoverflowlab): Don't call destructor.
10053 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
10054 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
10055 since we no longer output the message "discarding lookahead token
10056 end of input ()".
10057
5e6f62f2
PH
100582005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10059
10060 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
10061 fix a small glitch in debugging output.
10062 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
10063 after YY_SYMBOL_PRINT where needed.
10064
10065 (struct yyGLRState): Add some comments.
10066 (struct yySemanticOption): Add some comments.
10067 (union yyGLRStackItem): Add comment.
10068
10069 (yymergeOptionSets): Correct this to properly perform the union,
10070 avoiding infinite reported by Michael Rosien.
10071 Update comment.
10072
10073 * tests/glr-regression.at: Add test for GLR merging error reported
10074 by M. Rosien.
cea1469d 10075
0fb669f9
PE
100762005-05-13 Paul Eggert <eggert@cs.ucla.edu>
10077
10078 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
10079 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
10080 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
10081 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
10082 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
10083 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
10084 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
10085 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
10086 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
10087 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
10088 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
10089 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
10090 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
10091 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
10092 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
10093 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
10094 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
10095 src/derives.h, src/files.c, src/files.h, src/getargs.c,
10096 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
10097 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
10098 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
10099 src/output.h, src/parse-gram.c, src/parse-gram.h,
10100 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
10101 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
10102 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
10103 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
10104 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
10105 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
10106 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
10107 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
10108 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
10109 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
10110 tests/reduce.at, tests/regression.at, tests/sets.at,
10111 tests/synclines.at, tests/testsuite.at, tests/torture.at:
10112 Update FSF postal mail address.
10113
51f4735e
PE
101142005-05-11 Paul Eggert <eggert@cs.ucla.edu>
10115
10116 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
10117 Problem reported by Ralf Menzel.
10118
80ce3401
PE
101192005-05-01 Paul Eggert <eggert@cs.ucla.edu>
10120
10121 * tests/actions.at: Test that stack overflow invokes destructors.
10122 From Marcus Holland-Moritz.
10123 * data/yacc.c (yyerrlab): Move the code that destroys the stack
10124 from here....
10125 (yyreturn): to here. That way, destructors are called properly
10126 even if the stack overflows, or the user calls YYACCEPT or
10127 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
10128 (yyoverflowlab): Destroy the lookahead.
10129
101302005-04-24 Paul Eggert <eggert@cs.ucla.edu>
10131
10132 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
10133
72f000b0
PE
101342005-04-17 Paul Eggert <eggert@cs.ucla.edu>
10135
10136 * NEWS: Bison-generated C parsers no longer quote literal strings
10137 associated with tokens.
10138 * src/output.c (prepare_symbols): Don't escape strings,
10139 since users don't want to see C escapes.
10140 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
10141 in diagnostics.
c19683bb 10142 * tests/input.at (Torturing the Scanner): Likewise.
72f000b0
PE
10143 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
10144
1094323f
PE
101452005-04-16 Paul Eggert <eggert@cs.ucla.edu>
10146
10147 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
10148 the data size is known to be too small and we can't increase it.
10149 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
10150
ca407bdf
PE
101512005-04-15 Paul Eggert <eggert@cs.ucla.edu>
10152
10153 * src/parse-gram.y: Include quotearg.h.
10154 (string_as_id): Quote $1 before using it as a key, since the
10155 lexer no longer quotes it for us.
10156 (string_content): Don't strip quotes, since lexer no longer
10157 quotes it for us.
10158 * src/scan-gram.l: Include quotearg.h.
10159 ("\""): Omit quote.
10160 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
10161 a key, since the rest of the lexer doesn't quote it.
10162 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
10163 * tests/regression.at (Token definitions): Check for backslashes
10164 in token strings.
10165
10166 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
10167 (YYSIZE_T): Define to unsigned long int when using an older compiler.
10168 (yyparse): Revamp code to generate long syntax error message, to
10169 make it easier to translate, and to avoid problems with arithmetic
10170 overflow. Change "virtual memory" to "memory" in diagnostic, since
10171 we don't know whether the memory is virtual.
10172
1ce59070
PE
101732005-04-13 Paul Eggert <eggert@cs.ucla.edu>
10174
10175 * NEWS: Bison-generated C parsers now use the _ macro to
10176 translate strings.
10177 * data/yacc.c (_) [!defined _]: New macro.
10178 All English strings wrapped inside this macro.
10179 * doc/bison.texinfo (Bison Parser): Document _.
10180 * po/POTFILES.in: Include src/parse-gram.c, since it now
10181 includes translateable strings that parse-gram.y doesn't.
10182
a749a695
PE
101832005-04-12 Paul Eggert <eggert@cs.ucla.edu>
10184
10185 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
10186 reverting the 2004-10-11 change to this function.
10187 (symbol_check_alias_consistency): Don't call symbol_type_set
10188 if the type name is already correct.
10189 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
10190
8fb1053b
PE
101912005-03-25 Paul Eggert <eggert@cs.ucla.edu>
10192
10193 * tests/regression.at (Token definitions): Don't use a token named
10194 c, as that generates a "#define c ..." that runs afoul of buggy
10195 stdlib.h that uses the identifier c as a member of struct
10196 drand48_data. Problem reported by Horst Wente.
10197
ff498c4a
PE
101982005-03-21 Paul Eggert <eggert@cs.ucla.edu>
10199
10200 * bootstrap: Change translation URL from
10201 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
10202 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
10203 redirection glitches. Problem reported by twlevo@xs4all.nl.
10204
65211d70
PE
102052005-03-20 Paul Eggert <eggert@cs.ucla.edu>
10206
10207 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
10208 after operands; POSIX says this isn't portable for the c99 command.
10209
9577fb1f
PE
102102005-03-18 Paul Eggert <eggert@cs.ucla.edu>
10211
10212 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
10213 immediately if a data overrun has occurred; this may help us track
10214 down what may be a spurious failure on MacOS.
10215
78b178f7
PE
102162005-03-17 Paul Eggert <eggert@cs.ucla.edu>
10217
a2599d0f
PE
10218 Respond to problems reported by twlevo@xs4all.nl.
10219
10220 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
10221
78b178f7
PE
10222 * src/vcg.h: Comment fix.
10223 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
10224 (G_CMAX): Change to -1 instead of INT_MAX.
10225
10226 * data/yacc.c (yyparse): Omit spaces before #line.
78b178f7 10227
7296e729
PE
102282005-03-15 Paul Eggert <eggert@cs.ucla.edu>
10229
10230 * src/tables.c (state_number_to_vector_number): Put it inside an
10231 "#if 0", since it's not currently used. Problem reported by
10232 Roland McGrath.
10233
05ac60f3
PE
102342005-03-06 Paul Eggert <eggert@cs.ucla.edu>
10235
10236 * src/output.c (escaped_output): Renamed from
10237 escaped_file_name_output, since we now use it for symbol tags as
10238 well. All uses changed.
10239 (symbol_destructors_output, symbol_printers_output):
10240 Escape symbol tags too.
10241 Problem reported by Matyas Forstner in
10242 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
10243
10244 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
10245 not needed.
10246 * src/output.c (user_actions_output, token_definitions_output,
10247 symbol_destructors_output, symbol_printers_output): Likewise.
10248 * src/reader.c (prologue_augment): Likewise.
10249 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
10250
10251 * src/vcg.c (output_edge): Don't quote linestyle arg.
10252 Problem reported by twlevo@xs4all.nl.
10253
7eb453ac
PE
102542005-02-28 Paul Eggert <eggert@cs.ucla.edu>
10255
10256 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
10257 example, reported by Derek M Jones. Also, make the example even
10258 more outrageous, to better illustrate how bad the problem is.
10259
4c04c52a
PE
102602005-02-24 Paul Eggert <eggert@cs.ucla.edu>
10261
10262 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
10263 putsym. Typo reported by Sebastian Piping.
10264
a61e1620
PE
102652005-02-23 Paul Eggert <eggert@cs.ucla.edu>
10266
10267 * doc/bison.texinfo (Language and Grammar): some -> same
10268 (Epilogue): int he -> in the
10269 Typos reported by Sebastian Piping via Justin Pence.
10270
9ec93868
PE
102712005-02-07 Paul Eggert <eggert@cs.ucla.edu>
10272
10273 * tests/glr-regression.at (Improper handling of embedded actions
10274 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
10275 embedded actions and $-N in GLR parsers", work around an Autoconf bug
10276 with dollar signs in test names.
10277 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
10278 for a similar reason.
10279
73ce7e7e
PE
102802005-01-28 Paul Eggert <eggert@cs.ucla.edu>
10281
10282 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
10283 wants to redefine G_VIEW.
10284
2e72b98e
PE
102852005-01-27 Paul Eggert <eggert@cs.ucla.edu>
10286
10287 * src/vcg.c (get_view_str): Remove case for normal_view.
10288 Problem reported by twlevo@xs4all.nl.
10289
e0d634e5
PE
102902005-01-24 Paul Eggert <eggert@cs.ucla.edu>
10291
ccf830a4
PE
10292 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
10293 Problem reported by twlevo@xs4all.nl.
10294
e0d634e5
PE
10295 * doc/bison.texinfo: Change @dircategory from "GNU programming
10296 tools" to "Software development". Requested by Richard Stallman
10297 via Karl Berry.
10298
7bbc8cb0
PE
102992005-01-23 Paul Eggert <eggert@cs.ucla.edu>
10300
10301 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
10302 Problem reported by twlevo@xs4all.nl.
10303
08b770bc
PE
103042005-01-21 Paul Eggert <eggert@cs.ucla.edu>
10305
10306 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
10307 keyword; it's not needed with modern compilers, and it doesn't
10308 affect correctness with older compilers. Suggested by
10309 twlevo@xs4all.nl.
10310
95f22ad2
PE
103112005-01-17 Paul Eggert <eggert@cs.ucla.edu>
10312
10313 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
10314 gcc -Wswitch-default.
10315 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
10316 * data/yacc.c (yyparse): Likewise.
10317
d229d15c
PE
103182005-01-12 Paul Eggert <eggert@cs.ucla.edu>
10319
10320 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
10321 already. Let config.h define any nonstandard values.
10322
ecadd90f
PE
103232005-01-10 Paul Eggert <eggert@cs.ucla.edu>
10324
10325 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
10326 for the benefit of slower hosts. Problem reported by
10327 Nelson H. F. Beebe.
10328
213744b5
PE
103292005-01-07 Paul Eggert <eggert@cs.ucla.edu>
10330
10331 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
10332 being defined and not used.
10333 * data/lalr1.cc (yyparse): Likewise.
10334 Use "if (false)" rather than "if (0)".
10335
249d3236
PE
103362005-01-05 Paul Eggert <eggert@cs.ucla.edu>
10337
10338 * TODO: Mention that we should allow NUL bytes in tokens.
10339
987cc1fb
PE
103402005-01-02 Paul Eggert <eggert@cs.ucla.edu>
10341
10342 * src/scan-skel.l (<<EOF>>): Don't close standard output.
10343 Problem reported by Hans Aberg.
10344
08fe02d9
PE
103452005-01-01 Paul Eggert <eggert@cs.ucla.edu>
10346
10347 * src/getargs.c (version): Happy new year; update overall
10348 program copyright date from 2004 to 2005.
10349
10350 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
10351 Problem reported by Hans Aberg.
10352 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
10353 (Output file names.): Add a test for the case when standard output
10354 is closed.
10355
010c0266
PE
103562004-12-26 Paul Eggert <eggert@cs.ucla.edu>
10357
10358 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
10359 to fix an oversight in the Bison 2.0 manual.
10360
da12206a
PE
103612004-12-25 Paul Eggert <eggert@cs.ucla.edu>
10362
10363 * NEWS: Version 2.0. Reformat the existing news items since
10364 1.875, so that related items are grouped together.
3a4734aa 10365 * configure.ac (AC_INIT): Bump version to 2.0.
da12206a
PE
10366 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
10367
c935d934
PE
10368 * tests/torture.at (Exploding the Stack Size with Alloca): Set
10369 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
10370 otherwise, we're not testing alloca. Unfortunately there's no
10371 simple way to consult HAVE_ALLOCA here.
10372
da12206a
PE
10373 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
10374 for yymsg, too.
10375
10376 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
10377 hand. This avoids a warning about comparing int to size_t when
10378 GCC warnings are enabled.
10379
0a2c5137
PE
103802004-12-22 Paul Eggert <eggert@cs.ucla.edu>
10381
d7e14fc0
PE
10382 * NEWS: Bison-generated parsers no longer default to using the
10383 alloca function (when available) to extend the parser stack, due
10384 to widespread problems in unchecked stack-overflow detection.
10385 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
10386 responsibility to set it to a positive value. This lets the user
10387 specify a value that is not a preprocessor constant.
10388 * data/yacc.c (YYMAXDEPTH): Likewise.
10389 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
10390 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
10391 to be a compile-time constant. However, explain the constraints on it.
10392 Also, explain the constraints on YYINITDEPTH.
10393 (Table of Symbols): Explain that alloca is no longer the default.
10394 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
10395 to 1.
10396
0a2c5137
PE
10397 * doc/bison.texinfo (Location Default Action): Mention that n must
10398 be zero when k is zero. Suggested by Frank Heckenbach.
10399
e019c247
AD
104002004-12-22 Akim Demaille <akim@epita.fr>
10401
10402 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
10403 (parser::state_type, parser::semantic_type, parser::location_type):
10404 Private, not public.
10405 (parser::parse): Return ints, not bool.
10406 Returning a bool introduces a problem: 0 corresponds to false, and
10407 it seems weird to return false on success. Returning true changes
10408 the conventions for yyparse.
10409 Alternatively we could return void and send an exception.
10410 There is no clear consensus (yet?).
10411 (state_stack, semantic_stack, location_stack): Rename as...
10412 (state_stack_type, semantic_stack_type, location_stack_type): these.
10413 Private, not public.
10414 * tests/c++.at: New.
10415 * tests/testsuite.at, tests/Makefile.am: Adjust.
10416
72731bb7
AD
104172004-12-21 Akim Demaille <akim@epita.fr>
10418
10419 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
10420
9a0d8bec
AD
104212004-12-21 Akim Demaille <akim@epita.fr>
10422
10423 Don't impose std::string for filenames.
10424
10425 * data/lalr1.cc (b4_filename_type): New.
10426 (position::filename): Use it.
10427 (parser.hh): Move the inclusion of stack.hh and location.hh below
10428 the user code, so that needed headers for the filename type can be
10429 included first.
72731bb7
AD
10430 Forward declare them before the user code.
10431 * tests/Makefile.am (check-local, installcheck-local): Pass
10432 TESTSUITEFLAGS to the TESTSUITE.
9a0d8bec 10433
99880de5
AD
104342004-12-20 Akim Demaille <akim@epita.fr>
10435
10436 Use more STL like names: my_class instead of MyClass.
10437
10438 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
10439 (SemanticStack, SemanticType, StateStack, StateType)
10440 (TokenNumberType, Stack, Slice, Traits, Parser::location)
10441 (Parser::value): Rename as...
10442 (location_stack, location_type, rhs_number_type, semantic_stack)
10443 (semantic_type, state_stack, state_type, token_number_type, stack)
10444 (slice, traits, parser::yylloc, parser::yylval): these.
10445
10446 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
10447
9bec482e
PE
104482004-12-19 Paul Eggert <eggert@cs.ucla.edu>
10449
10450 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
10451 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
10452
f6fbd3da
PE
104532004-12-17 Paul Eggert <eggert@cs.ucla.edu>
10454
10455 Remove uses of 'short int' and 'unsigned short int'. This raises
10456 some arbitrary limits. It uses more memory but nowadays that's
10457 not much of an issue.
10458
10459 This change does not affect the generated parsers; that's a different
10460 task, as some users will want to conserve memory there.
10461
10462 Ideally we should use size_t to represent all object counts, and
10463 something like ptrdiff_t to represent signed differences of object
10464 counts; but that will require more code-cleanup than I have the
10465 time to do right now.
10466
10467 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
10468 Use size_t, not int or short int, to count objects.
10469 * src/closure.c (nritemset, closure): Likewise.
10470 * src/closure.h (nritemset, closure): Likewise.
10471 * src/nullable.c (nullable_compute): Likewise.
10472 * src/print.c (print_core): Likewise.
10473 * src/print_graph.c (print_core): Likewise.
10474 * src/state.c (state_compare, state_hash): Likewise.
10475 * src/state.h (struct state): Likewise.
10476 * src/tables.c (default_goto, goto_actions): Likewise.
10477
10478 * src/gram.h (rule_number, rule): Use int, not short int.
10479 * src/output.c (prepare_rules): Likewise.
10480 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
10481 errs, reductions): Likewise.
10482 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
10483 Likewise.
10484 * src/tables.c (vector_number, tally, action_number,
10485 ACTION_NUMBER_MINIMUM): Likewise.
10486 * src/output.c (muscle_insert_short_int_table): Remove.
10487
efeed023
AD
104882004-12-17 Akim Demaille <akim@epita.fr>
10489
10490 * data/lalr1.cc: Extensive Doxygenation.
10491 (error_): Rename as...
10492 (error): this, since it is visible to the user.
10493 Adjust callers.
10494 (Parser::message): Now an automatic variable from...
10495 (Parser::yyreport_syntax_error_): here.
10496 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
10497 Parser::error.
10498 * tests/input.at: Escape $.
10499
bc82c5a5
PE
105002004-12-16 Paul Eggert <eggert@cs.ucla.edu>
10501
10502 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
10503 Parenthesize rhs to avoid obscure problems with mistakes like
10504 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
10505 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
10506 b4_rhs_location): Likewise.
10507 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
10508 b4_rhs_location): Likewise.
10509
fd19f271
AD
105102004-12-16 Akim Demaille <akim@epita.fr>
10511
10512 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
10513 yacc.c: be sure to stay within yycheck_.
10514 * tests/actions.at: Re-enable C++ tests.
10515
10454ea4
AD
105162004-12-16 Akim Demaille <akim@epita.fr>
10517
10518 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
10519 real.
10520
c5b95ccf
AD
105212004-12-16 Akim Demaille <akim@epita.fr>
10522
10523 Use #define to handle the %name-prefix.
10524
10525 * data/glr.c, data/yacc.c: Comment changes.
10526 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
10527 so that one can refer to yylex in the parser file, and have it
10528 renamed, as is the case with other skeletons.
10529
617a8f12
AD
105302004-12-16 Akim Demaille <akim@epita.fr>
10531
10532 Move lalr1.cc internals into yy*.
10533
10534 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
10535 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
10536 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
10537 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
10538 (empty_, final_, terror_, errcode_, ntokens_)
10539 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
10540 (looka_, ilooka_, error_range_, nerrs_):
10541 Rename as...
10542 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
10543 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
10544 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
10545 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
10546 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
10547 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
10548 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
10549 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
10550 these.
10551
1e547e6e
PE
105522004-12-15 Paul Eggert <eggert@cs.ucla.edu>
10553
10554 Fix some problems reported by twlevo at xs4all.
10555 * src/symtab.c (symbol_new): Report an error if the input grammar
10556 contains too many symbols. This is better than calling abort() later.
10557 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
10558 (struct node, struct graph):
10559 Rename member expand to stretch. All uses changed.
10560 (struct graph): Remove member layoutalgorithm. All uses removed.
10561 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
10562 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
10563 All uses changed.
10564 (N_STRETCH): Rename from N_EXPAND. All uses changed.
10565
735d6bd4
AD
105662004-12-15 Akim Demaille <akim@epita.fr>
10567
10568 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
10569 Add more Doxygen comments.
10570 (symprint_, stack_print_, reduce_print_, destruct_, pop)
10571 (report_syntax_error_, translate_): Rename as...
10572 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
10573 (yypop_, yyreport_syntax_error_, yytranslate_): this.
10574
2e1f5829
AD
105752004-12-15 Akim Demaille <akim@epita.fr>
10576
10577 * data/lalr1.cc (lex_): Rename as...
10578 (yylex_): this.
10579 Move the trace here.
10580 Take the %name-prefix into account.
10581 Reported by Alexandre Duret-Lutz.
10582
a3cb6248
AD
105832004-12-15 Akim Demaille <akim@epita.fr>
10584
10585 Simplify the C++ parser constructor.
10586
10587 * data/lalr1.cc (debug_): Rename as...
10588 (yydebug_): so that the parser's internals are always in the yy*
10589 pseudo namespace.
10590 Adjust uses.
10591 (b4_parse_param_decl): Remove the leading comma as it is now only
10592 called as unique argument list.
10593 (Parser::Parser): Remove the constructor accepting a location and
10594 an initial debugging level.
10595 Remove from the other ctor the argument for the debugging level.
10596 (debug_level_type, debug_level, set_debug_level): New.
10597
10598 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
10599 constructor calls.
10600
07fed891
AD
106012004-12-15 Akim Demaille <akim@epita.fr>
10602
10603 Remove b4_root related material: failure experiment
a3cb6248 10604 (which goal was to allow to derive from a class).
07fed891
AD
10605
10606 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
10607 definitions and uses.
10608
e603eaa5
PE
106092004-12-14 Paul Eggert <eggert@cs.ucla.edu>
10610
10611 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
10612 not 2, since it's not portable to subtract 1 from the start of an
10613 array. The new item 0 is never set or used. All uses changed.
10614
10615 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
10616 the default definition of YYLLOC_DEFAULT. Problem reported
10617 by Frank Heckenbach.
10618
fafb007d
PE
106192004-12-12 Paul Eggert <eggert@cs.ucla.edu>
10620
10621 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
10622 the normal case and one for the error case. Just use the
10623 first one uniformly. Problem reported by Frank Heckenbach.
10624 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
10625 use exactly the same macro in both places.
10626 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
10627 so that the normal-case YYRHSLOC works for the error case too.
10628 All uses changed.
10629 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
10630 (YYLLOC_DEFAULT): Use the same macro as glr.c.
10631 * doc/bison.texinfo (Location Default Action): Don't claim that
10632 we have an array of locations. Use the same macro for both glr
10633 and lalr parsers. Mention YYRHSLOC. Mention what happens when
10634 the index is 0.
10635
48814dcd
PE
106362004-12-10 Paul Eggert <eggert@cs.ucla.edu>
10637
a4e1a53b
PE
10638 * HACKING: Update email addresses to send announcements to.
10639
48814dcd
PE
10640 * configure.ac (AC_INIT): Bump version to 1.875f.
10641
337116ba
PE
106422004-12-10 Paul Eggert <eggert@cs.ucla.edu>
10643
10644 * NEWS: Version 1.875e.
10645 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
10646
10647 * src/scan-skel.l: Include "complain.h", for "fatal".
10648
10649 * src/relation.h (relation_print, relation_digraph):
10650 Relation sizes are of type relation_node, not size_t (this is
10651 merely a doc fix, since the two types are equivalent).
10652 (relation_transpose): Relation sizes are of type relation_node,
10653 not int.
10654 * src/relation.c: Likewise.
10655 (top, infinity): Now of type relation_node, not int.
10656 (traverse, relation_transpose): Use relation_node, not int.
10657
10658 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
10659 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
10660 (yyparse): Remove unused local introduced in 2004-10-25 patch.
10661
10662 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
68b082af 10663 specifying whether the test should be skipped. Use it tp
337116ba 10664 specify that the [%defines %skeleton "lalr1.cc"] tests currently
68b082af 10665 fail on some hosts, and should be skipped.
337116ba 10666
da2a7671
PE
106672004-12-08 Paul Eggert <eggert@cs.ucla.edu>
10668
10669 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
10670 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
10671 unless otherwise specified below.
10672
10673 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
10674 to allocate kernel_base, kernel_items, kernel_size, since
10675 they needn't be initialized to 0.
10676 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
10677 * src/closure.c (new_closure): Likewise, for itemset.
10678 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
10679 * src/lalr.c (set_goto_map): Likewise, for temp_map.
10680 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
10681 (build_relations): Likewise for edge, states1, includes.
10682 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
10683 * src/reader.c (packgram): Likewise, for ritem, rules.
10684 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
10685 * src/relation.c (relation_digraph): Likewise for VERTICES.
10686 (relation_transpose): Likewise for new_R, end_R.
10687 * src/symtab.c (symbols_token_translations_init): Likewise for
10688 token_translations.
10689 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
10690 (token_actions): Likewise for yydefact, actrow, conflrow,
10691 conflict_list.
10692 (save_column): Likewise for froms[symno], tos[symno].
10693 (goto_actions): Likewise for state_count.
10694 (pack_table): Likewise for base, pos, check.
10695 (tables_generate): Likewise for width.
10696
10697 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
10698 for initial core. Just have a separate core, so we needn't worry
10699 about whether kernel_size and kernel_base are initialized.
10700
10701 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
10702 kernel_size, kernel_items): Remove unnecessary initialization.
10703 * src/conflicts.c (conflicts): Likewise.
10704 * src/derives.c (derives): Likewise.
10705 * src/muscle_tablc (muscle_insert): Likewise.
10706 * src/relation.c (relation_digraph): Likewise.
10707 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
10708 conflrow, conflict_table, conflict_list, table, check):
10709 Likewise.
10710
10711 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
10712 This is because all callers pass unsigned int.
10713 * src/closure.h (new_closure): Likewise.
10714
10715 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
10716 (build_relations): Initialize includes[i] in all cases.
10717 * src/reader.c (packgram): Always initialize rules[ruleno].prec
10718 and rules[ruleno].precsym. Initialize members in order.
10719 * src/relation.c (relation_transpose): Always initialize new_R[i]
10720 and end_R[i].
10721 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
10722
10723 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
10724 conflict_list[0] was always 0, but now it isn't initialized.
10725
10726 * src/table.c (table_grow): When conflict_table grew, the grown
10727 area wasn't cleared. Fix this.
10728
10729 * lib/.cvsignore: Add strdup.c, strdup.h.
10730 * m4/.cvsignore: Add strdup.m4.
10731
00baeeac
PE
107322004-12-07 Paul Eggert <eggert@cs.ucla.edu>
10733
10734 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
10735 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
10736 GOTO_NUMBER_MAXIMUM, since we occasionally compute
10737 ngotos + 1 without checking for overflow.
10738 (build_relations): Use END_NODE, not -1, to denote end of edges.
10739 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
10740 build_relations): Use goto_number, not int, for goto numbers.
10741 * src/tables.c (save_column, default_goto): Likewise.
10742
be3d9d42
AD
107432004-11-23 Akim Demaille <akim@epita.fr>
10744
10745 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
10746 of #defining from yystype.
10747 Don't typedef yystype, C++ does not need it.
10748 This lets it possible to forward declare it as union.
10749
78e526d5
PE
107502004-11-23 Paul Eggert <eggert@cs.ucla.edu>
10751
10752 * bootstrap (gnulib_modules): Add extensions.
10753 Problem reported by Jim Meyering.
10754
afbb696d
PE
107552004-11-22 Paul Eggert <eggert@cs.ucla.edu>
10756
10757 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
10758 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
10759 src/system.h, src/tables.c: XFREE -> free, to accommodate
10760 recent change to gnulib xalloc.h.
78e526d5 10761 Problem reported by Jim Meyering.
afbb696d 10762
c1f8f16a
AD
107632004-11-17 Akim Demaille <akim@epita.fr>
10764
10765 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
10766
db7e5eb5 107672004-11-17 Akim Demaille <akim@epita.fr>,
9a1e9989
AD
10768 Alexandre Duret-Lutz <adl@gnu.org>
10769
10770 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
10771 changes.
10772 (YYCDEBUG): Adjust.
10773 Use it instead of cdebug_.
10774 (Parser::debug_stream, Parser::set_debug_stream): New.
10775 (Parser::symprint_): Define cdebug_ for temporary backward
10776 compatibility.
10777 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
10778 debug_stream ().
10779
68e11668
AD
107802004-11-17 Akim Demaille <akim@epita.fr>
10781
10782 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
10783 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
10784 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
10785 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
10786
97cbc73e
PE
107872004-10-27 Paul Eggert <eggert@cs.ucla.edu>
10788
10789 * data/glr.c (yyloc_default): Remove; not used.
10790 Problem reported by Frank Heckenbach.
10791
e342c3be
AD
107922004-10-25 Akim Demaille <akim@epita.fr>
10793
10794 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
10795 Introduce another definition to address simple location arrays.
10796 (yyGLRStack): New member: yyerror_range.
10797 (yyrecoverSyntaxError, yyparse): Update it.
10798 (yyrecoverSyntaxError): Use it when shifting the error token to
10799 have an accurate range, equivalent to the one computed by both
10800 yacc.c and lalr1.cc.
10801 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
10802 that column numbers start at column 0, as per GNU Coding
10803 Standards, the others tests, and the doc.
10804 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
10805 Adjust to the above change (first column is 0).
10806 And adjust the location of the "<error>", now covering the whole
10807 line.
10808
93602feb 108092004-10-22 Akim Demaille <akim@epita.fr>
04098407 10810 and Paul Eggert <eggert@cs.ucla.edu>
93602feb
PE
10811
10812 Remove some arbitrary limits on goto numbers and relations.
10813 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
10814 initial values, since they're never used.
10815 (set_goto_map): ngotos is now unsigned, so test for overflow
10816 by seeing whether it wraps around to zero.
10817 * src/lalr.h (goto_number): Now size_t, not short int.
10818 (GOTO_NUMBER_MAXIMUM): Remove.
10819 * src/relation.c (relation_print, traverse, relation_transpose):
10820 Check for END_NODE rather than looking at sign.
10821 * src/relation.h (END_NODE): New macro.
10822 (relation_node): Now size_t, not short int.
10823
dba08b04
PE
108242004-10-22 Paul Eggert <eggert@cs.ucla.edu>
10825
10826 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
10827 keyword, not an identifier. Problem reported by Baron Schwartz in
10828 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
10829
df09ef2e
AD
108302004-10-11 Akim Demaille <akim@epita.fr>
10831
10832 * src/symtab.c (symbol_check_alias_consistency): Also check
10833 type names, destructors, and printers.
10834 Reported by Alexandre Duret-Lutz.
10835 Recode the handling of associativity and precedence in terms
10836 of symbol_precedence_set.
10837 Accept no redeclaration at all, not even equal to the previous
10838 value.
10839 (redeclaration): New.
10840 Use it to factor redeclaration complaints.
10841 (symbol_make_alias): Don't set the type of the alias, let
10842 symbol_check_alias_consistency do it as for other features.
10843 * src/symtab.h (symbol): Add new member prec_location, and
10844 type_location.
10845 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
10846 * tests/input.at (Incompatible Aliases): New.
10847
146bc99d
PE
108482004-10-09 Paul Eggert <eggert@cs.ucla.edu>
10849
10850 .cvsignore fixes to accommodate gnulib changes,
10851 and the practice of naming build directories "_build".
10852 * .cvsignore: Add "_*". Sort.
10853 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
10854 * m4/.cvsignore: Add "*_gl.m4".
10855
e503aa60
AD
108562004-10-06 Akim Demaille <akim@epita.fr>
10857
10858 * src/parse-gram.y (add_param): Fix the truncation of trailing
10859 spaces.
10860
b4a20338
AD
108612004-10-05 Akim Demaille <akim@epita.fr>
10862
10863 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
10864 whether the reducion was empty or not. This leaves room to
10865 improve the use of YYLLOC_DEFAULT in such a case.
10866 lalr1.cc is still experimental, so changing this is acceptable.
10867 And finally, there are probably not many users who changed the
10868 handling of locations in GLR, so changing is admissible too.
10869
10870 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
10871 empty reduction, set @$ to an empty location ending the previously
10872 stacked symbol.
10873 Adjust uses to make sure the code is triggered on empty
10874 reductions.
10875 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
10876 expected output: empty reductions have empty locations.
10877
f85a5e6f
AD
108782004-09-29 Akim Demaille <akim@epita.fr>
10879
10880 * data/lalr1.cc: Move towards a more standard C++ coding style
10881 for templates: Class < T > -> Class<T>.
10882
b203fc2c
AD
108832004-09-29 Akim Demaille <akim@epita.fr>
10884
10885 * data/lalr1.cc: Reinstall the former ctor, for sake of
10886 compatibility, but warn it will be removed.
10887 Move towards a more standard C++ coding style (i.e., type *var ->
10888 type* var).
10889
5b7e1e73
PE
108902004-09-27 Paul Eggert <eggert@cs.ucla.edu>
10891
3fee967f
PE
10892 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
10893 since it's less likely to work if NULs are involved in the future.
5b7e1e73 10894
0dcca5c2
AD
108952004-09-27 Akim Demaille <akim@epita.fr>
10896
10897 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
10898
6dde1c82
AD
108992004-09-27 Akim Demaille <akim@epita.fr>
10900
10901 * data/lalr1.cc (b4_parse_param_decl_1): New.
b203fc2c 10902 (b4_parse_param_decl): Use it to have different names between attribute
6dde1c82
AD
10903 and argument names.
10904 (b4_cc_constructor_call): Likewise.
10905
b233d555
AD
109062004-09-24 Akim Demaille <akim@epita.fr>
10907
10908 * src/parse-gram.y (add_param): Strip the leading and trailing
10909 blanks from a formal argument declaration.
10910 (YY_LOCATION_PRINT): New.
10911
619404e3
AD
109122004-09-24 Akim Demaille <akim@epita.fr>
10913
10914 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
10915 after the location.
10916
dd8d9022
AD
109172004-09-24 Akim Demaille <akim@epita.fr>
10918
10919 * doc/bison.texinfo (Table of Symbols): Sort.
10920
0092f063
AD
109212004-09-21 Akim Demaille <akim@epita.fr>
10922
10923 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
10924 the useless parentheses.
10925 Suggested by Paul Eggert.
10926
451364ed
AD
109272004-09-20 Akim Demaille <akim@epita.fr>
10928
10929 Let the initial-action act on the look-ahead, and use it for the
10930 "initial push" (corresponding to an hypothetical beginning-of-file).
10931 And let lalr1.cc honor %initial-action.
10932
10933 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
10934 example.
10935 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
10936 (Parser::Parser): Remove the ctor that used to initialize it.
10937 (Parser::parse): Like in the other skeletons, issue the "starting
10938 parse" message before any action.
10939 Honor %initial-action.
10940 Initialize the stacks with the lookahead.
10941 * data/yacc.c: Let $$ and @$ in %initial-action designate the
10942 look-ahead.
10943 Push them in the stacks.
10944 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
10945
18d192f0
AD
109462004-09-20 Akim Demaille <akim@epita.fr>
10947
10948 * doc/bison.texinfo (Initial Action Decl): New.
10949
b8458aa5
AD
109502004-09-20 Akim Demaille <akim@epita.fr>
10951
10952 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
10953 clearer criterion to define it.
10954 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
10955 When reducing on an empty RHS, use the latest stacked location as
10956 location.
10957 yylloc is not always available.
10958 * data/glr.c: Likewise.
10959 Also, honor initial-actions.
10960
3fc16193
AD
109612004-09-20 Akim Demaille <akim@epita.fr>
10962
10963 * data/yacc.c (YY_LOCATION_PRINT): New.
10964 Define when we know YYLTYPE's structure, i.e., when the default
10965 YYLLOC_DEFAULT is used.
10966 * data/c.m4 (b4_yysymprint_generate): Use it.
10967 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
10968 value of the result.
10969 (error_start_): Replace with...
10970 (error_range_): this location array.
10971 This allows to replace code relying on the implementation of
10972 locations by portable code.
10973 * data/yacc.c (yylerrsp): Replace with...
10974 (yyerror_range): this.
10975 Every time a token is popped, update yyerror_range[0], to have an
10976 accurate location for the error token.
10977 * data/glr.c (YY_LOCATION_PRINT): New.
10978 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
10979 deference a pointer.
10980 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
10981 report the location in %printers.
10982
10983 * src/scan-skel.l: Instead of abort, report error messages to ease
10984 understanding skeleton scanning failures.
10985
ecfe33e7
AD
109862004-09-16 Akim Demaille <akim@epita.fr>
10987
10988 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
10989 (iterator, const_iterator): these, to be more in the C++ spirit.
10990 Also, return reverse iterators so that when displaying the stack
10991 we display its bottom first.
10992 (Parser::stack_print_, Parser::reduce_print_): Match the messages
10993 from yacc.c.
10994 We should probably use vector here though.
10995
1576d44d
AD
109962004-09-16 Akim Demaille <akim@epita.fr>
10997
10998 Have more complete shift traces.
10999
11000 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
11001 to report Shifts instead of ad hoc YYDPRINTF invocations,
11002 including for the error token.
11003 * data/lalr1.cc (symprint_): Output the location.
11004 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
11005 output the location within the %printer.
11006 Activate GLR tests, at least to make sure they compile properly.
11007 They still don't pass though.
11008 * tests/calc.at: Adjust expect verbose output, since now "Entering
11009 state..." is on a different line than the "Shifting" message.
11010
9c66f418
AD
110112004-09-08 Akim Demaille <akim@epita.fr>
11012
11013 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
11014 Bison directive from the Bison file to the invocation of this
11015 macro, so that these directives are passed to
11016 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
11017 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
11018 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
11019 the extra Bison directives instead of the whole series.
11020 Change the grammar so that there are recoverable errors, and
11021 unrecoverable errors. Now we can have the parser give up before
11022 consuming the whole input. As a result we now can observe that
11023 the lookahead is freed when needed.
11024 Change the parser source to parse argv[1] instead of a hard coded
11025 string.
11026 Simplify yylex, and give a value and location to EOF.
11027 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
11028 passed directives already coded in the file.
11029 Add some tests to check the location of "error".
11030 For some tests, the C++ parser is correct, and not yacc.c.
11031 For other tests, they provide different, but unsatisfying, values,
11032 so keep the C++ value so that at least one parser is "correct"
11033 according to the test suite.
11034 (Actions after errors): Remove, this is subsumed by the
11035 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
11036
52d5733f
AD
110372004-09-06 Akim Demaille <akim@epita.fr>
11038
11039 * data/lalr1.cc: Adjust the indentation of the labels.
04098407 11040 (Parser::pop): New.
52d5733f
AD
11041 Use it.
11042
a0e68930
AD
110432004-09-06 Akim Demaille <akim@epita.fr>
11044
11045 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
11046 argument, an informative message.
11047 Call YY_SYMBOL_PRINT.
11048 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
11049 * data/lalr1.cc (destruct_): Likewise.
11050 In addition, no longer depend on b4_yysymprint_generate and
11051 b4_yydestruct_generate to generate these functions, do it "by
11052 hand".
11053
e757bb10
AD
110542004-09-03 Akim Demaille <akim@epita.fr>
11055
11056 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
11057 invoked, yydestruct the lookahead.
11058 * tests/calc.at (Calculator $1): Update the expected lengths of
11059 traces: there is an added line for the discarded lookahead.
11060 * doc/bison.texinfo (Destructor Decl): Some rewording.
11061 Define "discarded" symbols.
11062
0fe1f06d
AD
110632004-09-02 Akim Demaille <akim@epita.fr>
11064
11065 * data/lalr1.cc (translate_, destruct_): No reason to be static.
11066
284acc8b
AD
110672004-09-02 Akim Demaille <akim@epita.fr>
11068
11069 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
11070 (YYDSYMPRINTF): Rename as...
11071 (YY_SYMBOL_PRINT): this.
11072 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
11073 two.
11074 Use it instead of direct symprint_ calls.
11075 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
11076 one.
11077
a5eb1ed2
AD
110782004-09-02 Akim Demaille <akim@epita.fr>
11079
b7c72fe1
AD
11080 * data/lalr1.cc (b4_yysymprint_generate): New.
11081 (symprint_): New member function, defined when YYDEBUG.
11082 Use it consistently instead of token/nterm debugging output by
11083 hand.
a5eb1ed2
AD
11084 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
11085 %printer calls to use cdebug_ when using lalr1.cc.
11086
417141dd
AD
110872004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
11088
11089 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
11090 with #ifdef YYDEBUG.
11091
2fa09258
AD
110922004-08-26 Akim Demaille <akim@epita.fr>
11093
11094 * doc/bison.texinfo (Implementing Loops): Rename as...
11095 (Implementing Gotos/Loops): this.
11096
9378b508
PE
110972004-08-13 Paul Eggert <eggert@cs.ucla.edu>
11098
11099 Adjust to latest gnulib.
11100 * bootstrap (gnulib_modules): Add xalloc-die.
11101 Set LC_ALL=C so that file names sort consistently.
11102 Prefer the gnulib copies of gettext.m4, glibc21.m4,
11103 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
11104 uintmax_t.m4, ulonglong.m4.
11105 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
11106 po.m4 since we are now using _gl.m4 instead.
11107
87a8ad5c
PE
111082004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
11109
11110 * src/scan-action.l: Remove. Scanning of semantic actions is
11111 handled in scan-gram.l.
11112
dca81a78
PE
111132004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
11114
11115 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
11116
11117 * src/location.h (struct): The file member is a uniqstr.
11118 (equal_boundaries): Use UNIQSTR_EQ for comparison.
11119
c9cbf7c5
PE
111202004-07-22 Paul Eggert <eggert@cs.ucla.edu>
11121
11122 Fix bug with non-%union parsers that have printers or destructors,
11123 which led to a Bison core dump. Reported by Peter Fales in
11124 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
2fa09258 11125
c9cbf7c5
PE
11126 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
11127 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
11128 not to our own type.
11129 * src/output.c (symbol_destructors_output, symbol_printers_output):
11130 Don't assume %union.
11131 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
11132 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
11133 UNION-FLAG. All callers changed.
11134 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
11135 Use type char, not unsigned int, when declaring an array of char;
11136 this lets us remove a cast.
11137 (Printers and Destructors): Add non-%union test cases.
11138
fa7e68c3
PE
111392004-06-21 Paul Eggert <eggert@cs.ucla.edu>
11140
11141 * doc/bison.texinfo: Minor editorial changes, mostly to the new
11142 GLR writeups. E.g., avoid frenchspacing and the future tense,
11143 change "lookahead" to "look-ahead", and change "wrt" to "with
11144 respect to".
2fa09258 11145
fa7e68c3
PE
111462004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
11147
11148 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
11149 New sections, split off from the GLR Parsers section. Put the new
11150 Simple GLR Parser near the start of the GLR section, for clarity.
11151 Rewrite connective text.
11152
99a9344e
PE
111532004-06-21 Frank Heckenbach <frank@g-n-u.de>
11154
11155 * doc/bison.texinfo (Simple GLR Parsers): New section.
11156
8dd162d3
PE
111572004-06-21 Paul Eggert <eggert@cs.ucla.edu>
11158
11159 * NEWS, TODO, doc/bison.texinfo:
11160 Use "look-ahead" instead of "lookahead", to be consistent.
11161 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
11162 while we're fixing "look-ahead".
11163 * src/conflicts.c (shift_set): Renamed from shiftset.
11164 (look_ahead_set): Renamed from lookaheadset.
11165 * src/print.c: Likewise.
11166 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
11167 name for "lookahead".
11168 (report_types, usage): Likewise.
11169 * src/getargs.h (report_look_ahead_tokens): Renamed from
11170 report_lookaheads.
11171 * src/lalr.c (compute_look_ahead_tokens): Renamed from
11172 compute_lookaheads.
11173 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
11174 (look_ahead_tokens_print): Renamed from lookaheads_print.
11175 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
11176 state_rule_lookaheads_print.
11177 * src/state.h: Likewise.
11178 (reductions.look_ahead_tokens): Renamed from lookaheads.
11179 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
11180 AT_DATA_LOOKAHEADS_GRAMMAR.
11181
57a90331
PE
111822004-06-03 Paul Eggert <eggert@cs.ucla.edu>
11183
11184 * README: Update location of patched M4 distribution.
11185
8ed3234a
PE
111862004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
11187
11188 Don't assume the C++ compiler takes the same arguments as the C compiler
11189 (trivial change).
11190 * configure.ac (O0CXXFLAGS): New var.
11191 * tests/atlocal.in (CXXFLAGS): Use it.
11192
07971983
PE
111932004-05-29 Paul Eggert <eggert@cs.ucla.edu>
11194
11195 Fix some "make check" problems with C++ reported by
11196 Albert Chin-A-Young for Tru64 C++ in this thread:
11197 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
11198
11199 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
11200 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
11201 Output to a .cc file for C++, not to a .c file.
11202 * tests/calc.at (AT_CHECK_CALC): Likewise.
11203 * tests/regression.at (AT_CHECK_DANCER): Likewise.
11204 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
11205
29058652
PE
112062004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
11207
11208 * tests/calc.at, tests/actions.at: Workaround for SGI
11209 C++ compiler. (trivial change)
11210
62cb8a99
PE
112112004-05-27 Paul Eggert <eggert@cs.ucla.edu>
11212
fd418816
PE
11213 Spent a few hours checking out which prerequisite versions the
11214 current sources actually require. I went all the way back to
11215 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
11216 a seemingly endless set of combinations of versions more recent
11217 than that. The bottom line is that the current sources require
11218 fairly recent versions of the build tools, and it'll be some work
11219 to change this.
11220 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
11221 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
11222 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
11223 Add comments explaining why those particular versions are
11224 currently needed.
2fa09258 11225
62cb8a99
PE
11226 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
11227 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
161a71f3 11228 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
62cb8a99
PE
11229
11230 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
11231 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
11232
caa52c10
PE
112332004-05-26 Paul Eggert <eggert@cs.ucla.edu>
11234
11235 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
11236 0.11.5. Suggested by Bruno Haible.
11237 * bootstrap: Remove gettext version checking.
11238
11239 * doc/bison.texinfo (Decl Summary): Also mention that %union
11240 can depend on prerequisite types. Problem reported by Tim
11241 Van Holder.
11242
4bfd5e4e
PE
112432004-05-25 Paul Eggert <eggert@cs.ucla.edu>
11244
2cef3017
PE
11245 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
11246 * README-alpha: Don't tell people not to package this.
11247
b9c85d5c
PE
11248 * bootstrap: Don't assume $(...) works; use `...` instead.
11249 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
11250 gettext better.
11251
4bfd5e4e
PE
11252 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
11253 put into the -d output file, and mention what to do if YYSTYPE is
11254 defined as a macro.
11255
6a36ff94
PE
112562004-05-24 Paul Eggert <eggert@cs.ucla.edu>
11257
6712933e
PE
11258 Undo change made earlier today: it caused autopoint to not bring
11259 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
11260 autopoint's.
11261
11262 * bootstrap: Check that gettext version matches what's in
11263 configure.ac. Warn users to ignore robots.txt ERROR 404.
11264 * bootstrap: Undo today's earlier change (logged below).
11265 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
b9c85d5c 11266
6a36ff94
PE
11267 The gettext version checking is causing more trouble than it's
11268 curing; remove it. Problem reported by Paul Hilfinger.
11269
11270 * bootstrap: Issue a warning that one can expect a message
11271 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
11272 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
11273
209ea708
PE
112742004-05-23 Paul Eggert <eggert@cs.ucla.edu>
11275
11276 Ensure that the C++ compiler used for testing actually works on a
11277 simple test program; if not, skip the C++-related tests. Problem
11278 reported by Vin Shelton in:
161a71f3 11279 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
209ea708
PE
11280
11281 * m4/cxx.m4: New file.
11282 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
11283 * tests/atlocal.in (BISON_CXX_WORKS): Add.
11284 * tests/local.at (AT_COMPILE_CXX): Use it.
11285
41ca2549
PE
112862004-05-21 Paul Eggert <eggert@cs.ucla.edu>
11287
383e69dc
PE
11288 * data/glr.c (yylloc): Output this macro even if locations are not
11289 being generated, as the GLR parser needs it even in that case.
11290 Problem reported by Troy A. Johnson
11291 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
11292
41ca2549
PE
11293 * configure.ac (AC_INIT): Update to 1.875e.
11294
e476c87d
PE
112952004-05-21 Paul Eggert <eggert@cs.ucla.edu>
11296
11297 * NEWS: Version 1.875d.
11298 * configure.ac (AC_INIT): Likewise.
11299 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
11300
11301 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
11302 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
11303 lalr1.cc runs afoul of the first, and the last two are no longer
11304 supported by GCC 3.4.0.
11305 * README: Mention GNU m4 1.4 or later; mention m4 patches.
11306 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
11307
233a88ad
PE
113082004-05-06 Paul Eggert <eggert@cs.ucla.edu>
11309
11310 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
11311 unsigned int, for compatibility with latest gnulib hash module.
11312 * src/state.c (state_hash, state_hasher): Likewise.
11313 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
11314 * src/uniqstr.c (hash_uniqstr): Likewise.
e476c87d 11315
12ffdd28
PE
113162004-05-03 Paul Eggert <eggert@cs.ucla.edu>
11317
11318 * NEWS: Unescaped newlines are no longer allowed in char & strings.
11319
11320 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
11321 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
11322 character and string literals.
11323 (unexpected_end): New function.
11324 (unexpected_eof): Use it.
11325 (unexpected_newline): New function.
11326 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
11327 actions.
e476c87d 11328
12ffdd28
PE
11329 * NEWS: Document %expect-rr.
11330
11331 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
11332 Fix typo by replacing $1 with $option.
11333 Remove more 'intl'-related files.
9668e2be 11334 Don't DEFUN AM_INTL_SUBDIR twice.
12ffdd28
PE
11335
11336 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
11337 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
11338 strtoul.c.
11339 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
11340 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
11341 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
11342 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
11343 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
11344 * src/.cvsignore: Add *.output.
11345
11346 * src/parse-gram.y: Put copyright notice inside %{ %} so it
11347 gets copied to the output file.
e476c87d 11348
1f65350a
PE
113492004-04-28 Paul Eggert <eggert@twinsun.com>
11350
11351 Get files from the gnulib and po repositories, instead of relying
11352 on them being in our CVS. Upgrade to latest versions of gnulib
11353 and Automake.
11354
11355 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
11356 * bootstrap: Bootstrap from gnulib and po repositories.
11357 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
11358 * README-cvs: Document these changes. Remove version numbers from
11359 mentions of build tools, since they change so often. Mention Flex.
11360
11361 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
11362 (gl_USE_SYSTEM_EXTENSIONS): Add.
12ffdd28
PE
11363 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
11364 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
1f65350a 11365 does this for us.
12ffdd28
PE
11366 (AC_ISC_POSIX): Remove; we no longer support this
11367 ancient OS, as it gets in the way of latest Autoconf & gnulib.
1f65350a
PE
11368 (AC_HEADER_STDC): Remove: we now assume C89 or better.
11369 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
11370 Do not check for C89 headers, except for locale.h which is used
11371 by the Yacc library and must port to K&R hosts.
11372 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
11373 Do not check for C89 functions, except for setlocale which is
11374 used by the Yacc library.
11375 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
11376 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
11377 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
11378 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
11379 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
11380 AM_GNU_GETTEXT): Remove; now done by:
11381 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
11382 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
11383 for us.
11384
11385 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
11386 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
11387 Define to empty, as gnulib.mk will do the rest for us.
11388 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
11389 for us.
11390 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
11391 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
11392
11393 * src/files.c: Include gnulib's xstrndup.h.
11394
11395 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
11396 (REALLOC): Use xnrealloc, for likewise.
11397 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
11398 (strnlen, memrchr): Remove decls; functions no longer used.
11399 Include <stpcpy.h>.
11400
11401 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
11402 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
11403 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
11404 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
11405 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
11406 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
11407 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
11408 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
11409 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
11410 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
11411 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
11412 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
11413 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
11414 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
11415 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
11416 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
11417 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
11418 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
11419 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
11420 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
11421 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
11422 Remove, as these files are now generated automatically
11423 by bootstrap or automake.
11424
11425 * po/ChangeLog: Remove: all but one entry was a duplicate
11426 of this file, and I moved that 2000-11-02 entry here.
11427
11428 * config/.cvsignore: Add Makefile, depcomp, install-sh.
11429 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
11430 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
11431 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
11432 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
11433 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
11434 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
11435 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
11436 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
11437 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
11438 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
11439 xstrndup.h.
11440 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
11441 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
11442 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
11443 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
11444 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
11445 * src/.cvsignore: Remove *_.c.
11446
11447
11448 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
11449 support it. (The latest stable gzip doesn't.)
11450
114512004-04-27 Paul Eggert <eggert@twinsun.com>
11452
11453 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
11454 case, as stos_ is now used by destructors due to the 2004-02-09
11455 change.
11456
11457 Remove more K&R C support.
11458 * lib/libiberty.y (PARAMS): Remove. All uses removed.
11459 * lib/subpipe.c (errno): Remove decl.
11460 Include <stdlib.h> unconditionally.
11461 (EXIT_FAILURE): Remove macro.
11462 * src/complain.c (vfprintf, strerror): Remove.
11463 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
11464 unconditionally.
11465 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
11466 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
11467 (strchr, strspn, memchr): Remove decls.
11468 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
11469 unconditionally. Do not declare perror.
11470 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
11471 unconditionally.
11472
11473 * src/complain.c (_): Remove useless defn, as system.h defines this.
11474
11475 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
11476 with latest obstack.h.
11477 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
11478 to procedure types, as obstack.h now does that for us.
11479 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
11480
11481 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
11482 so that this include file can stand alone.
11483 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
11484 does this now. Include subpipe.h first after config.h, to
11485 test whether it can stand alone.
11486
11487 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
11488 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
11489 unused declaration.
11490
11491 * tests/synclines.at (%union synch line): Put a dummy member in
11492 the union, because empty unions aren't allowed in C. Caught
11493 by GCC 3.4.0.
11494
4f16766c
PE
114952004-04-13 Jim Meyering <jim@meyering.net>
11496
11497 * src/conflicts.c (conflicts_print): Correct format string typo:
11498 use `%%' to produce literal `%'. (trivial change)
11499
779e7ceb
PE
115002004-03-30 Paul Eggert <eggert@twinsun.com>
11501
11502 * src/getargs.c (version): Update copyright year to 2004.
11503
11504 * data/c.m4 (b4_int_type): Use 'short int' rather than
11505 'short', and similarly for 'long', 'unsigned', etc.
11506 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
11507 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
11508 yy_yypstack, yydumpstack): Likewise.
11509 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
11510 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
11511 Likewise.
11512 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
11513 yy_stack_print, yyparse): Likewise.
11514 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
11515 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
11516 * lib/bitset.c (bitset_print): Likewise.
11517 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
11518 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
11519 * lib/bitsetv.c (bitsetv_dump): Likewise.
11520 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
11521 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
11522 Likewise.
11523 * src/LR0.c (allocate_itemsets): Likewise.
11524 * src/gram.h (rule_number, rule): Likewise.
11525 * src/lalr.h (goto_number): Likewise.
11526 * src/nullable.c (nullable_compute): Likewise.
11527 * src/output.c (prepare_rules): Likewise.
11528 * src/relation.c (relation_print, relation_digraph): Likewise.
11529 * src/relation.h (relation_node): Likewise.
11530 * src/state.h (state_number, transitions, errs, reductions,
11531 struct state): Likewise.
11532 * src/symtab.h (symbol_number, struct symbol): Likewise.
11533 * src/tables.c (vector_number, tally, action_number,
11534 default_goto, goto_actions): Likewise.
11535 * tests/existing.at (GNU Cim Grammar): Likewise.
11536 * tests/regression.at (Web2c Actions): Likewise.
11537
11538 * src/output.c (muscle_insert_short_int_table): Renamed from
11539 muscle_insert_short_table. All uses changed.
11540
d6328241
PH
115412004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
11542
11543 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
11544 (declaration): Replace expected_conflicts with expected_sr_conflicts.
11545 Add %expect-rr rule.
4f16766c 11546
d6328241
PH
11547 * src/scan-gram.l: Recognize %expect-rr.
11548
4f16766c 11549 * src/conflicts.h (expected_sr_conflicts): Rename from
d6328241 11550 expected_conflicts.
4f16766c 11551 (expected_rr_conflicts): Declare.
d6328241
PH
11552
11553 * src/conflicts.c (expected_sr_conflicts): Rename from
11554 expected_conflicts.
11555 (expected_rr_conflicts): Define.
11556 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
11557 for GLR parsers.
11558 Use expected_sr_conflicts in place of expected_conflicts.
11559 Warn if expected_rr_conflicts used in non-GLR parser.
4f16766c 11560
d6328241 11561 * doc/bison.texinfo: Add documentation for %expect-rr.
4f16766c 11562
1452af69
PE
115632004-03-08 Paul Eggert <eggert@gnu.org>
11564
11565 Add support for hex token numbers. Suggested by Odd Arild Olsen in
161a71f3 11566 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
1452af69
PE
11567
11568 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
11569 in lalr1.cc.
11570 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
11571 * src/scan-gram.l (scan_integer): New function.
11572 ({int}): Use it.
11573 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
11574 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
11575 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
11576 Say "long int", not "long", for uniformity with GNU style.
11577
006d217d
PE
115782004-02-25 Paul Eggert <eggert@twinsun.com>
11579
11580 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
11581 compilers. This fixes a problem with Intel's C++ compiler being
11582 chatty, reported by Guido Trentalancia in
161a71f3 11583 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
006d217d 11584
c2729758
ADL
115852004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
11586
11587 Support %destructor and merge error locations in lalr1.cc.
11588
11589 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
11590 (Parser::stos_): Define unconditionally.
11591 (Parser::destruct_): New method. Generate its body with
11592 b4_yydestruct_generate.
11593 (Parser::error_start_): New attribute.
11594 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
11595 token which are discarded.
11596 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
11597 error_start_ when erroneous token are discarded.
11598 (Parser::parse) <yyerrlab1>: Compute the location of the error
11599 token so that it covers all the discarded tokens.
11600 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
11601 it can be called with `%skeleton "lalr1.cc"', and do that.
11602
dd0e0635
PE
116032004-02-02 Paul Eggert <eggert@twinsun.com>
11604
11605 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
11606 $(top_srcdir)/lib and ../lib. This fixes a bug reported
11607 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
11608 There's no need to mention top_builddir since Automake does that
11609 for us.
11610 (INCLUDES): Remove, as Automake says it's obsolescent.
11611 Contents migrated into AM_CPPFLAGS as described above.
11612 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
11613
116142004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
11615
11616 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
11617 (yyreportSyntaxError): Handle case where lookahead token is
11618 YYEMPTY.
11619
be16239b
PH
116202004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11621
11622 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
11623 resulting parsers are compilable with C++.
11624
5fa90832
PE
116252003-12-23 Paul Eggert <eggert@twinsun.com>
11626
11627 * config/depcomp, config/install-sh: Sync with Automake 1.8.
11628 * src/output.c (output_skeleton): Rename local var.
11629 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
11630 Bison tokens, as this runs afoul of the 2003-10-07 change that
11631 disallowed NUL bytes in character constants or string literals.
11632
11633 * tests/local.at: Require Autoconf 2.59's Autotest.
11634 * tests/testsuite.at: Don't include local.at, since we now assume
11635 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
11636 including it.
11637 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
11638 multiple inclusion warnings.
dd0e0635 11639
b165c324
AD
116402003-12-02 Akim Demaille <akim@epita.fr>
11641
11642 * doc/bison.texinfo (How Can I Reset the Parser): More about start
11643 conditions.
11644 From Bruno Haible.
11645
26e06a21
ADL
116462003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
11647
11648 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
11649
92ac3705
PE
116502003-10-07 Paul Eggert <eggert@twinsun.com>
11651
6a5ecb38
PE
11652 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
11653 if testsuite doesn't exist.
11654
92ac3705
PE
11655 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
11656 literals, unfortunately.
11657 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
11658 Complain about NUL bytes in character constants or string literals.
11659
91d2c560
PE
116602003-10-05 Paul Eggert <eggert@twinsun.com>
11661
11662 * NEWS: Don't document %no-default-prec, as it's still
11663 too experimental.
11664 * doc/bison.texinfo: Document %no-default-prec only if
11665 the defaultprec flag is set. Normally it's not.
11666
0cc3da3a
PE
116672003-10-04 Paul Eggert <eggert@twinsun.com>
11668
11669 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
11670 non-modifiable lvalue, instead of a modifiable one.
11671 * doc/bison.texinfo (Actions): Document that $$ can
11672 be assigned to. Do not claim that $$ and $N are
11673 array element references: user code should not rely on this.
11674
22fccf95
PE
116752003-10-01 Paul Eggert <eggert@twinsun.com>
11676
11677 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
11678 (grammar_declaration): Use it.
11679 * src/scan-gram.l: New token %no-default-prec.
11680 * tests/conflicts.at: Revamp tests to use %no-default-prec.
11681 * NEWS, doc/bison.texinfo: Document the above.
11682
fc8f2965
AD
116832003-10-01 Akim Demaille <akim@epita.fr>
11684
11685 VCG no longer supports long_straight_phase.
11686
11687 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
11688 * src/print_graph.c (print_graph): Adjust.
11689
39a06c25
PE
116902003-09-30 Frank Heckenbach <frank@g-n-u.de>
11691 and Paul Eggert <eggert@twinsun.com>
11692
11693 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
11694 Table of Symbols): Document %default-prec.
11695 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
11696 (grammar_declaration): Set default_prec on %default-prec.
11697 * src/scan-gram.l (%default-prec): New token.
11698 * src/reader.h (default_prec): New flag.
11699 * src/reader.c: Likewise.
11700 (packgram): Handle it.
11701 * tests/conflicts.at (%default-prec without %prec,
11702 %default-prec with %prec, %default-prec 1): New tests.
fc8f2965 11703
39a06c25
PE
117042003-09-30 Paul Eggert <eggert@twinsun.com>
11705
11706 * tests/testsuite.at: Include local.at, not input.at, fixing
11707 a typo in the 2003-08-25 patch.
11708
62b6aef9
AD
117092003-08-27 Akim Demaille <akim@epita.fr>
11710
11711 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
11712 GCC warnings.
11713
89e1cc61
AD
117142003-08-26 Akim Demaille <akim@epita.fr>
11715
11716 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
11717 "<\#" to avoid magic from Gnus when posting parts of this script.
11718
a08460b0
AD
117192003-08-26 Akim Demaille <akim@epita.fr>
11720
11721 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
11722 (Parser::parse): here.
11723 Adjust: nerrs and errstatus is now replaced by...
11724 (Parser::nerrs_, Parser::errstatus_): New.
11725
603f1cfd
AD
117262003-08-25 Akim Demaille <akim@epita.fr>
11727
11728 * config/announce-gen, Makefile.cfg: New.
11729 * Makefile.am: Adjust.
11730 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
11731 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
11732
cd3684cf
AD
117332003-08-25 Akim Demaille <akim@epita.fr>
11734
11735 When reducing initial empty rules, Bison parser read an initial
11736 location that is not defined. This results in garbage, and that
11737 affects Bison's own parser. Therefore we need (i) to extend Bison
11738 to support a means to initialize this location, and (ii) to use
11739 this CVS Bison to fix CVS Bison's parser.
11740
11741 * src/reader.h, reader.c (epilogue_augment): Remove, replace
11742 with...
11743 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
11744 * src/parse-gram.y: Adjust.
11745 (%initial-action): New.
11746 (%error-verbose): Since we require CVS Bison, there is no reason
11747 not to use it.
11748 * src/scan-gram.l: Adjust.
11749 * src/Makefile.am (YACC): New, to make sure we use our own parser.
11750 * data/yacc.c (yyparse): Use b4_initial_action.
11751
4e03e201
AD
117522003-08-25 Akim Demaille <akim@epita.fr>
11753
11754 * doc/bison.texinfo: Don't promote stdout for error messages.
11755
8c182d05
AD
117562003-08-25 Akim Demaille <akim@epita.fr>
11757
11758 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
11759 From Alexandre Duret-Lutz.
11760
6a60c4cf
PE
117612003-08-25 Akim Demaille <akim@epita.fr>
11762
11763 Version 1.875c.
11764
25f66e1a
AD
117652003-08-25 Akim Demaille <akim@epita.fr>
11766
11767 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
11768 Use them.
11769
5348bfbe
AD
117702003-08-25 Akim Demaille <akim@epita.fr>
11771
11772 * data/lalr1.cc (Parser::reduce_print_): New.
11773 Use it.
11774
47301314
AD
117752003-08-25 Akim Demaille <akim@epita.fr>
11776
11777 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
11778 error recovery loops. This patch is based on
161a71f3 11779 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
47301314
AD
11780 Also, augment the similarity between lalr1.cc and yacc.c.
11781 Note: the locations of error recovery rules are not correct yet.
11782
11783 * data/lalr1.cc: Comment changes to augment the similarity between
11784 lalr1.cc and yacc.c.
11785 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
11786 (yyerrlab1): Remove, but where it used to be (now the bottom part of
11787 yyerrlab), when hitting EOF, pop the whole stack here instead of
11788 merely falling thru the default error handling mechanism.
11789 (yyerrorlab): New label, with the old contents of YYERROR,
11790 plus the following change: pop the stack of rhs corresponding
11791 to the production that invoked YYERROR. That is how Yacc
11792 behaves (required by POSIX).
11793 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
11794 fail.
11795
1f7a61ff
AD
117962003-08-25 Akim Demaille <akim@epita.fr>
11797
11798 Tune local.at so that people can "autom4te -l autotest calc.at -o
11799 calc" for instance, to extract a sub test suite.
11800
11801 * tests/testsuite.at: Move the initialization, Autotest version
11802 requirement, and AT_TESTED invocation into...
11803 * tests/local.at: here.
11804 * tests/testsuite.at: Include it for compatibility with Autoconf
11805 2.57.
11806 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
11807 be ignore.
11808
327b5b56
PE
118092003-08-04 Paul Eggert <eggert@twinsun.com>
11810
11811 Rework code slightly to avoid gcc -Wtraditional warnings.
11812 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
11813 The returned value is now stored in *YY0. All callers changed.
11814 * src/output.c (merge_output): Adjust to the above change.
11815
0051e3ed
PE
118162003-07-26 Paul Eggert <eggert@twinsun.com>
11817
11818 * data/glr.c (YYASSERT): New macro.
11819 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
11820 yyresolveStates, yyprocessOneStack):
11821 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
11822 Derived from a suggestion by Frank Heckenbach.
1f7a61ff 11823
137437c6
PE
118242003-07-25 Paul Eggert <eggert@twinsun.com>
11825
5b620e06
PE
11826 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
11827 for portability to K&R C (after ansi2knr, presumably). See
161a71f3 11828 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
5b620e06
PE
11829 by Frank Heckenbach, though I have omitted the structure-initialization
11830 part of his glr-knr.diff patch since I recall that the Portable
11831 C Compiler didn't require that change.
11832
137437c6
PE
11833 Let the user specify how to allocate and free memory.
11834 Derived from a suggestion by Frank Heckenbach in
161a71f3 11835 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
137437c6
PE
11836 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
11837 All uses of free, malloc, realloc changed to use these macros,
11838 and unnecessary casts removed.
11839 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
11840
ddb85ca5
PE
118412003-07-06 Matthias Mann <MatthiasMann@gmx.de>
11842
11843 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
11844 use s.empty() rather than s == "" to test for empty string; see
161a71f3 11845 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
ddb85ca5
PE
11846 (trivial change)
11847
39910e09
AD
118482003-06-25 Akim Demaille <akim@epita.fr>
11849
11850 * config/depcomp, config/install-sh: Update from masters.
11851
0ae99356
PE
118522003-06-20 Paul Eggert <eggert@twinsun.com>
11853
11854 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
11855 and return properly parenthesized result.
11856 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
11857 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
11858 Remove unnecessary parentheses from uses.
11859 * doc/bison.texinfo (Location Default Action): Describe the
11860 conventions for parentheses.
11861
cd05d13c
PE
118622003-06-19 Paul Eggert <eggert@twinsun.com>
11863
81fd08ca
PE
11864 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
11865 yyreportTree): Do not assume that size_t is the same width as int,
11866 when printing sizes. Print sizes using an unsigned format.
11867 Problem reported by Frank Heckenbach in
161a71f3 11868 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4dcf140b 11869
cd05d13c
PE
11870 Port to Forte Developer 7 C compiler.
11871 * data/glr.c (struct YYLTYPE): If locations are not being used,
11872 declare a single dummy member, as empty structs do not conform
11873 to the C standard.
11874 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
11875 the Forte Developer 7 C compiler complains that end-of-loop
11876 code is not reached.
11877
4dcf140b
PE
118782003-06-17 Paul Eggert <eggert@twinsun.com>
11879
11880 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
11881 avoid warnings from picky compilers about redefinition of PARAMS.
11882
8dd76bee
PE
118832003-06-17 Paul Eggert <eggert@twinsun.com>
11884
11885 Version 1.875b.
11886
11887 * NEWS: Document 1.875b.
11888
11889 * lib/bbitset.h: Do not include config.h; that's the includer's job.
11890 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
11891 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
11892 Don't use 'index' in comments, as it's a builtin fn on some hosts.
11893 * lib/bitset_stats.c: Include gettext.h unconditionally, as
11894 per recent gettext manual's suggestion.
11895 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
11896 Use prototypes, not old-style definitions.
11897 * lib/lbitset.c (lbitset_unused_clear): Likewise.
11898 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
11899 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
11900 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
11901 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
11902 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
11903 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
11904 vbitset_or_and_cmp, vbitset_copy): Likewise.
11905
11906 * lib/libiberty.h: Do not include config.h; that's the includer's job.
11907 Do not include <stdlib.h>.
11908 (PARAMS): Define unconditionally for C89.
11909 (ATTRIBUTE_NORETURN): Remove.
11910 (ATTRIBUTE_UNUSED): Define unconditionally.
11911
11912 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
161a71f3 11913 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8dd76bee
PE
11914 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
11915 * lib/vbitset.c, lib/vbitset.h: New files.
11916 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
11917 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
11918 from libbitset.
11919
11920 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
11921 `How Can I Reset @code{yyparse}', since texinfo does not allow
11922 arbitrary @ in node names.
11923
11924 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
11925 shouldn't be needed according to the gettext 0.12.1 documentation
11926 but which seem to be needed anyway: codeset.m4 glibc21.m4
f8e8262e 11927 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8dd76bee 11928 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
f8e8262e 11929 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
cd05d13c 11930
8dd76bee
PE
11931 * lib/.cvsignore: Add stdbool.h.
11932 * m4/.cvsignore: Add nls.m4, po.m4.
11933
11934 Upgrade to CVS gnulib.
11935 * stdbool_.h: File renamed from stdbool.h.in.
11936 * configure.ac (AM_STDBOOL_H): Invoke this instead of
11937 AC_HEADER_STDBOOL.
11938 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
11939 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
11940 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
11941 (MOSTLYCLEANFILES): New var.
11942 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
11943 (stdbool.h): New rule.
11944 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
11945 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
11946 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
11947 m4/quote.m4: Upgrade to today's gnulib.
11948
11949 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
11950 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
11951 the tests right now.
11952 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
11953 yyerror are declared before use; C99 requires this.
11954
25005f6a
PH
119552003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11956
11957 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
11958 first.
11959 (yyrecoverSyntaxError): Correct the logic for setting and testing
11960 yyerrState.
11961 Correct comment on handling EOF.
11962 Allow states with only a default reduction, rather than failing
8dd76bee 11963 (I can't quite reconstruct why these were not allowed before).
25005f6a 11964
137437c6 11965 Fixes to avoid problem that $-N rules in GLR parsers can cause
25005f6a 11966 buffer overruns, corrupting state.
8dd76bee
PE
11967
11968 * src/output.c (prepare_rules): Output max_left_semantic_context
25005f6a
PH
11969 definition.
11970 * src/reader.h (max_left_semantic_context): New variable declaration.
11971 * src/scan-gram.l (max_left_semantic_context): Define.
11972 (handle_action_dollar): Update max_left_semantic_context.
11973 * data/glr.c (YYMAXLEFT): New definition.
11974 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
11975 (yyresolveAction): Ditto.
11976
11977 Fixes to problems with location handling in GLR parsers reported by
11978 Frank Heckenbach (2003/06/05).
11979
11980 * data/glr.c (YYLTYPE): Make trivial if locations not used.
11981 (YYRHSLOC): Add parentheses, and define only if locations used.
11982 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
11983 locations not used.
11984 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
11985 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8dd76bee 11986
25005f6a
PH
11987 * tests/cxx-type.at: Exercise location information; update tests
11988 to differentiate output with and without locations.
8dd76bee 11989 Remove forward declarations of yylex and yyerror---caused errors
25005f6a
PH
11990 because default YYLTYPE not yet defined.
11991 Change semantic actions to compute strings, rather than printing
11992 them directly (to test proper passing of semantics values). Change
11993 output to prefix notation and update test data and expected results.
11994 (yylex): Track locations.
11995 (stmtMerge): Return value rather than printing, and include arguments
11996 in value.
8dd76bee 11997
711f40b7
PE
119982003-06-03 Paul Eggert <eggert@twinsun.com>
11999
12000 Avoid warnings generated by GCC 2.95.4 when Bison is
12001 configured with --enable-gcc-warnings.
12002 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
12003 yy::]b4_parser_class_name[::translate_,
12004 yy::Stack::operator[] (unsigned),
12005 yy::Stack::operator[] (unsigned) const,
12006 yy::Slice::operator[] (unsigned),
12007 yy::Slice::operator[] (unsigned) const):
12008 Rename local vars to avoid warnings.
12009 * tests/glr-regression.at (Improper handling of embedded actions
12010 and $-N in GLR parsers): Remove unused local variable from yylex.
12011 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
12012 (void) as arg when not pure, since we now assume C89 when building
12013 Bison. Pacify GCC by using parameter.
12014
ac695f7d
PE
120152003-06-02 Paul Eggert <eggert@twinsun.com>
12016
12017 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
12018 yy::Location::lines, yy::Location::columns): Rename arguments
12019 to avoid shadowing; this removes a warning generated by GCC 3.3.
12020
26ec81e0
PE
120212003-06-01 Paul Eggert <eggert@twinsun.com>
12022
12023 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
12024 to g++, as GCC 3.3 complains if you do it.
12025 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
12026 everything that WARNING_CFLAGS has, except omit warnings
12027 not suitable for C++.
12028 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
12029 * tests/atlocal.in (CXXFLAGS): New var.
12030 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
12031
12032 Fix a GLR parser bug I reported in February; see
161a71f3 12033 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
26ec81e0
PE
12034 The problem was that GLR parsers did not conform to the C standard,
12035 because actions like { $1 = $2 + $3; } expanded to expressions
12036 that invoked YYFILL in separate subexpressions, and YYFILL assigned
12037 to a local variable. The C standard says that expressions
12038 like (var = f ()) + (var = f ()) have undefined behavior.
12039 Another problem was that GCC sometimes issues warnings that
12040 yyfill and its parameters are unused.
12041
12042 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
12043 as possibly unused.
12044 (yyfill): New function.
12045 (YYFILL): Use it.
12046 (yyuserAction): Change type of yynormal to bool, so that it matches
12047 the new yyfill signature. Mark it as possibly unused.
12048
12049
12050 Follow up on a bug I reported in February, where a Bison-generated
12051 parser can loop. Provide a test case and a fix for yacc.c. I
12052 don't have a fix for lalr1.cc or for glr.c, unfortunately.
12053 The original bug report is in:
161a71f3 12054 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
26ec81e0
PE
12055
12056 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
12057 macro's size was becoming unwieldy.
12058 (yyerrlab): Do not discard an empty lookahead symbol, as this
12059 might destroy garbage.
12060 (yyerrorlab): New label, with the old contents of YYERROR,
12061 plus the following change: pop the stack of rhs corresponding
12062 to the production that invoked YYERROR. That is how Yacc
12063 behaves, and POSIX requires this behavior.
12064 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
12065 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
12066 Define 'alarm' to do nothing if unistd.h is not available.
12067 Add a new rule "exp: '-' error;" to test the above change to
12068 data/yacc.c. Use 'alarm' to abort any test taking longer than
12069 10 seconds, as it's probably looping.
12070 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
12071 Also, the new yacc.c generates two fewer diagnostics for an
12072 existing test.
12073
d0829076
PE
120742003-05-24 Paul Eggert <eggert@twinsun.com>
12075
c6ae27df
PE
12076 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
12077 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
12078 This fixes a problem reported by John Bowman when the Compaq/HP
12079 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
12080 -ansi -Wall -gall).
12081 * data/yacc.c (union yyalloc): Likewise.
12082 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
26ec81e0 12083
d0829076
PE
12084 Switch from 'int' to 'bool' where that makes sense.
12085
12086 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
12087 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
12088 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
12089 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
12090 Return or accept bool, not int. All callers changed.
12091 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
12092 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
12093 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
12094 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
12095 bitset_or_and_cmp_): Likewise.
12096 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
12097 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
12098 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
12099 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
12100 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
12101 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
12102 bitset_stats_or_and_cmp): Likewise.
12103 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
12104 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
12105 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
12106 ebitset_xor_cmp): Likewise.
12107 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
12108 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
12109 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
12110 lbitset_xor_cmp): Likewise.
12111 * lib/bbitset.h: Include <stdbool.h>.
12112 (struct bitset_vtable): The following members now return bool, not
12113 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
12114 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
12115 or_and_cmp).
12116 * src/conflicts.c (count_rr_conflicts): Likewise.
12117 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
12118 All uses changed.
12119 * lib/ebitset.c (ebitset_obstack_init): Likewise.
12120 * lib/lbitset.c (lbitset_obstack_init): Likewise.
12121 * src/getargs.c (debug_flag, defines_flag, locations_flag,
12122 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
12123 graph_flag): Likewise.
12124 * src/getargs.h (debug_flag, defines_flag, locations_flag,
12125 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
12126 graph_flag): Likewise.
12127 * src/output.c (error_verbose): Likewise.
12128 * src/output.h (error_verbose): Likewise.
12129 * src/reader.c (start_flag, typed): Likewise.
12130 * src/reader.h (typed): Likewise.
12131 * src/getargs.c (LOCATIONS_OPTION): New constant.
12132 (long_options, getargs): Use it.
12133 * src/lalr.c (build_relations): Use bool, not int.
12134 * src/nullable.c (nullable_compute): Likewise.
12135 * src/print.c (print_reductions): Likewise.
12136 * src/tables.c (action_row, pack_vector): Likewise.
12137 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
12138 * src/output.c (prepare): Use it.
12139 * src/output.c (token_definitions_output,
12140 symbol_destructors_output, symbol_destructors_output): Use string,
12141 not boolean integer, to keep track of whether to output separator.
12142 * src/print_graph.c (print_core): Likewise.
12143 * src/state.c (state_rule_lookaheads_print): Likewise.
12144
12145 * config/install-sh: Sync from automake 1.7.5.
12146
6b2584b7
PE
121472003-05-14 Paul Eggert <eggert@twinsun.com>
12148
12149 * src/parse-gram.y (rules_or_grammar_declaration): Require a
12150 semicolon after a grammar declaration, in the interest of possible
12151 future changes to the Bison input language.
12152 Do not allow a stray semicolon at the start of the grammar.
12153 (rhses.1): Allow one or more semicolons after any rule, including
12154 just before "|" as required by POSIX.
12155 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
12156 grammar.
12157
caf37a36
ADL
121582003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
12159
12160 %parse-param support for lalr1.cc.
12161
12162 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
12163 b4_cc_constructor_calls, b4_cc_constructor_call,
12164 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
12165 definitions.
12166 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
12167 parse-param arguments.
12168 (yy::b4_parser_class_name): Declare instance variables to
12169 hold parse-param arguments.
12170 * tests/calc.at: s/value/semantic_value/ because value clashes
12171 with a member of yy::b4_parser_class_name. Adjust C++ code
12172 to handle %parse-param. Enable %parse-param test in C++.
12173
3ab37077
PE
121742003-05-12 Paul Eggert <eggert@twinsun.com>
12175
12176 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
12177 English a bit. Fix fclose typo. Change "const char" to "char
12178 const", and use ANSI C rather than K&R for "main". Suggest
12179 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
12180 and suggest yy_switch_to_buffer.
12181
121822003-05-05 Paul Eggert <eggert@twinsun.com>
163ab321
PE
12183
12184 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
12185 C89. This avoids a diagnostic on compilers that define __STDC__
12186 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
161a71f3 12187 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
163ab321 12188
e743727f
PE
121892003-05-03 Paul Eggert <eggert@twinsun.com>
12190
12191 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
12192 Do not overrun array bounds.
12193 This should fix a bug reported today by Olatunji Oluwabukunmi in
161a71f3 12194 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
e743727f 12195
916708d5
AD
121962003-04-29 Akim Demaille <akim@epita.fr>
12197
12198 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
12199 * src/getargs.c, src/getargs.h: here, as bool, not int.
12200 (nondeterministic_parser): New.
12201 * src/parse-gram.y, src/scan-gram.l: Support
12202 %nondeterministic-parser.
12203 * src/output.c (prepare): Use nondeterministic_parser instead
12204 of glr_parser where appropriate.
12205 * src/tables.c (conflict_row, action_row, save_row)
12206 (token_actions, token_actions, pack_vector): Ditto.
12207
a06ea4aa
AD
122082003-04-29 Akim Demaille <akim@epita.fr>
12209
12210 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
12211
211074ca
AD
122122003-04-29 Akim Demaille <akim@epita.fr>
12213
12214 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
12215 with %pure-parser and %locations to exercise the patch from Yakov
12216 Markovitch below.
12217
6175ffe3
PE
122182003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
12219
12220 * data/yacc.c: (b4_lex_param): Corrected for the case where
12221 %lex-param is provided and %pure-parser isn't.
12222
b1e95857
PE
122232003-04-27 Paul Eggert <eggert@twinsun.com>
12224
12225 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
161a71f3 12226 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
b1e95857
PE
12227 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
12228 if it is not defined.
12229 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
12230
acda9df6
PE
122312003-04-26 Paul Eggert <eggert@twinsun.com>
12232
3470c57b
PE
12233 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
12234 Declare to be of type suitable for the ninf value itself, not of
12235 type suitable for the corresponding table, since the latter might
12236 be unsigned but the ninf value might be negative. This fixes a
12237 bug reported by Alexandre Duret-Lutz in
161a71f3 12238 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
3470c57b 12239
acda9df6
PE
12240 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
12241 invokes it. We shouldn't invoke it twice because it will attempt
12242 to put error.o in the archive twice. This fixes a glitch reported
12243 by Martin Mokrejs in
161a71f3 12244 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
acda9df6 12245
b5250f26
PE
122462003-04-21 Paul Eggert <eggert@twinsun.com>
12247
12248 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
12249 to gnulib.
12250
089ac0f1
PE
122512003-04-21 Yakov Markovitch <Markovitch@iso.ru>
12252
12253 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
12254 Fix obvious typo that results in uncompilable GLR parsers
12255 when both %pure-parser and %locations are used. (trivial change)
12256
5ededac6
PE
122572003-04-17 Paul Eggert <eggert@twinsun.com>
12258
1b8f2fff
PE
12259 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
12260 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
12261 Do not insert the expected token via unput, as this runs afoul
12262 of a POSIX-compatibility bug in flex 2.5.31.
12263 All uses changed to BEGIN the parent state,
12264 since we no longer insert the expected token via unput.
12265 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
12266 that is no longer emitted after the above change.
12267
5ededac6
PE
12268 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
12269 the first one. This change is from Paul Hilfinger, and it fixes
12270 regression reported by Werner Lemberg in
161a71f3 12271 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5ededac6
PE
12272
12273 (resolve_sr_conflict): Don't invoke state_errs_set
12274 unless one or more tokens have been explicitly made errors.
12275 Otherwise, the above change causes Bison to abort.
12276
12277 * tests/existing.at (GNU pic Grammar): New test case, taken from
12278 Lemberg's email.
12279
b8be9132
AD
122802003-03-31 Akim Demaille <akim@epita.fr>
12281
12282 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
12283
d423d460
AD
122842003-03-31 Akim Demaille <akim@epita.fr>
12285
12286 * src/output.c (prepare_symbols): Avoid trailing spaces in the
12287 output.
12288
c7e441b4
AD
122892003-03-31 Akim Demaille <akim@epita.fr>
12290
12291 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
12292 From Paul Hilfinger.
12293
231897ad
AD
122942003-03-29 Akim Demaille <akim@epita.fr>
12295
12296 * m4/error.m4: Do not put under dynamic conditions some code which
12297 expansion is under static control.
12298
5b066063
AD
122992003-03-29 Akim Demaille <akim@epita.fr>
12300
12301 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
12302
22a74fec
AD
123032003-03-29 Akim Demaille <akim@epita.fr>
12304
12305 * doc/bison.texinfo (Strings are Destroyed): New.
12306
0eee27e7
PE
123072003-03-13 Paul Eggert <eggert@twinsun.com>
12308
12309 * .cvsignore: Add configure.lineno.
12310 * src/.cvsignore: Add yacc.
12311 * tests/.cvsignore: Add testsuite.log.
12312 * doc/fdl.texi: Sync with latest FSF version.
12313
f61aad93
PE
123142003-03-12 Paul Eggert <eggert@twinsun.com>
12315
537636c7
PE
12316 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
12317 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
12318 cursor, instead of leaving it undefined. This fixes a bug
12319 reported by Tim Van Holder in
161a71f3 12320 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
537636c7
PE
12321 * tests/input.at (Torturing the Scanner): Test the scanner on
12322 an empty input file, which was Tim Van Holder's test case.
12323
12324 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
12325 <sys/resource.h> can be included, include sys/time.h and
12326 sys/times.h first, if available. This works around the SunOS
12327 4.1.4 porting bug reported by Bruce Becker in
161a71f3 12328 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
537636c7
PE
12329
12330 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
12331 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
12332 AC_HEADER_SYS_WAIT.
12333
f61aad93
PE
12334 Merge changes from gnulib. This was prompted because the CVS
12335 snapshot didn't build on Solaris 7 due to strnlen problems.
12336
12337 These changes need to be merged back into gnulib:
12338 * lib/hash.c: Include <stdbool.h> unconditionally.
12339 * m4/onceonly.m4 (m4_quote): New macro.
12340 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
12341 Quote AC_FOREACH variable-expansions properly.
12342 The 2003-01-03 obstack.h change also needs merging.
12343 {end of changes requiring merging}
5b066063 12344
f61aad93
PE
12345 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
12346 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
12347 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
12348 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
12349 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
12350 New files, imported from gnulib.
12351 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
12352 above.
12353
12354 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
12355 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
12356 gnulib sources.
12357
12358 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
12359 Add.
12360 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
12361 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
12362 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
12363 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
12364 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
12365 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
12366 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
12367 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
12368 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
12369 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
12370 (jm_PREREQ_ARGMATCH): Remove.
12371 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
12372 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
12373
12374 * src/system.h: Include <stdbool.h> unconditionally.
12375
12376 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
12377 assuming at least C89 in the bitset code for some time now.
12378
d2ffe116
AD
123792003-03-03 Akim Demaille <akim@epita.fr>
12380
12381 * ro.po: New.
12382
052826fd
AD
123832003-03-02 Akim Demaille <akim@epita.fr>
12384
12385 * doc/bison.texinfo (Table of Symbols): Reactivate the
12386 documentation for %lex-param, and %parse-param.
12387
c4749565
AD
123882003-03-02 Akim Demaille <akim@epita.fr>
12389
12390 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
12391 generate verbose error messages.
12392 Use the number of tokens as an upper bound in yytname, as it
12393 cannot be a non terminal.
12394
d5286af1
AD
123952003-03-02 Akim Demaille <akim@epita.fr>
12396
12397 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
12398 message.
12399
22e304a6
AD
124002003-03-02 Akim Demaille <akim@epita.fr>
12401
22e304a6
AD
12402 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
12403 Use them to exercise yycheck overrun.
12404 Based on Andrew Suffield's grammar.
12405
67a25fed
AD
124062003-03-02 Akim Demaille <akim@epita.fr>
12407
12408 Create tests/local.at for Bison generic testing macros.
12409
12410 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
12411 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
12412 This new file.
12413 * tests/calc.at (AT_CHECK_CALC): Adjust.
12414 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
12415 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
12416 * tests/local.at: here.
12417 (AT_COMPILE_CXX): Tags the tests using it as c++.
12418 Ignore the test if CXX is not functional.
12419
9c2b381f
PE
124202003-03-01 Paul Eggert <eggert@twinsun.com>
12421
12422 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
12423 not loc->end, since loc->end might contain garbage and this leads
12424 to undefined behavior on some platforms.
12425 (id_loc, token_start): Use (IF_LINTed) initial values that do not
12426 depend on *loc, so that the reader doesn't give the the false
12427 impression that *loc is initialized.
12428 (<INITIAL>"%%"): Do not bother setting code_start, since its value
12429 does not survive the return.
12430
0433ba88
AD
124312003-03-01 Akim Demaille <akim@epita.fr>
12432
12433 * src/scan-gram.l (code_start): Always initialize it when entering
12434 into yylex, as SC_EPILOGUE is activated *before* the corresponding
12435 yylex invocation. An alternative would be making it static, but
12436 then it starts with the second %%'s beginning, instead of its end.
12437
b305ea69
PE
124382003-02-28 Paul Eggert <eggert@twinsun.com>
12439
12440 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
12441 around a UnixWare 7.1.1 porting bug reported by John Hughes in
161a71f3 12442 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
b305ea69 12443
c3d25e01
PE
124442003-02-26 Paul Eggert <eggert@twinsun.com>
12445
12446 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
12447 Remove Sequent/Pyramid discussion (nobody uses them any more).
12448 Merge VMS and MS-DOS discussion; these ports may well be dead
12449 but let's keep mentioning them for now. Put <> around email
12450 addresses. Add copyright notice.
12451
c267ffbc
PE
124522003-02-24 Paul Eggert <eggert@twinsun.com>
12453
12454 * data/glr.c (yy_reduce_print): yylineno -> yylno,
12455 to avoid collision with flex use of yylineno.
12456 Problem reported by Bruce Lilly in
161a71f3 12457 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
c267ffbc
PE
12458 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
12459 * data/yacc.c (yy_reduce_print): Likewise.
12460
12461 * config/depcomp: Sync with Automake 1.7.3.
12462
f939fc12
AD
124632003-02-21 Akim Demaille <akim@epita.fr>
12464
12465 * data/lalr1.cc: Use temporary variables instead of casts to
12466 change integer types.
12467 Suggested by Paul Eggert.
12468
95923bd6
AD
124692003-02-21 Akim Demaille <akim@epita.fr>
12470
12471 * doc/bison.texinfo: Use "location" consistently to refer to @n,
12472 to avoid confusions with lalr1.cc's notion of Position.
12473 Suggested by Paul Eggert.
12474
2cdc240e
AD
124752003-02-20 Akim Demaille <akim@epita.fr>
12476
12477 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
12478 before initial_columns.
12479 (location.hh): Use consistent variable names when defining the
12480 operator<<.
12481 Use "last" so that we subtract from Positions, not from unsigned.
12482
5d003116
AD
124832003-02-20 Akim Demaille <akim@epita.fr>
12484
12485 * data/lalr1.cc (position.hh): New subfile, including the extended
12486 and Doxygen'ed documentation of class Position.
12487 (location.hh): Use it.
12488 Document a` la Doxygen.
ba1ecc07 12489 With the help of Benoit Perrot.
5d003116 12490
d02b25f9
AD
124912003-02-20 Akim Demaille <akim@epita.fr>
12492
12493 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
12494 AT_YACC_IF.
12495 Redefine AT_YYERROR_SEES_LOC_IF using it.
12496 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
12497 not defined.
12498 Don't use the location in yy::Parser::error_ and
12499 yy::Parser::print_ when not %locations.
12500 Activate more lalr1.cc tests.
12501
0d1c3a04
AD
125022003-02-19 Akim Demaille <akim@epita.fr>
12503
12504 * data/lalr1.cc: When displaying a line number, be sure to make it
12505 an int.
12506
60a777aa
AD
125072003-02-19 Akim Demaille <akim@epita.fr>
12508
12509 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
12510 Remove, useless.
12511 (YYABORT, YYACCEPT, YYERROR): New.
12512 * tests/calc.at: Renable the lalr1.cc test.
12513
0b86fc41
AD
125142003-02-19 Akim Demaille <akim@epita.fr>
12515
12516 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
12517 error recovery, mixing with/without pops and discarding of the
12518 lookahead.
12519 Exercise YYERROR.
12520 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
12521
da99a5dc
PE
125222003-02-17 Paul Eggert <eggert@twinsun.com>
12523
12524 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
12525 * tests/testsuite.at (AT_COMPILE): Use them.
12526 This fixes the testsuite problem reported by Robert Lentz in
161a71f3 12527 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
da99a5dc 12528
93b8c255
PE
125292003-02-12 Paul Eggert <eggert@twinsun.com>
12530
12531 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
12532 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
161a71f3 12533 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
93b8c255
PE
12534 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
12535 Check for malloc failure, for consistency with yacc.c.
12536 (yytname_size): Remove, for consistency with yacc.c.
12537
12538 The bug still remains in data/lalr1.cc, as I didn't have time
12539 to fix it there.
12540
7548fed2
AD
125412003-02-06 Akim Demaille <akim@epita.fr>
12542
12543 * configure.ac (GXX): Rename as...
12544 (CXX): this, to keep the original Autoconf semantics.
12545 Require 2.57.
12546 * data/lalr1.cc: Fix b4_copyright invocations.
12547 If YYDEBUG is not defined, don't depend upon name_ being defined.
12548 (location.hh): Include string and iostream.
12549 (Position::filename): New member.
12550 (Position::Position ()): New.
12551 (operator<< (Position)): New.
12552 (operator- (Position, int)): New.
12553 (Location::first, Location::last): Rename as...
12554 (Location::begin, Location::end): these, to mock the conventional
12555 iterator names.
12556 (operator<< (Location)): New.
12557 * tests/atlocal.in (CXX): New.
12558 * tests/testsuite.at (AT_COMPILE_CXX): New.
12559 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
12560 locations in a more synthetic way.
12561 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
12562 lalr1.cc is used.
12563 Adjust the C locations to match those from Emacs: first column is
12564 column 0.
12565 Change all the expected results.
12566 Conform to the GCS: simplify the locations when applicable.
12567 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
12568 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
12569 these CPP macros with the m4 macros new defined by...
12570 (AT_CHECK_PUSHDEFS): this, i.e.:
12571 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
d02b25f9 12572 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7548fed2
AD
12573 New macros.
12574 (AT_CHECK_POPDEFS): Undefine them.
12575 (AT_CHECK_CALC_LALR1_CC): New.
12576 Use it for the first lalr1.cc test.
12577
43a176ef
AD
125782003-02-04 Akim Demaille <akim@epita.fr>
12579
12580 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
12581 Location as is defined.
12582
fc049e9c
AD
125832003-02-04 Akim Demaille <akim@epita.fr>
12584
12585 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
12586 name_ being defined.
12587
a737b216
PE
125882003-02-03 Paul Eggert <eggert@twinsun.com>
12589
12590 * src/gram.h (start_symbol): Remove unused decl.
12591
12592 Use more-consistent naming conventions for local vars.
12593
12594 * src/derives.c (derives_compute): Change type of local var from
12595 int to rule_number.
12596 * src/gram.c (grammar_rules_partial_print): Likewise.
12597 * src/print.c (print_core): Likewise.
12598 * src/reduce.c (reduce_grammar_tables): Likewise.
12599
12600 * src/gram.c (grammar_dump): Change name of item_number *
12601 local var from r to rp.
12602 * src/nullable.c (nullable_compute): Likewise.
12603
12604 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
12605
12606 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
12607 for symbol or symbol_number var.
12608 * src/reader.c (grammar_start_symbol_set): Likewise.
12609 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
12610 Likewise.
12611 * src/state.c (transitions_to): Likewise.
12612 * src/state.h: Likewise.
12613 * src/tables.c (symbol_number_to_vector_number): Likewise.
12614
12615 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
12616 char * var.
12617
12618 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
12619 var.
12620
12621 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
12622 var.
12623
12624 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
12625 Use str, not s, for char * var. Use ch, not c, for character var.
12626 Use size for size var.
12627
12628 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
12629 char * var.
12630 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
12631 uniqstr var.
12632 * src/uniqstr.h: Likewise.
12633
12634 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
12635 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
12636 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
12637 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
12638 param to have same name as that of enum, so that we don't use
12639 "s" to stand for a non-state.
12640
68e93ad5
AD
126412003-02-02 Akim Demaille <akim@epita.fr>
12642
12643 * src/scan-skel.l: Scan more than one inert character per yylex
12644 invocation.
12645
92898986
PE
126462003-02-01 Paul Eggert <eggert@twinsun.com>
12647
12648 Version 1.875a.
12649
1d9d5d71
PE
12650 * po/LINGUAS: Add ms.
12651
0435d061
AD
126522003-01-30 Akim Demaille <akim@epita.fr>
12653
12654 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
12655
6029a57f
PH
126562003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12657
12658 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
12659 of $1.
0435d061
AD
12660
12661 Changes in response to error report by S. Eken: GLR mode does not
6029a57f 12662 handle negative $ indices or $ indices in embedded rules correctly.
161a71f3 12663 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
0435d061 12664
6029a57f
PH
12665 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
12666 (b4_rhs_location): Ditto.
0435d061 12667 (yyfill): New function to copy from stack tree into array
6029a57f 12668 incrementally.
0435d061
AD
12669 (yyuserAction): Modify to allow incremental move of semantic values
12670 to rhs array when in GLR mode.
12671 Define YYFILL to use in user-defined actions to fill semantic array
6029a57f
PH
12672 as needed.
12673 Remove dummy use of yystack, as there is now a guaranteed use.
12674 (yydoAction): Modify to allow incremental move of semantic values
12675 to rhs array when in GLR mode.
12676 (yyresolveAction): Ditto.
12677 (yyglrShiftDefer): Update comment.
0435d061 12678 (yyresolveStates): Use X == NULL for pointers, not !X.
6029a57f
PH
12679 (yyglrReduce): Ditto.
12680 (yydoAction): Ditto
0435d061 12681
6029a57f
PH
12682 * tests/glr-regr1.at: Rename to ...
12683 * tests/glr-regression.at: Add new regression test for the problems
12684 described above (adapted from S. Eken).
12685 Update copyright notice.
12686 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
12687 * tests/Makefile.am: Ditto.
12688
6cee6297
PE
126892003-01-28 Paul Eggert <eggert@twinsun.com>
12690
12691 * data/lalr1.cc: Do not use @output_header_name@ unless
12692 b4_defines_flag is set. This fixes two bugs reported by
12693 Tim Van Holder in
161a71f3
PE
12694 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
12695 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
6cee6297 12696
b2a836b5
PE
126972003-01-21 Paul Eggert <eggert@twinsun.com>
12698
12699 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
12700 we don't need to worry about yyerrlab1 being reported as an
12701 "unused label" by non-GCC C compilers. The downside is that if
12702 locations are used then a couple of statements are duplicated each
12703 time YYERROR is invoked, but the upside is that the warnings
12704 should vanish.
12705 (yyerrlab1): Move code to YERROR.
12706 (yyerrlab2): Remove. Change uses back to yyerrlab1.
12707 This reverts some of the 2002-12-27 change.
12708
4196b931
PE
127092003-01-17 Paul Eggert <eggert@twinsun.com>
12710
12711 * src/output.c (symbol_printers_output): Fix typo that led
12712 to core dump. Problem reported by Antonio Rus in
161a71f3 12713 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
4196b931 12714
3ae831b4
AD
127152003-01-13 Akim Demaille <akim@epita.fr>,
12716 Quoc Peyrot <chojin@lrde.epita.fr>,
12717 Robert Anisko <anisko_r@lrde.epita.fr>
12718
12719 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
12720 when the stacks contain one element, as the loop would otherwise
12721 free the last state, and then use the top state (the one we just
12722 popped). This means that the initial elements will not be freed
12723 explicitly, as is the case in yacc.c; it is not a problem, as
12724 these elements have fake values.
12725
e3aa65c5
PE
127262003-01-11 Paul Eggert <eggert@twinsun.com>
12727
12728 * NEWS: %expect-violations are now just warnings, reverting
12729 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
12730 bootstrapping problem reported by Matthias Klose; see
161a71f3 12731 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
e3aa65c5
PE
12732 * src/conflicts.c (conflicts_print): Likewise.
12733 * tests/conflicts.at (%expect not enough, %expect too much,
12734 %expect with reduce conflicts): Likewise.
12735 * doc/bison.texinfo (Expect Decl): Document this. Also mention
12736 that the warning is enabled if the number of conflicts changes
12737 (not necessarily increases).
12738
12739 * src/getargs.c (version): Update copyright year.
12740
f0057011
AD
127412003-01-09 Akim Demaille <akim@epita.fr>
12742
12743 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
12744
1ee6d2a0
PE
127452003-01-08 Paul Eggert <eggert@twinsun.com>
12746
12747 * Makefile.maint (WGETFLAGS):
12748 New macro, containing "-C off" to disable proxy caches.
12749 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
12750 (rel-check): Use $(WGET) instead of wget.
12751
d4fd77c4
PE
127522003-01-06 Paul Eggert <eggert@twinsun.com>
12753
12754 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
12755 the GLR paper of Scott, Johnstone and Hussain.
12756
464c6927
PE
127572003-01-04 Paul Eggert <eggert@twinsun.com>
12758
d600ee67
PE
12759 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
12760 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
12761 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
12762 (EXTRA_LIBRARIES): New var, for liby.a.
12763 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
12764 (EXTRA_SCRIPTS): New var, for yacc.
12765
464c6927
PE
12766 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
12767 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
12768 Problem reported by Nelson H. F. Beebe.
12769
127702003-01-03 Paul Eggert <eggert@twinsun.com>
12771
12772 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
12773 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
12774 when compiling Bison 1.875's `bitset bset = obstack_alloc
12775 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
12776
12777 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
12778 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
12779 grow to a huge size with typical invocation.
d600ee67 12780
464c6927
PE
12781 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
12782 Use the pattern recommended by Autoconf 2.57, except also protect
12783 against double-definition.
12784 * src/system.h: Likewise.
12785 Portability issues reported by Nelson H. F. Beebe.
d600ee67 12786
464c6927
PE
12787 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
12788 All uses changed. Provide a definition in both C and C++.
12789 (yytrue, yyfalse): Define even if defined (__cplusplus).
12790
12791 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
12792 Reported by Nelson H. F. Beebe.
d600ee67 12793
464c6927
PE
12794 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
12795
0f42c7d5
PE
127962003-01-02 Paul Eggert <eggert@twinsun.com>
12797
12798 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
12799 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
12800 Bug reported by Nelson H. F. Beebe.
12801
dc546b0f
PE
128022003-01-01 Paul Eggert <eggert@twinsun.com>
12803
12804 * Version 1.875.
12805
2c09b6a7
PE
128062002-12-30 Paul Eggert <eggert@twinsun.com>
12807
12808 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
12809 Moved here from...
12810 (<INITIAL>","): Here. This causes stray "," to be treated
12811 more uniformly.
12812
dc546b0f 12813 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
12814 last brace in braced code when not in Yacc mode, for compatibility
12815 with Bison 1.35. This resurrects the 2001-12-15 patch to
12816 src/reader.c.
12817
12818 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
12819 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
12820
535c0f63
PE
128212002-12-28 Paul Eggert <eggert@twinsun.com>
12822
12823 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
12824 that of SYM's type. This fixes Debian bug 168069, reported by
12825 Thomas Olsson.
d600ee67 12826
963fcc17
PE
128272002-12-28 Paul Eggert <eggert@twinsun.com>
12828
12829 Version 1.75f.
12830
12831 Switch back to the Yacc style of conflict reports, undoing some
12832 of the 2002-07-30 change.
12833 * doc/bison.texinfo (Understanding): Use Yacc style for
12834 conflict reports. Also, use new way of locating rules.
12835 * src/conflicts.c (conflict_report):
12836 Renamed from conflict_report_yacc, removing the old
12837 'conflict_report'. Translate the entire conflict report at once,
12838 so that we don't assume that "," has the same interpretation in
12839 all languages.
12840 (conflicts_output): Use Yacc-style conflict report for each state,
12841 instead of our more-complicated style.
12842 (conflicts_print): Use Yacc-style conflict report, except print
12843 the input file name when not emulating Yacc.
12844 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
12845 Conflicted Reduction, %expect not enough, %expect too much,
12846 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
12847 * tests/existing.at (GNU Cim Grammar): Likewise.
12848 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
12849
12850 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
12851 fatal): Don't invoke fflush; it's not needed and it might even be
12852 harmful for stdout, as stdout might not be open.
12853 * src/reduce.c (reduce_print): Likewise.
12854
b1efe548
PE
128552002-12-27 Paul Eggert <eggert@twinsun.com>
12856
12857 Fix a bug where error locations were not being recorded correctly.
12858 This problem was originally reported by Paul Hilfinger in
161a71f3 12859 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
12860
12861 * data/yacc.c (yyparse): New local var yylerrsp, to record the
12862 top of the location stack's error locations.
12863 (yyerrlab): Set it. When discarding a token, push its location
12864 onto yylerrsp so that we don't lose track of the error's end.
12865 (yyerrlab1): Now is only the target of YYERROR, so that we can
12866 properly record the location of the action that failed. For GCC
12867 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
12868 GCC warning about yyerrlab1 being unused if YYERROR is unused.
12869 (yyerrlab2): New label, which yyerrlab now falls through to.
12870 Compute the error's location by applying YYLLOC_DEFAULT to
12871 the locations of all the symbols that went into the error.
12872 * doc/bison.texinfo (Location Default Action): Mention that
12873 YYLLOC_DEFAULT is also invoked for syntax errors.
12874 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
12875 Error locations include the locations of all the tokens that were
12876 discarded, not just the last token.
d600ee67 12877
983c5c2c
PE
128782002-12-26 Paul Eggert <eggert@twinsun.com>
12879
b1efe548
PE
12880 * src/files.c: Include quote.h.
12881 (compute_output_file_names): Warn if we detect conflicting
12882 outputs to the same file. This should catch the misunderstanding
12883 exemplified by Debian Bug 165349, reported by Bruce Stephens..
12884
12885 * src/conflicts.c (conflicts_print): If the user specifies
12886 "%expect N", report an error if there are any reduce/reduce
12887 conflicts. This is what the manual says should happen.
12888 This fixes Debian bug 130890, reported by Anthony DeRobertis.
12889 * tests/conflicts.at (%expect with reduce conflicts): New test.
12890
983c5c2c
PE
12891 Don't use m4_include on relative file names, as it doesn't work as
12892 desired if there happens to be a file with that name under ".".
d600ee67 12893
983c5c2c
PE
12894 * m4sugar/version.m4: Remove; it was included but it wasn't used.
12895 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
12896 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
12897 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
12898 * src/output.c (output_skeleton): Use full path names when
12899 specifying a file to include; don't rely on include path, as
12900 it's unreliable when the working file contains a file with
12901 that name.
d600ee67 12902
983c5c2c
PE
129032002-12-25 Paul Eggert <eggert@twinsun.com>
12904
12905 Remove obsolete references to bison.simple and bison.hairy.
12906 Problem mentioned by Aubin Mahe in
161a71f3 12907 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
12908 * data/glr.c: Comment fix.
12909 * doc/bison.1: Remove references. Also, mention "yacc".
12910
12911 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
12912 with -g option.
12913
12914 * src/parse-gram.y (declaration): Use enum "report_states" rather
12915 than its numeric value 1.
12916
12917 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
12918 opening a new one. This fixes Debian bug 165349, reported by
12919 Bruce Stephens.
12920
23f2d9dc
PE
129212002-12-24 Paul Eggert <eggert@twinsun.com>
12922
12923 Version 1.75e.
12924
12925 * Makefile.maint (cvs-update): Don't assume that the shell
12926 supports $(...), as Solaris sh doesn't.
12927
12928 * src/parse-gram.y (lloc_default): Remove test for empty
12929 nonterminals at the end, since it didn't change the result.
12930
129312002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
12932
12933 If the user does not define YYSTYPE as a macro, Bison now declares it
12934 using typedef instead of defining it as a macro. POSIX requires this.
12935 For consistency, YYLTYPE is also declared instead of defined.
12936
12937 %union directives can now have a tag before the `{', e.g., the
12938 directive `%union foo {...}' now generates the C code
12939 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
12940 The default union tag is `YYSTYPE', for compatibility with Solaris 9
12941 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
12942 instead of `yyltype'.
12943
12944 `yystype' and `yyltype' are now obsolescent macros instead of being
12945 typedefs or tags; they are no longer documented and will be
12946 withdrawn in a future release.
12947
12948 * data/glr.c (b4_location_type): Remove.
12949 (YYSTYPE): Renamed from yystype.
12950 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
12951 (struct YYLTYPE): Renamed from struct yyltype.
12952 (YYLTYPE): Renamed from yyltype.
12953 (yyltype, yystype): New (and obsolescent) macros,
12954 for backward compatibility.
12955 * data/yacc.c: Likewise.
12956
12957 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
12958 does not specify a union tag. This is for compatibility with
12959 Solaris 9 yacc.
12960
12961 * src/parse-gram.y (add_param): 2nd arg is now char * not char
12962 const *, since it is now modified by stripping surrounding { }.
12963 (current_braced_code): Remove.
12964 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
12965 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
12966 trailing " {...}". Now of type <chars>.
12967 (grammar_declaration): Adjust to bundled tokens.
12968 (code_content): Remove; stripping is now done by add_param.
12969 (print_token_value): Print contents of bundled tokens.
12970 (token_name): New function.
12971
12972 * src/reader.h (braced_code, current_braced_code): Remove.
12973 (token_name): New decl.
12974
12975 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
12976 token_type, not braced_code code_kind. All uses changed.
12977 (SC_PRE_CODE): New state, for scanning after a keyword that
12978 has (or usually has) an immediately-following braced code.
12979 (token_type): New local var, to keep track of which token type
12980 to return when scanning braced code.
12981 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 12982 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
12983 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
12984 instead of returning a token type immediately.
12985 (<INITIAL>"{"): Set token type.
12986 (<SC_BRACED_CODE>"}"): Use it.
12987 (handle_action_dollar, handle_action_at): Now returns bool
12988 indicating success. Fail if ! current_rule; this prevents a core dump.
12989 (handle_symbol_code_dollar, handle_symbol_code_at):
12990 Remove; merge body into caller.
12991 (handle_dollar, handle_at): Complain in invalid contexts.
12992
12993 * NEWS, doc/bison.texinfo: Document the above.
12994 * NEWS: Fix years and program names in copyright notice.
12995
879ca4f8
PE
129962002-12-17 Paul Eggert <eggert@twinsun.com>
12997
12998 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
12999 Reporting, Table of Symbols): Omit mentions of %lex-param and
13000 %parse-param from the documentation for now.
13001
1c5fe69d
PE
130022002-12-15 Paul Eggert <eggert@twinsun.com>
13003
13004 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
13005 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
13006 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
13007 disagreed with the Bison documentation. Bug
13008 reported by Andrew Walrond.
d600ee67 13009
1c5fe69d
PE
13010 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
13011 as the caller now does that.
13012 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
13013 (YYEMPTY): Parenthesize right hand side, since others use it.
13014 (yyparse): Don't assume that our generated code is the only code
13015 that sets yychar.
13016
d1de5372
PE
130172002-12-13 Paul Eggert <eggert@twinsun.com>
13018
13019 Version 1.75d.
13020
13021 POSIX requires a "yacc" command.
13022 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
13023 (MOSTLYCLEANFILES): Add yacc.
13024 (yacc): New rule.
1c5fe69d 13025 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
13026 as an alias for bison y.
13027
13028 * po/LINGUAS: Add da.
d600ee67 13029
d1de5372
PE
13030 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
13031 problem with latest <getopt.h>.
13032 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
13033
13034 * doc/fdl.texi: Upgrade to 1.2.
13035 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
13036 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
13037 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
13038 gnulib.
13039 * config/install-sh: Sync with autotools.
13040
13041 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
161a71f3 13042 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
13043 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
13044 locations are requested.
13045 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
13046 locations are requested.
13047
d0f3fe23
PE
130482002-12-12 Paul Eggert <eggert@twinsun.com>
13049
13050 Remove unportable casts and storage allocation tricks.
13051 While we're at it, remove almost all casts, since they
13052 usually aren't needed and are a sign of trouble.
13053
13054 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
13055
13056 * src/derives.c (derives_compute): Do not subtract NTOKENS from
13057 the pointer DSET returned by malloc; this isn't portable.
13058 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
13059 Similarly for DERIVES.
13060 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
13061 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
13062 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
13063
13064 * src/derives.c (derives_compute): Do not bother invoking
13065 int_of_rule_number, since rule numbers are integers.
13066
13067 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
13068 rather than XMALLOC (char, N).
13069
13070 * src/files.c (filename_split): Rewrite to avoid cast.
13071
13072 * src/gram.h (symbol_number_as_item_number,
13073 item_number_as_symbol_number, rule_number_as_item_number,
13074 item_number_as_rule_number):
13075 Now inline functions rather than macros, to avoid casts.
13076 * src/state.h (state_number_as_int): Likewise.
13077 * src/tables.c (state_number_to_vector_number,
13078 symbol_number_to_vector_number): Likewise.
13079
13080 * src/gram.h (int_of_rule_number): Remove; no longer used.
13081
13082 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
13083 since the resulting storage is always stored into.
13084
13085 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
13086 where it's needed.
13087
13088 * src/muscle_tab.c (muscle_m4_output):
13089 Now inline. Return bool, not int.
13090 * src/state.c (state_compare): Likewise.
13091 * src/symtab.c (symbol_check_defined,
13092 symbol_check_alias_consistency, symbol_pack, symbol_translation,
13093 hash_compare_symbol, hash_symbol):
13094 Likewise.
13095 * src/uniqstr.c (uniqstr_print): Likewise.
13096 * src/muscle_tab.c (muscle_m4_output_processor):
13097 New function, to avoid casts.
13098 * src/state.c (state_comparator, stage_hasher): Likewise.
13099 * src/symtab.c (symbol_check_defined_processor,
13100 symbol_check_alias_consistency_processor, symbol_pack_processor,
13101 symbol_translation_processor, hash_symbol_comparator,
13102 hash_symbol_hasher): Likewise.
13103 * src/uniqstr.c (uniqstr_print_processor): Likewise.
13104 * src/muscle_tab.c (muscles_m4_output):
13105 Use new functions instead of casting old functions unportably.
13106 * src/state.c (state_hash_new): Likewise.
13107 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
13108 symbols_token_translations_init):
13109 Likewise.
13110 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
13111
13112 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
13113 var instead of casting to long, to avoid casts.
13114 (prepare_states): Use MALLOC rather than alloca, so that we don't
13115 have to worry about alloca.
13116 * src/state.c (state_hash_lookup): Likewise.
13117
13118 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
13119 local var instead of casting to unsigned char, to avoid casts.
13120
13121 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
13122 STATE_ALLOC): Remove.
13123 (transitions_new, errs_new, reductions_new, state_new): Use malloc
13124 rather than calloc, and use offsetof to avoid allocating slightly
13125 too much storage.
13126 (state_new): Initialize all members.
13127
13128 * src/state.c (state_hash): Use unsigned accumulator, not signed.
13129
13130 * src/symtab.c (symbol_free): Remove; unused.
13131 (symbol_get): Remove cast in lhs of assignment.
13132 (symbols_do): Now static. Accept generic arguments, not
13133 hashing-related ones.
13134
13135 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
13136 (symbol_processor): Remove.
13137 (symbols_do): Remove decl; now static.
13138
13139 * src/system.h (alloca): Remove; decl no longer needed.
13140 (<stddef.h>): Include, for offsetof.
13141 (<inttypes.>, <stdint.h>): Include if available.
13142 (uintptr_t): New type, if system lacks it.
13143 (CALLOC, MALLOC, REALLOC): New macros.
13144 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
13145 new macros.
13146
13147 * src/tables.c (table_size): Now int, to pacify GCC.
13148 (table_grow, table_ninf_remap): Use signed table size.
13149 (save_row): Don't bother initializing locals when not needed.
13150 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
13151 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
13152
13153 * src/vcg.h: Correct misspellings.
13154
13155 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
13156
13157
13158 * src/getargs.c (getargs): Don't assume EOF == -1.
13159
26b4a969
PE
131602002-12-09 Paul Eggert <eggert@twinsun.com>
13161
13162 Change identifier spellings to avoid collisions with names
13163 that are reserved by POSIX.
13164
13165 Don't use names ending in _t, since POSIX reserves them.
13166 For consistency, remove _e and _s endings -- they're weren't
13167 needed to remove ambiguity. All uses changed.
13168 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
13169 turn was just renamed from struniq_t.
13170 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
13171 which in turn was just renamed from struniq_processor_t.
13172 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
13173 in turn was renamed from hash_compare_struniq_t.
13174 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
13175 (state_list): Renamed from state_list_t.
13176 * src/assoc.h (assoc): Renamed from assoc_t.
13177 * src/conflicts.c (enum conflict_resolution): Renamed from
13178 enum conflict_resolution_e.
13179 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
13180 (rule_list): Renamed from rule_list_t.
13181 * src/getargs.h (enum trace): Renamed from enum trace_e.
13182 (enum report): Renamed from enum report_e.
13183 * src/gram.h (item_number): Renamed from item_number_t.
13184 (rule_number): Renamed from rule_number_t.
13185 (struct rule_s): Remove the "rule_s" part; not used.
13186 (rule): Renamed from rule_t.
13187 (rule_filter): Renamed from rule_filter_t.
13188 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
13189 (goto_list): Renamed from goto_list_t.
13190 * src/lalr.h (goto_number): Renamed from goto_number_t.
13191 * src/location.h (location): Renamed from location_t.
13192 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
13193 and moved here from:
13194 * src/muscle_tab.h (muscle_entry_t): here.
13195 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
13196 (rule_list): Renamed from rule_list_t.
13197 * src/print_graph.c (static_graph): Renamed from graph.
13198 * src/reader.h (braced_code): Renamed from braced_code_t.
13199 Remove brace_code_e tag.
13200 * src/relation.h (relation_node): Renamed from relation_node_t.
13201 (relation_nodes): Renamed from relation_nodes_t.
13202 (relation): Renamed from relation_t.
13203 * src/state.h (state_number): Renamed from state_number_t.
13204 (struct state): Renamed from struct state_s.
13205 (state): Renamed from state_t.
13206 (transitions): Renamed from transitions_t. Unused (and
13207 misspelled) transtion_s tag removed.
13208 (errs): Renamed from errs_t. Unused errs_s tag removed.
13209 (reductions): Renamed from reductions_t. Unused tag
13210 reductions_s removed.
13211 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
13212 (struct symbol_list): Renamed from struct symbol_list_s.
13213 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
13214 (struct symbol): Renamed from struct symbol_s.
13215 (symbol): Renamed from symbol_t.
13216 * src/tables.c (vector_number): Renamed from vector_number_t.
13217 (action_number): Renamed from action_t.
13218 * src/tables.h (base_number): Renamed from base_t.
13219 * src/vcg.h (enum color): Renamed from enum color_e.
13220 (enum textmode): Renamed from enum textmode_e.
13221 (enum shape): Renamed from enum shape_e.
13222 (struct colorentry): Renamed from struct colorentry_s.
13223 (struct classname): Renamed from struct classname_s.
13224 (struct infoname): Renamed from struct infoname_s.
13225 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
13226 (enum decision): Renamed from enum decision_e.
13227 (enum orientation): Renamed from enum orientation_e.
13228 (enum alignment): Renamed from enum alignment_e.
13229 (enum arrow_mode): Renamed from enum arrow_mode_e.
13230 (enum crossing_type): Renamed from enum crossing_type_e.
13231 (enum view): Renamed from enum view_e.
13232 (struct node): Renamed from struct node_s.
13233 (node): Renamed from node_t.
13234 (enum linestyle): Renamed from enum linestyle_e.
13235 (enum arrowstyle): Renamed from enum arrowstyle_e.
13236 (struct edge): Renamed from struct edge.
13237 (edge): Renamed from edge_t.
13238 (struct graph): Renamed from struct graph_s.
13239 (graph): Renamed from graph_t.
13240 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
13241 Rename value_t -> value.
13242 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
13243 value_t_as_yystype -> value_as_yystype.
13244
13245 Don't include <errno.h> in the mainstream code, since it
13246 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
13247 * lib/get-errno.c, lib/get-errno.h: New files.
13248 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
13249 get-errno.c.
13250 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
13251 * src/output.c (output_skeleton): Likewise.
13252 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
13253 instead of errno.
13254 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
13255 Likewise.
13256 (handle_action_dollar, handle_action_at): Likewise.
13257 * src/system.h: Do not include <errno.h>.
13258 (TAB_EXT): Renamed from EXT_TAB.
13259 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
13260
13261 Avoid str[a-z]*, since <string.h> reserves that name space.
13262 Change all instances of "struniq" in names to "uniqstr", and
13263 likewise for "STRUNIQ" and "UNIQSTR".
13264 * src/uniqstr.c: Renamed from src/struniq.c.
13265 * src/uniqstr.h: Renamed from src/struniq.h.
13266 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
13267 * src/files.c (strsuffix): Remove; unused.
13268 (concat2): Renamed from stringappend. Now static.
13269 * src/files.h (strsuffix, stringappend): Remove; unused.
13270 * src/parse-gram.y (<chars>): Renamed from <string>.
13271 (<uniqstr>): Renamed from <struniq>.
13272 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
13273 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
13274 (struct graph_s.expand): Renamed from struct graph_s.stretch.
13275 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
13276 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
13277 (N_EXPAND): Renamed from N_STRETCH.
13278
13279 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
13280 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
13281 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
13282 Remove; unused.
13283 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
13284 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
13285 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
13286 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
13287 (BASE_MAXIMUM): Renamed from BASE_MAX.
13288 (BASE_MINIMUM): Renamed from BASE_MIN.
13289 (ACTION_MAX): Remove; unused.
13290 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
13291 Unnecessary casts removed from above defines.
13292
13293
13294 Fix misspelling in names.
13295 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
13296 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
13297 G_NODE_ALIGNEMENT.
13298
13299
13300 * lib/timevar.c (timevar_report): Renamed from time_report,
13301 for consistency with other names.
13302 * lib/timevar.h (timevar_report): New decl.
13303 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
13304
13305
13306 Sort include-file uses.
13307
13308 Reorder all include files under src to be in the order "system.h".
13309 then the ../lib include files in angle brackets (alphabetized),
13310 then the . include files in double-quotes (alphabetized). Fix
13311 dependency breakages encountered in this process, as follows:
13312 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
13313 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
13314 * src/state.h: Include "symtab.h".
13315
996b1c7e
PE
133162002-12-08 Paul Eggert <eggert@twinsun.com>
13317
13318 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
13319 since this causes problems when __file__ contains character
13320 sequences like "@" that are treated specially by src/scan-skel.l.
13321 Instead, just use the file's basename. This fixes the bug
13322 reported by Martin Mokrejs in
161a71f3 13323 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 13324
e19c4e5d
PE
133252002-12-06 Paul Eggert <eggert@twinsun.com>
13326
13327 Add support for rules that do not have trailing semicolons, as
13328 POSIX requires. Improve the quality of locations in Bison
13329 diagnostics.
26b4a969 13330
e19c4e5d
PE
13331 * src/location.c: Include <quotearg.h>.
13332 (empty_location): Now const.
13333 (location_print): New function. Follow the recommendation of the
13334 GNU Coding Standards for locations that span file boundaries.
13335 * src/location.h: Do not include <quotearg.h>; no longer needed.
13336 (boundary): New type.
13337 (location_t): Use it. This allows locations to span file boundaries.
13338 All member uses changed: file -> start.file or end.file (as needed),
13339 first_line -> start.line, first_column -> start.column,
13340 last_line -> end.line, last_column -> end.column.
13341 (equal_boundaries): New function.
13342 (LOCATION_RESET, LOCATION_STEP): Remove.
13343 (LOCATION_PRINT): Remove. All callers changed to use location_print.
13344 (empty_location): Now const.
13345 (location_print): New decl.
13346 * src/parse-gram.y (lloc_default): New function, which handles
13347 empty locations more accurately.
13348 (YYLLOC_DEFAULT): Use it.
13349 (%token COLON): Remove.
13350 (%token ID_COLON): New token.
26b4a969 13351 (rules): Use it.
e19c4e5d
PE
13352 (declarations, rules): Remove trailing semicolon.
13353 (declaration, rules_or_grammar_declaration):
13354 Allow empty (";") declaration.
13355 (symbol_def): Remove empty actions; no longer needed.
13356 (rules_or_grammar_declaration): Remove trailing semicolon.
13357 (semi_colon.opt): Remove.
13358 * src/reader.h: Include location.h.
13359 (scanner_cursor): New decl.
13360 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
13361 rolling our own.
13362 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
13363 of *loc.
13364 (STEP): Remove. No longer needed, now that adjust_location does
13365 the work. All uses removed.
13366 (scanner_cursor): New var.
13367 (adjust_location): Renamed from extend_location. It now sets
13368 *loc and adjusts the scanner cursor. All uses changed.
13369 Don't bother testing for CR.
13370 (handle_syncline): Remove location arg; now updates scanner cursor.
13371 All callers changed.
13372 (unexpected_end_of_file): Now accepts start boundary of token or
13373 comment, not location. All callers changed. Update scanner cursor,
13374 not the location.
13375 (SC_AFTER_IDENTIFIER): New state.
13376 (context_state): Renamed from c_context. All uses changed.
13377 (id_loc, code_start, token_start): New local vars.
13378 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
13379 processing of Yacc white space and equivalents here.
13380 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
13381 instead of returning ID immediately, since we need to search for
13382 a subsequent colon.
13383 (<INITIAL>"'", "\""): Save token_start.
13384 (<INITIAL>"%{", "{", "%%"): Save code_start.
13385 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
13386 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
13387 BEGIN context_state at end, not INITIAL.
13388 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
13389 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
13390 Return correct token start.
13391 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
13392 the start of a character, string or multiline comment is found.
13393 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
13394 Reduction): Adjust reported locations to match the more-precise
13395 results now expected.
13396 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
13397 * tests/reduce.at (Useless Rules, Reduced Automaton,
13398 Underivable Rules): Likewise.
13399 * tests/regression.at (Invalid inputs): No longer `expecting ";"
13400 or "|"' now that so many other tokens are allowed by the new grammar.
13401
13402 * src/complain.h (current_file): Remove duplicate decl;
13403 current_file is now owned by files.h.
13404 * src/complain.c, src/scan-gram.l: Include files.h.
13405
134062002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 13407
e19c4e5d
PE
13408 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
13409 promotes to int; it might be unsigned int.
13410 * data/yacc.c (yy_reduce_print): Likewise.
13411
13412 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
13413 be #defined in the prologue, not in the Bison declarations.
13414 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 13415
b64755e3
PE
134162002-12-02 Paul Eggert <eggert@twinsun.com>
13417
13418 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
13419 * lib/strtoul.c: New file, from gnulib.
13420 This fixes a porting bug reported by Peter Klein in
161a71f3 13421 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 13422
6e746484
PE
134232002-11-30 Paul Eggert <eggert@twinsun.com>
13424
b64755e3
PE
13425 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
13426 and put only a forward declaration in the prologue. This is for
13427 consistency with the other scanner helper functions.
13428
6ba55592
PE
13429 Type clashes now generate warnings, not errors, since it
13430 appears that POSIX may allow some grammars with type clashes.
13431 * src/reader.c (grammar_current_rule_check): Warn about
13432 type clashes instead of complaining.
13433 * tests/input.at (Type Clashes): Expect warnings, not complaints.
13434
6e746484
PE
13435 Add Yacc library, since POSIX requires it.
13436 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
13437 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
13438 * lib/main.c, lib/yyerror.c: New files.
13439
13440 gram_error can be static; it need not be extern.
13441 * src/reader.h (gram_error): Remove decl.
13442 * src/parse-gram.y (gram_error): Now static. Add static decl.
13443 (print_token_value): Omit parameter names from forward decl,
13444 for consistency.
13445
88510f9c
PE
134462002-11-29 Paul Eggert <eggert@twinsun.com>
13447
6e746484
PE
13448 * doc/bison.texinfo: Emphasize that yylex and yyerror must
13449 be declared before being used. E.g., one should typically
13450 declare them in the prologue. Use GNU coding style in examples.
13451 Put "const" consistently after the type it modifies. Mention
13452 that C99 supports "inline". Mention that yyerror traditionally
13453 returns "int".
13454
88510f9c
PE
13455 %parse-param and %lex-param now take just one argument, the
13456 declaration; the argument name is deduced from the declaration.
13457
13458 * doc/bison.texinfo (Parser Function, Pure Calling, Error
13459 Reporting, Table of Symbols): Document this.
13460 * src/parse-gram.y (add_param): New function.
13461 (COMMA): Remove.
13462 (declaration): Implement new rule for %parse-param and %lex-param.
13463 * src/scan-gram.l: "," now elicits a warning, rather than being
13464 a token; this is more compatible with byacc.
13465 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
13466
bb92250c
PE
134672002-11-27 Paul Eggert <eggert@twinsun.com>
13468
13469 Rename identifiers to avoid real and potential collisions.
13470
13471 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
13472 to avoid collision with lex macro described by Bruce Lilly in
161a71f3 13473 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
13474 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
13475 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
13476 * src/parse-gram.y (print_token_value): Renamed from yyprint.
13477 All uses changed.
13478 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
13479 The name "yycontrol" violates the name space rules, and this stuff
13480 wasn't being used anyway.
13481 (input): Remove action; this stuff wasn't being used.
13482 (gram_error): Rename local variable yylloc -> loc.
13483 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
13484 (YY_DECL): Don't use "yy" at start of local variables.
13485 All uses changed, e.g., yylloc -> loc.
13486 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
13487 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
13488 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
13489 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
13490
13491 * src/parse-gram.y (gram_error): loc is now const *.
13492 * src/reader.h (gram_error): Likewise.
13493
3af4feb2
PE
134942002-11-24 Paul Eggert <eggert@twinsun.com>
13495
13496 Version 1.75c.
13497
13498 * tests/actions.at (Actions after errors): Use an output format
13499 more similar to that of the Printers and Destructors test.
13500 Test the position of the ';' token too.
13501 (Printers and Destructors): Likewise.
13502 (Printers and Destructors: %glr-parser): Remove for now, to avoid
13503 unnecessarily alarming people when the test fails.
13504
13505 * data/yacc.c (yyerrlab1): Move this label down, so that the
13506 parser does not discard the lookahead token if the user code
13507 invokes YYERROR. This change is required for POSIX conformance.
13508
13509 * lib/error.c: Sync with gnulib.
13510
135112002-11-22 Paul Eggert <eggert@twinsun.com>
13512
13513 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
13514 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
13515 * lib/xmalloc.c: Likewise.
26b4a969 13516
58004308
PE
135172002-11-20 Paul Eggert <eggert@twinsun.com>
13518
13519 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
13520
135212002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 13522
58004308
PE
13523 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
13524 should use `if (! x) abort ();' rather than `assert (x);', and
13525 anyway it's one less thing to worry about configuring.
13526
13527 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
13528 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
13529 and replace all instances of assert with abort.
13530 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
13531 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
13532
13533 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
13534 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
13535 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
13536 hash_find_entry, hash_rehash, hash_insert): Likewise.
13537 * src/conflicts.c (resolve_sr_conflict): Likewise.
13538 * src/lalr.c (set_goto_map, map_goto): Likewise.
13539 * src/nullable.c (nullable_compute): Likewise.
13540 * src/output.c (prepare_rules, token_definitions_output): Likewise.
13541 * src/reader.c (packgram, reader): Likewise.
13542 * src/state.c (state_new, state_free, state_transitions_set,
13543 state_reduction_find): Likewise.
13544 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
13545 symbol_pack): Likewise.
13546 * src/tables.c (conflict_row, pack_vector): Likewise.
13547 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
13548 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
13549 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
13550 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
13551
13552 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
13553 (ARGMATCH_CONSTRAINT): New macro.
13554 (ARGMATCH_ASSERT): Use it.
13555
13556 * src/system.h (verify): New macro.
13557 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
13558 rather than assert.
13559 * src/tables.c (tables_generate): Likewise.
13560
13561 * src/struniq.c (struniq_assert): Now returns void, and aborts
13562 if the assertion is false.
13563 (struniq_assert_p): Remove.
13564 * src/struniq.h: Likewise.
13565
76ae8198
PE
135662002-11-18 Paul Eggert <eggert@twinsun.com>
13567
13568 * data/glr.c (yygetLRActions): Replace `yyindex' with
13569 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
13570 This fixes the regression with Sun ONE Studio 7 cc that I reported in
161a71f3 13571 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 13572
d3c4e709
AD
135732002-11-18 Akim Demaille <akim@epita.fr>
13574
13575 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
13576 space.
13577 From Tim Van Holder.
13578
8d8a7238
PE
135792002-11-17 Paul Eggert <eggert@twinsun.com>
13580
13581 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
13582 to "SyntaxError" for consistency with my 2002-11-15 change.
13583
13584 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
13585 not define to {}, since this breaks the common use of `YYDPRINTF
13586 ((...));' if a single statement is desired (e.g. before `else').
13587 Work around GCC warnings by surrounding corresponding calls with
13588 {} if needed.
13589 (yyhasResolvedValue): Remove unused function.
13590 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
13591 loop body.
13592 (yyreportSyntaxError): Renamed from yyreportParseError.
13593 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
13594 All uses changed.
13595 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
13596 extern when possible. Remove unused initializations.
13597
b0937b22
AD
135982002-11-16 Akim Demaille <akim@epita.fr>
13599
13600 Augment the similarity between GLR and LALR traces.
13601
13602 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
13603 (YY_REDUCE_PRINT): New.
13604 (yyparse): Use them.
13605 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
13606 YYDPRINT here.
13607 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
13608 state reached after the reduction/recovery, since...
13609 (yyparse, yyprocessOneStack): Report the state we are entering in.
13610
c5e3e510
AD
136112002-11-16 Akim Demaille <akim@epita.fr>
13612
13613 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
13614 Add support for --trace=skeleton.
13615 * src/scan-skel.l: %option debug.
13616 Scan strings of non-@ or \n instead of character by character.
13617 (scan_skel): Handle trace_skeleton.
13618 (QPUTS): New.
13619 (@output_parser_name@, @output_header_name@): ``Restore'' their
13620 support (used to be M4 macros).
13621 * data/yacc.c: Quote larger chunks, a la glr.c.
13622 * data/lalr1.cc: Likewise.
13623 The header guards are no longer available, so use some other
13624 string than `YYLSP_NEEDED'.
13625
4c6cc1db
AD
136262002-11-16 Akim Demaille <akim@epita.fr>
13627
13628 Make the ``Printers and Destructors'' test more verbose, taking
13629 `yacc.c''s behavior as (possibly wrong) reference.
13630
13631 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
13632 instead of fprint on stdout.
13633 Set and report the last_line of the symbols.
13634 Consistently display values and locations.
13635
6d9e8019
PE
136362002-11-16 Paul Eggert <eggert@twinsun.com>
13637
13638 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
13639
6e649e65
PE
136402002-11-15 Paul Eggert <eggert@twinsun.com>
13641
b25d88f6
PE
13642 * tests/actions.at (Actions after errors): New test case.
13643
6e649e65
PE
13644 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
13645 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
13646 tests/action.at, tests/calc.at, tests/conflicts.at,
13647 tests/cxx-type.at, tests/regression.at:
13648 "parse error" -> "syntax error" for POSIX compatibility.
13649 "parsing stack overflow..." -> "parser stack overflow" so
13650 that code matches Bison documentation.
13651
0f39aab9
AD
136522002-11-15 Akim Demaille <akim@epita.fr>
13653
13654 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
13655 take two BRACED_CODE, not two string_content.
13656 Free the scanner's obstack when we are done.
13657 (code_content): New.
13658 * tests/calc.at: Adjust.
13659 * doc/bison.texinfo: Adjust.
13660 Also, make sure to include the `,' for these declarations.
13661
761c1926
AD
136622002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
13663
13664 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
13665 definition; avoids potential autoreconf problems.
13666
b0f98b10
AD
136672002-11-15 Akim Demaille <akim@epita.fr>
13668
13669 Always check the value returned by yyparse.
13670
13671 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
13672 returned by yyparse.
13673 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
13674 Adjust calls.
13675 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
13676 returned by yyparse.
13677
970785f1
PH
136782002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13679
13680 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
13681 on input.at test.
13682
8fcc7db1
PE
136832002-11-14 Paul Eggert <eggert@twinsun.com>
13684
7ec1b48e
PE
13685 * src/output.c (output_skeleton): Call xfopen instead of
13686 duplicating xfopen's body.
13687
cfff7583 13688 Fix bugs reported by Nelson H. F. Beebe in
161a71f3 13689 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 13690
8fcc7db1
PE
13691 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
13692 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
13693 Group compiler. Instead, use "$CC -E bar.c". Include the .h
13694 file twice in the grammar, as an extra check.
13695
13696 * tests/input.at (Torturing the Scanner): Surround the
13697 backslash-newline tests with "#if 0", to make it less likely that
13698 we'll run into compiler bugs. Bring back solitary \ inside
13699 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 13700 test backslash-newline in C character constant.
8fcc7db1 13701
4e8d992c
AD
137022002-11-14 Akim Demaille <akim@epita.fr>
13703
13704 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
13705 status of the compiler.
f32b346d 13706 Calling `exit 1' is no longer needed.
4e8d992c
AD
13707 Reported by Nelson H. F. Beebe.
13708
9501dc6e
AD
137092002-11-14 Akim Demaille <akim@epita.fr>
13710
13711 * tests/atlocal.in (CPPFLAGS): We have config.h.
13712 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
13713 New.
13714 * tests/actions.at, tests/calc.at, tests/conflicts.at,
13715 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
13716 * tests/regression.at, tests/torture.at: Use them for all the
13717 grammars that are to be compiled.
13718 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
13719 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
13720 * doc/bison.texinfo (GLR Parsers): Document `inline'.
13721
18b519c0
AD
137222002-11-14 Akim Demaille <akim@epita.fr>
13723
13724 * doc/bison.texinfo: Various formatting changes (alignments in
13725 samples, additional @group/@end group, GCS in samples.
13726 Use @deffn instead of simple @table to define the directives,
13727 macros, variables etc.
13728
9a86cdb9
PE
137292002-11-13 Paul Eggert <eggert@twinsun.com>
13730
daa33def 13731 Fix some bugs reported by Albert Chin-A-Young in
161a71f3 13732 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 13733
daa33def 13734 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 13735 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
13736 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
13737 * tests/headers.at (export YYLTYPE): Likewise.
13738
13739 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 13740 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 13741
9a86cdb9
PE
13742 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
13743 comments, since they're not portable. Use GNU coding style.
13744
9c1e26bd
AD
137452002-11-13 Akim Demaille <akim@epita.fr>
13746
13747 * data/yacc.c: Leave bigger chunks of quoted text.
13748 (YYDSYMPRINTF): New.
13749 Use it to report symbol activities.
13750 * data/glr.c (YYDSYMPRINTF): New.
13751 Use it.
13752
87f721cc
PE
137532002-11-12 Paul Eggert <eggert@twinsun.com>
13754
13755 Version 1.75b.
13756
13757 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
13758 (yyglrReduce): Return yyok, not 0.
13759 This should avoid the enumerated-type warnings reported
464c6927 13760 by Nelson H. F. Beebe in
161a71f3 13761 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
13762
13763 * lib/bbitset.h (BITSET_INLINE): Remove.
13764 * lib/bitset.h [! BITSET_INLINE]: Remove.
13765 (bitset_set, bitset_reset, bitset_test): Rename local vars
13766 to avoid shadowing warnings by GCC.
13767
13768 * data/glr.c (inline): Remove #define. It's the user's
13769 responsibility to #define it away, just like 'const'.
464c6927 13770 This fixes one of the bugs reported by Nelson H. F. Beebe in
161a71f3 13771 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 13772
87f721cc
PE
13773 * Makefile.maint (po-check): Scan .l and .y files instead of the
13774 .c and the .h files that they generate. This fixes the bug
13775 reported by Tim Van Holder in:
161a71f3 13776 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
13777 Look for N_ as well as for _. Try to avoid matching #define for
13778 N_ and _.
13779 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
13780 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
13781 * src/scan-gram.l: Revamp regular expressions so that " and '
13782 do not confuse xgettext.
13783
13784 * src/struniq.h (struniq_new): Do not declare the return type
13785 to be 'const'; this violates the C standard.
13786 * src/struniq.c (struniq_new): Likewise.
13787
be14ade5
AD
137882002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
13789
13790 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
13791 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
13792 linker.
13793
05291fbc
AD
137942002-11-12 Akim Demaille <akim@epita.fr>
13795
13796 * Makefile.maint: Sync with Autoconf:
13797 (local_updates): New.
13798
1f5fd52e
AD
137992002-11-12 Akim Demaille <akim@epita.fr>
13800
13801 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
13802
283f1e64
AD
138032002-11-12 Akim Demaille <akim@epita.fr>
13804
13805 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
13806 locations.
13807
886b69d1
AD
138082002-11-12 Akim Demaille <akim@epita.fr>
13809
13810 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
13811 not yyvalue.
13812
3df37415
AD
138132002-11-12 Akim Demaille <akim@epita.fr>
13814
13815 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
13816 Use it to test the GLR parser.
13817
7bd6c77e
AD
138182002-11-12 Akim Demaille <akim@epita.fr>
13819
13820 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
13821 defines it.
13822 * data/glr.c (yystos): New.
13823 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
13824 (YYDSYMPRINT): New.
13825 (yyval): Don't define it, it is handled via M4.
13826 (yyrecoverParseError): Free verbosely the discarded symbols.
13827 * data/yacc.c (yysymprint): Remove, rather...
13828 (b4_yysymprint_generate): invoke.
13829 * data/c.m4 (b4_yysymprint_generate): New.
13830 Accept pointers as arguments, as opposed to the version from
13831 yacc.c.
13832 (b4_yydestruct_generate): Likewise.
13833 * tests/cations.at (Printers and Destructors): Use Bison directives
13834 instead of CPP macros.
13835 Don't rely on internal details.
13836
b0400cc6
AD
138372002-11-12 Akim Demaille <akim@epita.fr>
13838
13839 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
13840 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
13841 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
13842 it against YYEMPTY and so forth), work on yytoken (i.e., set
13843 it to YYEMPTY etc.).
13844 (yydestruct): Replace with a b4_yydestruct_generate invocation.
13845 (b4_symbol_actions): Remove.
13846 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
13847 for 0, end-of-input.
13848
72f889cc
AD
138492002-11-12 Akim Demaille <akim@epita.fr>
13850
13851 * doc/bison.texinfo (Destructor Decl): New.
13852
b1ae9233
AD
138532002-11-12 Akim Demaille <akim@epita.fr>
13854
13855 * src/tables.c (tables_generate): Use free for pointers that
13856 cannot be NULL, not XFREE.
13857 (pack_vector): Use assert, not fatal, for bound violations.
13858 * src/state.c (state_new): Likewise.
13859 * src/reader.c (reader): Likewise.
13860 * src/lalr.c (set_goto_map): Likewise.
72f889cc 13861 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
13862 the file name.
13863
7ec2d4cd
AD
138642002-11-12 Akim Demaille <akim@epita.fr>
13865
13866 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
13867 Restore.
13868 * src/scan-gram.l (last_string): Is global to the file, not to
13869 yylex.
13870 * src/parse-gram.y (input): Don't append the epilogue here,
13871 (epilogue.opt): do it here, and free the scanner's obstack.
13872 * src/reader.c (epilogue_set): Rename as...
13873 (epilogue_augment): this.
13874 * data/c.m4 (b4_epilogue): Defaults to empty.
13875
573a6cd3
AD
138762002-11-12 Akim Demaille <akim@epita.fr>
13877
13878 * src/getargs.c (long_options): Remove duplicates.
13879 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
13880 Remove.
13881 * doc/bison.rnh: Remove.
13882 * doc/bison.texinfo (VMS Invocation): Remove.
13883
95612cfa
AD
138842002-11-12 Akim Demaille <akim@epita.fr>
13885
13886 * src/struniq.h, src/struniq.c (struniq_t): Is const.
13887 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
13888
13889 Use struniq for symbols.
13890
13891 * src/symtab.h (symbol_t): The tag member is a struniq.
13892 (symbol_type_set): Adjust.
13893 * src/symtab.c (symbol_new): Takes a struniq.
13894 (symbol_free): Don't free the tag member.
13895 (hash_compare_symbol_t, hash_symbol_t): Rename as...
13896 (hash_compare_symbol, hash_symbol): these.
13897 Use the fact that tags as struniqs.
13898 (symbol_get): Use struniq_new.
13899 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
13900 Returns a strniq.
13901 * src/reader.h (merger_list, grammar_currentmerge_set): The name
13902 and type members are struniqs.
13903 * src/reader.c (get_merge_function)
13904 (grammar_current_rule_merge_set): Adjust.
13905 (TYPE, current_type): Are struniq.
13906
13907 Use struniq for file names.
13908
13909 * src/files.h, src/files.c (infile): Split into...
13910 (grammar_file, current_file): these.
13911 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
13912 * src/reduce.c (reduce_print): Likewise.
13913 * src/getargs.c (getargs): Likewise.
13914 * src/complain.h, src/complain.c: Likewise.
13915 * src/main.c (main): Call struniqs_new early enough to use it for
13916 file names.
13917 Don't free the input file name.
13918
3e6656f9
AD
139192002-11-12 Akim Demaille <akim@epita.fr>
13920
13921 * src/symtab.c (symbol_free): Remove dead deactivated code:
13922 type_name are properly removed.
13923 Don't use XFREE to free items that cannot be NULL.
13924 * src/struniq.h, src/struniq.c: New.
13925 * src/main.c (main): Initialize/free struniqs.
13926 * src/parse-gram.y (%union): Add astruniq member.
13927 (yyprint): Adjust.
13928 * src/scan-gram.l (<{tag}>): Return a struniq.
13929 Free the obstack bit that used to store it.
13930 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
13931
7672019c
PE
139322002-11-11 Paul Eggert <eggert@twinsun.com>
13933
13934 Revamp to fix many (but not all) of the C- and M4-related quoting
13935 problems. Among other things, this fixes the Bison bug reported
13936 by Jan Hubicka when processing the Bash grammar; see:
161a71f3 13937 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
13938
13939 Use new @ escapes consistently. Represent brackets with @{ and @}
13940 rather than @<:@ and @:>@, since this works a bit better with dumb
13941 editors like vi. Represent @ with @@, since @ is now consistently
13942 an escape. Use @oline@ and @ofile@ rather than __oline__ and
13943 __ofile__, to avoid unexpected expansions. Similarly, use @output
13944 rather than #output.
13945
13946 * data/c.m4 (b4_copyright): Omit file name from comment, since
13947 the file name could contain "*/".
13948 (b4_synclines_flag): Don't quote the 2nd argument; it should already
13949 be quoted. All uses changed.
13950
13951 * data/glr.c: Use new @ escapes consistently.
13952 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
13953 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
13954 Remove, since they couldn't handle arbitrary characters in file
13955 names.
13956 * data/lalr1.cc: Likewise.
13957 * data/yacc.c: Likewise.
13958
13959 * src/files.c (output_infix): Remove; all uses removed.
13960 * src/files.h: Likewise.
13961
13962 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
13963 mishandled funny characters in file names, and anyway it isn't
13964 needed any more.
13965 * data/yacc.c: Likewise.
13966 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
13967
13968 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
13969 * data/yacc.c: Likewise.
13970
13971 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
13972 strings now.
13973 (muscle_init): Quote filename as a C string.
13974 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
13975 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
13976 * src/output.c (escaped_file_name_output): New function.
13977 (prepare_symbols): Quote tokens for M4.
13978 (prepare): Don't insert output_infix, output_prefix,
13979 output_parser_name, output_header_name; this is now down by scan-skel.
13980 Insert skeleton as a C string.
13981
13982 * src/output.c (user_actions_output, symbol_destructors_output,
13983 symbol_printers_output): Quote filenames for C and M4.
13984 * src/reader.c (prologue_augment, epilogue_set): Likewise.
13985
13986 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
13987 escapes other than \\ and \'; this simplifies the code.
13988 (<SC_STRING>): Likewise, for \\ and \".
13989 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
13990 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
13991 Use new escapes @{ and @} for [ and ].
13992
13993 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
13994 them with auto vars.
13995 Switch to new escape scheme, where @ is the escape character uniformly.
13996 Abort if a stray escape character is found. Avoid unbounded input
13997 buffer when parsing non-escaped text.
13998
13999 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
14000 __oline__, #output, $@, and @{ do not have unintended meanings.
14001
acea4f3b
PE
140022002-11-09 Paul Eggert <eggert@twinsun.com>
14003
14004 Fix the test failure due to GCC warnings described in
161a71f3 14005 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
14006 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
14007 evaluate to 0 if it's impossible for NINF to be in the respective
14008 table.
14009 (yygetLRActions, yyrecoverParseError): Use them.
14010
14011 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
14012 counted in the token inserted at end of file. Now takes
14013 location_t *, not location_t, so that the location can be
14014 adjusted. All uses changed.
14015
14016 * tests/regression.at (Invalid inputs): Adjust wording in
14017 diagnostic to match the new behavior.
14018
14019 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
14020 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
14021 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
14022 abort ();'. This reduces the runtime of the "Many lookaheads"
14023 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
14024 GCC 3.2.
14025
20ef1ad5
PE
140262002-11-07 Paul Eggert <eggert@twinsun.com>
14027
14028 * src/parse-gram.y (CHARACTER): Remove unused token.
14029 All uses removed.
14030
14031 * src/scan-gram.l: Remove stack option. We no longer use the
14032 stack, since the stack was never deeper than 1; instead, use the
14033 new auto var c_context to record the stacked value.
14034
14035 Remove nounput option. At an unexpected end of file, we now unput
14036 the minimal input necessary to end cleanly; this simplifies the
14037 code.
14038
14039 Avoid unbounded token sizes where this is easy.
14040
14041 (unexpected_end_of_file): New function.
14042 Use it to systematize the error message on unexpected EOF.
14043 (last-string): Now auto, not static.
14044 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
14045 (scanner_last_string_free): Remove; not used.
14046 (percent_percent_count): Move decl to just before use.
14047 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
14048 not the (never otherwised-used) CHARACTER.
14049
93724f13
AD
140502002-11-07 Akim Demaille <akim@epita.fr>
14051
14052 Let yyerror always receive the msg as last argument, so that
14053 yyerror can be variadic.
14054
14055 * data/yacc.c (b4_yyerror_args): New.
14056 Use it when calling yyerror.
14057 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
14058 Use it when calling yyerror.
14059 * doc/bison.texinfo (Error Reporting): Adjust.
14060 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
14061 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
14062
6e40b4eb
AD
140632002-11-06 Akim Demaille <akim@epita.fr>
14064
14065 #line should have quoted strings.
14066 Ideally, this should be done by m4_quotearg.
14067
14068 * src/scan-skel.l: Include quotearg.h.
14069 Quote __ofile__.
14070 * src/output.c (symbol_printers_output)
14071 (symbol_destructors_output): Quote the file name.
14072
2dfbfc12
AD
140732002-11-06 Akim Demaille <akim@epita.fr>
14074
14075 * tests/regression.at (Invalid inputs): Adjust to the recent
14076 messages.
14077
437c2d80
AD
140782002-11-06 Akim Demaille <akim@epita.fr>
14079
14080 Restore --no-lines.
14081 Reported by Jim Kent.
14082
14083 * data/c.m4 (b4_syncline): New.
14084 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
14085 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
14086 * src/output.c (user_actions_output): Likewise.
14087 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 14088 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 14089
900c5db5
AD
140902002-11-06 Akim Demaille <akim@epita.fr>
14091
14092 * src/main.c (main): Free `infile'.
14093 * src/scan-gram.l (handle_syncline): New.
14094 Recognize `#line'.
14095 * src/output.c (user_actions_output, symbol_destructors_output)
14096 (symbol_printers_output): Use the location's file name, not
14097 infile.
14098 * src/reader.c (prologue_augment, epilogue_set): Likewise.
14099
e183b123 141002002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 14101
e183b123 14102 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 14103 either has GLR conflict entries.
e183b123 14104
193eb6b7
PE
141052002-11-05 Paul Eggert <eggert@twinsun.com>
14106
e183b123
PE
14107 * src/scan-gram.l: Use more accurate diagnostics, e.g.
14108 "integer out of range" rather than "invalid value".
14109 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
14110 accordingly.
14111
193eb6b7
PE
14112 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
14113 Also, remove one static variable in the scanner.
14114
14115 * src/scan-gram.l (braces_level): Now auto, not static.
14116 Initialize to zero if the compiler is being picky.
14117 (INITIAL): Clear braces_level instead of incrementing it.
14118 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
14119 as POSIX 1003.1-2001 requires.
14120 * src/system.h (IF_LINT): New macro, taken from coreutils.
14121 * configure.ac: Define "lint" if --enable-gcc-warnings.
14122
29c01725
AD
141232002-11-05 Akim Demaille <akim@epita.fr>
14124
14125 * src/scan-gram.l: When it starts with `%', complain about the
14126 whole directive, not just that `invalid character: %'.
14127
8aeac3ca
AD
141282002-11-04 Akim Demaille <akim@epita.fr>
14129
14130 * Makefile.maint: Update from Autoconf.
14131 (update, cvs-update, po-update, do-po-update): New.
14132
793a58bb
AD
141332002-11-04 Akim Demaille <akim@epita.fr>
14134
14135 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
14136 and yyerror.
14137 Have yyerror `use' its arguments.
14138 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
14139 returns true when location & yacc & pure & parse-param.
14140 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
14141
c4d720cd
AD
141422002-11-04 Akim Demaille <akim@epita.fr>
14143
14144 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
14145 clashes.
14146 * src/scan-gram.l: Use [\'] instead of ['] to pacify
14147 font-lock-mode.
14148 Use complain_at.
14149 Use quote, not quote_n since LOCATION_PRINT no longer uses the
14150 slot 0.
14151
613a0dc5
PE
141522002-11-03 Paul Eggert <eggert@twinsun.com>
14153
14154 * src/reader.c (get_merge_function, grammar_current_rule_check):
14155 Use consistent diagnostics for reporting type name clashes.
14156 Quote the types with <>, for consistency with Yacc.
14157 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
14158
2a8d363a
AD
141592002-11-03 Akim Demaille <akim@epita.fr>
14160
14161 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
14162 New.
14163 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
14164 (b4_parse_param): Remove.
14165 Use b4_identification.
14166 Propagate b4_pure_args where needed to pass them to yyerror.
14167 * data/glr.m4 (b4_parse_param): Remove.
14168 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
14169 (b4_lpure_formals): New.
14170 Use b4_identification.
14171 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
14172 b4_user_formals and b4_user_args.
14173 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
14174 (yyreportAmbiguity): When using a pure parser, also need
14175 the location, and the parse-params.
14176 Adjust callers.
14177 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
14178 When using a pure parser, also need the parse-params.
14179 Adjust callers.
14180 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
14181 (%pure-parser + %parse-param) LALR and GLR parsers.
14182 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
14183 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
14184 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
14185 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
14186 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
14187 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
14188 * doc/bison.texinfo: Untabify the whole file.
14189 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
14190 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
14191 (Error Reporting): Adjust to these new directives.
14192 Document %error-verbose, deprecate YYERROR_VERBOSE.
14193
9e32add8
AD
141942002-11-03 Akim Demaille <akim@epita.fr>
14195
14196 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
14197 AT_CHECK_CALC_GLR invocations to use % directives, instead of
14198 command line options.
14199 * tests/cxx-type.at: Formatting changes.
14200
b02d90a5
PE
142012002-11-03 Paul Eggert <eggert@twinsun.com>
14202
14203 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
14204 to count columns correctly, and to check for invalid inputs.
9e32add8 14205
b02d90a5
PE
14206 Use mbsnwidth to count columns correctly. Account for tabs, too.
14207 Include mbswidth.h.
14208 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
14209 (extend_location): New function.
14210 (YY_LINES): Remove.
14211
14212 Handle CRLF in C code rather than in Lex code.
14213 (YY_INPUT): New macro.
14214 (no_cr_read): New function.
14215
14216 Scan UCNs, even though we don't fully handle them yet.
14217 (convert_ucn_to_byte): New function.
14218
14219 Handle backslash-newline correctly in C code.
14220 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
14221 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
14222 all uses changed.
14223 (tag, splice): New EREs. Do not allow NUL or newline in tags.
14224 Use {splice} wherever C allows backslash-newline.
14225 YY_STEP after space, newline, vertical-tab.
14226 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 14227
b02d90a5
PE
14228 (letter, id): Don't assume ASCII; e.g., spell out a-z.
14229
14230 ({int}, handle_action_dollar, handle_action_at): Check for integer
14231 overflow.
9e32add8 14232
b02d90a5
PE
14233 (YY_STEP): Omit trailing semicolon, so that it's more like C.
14234
14235 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
14236 as well as \000. Check for UCHAR_MAX, not 255.
14237 Allow \x with an arbitrary positive number of digits, as in C.
14238 Check for overflow here.
14239 Allow \? and UCNs, for compatibility with C.
14240
14241 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
14242 with quote slot used by complain_at.
14243
14244 * tests/input.at: Add tests for backslash-newline, m4 quotes
14245 in symbols, long literals, and funny escapes in strings.
14246
14247 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
14248 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
14249 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
14250 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
14251 * m4/mbswidth.m4: New file, from GNU coreutils.
14252
14253 * doc/bison.texinfo (Grammar Outline): Document // comments.
14254 (Symbols): Document that trigraphs have no special meaning in Bison,
14255 nor is backslash-newline allowed.
14256 (Actions): Document that trigraphs have no special meaning.
14257
14258 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
14259 no longer used.
14260
142612002-11-02 Paul Eggert <eggert@twinsun.com>
14262
14263 * src/reader.c: Don't include quote.h; not needed.
14264 (get_merge_function): Reword warning to be consistent with
14265 type clash diagnostic in grammar_current_rule_check.
14266
14267 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
14268 bug in trigraph handling.
14269
14270 * src/output.c (prepare_symbols): When printing token names,
14271 escape "[" as "@<:@" and likewise for "]".
14272
14273 * src/system.h (errno): Remove declaration, as we are now
14274 assuming C89 or better, and C89 guarantees errno.
14275
762b212b
PE
142762002-10-30 Paul Eggert <eggert@twinsun.com>
14277
14278 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
14279 Check for close failures.
14280 * src/files.h (xfclose): Return void, not int, since it always
14281 returned zero.
14282 * src/files.c (xfclose): Likewise. Report I/O error if ferror
14283 indicates one.
14284 * src/output.c (output_skeleton): Use xfclose rather than fclose
14285 and ferror. xfclose now checks ferror.
14286
14287 * data/glr.c (YYLEFTMOST_STATE): Remove.
14288 (yyreportTree): Use a stack-based leftmost state. This avoids
14289 our continuing battles with bogus warnings about initializers.
14290
56100c60
AD
142912002-10-30 Akim Demaille <akim@epita.fr>
14292
14293 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
14294 #if.
14295
51b4a04c
PH
142962002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14297
14298 * tests/glr-regr1.at: New test for reported regressions.
14299 * tests/testsuite.at: Add glr-regr1.at test.
14300 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 14301
bf1ebda2
PE
143022002-10-24 Paul Eggert <eggert@twinsun.com>
14303
5c16c6b1
PE
14304 Version 1.75a.
14305
bf1ebda2
PE
14306 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
14307 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
14308 we use malloc. Don't assume 'A' through 'Z' are contiguous.
14309 Don't assume strdup exists; POSIX says its an XSI extension.
14310 Check for buffer overflow on input.
14311
b526ee61
AD
143122002-10-24 Akim Demaille <akim@epita.fr>
14313
14314 * src/output.c (output_skeleton): Don't disable M4sugar comments
14315 too soon: it results in comments being expanded.
14316 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
14317 first output.
14318
f1886bb2
AD
143192002-10-24 Akim Demaille <akim@epita.fr>
14320
14321 * data/yacc.c (m4_int_type): New.
14322 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
14323 char' as only yacc.c wants K&R portability.
14324 * data/glr.c (yysigned_char): Remove.
14325 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
14326 Reported by Quoc Peyrot.
14327
c5576256
PE
143282002-10-23 Paul Eggert <eggert@twinsun.com>
14329
14330 * src/main.c (main): With --trace=time, report times even if a
14331 non-fatal error occurs. Formerly, the times were reported in some
14332 such cases but not in others.
14333 * src/reader.c (reader): Just return if a complaint has been issued,
14334 instead of exiting, so that 'main' can report times.
14335
27b0ffea
AD
143362002-10-22 Akim Demaille <akim@epita.fr>
14337
14338 * src/system.h: Include sys/types.
14339 Reported by Bert Deknuydt.
14340
223a7883
PE
143412002-10-23 Paul Eggert <eggert@twinsun.com>
14342
14343 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
14344 Suggested by Art Haas.
14345
143462002-10-22 Paul Eggert <eggert@twinsun.com>
14347
14348 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
14349 decl; not needed any more.
14350 * src/main.c (main): Use return to exit, undoing yesterday's change.
14351 The last OS that we could find where this wouldn't work is
14352 SunOS 3.5, and that's too old to worry about now.
14353
14354 * data/glr.c (struct yyltype): Define members even when not
14355 doing locations. This is more consistent with yacc.c, and it
14356 works around the following bug reports:
161a71f3
PE
14357 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
14358 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 14359
223a7883
PE
14360 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
14361 @acronym consistently. Standardize on "Yacc" instead of "YACC",
14362 "Algol" instead of "ALGOL". Give a bit more history about BNF.
14363
8b76775a
AD
143642002-10-22 Akim Demaille <akim@epita.fr>
14365
14366 * data/README: New.
14367
6db10d14
PE
143682002-10-21 Paul Eggert <eggert@twinsun.com>
14369
14370 Be consistent about 'bool'; the old code used an enum in one
14371 module and an int in another, and this violates the C standard.
14372 * m4/stdbool.m4: New file, from coreutils 4.5.3.
14373 * configure.ac (AC_HEADER_STDBOOL): Add.
14374 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
14375 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
14376 * src/symtab.c (hash_compare_symbol_t): Likewise.
14377 * src/system.h (bool, false, true): Use a definition consistent
14378 with ../lib/hash.c. All uses changed.
14379
14380 * src/complain.c (warning_issued): Renamed from warn_message_count,
14381 so that we needn't worry about integer overflow (!).
14382 Now of type bool. All uses changed.
14383 (complaint_issued): Renamed from complain_message_count; likewise.
14384
14385 * src/main.c (main): Use exit to exit with failure.
27b0ffea 14386
6db10d14
PE
14387 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
14388 rather than 1 and 0.
14389 * src/main.c (main): Likewise.
14390 * src/getargs.c (getargs): Likewise.
14391 * src/reader.c (reader): Likewise.
14392
14393 * src/getarg.c (getargs): Remove duplicate code for
14394 "Try `bison --help'".
14395
14396 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
14397 What was that "2" for?
14398
14399 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
14400 * src/getargs.c (usage): Likewise.
14401
14402 * src/getargs.c (getargs): When there are too few operands, report
14403 the last one. When there are too many, report the first extra
14404 one. This is how diffutils does it.
14405
92a060fd
PE
144062002-10-20 Paul Eggert <eggert@twinsun.com>
14407
14408 Remove K&R vestiges.
14409 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
14410 * src/complain.c (VA_START): Remove. Assume prototypes.
14411 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
14412 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
14413 fatal): Assume prototypes.
14414 * src/complain.h: Assume prototypes.
14415 * src/system.h (PARAMS): Remove.
14416 Include <limits.h> unconditionally, since it's guaranteeed even
14417 for a freestanding C89 compiler.
14418 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
14419 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 14420
e7cb57c0
AD
144212002-10-20 Akim Demaille <akim@epita.fr>
14422
14423 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
14424 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
14425 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
14426 (yyresolveStates, yyresolveAction, yyresolveStack)
14427 (yyprocessOneStack): Use them.
14428 (yy_reduce_print): New.
14429 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
14430
0245f82d
AD
144312002-10-20 Akim Demaille <akim@epita.fr>
14432
14433 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
14434 arguments and output `void'.
14435 (b4_c_function): Rename as...
14436 (b4_c_function_def): this.
14437 (b4_c_function_decl, b4_c_ansi_function_def)
14438 (b4_c_ansi_function_decl): New.
14439 Change the interpretation of the arguments: before `int, foo', now
14440 `int foo, foo'.
14441 * data/yacc.c (yyparse): Prototype and define thanks to these.
14442 Adjust b4_c_function_def uses.
14443 * data/glr.c (yyparse): Likewise, but ANSI only.
14444
39912f52
AD
144452002-10-20 Akim Demaille <akim@epita.fr>
14446
14447 * src/output.c (prepare): Move the definition of `tokens_number',
14448 `nterms_number', `undef_token_number', `user_token_number_max'
14449 to...
14450 (prepare_tokens): Here.
14451 (prepare_tokens): Rename as...
14452 (prepare_symbols): this.
14453 (prepare): Move the definition of `rules_number' to...
14454 (prepare_rules): here.
14455 (prepare): Move the definition of `last', `final_state_number',
14456 `states_number' to...
14457 (prepare_states): here.
14458 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
14459
20c1e2ad
AD
144602002-10-20 Akim Demaille <akim@epita.fr>
14461
14462 * src/tables.h, src/tables.c, src/output.c: Comment changes.
14463
21964f43
AD
144642002-10-20 Akim Demaille <akim@epita.fr>
14465
14466 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
14467 * data/c.m4: here.
14468
66d30cd4
AD
144692002-10-20 Akim Demaille <akim@epita.fr>
14470
14471 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
14472 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
14473 `pair'.
14474 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
14475 `name' to...
14476 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
14477 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
14478 These.
14479
95f2c9fe
PE
144802002-10-19 Paul Eggert <eggert@twinsun.com>
14481
14482 Do not create a temporary file, as that involves security and
14483 cleanup headaches. Instead, use a pair of pipes.
14484 Derived from a suggestion by Florian Krohm.
14485 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
14486 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
14487 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
14488 (BISON_PREREQ_SUBPIPE): Add.
14489 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
14490 Add subpipe.h, subpipe.c.
14491 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
14492 * po/POTFILES.in: Add lib/subpipe.c.
14493 * src/output.c: Include "subpipe.h".
14494 (m4_invoke): Remove decl.
14495 (scan_skel): New decl.
14496 (output_skeleton): Use pipe rather than temporary file for m4 input.
14497 Check that m4sugar.m4 is readable, to avoid deadlock.
14498 Check for pipe I/O error.
14499 * src/scan-skel.l (readpipe): Remove decl.
14500 (scan_skel): New function, to be used in place of m4_invoke.
14501 Read from stream rather than file.
66d30cd4 14502
95f2c9fe
PE
14503 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
14504 float, as this generates a warning on Solaris 8 + GCC 3.2 with
14505 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
14506 this generates a more-accurate value anyway.
14507
14508 * lib/timevar.c (timervar_accumulate): Rename locals to
14509 avoid confusion with similarly-named more-global.
14510 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
14511
14512 * src/output.c (prepare): Use xstrdup to convert char const *
14513 to char *, to avoid GCC warning.
14514
c19988b7
AD
145152002-10-19 Akim Demaille <akim@epita.fr>
14516
14517 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
14518 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
14519 Use them to have `calc.y' ready for %pure-parser.
14520 * data/yacc.c (YYLEX): Pass a yylex return type to
14521 b4_c_function_call.
14522
ae7453f2
AD
145232002-10-19 Akim Demaille <akim@epita.fr>
14524
14525 Prototype support of %lex-param and %parse-param.
14526
14527 * src/parse-gram.y: Add the definition of the %lex-param and
14528 %parse-param tokens, plus their rules.
14529 Drop the `_' version of %glr-parser.
14530 Add the "," token.
14531 * src/scan-gram.l (INITIAL): Scan them.
14532 * src/muscle_tab.c: Comment changes.
14533 (muscle_insert, muscle_find): Rename `pair' as `probe'.
14534 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
14535 (muscle_entry_s): The `value' member is no longer const.
14536 Adjust all dependencies.
14537 * src/muscle_tab.c (muscle_init): Adjust: use
14538 MUSCLE_INSERT_STRING.
14539 Initialize the obstack earlier.
14540 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
14541 (muscle_pair_list_grow): New.
14542 * data/c.m4 (b4_c_function_call, b4_c_args): New.
14543 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
14544 * tests/calc.at: Use %locations, not --locations.
14545 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
14546
0e575721
AD
145472002-10-19 Akim Demaille <akim@epita.fr>
14548
14549 * src/getargs.c (usage): Take status as argument and exit
14550 accordingly.
14551 Report the traditional `Try ... --help' message when status != 0.
14552 (usage, version): Don't take a FILE * as arg, it is pointless.
14553 (getargs): When there is an incorrect number of arguments, make it
14554 an error, and report it GNUlically thanks to `usage ()'.
14555
724ce7f5
PE
145562002-10-18 Paul Eggert <eggert@twinsun.com>
14557
3a781eb2
PE
14558 * data/glr.c (yyreportParseError): Don't assume that sprintf
14559 yields the length of the printed string, as this is not true
14560 on SunOS 4.1.4. Reported by Peter Klein.
14561
724ce7f5
PE
14562 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
14563 * tests/conflicts.at (%nonassoc and eof): Likewise.
14564 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
14565
473d0a75
AD
145662002-10-17 Akim Demaille <akim@epita.fr>
14567
14568 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
14569 * src/getargs.c (trace_types, trace_args): Adjust.
14570 * src/reader.c (grammar_current_rule_prec_set)
14571 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
14572 Standardize error messages.
14573 And s/@prec/%prec/!
14574 (reader): Use trace_flag to enable scanner/parser debugging,
14575 instead of an adhoc scheme.
14576 * src/scan-gram.l: Remove trailing debugging code.
14577
e76d2469
PE
145782002-10-16 Paul Eggert <eggert@twinsun.com>
14579
93e2236a
PE
14580 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
14581 MUSCLE_TAB_H.
14582
e76d2469
PE
14583 * NEWS: Officially drop support for building Bison with K&R C,
14584 since it didn't work anyway and it's not worth worrying about.
14585 * Makefile.maint (wget_files): Remove ansi2knr.c.
14586 (ansi2knr.c-url_prefix): Remove.
14587 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
14588 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
14589 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
14590
5bd1c419
PE
145912002-10-15 Paul Eggert <eggert@twinsun.com>
14592
14593 Stop using the "enum_" trick for K&R-style function definitions;
14594 it confused me, and I was the author! Instead, assume that people
14595 who want to use K&R C compilers (when using these modules in GCC,
14596 perhaps?) will run ansi2knr.
14597
14598 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
14599 All uses of "enum_" changed to "enum ".
14600 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
14601 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 14602
5bd1c419
PE
14603 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
14604 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
14605 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
14606 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
14607 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
14608 abitset_not, abitset_ones, abitset_or, abitset_or_and,
14609 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
14610 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
14611 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
14612 Use function prototypes; this removes the need for declaring
14613 static functions simply to provide their prototypes.
14614 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
14615 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
14616 bitset_count_, bitset_create, bitset_dump, bitset_first,
14617 bitset_free, bitset_init, bitset_last, bitset_next,
14618 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
14619 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
14620 bitset_print, bitset_release_memory, bitset_toggle_,
14621 bitset_type_choose, bitset_type_get, bitset_type_name_get,
14622 debug_bitset): Likewise.
14623 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
14624 * lib/bitset_stats.c (bitset_log_histogram_print,
14625 bitset_percent_histogram_print, bitset_stats_and,
14626 bitset_stats_and_cmp, bitset_stats_and_or,
14627 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
14628 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
14629 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
14630 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
14631 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
14632 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
14633 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
14634 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
14635 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
14636 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
14637 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
14638 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
14639 bitset_stats_zero): Likewise.
14640 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
14641 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
14642 bitsetv_dump, debug_bitsetv): Likewise.
14643 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
14644 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
14645 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
14646 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
14647 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
14648 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
14649 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
14650 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
14651 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
14652 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
14653 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
14654 Likewise.
14655 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
14656 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
14657 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
14658 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
14659 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
14660 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
14661 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
14662 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
14663 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
14664 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
14665 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 14666
ae26e1f0
AD
146672002-10-14 Akim Demaille <akim@epita.fr>
14668
14669 Version 1.75.
14670
d43baf71
AD
146712002-10-14 Akim Demaille <akim@epita.fr>
14672
14673 * tests/Makefile.am (maintainer-check-posix): New.
14674
7ebc83e3
AD
146752002-10-14 Akim Demaille <akim@epita.fr>
14676
14677 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
14678 member.
14679
05846dae
AD
146802002-10-14 Akim Demaille <akim@epita.fr>
14681
14682 * src/tables.c (table_ninf_remap): base -> tab.
14683 Reported by Matt Rosing.
14684
1318e37d
PE
146852002-10-14 Paul Eggert <eggert@twinsun.com>
14686
447fbb17
PE
14687 * tests/action.at, tests/calc.at, tests/conflicts.at,
14688 tests/cxx-type.at, tests/headers.at, tests/input.at,
14689 tests/regression.at, tests/synclines.at, tests/torture.at:
14690 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
14691 so that the tests still work even if POSIXLY_CORRECT is set.
14692 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 14693
1318e37d
PE
14694 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
14695 for portability to K&R hosts. Fix typo: signed char is guaranteed
14696 only to 127, not to 128.
14697 * data/glr.c (yysigned_char): New type.
14698 * data/yacc.c (yysigned_char): Likewise.
14699 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
14700
cc0f0794
PE
147012002-10-13 Paul Eggert <eggert@twinsun.com>
14702
5038f418
PE
14703 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
14704 true due to limited range of data type" warning from GCC.
14705
cc0f0794
PE
14706 * data/c.m4 (b4_token_defines): Protect against double-inclusion
14707 by wrapping enum yytokentype's definition inside #ifndef
14708 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
14709
6fed0802
AD
147102002-10-13 Akim Demaille <akim@epita.fr>
14711
14712 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
14713 Un yy- yyrhs to avoid the name clash with the global YYRHS.
14714
32f0598d
AD
147152002-10-13 Akim Demaille <akim@epita.fr>
14716
14717 * Makefile.maint: Update from Autoconf 2.54.
14718 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
14719
7ea9a33f
AD
147202002-10-13 Akim Demaille <akim@epita.fr>
14721
14722 * src/print.c (print_state): Separate the list of solved conflicts
14723 from the other items.
14724 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
14725
ea99527d
AD
147262002-10-13 Akim Demaille <akim@epita.fr>
14727
14728 Let nondeterministic skeletons be usable with deterministic
14729 tables.
14730
14731 With the patch, GAWK compiled by GCC without -O2 passes its test
14732 suite using a GLR parser driven by LALR tables. It fails with -O2
14733 because `struct stat' gives two different answers on my machine:
14734 88 (definition of an auto var) and later 96 (memset on this var).
14735 Hence the stack is badly corrumpted. The headers inclusion is to
14736 blame: if I move the awk.h inclusion before GLR's system header
14737 inclusion, the two struct stat have the same size.
14738
14739 * src/tables.c (pack_table): Always create conflict_table.
14740 (token_actions): Always create conflict_list.
14741 * data/glr.c (YYFLAG): Remove, unused.
14742
f377f69f
AD
147432002-10-13 Akim Demaille <akim@epita.fr>
14744
14745 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
14746 (O0FLAGS): New.
14747 (VALGRIND, GXX): New.
14748 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
14749 * tests/bison.in: Run $PREBISON a pre-command.
14750 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
14751 (maintainer-check-g++): New.
14752 * Makefile.am (maintainer-check): New.
14753
2a1fe6ed
AD
147542002-10-13 Akim Demaille <akim@epita.fr>
14755
14756 * data/glr.c: Formatting changes.
14757 Tweak some trace messages to match yacc.c's.
14758
f50adbbd
AD
147592002-10-13 Akim Demaille <akim@epita.fr>
14760
14761 GLR parsers sometimes raise parse errors instead of performing the
14762 default reduction.
14763 Reported by Charles-Henry de Boysson.
14764
14765 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
ba0fe3c7 14766 check the length of the traces when %glr.
f50adbbd
AD
14767 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
14768 GLR's traces.
14769 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
14770 Test GLR parsers.
14771 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
14772 (yyltype): Remove the yy prefix from the member names.
14773 (yytable): Complete its comment.
14774 (yygetLRActions): Map error action number from YYTABLE from
14775 YYTABLE_NINF to 0.
14776 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
14777 (which was a bug: it should have been YYTABEL_NINF, and yet it was
14778 not satisfying as we could compare an YYACTION computed from
14779 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
14780 only value for error actions.
14781 (yyreportParseError): In verbose parse error messages, don't issue
14782 `error' in the list of expected tokens.
14783 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
14784 next action to perform to match glr.c's decoding.
14785 (yytable): Complete its comment.
14786
bcbad5b9
PE
147872002-10-13 Paul Eggert <eggert@twinsun.com>
14788
14789 Fix problem reported by Henrik Grubbstroem in
161a71f3 14790 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
14791 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
14792 because the Bison parser reads the second action before reducing
14793 the first one.
14794 * src/scan-gram.l (rule_length): New static var.
14795 Use it to keep track of the rule length in the scanner, since
14796 we can't expect the parser to be in lock-step sync with the scanner.
14797 (handle_action_dollar, handle_action_at): Use this var.
14798 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 14799
14904b89
PE
148002002-10-12 Paul Eggert <eggert@twinsun.com>
14801
1fe611e5
PE
14802 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
14803 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
14804 Include <sys/time.h> when checking for clock_t and struct tms.
14805 Use same include order as source.
14806 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
161a71f3 14807 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 14808
1fe611e5
PE
14809 * lib/timevar.c: Update copyright date and clarify comments.
14810 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 14811
1fe611e5
PE
14812 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
14813 GCC version as of today, then merge Bison's changes.
14814 Change "GCC" to "Bison" in copyright notice. timevar.def's
14815 author is Akim, so change that too.
14816
98194095
PE
14817 * src/reader.c (grammar_current_rule_check):
14818 Don't worry about the default action if $$ is untyped.
14819 Prevents bogus warnings reported by Jim Gifford in
161a71f3 14820 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 14821
14904b89
PE
14822 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
14823 * data/glr.c, data/lalr1.cc, data/yacc.c:
14824 Output token definitions before the first part of user declarations.
14825 Fixes compatibility problem reported by Jim Gifford for kbd in
161a71f3 14826 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 14827
ff6dca18
PE
148282002-10-11 Paul Eggert <eggert@twinsun.com>
14829
14830 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
14831 (yyparse): here. This undoes some of the 2002-07-25 change.
14832 Compatibility problem reported by Ralf S. Engelschall with
14833 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
14834
eb714592
AD
148352002-10-11 Akim Demaille <akim@epita.fr>
14836
14837 * tests/regression.at Characters Escapes): New.
14838 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
14839 characters.
14840 Reported by Jan Nieuwenhuizen.
14841
b7195100
AD
148422002-10-11 Akim Demaille <akim@epita.fr>
14843
14844 * po/id.po: New.
14845
f28a0f2d
PE
148462002-10-10 Paul Eggert <eggert@twinsun.com>
14847
14848 Portability fixes for bitsets; this also avoids several GCC
14849 warnings.
14850
14851 * lib/abitset.c: Include <stddef.h>, for offsetof.
14852 * lib/lbitset.c: Likewise.
14853
14854 * lib/abitset.c (abitset_bytes): Return a size that is aligned
14855 properly for vectors of objects. Do not assume that adding a
14856 header size to a multiple of a word size yields a value that is
14857 properly aligned for the whole union.
14858 * lib/bitsetv.c (bitsetv_alloc): Likewise.
14859
14860 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
14861 unique names for structures.
14862 * lib/ebitset.c (ebitset_bytes): Likewise.
14863 * lib/lbitset.c (lbitset_bytes): Likewise.
14864
14865 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
14866 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
14867 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
14868 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
14869 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
14870 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
14871 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
14872 to improve the type-checking that GCC can do.
14873 * lib/bitset.c (bitset_op4_cmp): Likewise.
14874 * lib/bitset_stats.c (bitset_stats_count,
14875 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
14876 bitset_stats_copy, bitset_stats_disjoint_p,
14877 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
14878 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
14879 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
14880 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
14881 bitset_stats_and_or_cmp, bitset_stats_andn_or,
14882 bitset_stats_andn_or_cmp, bitset_stats_or_and,
14883 bitset_stats_or_and_cmp): Likewise.
14884 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
14885 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
14886 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
14887 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
14888
14889 * lib/abitset.h: Include bitset.h, not bbitset.h.
14890 * lib/ebitset.h: Likewise.
14891 * lib/lbitset.h: Likewise.
14892
14893 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
14894 All instances of parameters of type enum bitset_opts are now of
14895 type enum_bitset_opts, to conform to the C Standard, and similarly
14896 for enum_bitset_type.
14897 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
14898 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
14899
14900 Do not use "struct bitset_struct" to mean different things in
14901 different modules. Not only is this confusing, it violates
14902 the C Standard, which requires that structure types in different
14903 modules must be compatible if one is to be passed to the other.
14904 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
14905 All instances of "struct bitset_struct *" replaced with "bitset".
14906 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
14907 (union bitset_union, struct abitset_struct, struct ebitset_struct,
14908 struct lbitset_struct, struct bitset_stats_struct): New types.
14909 All uses of struct bitset_struct changed to union bitset_union,
14910 etc.
ba0fe3c7 14911 * lib/abitset.c (struct abitset_struct, abitset,
f28a0f2d
PE
14912 struct bitset_struct): Remove.
14913 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
14914 struct bitset_struct): Remove.
14915 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
14916 bitset_struct): Remove.
14917 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
14918 Likewise.
14919
14920 Do not call a function of type T using a call that assumes the
14921 function is of a different type U. Standard C requires that a
14922 function must be called with a type that is compatible with its
14923 definition.
14924 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
14925 New decls.
14926 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
14927 New functions.
14928 * lib/ebitset.c (PFV): Remove.
14929 * lib/lbitset.c (PFV): Likewise.
14930 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
14931 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
14932 decls.
14933 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
14934 (ebitset_vtable): Use them.
14935 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
14936 lbitset_xor): New functions.
14937 (lbitset_vtable): Use them.
14938
14939 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
14940 Declare.
14941
14942 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
14943 GCC warning.
14944 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
14945 Use offsetof, for simplicity.
14946
6fbe4984
PE
149472002-10-06 Paul Eggert <eggert@twinsun.com>
14948
14949 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
14950 the same width as int. This reapplies a hunk of the 2002-08-12 patch
161a71f3 14951 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
14952 which was inadvertently undone by the 2002-09-30 patch.
14953 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
14954 the same width as int.
14955
420f93c8
PE
149562002-10-04 Paul Eggert <eggert@twinsun.com>
14957
14958 Version 1.50.
14959
14960 * configure.ac (AC_INIT), NEWS: Increment version number.
14961
14962 * doc/bison.texinfo: Minor spelling, grammar, and white space
14963 fixes.
14964 (Symbols): Mention that any negative value returned from yylex
14965 signifies end-of-input. Warn about negative chars. Mention
14966 the portable Standard C character set.
14967
14968 The GNU coding standard says CFLAGS and YFLAGS are reserved
14969 for the installer to set.
14970 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
14971 * src/Makefile.am (AM_CFLAGS): Likewise.
14972 (AM_YFLAGS): Renamed from YFLAGS.
14973
14974 Fix some MAX and MIN problems.
14975 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
14976 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
14977 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
14978 * src/reader.c (reader): Use it.
14979
14980 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
14981 POSIX 1003.1-2001 has removed fgrep.
14982
149832002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
14984
14985 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
14986 interpreted as signed.
14987 * lib/ebitset.c (ebitset_list): Fix bug.
14988
ff68026d
PE
149892002-10-01 Paul Eggert <eggert@twinsun.com>
14990
14991 More fixes for 64-bit hosts and large bitsets.
14992
14993 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
14994 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
14995 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
14996 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
14997 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
14998 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
14999 bitset_count_): Likewise.
15000 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
15001 bitset_first, bitset_last): Likewise.
15002 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
15003 bitset_stats_list_reverse, bitset_stats_size,
15004 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
15005 Likewise.
15006 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
15007 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
15008 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
15009 bitsetv_reflexive_transitive_closure): Likewise.
15010 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
15011 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
15012 Likewise.
15013 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
15014 Likewise.
420f93c8 15015
ff68026d
PE
15016 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
15017 Use size_t, not unsigned int, to count bytes.
15018 * lib/abitset.h (abitset_bytes): Likewise.
15019 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
15020 Likewise.
15021 * lib/bitset.h (bitset_bytes): Likewise.
15022 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
15023 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
15024 * lib/bitsetv.c (bitsetv_alloc): Likewise.
15025 * lib/ebitset.c (ebitset_bytes): Likewise.
15026 * lib/ebitset.h (ebitset_bytes): Likewise.
15027 * lib/lbitset.c (lbitset_bytes): Likewise.
15028 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 15029
ff68026d
PE
15030 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
15031 abitset_subset_p, abitset_disjoint_p, abitset_and,
15032 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
15033 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
15034 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
15035 abitset_or_and, abitset_or_and_cmp):
15036 Use bitset_windex instead of unsigned int.
15037 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
15038 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
15039 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
15040 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
15041 Likewise.
15042 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 15043
ff68026d
PE
15044 * lib/bitset.c (bitset_print):
15045 Use proper printf formats for widths of integer types.
15046 * lib/bitset_stats.c (bitset_percent_histogram_print,
15047 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
15048 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
15049 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
15050 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 15051
ff68026d
PE
15052 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
15053 BITSET_SIZE_MAX): New macros.
15054 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
15055 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
15056 to BITSET_WINDEX_MAX.
15057
15058 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
15059 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
15060 since we now return the bitset_bindex type (not int).
15061
15062 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
15063 when computing sizes.
15064 * lib/ebitset.c (ebitset_elts_grow): Likewise.
15065
15066 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
15067 and avoid cast to unsigned.
15068
6aa452a6
AD
150692002-09-30 Akim Demaille <akim@epita.fr>
15070
15071 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
15072 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
15073 Updates from Michael Hayes.
15074
927f7817
AD
150752002-09-30 Art Haas <ahaas@neosoft.com>
15076
15077 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
15078 invocations.
15079 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
15080 defined.
15081
9738f41e
AD
150822002-09-27 Akim Demaille <akim@epita.fr>
15083
15084 Version 1.49c.
15085
a5c75d7f
AD
150862002-09-27 Akim Demaille <akim@epita.fr>
15087
15088 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
15089 (Because of AC_LIBSOURCE).
15090
8280e179
AD
150912002-09-27 Akim Demaille <akim@epita.fr>
15092
15093 Playing with Autoscan.
15094
15095 * configure.ac: Remove the old LIBOBJ tweaks.
15096 (AC_REPLACE_FUNCS): Add strrchr and strtol.
15097 * lib/strrchr.c: New.
15098 * lib/strtol.c: New, from the Coreutils 4.5.1.
15099
ae64af35
AD
151002002-09-27 Akim Demaille <akim@epita.fr>
15101
15102 Playing with Autoscan.
15103
15104 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
15105 * lib/Makefile.am (libbison_a_SOURCES): No longer include
15106 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
15107 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
15108 Coreutils 4.5.1.
15109
d1a1114f
AD
151102002-09-24 Akim Demaille <akim@epita.fr>
15111
15112 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
15113 (Frequently Asked Questions, Parser Stack Overflow): New.
15114
b906441c
AD
151152002-09-13 Akim Demaille <akim@epita.fr>
15116
15117 Playing with autoscan.
15118
15119 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
15120 * src/files.c (skeleton_find): Remove, unused.
15121 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
15122 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
15123
bd701811
AD
151242002-09-13 Akim Demaille <akim@epita.fr>
15125
15126 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
15127 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
15128
e0a13e7b
AD
151292002-09-13 Akim Demaille <akim@epita.fr>
15130
15131 * configure.ac: Require 2.54.
15132 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
15133 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
15134 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
15135 Remove, provided by Autoconf macros.
15136
c97011bf
AD
151372002-09-12 Akim Demaille <akim@epita.fr>
15138
15139 * m4/prereq.m4: Update, from Coreutils 4.5.1.
15140
d862b1be
AD
151412002-09-12 Akim Demaille <akim@epita.fr>
15142
15143 * m4/prereq.m4: Update, from Fileutils 4.1.5.
15144 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
15145 Reported by Martin Mokrejs.
15146
3d38c03a
AD
151472002-09-10 Akim Demaille <akim@epita.fr>
15148
15149 * src/parse-gram.y: Associate a human readable string to each
15150 token type.
15151 * tests/regression.at (Invalid inputs): Adjust.
15152
b6347355
AD
151532002-09-10 Gary V. Vaughan <gary@gnu.org>
15154
15155 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
15156 with an Autoconf-2.5x style configure.ac.
15157
09ba4ab2
PE
151582002-09-06 Paul Eggert <eggert@twinsun.com>
15159
15160 * doc/bison.texinfo (Conditions): Make explicit that the GPL
15161 exception applies only to yacc.c. This is a modification of a
15162 patch originally suggested by Akim Demaille.
15163
21846f69
AD
151642002-09-06 Akim Demaille <akim@epita.fr>
15165
09ba4ab2
PE
15166 * data/c.m4 (b4_copyright): Move the GPL exception comment from
15167 here to...
15168 * data/yacc.c: here.
15169
21846f69
AD
15170 * data/lalr1.cc (struct yyltype): Don't define it, since we use
15171 LocationType.
15172 (b4_ltype): Default to yy::Location from location.hh.
15173
c0ad8bf3
AD
151742002-09-04 Jim Meyering <jim@meyering.net>
15175
15176 * data/yacc.c: Guard the declaration of yytoknum also with
15177 `#ifdef YYPRINT', so it is declared only when used.
15178
3a93251e
AD
151792002-09-04 Akim Demaille <akim@epita.fr>
15180
15181 * configure.in: Rename as...
15182 * configure.ac: this.
15183 Bump to 1.49c.
15184
427c0dda
AD
151852002-09-04 Akim Demaille <akim@epita.fr>
15186
15187 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
15188 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
15189 translate maintainer only messages.
15190
6a254321
PE
151912002-08-12 Paul Eggert <eggert@twinsun.com>
15192
645e30d1
PE
15193 Version 1.49b.
15194
6a254321
PE
15195 * Makefile.am (SUBDIRS): Remove intl.
15196 (DISTCLEANFILES): Remove.
15197 * NEWS: Mention that GNU M4 is now required. Clarify what is
15198 meant by "larger grammars". Mention the pt_BR translation.
15199 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
15200 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
15201 Bump version from 0.11.2 to 0.11.5.
15202 (BISON_PREREQ_STAGE): Remove.
15203 (AM_GNU_GETTEXT): Use external gettext.
15204 (AC_OUTPUT): Remove intl/Makefile.
15205
15206 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
15207
15208 * data/glr.c: Include string.h, for strlen.
15209 (yyreportParseError): Use size_t for yysize.
15210 (yy_yypstack): No longer nested inside yypstates, as nested
15211 functions are not portable. Do not assume size_t is the
15212 same width as int.
15213 (yypstates): Do not assume that ptrdiff_t is the same width
15214 as int, and similarly for yyposn and YYINDEX.
15215
15216 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
15217
15218 * lib/Makefile.am (INCLUDES): Do not include from the intl
15219 directory, which has been removed.
15220 * src/Makefile.am (INCLUDES): Likewise.
15221
15222 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
15223 (bitsets_sources, additional_bitsets_sources, timevars_sources):
15224 New vars.
15225
15226 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
15227 * tests/Makefile.am (EXTRA_DIST): Likewise.
15228
15229 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
15230 Do not assume that bitset_windex is the same width as unsigned.
15231
15232 * lib/abitset.c (abitset_unused_clear): Do not assume that
15233 bitset_word is the same width as int.
15234 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
15235 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
15236 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
15237 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
15238 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
15239
15240 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
15241 portability to one's complement hosts!).
15242 * lib/ebitset.c (ebitset_op1): Likewise.
15243 * lib/lbitset.c (lbitset_op1): Likewise.
15244
15245 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
15246 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
15247 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
15248 Sync with fileutils.
15249 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
15250 lib/gettext.h: Sync with diffutils.
15251
15252 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
15253 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
15254
15255 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
15256 PROTOTYPES to check for prototypes, and "defined __STDC__" to
15257 check for void *.
15258
15259 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
15260 size_t; the old version tried to do this but casted improperly.
15261 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
15262 (bitset_test): Now returns int, not unsigned long.
15263
15264 * lib/bitset_stats.c: Include "gettext.h".
15265 (_): New macro.
15266 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
15267 name locals "index", as it generates unnecessary warnings on some
15268 hosts that have an "index" function.
15269
15270 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
15271 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
15272 they need translation.
15273 * src/LR0.c (state_list_append, new_itemsets, get_state,
15274 append_states, generate_states): Likewise.
15275 * src/assoc.c (assoc_to_string): Likewise.
15276 * src/closure.c (print_closure, set_firsts, closure): Likewise.
15277 * src/gram.c (grammar_dump): Likewise.
15278 * src/injections.c (injections_compute): Likewise.
15279 * src/lalr.c (lookaheads_print): Likewise.
15280 * src/relation.c (relation_transpose): Likewise.
15281 * src/scan-gram.l: Likewise.
15282 * src/tables.c (table_grow, pack_vector): Likewise.
15283
15284 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
15285 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
15286 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
15287 * m4/mbstate_t.m4: Sync with fileutils.
15288 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
15289
15290 * po/LINGUAS: Add pt_BR.
15291 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
15292 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
15293 lib/timevar.c.
15294 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
15295 manual recommends.
15296 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
15297
15298 * src/complain.c (strerror_r): Remove decl; not needed.
15299 (strerror): Use same pattern as ../lib/error.c.
15300
15301 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
15302
15303 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
15304
15305 * src/main.c (main): Cast result of bindtextdomain and textdomain
15306 to void, to avoid a GCC warning when --disable-nls is in effect.
15307
15308 * src/scan-gram.l: Use strings rather than escapes when possible,
15309 to minimize the number of warnings from xgettext.
15310 (handle_action_dollar, handle_action_at): Don't use isdigit,
15311 as it mishandles negative chars and it may not work as expected
15312 outside the C locale.
15313
15314 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
15315 this is a GCC extension and is not portable to other compilers.
15316
15317 * src/system.h (alloca): Use same pattern as ../lib/error.c.
15318 Do not include <ctype.h>; no longer needed.
15319 Do not include <malloc.h>; no longer needed (and generates
15320 warnings on OpenBSD 3.0).
15321
15322 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
15323 it's not portable.
15324
15325 * tests/regression.at: Do not use 'cc -c input.c -o input';
15326 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
15327
15328 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
15329 exit status as failure, not just exit status 1. Sun C exits
15330 with status 2 sometimes.
15331
15332 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
15333 Use it for the two large tests.
15334
c8f002c7
AD
153352002-08-02 Akim Demaille <akim@epita.fr>
15336
15337 * src/conflicts.c (conflicts_output): Don't output rules never
15338 reduced here, since anyway that computation doesn't work.
15339 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
15340 (rule_useless_p, rule_never_reduced_p): New.
15341 (grammar_rules_partial_print): Use a filter instead of a range.
15342 Display the title only if needed.
15343 (grammar_rules_print): Adjust.
15344 (grammar_rules_never_reduced_report): New.
15345 * src/tables.c (action_row): Move the computation of rules never
15346 reduced to...
15347 (token_actions): here.
15348 * src/main.c (main): Make the parser before making the report, so
15349 that rules never reduced are computed.
15350 Call grammar_rules_never_reduced_report.
15351 * src/print.c (print_results): Report rules never reduced.
15352 * tests/conflicts.at, tests/reduce.at: Adjust.
15353
cd08e51e
AD
153542002-08-01 Akim Demaille <akim@epita.fr>
15355
15356 Instead of attaching lookaheads and duplicating the rules being
15357 reduced by a state, attach the lookaheads to the reductions.
15358
15359 * src/state.h (state_t): Remove the `lookaheads',
15360 `lookaheads_rule' member.
15361 (reductions_t): Add a `lookaheads' member.
15362 Use a regular array for the `rules'.
15363 * src/state.c (reductions_new): Initialize the lookaheads member
15364 to 0.
15365 (state_rule_lookaheads_print): Adjust.
15366 * src/state.h, src/state.c (state_reductions_find): New.
15367 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
15368 (count_rr_conflicts): Adjust.
15369 * src/lalr.c (LArule): Remove.
15370 (add_lookback_edge): Adjust.
15371 (state_lookaheads_count): New.
15372 (states_lookaheads_initialize): Merge into...
15373 (initialize_LA): this.
15374 (lalr_free): Adjust.
15375 * src/main.c (main): Don't free nullable and derives too early: it
15376 is used by --verbose.
15377 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
15378
bb0027a9
AD
153792002-08-01 Akim Demaille <akim@epita.fr>
15380
15381 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
15382 `rule_number_t**'.
15383 (set_derives, free_derives): Rename as...
15384 (derives_compute, derives_free): this.
15385 Adjust all dependencies.
15386 * src/nullable.c (set_nullable, free_nullable): Rename as...
15387 (nullable_compute, nullable_free): these.
15388 (rule_list_t): Store rule_t *, not rule_number_t.
15389 * src/state.c (state_rule_lookaheads_print): Directly compare rule
15390 pointers, instead of their numbers.
15391 * src/main.c (main): Call nullable_free, and derives_free earlier,
15392 as they were lo longer used.
15393
3325ddc4
AD
153942002-08-01 Akim Demaille <akim@epita.fr>
15395
15396 * lib/timevar.c (get_time): Include children time.
15397 * src/lalr.h (LA, LArule): Don't export them: used with the
15398 state_t.
15399 * src/lalr.c (LA, LArule): Static.
15400 * src/lalr.h, src/lalr.c (lalr_free): New.
15401 * src/main.c (main): Call it.
15402 * src/tables.c (pack_vector): Check whether loc is >= to the
15403 table_size, not >.
15404 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
15405 (tables_generate): do it, since that's also it which allocates
15406 them.
15407 Don't free LA and LArule, main does.
15408
c6f1a33c
AD
154092002-07-31 Akim Demaille <akim@epita.fr>
15410
15411 Separate parser tables computation and output.
15412
15413 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
15414 (conflict_list, conflict_list_cnt, table, check, table_ninf)
15415 (yydefgoto, yydefact, high): Move to...
15416 * src/tables.h, src/tables.c: here.
15417 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
15418 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
15419 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
15420 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
15421 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
15422 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
15423 (action_row, save_row, token_actions, save_column, default_goto)
15424 (goto_actions, sort_actions, matching_state, pack_vector)
15425 (table_ninf_remap, pack_table, prepare_actions): Move to...
15426 * src/tables.c: here.
15427 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
15428 * src/output.c (token_actions, output_base, output_conflicts)
15429 (output_check): Merge into...
15430 (prepare_actions): this.
15431 (actions_output): Rename as...
15432 (user_actions_output): this.
15433 * src/main.c (main): Call tables_generate and tables_free.
15434
1509d42f
AD
154352002-07-31 Akim Demaille <akim@epita.fr>
15436
15437 Steal GCC's --time-report support.
15438
15439 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
15440 stolen/adjusted from GCC.
15441 * m4/stage.m4: Remove time related checks.
15442 * m4/timevar.m4: New.
15443 * configure.in: Adjust.
15444 * src/system.h: Adjust to using timevar.h.
15445 * src/getargs.h, src/getargs.c: Support trace_time for
15446 --trace=time.
15447 * src/main.c (stage): Remove.
15448 (main): Replace `stage' invocations with timevar calls.
15449 * src/output.c: Insert pertinent timevar calls.
15450
273a74fa
AD
154512002-07-31 Akim Demaille <akim@epita.fr>
15452
15453 Let --trace have arguments.
15454
15455 * src/getargs.h (enum trace_e): New.
15456 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
15457 (long_options, short_options): --trace/-T takes an optional
15458 argument.
15459 Change all the uses of trace_flag to reflect the new flags.
15460 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
15461
15462 Strengthen `stage' portability.
15463
15464 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
15465 * configure.in: Use it.
15466 Don't check for malloc.h and sys/times.h.
15467 * src/system.h: Include them when appropriate.
15468 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
15469 times and struct tms are available.
15470
217598da
AD
154712002-07-30 Akim Demaille <akim@epita.fr>
15472
15473 In verbose parse error message, don't report `error' as an
15474 expected token.
15475 * tests/actions.at (Printers and Destructors): Adjust.
15476 * tests/calc.at (Calculator $1): Adjust.
15477 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
15478 error message, do not report the parser accepts the error token in
15479 that state.
15480
52489d44
AD
154812002-07-30 Akim Demaille <akim@epita.fr>
15482
15483 Normalize conflict related messages.
15484
15485 * src/complain.h, src/complain.c (warn, complain): New.
15486 * src/conflicts.c (conflicts_print): Use them.
15487 (conflict_report_yacc): New, extracted from...
15488 (conflicts_print): here.
15489 * tests/conflicts.at, tests/existing.at: Adjust.
15490
e8832397
AD
154912002-07-30 Akim Demaille <akim@epita.fr>
15492
15493 Report rules which are never reduced by the parser: those hidden
15494 by conflicts.
15495
15496 * src/LR0.c (save_reductions): Don't make the final state too
15497 different: save its reduction (accept) instead of having a state
15498 without any action (no shift or goto, no reduce).
15499 Note: the final state is now a ``regular'' state, i.e., the
15500 parsers now contain `reduce 0' as default reduction.
15501 Nevertheless, since they decide to `accept' when yystate =
15502 final_state, they still will not reduce rule 0.
15503 * src/print.c (print_actions, print_reduction): Adjust.
15504 * src/output.c (action_row): Track reduced rules.
15505 (token_actions): Report rules never reduced.
15506 * tests/conflicts.at, tests/regression.at: Adjust.
15507
caf23d24
AD
155082002-07-30 Akim Demaille <akim@epita.fr>
15509
15510 `stage' was accidently included in a previous patch.
15511 Initiate its autoconfiscation.
15512
15513 * configure.in: Look for malloc.h and sys/times.h.
15514 * src/main.c (stage): Adjust.
15515 Report only when trace_flag.
15516
640748ee
AD
155172002-07-29 Akim Demaille <akim@epita.fr>
15518
15519 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
15520 state_number_t.
15521 (errs_t): symbol_t*, not symbol_number_t.
15522 (reductions_t): rule_t*, not rule_number_t.
15523 (FOR_EACH_SHIFT): New.
15524 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
15525 * src/print.c, src/print_graph.c: Adjust.
15526
88bce5a2
AD
155272002-07-29 Akim Demaille <akim@epita.fr>
15528
15529 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
15530
15531 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
15532 (endtoken, accept): these.
15533 * src/reader.c (reader): Set endtoken's default tag to "$end".
15534 Set undeftoken's tag to "$undefined" instead of "$undefined.".
15535 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
15536 Adjust.
15537
1bfb97db
AD
155382002-07-29 Akim Demaille <akim@epita.fr>
15539
15540 * src/reduce.c (reduce_grammar): When the language is empty,
15541 complain about the start symbol, not the axiom.
15542 Use its location.
15543 * tests/reduce.at (Empty Language): New.
15544
fc5734fe
AD
155452002-07-26 Akim Demaille <akim@epita.fr>
15546
15547 * src/reader.h, src/reader.c (gram_error): ... can't get
15548 yycontrol without making too strong assumptions on the parser
15549 itself.
15550 * src/output.c (prepare_tokens): Use the real 0th value of
15551 token_translations instead of `0'.
15552 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
15553 visible here.
15554 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
15555 for the time being: %locations ought to provide it to yyerror.
15556
3650b4b8
AD
155572002-07-25 Akim Demaille <akim@epita.fr>
15558
15559 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
15560 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
15561 * tests/regression.at (Web2c Actions): Adjust.
15562
4b3d3a8e
AD
155632002-07-25 Akim Demaille <akim@epita.fr>
15564
15565 Stop storing rules from 1 to nrules + 1.
15566
15567 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
15568 * src/nullable.c, src/output.c, src/print.c, src/reader.c
15569 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
15570 Iterate from 0 to nrules.
15571 Use rule_number_as_item_number and item_number_as_rule_number.
15572 Adjust to `derive' now containing possibly 0.
15573 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
15574 Handle the `- 1' part in rule numbers from/to item numbers.
15575 * src/conflicts.c (log_resolution): Fix the message which reversed
15576 shift and reduce.
15577 * src/output.c (action_row): Initialize default_rule to -1.
15578 (token_actions): Adjust.
15579 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
15580 expected output.
15581 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
15582
4a2a22f4
AD
155832002-07-25 Akim Demaille <akim@epita.fr>
15584
15585 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
15586 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
15587 (b4_c_knr_arg_decl): New.
15588 * data/yacc.c: Use it to define yysymprint, yydestruct, and
15589 yyreport_parse_error.
15590
b8df3223
AD
155912002-07-25 Akim Demaille <akim@epita.fr>
15592
15593 * data/yacc.c (yyreport_parse_error): New, extracted from...
15594 (yyparse): here.
15595 (yydestruct, yysymprint): Move above yyparse.
15596 Be K&R compliant.
15597
a762e609
AD
155982002-07-25 Akim Demaille <akim@epita.fr>
15599
15600 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
15601 replace...
15602 (b4_sint_type, b4_uint_type): these.
15603 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
15604 * tests/regression.at (Web2c Actions): Adjust.
15605
12b0043a
AD
156062002-07-25 Akim Demaille <akim@epita.fr>
15607
15608 * src/gram.h (TIEM_NUMBER_MAX): New.
15609 (item_number_of_rule_number, rule_number_of_item_number): Rename
15610 as...
15611 (rule_number_as_item_number, item_number_as_rule_number): these.
15612 Adjust dependencies.
15613 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
15614 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
15615 (symbol_number_to_vector_number): New.
15616 (order): Of vector_number_t* type.
15617 (base_t, BASE_MAX, BASE_MIN): New.
15618 (froms, tos, width, pos, check): Of base_t type.
15619 (action_number_t, ACTION_MIN, ACTION_MAX): New.
15620 (actrow): Of action_number_t type.
15621 (conflrow): Of unsigned int type.
15622 (table_ninf, base_ninf): New.
15623 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
15624 (muscle_insert_int_table, muscle_insert_base_table)
15625 (muscle_insert_rule_number_table): New.
15626 (prepare_tokens): Output `toknum' as int_table.
15627 (action_row): Returns a rule_number_t.
15628 Use ACTION_MIN, not SHRT_MIN.
15629 (token_actions): yydefact is rule_number_t*.
15630 (table_ninf_remap): New.
15631 (pack_table): Use it for `base' and `table'.
15632 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
15633 replaced with...
15634 (YYPACT_NINF, YYTABLE_NINF): these.
15635 (yypact, yytable): Compute their types instead of hard-coded
15636 `short'.
15637 * tests/regression.at (Web2c Actions): Adjust.
15638
5dde258a
AD
156392002-07-19 Akim Demaille <akim@epita.fr>
15640
15641 * src/scan-gram.l (id): Can start with an underscore.
15642
a945ec39
AD
156432002-07-16 Akim Demaille <akim@epita.fr>
15644
15645 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
15646 Adjust all former `associativity' dependencies.
15647 * src/symtab.c (symbol_new): Default associativity is `undef', not
15648 `right'.
15649 (symbol_check_alias_consistence): Adjust.
15650
fae437e8
AD
156512002-07-09 Akim Demaille <akim@epita.fr>
15652
15653 * doc/bison.texinfo: Properly set the ``header'' part.
15654 Use @dircategory ``GNU programming tools'' as per Texinfo's
15655 documentation.
15656 Use @copying.
15657
1a715ef2
AD
156582002-07-09 Akim Demaille <akim@epita.fr>
15659
15660 * lib/quotearg.h: Protect against multiple inclusions.
15661 * src/location.h (location_t): Add a `file' member.
15662 (LOCATION_RESET, LOCATION_PRINT): Adjust.
15663 * src/complain.c (warn_at, complain_at, fatal_at): Drop
15664 `error_one_per_line' support.
15665
a5d50994
AD
156662002-07-09 Akim Demaille <akim@epita.fr>
15667
15668 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
15669 * src/reader.c (lineno): Remove.
15670 Adjust all dependencies.
15671 (get_merge_function): Take a location and use complain_at.
15672 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
15673 * tests/regression.at (Invalid inputs, Mixing %token styles):
15674 Adjust.
15675
b275314e
AD
156762002-07-09 Akim Demaille <akim@epita.fr>
15677
15678 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
15679 recovery rule, and forbid extensions when --yacc.
15680 (gram_error): Use complain_at.
15681 * src/reader.c (reader): Exit if there were parse errors.
15682
865b9df1
AD
156832002-07-09 Akim Demaille <akim@epita.fr>
15684
15685 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
15686 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
15687 Reported by R Blake <blakers@mac.com>.
15688
c76e14da
AD
156892002-07-09 Akim Demaille <akim@epita.fr>
15690
15691 * data/yacc.c: Output the copyright notive in the header.
15692
7db2ed2d
AD
156932002-07-03 Akim Demaille <akim@epita.fr>
15694
15695 * src/output.c (froms, tos): Are state_number_t.
15696 (save_column): sp, sp1, and sp2 are state_number_t.
15697 (prepare): Rename `final' as `final_state_number', `nnts' as
15698 `nterms_number', `nrules' as `rules_number', `nstates' as
15699 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
15700 unused.
15701 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
15702 * data/lalr1.cc (nsym_): Remove, unused.
15703
e68e0410
AD
157042002-07-03 Akim Demaille <akim@epita.fr>
15705
15706 * src/lalr.h, src/lalr.c (goto_number_t): New.
15707 * src/lalr.c (goto_list_t): New.
15708 Propagate them.
15709 * src/nullable.c (rule_list_t): New.
15710 Propagate.
15711 * src/types.h: Remove.
15712
e1a4f3a4
AD
157132002-07-03 Akim Demaille <akim@epita.fr>
15714
15715 * src/closure.c (print_fderives): Use rule_rhs_print.
15716 * src/derives.c (print_derives): Use rule_rhs_print.
15717 (rule_list_t): New, replaces `shorts'.
15718 (set_derives): Add comments.
15719 * tests/sets.at (Nullable, Firsts): Adjust.
15720
536545f3
AD
157212002-07-03 Akim Demaille <akim@epita.fr>
15722
15723 * src/output.c (prepare_actions): Free `tally' and `width'.
15724 (prepare_actions): Allocate and free `order'.
15725 * src/symtab.c (symbols_free): Free `symbols'.
15726 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
15727 * src/output.c (m4_invoke): Move to...
15728 * src/scan-skel.l: here.
15729 (<<EOF>>): Close yyout, and free its name.
15730
8b752b00
AD
157312002-07-03 Akim Demaille <akim@epita.fr>
15732
15733 Fix some memory leaks, and fix a bug: state 0 was examined twice.
15734
15735 * src/LR0.c (new_state): Merge into...
15736 (state_list_append): this.
15737 (new_states): Merge into...
15738 (generate_states): here.
15739 (set_states): Don't ensure a proper `errs' state member here, do it...
15740 * src/conflicts.c (conflicts_solve): here.
15741 * src/state.h, src/state.c: Comment changes.
15742 (state_t): Rename member `shifts' as `transitions'.
15743 Adjust all dependencies.
15744 (errs_new): For consistency, also take the values as argument.
15745 (errs_dup): Remove.
15746 (state_errs_set): New.
15747 (state_reductions_set, state_transitions_set): Assert that no
15748 previous value was assigned.
15749 (state_free): New.
15750 (states_free): Use it.
15751 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
15752 temporary storage: use `errs' and `nerrs' as elsewhere.
15753 (set_conflicts): Allocate and free this `errs'.
15754
613f5e1a
AD
157552002-07-02 Akim Demaille <akim@epita.fr>
15756
15757 * lib/libiberty.h: New.
15758 * lib: Update the bitset implementation from upstream.
15759 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
15760 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
15761 * src/main.c: Adjust bitset stats calls.
15762
26e0cadc
PE
157632002-07-01 Paul Eggert <eggert@twinsun.com>
15764
15765 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
15766 char, so that negative chars don't collide with $.
15767
1154cced
AD
157682002-06-30 Akim Demaille <akim@epita.fr>
15769
15770 Have the GLR tests be `warning' checked, and fix the warnings.
15771
15772 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
15773 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
15774 (yyremoveDeletes): `yyi' and `yyj' are size_t.
15775 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
15776 (yyaddDeferredAction): static.
15777 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
15778 (yyreportParseError): yyprefix is const.
15779 yytokenp is used only when verbose.
15780 (yy__GNUC__): Replace with __GNUC__.
15781 (yypdumpstack): yyi is size_t.
15782 (yypreference): Un-yy local variables and arguments, to avoid
15783 clashes with `yyr1'. Anyway, we are not in the user name space.
15784 (yytname_size): be an int, as is compared with ints.
15785 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
15786 Use them.
15787 * tests/cxx-gram.at: Use quotation to protect $1.
15788 Use AT_COMPILE to enable warnings hunts.
15789 Prototype yylex and yyerror.
15790 `Use' argc.
15791 Include `string.h', not `strings.h'.
15792 Produce and prototype stmtMerge only when used.
15793 yylex takes a location.
15794
97650f4e
AD
157952002-06-30 Akim Demaille <akim@epita.fr>
15796
15797 We spend a lot of time in quotearg, in particular when --verbose.
15798
15799 * src/symtab.c (symbol_get): Store a quoted version of the key.
15800 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
15801 Adjust all callers.
15802
d2576365
AD
158032002-06-30 Akim Demaille <akim@epita.fr>
15804
15805 * src/state.h (reductions_t): Rename member `nreds' as num.
15806 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
15807 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
15808
ccaf65bc
AD
158092002-06-30 Akim Demaille <akim@epita.fr>
15810
15811 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
15812 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
15813 (shifts_to): Rename as...
15814 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
15815 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
15816 (TRANSITION_IS_DISABLED, transitions_to): these.
15817
87675353
AD
158182002-06-30 Akim Demaille <akim@epita.fr>
15819
15820 * src/print.c (print_shifts, print_gotos): Merge into...
15821 (print_transitions): this.
15822 (print_transitions, print_errs, print_reductions): Align the
15823 lookaheads columns.
15824 (print_core, print_transitions, print_errs, print_state,
15825 print_grammar): Output empty lines separator before, not after.
15826 (state_default_rule_compute): Rename as...
15827 (state_default_rule): this.
15828 * tests/conflicts.at (Defaulted Conflicted Reduction),
15829 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
15830 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
15831
ce4ccb4b
AD
158322002-06-30 Akim Demaille <akim@epita.fr>
15833
15834 Display items as we display rules.
15835
15836 * src/gram.h, src/gram.c (rule_lhs_print): New.
15837 * src/gram.c (grammar_rules_partial_print): Use it.
15838 * src/print.c (print_core): Likewise.
15839 * tests/conflicts.at (Defaulted Conflicted Reduction),
15840 (Unresolved SR Conflicts): Adjust.
15841 (Unresolved SR Conflicts): Adjust and rename as...
15842 (Resolved SR Conflicts): this, as was meant.
15843 * tests/regression.at (Web2c Report): Adjust.
15844
bc933ef1
AD
158452002-06-30 Akim Demaille <akim@epita.fr>
15846
15847 * src/print.c (state_default_rule_compute): New, extracted from...
15848 (print_reductions): here.
15849 Pessimize, but clarify the code.
15850 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
15851
53d4308d
AD
158522002-06-30 Akim Demaille <akim@epita.fr>
15853
15854 * src/output.c (action_row): Let default_rule be always a rule
15855 number.
15856
574fb2d5
AD
158572002-06-30 Akim Demaille <akim@epita.fr>
15858
15859 * src/closure.c (print_firsts, print_fderives, closure):
15860 Use BITSET_EXECUTE.
15861 * src/lalr.c (lookaheads_print): Likewise.
15862 * src/state.c (state_rule_lookaheads_print): Likewise.
15863 * src/print_graph.c (print_core): Likewise.
15864 * src/print.c (print_reductions): Likewise.
15865 * src/output.c (action_row): Likewise.
15866 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
15867
05811fd7
AD
158682002-06-30 Akim Demaille <akim@epita.fr>
15869
15870 * src/print_graph.c: Use report_flag.
15871
0e4d5753
AD
158722002-06-30 Akim Demaille <akim@epita.fr>
15873
15874 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
15875 to...
15876 * src/relation.h, src/relation.c (traverse, relation_digraph)
15877 (relation_print, relation_transpose): New.
15878
24c7d800
AD
158792002-06-30 Akim Demaille <akim@epita.fr>
15880
15881 * src/state.h, src/state.c (shifts_to): New.
15882 * src/lalr.c (build_relations): Use it.
15883
9222837b
AD
158842002-06-30 Akim Demaille <akim@epita.fr>
15885
15886 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
15887 (item_number_of_rule_number, rule_number_of_item_number): New.
15888 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
15889 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
15890 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
15891 Propagate their use.
15892 Much remains to be done, in particular wrt `shorts' from types.h.
15893
260008e5
AD
158942002-06-30 Akim Demaille <akim@epita.fr>
15895
15896 * src/symtab.c (symbol_new): Initialize the `printer' member.
15897
8a731ca8
AD
158982002-06-30 Akim Demaille <akim@epita.fr>
15899
15900 * src/LR0.c (save_reductions): Remove, replaced by...
15901 * src/state.h, src/state.c (state_reductions_set): New.
15902 (reductions, errs): Rename as...
15903 (reductions_t, errs_t): these.
15904 Adjust all dependencies.
15905
32e1e0a4
AD
159062002-06-30 Akim Demaille <akim@epita.fr>
15907
15908 * src/LR0.c (state_list_t, state_list_append): New.
15909 (first_state, last_state): Now symbol_list_t.
15910 (this_state): Remove.
15911 (new_itemsets, append_states, save_reductions): Take a state_t as
15912 argument.
15913 (set_states, generate_states): Adjust.
15914 (save_shifts): Remove, replaced by...
15915 * src/state.h, src/state.c (state_shifts_set): New.
15916 (shifts): Rename as...
15917 (shifts_t): this.
15918 Adjust all dependencies.
15919 * src/state.h (state_t): Remove the `next' member.
15920
e5fb6710
AD
159212002-06-30 Akim Demaille <akim@epita.fr>
15922
15923 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
15924 escaped in slot 0.
15925
c7ca99d4
AD
159262002-06-30 Akim Demaille <akim@epita.fr>
15927
15928 Use hash.h for the state hash table.
15929
15930 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
15931 (allocate_storage): Use state_hash_new.
15932 (free_storage): Use state_hash_free.
15933 (new_state, get_state): Adjust.
15934 * src/lalr.h, src/lalr.c (states): Move to...
15935 * src/states.h (state_t): Remove the `link' member, no longer
15936 used.
15937 * src/states.h, src/states.c: here.
15938 (state_hash_new, state_hash_free, state_hash_lookup)
15939 (state_hash_insert, states_free): New.
15940 * src/states.c (state_table, state_compare, state_hash): New.
15941 * src/output.c (output_actions): Do not free states now, since we
15942 still need to know the final_state number in `prepare', called
15943 afterwards. Do it...
15944 * src/main.c (main): here: call states_free after `output'.
15945
df0e7316
AD
159462002-06-30 Akim Demaille <akim@epita.fr>
15947
15948 * src/state.h, src/state.c (state_new): New, extracted from...
15949 * src/LR0.c (new_state): here.
15950 * src/state.h (STATE_ALLOC): Move to...
15951 * src/state.c: here.
15952 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
15953 * src/state.h, src/state.c: here.
15954
39f41916
AD
159552002-06-30 Akim Demaille <akim@epita.fr>
15956
15957 * src/reader.c (gensym): Rename as...
15958 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
15959 (getsym): Rename as...
15960 (symbol_get): this.
15961
d57650a5
AD
159622002-06-30 Akim Demaille <akim@epita.fr>
15963
15964 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
15965 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
15966 * src/output.c, src/print.c, src/print_graph.c: Propagate.
15967 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
15968
5a08f1ce
AD
159692002-06-30 Akim Demaille <akim@epita.fr>
15970
15971 Make the test suite pass with warnings checked.
15972
15973 * tests/actions.at (Printers and Destructors): Improve.
15974 Avoid unsigned vs. signed issues.
15975 * tests/calc.at: Don't exercise the scanner here, do it...
15976 * tests/input.at (Torturing the Scanner): here.
15977
720623af
PH
159782002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15979
88e7e941 15980 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
15981 reorganize first lines parallel to yacc.c.
15982
fb8135fa
AD
159832002-06-28 Akim Demaille <akim@epita.fr>
15984
15985 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
15986 (b4_token_enum, b4_token_defines): New, factored from...
15987 * data/lalr1.cc, data/yacc.c, glr.c: here.
15988
41442480
AD
159892002-06-28 Akim Demaille <akim@epita.fr>
15990
15991 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
15992 unused variables.
15993 * src/output.c (merger_output): static.
15994
e0e5bf84
AD
159952002-06-28 Akim Demaille <akim@epita.fr>
15996
ba0fe3c7 15997 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
e0e5bf84
AD
15998 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
15999 pacify GCC.
16000 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 16001
676385e2
PH
160022002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16003
16004 Accumulated changelog for new GLR parsing features.
16005
6a254321 16006 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
16007 conflicts_total_count.
16008 * src/conflicts.h: Ditto.
16009 * src/output.c (token_actions): Use the new name.
16010 (output_conflicts): Change conflp => conflict_list_heads, and
16011 confl => conflict_list for better readability.
16012 * data/glr.c: Use the new names.
16013 * NEWS: Add self to GLR announcement.
e0e5bf84 16014
676385e2
PH
16015 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
16016
16017 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
16018 Akim Demaille.
16019
16020 * data/bison.glr: Change name to glr.c
16021 * data/glr.c: Renamed from bison.glr.
16022 * data/Makefile.am: Add glr.c
e0e5bf84
AD
16023
16024 * src/getargs.c:
16025
676385e2 16026 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
ba0fe3c7 16027 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 16028
676385e2
PH
16029 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16030
16031 * data/bison.glr: Be sure to restore the
16032 current #line when returning to the skeleton contents after having
16033 exposed the input file's #line.
16034
16035 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16036
16037 * data/bison.glr: Bring up to date with changes to bison.simple.
16038
16039 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16040
16041 * data/bison.glr: Correct definitions that use b4_prefix.
16042 Various reformatting.
16043 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
16044 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
16045 yytokenp argument; now part of stack.
16046 (yychar): Define to behave as documented.
16047 (yyclearin): Ditto.
e0e5bf84 16048
676385e2
PH
16049 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16050
16051 * src/reader.h: Add declaration for free_merger_functions.
16052
16053 * src/reader.c (merge_functions): New variable.
16054 (get_merge_function): New function.
16055 (free_merger_functions): New function.
16056 (readgram): Check for %prec that is not followed by a symbol.
16057 Handle %dprec and %merge declarations.
16058 (packgram): Initialize dprec and merger fields in rules array.
16059
16060 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
16061 conflict_list_cnt, conflict_list_free): New variables.
16062 (table_grow): Also grow conflict_table.
e0e5bf84 16063 (prepare_rules): Output dprec and merger tables.
676385e2 16064 (conflict_row): New function.
e0e5bf84 16065 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
16066 default reduction in conflicted states for GLR parser so that there
16067 are spaces for the conflict lists.
16068 (save_row): Also save conflict information.
16069 (token_actions): Allocate conflict list.
16070 (merger_output): New function.
16071 (pack_vector): Pack conflict table, too.
16072 (output_conflicts): New function to output yyconflp and yyconfl.
16073 (output_check): Allocate conflict_tos.
16074 (output_actions): Output conflict tables, also.
16075 (output_skeleton): Output b4_mergers definition.
16076 (prepare): Output b4_max_rhs_length definition.
16077 Use 'bison.glr' as default skeleton for GLR parsers.
16078
16079 * src/gram.c (glr_parser): New flag.
16080 (grammar_free): Call free_merger_functions.
16081
16082 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
16083 all pairs of conflicting reductions, rather than just all tokens
16084 causing conflicts. Needed to size conflict tables.
e0e5bf84 16085 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
16086 interface.
16087 (conflicts_print): Ditto.
16088 (count_total_conflicts): New function.
16089
16090 * src/reader.h (merger_list): New type.
16091 (merge_functions): New variable.
16092
16093 * src/lex.h (tok_dprec, tok_merge): New token types.
16094
16095 * src/gram.h (rule_s): Add dprec and merger fields.
16096 (glr_parser): New flag.
16097
16098 * src/conflicts.h (count_total_conflicts): New function.
16099
16100 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
16101
16102 * doc/bison.texinfo (Generalized LR Parsing): New section.
16103 (GLR Parsers): New section.
16104 (Language and Grammar): Mention GLR parsing.
16105 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
16106 Correct typo ("tge" -> "the").
16107
16108 * data/bison.glr: New skeleton for GLR parsing.
16109
16110 * tests/cxx-gram.at: New tests for GLR parsing.
16111
16112 * tests/testsuite.at: Include cxx-gram.at.
16113
16114 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 16115
676385e2
PH
16116 * src/parse-gram.y:
16117
16118 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
16119
16120 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 16121
b5480d74 161222002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
16123
16124 * src/options.h, src/options.c: Remove.
16125 * src/getargs.c (short_options, long_options): New.
16126
60491a94
AD
161272002-06-27 Akim Demaille <akim@epita.fr>
16128
16129 * data/bison.simple, data/bison.c++: Rename as...
16130 * data/yacc.c, data/lalr1.cc: these.
16131 * doc/bison.texinfo (Environment Variables): Remove.
16132
9be0c25b
AD
161332002-06-25 Raja R Harinath <harinath@cs.umn.edu>
16134
16135 * src/getargs.c (report_argmatch): Initialize strtok().
16136
1ae72863
AD
161372002-06-20 Akim Demaille <akim@epita.fr>
16138
16139 * data/bison.simple (b4_symbol_actions): New, replaces...
16140 (b4_symbol_destructor, b4_symbol_printer): these.
16141 (yysymprint): Be sure to call YYPRINT only for tokens, and using
16142 user token numbers.
16143
87542d29
AD
161442002-06-20 Akim Demaille <akim@epita.fr>
16145
16146 * data/bison.simple (yydestructor): Rename as...
16147 (yydestruct): this.
16148
1a31ed21
AD
161492002-06-20 Akim Demaille <akim@epita.fr>
16150
16151 * src/symtab.h, src/symtab.c (symbol_type_set)
16152 (symbol_destructor_set, symbol_precedence_set): The location is
16153 the last argument.
16154 Adjust all callers.
16155
e776192e
AD
161562002-06-20 Akim Demaille <akim@epita.fr>
16157
16158 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
16159 internals.
16160 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
16161 Takes a location.
16162 * src/symtab.h, src/symtab.c (symbol_class_set)
16163 (symbol_user_token_number_set): Likewise.
16164 Adjust all callers.
16165 Promote complain_at.
16166 * tests/input.at (Type Clashes): Adjust.
16167
5c1180b3
AD
161682002-06-20 Akim Demaille <akim@epita.fr>
16169
16170 * data/bison.simple (YYLEX): Fix the declaration when
16171 %pure-parser.
16172
e3170060
AD
161732002-06-20 Akim Demaille <akim@epita.fr>
16174
16175 * data/bison.simple (yysymprint): Don't print the token number,
16176 just its name.
16177 * tests/actions.at (Destructors): Rename as...
16178 (Printers and Destructors): this.
16179 Also exercise %printer.
16180
253862fd
AD
161812002-06-20 Akim Demaille <akim@epita.fr>
16182
16183 * data/bison.simple (YYDSYMPRINT): New.
16184 Use it to remove many of the #if YYDEBUG/if (yydebug).
16185
366eea36
AD
161862002-06-20 Akim Demaille <akim@epita.fr>
16187
16188 * src/symtab.h, src/symtab.c (symbol_t): printer and
16189 printer_location are new members.
16190 (symbol_printer_set): New.
16191 * src/parse-gram.y (PERCENT_PRINTER): New token.
16192 Handle its associated rule.
16193 * src/scan-gram.l: Adjust.
16194 (handle_destructor_at, handle_destructor_dollar): Rename as...
16195 (handle_symbol_code_at, handle_symbol_code_dollar): these.
16196 * src/output.c (symbol_printers_output): New.
16197 (output_skeleton): Call it.
16198 * data/bison.simple (yysymprint): New. Cannot be named yyprint
16199 since there are already many grammar files with a user `yyprint'.
16200 Replace the calls to YYPRINT to calls to yysymprint.
16201 * tests/calc.at: Adjust.
16202 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
16203 taking advantage of parser very internal details (stack size!).
16204
4f25ebb0
AD
162052002-06-20 Akim Demaille <akim@epita.fr>
16206
16207 * src/scan-gram.l: Complete the scanner with the missing patterns
16208 to pacify Flex.
16209 Use `quote' and `symbol_tag_get' where appropriate.
16210
93b68a0e
AD
162112002-06-19 Akim Demaille <akim@epita.fr>
16212
16213 * tests/actions.at (Destructors): Augment to test locations.
16214 * data/bison.simple (yydestructor): Pass it the current location
16215 if locations are enabled.
16216 Prototype only when __STDC__ or C++.
16217 Change the argument names to move into the yy name space: there is
16218 user code here.
16219
58612f1d
AD
162202002-06-19 Akim Demaille <akim@epita.fr>
16221
74310291
AD
16222 * data/bison.simple (b4_pure_if): New.
16223 Use it instead of #ifdef YYPURE.
16224
162252002-06-19 Akim Demaille <akim@epita.fr>
16226
16227 * data/bison.simple (b4_location_if): New.
58612f1d
AD
16228 Use it instead of #ifdef YYLSP_NEEDED.
16229
f25bfb75
AD
162302002-06-19 Akim Demaille <akim@epita.fr>
16231
16232 Prepare @$ in %destructor, but currently don't bind it in the
16233 skeleton, as %location use is not cleaned up yet.
16234
16235 * src/scan-gram.l (handle_dollar, handle_destructor_at)
16236 (handle_action_at): New.
16237 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
16238 a braced_code_t and a location as additional arguments.
16239 (handle_destructor_dollar): Instead of requiring `b4_eval', just
16240 unquote one when outputting `b4_dollar_dollar'.
16241 Adjust callers.
16242 * data/bison.simple (b4_eval): Remove.
16243 (b4_symbol_destructor): Adjust.
16244 * tests/input.at (Invalid @n): Adjust.
16245
c732d2c6
AD
162462002-06-19 Zack Weinberg <zack@codesourcery.com>
16247
16248 * doc/bison.texinfo: Document ability to have multiple
16249 prologue sections.
16250
8c165d89
AD
162512002-06-18 Akim Demaille <akim@epita.fr>
16252
16253 * src/files.c (compute_base_names): When computing the output file
16254 names from the input file name, strip the directory part.
16255
ca98bf57
AD
162562002-06-18 Akim Demaille <akim@epita.fr>
16257
16258 * data/bison.simple.new: Comment changes.
16259 Reported by Andreas Schwab.
16260
0bfb02ff
AD
162612002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
16262
16263 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
16264 there are no `label `yyoverflowlab' defined but not used' warnings
16265 when yyoverflow is defined.
16266
24c0aad7
AD
162672002-06-18 Akim Demaille <akim@epita.fr>
16268
16269 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
16270 new member.
16271 (symbol_destructor_set): Adjust.
16272 * src/output.c (symbol_destructors_output): Output the destructor
16273 locations.
16274 Output the symbol name.
16275 * data/bison.simple (b4_symbol_destructor): Adjust.
16276
5719c109
AD
162772002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
16278 and Akim Demaille <akim@epita.fr>
16279
16280 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
16281 what's left on the stack when the error recovery hits EOF.
16282 * tests/actions.at (Destructors): Complete to exercise this case.
16283
9280d3ef
AD
162842002-06-17 Akim Demaille <akim@epita.fr>
16285
16286 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
16287 arguments is really empty, not only equal to `[]'.
16288 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
16289 member.
16290 (symbol_destructor_set): New.
16291 * src/output.c (symbol_destructors_output): New.
16292 * src/reader.h (brace_code_t, current_braced_code): New.
16293 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
16294 (handle_dollar): Rename as...
16295 (handle_action_dollar): this.
16296 (handle_destructor_dollar): New.
16297 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
16298 (grammar_declaration): Use it.
16299 * data/bison.simple (yystos): Is always defined.
16300 (yydestructor): New.
16301 * tests/actions.at (Destructors): New.
16302 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
16303
dafdc66f
AD
163042002-06-17 Akim Demaille <akim@epita.fr>
16305
16306 * src/symlist.h, src/symlist.c (symbol_list_length): New.
16307 * src/scan-gram.l (handle_dollar, handle_at): Compute the
16308 rule_length only when needed.
16309 * src/output.c (actions_output, token_definitions_output): Output
16310 the full M4 block.
16311 * src/symtab.c: Don't access directly to the symbol tag, use
16312 symbol_tag_get.
16313 * src/parse-gram.y: Use symbol_list_free.
16314
56c47203
AD
163152002-06-17 Akim Demaille <akim@epita.fr>
16316
16317 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
16318 (symbol_list_prepend, get_type_name): Move to...
16319 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
16320 (symbol_list_prepend, symbol_list_n_type_name_get): here.
16321 Adjust all callers.
16322 (symbol_list_free): New.
16323 * src/scan-gram.l (handle_dollar): Takes a location.
16324 * tests/input.at (Invalid $n): Adjust.
16325
1e0bab92
AD
163262002-06-17 Akim Demaille <akim@epita.fr>
16327
16328 * src/reader.h, src/reader.c (symbol_list_new): Export it.
16329 (symbol_list_prepend): New.
16330 * src/parse-gram.y (%union): `list' is a new member.
16331 (symbols.1): New, replaces...
16332 (terms_to_prec.1, nterms_to_type.1): these.
16333 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
16334 Take a location as additional argument.
16335 Adjust all callers.
16336
04e60654
AD
163372002-06-15 Akim Demaille <akim@epita.fr>
16338
16339 * src/parse-gram.y: Move %token in the declaration section so that
16340 we don't depend upon CVS Bison.
16341
10e5b8bd
AD
163422002-06-15 Akim Demaille <akim@epita.fr>
16343
16344 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
16345 * src/print.c (print_core): Use it.
16346
9801d40c
AD
163472002-06-15 Akim Demaille <akim@epita.fr>
16348
16349 * src/conflicts.c (log_resolution): Accept the rule involved in
16350 the sr conflicts instead of the lookahead number that points to
16351 that rule.
16352 (flush_reduce): Accept the current lookahead vector as argument,
16353 instead of the index in LA.
16354 (resolve_sr_conflict): Accept the current number of lookahead
16355 bitset to consider for the STATE, instead of the index in LA.
16356 (set_conflicts): Adjust.
16357 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
16358
c0263492
AD
163592002-06-15 Akim Demaille <akim@epita.fr>
16360
16361 * src/state.h (state_t): Replace the `lookaheadsp' member, a
16362 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
16363 Adjust all dependencies.
16364 * src/lalr.c (initialize_lookaheads): Split into...
16365 (states_lookaheads_count, states_lookaheads_initialize): these.
16366 (lalr): Adjust.
16367
9757c359
AD
163682002-06-15 Akim Demaille <akim@epita.fr>
16369
16370 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
16371 out of...
16372 (grammar_rules_print): here.
16373 * src/reduce.c (reduce_output): Use it.
16374 * tests/reduce.at (Useless Rules, Reduced Automaton)
16375 (Underivable Rules): Adjust.
16376
6b98e4b5
AD
163772002-06-15 Akim Demaille <akim@epita.fr>
16378
16379 Copy BYacc's nice way to report the grammar.
16380
16381 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
16382 New.
16383 Don't print the rules' location, it is confusing and useless.
16384 (rule_print): Use grammar_rhs_print.
16385 * src/print.c (print_grammar): Use grammar_rules_print.
16386
6b98e4b5
AD
163872002-06-15 Akim Demaille <akim@epita.fr>
16388
16389 Complete and rationalize `useless thing' warnings.
16390
16391 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
16392 (symbol_tag_print): New.
16393 Use them everywhere in place of accessing directly the tag member.
16394 * src/gram.h, src/gram.c (rule_print): New.
16395 Use it where a rule used to be printed `by hand'.
16396 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
16397 (reduce_grammar_tables): Report the useless rules.
16398 (reduce_print): Useless things are a warning, not an error.
16399 Report it as such.
16400 * tests/reduce.at (Useless Nonterminals, Useless Rules):
16401 (Reduced Automaton, Underivable Rules): Adjust.
16402 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
16403 * tests/conflicts.at (Unresolved SR Conflicts)
16404 (Solved SR Conflicts): Adjust.
16405
ee000ba4
AD
164062002-06-15 Akim Demaille <akim@epita.fr>
16407
16408 Let symbols have a location.
16409
16410 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
16411 (getsym): Adjust.
16412 Adjust all callers.
16413 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
16414 Use location_t, not int.
16415 * src/symtab.c (symbol_check_defined): Take advantage of the
16416 location.
16417 * tests/regression.at (Invalid inputs): Adjust.
16418
8efe435c
AD
164192002-06-15 Akim Demaille <akim@epita.fr>
16420
16421 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
16422 (input): Don't try to initialize yylloc here, do it in the
16423 scanner.
16424 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
16425 * src/gram.h (rule_t): Change line and action_line into location
16426 and action_location, of location_t type.
16427 Adjust all dependencies.
16428 * src/location.h, src/location.c (empty_location): New.
16429 * src/reader.h, src/reader.c (grammar_start_symbol_set)
16430 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
16431 (grammar_current_rule_symbol_append)
16432 (grammar_current_rule_action_append): Expect a location as argument.
16433 * src/reader.c (grammar_midrule_action): Adjust to attach an
16434 action's location as dummy symbol location.
16435 * src/symtab.h, src/symtab.c (startsymbol_location): New.
16436 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
16437 the line numbers.
16438
1921f1d7
AD
164392002-06-14 Akim Demaille <akim@epita.fr>
16440
16441 Grammar declarations may be found in the grammar section.
16442
16443 * src/parse-gram.y (rules_or_grammar_declaration): New.
16444 (declarations): Each declaration may end with a semicolon, not
16445 just...
16446 (grammar_declaration): `"%union"'.
16447 (grammar): Branch to rules_or_grammar_declaration.
16448
4515534c
AD
164492002-06-14 Akim Demaille <akim@epita.fr>
16450
16451 * src/main.c (main): Invoke scanner_free.
16452
f958596b
AD
164532002-06-14 Akim Demaille <akim@epita.fr>
16454
16455 * src/output.c (m4_invoke): Extracted from...
16456 (output_skeleton): here.
16457 Free tempfile.
16458
2c569025
AD
164592002-06-14 Akim Demaille <akim@epita.fr>
16460
16461 * src/parse-gram.y (directives, directive, gram)
16462 (grammar_directives, precedence_directives, precedence_directive):
16463 Rename as...
16464 (declarations, declaration, grammar, grammar_declaration)
16465 (precedence_declaration, precedence_declarator): these.
16466 (symbol_declaration): New.
16467
592e8d4d
AD
164682002-06-14 Akim Demaille <akim@epita.fr>
16469
16470 * src/files.c (action_obstack): Remove, unused.
16471 (output_obstack): Remove it, and all its dependencies, as it is no
16472 longer needed.
16473 * src/reader.c (epilogue_set): Build the epilogue in the
16474 muscle_obstack.
16475 * src/output.h, src/output.c (muscle_obstack): Move to...
16476 * src/muscle_tab.h, src/muscle_tab.h: here.
16477 (muscle_init): Initialize muscle_obstack.
16478 (muscle_free): New.
16479 * src/main.c (main): Call it.
16480
0c15323d
AD
164812002-06-14 Akim Demaille <akim@epita.fr>
16482
16483 * src/location.h: New, extracted from...
16484 * src/reader.h: here.
16485 * src/Makefile.am (noinst_HEADERS): Merge into
16486 (bison_SOURCES): this.
16487 Add location.h.
16488 * src/parse-gram.y: Use location_t instead of Bison's.
16489 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
16490 Use location_t instead of ints.
16491
e96c9728
AD
164922002-06-14 Akim Demaille <akim@epita.fr>
16493
16494 * data/bison.simple, data/bison.c++: Be sure to restore the
16495 current #line when returning to the skeleton contents after having
16496 exposed the input file's #line.
16497
75d1fe16
AD
164982002-06-12 Akim Demaille <akim@epita.fr>
16499
16500 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
16501 eager.
16502 * tests/actions.at (Exotic Dollars): New.
16503
6c35d22c
AD
165042002-06-12 Akim Demaille <akim@epita.fr>
16505
16506 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
16507 ['"/] too eagerly.
16508 * tests/input.at (Torturing the Scanner): New.
16509
1d6412ad
AD
165102002-06-11 Akim Demaille <akim@epita.fr>
16511
16512 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
16513 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
16514 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
16515 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
16516 * src/reader.c (reader): Use it.
16517
4cdb01db
AD
165182002-06-11 Akim Demaille <akim@epita.fr>
16519
16520 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
16521 Adjust all callers.
16522 (scanner_last_string_free): New.
16523
44995b2e
AD
165242002-06-11 Akim Demaille <akim@epita.fr>
16525
16526 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
16527 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
16528 (last_string, YY_OBS_FREE): New.
16529 Use them when returning an ID.
16530
e9955c83
AD
165312002-06-11 Akim Demaille <akim@epita.fr>
16532
16533 Have Bison grammars parsed by a Bison grammar.
16534
16535 * src/reader.c, src/reader.h (prologue_augment): New.
16536 * src/reader.c (copy_definition): Remove.
16537
16538 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
16539 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
16540 (grammar_current_rule_prec_set, grammar_current_rule_check)
16541 (grammar_current_rule_symbol_append)
16542 (grammar_current_rule_action_append): Export.
16543 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
16544 (symbol_list_action_append): Remove.
16545 Hook the routines from reader.
16546 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
16547 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
16548
16549 * src/reader.c (read_declarations): Remove, unused.
16550
16551 * src/parse-gram.y: Handle the epilogue.
16552 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
16553 (grammar_start_symbol_set): this.
16554 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
16555 * src/reader.c (readgram): Remove, unused.
16556 (reader): Adjust to insert eoftoken and axiom where appropriate.
16557
16558 * src/reader.c (copy_dollar): Replace with...
16559 * src/scan-gram.h (handle_dollar): this.
16560 * src/parse-gram.y: Remove `%thong'.
16561
16562 * src/reader.c (copy_at): Replace with...
16563 * src/scan-gram.h (handle_at): this.
16564
16565 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
16566 New.
16567
16568 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
16569 time being.
16570
16571 * src/reader.h, src/reader.c (grammar_rule_end): New.
16572
16573 * src/parse.y (current_type, current_class): New.
16574 Implement `%nterm', `%token' support.
16575 Merge `%term' into `%token'.
16576 (string_as_id): New.
16577 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
16578 type name.
16579
16580 * src/parse-gram.y: Be sure to handle properly the beginning of
16581 rules.
16582
16583 * src/parse-gram.y: Handle %type.
16584 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
16585
16586 * src/parse-gram.y: More directives support.
16587 * src/options.c: No longer handle source directives.
16588
16589 * src/parse-gram.y: Fix %output.
16590
16591 * src/parse-gram.y: Handle %union.
16592 Use the prologue locations.
16593 * src/reader.c (parse_union_decl): Remove.
16594
16595 * src/reader.h, src/reader.c (epilogue_set): New.
16596 * src/parse-gram.y: Use it.
16597
16598 * data/bison.simple, data/bison.c++: b4_stype is now either not
16599 defined, then default to int, or to the contents of %union,
16600 without `union' itself.
16601 Adjust.
16602 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
16603
16604 * src/output.c (actions_output): Don't output braces, as they are
16605 already handled by the scanner.
16606
16607 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
16608 characters to themselves.
16609
16610 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
16611 that the epilogue has a proper #line.
16612
16613 * src/parse-gram.y: Handle precedence/associativity.
16614
16615 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
16616 a terminal.
16617 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
16618 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
16619 at all to define terminals that cannot be emitted.
16620
16621 * src/scan-gram.l: Escape M4 characters.
16622
16623 * src/scan-gram.l: Working properly with escapes in user
16624 strings/characters.
16625
16626 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
16627 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
16628 grammar.
16629 Use more modest sizes, as for the time being the parser does not
16630 release memory, and therefore the process swallows a huge amount
16631 of memory.
16632
16633 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
16634 stricter %token grammar.
16635
16636 * src/symtab.h (associativity): Add `undef_assoc'.
16637 (symbol_precedence_set): Do nothing when passed an undef_assoc.
16638 * src/symtab.c (symbol_check_alias_consistence): Adjust.
16639
16640 * tests/regression.at (Invalid %directive): Remove, as it is now
16641 meaningless.
16642 (Invalid inputs): Adjust to the new error messages.
16643 (Token definitions): The new grammar doesn't allow too many
16644 eccentricities.
16645
16646 * src/lex.h, src/lex.c: Remove.
16647 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
16648 (copy_character, copy_string2, copy_string, copy_identifier)
16649 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
16650 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
16651 (parse_action): Remove.
16652 * po/POTFILES.in: Adjust.
16653
2e047461
AD
166542002-06-11 Akim Demaille <akim@epita.fr>
16655
cd05d13c 16656 * src/reader.c (parse_action): Don't store directly into the
2e047461
AD
16657 rule's action member: return the action as a string.
16658 Don't require `rule_length' as an argument: compute it.
16659 (grammar_current_rule_symbol_append)
16660 (grammar_current_rule_action_append): New, eved out from
16661 (readgram): here.
16662 Remove `action_flag', `rulelength', unused now.
16663
9af3fbce
AD
166642002-06-11 Akim Demaille <akim@epita.fr>
16665
16666 * src/reader.c (grammar_current_rule_prec_set).
16667 (grammar_current_rule_check): New, eved out from...
16668 (readgram): here.
16669 Remove `xaction', `first_rhs': useless.
16670 * tests/input.at (Type clashes): New.
16671 * tests/existing.at (GNU Cim Grammar): Adjust.
16672
1485e106
AD
166732002-06-11 Akim Demaille <akim@epita.fr>
16674
16675 * src/reader.c (grammar_midrule_action): New, Eved out from
16676 (readgram): here.
16677
da4160c3
AD
166782002-06-11 Akim Demaille <akim@epita.fr>
16679
16680 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
16681 New.
16682 (readgram): Use them as replacement of inlined code, crule and
16683 crule1.
16684
f6d0f937
AD
166852002-06-11 Akim Demaille <akim@epita.fr>
16686
16687 * src/reader.c (grammar_end, grammar_symbol_append): New.
16688 (readgram): Use them.
16689 Make the use of `p' as local as possible.
16690
69078d4b
AD
166912002-06-10 Akim Demaille <akim@epita.fr>
16692
16693 GCJ's parser requires the tokens to be defined before the prologue.
16694
16695 * data/bison.simple: Output the token definition before the user's
16696 prologue.
16697 * tests/regression.at (Braces parsing, Duplicate string)
16698 (Mixing %token styles): Check the output from bison.
16699 (Early token definitions): New.
16700
5e424082
AD
167012002-06-10 Akim Demaille <akim@epita.fr>
16702
16703 * src/symtab.c (symbol_user_token_number_set): Don't complain when
16704 assigning twice the same user number to a token, so that we can
16705 use it in...
16706 * src/lex.c (lex): here.
16707 Also use `symbol_class_set' instead of hand written code.
16708 * src/reader.c (parse_assoc_decl): Likewise.
16709
44536b35
AD
167102002-06-10 Akim Demaille <akim@epita.fr>
16711
16712 * src/symtab.c, src/symtab.c (symbol_class_set)
16713 (symbol_user_token_number_set): New.
16714 * src/reader.c (parse_token_decl): Use them.
16715 Use a switch instead of ifs.
16716 Use a single argument.
16717
8b9f2372
AD
167182002-06-10 Akim Demaille <akim@epita.fr>
16719
16720 Remove `%thong' support as it is undocumented, unused, duplicates
16721 `%token's job, and creates useless e-mail traffic with people who
16722 want to know what it is, why it is undocumented, unused, and
16723 duplicates `%token's job.
16724
16725 * src/reader.c (parse_thong_decl): Remove.
16726 * src/options.c (option_table): Remove "thong".
16727 * src/lex.h (tok_thong): Remove.
16728
3ae2b51f
AD
167292002-06-10 Akim Demaille <akim@epita.fr>
16730
16731 * src/symtab.c, src/symtab.c (symbol_type_set)
16732 (symbol_precedence_set): New.
16733 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
16734 (value_components_used): Remove, unused.
16735
2f1afb73
AD
167362002-06-09 Akim Demaille <akim@epita.fr>
16737
16738 Move symbols handling code out of the reader.
16739
16740 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
16741 (axiom): Move to...
16742 * src/symtab.h, src/symtab.c: here.
16743
16744 * src/gram.c (start_symbol): Remove: use startsymbol->number.
16745 * src/reader.c (startval): Rename as...
16746 * src/symtab.h, src/symtab.c (startsymbol): this.
16747 * src/reader.c: Adjust.
16748
16749 * src/reader.c (symbol_check_defined, symbol_make_alias)
16750 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
16751 (token_translations_init)
16752 Move to...
16753 * src/symtab.c: here.
16754 * src/reader.c (packsymbols): Move to...
16755 * src/symtab.h, src/symtab.c (symbols_pack): here.
16756 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
16757 argument.
16758
e9bca3ad
AD
167592002-06-03 Akim Demaille <akim@epita.fr>
16760
16761 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
16762 then statements.
16763
86eff183
AD
167642002-06-03 Akim Demaille <akim@epita.fr>
16765
16766 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
16767 structs with non literals.
16768 * src/scan-skel.l: never-interactive.
16769 * src/conflicts.c (enum conflict_resolution_e): No trailing
16770 comma.
16771 * src/getargs.c (usage): Split long literal strings.
16772 Reported by Hans Aberg.
16773
717be197
AD
167742002-05-28 Akim Demaille <akim@epita.fr>
16775
16776 * data/bison.c++: Use C++ ostreams.
16777 (cdebug_): New member.
16778
670ddffd
AD
167792002-05-28 Akim Demaille <akim@epita.fr>
16780
16781 * src/output.c (output_skeleton): Be sure to allocate enough room
16782 for `/' _and_ for `\0' in full_skeleton.
16783
769b430f
AD
167842002-05-28 Akim Demaille <akim@epita.fr>
16785
16786 * data/bison.c++: Catch up with bison.simple:
16787 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16788 and Paul Eggert <eggert@twinsun.com>: `error' handing.
16789 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
16790 and popping traces.
16791
7067cb36
PH
167922002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16793
16794 * src/output.c (output_skeleton): Put an explicit path in front of
16795 the skeleton file name, rather than relying on the -I directory,
16796 to partially alleviate effects of having a skeleton file lying around
16797 in the current directory.
769b430f 16798
4a713ec2
PH
167992002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16800
769b430f 16801 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
16802 obstack_printf should be obstack_fgrow1.
16803
b408954b
AD
168042002-05-26 Akim Demaille <akim@epita.fr>
16805
16806 * src/state.h (state_t): `solved_conflicts' is a new member.
16807 * src/LR0.c (new_state): Set it to 0.
16808 * src/conflicts.h, src/conflicts.c (print_conflicts)
16809 (free_conflicts, solve_conflicts): Rename as...
16810 (conflicts_print, conflicts_free, conflicts_solve): these.
16811 Adjust callers.
16812 * src/conflicts.c (enum conflict_resolution_e)
16813 (solved_conflicts_obstack): New, used by...
16814 (log_resolution): this.
16815 Adjust to attach the conflict resolution to each state.
16816 Complete the description with the precedence/associativity
16817 information.
16818 (resolve_sr_conflict): Adjust.
16819 * src/print.c (print_state): Output its solved_conflicts.
16820 * tests/conflicts.at (Unresolved SR Conflicts)
16821 (Solved SR Conflicts): Exercise --report=all.
16822
a49aecd5
AD
168232002-05-26 Akim Demaille <akim@epita.fr>
16824
16825 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
16826 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
16827 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
16828 (token_number_t, item_number_as_token_number)
16829 (token_number_as_item_number, muscle_insert_token_number_table):
16830 Rename as...
16831 (symbol_number_t, item_number_as_symbol_number)
16832 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
16833 these, since it is more appropriate.
16834
5504898e
AD
168352002-05-26 Akim Demaille <akim@epita.fr>
16836
16837 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
16838 `Error:' lines.
16839 * data/bison.simple (yystos) [YYDEBUG]: New.
16840 (yyparse) [YYDEBUG]: Display the symbols which are popped during
16841 error recovery.
16842 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
16843
ec3bc396
AD
168442002-05-25 Akim Demaille <akim@epita.fr>
16845
16846 * doc/bison.texinfo (Debugging): Split into...
16847 (Tracing): this new section, its former contents, and...
16848 (Understanding): this new section.
16849 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
16850 by...
16851 (report_flag): this.
16852 Adjust all dependencies.
16853 (report_args, report_types, report_argmatch): New.
16854 (usage, getargs): Report/support -r, --report.
16855 * src/options.h
16856 (struct option_table_struct): Rename as..,
16857 (struct option_table_s): this.
16858 Rename the `set_flag' member to `flag' to match with getopt_long's
16859 struct.
16860 * src/options.c (option_table): Split verbose into an entry for
16861 %verbose, and another for --verbose.
16862 Support --report/-r, so remove -r from the obsolete --raw.
16863 * src/print.c: Attach full item sets and lookaheads reports to
16864 report_flag instead of trace_flag.
16865 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
16866
78df8250
PE
168672002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16868 and Paul Eggert <eggert@twinsun.com>
769b430f 16869
78df8250
PE
16870 * data/bison.simple (yyparse): Correct error handling to conform to
16871 POSIX and yacc. Specifically, after syntax error is discovered,
16872 do not reduce further before shifting the error token.
16873 Clean up the code a bit by removing the labels yyerrdefault,
16874 yyerrhandle, yyerrpop.
16875 * NEWS: Document the above.
16876
c0c9ea05
PH
168772002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16878
16879 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
16880 type; it isn't always big enough, since it doesn't necessarily
16881 include non-terminals.
769b430f 16882 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
16883 the latter can be removed.
16884 (yy_token_number_type): Remove, only one use.
16885 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
16886 don't use TokenNumberType as element type.
769b430f 16887
c0c9ea05
PH
16888 * tests/regression.at: Modify expected output to agree with change
16889 to yyr1 and yytranslate.
769b430f 16890
6390a83f
FK
168912002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
16892
16893 * src/reader.c (parse_action): Use copy_character instead of
16894 obstack_1grow.
16895
db7c8e9a
AD
168962002-05-13 Akim Demaille <akim@epita.fr>
16897
16898 * tests/regression.at (Token definitions): Prototype yylex and
16899 yyerror.
16900
fcc61800
PH
169012002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16902
158c687b 16903 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
16904 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
16905 32-bit arithmetic.
16906 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
16907
5683e9b2
AD
169082002-05-07 Akim Demaille <akim@epita.fr>
16909
16910 * tests/synclines.at: Be sure to prototype yylex and yyerror to
16911 avoid GCC warnings.
16912
0c2d3f4c
AD
169132002-05-07 Akim Demaille <akim@epita.fr>
16914
16915 Kill GCC warnings.
16916
16917 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
16918 over the RHS of each rule.
16919 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
16920 * src/state.h (state_t): Member `nitems' is unsigned short.
16921 * src/LR0.c (get_state): Adjust.
16922 * src/reader.c (packgram): Likewise.
16923 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
16924 `Type'.
16925 (muscle_insert_int_table): Remove, unused.
16926 (prepare_rules): Remove `max'.
16927
1565b720
AD
169282002-05-06 Akim Demaille <akim@epita.fr>
16929
16930 * src/closure.c (print_firsts): Display of the symbol tags.
16931 (bitmatrix_print): Move to...
16932 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
16933 here.
16934 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
16935
cfaee611
AD
169362002-05-06 Akim Demaille <akim@epita.fr>
16937
16938 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
16939 hash_do_for_each.
16940
458be8e0
AD
169412002-05-06 Akim Demaille <akim@epita.fr>
16942
16943 * src/LR0.c (new_state, get_state): Instead of using the global
16944 `kernel_size' and `kernel_base', have two new arguments:
16945 `core_size' and `core'.
16946 Adjust callers.
16947
a900a624
AD
169482002-05-06 Akim Demaille <akim@epita.fr>
16949
16950 * src/reader.c (packgram): No longer end `ritem' with a 0
16951 sentinel: it is not used.
16952
d4e7d3a1
AD
169532002-05-05 Akim Demaille <akim@epita.fr>
16954
16955 New experimental feature: display the lookaheads in the report and
16956 graph.
16957
16958 * src/print (print_core): When --trace-flag, display the rules
16959 lookaheads.
16960 * src/print_graph.c (print_core): Likewise.
16961 Swap the arguments.
16962 Adjust caller.
16963
39ceb25b
AD
169642002-05-05 Akim Demaille <akim@epita.fr>
16965
16966 * tests/torture.at (Many lookaheads): New test.
16967
5372019f
AD
169682002-05-05 Akim Demaille <akim@epita.fr>
16969
16970 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
16971 (GENERATE_MUSCLE_INSERT_TABLE): this.
16972 (output_int_table, output_unsigned_int_table, output_short_table)
16973 (output_token_number_table, output_item_number_table): Replace with...
16974 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
16975 (muscle_insert_short_table, muscle_insert_token_number_table)
16976 (muscle_insert_item_number_table): these.
16977 Adjust all callers.
16978 (prepare_tokens): Don't free `translations', since...
16979 * src/reader.h, src/reader.c (grammar_free): do it.
16980 Move to...
16981 * src/gram.h, src/gram.c (grammar_free): here.
16982 * data/bison.simple, data/bison.c++: b4_token_number_max is now
16983 b4_translate_max.
16984
5df5f6d5
AD
169852002-05-05 Akim Demaille <akim@epita.fr>
16986
16987 * src/output.c (output_unsigned_int_table): New.
16988 (prepare_rules): `i' is unsigned.
16989 `prhs', `rline', `r2' are unsigned int.
16990 Rename muscle `rhs_number_max' as `rhs_max'.
16991 Output muscles `prhs_max', `rline_max', and `r2_max'.
16992 Free rline and r1.
16993 * data/bison.simple, data/bison.c++: Adjust to use these muscles
16994 to compute types instead of constant types.
16995 * tests/regression.at (Web2c Actions): Adjust.
16996
b87f8b21
AD
169972002-05-04 Akim Demaille <akim@epita.fr>
16998
16999 * src/symtab.h (SALIAS, SUNDEF): Rename as...
17000 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
17001 Adjust dependencies.
17002 * src/output.c (token_definitions_output): Be sure not to output a
17003 `#define 'a'' when fed with `%token 'a' "a"'.
17004 * tests/regression.at (Token definitions): New.
17005
8bb936e4
PE
170062002-05-03 Paul Eggert <eggert@twinsun.com>
17007
17008 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
17009 for K&R C.
17010
170112002-05-03 gettextize <bug-gnu-gettext@gnu.org>
17012
17013 * Makefile.am (SUBDIRS): Remove intl.
17014 (EXTRA_DIST): Add config/config.rpath.
17015
53c71a12
AD
170162002-05-03 Akim Demaille <akim@epita.fr>
17017
17018 * data/bison.simple (m4_if): Don't output empty enums.
17019 And actually, output valid enum definitions :(.
17020
289dd0cf
AD
170212002-05-03 Akim Demaille <akim@epita.fr>
17022
17023 * configure.bat: Remove, completely obsolete.
17024 * Makefile.am (EXTRA_DIST): Adjust.
17025 Don't distribute config.rpath...
17026 * config/Makefile.am (EXTRA_DIST): Do it.
17027
db85e524
AD
170282002-05-03 Akim Demaille <akim@epita.fr>
17029
17030 * configure.in (GETTEXT_VERSION): New.
17031 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
17032
83ccf991
AD
170332002-05-03 Akim Demaille <akim@epita.fr>
17034
17035 * data/bison.simple (b4_token_enum): New.
17036 (b4_token_defines): Use it to output tokens both as #define and
17037 enums.
17038 Suggested by Paul Eggert.
17039 * src/output.c (token_definitions_output): Don't output spurious
17040 white spaces.
17041
1f418995
AD
170422002-05-03 Akim Demaille <akim@epita.fr>
17043
17044 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
17045
45119f04
RA
170462002-05-02 Robert Anisko <robert@lrde.epita.fr>
17047
17048 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
17049 Update the stack class, give a try to deque as the default container.
17050
b2d52318
AD
170512002-05-02 Akim Demaille <akim@epita.fr>
17052
17053 * data/bison.simple (yyparse): Do not implement @$ = @1.
17054 (YYLLOC_DEFAULT): Adjust to do it.
17055 * doc/bison.texinfo (Location Default Action): Fix.
17056
3a8b4109
AD
170572002-05-02 Akim Demaille <akim@epita.fr>
17058
17059 * src/reader.c (parse_braces): Merge into...
17060 (parse_action): this.
17061
84614e13
AD
170622002-05-02 Akim Demaille <akim@epita.fr>
17063
17064 * configure.in (ALL_LINGUAS): Remove.
17065 * po/LINGUAS, hr.po: New.
17066
fdbcd8e2
AD
170672002-05-02 Akim Demaille <akim@epita.fr>
17068
17069 Remove the so called hairy (semantic) parsers.
17070
17071 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
17072 * src/gram.h, src/gram.c (semantic_parser): Remove.
17073 (rule_t): Remove the guard and guard_line members.
17074 * src/lex.h (token_t): remove tok_guard.
17075 * src/options.c (option_table): Remove %guard and %semantic_parser
17076 support.
17077 * src/output.c, src/output.h (guards_output): Remove.
17078 (prepare): Adjust.
17079 (token_definitions_output): Don't output the `T'
17080 tokens (???).
17081 (output_skeleton): Don't output the guards.
17082 * src/files.c, src/files.c (attrsfile): Remove.
17083 * src/reader.c (symbol_list): Remove the guard and guard_line
17084 members.
17085 Adjust dependencies.
17086 (parse_guard): Remove.
17087 * data/bison.hairy: Remove.
17088 * doc/bison.texinfo (Environment Variables): Remove occurrences of
17089 BISON_HAIRY.
17090
82b6cb3f
AD
170912002-05-02 Akim Demaille <akim@epita.fr>
17092
17093 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
17094 (parse_guard): Rename the formal argument `stack_offset' as
17095 `rule_length', which is more readable.
17096 Adjust callers.
17097 (copy_at, copy_dollar): Instead of outputting the hard coded
17098 values of $$, $n and so forth, output invocation to b4_lhs_value,
17099 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
17100 Note: this patch partially drops `semantic-parser' support: it
17101 always does `rule_length - n', where semantic parsers ought to
17102 always use `-n'.
82b6cb3f
AD
17103 * data/bison.simple, data/bison.c++ (b4_lhs_value)
17104 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
17105
6cbfbcc5
AD
171062002-05-02 Akim Demaille <akim@epita.fr>
17107
17108 * configure.in (AC_INIT): Bump to 1.49b.
17109 (AM_INIT_AUTOMAKE): Short invocation.
17110
b8548114
AD
171112002-05-02 Akim Demaille <akim@epita.fr>
17112
17113 Version 1.49a.
17114
c20cd1fa
AD
171152002-05-01 Akim Demaille <akim@epita.fr>
17116
17117 * src/skeleton.h: Remove.
17118
8a9566d4
AD
171192002-05-01 Akim Demaille <akim@epita.fr>
17120
17121 * src/skeleton.h: Fix the #endif.
17122 Reported by Magnus Fromreide.
17123
8c6d399a
PE
171242002-04-26 Paul Eggert <eggert@twinsun.com>
17125
17126 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
17127 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 17128 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 17129
2b7ed18a
RA
171302002-04-25 Robert Anisko <robert@lrde.epita.fr>
17131
17132 * src/scan-skel.l: Postprocess quadrigraphs.
17133
17134 * src/reader.c (copy_character): New function, used to output
17135 single characters while replacing `[' and `]' with quadrigraphs, to
17136 avoid troubles with M4 quotes.
17137 (copy_comment): Output characters with copy_character.
17138 (read_additionnal_code): Likewise.
17139 (copy_string2): Likewise.
17140 (copy_definition): Likewise.
17141
17142 * tests/calc.at: Exercise M4 quoting.
17143
34a89c50
AD
171442002-04-25 Akim Demaille <akim@epita.fr>
17145
17146 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
17147 between `!' and the command.
17148 Reported by Paul Eggert.
17149
0dd1580a
RA
171502002-04-24 Robert Anisko <robert@lrde.epita.fr>
17151
17152 * tests/calc.at: Exercise prologue splitting.
17153
17154 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
17155 `b4_post_prologue' instead of `b4_prologue'.
17156
17157 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
17158 muscles.
17159 (output): Free pre_prologue_obstack and post_prologue_obstack.
17160 * src/files.h, src/files.c (attrs_obstack): Remove.
17161 (pre_prologue_obstack, post_prologue_obstack): New.
17162 * src/reader.c (copy_definition): Add a parameter to specify the
17163 obstack to fill, instead of using attrs_obstack unconditionally.
17164 (read_declarations): Pass pre_prologue_obstack to copy_definition if
17165 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
17166
83c1796f
PE
171672002-04-23 Paul Eggert <eggert@twinsun.com>
17168
17169 * data/bison.simple: Remove unnecessary commentary and white
17170 space differences from 1_29-branch.
17171 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
17172
17173 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
17174 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
17175 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
17176 constructors or destructors.
17177
17178 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
17179
1207eeac
AD
171802002-04-23 Akim Demaille <akim@epita.fr>
17181
17182 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
17183 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
17184 location with columns.
17185 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
17186 All reported by Paul Eggert.
17187
78ab8f67
AD
171882002-04-22 Akim Demaille <akim@epita.fr>
17189
17190 * src/reduce.c (dump_grammar): Move to...
17191 * src/gram.h, src/gram.c (grammar_dump): here.
17192 Be sure to separate long item numbers.
17193 Don't read the members of a rule's prec if its nil.
17194
133c20e2
AD
171952002-04-22 Akim Demaille <akim@epita.fr>
17196
17197 * src/output.c (table_size, table_grow): New.
17198 (MAXTABLE): Remove, replace uses with table_size.
17199 (pack_vector): Instead of dying when the table is too big, grow it.
17200
9515e8a7
AD
172012002-04-22 Akim Demaille <akim@epita.fr>
17202
17203 * data/bison.simple (yyr1): Its type is that of a token number.
17204 * data/bison.c++ (r1_): Likewise.
17205 * tests/regression.at (Web2c Actions): Adjust.
17206
23c5a174
AD
172072002-04-22 Akim Demaille <akim@epita.fr>
17208
17209 * src/reader.c (token_translations_init): 256 is now the default
17210 value for the error token, i.e., it will be assigned another
17211 number if the user assigned 256 to one of her tokens.
17212 (reader): Don't force 256 to error.
17213 * doc/bison.texinfo (Symbols): Adjust.
17214 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
17215 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
17216 etc. instead of 10, 20, 30 (which was used to `jump' over error
17217 (256) and undefined (2)).
17218
5fbb0954
AD
172192002-04-22 Akim Demaille <akim@epita.fr>
17220
17221 Propagate more token_number_t.
17222
17223 * src/gram.h (token_number_as_item_number)
17224 (item_number_as_token_number): New.
17225 * src/output.c (GENERATE_OUTPUT_TABLE): New.
17226 Use it to create output_item_number_table and
17227 output_token_number_table.
17228 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
17229 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
17230 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
17231 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
17232
4f940944
AD
172332002-04-22 Akim Demaille <akim@epita.fr>
17234
17235 * src/output.h, src/output.c (get_lines_number): Remove.
17236
3ded9a63
AD
172372002-04-19 Akim Demaille <akim@epita.fr>
17238
17239 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
17240 as Lex/Flex'.
17241 (Debugging): More details about enabling the debugging features.
17242 (Table of Symbols): Describe $$, $n, @$, and @n.
17243 Suggested by Tim Josling.
17244
e0c471a9
AD
172452002-04-19 Akim Demaille <akim@epita.fr>
17246
17247 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
17248
fecc10cd
AD
172492002-04-10 Akim Demaille <akim@epita.fr>
17250
17251 * src/system.h: Rely on HAVE_LIMITS_H.
17252 Suggested by Paul Eggert.
17253
51dec47b
AD
172542002-04-09 Akim Demaille <akim@epita.fr>
17255
17256 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
17257 full stderr, and strip it according to the bison options, instead
17258 of composing the error message from different bits.
17259 This makes it easier to check for several error messages.
17260 Adjust all the invocations.
17261 Add an invocation exercising the error token.
17262 Add an invocation demonstrating a stupid error message.
17263 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
17264 Adjust the tests.
17265 Error message are for stderr, not stdout.
17266
007a50a4
AD
172672002-04-09 Akim Demaille <akim@epita.fr>
17268
17269 * src/gram.h, src/gram.c (error_token_number): Remove, use
17270 errtoken->number.
17271 * src/reader.c (reader): Don't specify the user token number (2)
17272 for $undefined, as it uselessly prevents using it.
17273 * src/gram.h (token_number_t): Move to...
17274 * src/symtab.h: here.
17275 (state_t.number): Is a token_number_t.
17276 * src/print.c, src/reader.c: Use undeftoken->number instead of
17277 hard coded 2.
17278 (Even though this 2 is not the same as above: the number of the
17279 undeftoken remains being 2, it is its user token number which
17280 might not be 2).
17281 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
17282 `user_token_number_max'.
17283 Output `undef_token_number'.
17284 * data/bison.simple, data/bison.c++: Use them.
17285 Be sure to map invalid yylex return values to
17286 `undef_token_number'. This saves us from gratuitous SEGV.
17287
17288 * tests/conflicts.at (Solved SR Conflicts)
17289 (Unresolved SR Conflicts): Adjust.
17290 * tests/regression.at (Web2c Actions): Adjust.
17291
06446ccf
AD
172922002-04-08 Akim Demaille <akim@epita.fr>
17293
17294 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
17295 Adding #line.
17296 Remove the duplicate `typedefs'.
17297 (RhsNumberType): Fix the declaration and various other typos.
17298 Use __ofile__.
17299 * data/bison.simple: Use __ofile__.
17300 * src/scan-skel.l: Handle __ofile__.
17301
62a3e4f0
AD
173022002-04-08 Akim Demaille <akim@epita.fr>
17303
17304 * src/gram.h (item_number_t): New, the type of item numbers in
17305 RITEM. Note that it must be able to code symbol numbers as
17306 positive number, and the negation of rule numbers as negative
17307 numbers.
17308 Adjust all dependencies (pretty many).
17309 * src/reduce.c (rule): Remove this `short *' pointer: use
17310 item_number_t.
17311 * src/system.h (MINSHORT, MAXSHORT): Remove.
17312 Include `limits.h'.
17313 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
17314 (shortcpy): Remove.
17315 (MAXTABLE): Move to...
17316 * src/output.c (MAXTABLE): here.
17317 (prepare_rules): Use output_int_table to output rhs.
17318 * data/bison.simple, data/bison.c++: Adjust.
17319 * tests/torture.at (Big triangle): Move the limit from 254 to
17320 500.
17321 * tests/regression.at (Web2c Actions): Ajust.
17322
17323 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
17324 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
17325 passes, but produces negative #line number, once fixed, GCC is
17326 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
17327 C), it passes.
17328 * src/state.h (state_h): Code input lines on ints, not shorts.
17329
bb88b0fc
AD
173302002-04-08 Akim Demaille <akim@epita.fr>
17331
17332 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
17333 and then the grammar.
17334
9a636f47
AD
173352002-04-08 Akim Demaille <akim@epita.fr>
17336
17337 * src/system.h: No longer using strndup.
17338
680e8701
AD
173392002-04-07 Akim Demaille <akim@epita.fr>
17340
17341 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
17342 * src/output.c (output_table_data): Return the longest number.
17343 (prepare_tokens): Output `token_number_max').
17344 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
17345 New.
17346 Use them to define yy_token_number_type/TokenNumberType.
17347 Use this type for yytranslate.
17348 * tests/torture.at (Big triangle): Push the limit from 124 to
17349 253.
17350 * tests/regression.at (Web2c Actions): Adjust.
17351
817e9f41
AD
173522002-04-07 Akim Demaille <akim@epita.fr>
17353
17354 * tests/torture.at (Big triangle): New.
17355 (GNU AWK Grammar, GNU Cim Grammar): Move to...
17356 * tests/existing.at: here.
17357
5123689b
AD
173582002-04-07 Akim Demaille <akim@epita.fr>
17359
17360 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
17361 nritems.
17362 Adjust dependencies.
17363
f3849179
AD
173642002-04-07 Akim Demaille <akim@epita.fr>
17365
17366 * src/reader.c: Normalize increments to prefix form.
17367
bd02036a
AD
173682002-04-07 Akim Demaille <akim@epita.fr>
17369
17370 * src/reader.c, symtab.c: Remove debugging code.
17371
db8837cb
AD
173722002-04-07 Akim Demaille <akim@epita.fr>
17373
17374 Rename all the `bucket's as `symbol_t'.
17375
17376 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
17377 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
17378 * src/symtab.c, src/symtab.h (bucket): Rename as...
17379 (symbol_t): this.
17380 (symbol_list_new, bucket_check_defined, bucket_make_alias)
17381 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
17382 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
17383 (buckets_new, buckets_free, buckets_do): Rename as...
17384 (symbol_list_new, symbol_check_defined, symbol_make_alias)
17385 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
17386 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
17387 (symbols_new, symbols_free, symbols_do): these.
17388
72a23c97
AD
173892002-04-07 Akim Demaille <akim@epita.fr>
17390
17391 Use lib/hash for the symbol table.
17392
17393 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
17394 EOF.
17395 * src/lex.c (lex): Set the `number' member of new terminals.
17396 * src/reader.c (bucket_check_defined, bucket_make_alias)
17397 (bucket_check_alias_consistence, bucket_translation): New.
17398 (reader, grammar_free, readgram, token_translations_init)
17399 (packsymbols): Adjust.
17400 (reader): Number the predefined tokens.
17401 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
17402 for predefined tokens.
17403 * src/symtab.h (bucket): Remove all the hash table related
17404 members.
17405 * src/symtab.c (symtab): Replace by...
17406 (bucket_table): this.
17407 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
17408 (buckets_new, buckets_do): New.
17409
280a38c3
AD
174102002-04-07 Akim Demaille <akim@epita.fr>
17411
17412 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
17413 (start_symbol, max_user_token_number, semantic_parser)
17414 (error_token_number): Initialize.
17415 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
17416 Initialize.
17417 (reader): Don't.
17418 (errtoken, eoftoken, undeftoken, axiom): Extern.
17419
03b31c0c
AD
174202002-04-07 Akim Demaille <akim@epita.fr>
17421
17422 * src/gram.h (rule_s): prec and precsym are now pointers
17423 to the bucket giving the priority/associativity.
17424 Member `associativity' removed: useless.
17425 * src/reduce.c, src/conflicts.c: Adjust.
17426
8b3df748
AD
174272002-04-07 Akim Demaille <akim@epita.fr>
17428
17429 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
17430 Properly escape the symbols' TAG when outputting them.
17431
e601aa1d
AD
174322002-04-07 Akim Demaille <akim@epita.fr>
17433
17434 * src/lalr.h (LA): Is a bitsetv, not bitset*.
17435
b0299a2e
AD
174362002-04-07 Akim Demaille <akim@epita.fr>
17437
17438 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
17439 (LArule): this, which is an array to rule_t*.
17440 * src/print.c, src/conflicts.c: Adjust.
17441
d7e1f00c
AD
174422002-04-07 Akim Demaille <akim@epita.fr>
17443
17444 * src/gram.h (rule_t): Rename `number' as `user_number'.
17445 `number' is a new member.
17446 Adjust dependencies.
17447 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
17448
cc9305dd
AD
174492002-04-07 Akim Demaille <akim@epita.fr>
17450
17451 As a result of the previous patch, it is no longer needed
17452 to reorder ritem itself.
17453
17454 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
17455
b0940840
AD
174562002-04-07 Akim Demaille <akim@epita.fr>
17457
17458 Be sure never to walk through RITEMS, but use only data related to
17459 the rules themselves. RITEMS should be banished.
17460
17461 * src/output.c (output_token_translations): Rename as...
17462 (prepare_tokens): this.
17463 In addition to `translate', prepare the muscles `tname' and
17464 `toknum', which were handled by...
17465 (output_rule_data): this.
17466 Remove, and move the remainder of its outputs into...
17467 (prepare_rules): this new routines, which also merges content from
17468 (output_gram): this.
17469 (prepare_rules): Be sure never to walk through RITEMS.
17470 (output_stos): Rename as...
17471 (prepare_stos): this.
17472 (output): Always invoke prepare_states, after all, just don't use it
17473 in the output if you don't need it.
17474
643a5994
AD
174752002-04-07 Akim Demaille <akim@epita.fr>
17476
17477 * src/LR0.c (new_state): Display `nstates' as the name of the
17478 newly created state.
17479 Adjust to initialize first_state and last_state if needed.
17480 Be sure to distinguish the initial from the final state.
17481 (new_states): Create the itemset of the initial state, and use
17482 new_state.
17483 * src/closure.c (closure): Now that the initial state has its
17484 items properly set, there is no need for a special case when
17485 creating `ruleset'.
17486
17487 As a result, now the rule 0, reducing to $axiom, is visible in the
17488 outputs. Adjust the test suite.
17489
17490 * tests/conflicts.at (Solved SR Conflicts)
17491 (Unresolved SR Conflicts): Adjust.
17492 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
17493 * tests/conflicts.at (S/R in initial): New.
17494
b4c4ccc2
AD
174952002-04-07 Akim Demaille <akim@epita.fr>
17496
17497 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
17498 the RHS of the rules.
17499 * src/output.c (output_gram): Likewise.
17500
bba97eb2
AD
175012002-04-07 Akim Demaille <akim@epita.fr>
17502
17503 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
17504 bucket.
17505 Adjust all dependencies.
17506 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
17507 `number' of the buckets too.
17508 * src/gram.h: Include `symtab.h'.
17509 (associativity): Move to...
17510 * src/symtab.h: here.
17511 No longer include `gram.h'.
17512
c3b407f4
AD
175132002-04-07 Akim Demaille <akim@epita.fr>
17514
17515 * src/gram.h, src/gram.c (rules_rhs_length): New.
17516 (ritem_longest_rhs): Use it.
17517 * src/gram.h (rule_t): `number' is a new member.
17518 * src/reader.c (packgram): Set it.
17519 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
17520 the end of `rules', and count them out of `nrules'.
17521 (reduce_output, dump_grammar): Adjust.
17522 * src/print.c (print_grammar): It is no longer needed to check for
17523 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
17524 * tests/reduce.at (Reduced Automaton): New test.
17525
11652ab3
AD
175262002-04-07 Akim Demaille <akim@epita.fr>
17527
17528 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
17529 lacking `+ 1' to nrules, Bison reported as useless a token if it
17530 was used solely to set the precedence of the last rule...
17531
26b23c1a
AD
175322002-04-07 Akim Demaille <akim@epita.fr>
17533
17534 * data/bison.c++, data/bison.simple: Don't output the current file
17535 name in #line, to avoid useless diffs between two identical
17536 outputs under different names.
17537
18bcecb0
AD
175382002-04-07 Akim Demaille <akim@epita.fr>
17539
17540 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
17541 Normalize loops to using `< nrules + 1', not `<= nrules'.
17542
fa770c86
AD
175432002-04-07 Akim Demaille <akim@epita.fr>
17544
17545 * TODO: Update.
17546
d9b739c3
AD
175472002-04-07 Akim Demaille <akim@epita.fr>
17548
17549 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
17550 bucket.value as bucket.number.
17551
99013900
AD
175522002-04-07 Akim Demaille <akim@epita.fr>
17553
17554 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
17555 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
17556 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
17557 RHS, instead of being an index in RITEMS.
17558
e966383b
PE
175592002-04-04 Paul Eggert <eggert@twinsun.com>
17560
17561 * doc/bison.texinfo: Update copyright date.
17562 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
17563 (Symbols): Warn about running Bison in one character set,
17564 but compiling and/or running in an incompatible one.
17565 Warn about character code 256, too.
17566
175672002-04-03 Paul Eggert <eggert@twinsun.com>
17568
17569 * src/bison.data (YYSTACK_ALLOC): Depend on whether
17570 YYERROR_VERBOSE is nonzero, not whether it is defined.
17571
17572 Merge changes from bison-1_29-branch.
c307773e 17573
8d6c48b9
PE
175742002-03-20 Paul Eggert <eggert@twinsun.com>
17575
17576 Merge fixes from Debian bison_1.34-1.diff.
17577
17578 * configure.in (AC_PREREQ): 2.53.
17579
e53c6322
AD
175802002-03-20 Akim Demaille <akim@epita.fr>
17581
17582 * src/conflicts.c (log_resolution): Argument `resolution' is const.
17583
9ffbeca7
PE
175842002-03-19 Paul Eggert <eggert@twinsun.com>
17585
21db0b2a
PE
17586 * src/bison.simple (YYCOPY): New macro.
17587 (YYSTACK_RELOCATE): Use it.
17588 Remove Type arg; no longer needed. All callers changed.
17589 (yymemcpy): Remove; no longer needed.
17590
9ffbeca7
PE
17591 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
17592 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
17593
642cb8f8
AD
175942002-03-19 Akim Demaille <akim@epita.fr>
17595
17596 Test and fix the #line outputs.
17597
17598 * tests/atlocal.at (GCC): New.
17599 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
0ffd4fd1 17600 (Prologue synch line, %union synch line, Postprologue synch line)
642cb8f8
AD
17601 (Action synch line, Epilogue synch line): New tests.
17602 * src/reader.c (parse_union_decl): Define the muscle stype_line.
17603 * data/bison.simple, data/bison.c++: Use it.
17604
3c31a486
AD
176052002-03-19 Akim Demaille <akim@epita.fr>
17606
17607 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
17608 (Solved SR Conflicts, %expect not enough, %expect right)
17609 (%expect too much): Move to...
17610 * tests/conflicts.at: this new file.
17611
0d8bed56
AD
176122002-03-19 Akim Demaille <akim@epita.fr>
17613
17614 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
17615 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
17616 that we can move to enums for instance.
17617 * src/output.c (token_definitions_output): Output a list of
17618 `token-name, token-number' instead of the #define.
17619 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
17620
9208d17f
AD
176212002-03-14 Akim Demaille <akim@epita.fr>
17622
17623 Use Gettext 0.11.1.
17624
af27eacb
RA
176252002-03-09 Robert Anisko <robert@lrde.epita.fr>
17626
17627 * data/bison.c++: Make the user able to add members to the generated
17628 parser by subclassing.
17629
9101a310
RA
176302002-03-05 Robert Anisko <robert@lrde.epita.fr>
17631
17632 * src/reader.c (read_additionnal_code): `c' should be an integer, not
17633 a character.
17634 Reported by Nicolas Tisserand and Nicolas Burrus.
17635
fff9bf0b
RA
176362002-03-04 Robert Anisko <robert@lrde.epita.fr>
17637
17638 * src/reader.c: Warn about lacking semi-colons, do not complain.
17639
64dba31e
RA
176402002-03-04 Robert Anisko <robert@lrde.epita.fr>
17641
17642 * data/bison.c++: Remove a debug line.
17643
374f5a14
RA
176442002-03-04 Robert Anisko <robert@lrde.epita.fr>
17645
17646 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
17647 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
17648 provide a default implementation.
17649
bfcf1f3a
AD
176502002-03-04 Akim Demaille <akim@epita.fr>
17651
17652 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
17653 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
17654 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
17655 * tests/semantic.at (Parsing Guards): Similarly.
17656 * src/reader.at (readgram): Complain if the last rule is not ended
17657 with a semi-colon.
17658
65ccf9fc
AD
176592002-03-04 Akim Demaille <akim@epita.fr>
17660
17661 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
17662 * src/closure.c: here.
17663 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
17664 RTC.
17665 * src/warshall.h, src/warshall.c: Remove.
17666 * tests/sets.at (Broken Closure): Adjust.
17667
d0039cbc
AD
176682002-03-04 Akim Demaille <akim@epita.fr>
17669
17670 * src/output.c (output_skeleton): tempdir is const.
17671 bytes_read is unused.
17672
345cea78
AD
176732002-03-04 Akim Demaille <akim@epita.fr>
17674
17675 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
17676 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
17677 Update.
17678 From Michael Hayes.
17679
564801f7
AD
176802002-03-04 Akim Demaille <akim@epita.fr>
17681
17682 * src/closure.c (closure): `r' is unused.
17683
e5352bc7
AD
176842002-03-04 Akim Demaille <akim@epita.fr>
17685
17686 * tests/sets.at (Broken Closure): Add the ending `;'.
17687 * src/reader.at (readgram): Complain if a rule is not ended with a
17688 semi-colon.
17689
914feea9
AD
176902002-03-04 Akim Demaille <akim@epita.fr>
17691
17692 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
17693 (count_sr_conflicts): Use bitset_count.
17694 * src/reduce.c (inaccessable_symbols): Ditto.
17695 (bits_size): Remove.
17696 * src/warshall.h, src/warshall.c: Convert to bitsetv.
17697
f0250de6
AD
176982002-03-04 Akim Demaille <akim@epita.fr>
17699
17700 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
17701 * src/reduce.c: Remove the `bitset_zero's following the
17702 `bitset_create's, as now it is performed by the latter.
17703
ef017502
AD
177042002-03-04 Akim Demaille <akim@epita.fr>
17705
17706 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
17707 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
17708 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
17709 latest sources from Michael.
17710
76514394
AD
177112002-03-04 Akim Demaille <akim@epita.fr>
17712
17713 * src/output.c (output): Don't free the grammar.
17714 * src/reader.c (grammar_free): New.
17715 * src/main.c (main): Call it and don't free symtab here.
17716
55024580
AD
177172002-03-04 Akim Demaille <akim@epita.fr>
17718
17719 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
17720 before returning.
17721 Reported by Benoit Perrot.
17722
f9abaa2c
AD
177232002-03-04 Akim Demaille <akim@epita.fr>
17724
17725 Use bitset operations when possible, not loops over bits.
17726
17727 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
17728 bitset_or.
17729 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
17730 * src/reduce.c (useless_nonterminals): Formatting changes.
17731 * src/warshall.c (TC): Use bitset_or.
17732
0e721e75
AD
177332002-03-04 Akim Demaille <akim@epita.fr>
17734
17735 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
17736 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
17737 Ditto.
17738
0fb1ffb1
AD
177392002-03-04 Akim Demaille <akim@epita.fr>
17740
17741 * src/lalr.c (F): Now a bitset*.
17742 Adjust all dependencies.
17743
b86796bf
AD
177442002-03-04 Akim Demaille <akim@epita.fr>
17745
17746 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
17747 Adjust all dependencies.
17748
602bbf31
AD
177492002-03-04 Akim Demaille <akim@epita.fr>
17750
17751 * src/L0.c, src/LR0.h (nstates): Be size_t.
17752 Adjust comparisons (signed vs unsigned).
17753 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
17754 bitset*.
17755 Adjust all dependencies.
17756
d8a0245c
AD
177572002-03-04 Akim Demaille <akim@epita.fr>
17758
17759 * src/closure.c (firsts): Now, also a bitset.
17760 Adjust all dependencies.
17761 (varsetsize): Remove, now unused.
17762 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
17763
34ba9743
AD
177642002-03-04 Akim Demaille <akim@epita.fr>
17765
17766 * src/print.c: Convert to use bitset.h, not hand coded iterations
17767 over ints.
17768
ed86e78c
AD
177692002-03-04 Akim Demaille <akim@epita.fr>
17770
17771 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
17772
dfdb1797
AD
177732002-03-04 Akim Demaille <akim@epita.fr>
17774
17775 * src/closure.c (ruleset): Be a bitset.
17776 (rulesetsize): Remove.
17777
7086e707
AD
177782002-03-04 Akim Demaille <akim@epita.fr>
17779
17780 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
17781 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
17782 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
17783 * src/closure.c (fderives): Be an array of bitsets.
17784
98254360
RA
177852002-02-28 Robert Anisko <robert@lrde.epita.fr>
17786
17787 * data/bison.c++: Merge the two generated headers. Insert a copyright
17788 notice in each output file.
17789
a75c057f
AD
177902002-02-28 Akim Demaille <akim@epita.fr>
17791
17792 * data/bison.c++: Copy the prologue of bison.simple to fetch
17793 useful M4 definitions, such as b4_header_guard.
17794
06b00abc
AD
177952002-02-25 Akim Demaille <akim@epita.fr>
17796
17797 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
17798 translator friendly scheme for the bgr
17799 copyright notice.
06b00abc 17800
70e7d534
AD
178012002-02-25 Akim Demaille <akim@epita.fr>
17802
17803 * src/output.c (header_output): Remove, now handled completely via
17804 M4.
17805
abe017f6
AD
178062002-02-25 Akim Demaille <akim@epita.fr>
17807
17808 * m4/m4.m4: New, from CVS Autoconf.
17809 * configure.in: Invoke it.
17810 * src/output.c (output_skeleton): Use its result instead of the
17811 hard coded name.
17812
381fb12e
AD
178132002-02-25 Akim Demaille <akim@epita.fr>
17814
17815 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
17816 Fileutils 4.1.5.
17817 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
17818 * src/output.c (output_skeleton): Use mkstemp to create a real
17819 temporary file.
17820 Move the filling of `skeleton' and its muscle to...
17821 (prepare): here.
17822 (output): Move the definition of the prologue muscle to...
17823 (prepare): here.
17824 * src/system.h (DEFAULT_TMPDIR): New.
17825
6f38107f
PE
178262002-02-14 Paul Eggert <eggert@twinsun.com>
17827
17828 Remove the support for C++ namespace cleanliness; it was
17829 causing more problems than it was curing, since it didn't work
17830 properly on some nonstandard C++ compilers. This can wait
17831 for a proper C++ parser.
17832
17833 * NEWS: Document this.
17834 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
17835 of C++, as it's treated like C now.
17836 * src/bison.simple (YYSTD): Remove.
17837 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
17838 Treat C++ just like Standard C instead of trying to support
17839 namespace cleanliness.
17840
80cce3da
AD
178412002-02-14 Akim Demaille <akim@epita.fr>
17842
17843 * tests/regression.at (else): Adjust to Andreas' change.
17844
842e8679
AD
178452002-02-14 Akim Demaille <akim@epita.fr>
17846
17847 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
17848
4bda3f10
AD
178492002-02-13 Andreas Schwab <schwab@suse.de>
17850
17851 * src/output.c (output_rule_data): Don't output NULL, it might
17852 not be defined yet.
17853
4162fa07 178542002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 17855
4162fa07
RA
17856 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
17857 (Copyright notice): Update.
b418ecd8 17858
bd16a5dc
AD
178592002-02-11 Akim Demaille <akim@epita.fr>
17860
17861 * tests/regression.at (%nonassoc and eof): Don't include
17862 nonportable headers.
17863
8d69a1a3
RA
178642002-02-08 Robert Anisko <robert@lrde.epita.fr>
17865
17866 * data/bison.c++: Correct error recovery. Make the user able to
17867 initialize the starting location.
17868
9b2d0677
AD
178692002-02-07 Akim Demaille <akim@epita.fr>
17870
17871 * tests/input.at: New.
17872
69e2658b
RA
178732002-02-07 Robert Anisko <robert@lrde.epita.fr>
17874
17875 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 17876 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
17877 directives around tables only needed for debugging.
17878
4aacc3a7
RA
178792002-02-07 Robert Anisko <robert@lrde.epita.fr>
17880
17881 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
17882 C++ parsers.
17883 (yy::b4_name::parse): Use print_.
17884
762a801e
RA
178852002-02-07 Robert Anisko <robert@lrde.epita.fr>
17886
17887 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
17888
4bb2bc3f
RA
178892002-02-07 Robert Anisko <robert@lrde.epita.fr>
17890
17891 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
17892 C++ parsers.
17893 (yy::b4_name::parse): Build verbose error messages, and use error_.
17894
6b45a3ca
RA
178952002-02-06 Robert Anisko <robert@lrde.epita.fr>
17896
17897 * data/bison.c++: Fix m4 quoting in comments.
17898
50997c6e
RA
178992002-02-06 Robert Anisko <robert@lrde.epita.fr>
17900
17901 * data/bison.c++: Adjust the parser code. Fix some muscles that were
17902 not expanded by m4.
17903
3f3eed27
AD
179042002-02-05 Akim Demaille <akim@epita.fr>
17905
17906 * data/bison.c++: Adjust to the M4 back end.
17907 More is certainly needed.
17908
be2a1a68
AD
179092002-02-05 Akim Demaille <akim@epita.fr>
17910
17911 Give a try to M4 as a back end.
17912
17913 * lib/readpipe.c: New, from wdiff.
17914 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
17915 BISON_HAIRY.
17916 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
17917 specific values. Now it is m4 that performs the lookup.
17918 * src/parse-skel.y: Remove.
17919 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
17920 * src/output.c (actions_output, guards_output)
17921 (token_definitions_output): No longer keeps track of the output
17922 line number, hence remove the second argument.
17923 (guards_output): Check against the guard member of a rule, not the
17924 action member.
17925 Adjust callers.
17926 (output_skeleton): Don't look for the skeleton location, let m4 do
17927 that.
17928 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
17929 file will be used.
17930 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
17931 (prepare): Given that for the time being changesyntax is not
17932 usable in M4, rename the muscles using `-' to `_'.
17933 Define `defines_flag', `output_parser_name' and `output_header_name'.
17934 * src/output.h (actions_output, guards_output)
17935 (token_definitions_output): Adjust prototypes.
17936 * src/scan-skel.l: Instead of scanning the skeletons, it now
17937 processes the output of m4: `__oline__' and `#output'.
17938 * data/bison.simple: Adjust to be used by M4(sugar).
17939 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
17940 to date.
17941 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
17942 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
17943 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
17944 shamelessly stolen from CVS Autoconf.
17945
beda758b
AD
179462002-02-05 Akim Demaille <akim@epita.fr>
17947
17948 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
17949 * configure.in: Check for the declarations of free and malloc.
17950 * src/muscle_tab.c: Adjust.
17951
5ece6d43
AD
179522002-02-05 Akim Demaille <akim@epita.fr>
17953
17954 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
17955 which have no values.
17956
5bb18f9a
AD
179572002-02-05 Akim Demaille <akim@epita.fr>
17958
17959 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
17960 * data/: here.
17961
894dd62e
PE
179622002-01-29 Paul Eggert <eggert@twinsun.com>
17963
17964 * src/bison.simple (YYSIZE_T): Do not define merely because
17965 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
17966 On some platforms, <alloca.h> does not declare YYSTD (size_t).
17967
82841af7
AD
179682002-01-27 Akim Demaille <akim@epita.fr>
17969
17970 Fix `%nonassoc and eof'.
17971
17972 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
17973 which were not properly copied! Replace
17974 memcpy (res->errs, src->errs, src->nerrs);
17975 with
17976 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
17977 !!!
17978 * tests/regression.at (%nonassoc and eof): Adjust to newest
17979 Autotest: `.' is not in the PATH.
17980
318b76e9
AD
179812002-01-27 Akim Demaille <akim@epita.fr>
17982
17983 * tests/sets.at (AT_EXTRACT_SETS): New.
17984 (Nullable): Use it.
17985 (Firsts): New.
17986
30d2f3d5
AD
179872002-01-26 Akim Demaille <akim@epita.fr>
17988
17989 * tests/actions.at, tests/calc.at, tests/headers.at,
17990 * tests/torture.at: Adjust to the newest Autotest which no longer
17991 forces `.' in the PATH.
17992
30f8c395
AD
179932002-01-25 Akim Demaille <akim@epita.fr>
17994
17995 * tests/regression.at (%nonassoc and eof): New.
17996 Suggested by Robert Anisko.
17997
29ae55f1
AD
179982002-01-24 Akim Demaille <akim@epita.fr>
17999
18000 Bison dumps core when trying to complain about broken input files.
18001 Reported by Cris van Pelt.
18002
18003 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
18004 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
18005 into...
18006 (Invalid inputs): Strengthen: exercise parse_percent_token.
18007
2b548aa6
RA
180082002-01-24 Robert Anisko <robert.anisko@epita.fr>
18009
18010 * src/Makefile.am: Add bison.c++.
18011 * src/bison.c++: New skeleton.
18012
bb0146c2
AD
180132002-01-21 Paolo Bonzini <bonzini@gnu.org>
18014
18015 * po/it.po: New.
18016
bec30531
AD
180172002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
18018
18019 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
18020
fc6edc45
MA
180212002-01-20 Marc Autret <marc@gnu.org>
18022
18023 * src/files.c (compute_output_file_names): Fix
18024
5e5d5415
MA
180252002-01-20 Marc Autret <marc@gnu.org>
18026
18027 * tests/output.at: New test.
18028 * src/files.c (compute_base_names): Don't map extensions when
18029 the YACC flag is set, use defaults.
18030 Reported by Evgeny Stambulchik.
18031
44ea3fbd
MA
180322002-01-20 Marc Autret <marc@gnu.org>
18033
ba0fe3c7
PE
18034 * src/system.h: Need to define __attribute__ away for non-GCC
18035 compilers as well (i.e., the vendor C compiler).
44ea3fbd
MA
18036 Suggested by Albert Chin-A-Young.
18037
338963d1
TVH
180382002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
18039
18040 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
18041 canonical definition.
18042 * src/system.h: Use the canonical definition for PARAMS (avoids
18043 a conflict with the macro from lib/hash.h).
18044
c57b2479
AD
180452002-01-11 Akim Demaille <akim@epita.fr>
18046
18047 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 18048 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 18049
b85810ae
AD
180502002-01-09 Akim Demaille <akim@epita.fr>
18051
18052 * src/files.c, src/files.h (output_infix): New.
18053 (tab_extension): Remove.
18054 (compute_base_names): Compute the former, drop the latter.
18055 * src/output.c (prepare): Insert the muscles `output-infix', and
18056 `output-suffix'.
18057 * src/parse-skel.y (string, string.1): New.
18058 (section.header): Use it.
18059 (section.yacc): Remove.
18060 (prefix): Remove too.
18061 * src/scan-skel.l: Adjust.
18062 * src/bison.simple, src/bison.hairy: Adjust.
18063
cae60122
AD
180642002-01-09 Akim Demaille <akim@epita.fr>
18065
18066 * configure.in (WERROR_CFLAGS): Compute it.
18067 * src/Makefile.am (CFLAGS): Pass it.
18068 * tests/atlocal.in (CFLAGS): Idem.
18069 * src/files.c: Fix a few warnings.
18070 (get_extension_index): Remove, unused.
18071
ae404801
AD
180722002-01-08 Akim Demaille <akim@epita.fr>
18073
18074 * src/getargs.c (AS_FILE_NAME): New.
18075 (getargs): Use it to convert DOSish file names.
18076 * src/files.c (base_name): Rename as full_base_name to avoid
18077 clashes with `base_name ()'.
18078 (filename_split): New.
18079 (compute_base_names): N-th rewrite, using filename_split.
18080
22312b71
AD
180812002-01-08 Akim Demaille <akim@epita.fr>
18082
18083 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
18084 New, stolen from the Fileutils 4.1.
18085 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
18086 * configure.in: Check for the presence of memrchr, and of its
18087 prototype.
18088
a67cef01
TVH
180892002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
18090
18091 * lib/hash.h (__P): Added definition for this macro.
18092 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
18093 BUILT_SOURCES, to ensure they are generated first.
18094 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
18095 %error-verbose to allow bootstrapping with bison 1.30x.
18096
2b25d624
AD
180972002-01-06 Akim Demaille <akim@epita.fr>
18098
18099 * src/reader.c (parse_braces): Don't fetch the next char, the
18100 convention is to fetch on entry.
18101 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
18102 'switch' without a following semicolon.
18103 * tests/regression.at (braces parsing): New.
18104
3460813b
AD
181052002-01-06 Akim Demaille <akim@epita.fr>
18106
18107 Bison is dead wrong in its RR conflict reports.
18108
18109 * tests/torture.at (GNU Cim Grammar): New.
18110 * src/conflicts.c (count_rr_conflicts): Fix.
18111
73784c64
AD
181122002-01-06 Akim Demaille <akim@epita.fr>
18113
18114 Creating package.m4 from configure.ac causes too many problems.
18115
18116 * tests/Makefile.am (package.m4): Create it by hand,
18117 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
18118
25d81090
AD
181192002-01-06 Akim Demaille <akim@epita.fr>
18120
18121 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
18122 skeleton.h.
18123
a9b8959e
PE
181242002-01-04 Paul Eggert <eggert@twinsun.com>
18125
18126 * doc/bison.texinfo (Debugging):
18127 Remove YYSTDERR; it's no longer defined or used.
18128 Also, s/cstdio.h/cstdio/.
18129
25d81090
AD
181302002-01-03 Akim Demaille <akim@epita.fr>
18131
18132 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
18133
1109455c
AD
181342002-01-03 Akim Demaille <akim@epita.fr>
18135
18136 * src/parse-skel.y (process_skeleton): Don't bind the parser's
18137 tracing code to --trace, wait for a better --trace option, with
18138 args.
18139
7ea5e977
AD
181402002-01-03 Akim Demaille <akim@epita.fr>
18141
18142 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
18143 The ISO C++ standard is extremely clear about it: stderr is
18144 considered a macro, not a regular symbol (see table 94 `Header
18145 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
18146 Therefore std:: does not apply to it. It still does with fprintf.
18147 Also, s/cstdio.h/cstdio/.
18148
fab5b110
AD
181492002-01-03 Akim Demaille <akim@epita.fr>
18150
18151 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
18152 for non system headers.
18153
aed7fd9b
AD
181542002-01-02 Akim Demaille <akim@epita.fr>
18155
18156 Equip the skeleton chain with location tracking, runtime trace,
18157 pure parser and scanner.
18158
18159 * src/parse-skel.y: Request a pure parser, locations, and prefix
18160 renaming.
18161 (%union): Having several members with the same type does not help
18162 type mismatches, simplify.
18163 (YYPRINT, yyprint): New.
18164 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
18165 (skel_error): this.
18166 Handle locations.
18167 * src/scan-skel.l: Adjust to these changes.
18168 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
18169 (LOCATION_PRINT, skel_control_t): New.
18170
24fad99e
AD
181712001-12-30 Akim Demaille <akim@epita.fr>
18172
18173 * src/parse-skel.y: Get rid of the shift/reduce conflict:
18174 replace `gb' with BLANKS.
18175 * src/scan-skel.l: Adjust.
18176
a4b36db4
AD
181772001-12-30 Akim Demaille <akim@epita.fr>
18178
18179 * src/system.h: We don't need nor want bcopy.
18180 Throw away MS-DOS crap: we don't need getpid.
18181 * configure.in: We don't need strndup. It was even causing
18182 problems: because Flex includes the headers *before* us,
18183 _GNU_SOURCE is not defined by config.h, and therefore strndup was
18184 not visible.
18185 * lib/xstrndup.c: New.
18186 * src/scan-skel.l: Use it.
18187 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
18188 * src/parse-skel.y: Use %directives instead of #defines.
18189
1239777d
AD
181902001-12-30 Akim Demaille <akim@epita.fr>
18191
18192 * src/skeleton.h: New.
18193 * src/output.c (output_parser, output_master_parser): Remove, dead
18194 code.
18195 * src/output.h (get_lines_number, actions_output, guards_output)
18196 (token_definitions_output): Prototype them.
18197 * src/parse-skel.y: Add the license notice.
18198 Include output.h and skeleton.h.
18199 (process_skeleton): Returns void, and takes a single parameter.
18200 * src/scan-skel.l: Add the license notice.
18201 Include skeleton.h.
18202 Don't use %option yylineno: it seems that then Flex imagines
18203 REJECT has been used, and therefore it won't reallocate its
18204 buffers (which makes no other sense to me than a bug). It results
18205 in warnings for `unused: yy_flex_realloc'.
18206
9b3add5b
RA
182072001-12-30 Robert Anisko <robert.anisko@epita.fr>
18208
18209 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
18210 (MUSCLE_INSERT_PREFIX): ...to there.
18211 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
18212 (MUSCLE_INSERT_PREFIX): Move from here...
18213
18214 * src/bison.hairy: Add a section directive. Put braces around muscle
18215 names. This parser skeleton is still broken, but Bison should not
18216 choke on a bad muscle 'syntax'.
18217 * src/bison.simple: Add a section directive. Put braces around muscle
18218 names.
18219
18220 * src/files.h (strsuffix, stringappend): Add declarations.
18221 (tab_extension): Add declaration.
18222 (short_base_name): Add declaration.
18223
18224 * src/files.c (strsuffix, stringappend): No longer static. These
18225 functions are used in the skeleton parser.
18226 (tab_extension): New.
18227 (compute_base_names): Use the computations done in this function
fab5b110 18228 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
18229 names.
18230 (short_base_name): No longer static.
18231
18232 * src/output.c (output_skeleton): New.
18233 (output): Disable call to output_master_parser, and give a try to
18234 a new skeleton handling system.
18235 (guards_output, actions_output): No longer static.
18236 (token_definitions_output, get_lines_number): No longer static.
18237
18238 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
18239
fab5b110 18240 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
18241 parse-skel.y.
18242
18243 * src/parse-skel.y: New file.
18244 * src/scan-skel.l: New file.
18245
b5b61c61
AD
182462001-12-29 Akim Demaille <akim@epita.fr>
18247
18248 %name-prefix is broken.
18249
18250 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
18251 Adjust all dependencies.
18252 * tests/headers.at (export YYLTYPE): Strengthen this test: use
18253 %name-prefix.
18254
18255 Renaming yylval but not yylloc is not consistent. Now we do.
18256
18257 * src/bison.simple: Prefix yylloc if used.
18258 * doc/bison.texinfo (Decl Summary): Document that.
18259
8c9a50be
AD
182602001-12-29 Akim Demaille <akim@epita.fr>
18261
18262 * doc/bison.texinfo: Promote `%long-directive' over
18263 `%long_directive'.
18264 Remove all references to fixed-output-files, yacc is enough.
18265
d99361e6
AD
182662001-12-29 Akim Demaille <akim@epita.fr>
18267
18268 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
18269 user prologue. These are defaults.
18270 * tests/actions.at (Mid-rule actions): Make sure the user can
18271 define YYDEBUG and YYERROR_VERBOSE.
18272
b9cecb91
AD
182732001-12-29 Akim Demaille <akim@epita.fr>
18274
18275 * src/output.c (header_output): Don't forget to export YYLTYPE and
18276 yylloc.
18277 * tests/headers.at (export YYLTYPE): New, make sure it does.
18278 * tests/regression.at (%union and --defines, Invalid CPP headers):
18279 Move to...
18280 * tests/headers.at: here.
18281
aea13e97
AD
182822001-12-29 Akim Demaille <akim@epita.fr>
18283
18284 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
18285
931394cb
AD
182862001-12-29 Akim Demaille <akim@epita.fr>
18287
18288 * tests/actions.at (Mid-rule actions): Output on a single line
18289 instead of several.
18290
704a47c4
AD
182912001-12-29 Akim Demaille <akim@epita.fr>
18292
18293 * doc/bison.texinfo: Formatting changes.
18294
091e20bb
AD
182952001-12-29 Akim Demaille <akim@epita.fr>
18296
18297 Don't store the token defs in a muscle, just be ready to output it
18298 on command. Now possible via `symbols'. Fixes a memory leak.
18299
18300 * src/output.c (token_definitions_output): New.
18301 (output_parser, header_output): Use it.
18302 * src/reader.c (symbols_save): Remove.
18303
cce71710
AD
183042001-12-29 Akim Demaille <akim@epita.fr>
18305
18306 * src/bison.simple: Do not provide a default for YYSTYPE and
18307 YYLTYPE before the user's prologue. Otherwise it's hardly... a
18308 default.
18309
82c035a8
AD
183102001-12-29 Akim Demaille <akim@epita.fr>
18311
18312 Mid-rule actions are simply... ignored!
18313
18314 * src/reader.c (readgram): Be sure to attach mid-rule actions to
18315 the empty-rule associated to the dummy symbol, not to the host
18316 rule.
18317 * tests/actions.at (Mid-rule actions): New.
18318
8419d367
AD
183192001-12-29 Akim Demaille <akim@epita.fr>
18320
18321 Memory leak.
18322
18323 * src/reader.c (reader): Free grammar.
18324
375d5806
AD
183252001-12-29 Akim Demaille <akim@epita.fr>
18326
18327 Memory leak.
18328
18329 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
18330 since it allocates it for each state, although only one is needed.
18331 (allocate_storage): Do it here.
18332
f51cb8ff
AD
183332001-12-29 Akim Demaille <akim@epita.fr>
18334
18335 * src/options.h, src/options.c (create_long_option_table): Rename
18336 as...
18337 (long_option_table_new): this, with a clearer prototype.
18338 (percent_table): Remove, unused,
18339 * src/getargs.c (getargs): Adjust.
18340
29e88316
AD
183412001-12-29 Akim Demaille <akim@epita.fr>
18342
18343 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
18344 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
18345 as states.
18346
b9f71f19
AD
183472001-12-29 Akim Demaille <akim@epita.fr>
18348
18349 * src/lalr.c (build_relations): Rename `states' as `states1'.
18350 Sorry, I don't understand exactly what it is, no better name...
18351
1a2b5d37
AD
183522001-12-29 Akim Demaille <akim@epita.fr>
18353
18354 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
18355 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
18356 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
18357 as rules.
18358
1cca533e
AD
183592001-12-29 Akim Demaille <akim@epita.fr>
18360
18361 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
18362 ago.
18363
c03ae966
AD
183642001-12-29 Akim Demaille <akim@epita.fr>
18365
18366 * src/reader.c, src/reader.h (user_toknums): Remove.
18367 Adjust all users to use symbols[i]->user_token_number.
18368
5a670b1e
AD
183692001-12-29 Akim Demaille <akim@epita.fr>
18370
18371 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
18372 Adjust all users to use symbols[i]->prec or ->assoc.
18373
ad949da9
AD
183742001-12-29 Akim Demaille <akim@epita.fr>
18375
18376 * src/reader.c, src/reader.h (tags): Remove.
18377 Adjust all users to use symbols[i]->tag.
18378
0e78e603
AD
183792001-12-29 Akim Demaille <akim@epita.fr>
18380
18381 * src/gram.h, src/gram.c (symbols): New, similar to state_table
18382 and rule_table.
18383 * src/reader.c (packsymbols): Fill this table.
18384 Drop sprec.
18385 * src/conflicts.c (resolve_sr_conflict): Adjust.
18386 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
18387 single table.
18388 Use symbols[i]->tag instead of tags[i].
18389
213e640e
AD
183902001-12-29 Akim Demaille <akim@epita.fr>
18391
18392 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
18393 In addition, put a comment in there, to replace...
18394 * tests/regression.at (%union and C comments): Remove.
18395
e7b8bef1
AD
183962001-12-29 Akim Demaille <akim@epita.fr>
18397
18398 * tests/regression.at (Web2c Actions): Blindly move the actual
18399 output as expected output. The contents *seem* right to me, but I
18400 can't pretend reading perfectly parser tables... Nonetheless, all
18401 the other tests pass correctly, the table look OK, even though the
18402 presence of `$axiom' is to be noted: AFAICS it is useless (but
18403 harmless).
18404
b68e7744
AD
184052001-12-29 Akim Demaille <akim@epita.fr>
18406
18407 * src/reader.c (readgram): Don't add the rule 0 if there were no
18408 rules read. In other words, add it _after_ having performed
18409 grammar sanity checks.
18410 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
18411
78d5bae9
AD
184122001-12-29 Akim Demaille <akim@epita.fr>
18413
18414 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
18415 visible, and some states have now a different number.
18416
ff442794
AD
184172001-12-29 Akim Demaille <akim@epita.fr>
18418
18419 * src/reader.c (readgram): Bind the initial rule's lineno to that
18420 of the first rule.
18421 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
18422 (Solved SR Conflicts): Adjust rule 0's line number.
18423
610ab194
AD
184242001-12-29 Akim Demaille <akim@epita.fr>
18425
18426 Fix the `GAWK Grammar' failure.
18427
18428 * src/LR0.c (final_state): Initialize to -1 so that we do compute
18429 the reductions of the first state which was mistakenly confused
18430 with the final state because precisely final_state was initialized
18431 to 0.
18432 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
18433 now noticed by Bison.
18434 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
18435 have a reduction on $default.
18436
29d29c8f
AD
184372001-12-29 Akim Demaille <akim@epita.fr>
18438
18439 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
18440 rule line numbers.
18441 * src/closure.c (print_closure): Likewise.
18442 * src/derives.c (print_derives): Likewise.
18443 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
18444 now.
18445
7c6b64d0
AD
184462001-12-29 Akim Demaille <akim@epita.fr>
18447
18448 * src/lalr.c (lookaheads_print): New.
18449 (lalr): Call it when --trace-flag.
18450 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
18451 are dumped.
18452
3d4daee3
AD
184532001-12-29 Akim Demaille <akim@epita.fr>
18454
18455 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
18456 when walking through ritem, even via rule->rhs.
18457 * src/reduce.c (dump_grammar, useful_production, reduce_output)
18458 (useful_production, useless_nonterminals): Likewise.
18459 (reduce_grammar_tables): Likewise, plus update nritems.
18460 * src/nullable.c (set_nullable): Likewise.
18461 * src/lalr.c (build_relations): Likewise.
18462 * tests/sets.at (Nullable): Adjust.
18463 Fortunately, now, the $axiom is no longer nullable.
18464
9e7f6bbd
AD
184652001-12-29 Akim Demaille <akim@epita.fr>
18466
18467 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
18468 the 0-sentinel.
18469 * src/gram.c (ritem_longest_rhs): Likewise.
18470 * src/reduce.c (nonterminals_reduce): Likewise.
18471 * src/print_graph.c (print_graph): Likewise.
18472 * src/output.c (output_rule_data): Likewise.
18473 * src/nullable.c (set_nullable): Likewise.
18474
255ef638
AD
184752001-12-29 Akim Demaille <akim@epita.fr>
18476
18477 * src/output.c: Comment changes.
18478
0d8a7363
AD
184792001-12-27 Paul Eggert <eggert@twinsun.com>
18480
18481 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
18482 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
18483 Sparc, as they were causing more porting problems than the
18484 (minor) performance improvement was worth.
18485
18486 Also, catch up with 1.31's YYSTD.
18487
3db472b9
AD
184882001-12-27 Akim Demaille <akim@epita.fr>
18489
18490 * src/output.c (output_gram): Rely on nritems, not the
18491 0-sentinel. See below.
18492 Use -1 as separator, not 0.
18493 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
18494 Rely on -1 as separator in yyrhs, instead of 0.
18495 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
18496 twice `Now at end of input', therefore there are two lines less to
18497 expect.
18498
b365aa05
AD
184992001-12-27 Akim Demaille <akim@epita.fr>
18500
18501 * tests/regression.at (Unresolved SR Conflicts):
18502 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
18503 below.
18504
30171f79
AD
185052001-12-27 Akim Demaille <akim@epita.fr>
18506
18507 * src/LR0.c (new_state): Recognize the final state by the fact it
18508 is reached by eoftoken.
18509 (insert_start_shifting_state, insert_eof_shifting_state)
18510 (insert_accepting_state, augment_automaton): Remove, since now
18511 these states are automatically computed from the initial state.
18512 (generate_states): Adjust.
18513 * src/print.c: When reporting a rule number to the user, substract
18514 1, so that the axiom rule is rule 0, and the first user rule is 1.
18515 * src/reduce.c: Likewise.
18516 * src/print_graph.c (print_core): For the time being, just as for
18517 the report, depend upon --trace-flags to dump the full set of
18518 items.
18519 * src/reader.c (readgram): Once the grammar read, insert the rule
18520 0: `$axiom: START-SYMBOL $'.
18521 * tests/set.at: Adjust: rule 0 is now displayed, and since the
18522 number of the states has changed (the final state is no longer
18523 necessarily the last), catch up.
18524
75142d45
AD
185252001-12-27 Akim Demaille <akim@epita.fr>
18526
18527 Try to make the use of the eoftoken valid. Given that its value
18528 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
18529 is used instead of > 0 where appropriate, (ii), depend upon nritems
18530 instead of the 0-sentinel.
18531
18532 * src/gram.h, src/gram.c (nritems): New.
18533 Expected to be duplication of nitems, but for the time being...
18534 * src/reader.c (packgram): Assert nritems and nitems are equal.
18535 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
18536 * src/closure.c (print_closure, print_fderives): Likewise.
18537 * src/gram.c (ritem_print): Likewise.
18538 * src/print.c (print_core, print_grammar): Likewise.
18539 * src/print_graph.c: Likewise.
18540
b7c49edf
AD
185412001-12-27 Akim Demaille <akim@epita.fr>
18542
18543 * src/main.c (main): If there are complains after grammar
18544 reductions, then output the report anyway if requested, then die.
18545 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
18546 * src/reader.c (eoftoken): New.
18547 (parse_token_decl): If the token being defined has value `0', it
18548 is the eoftoken.
18549 (packsymbols): No longer hack `tags' to insert `$' by hand.
18550 Be sure to preserve the value of the eoftoken.
18551 (reader): Make sure eoftoken is defined.
18552 Initialize nsyms to 0: now eoftoken is created just like the others.
18553 * src/print.c (print_grammar): Don't special case the eof token.
18554 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
18555 lie anyway, albeit pleasant.
18556 * tests/calc.at: Exercise error messages with eoftoken.
18557 Change the grammar so that empty input is invalid.
18558 Adjust expectations.
18559 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
18560
ec2da99f
AD
185612001-12-27 Akim Demaille <akim@epita.fr>
18562
18563 * configure.in: Check the protos of strchr ans strspn.
18564 Replace strchr if needed.
18565 * src/system.h: Provide the protos of strchr, strspn and memchr if
18566 missing.
18567 * lib/strchr.c: New.
18568 * src/reader.c (symbols_save): Use strchr.
18569
8adfa272
AD
185702001-12-27 Akim Demaille <akim@epita.fr>
18571
18572 * src/print.c, src/print_graph.c (escape): New.
18573 Use it to quote the TAGS outputs.
18574 * src/print_graph.c (print_state): Now errors are in red, and
18575 reductions in green.
18576 Prefer high to wide: output the state number on a line of its own.
18577
80dac38c
AD
185782001-12-27 Akim Demaille <akim@epita.fr>
18579
18580 * src/state.h, src/state.c (reductions_new): New.
18581 * src/LR0.c (set_state_table): Let all the states have a
18582 `reductions', even if reduced to 0.
18583 (save_reductions): Adjust.
18584 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
18585 * src/print.c (print_reductions, print_actions): Adjust.
18586 * src/output.c (action_row): Adjust.
18587
2cec70b9
AD
185882001-12-27 Akim Demaille <akim@epita.fr>
18589
18590 * src/state.h, src/state.c (errs_new, errs_dup): New.
18591 * src/LR0.c (set_state_table): Let all the states have an errs,
18592 even if reduced to 0.
18593 * src/print.c (print_errs, print_reductions): Adjust.
18594 * src/output.c (output_actions, action_row): Adjust.
18595 * src/conflicts.c (resolve_sr_conflict): Adjust.
18596
13ca549a
AD
185972001-12-27 Akim Demaille <akim@epita.fr>
18598
18599 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
18600
5092aba5
AD
186012001-12-27 Akim Demaille <akim@epita.fr>
18602
18603 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
18604 * src/print.c: here.
18605 (lookaheadset, shiftset): New, used as additional storage by
18606 print_reductions.
18607 (print_results): Adjust.
18608 (print_shifts, print_gotos, print_errs): New, extracted from...
18609 (print_actions): here.
18610 * src/print_graph.c (print_actions): Remove dead code.
18611
11e2beca
AD
186122001-12-27 Akim Demaille <akim@epita.fr>
18613
18614 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
18615 `$n' and `@n'.
18616
dac3c910
AD
186172001-12-27 Akim Demaille <akim@epita.fr>
18618
18619 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
18620 (build_relations): Adjust.
18621
d0b0fefa
AD
186222001-12-27 Akim Demaille <akim@epita.fr>
18623
18624 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
18625 duplication.
18626
adc8c848
AD
186272001-12-27 Akim Demaille <akim@epita.fr>
18628
18629 * src/reader.c (packgram): Catch nitems overflows.
18630
14d293ac
AD
186312001-12-27 Akim Demaille <akim@epita.fr>
18632
18633 * src/files.c, src/files.h (guard_obstack): Remove.
18634 * src/output.c (output): Adjust.
18635 * src/reader.c (parse_braces): New, factoring...
18636 (copy_action, copy_guard): these two which are renamed as...
18637 (parse_action, parse_guard): these.
18638 As a voluntary consequence, using braces around guards is now
18639 mandatory.
18640
f499b062
AD
186412001-12-27 Akim Demaille <akim@epita.fr>
18642
18643 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
18644 * src/reader.c (symbol_list): `guard' and `guard_line' are new
18645 members.
18646 (symbol_list_new): Adjust.
18647 (copy_action): action_line is the first line, not the last.
18648 (copy_guard): Just as for actions, store the `action' only, not
18649 the switch/case/break flesh.
18650 Don't parse the user action that might follow the guard, let...
18651 (readgram): do it, i.e., now, there can be an action after a
18652 guard.
18653 In other words the guard is just explicitly optional.
18654 (packgram): Adjust.
18655 * src/output.c (guards_output): New.
18656 (output_parser): Call it when needed.
18657 (output): Also free the guard and attrs obstacks.
18658 * src/files.c, src/files.h (obstack_save): Remove.
18659 (output_files): Remove.
18660 As a result, if one needs the former `.act' file, using an
18661 appropriate skeleton which requires actions and guards is now
18662 required.
18663 * src/main.c (main): Adjust.
18664 * tests/semantic.at: New.
18665 * tests/regression.at: Use `input.y' as input file name.
18666 Avoid 8+3 problems by requiring input.c when the test needs the
18667 parser.
18668
d945f5cd
AD
186692001-12-27 Akim Demaille <akim@epita.fr>
18670
18671 * src/reader.c (symbol_list_new): Be sure to initialize all the
18672 fields.
18673
d200e455
AD
186742001-12-27 Akim Demaille <akim@epita.fr>
18675
18676 All the hacks using a final pseudo state are now useless.
18677
18678 * src/LR0.c (set_state_table): state_table holds exactly nstates.
18679 * src/lalr.c (nLA): New.
18680 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
18681 instead of lookaheadsp from the pseudo state (nstate + 1).
18682
f9507c28
AD
186832001-12-27 Akim Demaille <akim@epita.fr>
18684
18685 * src/output.c (action_row, token_actions): Use a state_t instead
18686 of a integer, and nlookaheads instead of the following state's
18687 lookaheadsp.
18688
065fbd27
AD
186892001-12-27 Akim Demaille <akim@epita.fr>
18690
18691 * src/conflicts.c (log_resolution, flush_shift)
18692 (resolve_sr_conflict, set_conflicts, solve_conflicts)
18693 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
18694 (conflicts_print, print_reductions): Use a state_t instead of an
18695 integer when referring to a state.
18696 As much as possible, depend upon nlookaheads, instead of the
18697 `lookaheadsp' member of the following state (since lookaheads of
18698 successive states are successive, the difference between state n + 1
18699 and n served as the number of lookaheads for state n).
18700 * src/lalr.c (add_lookback_edge): Likewise.
18701 * src/print.c (print_core, print_actions, print_state)
18702 (print_results): Likewise.
18703 * src/print_graph.c (print_core, print_actions, print_state)
18704 (print_graph): Likewise.
18705 * src/conflicts.h: Adjust.
18706
1b177bd7
AD
187072001-12-27 Akim Demaille <akim@epita.fr>
18708
18709 * src/bison.hairy: Formatting/comment changes.
18710 ANSIfy.
18711 Remove `register' indications.
18712 Add plenty of `static'.
18713
7742ddeb
AD
187142001-12-27 Akim Demaille <akim@epita.fr>
18715
18716 * src/output.c (prepare): Drop the muscle `ntbase' which
18717 duplicates ntokens.
18718 * src/bison.simple: Formatting/comment changes.
18719 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
18720 is an undocumented synonym.
18721
1fa14068
AD
187222001-12-22 Akim Demaille <akim@epita.fr>
18723
18724 * src/output.c (output_table_data): Change the prototype to use
18725 `int' for array ranges: some invocations do pass an int, not a
18726 short.
18727 Reported by Wayne Green.
18728
b9752825
AD
187292001-12-22 Akim Demaille <akim@epita.fr>
18730
18731 Some actions of web2c.y are improperly triggered.
18732 Reported by Mike Castle.
18733
18734 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
18735 * tests/regression.at (Web2c): Rename as...
18736 (Web2c Report): this.
18737 (Web2c Actions): New.
18738
776209d6
AD
187392001-12-22 Akim Demaille <akim@epita.fr>
18740
18741 Reductions in web2c.y are improperly reported.
18742 Reported by Mike Castle.
18743
18744 * src/conflicts.c (print_reductions): Fix.
18745 * tests/regression.at (Web2c): New.
18746
275fc3ad
AD
187472001-12-18 Akim Demaille <akim@epita.fr>
18748
18749 Some host fail on `assert (!"foo")', which expands to
18750 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
18751 Reported by Nelson Beebee.
18752
18753 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
18754 `#define it_succeeded 0' and `assert (it_succeeded)'.
18755
897668ee
MA
187562001-12-17 Marc Autret <autret_m@epita.fr>
18757
18758 * src/bison.simple: Don't hard code the skeleton line and filename.
18759 * src/output.c (output_parser): Rename 'line' as 'output_line'.
18760 New line counter 'skeleton_line' (skeleton-line muscle).
18761
ab3399e0
PE
187622001-12-17 Paul Eggert <eggert@twinsun.com>
18763
18764 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
18765 YYDEBUG must be defined to a nonzero value.
18766
18767 * src/bison.simple (yytname): Do not assume that the user defines
18768 YYDEBUG to a properly parenthesized expression.
18769
3877f72b
AD
187702001-12-17 Akim Demaille <akim@epita.fr>
18771
18772 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
18773 nlookaheads is a new member.
18774 Adjust all users.
18775 * src/lalr.h (nlookaheads): Remove this orphan declaration.
18776 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
18777 state.
776209d6 18778
331dbc1b
AD
187792001-12-17 Akim Demaille <akim@epita.fr>
18780
18781 * src/files.h, src/files.c (open_files, close_files): Remove.
18782 * src/main.c (main): Don't open/close files, nor invoke lex_free,
18783 let...
18784 * src/reader.c (reader): Do it.
776209d6 18785
be750e4c
AD
187862001-12-17 Akim Demaille <akim@epita.fr>
18787
18788 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 18789
709ae8c6
AD
187902001-12-17 Akim Demaille <akim@epita.fr>
18791
18792 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
18793 (flush_reduce): New.
18794 (resolve_sr_conflict): Adjust.
776209d6 18795
f87685c3
AD
187962001-12-17 Akim Demaille <akim@epita.fr>
18797
18798 * src/output.c (output_obstack): Be static and rename as...
18799 (format_obstack): this, to avoid any confusion with files.c's
18800 output_obstack.
18801 * src/reader.h (muscle_obstack): Move to...
18802 * src/output.h: here, since it's defined in output.c.
18803
837491d8
AD
188042001-12-17 Akim Demaille <akim@epita.fr>
18805
18806 * src/output.c (action_row, save_column, default_goto)
18807 (sort_actions, matching_state, pack_vector): Better variable
18808 locality.
18809
796d61fb
AD
188102001-12-17 Akim Demaille <akim@epita.fr>
18811
18812 * src/output.c: Various formatting changes.
776209d6 18813
64d15509
AD
188142001-12-17 Akim Demaille <akim@epita.fr>
18815
18816 * src/files.c (output_files): Free the output_obstack.
18817 * src/main.c (main): Call print and print_graph conditionally.
18818 * src/print.c (print): Work unconditionally.
18819 * src/print_graph.c (print_graph): Work unconditionally.
18820 * src/conflicts.c (log_resolution): Output only if verbose_flag.
18821
fbc8ecb7
MA
188222001-12-16 Marc Autret <autret_m@epita.fr>
18823
18824 * src/output.c (actions_output): Fix. When we use %no-lines,
18825 there is one less line per action.
18826
f0440388
MA
188272001-12-16 Marc Autret <autret_m@epita.fr>
18828
18829 * src/bison.simple: Remove a useless #line directive.
18830 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
18831 * src/output.c (get_lines_number): New.
776209d6 18832 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
18833 output muscles.
18834 Fix line numbering.
18835 (actions_output): Computes the number of lines taken by actions.
18836 (output_master_parser): Insert new skeleton which is the name of
18837 the output parser file name.
18838
a79986b8
MA
188392001-12-15 Marc Autret <autret_m@epita.fr>
18840
18841 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
18842
4ec8e00f
MA
188432001-12-15 Marc Autret <autret_m@epita.fr>
18844
18845 * src/output.c (output_gram): Keep track of the hairy one.
18846
1a4648ff
AD
188472001-12-15 Akim Demaille <akim@epita.fr>
18848
18849 Make `make distcheck' work.
18850
18851 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
18852 system.h which uses libgettext.h.
18853
9c2c67e6
AD
188542001-12-15 Akim Demaille <akim@epita.fr>
18855
18856 * src/nullable.c (set_nullable): Useless rules must be skipped,
18857 otherwise, since we range over their symbols, we might look at a
18858 nonterminal which no longer ``exists'', i.e., it is not counted in
18859 `nvars', hence we overflow our arrays.
18860
93ede233
AD
188612001-12-15 Akim Demaille <akim@epita.fr>
18862
18863 The header can also be produced directly, without any obstack!
18864 Yahoo!
18865
18866 * src/files.c, src/files.h (defines_obstack): Remove.
18867 (compute_header_macro): Global.
18868 (defines_obstack_save): Remove.
18869 * src/reader.c (parse_union_decl): No longer output to
18870 defines_obstack: its content can be found in the `stype' muscle
18871 anyway.
18872 (output_token_translations): Merge into...
18873 (symbols_output): this.
18874 Rename as...
18875 (symbols_save): this.
18876 (reader): Adjust.
18877 * src/output.c (header_output): New.
18878 (output): Call it.
18879
2666f928
AD
188802001-12-15 Akim Demaille <akim@epita.fr>
18881
18882 * src/reader.c (parse_union_decl): Instead of handling two obstack
18883 simultaneously, use one to define the `stype' muscle, and use the
18884 value of the latter to fill defines_obstack.
18885 (copy_comment): Remove.
18886 (copy_comment2): Work for a single obstack.
18887 Rename as...
18888 (copy_comment): this.
18889
428046f8
AD
188902001-12-15 Akim Demaille <akim@epita.fr>
18891
18892 * src/lex.c, src/lex.h (xgetc): No longer static.
18893 * src/reader.c (parse_union_decl): Revamp.
18894
ea52d706
AD
188952001-12-15 Akim Demaille <akim@epita.fr>
18896
18897 Still making progress in separating Bison into (i) input, (ii)
18898 process, (iii) output: now we can directly output the parser file
18899 without using table_obstack at all.
18900
18901 * src/files.c, src/files.h (table_obstack): Bye bye.
18902 (parser_file_name): New.
18903 * src/files.c (compute_output_file_names): Compute it.
18904 * src/output.c (actions_output, output_parser)
18905 (output_master_parser): To a file instead of an obstack.
18906
3f96f4dc
AD
189072001-12-15 Akim Demaille <akim@epita.fr>
18908
18909 Attach actions to rules, instead of pre-outputting them to
18910 actions_obstack.
18911
18912 * src/gram.h (rule_t): action and action_line are new members.
18913 * src/reader.c (symbol_list): Likewise.
18914 (copy_action): Save the actions within the rule.
18915 (packgram): Save them in rule_table.
18916 * src/output.c (actions_output): New.
18917 (output_parser): Use it on `%%actions'.
18918 (output_rule_data): Don't free rule_table.
18919 (output): Do it.
18920 (prepare): Don't save the `action' muscle.
18921 * src/bison.simple: s/%%action/%%actions/.
18922
51576fb3
AD
189232001-12-15 Akim Demaille <akim@epita.fr>
18924
18925 * src/reader.c (copy_action): When --yacc, don't append a `;'
18926 to the user action: let it fail if lacking.
dee049eb 18927 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 18928
2648a72d
AD
189292001-12-14 Akim Demaille <akim@epita.fr>
18930
18931 * src/lex.c (literalchar): Simply return the char you decoded, non
18932 longer mess around with obstacks and int pointers.
18933 Adjust all callers.
18934
92790e5b
AD
189352001-12-14 Akim Demaille <akim@epita.fr>
18936
18937 * src/lex.c (literalchar): Don't escape the special characters,
18938 just decode them, and keep them as char (before, eol was output as
18939 the 2 char string `\n' etc.).
18940 * src/output.c (output_rule_data): Use quotearg to output the
18941 token strings.
18942
927c1557
PE
189432001-12-13 Paul Eggert <eggert@twinsun.com>
18944
18945 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
18946 Do not infringe on the global user namespace when using C++.
18947 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
18948 All uses of `fprintf' and `stderr' changed.
18949
18950 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
18951
ed8e1f68
AD
189522001-12-13 Akim Demaille <akim@epita.fr>
18953
18954 The computation of nullable is broken: it doesn't handle empty
18955 RHS's properly.
18956
18957 * tests/torture.at (GNU AWK Grammar): New.
18958 * tests/sets.at (Nullable): New.
18959 * src/nullable.c (set_nullable): Instead of blindly looping over
18960 `ritems', loop over the rules, and then over their rhs's.
18961
18962 Work around Autotest bugs.
18963
18964 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
18965 frame, because Autotest understand lines starting with a `+' as
18966 traces from the shell. Then, they are not processed properly.
18967 Admittedly an Autotest bug, but we don't have time to wait for
18968 Autotest to catch up.
18969 * tests/regression.at (Broken Closure): Adjust to the new table
18970 frames.
18971 Move to...
18972 * tests/sets.at: here.
18973
cb581495
AD
189742001-12-13 Akim Demaille <akim@epita.fr>
18975
18976 * src/closure.c (closure): Use nrules instead of playing tricks
18977 with BITS_PER_WORD.
18978
2e729273
AD
189792001-12-13 Akim Demaille <akim@epita.fr>
18980
18981 * src/print.c (print_actions): Output the handling of `$' as the
18982 traces do: shifting the token EOF. Before EOF was treated as a
18983 nonterminal.
18984 * tests/regression.at: Adjust some tests.
18985 * src/print_graph.c (print_core): Complete the set of items via
18986 closure. The next-to-final and final states are still unsatisfying,
18987 but that's to be addressed elsewhere.
18988 No longer output the rule numbers, but do output the state number.
18989 A single loop for the shifts + gotos is enough, but picked a
18990 distinct color for each.
18991 (print_graph): Initialize and finalize closure.
18992
107f7dfb
AD
189932001-12-13 Akim Demaille <akim@epita.fr>
18994
18995 * src/reader.c (readgram): Remove dead code, an strip useless
18996 braces.
18997 (get_type): Remove, unused.
18998
9b53a24f
AD
189992001-12-12 Akim Demaille <akim@epita.fr>
19000
19001 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
19002 on that of lib/error.c.
19003
dbfb6dcd
AD
190042001-12-12 Akim Demaille <akim@epita.fr>
19005
19006 Some hosts don't like `/' in includes.
19007
19008 * src/system.h: Include libgettext.h without qualifying the path.
19009 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
19010 $(top_srcdir).
19011
c25fb648
MA
190122001-12-11 Marc Autret <autret_m@epita.fr>
19013
19014 * src/output.c (output_parser): Remove useless muscle.
19015
710ddc4f
MA
190162001-12-11 Marc Autret <autret_m@epita.fr>
19017
19018 * src/bison.simple: Remove #line just before %%epilogue. It
19019 is now handled in ...
19020 * src/reader.c (read_additionnal_code): Add the output of a
19021 #line for the epilogue.
19022
e83d80b8
MA
190232001-12-10 Marc Autret <autret_m@epita.fr>
19024
927c1557 19025 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
19026 replace precedent remove.
19027 * src/bison.simple: Remove #line before %%prologue because
19028 %%input-line is wrong at this time.
19029
971d5158
MA
190302001-12-10 Marc Autret <autret_m@epita.fr>
19031
19032 * src/reader.c (symbols_output): Clean up.
927c1557 19033 * src/output.c (output_gram, output): Clean up.
971d5158 19034
5edafffd
AD
190352001-12-10 Akim Demaille <akim@epita.fr>
19036
19037 * src/lalr.c (initialize_lookaheads): New. Extracted from...
19038 * src/LR0.c (set_state_table): here.
19039 * src/lalr.c (lalr): Call it.
19040
0279f8e9
AD
190412001-12-10 Akim Demaille <akim@epita.fr>
19042
19043 * src/state.h (shifts): Remove the `number' member: shifts are
19044 attached to state, hence no longer need to be labelled with a
19045 state number.
19046
190c4f5f
AD
190472001-12-10 Akim Demaille <akim@epita.fr>
19048
19049 Now that states have a complete set of members, the linked list of
19050 shifts is useless: just fill directly the state's shifts member.
19051
19052 * src/state.h (shifts): Remove the `next' member.
19053 * src/LR0.c (first_state, last_state): Remove.
19054 Adjust the callers.
19055 (augment_automaton): Don't look for the shifts that must be added
19056 a shift on EOF: it is those of the state we looked for! But now,
19057 since shifts are attached, it is no longer needed to looking
19058 merely by its id: its number.
19059
2a73b93d
AD
190602001-12-10 Akim Demaille <akim@epita.fr>
19061
19062 * src/LR0.c (augment_automaton): Better variable locality.
19063 Remove an impossible branch: if there is a state corresponding to
19064 the start symbol being shifted, then there is shift for the start
19065 symbol from the initial state.
19066
74392f6a
AD
190672001-12-10 Akim Demaille <akim@epita.fr>
19068
19069 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
19070 only when appropriate: when insert_start_shifting_state' is not
19071 invoked.
19072 * tests/regression.at (Rule Line Numbers): Adjust.
19073
37c82725
AD
190742001-12-10 Akim Demaille <akim@epita.fr>
19075
19076 * src/LR0.c (augment_automaton): Now that all states have shifts,
19077 merge the two cases addition shifts to the initial state.
19078
6a164e0c
AD
190792001-12-10 Akim Demaille <akim@epita.fr>
19080
19081 * src/lalr.c (set_state_table): Move to...
19082 * src/LR0.c: here.
19083 * src/lalr.c (lalr): Don't call it...
19084 * src/LR0.c (generate_states): do it.
19085 * src/LR0.h (first_state): Remove, only the table is used.
19086
7215de24
AD
190872001-12-10 Akim Demaille <akim@epita.fr>
19088
19089 * src/LR0.h (first_shift, first_reduction): Remove.
19090 * src/lalr.c: Don't use first_shift: find shifts through the
19091 states.
19092
80e25d4d
AD
190932001-12-10 Akim Demaille <akim@epita.fr>
19094
19095 * src/LR0.c: Attach shifts to states as soon as they are
19096 computed.
19097 * src/lalr.c (set_state_table): Instead of assigning shifts to
19098 state, just assert that the mapping was properly done.
19099
0ab3728b
AD
191002001-12-10 Akim Demaille <akim@epita.fr>
19101
19102 * src/LR0.c (insert_start_shift): Rename as...
19103 (insert_start_shifting_state): this.
19104 (insert_eof_shifting_state, insert_accepting_state): New.
19105 (augment_automaton): Adjust.
19106 Better locality of the variables.
19107 When looking if the start_symbol is shifted from the initial
19108 state, using `while (... symbol != start_symbol ...)' sounds
19109 better than `while (... symbol < start_symbol ...)': If fail
19110 to see how the order between symbols could be relevant!
19111
78af9bbc
AD
191122001-12-10 Akim Demaille <akim@epita.fr>
19113
19114 * src/getargs.h: Don't declare `spec_name_prefix' and
19115 `spec_file_prefix', declared by src/files.h.
19116 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
19117 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
19118 * src/output.c (prepare): Adjust.
19119 * src/reader.c (symbols_output): Likewise.
19120 * src/vmsgetargs.c: Vaguely adjust, but who cares?
19121
bdef2a41
AD
191222001-12-10 Akim Demaille <akim@epita.fr>
19123
19124 * src/muscle_tab.c (muscle_init): NULL is a better default than
19125 `"0"'.
19126
3735969c
AD
191272001-12-10 Akim Demaille <akim@epita.fr>
19128
19129 * src/reader.c (reader): Calling symbols_output once is enough.
19130
49701457
AD
191312001-12-10 Akim Demaille <akim@epita.fr>
19132
19133 Now that states have a complete set of members, the linked list of
19134 reductions is useless: just fill directly the state's reductions
19135 member.
19136
19137 * src/state.h (struct reductions): Remove member `number' and
19138 `next'.
19139 * src/LR0.c (first_reduction, last_reduction): Remove.
19140 (save_reductions): Don't link the new reductions, store them in
19141 this_state.
19142 * src/lalr.c (set_state_table): No need to attach reductions to
19143 states, it's already done.
19144 * src/output.c (output_actions): No longer free the shifts, then
19145 the reductions, then the states: free all the states and their
19146 members.
19147
0edad749
AD
191482001-12-10 Akim Demaille <akim@epita.fr>
19149
19150 * src/options.c (OPTN, DRTV, BOTH): New.
19151 (option_table): Use them.
19152
0edad749
AD
19153 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
19154 the job of system.h.
19155 * src/options.c: Don't include stdio.h and xalloc.h for the same
19156 reasons.
19157
5449dd0f
AD
191582001-12-10 Akim Demaille <akim@epita.fr>
19159
19160 * src/output.c (output, prepare): Make sure the values of the
19161 muscles `action' and `prologue' are 0-terminated.
19162
a870c567
AD
191632001-12-10 Akim Demaille <akim@epita.fr>
19164
19165 Clean up GCC warnings.
19166
19167 * src/reader.c (copy_action): `buf' is not used.
19168 (parse_skel_decl): Be static.
19169 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
19170 * src/options.h (create_long_option_table): Have a real prototype.
19171 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
19172 (hash_delete_at): Return const void *.
19173 Adjust casts to preserve the const.
19174
80df8768
AD
191752001-12-10 Akim Demaille <akim@epita.fr>
19176
19177 * configure.in: Require 2.52g.
19178 M4 is not needed, but AUTOM4TE is.
19179 * m4/m4.m4: Remove.
19180 * tests/Makefile.am: Adjust.
19181
f693ad14
AD
191822001-12-10 Akim Demaille <akim@epita.fr>
19183
19184 One structure for states is enough, even though theoretically
19185 there are LR(0) states and LALR(1) states.
19186
19187 * src/lalr.h (state_t): Remove.
19188 (state_table): Be state_t **, not state_t *.
19189 * src/state.h (core, CORE_ALLOC): Rename as...
19190 (state_t, STATE_ALLOC): this.
19191 Add the LALR(1) members: shifts, reductions, errs.
19192 * src/LR0.c (state_table): Rename as...
19193 (state_hash): this, to avoid name clashes with the global
19194 `state_table'.
19195 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
19196 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
19197
74ffbcb6
AD
191982001-12-10 Akim Demaille <akim@epita.fr>
19199
19200 Bison dumps core on bash.y.
19201 Reported by Pascal Bart.
19202
19203 * src/warshall.c (bitmatrix_print): New.
19204 (TC): Use it.
ba0fe3c7 19205 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
74ffbcb6
AD
19206 j must be the outer loop.
19207 * tests/regression.at (Broken Closure): New.
19208
07708e19
AD
192092001-12-05 Akim Demaille <akim@epita.fr>
19210
19211 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
19212 its argument.
ba1ecc07 19213 Reported by Peter Hamorsky.
07708e19 19214
92b16366
AD
192152001-12-05 Akim Demaille <akim@epita.fr>
19216
19217 * src/conflicts.c (err_table): Remove.
19218 (resolve_sr_conflict): Adjust.
19219 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
19220 Rename as...
19221 (state_t.reductions, state_t.shifts): this.
19222
076ab033
AD
192232001-12-05 Akim Demaille <akim@epita.fr>
19224
19225 * src/reduce.c (reduce_grammar_tables): No longer disable the
19226 removal of useless rules via CPP but via `if (0)', so that the
19227 compiler still check the code is valid.
19228 For instance, it should have noticed `rline' no longer exists: use
19229 the `line' member of rule_t.
19230 * src/gram.c (dummy, rline): Remove, unused.
19231
3843c413
AD
192322001-12-05 Akim Demaille <akim@epita.fr>
19233
19234 * src/output.c (pack_vector): Use assert, not berror.
19235 * src/main.c (berror): Remove, unused.
19236
43168960
AD
192372001-12-05 Akim Demaille <akim@epita.fr>
19238
19239 New experimental feature: if --verbose --trace output all the
19240 items of a state, not only its kernel.
19241
19242 * src/print.c (print_core): If `trace_flag', then invoke closure
19243 before outputting the items of the state (print_core is no longer
19244 a correct name them).
19245 (print_results): Invoke new_closure/free_closure if needed.
19246
b2872512
AD
192472001-12-05 Akim Demaille <akim@epita.fr>
19248
19249 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
19250 * src/closure.c, src/closure.h (itemsetsize): Rename as...
19251 (nitemset): for consistency with the rest of the project.
19252
23cbcc6c
AD
192532001-12-05 Akim Demaille <akim@epita.fr>
19254
19255 * src/closure.c (print_closure): Improve.
19256 (closure): Use it for printing input and output.
19257
03ec521c
AD
192582001-12-05 Akim Demaille <akim@epita.fr>
19259
19260 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
19261 indexed by nonterminals.
19262
3a7456dd
AD
192632001-12-05 Akim Demaille <akim@epita.fr>
19264
19265 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
19266 what it was!).
19267 * src/warshall.h: Remove accidental duplication of the content.
19268
1cbcf2e7
AD
192692001-12-05 Akim Demaille <akim@epita.fr>
19270
19271 * src/closure.c (set_fderives): De-obfuscate.
19272
84182270
AD
192732001-12-05 Akim Demaille <akim@epita.fr>
19274
19275 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
19276
3f6f053c
AD
192772001-12-05 Akim Demaille <akim@epita.fr>
19278
19279 * src/closure.c (set_firsts): De-obfuscate.
19280
7a5350ba
AD
192812001-12-05 Akim Demaille <akim@epita.fr>
19282
19283 * src/output.c (action_row): De-obfuscate
19284 using the good o' techniques: arrays not pointers, variable
19285 locality, BITISSET, RESETBIT etc.
19286
d954473d
AD
192872001-12-05 Akim Demaille <akim@epita.fr>
19288
19289 Pessimize the code to simplify it: from now on, all the states
19290 have a valid SHIFTS, which NSHIFTS is possibly 0.
19291
19292 * src/LR0.c (shifts_new): Be global and move to..
19293 * src/state.c, src/state.h: here.
19294 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
19295 * src/print_graph: Adjust.
19296
9839bbe5
AD
192972001-12-05 Akim Demaille <akim@epita.fr>
19298
19299 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
19300 * src/conflicts.c: Use it.
19301 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
19302 incorrectly ``simplified''.
19303
9f136c07
AD
193042001-12-05 Akim Demaille <akim@epita.fr>
19305
19306 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
19307 using the good o' techniques: arrays not pointers, variable
19308 locality, BITISSET, RESETBIT etc.
19309
b608206e
AD
193102001-12-05 Akim Demaille <akim@epita.fr>
19311
19312 * src/state.h (SHIFT_SYMBOL): New.
19313 * src/conflicts.c: Use it to deobfuscate.
19314
52afa962
AD
193152001-12-05 Akim Demaille <akim@epita.fr>
19316
19317 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
19318 (print_reductions): De-obfuscate using the good o' techniques:
19319 arrays not pointers, variable locality, BITISSET.
19320
e74dc321
AD
193212001-12-05 Akim Demaille <akim@epita.fr>
19322
19323 * src/conflicts.c (print_reductions): Arrays, not pointers.
19324 Use BITISSET.
19325
768fca83
AD
193262001-12-05 Akim Demaille <akim@epita.fr>
19327
19328 * src/conflicts.c (print_reductions): Pessimize, but clarify.
19329
a17e599f
AD
193302001-12-05 Akim Demaille <akim@epita.fr>
19331
19332 * src/conflicts.c (print_reductions): Improve variable locality.
19333
a04bc341
AD
193342001-12-05 Akim Demaille <akim@epita.fr>
19335
19336 * src/conflicts.c (print_reductions): Pessimize, but clarify.
19337
c8ea038e
AD
193382001-12-05 Akim Demaille <akim@epita.fr>
19339
19340 * src/conflicts.c (print_reductions): Improve variable locality.
19341
aa2aab3c
AD
193422001-12-05 Akim Demaille <akim@epita.fr>
19343
19344 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
19345 * src/lalr.c: Use them.
19346
b178c8cc
AD
193472001-12-05 Akim Demaille <akim@epita.fr>
19348
19349 * src/LR0.c (augment_automaton): Formatting changes.
19350 Better variable locality.
19351
f67d13aa
AD
193522001-12-05 Akim Demaille <akim@epita.fr>
19353
19354 * src/lalr.c (matrix_print): New.
19355 (transpose): Use it.
19356 Use arrays instead of pointers.
19357
c2713865
AD
193582001-12-05 Akim Demaille <akim@epita.fr>
19359
19360 * src/lalr.c (maxrhs): Move to...
19361 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
19362 * src/lalr.c (build_relations): Adjust.
19363
9887c18a
AD
193642001-12-05 Akim Demaille <akim@epita.fr>
19365
19366 * src/lalr.c (transpose): Free the memory allocated to the
19367 argument, as it is replaced by the results by the unique caller.
19368 (build_relations): Merely invoke transpose: it handles the memory
19369 deallocation.
19370 Improve variable locality.
19371 Avoid variables used as mere abbreviations.
19372 (compute_lookaheads): Use arrays instead of pointers.
19373
4d4f699c
AD
193742001-12-05 Akim Demaille <akim@epita.fr>
19375
19376 * src/lalr.c (initialize_F): Improve variable locality.
19377 Avoid variables used as mere abbreviations.
19378
80a69750
AD
193792001-12-05 Akim Demaille <akim@epita.fr>
19380
19381 * src/derives.c (print_derives): Display the ruleno.
19382 * src/lalr.c (initialize_F, transpose): Better variable locality
19383 to improve readability.
19384 Avoid variables used as mere abbreviations.
19385
fe961097
AD
193862001-12-05 Akim Demaille <akim@epita.fr>
19387
19388 * src/lalr.c (traverse): Use arrays instead of pointers.
19389
e3e4e814
AD
193902001-12-05 Akim Demaille <akim@epita.fr>
19391
19392 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
19393 the handling of squeue.
19394 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
19395
630e182b
AD
193962001-12-05 Akim Demaille <akim@epita.fr>
19397
19398 Because useless nonterminals are now kept alive (instead of being
19399 `destroyed'), we now sometimes examine them, and store information
19400 related to them. Hence we need to know their number, and adjust
19401 memory allocations.
19402
19403 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
19404 static.
19405 * src/LR0.c (allocate_itemsets): The memory allocated to
19406 `symbol_count' was used for two different purpose: once to count
19407 the number of occurrences of each symbol, and later reassigned to
19408 `shift_symbol', containing the symbol that can be shifted from a
19409 given state.
19410 Deobfuscate, i.e., allocate, use and free `symbol_count' here
19411 only, and...
19412 (new_itemsets): Allocate `shift_symbol' here.
19413 (allocate_itemsets): symbol_count includes useless nonterminals.
19414 Make room for them.
19415 (free_storage): Use `free', not `XFREE', for pointers that cannot
19416 be null.
19417
81b51460
AD
194182001-12-05 Akim Demaille <akim@epita.fr>
19419
19420 * src/nullable.c (set_nullable): Deobfuscate the handling of
19421 ritem.
19422 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
19423
3067fbef
AD
194242001-12-05 Akim Demaille <akim@epita.fr>
19425
19426 * src/gram.c, src/gram.h (ritem_print): New.
19427 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
19428 (This useless function was defined only to work around VMS linkers
19429 that can't handle compilation units with variables only).
19430 * src/reduce.c (dump_grammar): Use it to trace the construction of
19431 ritem.
19432
c2bea5f9
PE
194332001-12-04 Paul Eggert <eggert@twinsun.com>
19434
7d27c823
PE
19435 * src/bison.simple (union yyalloc): Change member names
19436 to be the same as the stack names.
19437 (yyparse): yyptr is now union yyalloc *, not char *.
19438 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
19439 and may generate better code on some machines.
c2bea5f9
PE
19440 (yystpcpy): Use prototype if __STDC__ is defined, not just
19441 if __cplusplus is defined.
35687a9d 19442
2c8a9dfa
AD
194432001-11-30 Akim Demaille <akim@epita.fr>
19444
19445 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
19446 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
19447 Gettext doesn't compile cleanly, and dies with -Werror.
19448 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
19449 Include WARNING_CFLAGS here.
19450 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
19451 before being defined.
19452
f4e421e6
AD
194532001-11-27 Paul Eggert <eggert@twinsun.com>
19454
19455 * lib/quotearg.h (quotearg_n, quotearg_n_style):
19456 First arg is int, not unsigned.
19457 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
19458 (SIZE_MAX, UINT_MAX): New macros.
19459 (quotearg_n_options): Abort if N is negative.
19460 Avoid overflow check on hosts where size_t is 64 bits and int
19461 is 32 bits, as overflow is impossible there.
19462 Fix off-by-one typo that caused unnecessary reallocation.
19463
7093d0f5
AD
194642001-11-29 Paul Eggert <eggert@twinsun.com>
19465
19466 Name space cleanup in generated parser.
19467
19468 * doc/bison.texinfo (Bison Parser): Discuss system headers
19469 and their effect on the user name space.
19470
19471 * src/bison.simple:
19472 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
19473 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
19474 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
19475
19476 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
19477 on user names when possible.
19478
19479 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
19480 Simplify test for whather <alloca.h> exists.
19481
19482 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
19483
19484 (<stdio.h>): Include if YYDEBUG.
19485
19486 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
19487 ! defined (yyoverflow) && ! defined (yymemcpy).
19488
19489 (yymemcpy, yyparse): Rename local variables as needed so that
19490 they all begin with 'yy'.
19491
19492 (yystrlen, yystpcpy): New functions.
19493
19494 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
19495 All uses changed.
19496
19497 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
19498 instead of relying on string.h functions. Use YYSTACK_ALLOC
19499 and YYSTACK_FREE instead of malloc and free.
19500
fd51e5ff
AD
195012001-11-30 Akim Demaille <akim@epita.fr>
19502
19503 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
19504 before their first uses.
19505 (YYBISON, YYPURE): Move to the top of the output.
19506
7d13ff5f
AD
195072001-11-30 Akim Demaille <akim@epita.fr>
19508
19509 * tests/reduce.at (Useless Nonterminals): Fix.
19510
892a3995
AD
195112001-11-30 Akim Demaille <akim@epita.fr>
19512
19513 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
19514 if body instead of `;' to pacify GCC's warnings.
19515
68f1e3ed
AD
195162001-11-30 Akim Demaille <akim@epita.fr>
19517
19518 Instead of mapping the LHS of unused rules to -1, keep the LHS
19519 valid, but flag the rules as invalid.
19520
19521 * src/gram.h (rule_t): `useful' is a new member.
19522 * src/print.c (print_grammar): Adjust.
19523 * src/derives.c (set_derives): Likewise.
19524 * src/reader.c (packgram, reduce_output): Likewise.
19525 * src/reduce.c (reduce_grammar_tables): Likewise.
19526 * tests/reduce.at (Underivable Rules, Useless Rules): New.
19527
d2d1b42b
AD
195282001-11-30 Akim Demaille <akim@epita.fr>
19529
19530 * src/reduce.c (reduce_output): Formatting changes.
19531 * src/print.c (print_results, print_grammar): Likewise.
19532 * tests/regression.at (Rule Line Numbers)
19533 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
19534
760b53a8
AD
195352001-11-30 Akim Demaille <akim@epita.fr>
19536
19537 * src/reduce.c (nonterminals_reduce): Instead of throwing away
19538 useless nonterminals, move them at the end of the symbol arrays.
19539 (reduce_output): Adjust.
19540 * tests/reduce.at (Useless Nonterminals): Adjust.
19541
00238958
AD
195422001-11-30 Akim Demaille <akim@epita.fr>
19543
19544 * src/reduce.c: Various comment/formatting changes.
19545 (nonterminals_reduce): New, extracted from...
19546 (reduce_grammar_tables): here.
19547 (reduce_grammar): Call nonterminals_reduce.
19548
396452de
PE
195492001-11-29 Paul Eggert <eggert@twinsun.com>
19550
19551 * src/bison.simple (YYSTACK_REALLOC): Remove.
19552 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
19553 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
19554 New macros.
19555 (union yyalloc): New type.
19556 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
19557 an arbitrary restriction on hosts where size_t is wider than int.
19558
19559 (yyparse): Don't dump core if alloca or malloc fails; instead, report
19560 a parser stack overflow. Allocate just one block of memory for all
19561 three stacks, instead of allocating three blocks; this typically is
19562 faster and reduces fragmentation.
19563
19564 Do not limit the number of items in the stack to a value that fits
19565 in 'int', as this is an arbitrary limit on hosts with 64-bit
19566 size_t and 32-bit int.
19567
147e184c
MA
195682001-11-29 Marc Autret <autret_m@epita.fr>
19569
19570 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
19571 of defining YYERROR_VERBOSE.
19572 [AT_DATA]: $4 is now out of C declarations in the prologue.
19573
426cf563
MA
195742001-11-28 Marc Autret <autret_m@epita.fr>
19575
19576 * src/reader.c (parse_dquoted_param): New.
19577 (parse_skel_decl): Use it.
19578 * src/lex.h: Add its prototype.
19579 * src/lex.c (literalchar): Become not static.
19580
c7925b99
MA
195812001-11-28 Marc Autret <autret_m@epita.fr>
19582
19583 * src/output.h: And put its extern declaration here.
19584 * src/output.c (error_verbose): Define here.
19585 (prepare): Echo name modification.
19586 * src/getargs.h: Clean its extern declaration.
19587 * src/getargs.c (error_verbose_flag): Remove.
19588 (getargs): Remove case 'e'.
19589 * src/options.c (option_table): 'error-verbose' is now seen as simple
19590 percent option.
19591 Include output.h.
19592
19593 * src/reader.c (read_declarations): Remove case tok_include.
19594 (parse_include_decl): Remove.
19595 * src/lex.h (token_t): Remove tok_include.
19596 * src/options.c (option_table): 'include' is now a simple command line
19597 option.
19598
5b5d1929
MA
195992001-11-28 Marc Autret <autret_m@epita.fr>
19600
19601 * src/bison.simple: Adjust muscle names.
19602 * src/muscle_tab.c (muscle_init): Also rename the muscles.
19603 * src/output.c (prepare): s/_/-/ for the muscles names.
19604 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
19605
8850be4b
MA
196062001-11-28 Marc Autret <autret_m@epita.fr>
19607
19608 * src/bison.simple: Fix debug.
19609 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
19610
4a38e613
AD
196112001-11-28 Akim Demaille <akim@epita.fr>
19612
19613 * src/LR0.c (shifts_new): New.
19614 (save_shifts, insert_start_shift, augment_automaton): Use it.
19615
4b35e1c1
AD
196162001-11-28 Akim Demaille <akim@epita.fr>
19617
19618 * src/closure.c (closure): `b' and `ruleno' denote the same value:
19619 keep ruleno only.
19620
d2b04478
AD
196212001-11-28 Akim Demaille <akim@epita.fr>
19622
19623 * src/closure.c (closure): Instead of looping over word in array
19624 then bits in words, loop over bits in array.
19625
2c4c30aa
AD
196262001-11-28 Akim Demaille <akim@epita.fr>
19627
19628 * src/closure.c (closure): No longer optimize the special case
19629 where all the bits of `ruleset[r]' are set to 0, to make the code
19630 clearer.
19631
576890b7
AD
196322001-11-28 Akim Demaille <akim@epita.fr>
19633
19634 * src/closure.c (closure): `r' and `c' are new variables, used to
19635 de-obfuscate accesses to RULESET and CORE.
19636
cb487d7d
AD
196372001-11-28 Akim Demaille <akim@epita.fr>
19638
19639 * src/reduce.c (reduce_print): Use ngettext.
19640 (dump_grammar): Improve the trace accuracy.
19641
6013d43f
AD
196422001-11-28 Akim Demaille <akim@epita.fr>
19643
19644 * src/reduce.c (dump_grammar): Don't translate trace messages.
19645
cb4956ee
AD
196462001-11-28 Akim Demaille <akim@epita.fr>
19647
19648 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
19649 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
19650 as all tags are free'ed afterwards.
19651 From Enrico Scholz.
19652
648185ab
PE
196532001-11-27 Paul Eggert <eggert@twinsun.com>
19654
19655 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
19656 use alloca when we didn't want to, and vice versa.
19657
68254a03
MA
196582001-11-27 Marc Autret <autret_m@epita.fr>
19659
9113b58f
AD
19660 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
19661 initialization.
68254a03
MA
19662 * src/output.c (prepare): Remove its update.
19663
04d843a2
MA
196642001-11-27 Marc Autret <autret_m@epita.fr>
19665
19666 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
19667 Use %error-verbose.
19668
d2079671 196692001-11-27 Marc Autret <autret_m@epita.fr>
eeeb962b
MA
19670
19671 * src/bison.simple: Remove YYERROR_VERBOSE using.
19672 Use %%error_verbose.
19673 (yyparse): Likewise.
19674 * src/output.c (prepare): Give its final value.
19675 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
19676 * src/getargs.h: Add its extern declaration.
19677 * src/getargs.c (error_verbose_flag): New int.
19678 (getargs): Update to catch new case.
19679 * src/options.c (option_table): 'error-verbose' is a new option.
19680 (shortopts): Update.
19681
e0327bc8
AD
196822001-11-27 Akim Demaille <akim@epita.fr>
19683
19684 * src/system.h: Use intl/libgettext.h.
19685 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
19686
000f1a3c
AD
196872001-11-27 Akim Demaille <akim@epita.fr>
19688
19689 * tests/torture.at (Exploding the Stack Size with Malloc):
19690 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
19691
26cfe0be
AD
196922001-11-27 Akim Demaille <akim@epita.fr>
19693
19694 * src/files.c: Include error.h.
19695 Reported by Hans Aberg.
19696
f6bd5427
MA
196972001-11-26 Marc Autret <autret_m@epita.fr>
19698
d2079671 19699 * src/reader.c (parse_include_decl): New, not yet implemented.
f6bd5427
MA
19700 (read_declarations): Add case tok_include.
19701 * src/getargs.h (include): Add its extern definition.
19702 * src/getargs.c (include): New const char *.
19703 (getargs): Add case '-I'.
19704 * src/options.c (option_table): Add include as command line and
19705 percent option.
19706 * src/lex.h (token_t): Add tok_include.
19707
2ca209c1
AD
197082001-11-26 Akim Demaille <akim@epita.fr>
19709
19710 * src/reader.c (readgram): Make sure rules for mid-rule actions
19711 have a lineno equal to that of their host rule.
19712 Reported by Hans Aberg.
19713 * tests/regression.at (Rule Line Numbers): New.
19714
0e41b407
AD
197152001-11-26 Akim Demaille <akim@epita.fr>
19716
19717 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
19718 size_ts.
19719
197202001-11-26 Akim Demaille <akim@epita.fr>
19721
19722 * src/complain.c, src/complain.h (error): Remove, provided by
19723 lib/error.[ch].
19724
e0c40012
AD
197252001-11-26 Akim Demaille <akim@epita.fr>
19726
19727 * src/reader.c (read_declarations): Don't abort on tok_illegal,
19728 issue an error message.
19729 * tests/regression.at (Invalid %directive): New.
19730 Reported by Hans Aberg.
19731
5e147124
AD
197322001-11-26 Akim Demaille <akim@epita.fr>
19733
19734 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
19735 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
19736
a034c8b8
AD
197372001-11-26 Akim Demaille <akim@epita.fr>
19738
19739 * src/conflicts.c (conflicts_print): Don't complain at all when
19740 there are no reduce/reduce conflicts, and as many shift/reduce
19741 conflicts as expected.
19742 * tests/regression.at (%expect right): Adjust.
19743
c64a20f3
AD
197442001-11-23 Akim Demaille <akim@epita.fr>
19745
19746 * lib/alloca.c: Update, from fileutils.
19747
5b0d29bb
AD
197482001-11-23 Akim Demaille <akim@epita.fr>
19749
19750 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
19751
722c4bfe
AD
197522001-11-23 Akim Demaille <akim@epita.fr>
19753
19754 * src/system.h: Include alloca.h.
19755 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
19756
6255b435
AD
197572001-11-23 Akim Demaille <akim@epita.fr>
19758
19759 * src/print_graph.c (print_actions): Remove `rule', unused.
19760 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
19761 pacify GCC's signed < unsigned warnings.
19762 * src/closure.c (itemsetsize): Likewise.
19763 * src/reader.c (symbol_list_new): Static.
19764
b29b2ed5
AD
197652001-11-23 Akim Demaille <akim@epita.fr>
19766
19767 Attaching lineno to buckets is stupid, since only one copy of each
19768 symbol is kept, only the line of the first occurrence is kept too.
19769
19770 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
19771 * src/reader.c (rline_allocated): Remove, unused.
19772 (symbol_list): Have a `line' member.
19773 (symbol_list_new): New.
19774 (readgram): Use it.
19775 * src/print.c (print_grammar): Output the rule line numbers.
19776 * tests/regression.at (Solved SR Conflicts)
19777 (Unresolved SR Conflicts): Adjust.
19778 Reported by Hans Aberg.
19779
a81b1d4a
MA
197802001-11-22 Marc Autret <autret_m@epita.fr>
19781
19782 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
19783
c1ecb3c1
MA
197842001-11-22 Marc Autret <autret_m@epita.fr>
19785
19786 * src/muscle_tab.c (muscle_init): Remove initialization of
19787 skeleton muscle.
19788 * src/output.c (output_master_parser): Do it here.
19789
fbe01355
AD
197902001-11-20 Akim Demaille <akim@epita.fr>
19791
19792 * po/sv.po: New.
19793 * configure.in (ALL_LINGUAS): Adjust.
19794 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
19795 longer contains strings to translate.
19796
81e895c0
AD
197972001-11-19 Akim Demaille <akim@epita.fr>
19798
19799 * src/conflicts.c (conflicts_print): Add a missing \n.
19800
6bb1878b
AD
198012001-11-19 Akim Demaille <akim@epita.fr>
19802
19803 * src/nullable.c (nullable_print): New.
19804 (set_nullable): Call it when tracing.
19805 Better locality of variables.
19806
d9ec2d07
AD
198072001-11-19 Akim Demaille <akim@epita.fr>
19808
19809 * src/print.c (print_actions): Better locality of variables.
19810
720e5c1b
AD
198112001-11-19 Akim Demaille <akim@epita.fr>
19812
19813 * src/derives.c (print_derives): Fix and enrich.
19814 * src/closure.c (print_fderives): Likewise.
19815
fb908786
AD
198162001-11-19 Akim Demaille <akim@epita.fr>
19817
19818 * src/closure.c (itemsetend): Remove, replaced with...
19819 (itemsetsize): new.
19820
125ecb56
AD
198212001-11-19 Akim Demaille <akim@epita.fr>
19822
19823 * src/LR0.c (kernel_end): Remove, replaced with...
19824 (kernel_size): new.
19825
d8cf039f
AD
198262001-11-19 Akim Demaille <akim@epita.fr>
19827
19828 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
19829 to clarify.
19830
7bec0760
AD
198312001-11-19 Akim Demaille <akim@epita.fr>
19832
19833 * src/closure.c (closure): Use arrays instead of pointers to clarify.
19834
c87d4863
AD
198352001-11-19 Akim Demaille <akim@epita.fr>
19836
19837 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
19838 trace messages.
19839 * src/LR0.c: Likewise.
19840 (allocate_itemsets): Use arrays instead of pointers to clarify.
19841
9bfe901c
AD
198422001-11-19 Akim Demaille <akim@epita.fr>
19843
19844 * src/getargs.c (statistics_flag): Replace with...
19845 (trace_flag): New.
19846 (longopts): Accept --trace instead of --statistics.
19847 * src/getargs.h, src/options.c: Adjust.
19848 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
19849 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
19850
97db7bd4
AD
198512001-11-19 Akim Demaille <akim@epita.fr>
19852
cc72668c 19853 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
97db7bd4
AD
19854 pointers to clarify the code.
19855 (save_reductions, save_shifts): Factor common parts of alternatives.
19856
2c5f66ed
AD
198572001-11-19 Akim Demaille <akim@epita.fr>
19858
19859 * src/LR0.c (new_state, get_state): Complete TRACE code.
19860 * src/closure.c: Include `reader.h' to get `tags', needed by the
19861 trace code.
19862 Rename the conditional DEBUG as TRACE.
19863 Output consistently TRACEs to stderr, not stdout.
19864 * src/derives.c: Likewise.
19865 * src/reduce.c: (inaccessable_symbols): Using if is better style
19866 than goto.
19867 Use `#if TRACE' instead of `#if 0' for tracing code.
19868
300f275f
AD
198692001-11-19 Akim Demaille <akim@epita.fr>
19870
19871 * src/system.h (LIST_FREE, shortcpy): New.
19872 * src/LR0.c: Use them.
19873 * src/output.c (free_itemsets, free_reductions, free_shifts):
19874 Remove, replaced by LIST_FREE.
19875
f59c437a
AD
198762001-11-19 Akim Demaille <akim@epita.fr>
19877
19878 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
19879 (REDUCTIONS_ALLOC): New.
19880 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
19881 allocation.
19882
6986fd9e
AD
198832001-11-19 Akim Demaille <akim@epita.fr>
19884
19885 * src/LR0.c (new_state): Complete trace code.
19886 * src/nullable.c (set_nullable): Don't translate traces.
19887
4bc30f78
AD
198882001-11-19 Akim Demaille <akim@epita.fr>
19889
19890 * src/print_graph.c (print_core): Better locality of variables.
19891 * src/print.c (print_core): Likewise.
19892
08a946e0
AD
198932001-11-19 Akim Demaille <akim@epita.fr>
19894
19895 * src/vcg.c: You do the output, so you are responsible of the
19896 handling of VCG syntax, in particular: use quotearg.
19897 * src/print_graph.c: Don't.
19898 (print_actions): Don't output the actions as part of the nodes,
19899 since that's the job of the edges.
19900 (print_state): Don't output by hand: fill the node description,
9bfe901c 19901 and ask for its output.
08a946e0 19902
f0473484
AD
199032001-11-19 Akim Demaille <akim@epita.fr>
19904
cc72668c
AD
19905 * src/bison.simple (yyparse): When verbosely reporting an error,
19906 no longer put additional quotes around token names.
f0473484
AD
19907 * tests/calc.at: Adjust.
19908
e41dc700
AD
199092001-11-19 Akim Demaille <akim@epita.fr>
19910
19911 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
19912 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
19913 * src/output.c: Adjust.
19914
652a871c
AD
199152001-11-19 Akim Demaille <akim@epita.fr>
19916
19917 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
19918 (rule_t): this.
19919 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
19920
b2ed6e58
AD
199212001-11-19 Akim Demaille <akim@epita.fr>
19922
19923 * src/gram.h (rule_t): New.
19924 (rule_table): New.
19925 (rrhs, rlhs): Remove, part of state_t.
19926 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
19927 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
19928 * src/reader.c, src/reduce.c: Adjust.
19929
edad7067
AD
199302001-11-19 Akim Demaille <akim@epita.fr>
19931
19932 * src/reader.c (symbols_output): New, extracted from...
19933 (packsymbols): Here.
19934 (reader): Call it.
19935
3feec034
AD
199362001-11-19 Akim Demaille <akim@epita.fr>
19937
19938 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
19939 (maxrhs): this new function.
19940
ddcd5fdf
AD
199412001-11-19 Akim Demaille <akim@epita.fr>
19942
cc72668c 19943 * src/lalr.c (F): New macro to access the variable F.
ddcd5fdf
AD
19944 Adjust.
19945
bb527fc2
AD
199462001-11-19 Akim Demaille <akim@epita.fr>
19947
cc72668c 19948 * src/lalr.h (LA): New macro to access the variable LA.
bb527fc2
AD
19949 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
19950 * src/lalr.c: Adjust.
19951
a845a697
AD
199522001-11-19 Akim Demaille <akim@epita.fr>
19953
19954 * src/lalr.c (initialize_LA): Only initialize LA. Let...
19955 (set_state_table): handle the `lookaheads' members.
19956
f004bf6a
AD
199572001-11-19 Akim Demaille <akim@epita.fr>
19958
cc72668c
AD
19959 * src/lalr.h (lookaheads): Removed array, whose contents is now
19960 a member of...
f004bf6a
AD
19961 (state_t): this structure.
19962 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
19963 Adjust.
19964
de326cc0
AD
199652001-11-19 Akim Demaille <akim@epita.fr>
19966
cc72668c
AD
19967 * src/lalr.h (consistent): Removed array, whose contents is now
19968 a member of...
de326cc0
AD
19969 (state_t): this structure.
19970 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
19971 Adjust.
19972
90b4416b
AD
199732001-11-19 Akim Demaille <akim@epita.fr>
19974
cc72668c
AD
19975 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
19976 contents are now members of...
90b4416b
AD
19977 (state_t): this structure.
19978 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
19979 Adjust.
19980
9703cc49
AD
199812001-11-19 Akim Demaille <akim@epita.fr>
19982
19983 * src/lalr.h (state_t): New.
19984 (state_table): Be a state_t * instead of a core **.
19985 (accessing_symbol): Remove, part of state_t.
19986 * src/lalr.c: Adjust.
19987 (set_accessing_symbol): Merge into...
19988 (set_state_table): this.
19989 * src/print_graph.c, src/conflicts.c: Adjust.
19990
d803322e
AD
199912001-11-14 Akim Demaille <akim@epita.fr>
19992
19993 * tests/calc.at, tests/output.at, tests/regression.at,
19994 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
19995 now the tests are run in private dirs, therefore AC_CLEANUP and
19996 family can be simplified to 0-ary.
19997 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
19998 use abs. path to find config.h.
19999 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
20000 stderr, there can be way too much random noise.
20001 Instead pass -Werror to GCC and rely on the exit status.
20002 Reported by Wolfram Wagner.
20003
3d76b07d
AD
200042001-11-14 Akim Demaille <akim@epita.fr>
20005
20006 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
20007 defined only if yyoverflow is defined, to avoid `warning: unused
20008 variable `yyvs1''.
20009 Reported by The Test Suite.
20010
09b503c8
AD
200112001-11-14 Akim Demaille <akim@epita.fr>
20012
20013 * src/print.c: Include reduce.h.
20014 Reported by Hans Aberg.
20015
200162001-11-14 Akim Demaille <akim@epita.fr>
20017
20018 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
20019 Revert a previous patch: these are really const.
20020 * src/conflicts.c (conflict_report): Additional useless pair of
20021 braces to pacify GCC's warnings for `if () if () {} else {}'.
20022 * src/lex.c (parse_percent_token): Replace equal_offset with
20023 arg_offset.
20024 arg is const.
20025 Be sure to strdup `arg' when used, since there is no reason for
20026 token_buffer not to change.
20027
0f37a994
AD
200282001-11-14 Akim Demaille <akim@epita.fr>
20029
20030 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
20031 definition.
20032 * src/main.c (main): Use them.
20033 Suggested by Hans Aberg.
20034
d39d93b8
AD
200352001-11-12 Akim Demaille <akim@epita.fr>
20036
20037 * src/system.h (ngettext): Now that we use ngettext, be sure to
20038 provide a default definition when NLS are not used.
20039
9edcd895
AD
200402001-11-12 Akim Demaille <akim@epita.fr>
20041
20042 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
20043 Use @kbd to denote user input.
20044 (Language and Grammar): ANSIfy the example.
20045 Adjust its layout for info/notinfo.
20046 (Location Tracking Calc): Output error messages to stderr.
20047 Output locations in a more GNUtically correct way.
20048 Fix a couple of Englishos.
20049 Adjust @group/@end group pairs.
20050
7da99ede
AD
200512001-11-12 Akim Demaille <akim@epita.fr>
20052
e3aa65c5 20053 %expect was not functioning at all.
7da99ede
AD
20054
20055 * src/conflicts.c (expected_conflicts): Set to -1.
20056 (conflict_report): Use ngettext.
20057 (conflicts_print): Check %expect and make its violation an error.
20058 * doc/bison.texinfo (Expect Decl): Adjust.
20059 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
20060 * tests/regression.at (%expect not enough, %expect right)
20061 (%expect too much): New.
20062
ba9dda1a
AD
200632001-11-12 Akim Demaille <akim@epita.fr>
20064
20065 * tests/regression.at (Conflicts): Rename as...
20066 (Unresolved SR Conflicts): this.
20067 (Solved SR Conflicts): New.
20068
337c5bd1
AD
200692001-11-12 Akim Demaille <akim@epita.fr>
20070
20071 * src/reduce.c (print_results): Rename as...
20072 (reduce_output): This.
20073 Output to OUT, passed as argument, instead of output_obstack.
20074 (dump_grammar): Likewise.
20075 (reduce_free): New.
20076 Also free V1.
20077 (reduce_grammar): No longer call reduce_output, since...
20078 * src/print.c (print_results): do it.
20079 * src/main.c (main): Call reduce_free;
20080
c73a41af
AD
200812001-11-12 Akim Demaille <akim@epita.fr>
20082
20083 * src/conflicts.c (print_reductions): Accept OUT as argument.
20084 Output to it, not to output_obstack.
20085 * src/print.c (print_actions): Adjust.
20086
0df87bb6
AD
200872001-11-12 Akim Demaille <akim@epita.fr>
20088
20089 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
20090 the result instead of using...
20091 (src_total, rrc_total, src_count, rrc_count): Remove.
20092 (any_conflicts): Remove.
20093 (print_conflicts): Split into...
20094 (conflicts_print, conflicts_output): New.
20095 * src/conflicts.h: Adjust.
20096 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
0f37a994 20097 * src/print.c (print_grammar): Issue `\n' between two rules.
0df87bb6
AD
20098 * tests/regression.at (Conflicts): New.
20099 Reported by Tom Lane.
20100
e4d3d4de
AD
201012001-11-12 Akim Demaille <akim@epita.fr>
20102
20103 * tests/regression.at (Invalid input): Remove, duplicate with
20104 ``Invalid input: 1''.
20105
6d7d248e
AD
201062001-11-12 Akim Demaille <akim@epita.fr>
20107
20108 * tests/torture.at (AT_DATA_STACK_TORTURE)
20109 (Exploding the Stack Size with Alloca)
20110 (Exploding the Stack Size with Malloc): New.
20111
e9e4c321
AD
201122001-11-12 Akim Demaille <akim@epita.fr>
20113
20114 * src/bison.simple (YYSTACK_REALLOC): New.
20115 (yyparse) [!yyoverflow]: Use it and free the old stack.
0f37a994 20116 Reported by Per Allansson.
e9e4c321 20117
5f7e0832
AD
201182001-11-12 Pascal Bart <pascal.bart@epita.fr>
20119
20120 * src/bison.simple: Define type yystype instead of YYSTYPE, and
20121 define CPP macro, which substitute YYSTYPE by yystype.
20122 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
20123 with yyltype/YYLTYPE. This allows inclusion of the generated
20124 header within the parser if the compiler, such as GGC, accepts
20125 multiple equivalent #defines.
20126 From Akim.
20127
e3f1699f
AD
201282001-11-05 Akim Demaille <akim@epita.fr>
20129
20130 * src/reader.c (symbols_output): New, extracted from...
20131 (packsymbols): here.
20132 (reader): Adjust.
20133
65be0866
AD
201342001-11-05 Akim Demaille <akim@epita.fr>
20135
20136 * src/lex.c (parse_percent_token): s/quotearg/quote/.
20137
e4d910bf
AD
201382001-11-05 Akim Demaille <akim@epita.fr>
20139
20140 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
20141 pattern.
20142
951366c1
AD
201432001-11-05 Akim Demaille <akim@epita.fr>
20144
20145 * src/options.h (struct option_table_struct): set_flags is void*.
20146 * src/options.c (longopts): Support `--output' and `%output'.
20147 (usage): Adjust.
20148 * src/lex.h (tok_setopt): Remove, replaced with...
20149 (tok_intopt, tok_stropt): these new guys.
20150 * src/lex.c (getopt.h): Not needed.
20151 (token_buffer, unlexed_token_buffer): Not const.
20152 (percent_table): Promote `-' over `_' in directive names.
20153 Active `%name-prefix', `file-prefix', and `output'.
20154 (parse_percent_token): Accept possible arguments to directives.
20155 Promote `-' over `_' in directive names.
20156
d8988b2f
AD
201572001-11-04 Akim Demaille <akim@epita.fr>
20158
20159 * doc/bison.texinfo (Decl Summary): Split the list into
20160 `directives for grammars' and `directives for bison'.
20161 Sort'em.
20162 Add description of `%name-prefix', `file-prefix', and `output'.
20163 Promote `-' over `_' in directive names.
20164 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
20165 Simplify the description of `--name-prefix'.
20166 Promote `-' over `_' in directive names.
20167 Promote `--output' over `--output-file'.
20168 Fix the description of `--defines'.
20169 * tests/output.at: Exercise %file-prefix and %output.
20170
6468d18e
AD
201712001-11-02 Akim Demaille <akim@epita.fr>
20172
20173 * doc/refcard.tex: Update.
20174
6b7e85b9
AD
201752001-11-02 Akim Demaille <akim@epita.fr>
20176
20177 * src/symtab.h (SUNDEF): New.
20178 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
20179 stand for `uninitialized', instead of 0.
20180 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
20181 * src/lex.c (lex): Adjust.
20182
20183 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
20184 Number it 0.
20185 Let yylex return it instead of a plain 0.
20186 Reported by Dick Streefland.
20187
cd5aafcf
AD
201882001-11-02 Akim Demaille <akim@epita.fr>
20189
20190 * tests/regression.at (Mixing %token styles): New test.
20191
037ca2f1
AD
201922001-11-02 Akim Demaille <akim@epita.fr>
20193
20194 * src/reader.c (parse_thong_decl): Formatting changes.
20195 (token_translations_init): New, extracted from...
20196 (packsymbols): Here.
20197 Adjust.
20198
270a173c
AD
201992001-11-01 Akim Demaille <akim@epita.fr>
20200
20201 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
20202 Check that `9foo.y' produces correct cpp guards.
20203 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
20204 guards.
20205 Reported by Wwp.
20206
561f9a30
AD
202072001-11-01 Akim Demaille <akim@epita.fr>
20208
20209 * tests/regression.at (Invalid input: 2): New.
20210 * src/lex.c (unlexed_token_buffer): New.
20211 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
20212 too.
20213 Reported by Wwp.
20214
f987e9d2
AD
202152001-11-01 Akim Demaille <akim@epita.fr>
20216
20217 * tests/calc.at: Catch up with 1.30.
20218 * configure.in: Bump to 1.49a.
20219 Adjust to newer Autotest.
20220
0846f581
PB
202212001-10-19 Pascal Bart <pascal.bart@epita.fr>
20222
20223 * src/conflicts.c: Move global variables rrc_total and src_total ...
20224 (print_conflicts): here.
20225 * src/output.c (output): Free global variable user_toknums.
20226 * src/lex.c (token_obstack): Become static.
20227
3c1a79b3
AD
202282001-10-18 Akim Demaille <akim@epita.fr>
20229
20230 * tests/atlocal.in (GCC): Add.
20231 * tests/calc.at: s/m4_match/m4_bmatch/.
20232 s/m4_patsubst/m4_bpatsubst/.
20233 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
20234 * configure.in: AC_SUBST(GCC).
20235
5d52e7d0
MA
202362001-10-14 Marc Autret <autret_m@epita.fr>
20237
20238 * src/options.c (create_long_option_table): Fix.
20239
631aa1d3
AD
202402001-10-10 Akim Demaille <akim@epita.fr>
20241
20242 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
20243
f6ec6d13
AD
202442001-10-04 Akim Demaille <akim@epita.fr>
20245
20246 * src/reader.c (parse_union_decl): Push the caracters in
20247 union_obstack, not attrs_obstack.
20248
342b8b6e
AD
202492001-10-04 Akim Demaille <akim@epita.fr>
20250
20251 Merge in the branch 1.29.
20252
20253 * src/reader.c (packsymbols): Use a temporary obstack for
20254 `%%tokendef', since output_stack is already used elsewhere.
20255
20256 2001-10-02 Akim Demaille <akim@epita.fr>
20257
20258 Bump 1.29d.
20259
20260 2001-10-02 Akim Demaille <akim@epita.fr>
20261
20262 Version 1.29c.
20263
20264 2001-10-02 Akim Demaille <akim@epita.fr>
20265
20266 * tests/regression.at (Invalid CPP headers): New.
20267 From Alexander Belopolsky.
20268 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
20269
20270 2001-10-02 Akim Demaille <akim@epita.fr>
20271
20272 * tests/regression.at (Invalid input): New.
20273 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
20274 Reported by Shura.
20275
20276 2001-10-02 Akim Demaille <akim@epita.fr>
20277
20278 * tests/calc.at: Now that --debug works, the tests must be adjusted.
20279
20280 2001-10-02 Akim Demaille <akim@epita.fr>
20281
20282 * src/output.c (output_parser): Assert `skeleton'.
20283 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
20284 systems.
20285 From Shura.
20286
20287 2001-10-01 Marc Autret <autret_m@epita.fr>
20288
20289 * src/lex.h: Echo modifications.
20290 * src/lex.c (unlex): Parameter is now token_t.
20291 From Hans Aberg.
20292
20293 2001-10-01 Marc Autret <autret_m@epita.fr>
20294
20295 * src/main.c: Include lex.h.
20296 From Hans Aberg.
20297
20298 2001-09-29 Akim Demaille <akim@epita.fr>
20299
20300 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
20301
20302 2001-09-28 Akim Demaille <akim@epita.fr>
20303
20304 * tests/testsuite.at: Update to newer Autotest.
20305 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
20306
20307 2001-09-27 Akim Demaille <akim@epita.fr>
20308
20309 Position independent wrapper.
20310
20311 * tests/bison: Remove.
20312 * tests/bison.in: New.
20313 * configure.in: Adjust.
20314
20315 2001-09-27 Paul Eggert <eggert@twinsun.com>
20316
20317 Port quotearg fixes from tar 1.13.24.
20318
20319 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
20320 tm to be declared.
20321 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
20322 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
20323
20324 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
20325 * m4/mbrtowc.m4: New file.
20326 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
20327 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
20328
20329 2001-09-27 Akim Demaille <akim@epita.fr>
20330
20331 Bump to 1.29c.
20332
20333 2001-09-27 Akim Demaille <akim@epita.fr>
20334
20335 Version 1.29b.
20336
20337 2001-09-25 Akim Demaille <akim@epita.fr>
20338
20339 * src/system.h: Include `xalloc.h'.
20340 Remove it from the C files.
20341 * src/files.c (output_files): Free the obstacks.
20342 * src/lex.c (init_lex): Rename as...
20343 (lex_init): this.
20344 (lex_free): New.
20345 * src/main.c (main): Use it.
20346
20347 2001-09-24 Marc Autret <autret_m@epita.fr>
20348
20349 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
20350 to output informations in fout (FILE*).
20351 (open_graph, close_graph): Likewise.
20352 (output_graph, output_edge, output_node): Likewise.
20353 * src/vcg.h: Update function prototypes.
20354 * src/print_graph.c (print_graph): Open output graph file.
20355 (print_actions): Adjust.
20356 * src/files.h: Remove extern declaration.
20357 * src/files.c: Remove graph_obstack declaration.
20358 (open_files): Remove graph_obstack initialization.
20359 (output_files): Remove graph_obstack saving.
20360
20361 2001-09-24 Marc Autret <autret_m@epita.fr>
20362
20363 * src/files.c (compute_output_file_names): Fix.
20364
20365 2001-09-24 Marc Autret <autret_m@epita.fr>,
20366 Akim Demaille <akim@epita.fr>
20367
20368 * src/reader.c (reader): Remove call to free_symtab ().
20369 * src/main.c (main): Call it here.
20370 Include symtab.h.
20371 * src/conflicts.c (initialize_conflicts): Rename as...
20372 (solve_conflicts): this.
20373 * src/print.c (print_core, print_actions, print_state)
20374 (print_grammar): Dump to a file instead a `output_obstack'.
20375 (print_results): Dump `output_obstack', and then proceed with the
20376 FILE *.
20377 * src/files.c (compute_output_file_names, close_files): New.
20378 (output_files): Adjust.
20379 * src/main.c (main): Adjust.
20380
20381 2001-09-23 Marc Autret <autret_m@epita.fr>
20382
20383 * src/files.c (compute_header_macro): Computes header macro name
20384 from spec_defines_file when given.
20385
20386 2001-09-23 Marc Autret <autret_m@epita.fr>
20387
20388 * src/files.c (output_files): Add default extensions.
20389
20390 2001-09-22 Akim Demaille <akim@epita.fr>
20391
20392 * src/conflicts.c (finalize_conflicts): Rename as...
20393 (free_conflicts): this.
20394
20395 2001-09-22 Akim Demaille <akim@epita.fr>
20396
20397 * src/gram.c (gram_free): Rename back as...
20398 (dummy): this.
20399 (output_token_translations): Free `token_translations'.
20400 * src/symtab.c (free_symtab): Free the tag field.
20401
20402 2001-09-22 Akim Demaille <akim@epita.fr>
20403
20404 Remove `translations' as it is always set to true.
20405
20406 * src/gram.h: Adjust.
20407 * src/reader.c (packsymbols, parse_token_decl): Adjust
20408 * src/print.c (print_grammar): Adjust.
20409 * src/output.c (output_token_translations): Adjust.
20410 * src/lex.c (lex): Adjust.
20411 * src/gram.c: Be sure the set pointers to NULL.
20412 (dummy): Rename as...
20413 (gram_free): this.
20414
20415 2001-09-22 Akim Demaille <akim@epita.fr>
20416
20417 * configure.in: Invoke AM_LIB_DMALLOC.
20418 * src/system.h: Use dmalloc.
20419 * src/LR0.c: Be sure to have pointers initialized to NULL.
20420 (allocate_itemsets): Allocate kernel_items only if needed.
20421
20422 2001-09-22 Akim Demaille <akim@epita.fr>
20423
20424 * configure.in: Bump to 1.29b.
20425 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
20426 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
20427 need xmalloc.c in calc.y.
20428 From Pascal Bart.
20429
20430 2001-09-21 Akim Demaille <akim@epita.fr>
20431
20432 Version 1.29a.
20433 * Makefile.maint, config/config.guess, config/config.sub,
20434 * config/missing: Update from masters.
20435 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
20436 upon package.m4.
20437 * configure.in (ALL_LINGUAS): Add `tr'.
20438
20439 2001-09-21 Akim Demaille <akim@epita.fr>
20440
20441 * tests/Makefile.am (package.m4): Move to...
20442 ($(srcdir)/$(TESTSUITE)): here.
20443
20444 2001-09-20 Akim Demaille <akim@epita.fr>
20445
20446 * src/complain.c: No longer try to be standalone: use system.h.
20447 Don't assume __STDC__ is defined to 1. Just test if it is defined.
20448 * src/complain.h: Likewise.
20449 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
20450 Remove the unused variable `n'.
20451 From Albert Chin-A-Young.
20452
20453 2001-09-18 Marc Autret <autret_m@epita.fr>
20454
20455 * doc/bison.1: Update.
20456 * doc/bison.texinfo (Bison Options): Update --defines and --graph
20457 descriptions.
20458 (Option Cross Key): Update.
20459 Add --graph.
20460
20461 2001-09-18 Marc Autret <autret_m@epita.fr>
20462
20463 * tests/regression.at: New test (comment in %union).
20464
20465 2001-09-18 Marc Autret <autret_m@epita.fr>
20466
20467 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
20468 do that.
20469 Reported by Keith Browne.
20470
20471 2001-09-18 Marc Autret <autret_m@epita.fr>
20472
20473 * tests/output.at: Add tests for --defines and --graph.
20474
20475 2001-09-18 Marc Autret <autret_m@epita.fr>
20476
20477 * tests/output.at: Removes tests of %{header,src}_extension features.
20478
20479 2001-09-18 Akim Demaille <akim@epita.fr>
20480
20481 * tests/Makefile.am (package.m4): New.
20482 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
20483 (_AT_CHECK_CALC_ERROR): Likewise.
20484 Factor the `, ' part of verbose error messages.
20485
20486 2001-09-18 Marc Autret <autret_m@epita.fr>
20487
20488 * src/getargs.c (longopts): Declare --defines and --graph as options
20489 with optional arguments.
20490 * src/files.h: Add extern declarations.
20491 * src/files.c (spec_graph_file, spec_defines_file): New.
20492 (output_files): Update.
20493 Remove CPP-outed code.
20494
20495 2001-09-18 Marc Autret <autret_m@epita.fr>
20496
20497 Turn off %{source,header}_extension feature.
20498
20499 * src/files.c (compute_exts_from_gf): Update.
20500 (compute_exts_from_src): Update.
20501 (output_files): CPP-out useless code.
20502 * src/files.h: Remove {header,source}_extension extern declarations.
20503 * src/reader.c (parse_dquoted_param): CPP-out.
20504 (parse_header_extension_decl): Remove.
20505 (parse_source_extension_decl): Remove.
20506 (read_declarations): Remove cases tok_{hdrext,srcext}.
20507 * src/lex.c (percent_table): Remove {header,source}_extension entries.
20508 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
20509
20510 2001-09-10 Akim Demaille <akim@epita.fr>
20511
20512 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
20513 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
20514 (AT_CHECK_OUTPUT): this.
20515 Merely check ls' exit status, its output is useless.
20516
20517 2001-09-10 Akim Demaille <akim@epita.fr>
20518
20519 * tests/calc.at: Use m4_match.
20520 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
20521
20522 2001-09-10 Marc Autret <autret_m@epita.fr>,
20523 Akim Demaille <akim@epita.fr>
20524
20525 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
20526 enum color_e.
20527 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
20528 to `normal'.
20529 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
20530 * src/lex.h: Adjust prototype.
20531 (token_t): Add `tok_undef'.
20532 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
20533 (parse_percent_token): Now returns token_t.
20534 Add default statement in switch.
20535 (lex): Separate `c' as an input variable, from the token_t result
20536 part.
20537 (unlexed): Is a token_t.
20538
20539 2001-09-10 Akim Demaille <akim@epita.fr>
20540
20541 * configure.in: Bump to 1.29a.
20542
20543 2001-09-07 Akim Demaille <akim@epita.fr>
20544
20545 Version 1.29.
20546
20547 2001-08-30 Akim Demaille <akim@epita.fr>
20548
20549 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
20550 * m4/atconfig.m4: Remove.
20551 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
20552 * tests/bison: New.
20553 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
20554 m4_if, m4_patsubst, and m4_regexp.
20555 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
20556 `input' file instead of echo.
20557
20558 2001-08-29 Akim Demaille <akim@epita.fr>
20559
20560 Bump to 1.28e.
20561
20562 2001-08-29 Akim Demaille <akim@epita.fr>
20563
20564 Version 1.28d.
20565
20566 2001-08-29 Paul Eggert <eggert@twinsun.com>
20567
20568 * src/bison.simple (yyparse): Don't take the address of an
20569 item before the start of an array, as that doesn't conform to
20570 the C Standard.
20571
20572 2001-08-29 Robert Anisko <anisko_r@epita.fr>
20573
20574 * doc/bison.texinfo (Location Tracking Calc): New node.
20575
20576 2001-08-29 Paul Eggert <eggert@twinsun.com>
20577
20578 * src/output.c (output): Do not define const, as this now
20579 causes more problems than it cures.
20580
20581 2001-08-29 Akim Demaille <akim@epita.fr>
20582
20583 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
20584 the nodes.
20585 Be sure to tag the `detailmenu'.
20586
20587 2001-08-29 Akim Demaille <akim@epita.fr>
20588
20589 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
20590 download in a tmp dir.
20591
20592 2001-08-28 Marc Autret <autret_m@epita.fr>
20593
20594 * config/depcomp: New file.
20595
20596 2001-08-28 Marc Autret <autret_m@epita.fr>
20597
20598 * doc/bison.1 (mandoc): Adjust.
20599 From Juan Manuel Guerrero.
20600
20601 2001-08-28 Marc Autret <autret_m@epita.fr>
20602
20603 * src/print_graph.c (print_state): Fix.
20604
20605 2001-08-27 Marc Autret <autret_m@epita.fr>
20606
20607 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
20608 char * members.
20609 Echo modifications to the functions prototypes.
20610 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
20611
20612 2001-08-27 Marc Autret <autret_m@epita.fr>
20613
20614 * src/vcg.c: Include `xalloc.h'.
20615 (add_colorentry): New.
20616 (add_classname): New.
20617 (add_infoname): New.
20618 * src/vcg.h: Add new prototypes.
20619
20620 2001-08-27 Akim Demaille <akim@epita.fr>
20621
20622 * Makefile.maint: Sync. again with CVS Autoconf.
20623
20624 2001-08-27 Akim Demaille <akim@epita.fr>
20625
20626 * Makefile.maint: Formatting changes.
20627 (po-update, cvs-update, update): New targets.
20628 (AMTAR): Remove.
20629
20630 2001-08-27 Akim Demaille <akim@epita.fr>
20631
20632 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
20633 * Makefile.maint: Sync. with CVS Autoconf.
20634
20635 2001-08-27 Marc Autret <autret_m@epita.fr>
20636
20637 * src/vcg.h (struct infoname_s): New.
20638 (struct colorentry_s): New.
20639 (graph_s): New fields {vertical,horizontal}_order in structure.
20640 Add `infoname' field.
20641 Add `colorentry' field;
20642 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
20643 (G_HORIZONTAL_ORDER): New.
20644 (G_INFONAME): New.
20645 (G_COLORENTRY): New.
20646 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
20647 Add output of `infoname'.
20648 Add output of `colorentry'.
20649
20650 2001-08-27 Marc Autret <autret_m@epita.fr>
20651
20652 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
20653 This one shadowed a global parameter.
20654
20655 2001-08-24 Marc Autret <autret_m@epita.fr>
20656
20657 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
20658 instead of `unsigned'.
20659 (print_state): Do not call obstack_object_size () in obstack_grow ()
20660 to avoid macro variables shadowing.
20661
20662 2001-08-23 Marc Autret <autret_m@epita.fr>
20663
20664 * src/lex.c (percent_table): Typo: s/naem/name/.
20665 Add graph option.
20666 Normalize new options declarations.
20667
20668 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
20669
20670 * tests/suite.at: Exercise %header_extension and %source_extension.
20671
20672 2001-08-16 Marc Autret <autret_m@epita.fr>
20673
20674 * src/reader.c (parse_dquoted_param): New.
20675 (parse_header_extension_decl): Use it.
20676 (parse_source_extension_decl): Likewise.
20677
20678 2001-08-16 Marc Autret <autret_m@epita.fr>
20679
20680 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
20681 (get_xxxx_str): Use assert () instead of complain ().
20682 Remove return invokations in default cases.
20683 (get_decision_str): Modify default behaviour. Remove second argument.
20684 Echo modifications on calls.
20685 (output_graph): Fix.
20686
20687 2001-08-16 Marc Autret <autret_m@epita.fr>
20688
20689 * src/getargs.c (usage): Update with ``-g, --graph''.
20690
20691 2001-08-16 Marc Autret <autret_m@epita.fr>
20692
20693 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
20694 (Option Cross Key): Likewise.
20695 * doc/bison.1: Update.
20696
1c8c2190
PB
206972001-09-25 Pascal Bart <pascal.bart@epita.fr>
20698
20699 * src/output.c (output_master_parser): Don't finish action_obstack.
20700 (output_parser): Don't care about the muscle action, here.
20701 (prepare): Copy the action_obstack in the action muscle.
20702 (output): Free action_obstack.
20703
180d45ba
PB
207042001-09-23 Pascal Bart <pascal.bart@epita.fr>
20705
20706 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
20707 will contain `%union' declaration.
20708 (parse_union_decl): Delete #line directive output.
20709 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
20710 informations about %union.
20711 (parse_union_decl): Copy the union_obstack in the muscle stype.
20712 * src/bison.simple: Add new #line directive.
20713 Add typdef %%stype YYSTYPE.
20714
c51d1a19
PB
207152001-09-23 Pascal Bart <pascal.bart@epita.fr>
20716
20717 * src/bison.simple: Add new `#line' directive.
20718
6f9344da
PB
207192001-09-22 Pascal Bart <pascal.bart@epita.fr>
20720
20721 * src/bison.simple: New `#line' directive.
20722 * src/output.c (output_parser): Support new dynamic muscle input_line.
20723
652def80
MA
207242001-09-22 Marc Autret <autret_m@epita.fr>
20725
20726 * src/output.c (output_master_parser): New.
20727 (output_parser): Be more re-entrant.
20728
25b222fa
MA
207292001-09-21 Marc Autret <autret_m@epita.fr>
20730
20731 * src/reader.c (copy_definition, parse_union_decl): Update and use
20732 `linef' muscle.
20733 (copy_action): Likewise.
20734 Use obstack_1grow ().
20735 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
20736
6bc35ae5
MA
207372001-09-21 Marc Autret <autret_m@epita.fr>
20738
20739 * src/options.c (option_table): Adjust.
20740 * src/lex.c (parse_percent_token): Fix.
20741
c0629aa1
PB
207422001-09-20 Pascal Bart <pascal.bart@epita.fr>
20743
20744 * src/options.c (symtab.h): Include it, need by lex.h.
342b8b6e 20745
82b6d266
PB
207462001-09-20 Pascal Bart <pascal.bart@epita.fr>
20747
20748 * src/lex.c (parse_percent_token): Change type of variable `tx', which
20749 is now an option_table_struct*.
20750 (option_strcmp): New function option_strcmp.
20751 (parse_percent_token): Call option_strcmp.
20752 * src/getargs.c (xalloc.h, options.h): Include it.
20753 (getargs): Call create_long_option_table.
20754 (getargs): Free longopts at the end of the function.
20755 (shortopts): Move in options.c.
20756 * src/options.c (create_long_option_table): New function. Convert
20757 information from option_table to option structure.
20758 * src/reader.c (options.h): Include it.
20759
20760 * src/Makefile.am: Adjust.
20761 * src/options.c (option_table): Create from longopts and percent_table.
20762 * src/getargs.c (longopts): Delete.
20763 * src/lex.c (struct percent_table_struct): Delete.
20764 (percent_table): Delete.
20765 (options.h): Include it.
20766 * src/options.c: Create.
20767 * src/options.h: Create.
20768 Declare enum opt_access_e.
20769 Define struct option_table_struct.
20770
75f5aaea
MA
207712001-09-20 Marc Autret <autret_m@epita.fr>
20772
20773 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
20774 sections of Bison.
20775
f508cb0a
PB
207762001-09-19 Pascal Bart <pascal.bart@epita.fr>
20777
20778 * src/bison.simple: s/%%filename/%%skeleton.
20779 * src/muscle_tab.c (getargs.h): Include it.
20780 (muscle_init): Insert new muscle skeleton.
20781
13105fc1
PB
207822001-09-18 Pascal Bart <pascal.bart@epita.fr>
20783
20784 * src/output.c (output_parser): Delete unused variable actions_dumped.
20785
b0c4483e
PB
207862001-09-07 Pascal Bart <pascal.bart@epita.fr>
20787
20788 * src/output.c (output): Delete call to reader_output_yylsp.
20789 * src/reader.c (reader): Likewise.
ba0fe3c7 20790 * src/reader.h: Delete declaration of reader_output_yylsp.
342b8b6e 20791
11d82f03
MA
207922001-09-02 Marc Autret <autret_m@epita.fr>
20793
20794 * src/reader.c: Include muscle_tab.h.
20795 (parse_union_decl): Update.
20796 (parse_macro_decl): Rename parse_muscle_decl.
20797 Update to use renamed functions and variable.
20798 (read_declarations, copy_action, read_additionnal_code, : Updated
20799 with correct variables and functions names.
20800 (packsymbols, reader): Likewise.
342b8b6e 20801
11d82f03 20802 * src/reader.h (muscle_obstack): Extern declaration update.
342b8b6e 20803
11d82f03
MA
20804 * src/output.c: Include muscle_tab.h
20805 In all functions using macro_insert, change by using muscle_insert ().
20806 (macro_obstack): Rename muscle_obstack.
20807 Echo modifications in the whole file.
20808 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
20809 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
20810 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
20811
20812 * src/muscle_tab.h: Update double inclusion macros.
20813 (macro_entry_s): Rename muscle_entry_s.
20814 Update prototypes.
342b8b6e 20815
11d82f03
MA
20816 * src/muscle_tab.c: Include muscle_tab.h.
20817 Rename macro_tabble to muscle_table.
20818 (mhash1, mhash2, mcmp): Use muscle_entry.
20819 (macro_init): Rename muscle_init. Update.
20820 (macro_insert): Rename muscle_insert. Update.
20821 (macro_find): Rename muscle_find. Update.
20822
20823 * src/main.c: Include muscle_tab.h.
20824 (main): Call muscle_init ().
20825 * src/Makefile.am (bison_SOURCES): Echo modifications.
20826
93a37297
MA
208272001-09-02 Marc Autret <autret_m@epita.fr>
20828
f753cd62 20829 Now the files macro_tab.[ch] are named muscle_tab.[ch].
342b8b6e 20830
f753cd62
MA
20831 * src/muscle_tab.c, src/muscle_tab.h: Add files.
20832
208332001-09-02 Marc Autret <autret_m@epita.fr>
20834
20835 * src/macrotab.c, src/macrotab.h: Remove.
93a37297 20836
682d48cd
PB
208372001-09-01 Pascal Bart <pascal.bart@epita.fr>
20838
342b8b6e 20839 * src/reader.c (copy_guard): Use muscle to specify the `#line'
682d48cd
PB
20840 filename.
20841
087c8fda
MA
208422001-09-01 Marc Autret <autret_m@epita.fr>
20843
20844 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
20845 to an explicit value to activate the feature. We do it here.
20846
dda680cb
PB
208472001-08-31 Pascal Bart <pascal.bart@epita.fr>
20848
20849 * src/output.c (prepare): Delete the `filename' muscule insertion.
20850 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
20851 (parse_union_decl): Likewise.
20852 * src/macrotab.c (macro_init): Initialize filename by infile.
20853
9e644e64
MA
208542001-08-31 Marc Autret <autret_m@epita.fr>
20855
20856 * src/bison.simple (YYLSP_NEEDED): New definition.
20857 * src/output.c (prepare): Add macro insertion of `locations_flag'
20858
17da6427
PB
208592001-08-31 Pascal Bart <pascal.bart@epita.fr>
20860
20861 * src/output.c (prepare): Delete insertion of previous muscles,
20862 and insert the `prefix' muscles.
20863 * src/macrotab.c (macro_init): Likewise.
20864 (macro_init): Initialization prefix directive by `yy'.
342b8b6e 20865 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17da6427
PB
20866 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
20867 yylval, yydebug, yyerror, yynerrs and yyparse.
342b8b6e 20868 New directive `#define' to substitute yydebug, ... with option
17da6427
PB
20869 name_prefix.
20870
e8cb70b9
PB
208712001-08-31 Pascal Bart <pascal.bart@epita.fr>
20872
20873 * src/main.c (main): Standardize.
20874 * src/output.c (output_table_data, output_parser): Likewise.
20875 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
20876
63c2d5de
MA
208772001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
20878
342b8b6e 20879 * src/reader.c (read_additionnal_code): Rename %%user_code to
63c2d5de
MA
20880 %%epilogue.
20881 * src/output.c (output): Rename %%declarations to %%prologue.
20882 * src/bison.simple: Echo modifications.
342b8b6e 20883
d8cb5183
MA
208842001-08-31 Marc Autret <autret_m@epita.fr>
20885
20886 * src/reader.c (readgram): CleanUp.
20887 (output_token_defines): Likewise.
20888 (packsymbols): Likewise.
20889 (reader): Likewise.
20890 * src/output.c (output): CPP-out useless code.
20891
6c686258
PB
208922001-08-31 Pascal Bart <pascal.bart@epita.fr>
20893
342b8b6e 20894 * src/reader.c (reader): Delete obsolete call to function
6c686258
PB
20895 output_trailers and output_headers.
20896 * src/output.h: Remove obsolete functions prototypes of output_headers
20897 and output_trailers.
20898
8f451ef7
PB
208992001-08-30 Pascal Bart <pascal.bart@epita.fr>
20900
20901 * src/main.c: Include macrotab.h.
342b8b6e 20902 * src/macrotab.h (macro_entry_s): Constify fields.
8f451ef7
PB
20903 Adjust functions prototypes.
20904 * src/macrotab.c (macro_insert): Constify key and value.
20905 (macro_find): Constify key.
20906 (macro_insert): Include 'xalloc.h'
20907 (macro_insert): Use XMALLOC.
20908 (macro_find): Constify return value.
20909 * src/output.c (output_table_data): Rename table to table_data.
20910 (output_parser): Constify macro_key, macro_value.
20911
997b6fd0 209122001-08-30 Marc Autret <autret_m@epita.fr>
2ba3b73c
MA
20913
20914 * src/reader.c (parse_skel_decl): New.
342b8b6e 20915 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
2ba3b73c
MA
20916 * src/lex.h (token_t): New token `tok_skel'.
20917 * src/lex.c (percent_table): Add skeleton option entry.
20918 Standardize.
20919
ff48177d
MA
209202001-08-29 Marc Autret <autret_m@epita.fr>
20921
20922 * src/bison.simple: Add %%user_code directive at the end.
20923 * src/reader.c (read_additionnal_code): New.
20924 (reader): Use it.
20925 * src/output.c (output_program): Remove.
20926 (output): Update.
20927
b33160bf
MA
209282001-08-28 Marc Autret <autret_m@epita.fr>
20929
20930 * src/output.c (output_actions): Clean up.
4e5caae2 20931 (output_gram): CPP-out useless code.
b33160bf
MA
20932 * src/reader.c (reader): Clean up, CPP-out useless code.
20933
d1a2daf7
PB
209342001-08-28 Pascal Bart <pascal.bart@epita.fr>
20935
342b8b6e 20936 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
535c0e75 20937 directive.
d1a2daf7
PB
20938 * src/bison.simple: Add `%%definitions'.
20939
2b763dfe
MA
209402001-08-28 Marc Autret <autret_m@epita.fr>
20941
20942 * config/depcomp: New file.
20943
f1a87ef6
PE
209442001-08-27 Paul Eggert <eggert@twinsun.com>
20945
20946 * src/bison.simple (yyparse): Don't take the address of an
20947 item before the start of an array, as that doesn't conform to
20948 the C Standard.
20949
82e236e2
RA
209502001-08-27 Robert Anisko <robert.anisko@epita.fr>
20951
f1a87ef6 20952 * src/output.c (output): Remove the initialization of the macro
82e236e2
RA
20953 obstack. It was done too late here.
20954
20955 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
20956 completely wrong.
20957 (reader): Initialize the macro obstack here, since we need it to grow
20958 '%define' directives.
20959
20960 * src/reader.h: Declare the macro obstack as extern.
20961
b0cfa28a
RA
209622001-08-27 Robert Anisko <robert.anisko@epita.fr>
20963
20964 * src/output.c (output_parser): Fix. Store single '%' characters in
20965 the output obstack instead of throwing them away.
20966
6fc74234
AD
209672001-08-27 Akim Demaille <akim@epita.fr>
20968
20969 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
20970
9c76d118
RA
209712001-08-25 Robert Anisko <robert.anisko@epita.fr>
20972
20973 * lib/Makefile.am: Adjust.
20974
a8289c62
RA
209752001-08-25 Robert Anisko <robert.anisko@epita.fr>
20976
20977 * src/bison.simple: Update and add '%%' directives.
20978
b6610515
RA
209792001-08-25 Robert Anisko <robert.anisko@epita.fr>
20980
20981 * src/reader.c (reader): Remove calls to 'output_headers' and
20982 'output_trailers'. Remove some C output.
20983 (readgram): Disable a piece of code that was writing a default
20984 definition for 'YYSTYPE'.
20985 (reader_output_yylsp): Remove.
20986 (packsymbols): Output token defintions to a macro.
20987 (copy_definition): Disable C output.
6fc74234 20988
b6610515
RA
20989 * src/reader.c (parse_macro_decl): New function used to parse macro
20990 declarations.
20991 (copy_string2): Put the body of copy_string into this new function.
20992 Add a parameter to let the caller choose whether he wants to copy the
20993 string delimiters or not.
20994 (copy_string): Be a simple call to copy_string2 with the last argument
20995 bound to true.
20996 (read_declarations): Add case for macro definition.
20997 (copy_identifier): New.
6fc74234 20998 (parse_macro_decl): Read macro identifiers using copy_identifier
b6610515
RA
20999 rather than lex.
21000
26f609ff
RA
210012001-08-25 Robert Anisko <robert.anisko@epita.fr>
21002
21003 * src/output.c (prepare): Add prefixed names.
21004 (output_parser): Output semantic actions.
21005 (output_parser): Fix bug on '%%line' directives.
6fc74234 21006
26f609ff
RA
21007 * src/output.c (output_headers): Remove. The C code printed by this
21008 function should now be in the skeletons.
21009 (output_trailers): Remove.
21010 (output): Disable call to 'reader_output_yylsp'.
21011 (output_rule_data): Do not output tables to the table obstack.
21012
21013 * src/output.c: Remove some C dedicated output.
21014 Improve the use of macro and output obstacks.
21015 (output_defines): Remove.
6fc74234 21016
26f609ff
RA
21017 * src/output.c (output_token_translations): Associate 'translate'
21018 table with a macro. No output to the table obstack.
21019 (output_gram): Same for 'rhs' and 'prhs'.
21020 (output_stos): Same for 'stos'.
21021 (output_rule_data): Same for 'r1' and 'r2'.
21022 (token_actions): Same for 'defact'.
21023 (goto_actions): Same for 'defgoto'.
21024 (output_base): Same for 'pact' and 'pgoto'.
21025 (output_table): Same for 'table'.
21026 (output_check): Same for 'check'.
6fc74234 21027
26f609ff
RA
21028 * src/output.c (output_table_data): New function.
21029 (output_short_table): Remove.
21030 (output_short_or_char_table): Remove.
6fc74234 21031
26f609ff
RA
21032 * src/output.c (output_parser): Replace most of the skeleton copy code
21033 with something new. Skeletons are now processed character by character
21034 rather than line by line, and Bison looks for '%%' macros. This is the
21035 first step in making Bison's output process (a lot) more flexible.
21036 (output_parser): Use the macro table.
21037
6f43b113
RA
210382001-08-25 Robert Anisko <robert.anisko@epita.fr>
21039
21040 * src/main.c (main): Initialize the macro table.
21041
dd3127cf
RA
210422001-08-25 Robert Anisko <robert.anisko@epita.fr>
21043
21044 * src/lex.c (percent_table): Add tok_define.
21045 * src/lex.h: Add tok_define.
21046
aa321494
RA
210472001-08-25 Robert Anisko <robert.anisko@epita.fr>
21048
21049 * src/macrotab.c: New file.
21050 * src/macrotab.h: New file.
21051 * src/Makefile.am: Update.
21052
68bd3b6b
RA
210532001-08-25 Robert Anisko <robert.anisko@epita.fr>
21054
21055 * lib/hash.c: New file.
21056 * lib/hash.h: New file.
21057 * lib/Makefile.am: Update.
21058
45f8dd1e
AD
210592001-08-15 Akim Demaille <akim@epita.fr>
21060
21061 Version 1.28c.
21062
40a64a7a 210632001-08-15 Marc Autret <autret_m@epita.fr>
0b8afb77
AD
21064
21065 * src/reader.c (readgram): Indent output macro YYSTYPE.
21066 (packsymbols): Likewise.
21067 (output_token_defines): Likewise.
21068 * src/files.c: Standardize.
21069 (compute_header_macro): New.
21070 (defines_obstack_save): New. Use compute_header_macro.
21071 (output_files): Update. Use defines_obstack_save.
21072
f9a8293a
AD
210732001-08-15 Akim Demaille <akim@epita.fr>
21074
21075 * doc/bison.texinfo (Table of Symbols): Document
21076 YYSTACK_USE_ALLOCA.
21077
150ca7a7
AD
210782001-08-15 Akim Demaille <akim@epita.fr>
21079
21080 * missing: Update from CVS Automake.
21081 * config/config.guess, config/config.sub, config/texinfo.tex:
21082 Update from gnu.org.
21083
69b5cec4
AD
210842001-08-15 Akim Demaille <akim@epita.fr>
21085
21086 * Makefile.maint: Sync with CVS Autoconf.
21087
f2b5126e
PB
210882001-08-14 Pascal Bart <pascal.bart@epita.fr>
21089
69b5cec4 21090 * doc/bison.texinfo: Include GNU Free Documentation License from
f2b5126e
PB
21091 `fdl.texi'.
21092 * doc/fdl.texi: Add to package.
21093
4ecbf796
MA
210942001-08-14 Marc Autret <autret_m@epita.fr>
21095
21096 Turn on %{source,header}_extension features.
21097
69b5cec4 21098 * src/lex.c (percent_table): Un-CPP out header_extension and
4ecbf796
MA
21099 source_extension.
21100 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
69b5cec4 21101 (compute_exts_from_src): Remove conditions. It restores priorities
4ecbf796
MA
21102 between options.
21103
95fb5662
MA
211042001-08-14 Marc Autret <autret_m@epita.fr>
21105
21106 * src/files.c (compute_base_names): Add extensions computing when
21107 `--file-prefix' used.
21108 Standardize function calls.
21109
78d09da9
MA
211102001-08-13 Marc Autret <autret_m@epita.fr>
21111
69b5cec4 21112 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
78d09da9
MA
21113 defining it (defined but null disables alloca).
21114
5a009f2c
MA
211152001-08-13 Marc Autret <autret_m@epita.fr>
21116
21117 * src/bison.simple (_yy_memcpy): CPP reformat.
21118
1e41465a
PB
211192001-08-13 Pascal Bart <pascal.bart@epita.fr>
21120
21121 * tests/atconfig.in (CPPFLAGS): Fix.
21122
c67a198d
PB
211232001-08-10 Pascal Bart <pascal.bart@epita.fr>
21124
79282c6c 21125 * doc/bison.texinfo: Include GNU General Public License from
c67a198d
PB
21126 `gpl.texi'.
21127 * doc/gpl.texi: Add to package.
21128
09a6de7e
MA
211292001-08-10 Marc Autret <autret_m@epita.fr>
21130
21131 * src/print_graph.h: Fix.
21132 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
21133
b77b9ee0
AD
211342001-08-10 Akim Demaille <akim@epita.fr>
21135
21136 * src/system.h: Provide default declarations for stpcpy, strndup,
21137 and strnlen.
21138
3e259915
MA
211392001-08-10 Robert Anisko <anisko_r@epita.fr>
21140
21141 * doc/bison.texinfo (Locations): Update @$ stuff.
21142
ca96bc2d
MA
211432001-08-09 Robert Anisko <anisko_r@epita.fr>
21144
21145 * src/bison.simple (YYLLOC_DEFAULT): Update.
21146 (yyparse): Adjust.
21147
fdc6758b
MA
211482001-08-08 Marc Autret <autret_m@epita.fr>
21149
b77b9ee0 21150 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
fdc6758b
MA
21151 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
21152 Reported by Fabrice Bauzac.
957d4dbf 21153
600cad3b
MA
211542001-08-08 Marc Autret <autret_m@epita.fr>
21155
21156 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
21157 * src/vcg.c (output_node): Fix.
21158 * src/vcg.h: Cleanup.
21159 * src/print_graph.c: Add comments.
b77b9ee0 21160 (node_output_size): New global variable. Simplify the formatting of
600cad3b 21161 the VCG graph output.
b77b9ee0 21162 (print_actions): Unused code is now used. It notifies the final state
600cad3b 21163 and no action states in the VCG graph. It also give the reduce actions.
b77b9ee0 21164 The `shift and goto' edges are red and the `go to state' edges are
600cad3b
MA
21165 blue.
21166 Get the current node name and node_obstack by argument.
21167 (node_obstack): New variable.
21168 (print_state): Manage node_obstack.
21169 (print_core): Use node_obstack given by argument.
21170 A node is not only computed here but in print_actions also.
21171 (print_graph): CPP out useless code instead of commenting it.
21172
976e528f
AD
211732001-08-07 Pascal Bart <pascal.bart@epita.fr>
21174
21175 * tests/atconfig.in (CPPFLAGS): Fix.
21176
20e8e5ca
AD
211772001-08-07 Akim Demaille <akim@epita.fr>
21178
21179 * src/print_graph.c (quote): New.
21180 (print_core): Use it.
21181
957d4dbf 211822001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
3e3da797 21183
3e3da797
AD
21184 * src/vcg.c (complain.h): Include it.
21185 Unepitaize `return' invocations.
c4b66126 21186 [NDEBUG] (main): Remove.
79282c6c 21187 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
c4b66126
AD
21188 * src/files.c (open_files): Initialize graph_obstack.
21189 * src/print_graph.c (print_actions): CPP out useless code.
21190 (print_core): Don't output the last `\n' in labels.
21191 Use `quote'.
21192 * src/files.c (output_files): Output the VCG file.
21193 * src/main.c (main): Invoke print_graph ();
3e3da797 21194
957d4dbf 211952001-08-06 Marc Autret <autret_m@epita.fr>
22c2cbc0
AD
21196
21197 Automaton VCG graph output.
21198 Using option ``-g'' or long option ``--graph'', you can generate
21199 a gram_filename.vcg file containing a VCG description of the LALR (1)
21200 automaton of your grammar.
21201
21202 * src/main.c: Call to print_graph() function.
21203 * src/getargs.h: Update.
21204 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
21205 (graph_flag): New flag.
21206 (longopts): Update.
21207 (getargs): Add case `g'.
21208 * src/files.c (graph_obstack): New obstack struct.
21209 (open_files): Initialize new obstack.
21210 (output_files): Saves graph_obstack if required.
21211 * src/files.h (graph_obstack): New extern declaration.
21212 * src/Makefile.am: Add new source files.
21213
927c1557 212142001-08-06 Marc Autret <autret_m@epita.fr>
ce4d5ce0
AD
21215
21216 * src/print_graph.c, src/print_graph.h (graph): New.
21217 * src/vcg.h: New file.
21218 * src/vcg.c: New file, VCG graph handling.
21219
7333d403
AD
212202001-08-06 Marc Autret <autret_m@epita.fr>
21221
21222 Add of %source_extension and %header_extension which specify
21223 the source or/and the header output file extension.
21224
21225 * src/files.c (compute_base_names): Remove initialisation of
21226 src_extension and header_extension.
21227 (compute_exts_from_gf): Update.
21228 (compute_exts_from_src): Update.
21229 (output_files): Update.
21230 * src/reader.c (parse_header_extension_decl): New.
21231 (parse_source_extension_decl): New.
21232 (read_declarations): New case statements for the new tokens.
21233 * src/lex.c (percent_table): Add entries for %source_extension
21234 and %header_extension.
21235 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
21236
84163231
AD
212372001-08-06 Marc Autret <autret_m@epita.fr>
21238
21239 * configure.in: Bump to 1.28c.
21240 * doc/bison.texinfo: Texinfo thingies.
21241
8303fc42
AD
212422001-08-04 Pascal Bart <pascal.bart@epita.fr>
21243
21244 * tests/atconfig.in (CPPFLAGS): Add.
21245 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
21246
70a84437
AD
212472001-08-03 Akim Demaille <akim@epita.fr>
21248
21249 Version 1.28b.
21250
2ce10144
AD
212512001-08-03 Akim Demaille <akim@epita.fr>
21252
21253 * tests/Makefile.am (check-local): Ship testsuite.
21254 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
21255 Include `string.h'.
21256
1e3e4bc1
AD
212572001-08-03 Akim Demaille <akim@epita.fr>
21258
21259 * configure.in: Try using -Wformat when compiling.
21260
42b45b7f
AD
212612001-08-03 Akim Demaille <akim@epita.fr>
21262
21263 * configure.in: Bump to 1.28b.
21264
8f13fe33
AD
212652001-08-03 Akim Demaille <akim@epita.fr>
21266
21267 * src/complain.c: Adjust strerror_r portability issues.
21268
b37ba92c
AD
212692001-08-03 Akim Demaille <akim@epita.fr>
21270
21271 Version 1.28a.
21272
b0ce6046
AD
212732001-08-03 Akim Demaille <akim@epita.fr>
21274
21275 * src/getargs.c, src/getarg.h (skeleton)): Constify.
21276 * src/lex.c (literalchar): Avoid name clashes on `buf'.
21277 * src/getargs.c: Include complain.h.
21278 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
21279 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
21280
d01c415b
AD
212812001-08-03 Akim Demaille <akim@epita.fr>
21282
21283 * src/reader.c (readgram): Display hidden chars in error messages.
21284
459dd1a6
AD
212852001-08-03 Akim Demaille <akim@epita.fr>
21286
21287 Update to gettext 0.10.39.
21288
53b74c0c
AD
212892001-08-03 Akim Demaille <akim@epita.fr>
21290
21291 * lib/strspn.c: New.
21292
234a3be3
AD
212932001-08-01 Marc Autret <autret_m@epita.fr>
21294
21295 * doc/bison.texinfo: Update.
21296 * doc/bison.1 (mandoc): Update.
21297 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
21298 * src/files.c: Support output files extensions computing.
21299 (src_extension): New static variable.
21300 (header_extension): New static variable.
21301 (tr): New function.
21302 (get_extension_index): New function, gets the index of an extension
21303 filename in a string.
21304 (compute_exts_from_gf): New function, computes extensions from the
21305 grammar file extension.
21306 (compute_exts_from_src): New functions, computes extensions from the
21307 C source file extension, file given by ``-o'' option.
21308 (compute_base_names): Update.
21309 (output_files): Update.
21310
847bf1f5
AD
213112001-08-01 Robert Anisko <anisko_r@epita.fr>
21312
d995fee7 21313 * doc/bison.texi: Document @$.
847bf1f5
AD
21314 (Locations): New section.
21315
d074a105
AD
213162001-07-18 Akim Demaille <akim@epita.fr>
21317
21318 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
21319 * config/prev-version.txt, config/move-if-change: New.
21320 * Makefile.am: Adjust.
21321
3419715d
AD
213222001-07-08 Pascal Bart <pascal.bart@epita.fr>
21323
21324 * src/bison.simple (yyparse): Suppress warning `comparaison
21325 between signed and unsigned'.
21326
62ab6972
AD
213272001-07-05 Pascal Bart <pascal.bart@epita.fr>
21328
21329 * src/getargs.h (raw_flag): Remove.
21330 * src/getargs.c: Die on `-r'/`--raw'.
21331 * src/lex.c (parse_percent_token): Die on `%raw'.
21332 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
21333 * tests/calc.at: Suppress test with option `--raw'.
21334
1e24cc5b
AD
213352001-07-14 Akim Demaille <akim@epita.fr>
21336
21337 * config/: New.
21338 * configure.in: Require Autoconf 2.50.
21339 Update to gettext 0.10.38.
21340
32dfccf8
AD
213412001-03-16 Akim Demaille <akim@epita.fr>
21342
21343 * doc/bison.texinfo: ANSIfy the examples.
21344
cd5bd6ac
AD
213452001-03-16 Akim Demaille <akim@epita.fr>
21346
21347 * getargs.c (skeleton): New variable.
21348 (longopts): --skeleton is a new option.
21349 (shortopts, getargs): -S is a new option.
21350 * getargs.h: Declare skeleton.
21351 * output.c (output_parser): Use it.
21352
5141b016
AD
213532001-03-16 Akim Demaille <akim@epita.fr>
21354
21355 * m4/strerror_r.m4: New.
21356 * m4/error.m4: Run AC_FUNC_STRERROR_R.
21357 * lib/error.h, lib/error.c: Update.
21358
447992b9
AD
213592001-03-16 Akim Demaille <akim@epita.fr>
21360
21361 * src/getargs.c (longopts): Clean up.
21362
274d42ce
AD
213632001-02-21 Akim Demaille <akim@epita.fr>
21364
21365 * src/reader.c (gensym): `gensym_count' is your own.
21366 Use a static buf to create the symbol name, as token_buffer is no
21367 longer a buffer.
21368
22c821f3
AD
213692001-02-08 Akim Demaille <akim@epita.fr>
21370
21371 * src/conflicts.c (conflict_report): Be sure not to append to res
21372 between two calls, which could happen if both first sprintf were
21373 skipped, but not the first cp += strlen.
21374
18569462
AD
213752001-02-08 Akim Demaille <akim@epita.fr>
21376
21377 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
21378 New, from fileutils 4.0.37.
21379 * configure.in: Require Autoconf 2.49c. I took some time before
21380 making this decision. This is the only way out for portability
21381 issues in Bison, it would mean way too much duplicate effort to
21382 import in Bison features implemented in 2.49c since 2.13.
21383 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
21384
0d8f3c8a
AD
213852001-02-02 Akim Demaille <akim@epita.fr>
21386
21387 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
66075dcf 21388 * lib/xalloc.h, lib/xmalloc.c: Update.
0d8f3c8a 21389
f17bcd1f
AD
213902001-01-19 Akim Demaille <akim@epita.fr>
21391
21392 Get rid of the ad hoc handling of token_buffer in the scanner: use
21393 the obstacks.
21394
21395 * src/lex.c (token_obstack): New.
21396 (init_lex): Initialize it. No longer call...
21397 (grow_token_buffer): this. Remove it.
21398 Adjust all the places which used it to use the obstack.
21399
511e79b3
AD
214002001-01-19 Akim Demaille <akim@epita.fr>
21401
21402 * src/lex.h: Rename all the tokens:
21403 s/\bENDFILE\b/tok_eof/g;
21404 s/\bIDENTIFIER\b/tok_identifier/g;
21405 etc.
21406 Let them be enums, not #define, to ease debugging.
21407 Adjust all the code.
21408
0d6508ef
AD
214092001-01-18 Akim Demaille <akim@epita.fr>
21410
21411 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
21412 * src/lex.c (maxtoken, grow_token_buffer): Static.
21413
6deb4447
AD
214142001-01-18 Akim Demaille <akim@epita.fr>
21415
21416 Since we now use obstacks, more % directives can be enabled.
21417
21418 * src/lex.c (percent_table): Also accept `%yacc',
21419 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
21420 `%debug'.
21421 Handle the actions for `%semantic_parser' and `%pure_parser' here,
21422 instead of returning a token.
21423 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
21424 * src/reader.c (read_declarations): Adjust.
21425 * src/files.c (open_files): Don't call `compute_base_names', don't
21426 compute `attrsfile' since they depend upon data which might be
21427 *in* the input file now.
21428 (output_files): Do it here.
21429 * src/output.c (output_headers): Document the fact that this patch
21430 introduces a guaranteed SEGV for semantic parsers.
21431 * doc/bison.texinfo: Document them.
21432 * tests/suite.at: Exercise these %options.
21433
ff4423cc
AD
214342000-12-20 Akim Demaille <akim@epita.fr>
21435
21436 Also handle the output file (--verbose) with obstacks.
21437
21438 * files.c (foutput): Remove.
21439 (output_obstack): New.
21440 Adjust all dependencies.
21441 * src/conflicts.c: Return a string.
21442 * src/system.h (obstack_grow_string): Rename as...
21443 (obstack_sgrow): this. Be ready to work with non literals.
21444 (obstack_fgrow4): New.
21445
956dba3a
AD
214462000-12-20 Akim Demaille <akim@epita.fr>
21447
21448 * src/files.c (open_files): Fix the computation of short_base_name
21449 in the case of `-o foo.tab.c'.
21450
337bab46
AD
214512000-12-20 Akim Demaille <akim@epita.fr>
21452
21453 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
21454 (copy_dollar): Now that everything uses obstacks, get rid of the
21455 FILE * parameters.
21456
5d3214b8
AD
214572000-12-20 Akim Demaille <akim@epita.fr>
21458
21459 * src/files.c (open_files): Actually the `.output' file is based
21460 on the short_base_name, not base_name.
21461 * tests/suite.at (Checking output file names): Adjust.
21462
29092a57
AD
214632000-12-20 Akim Demaille <akim@epita.fr>
21464
21465 * src/bison.s1: Remove, we now use directly...
21466 * src/bison.simple: this.
21467 * src/Makefile.am: Use pkgdata instead of data.
21468
ea5607fd
AD
214692000-12-20 Akim Demaille <akim@epita.fr>
21470
21471 * src/files.c (guard_obstack): New.
21472 (open_files): Initialize it.
21473 (output_files): Dump it...
21474 * src/files.h: Export it.
21475 * src/reader.c (copy_guard): Use it.
21476
27110317
AD
214772000-12-19 Akim Demaille <akim@epita.fr>
21478
21479 * src/files.c (outfile, defsfile, actfile): Removed as global
21480 vars.
21481 (open_files): Don't compute them.
21482 (output_files): Adjust.
21483 (base_name, short_base_name): Be global.
21484 Adjust dependencies.
21485
19c50364
AD
214862000-12-19 Akim Demaille <akim@epita.fr>
21487
21488 * src/files.c (strsuffix): New.
21489 (stringappend): Be just like strcat but allocate.
21490 (base_names): Eve out from open_files.
21491 Try to simplify the rather hairy computation of base_name and
21492 short_base_name.
21493 (open_files): Use it.
21494 * tests/suite.at (Checking output file names): New test.
21495
573c1d9f
AD
214962000-12-19 Akim Demaille <akim@epita.fr>
21497
21498 * src/system.h (obstack_grow_literal_string): Rename as...
21499 (obstack_grow_string): this.
21500 * src/output.c (output_parser): Recognize `%% actions' instead of
21501 `$'.
21502 * src/bison.s1: s/$/%% actions/.
21503 * src/bison.hairy: Likewise.
21504
ef7ddedd
AD
215052000-12-19 Akim Demaille <akim@epita.fr>
21506
21507 * src/output.c (output_parser): Compute the `#line' lines when
21508 there are.
21509 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
21510 Suggested by Hans Aberg.
21511
ff61dabd
AD
215122000-12-19 Akim Demaille <akim@epita.fr>
21513
21514 Let the handling of the skeleton files be local to the procedures
21515 that use it.
21516
21517 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
21518 longer static.
21519 (fparser, open_extra_files): Remove.
21520 (open_files, output_files): Don't take care of fparser.
21521 * src/files.h: Adjust.
21522 * src/output.c (output_parser): Open and close the file to the
21523 skeleton.
21524 * src/reader.c (read_declarations): When %semantic_parser, open
21525 fguard.
21526
55b96341
AD
215272000-12-19 Akim Demaille <akim@epita.fr>
21528
21529 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
21530 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
21531
358c15b7
AD
215322000-12-19 Akim Demaille <akim@epita.fr>
21533
21534 * src/files.c (open_files): Yipee! We no longer need all the code
21535 looking for `/tmp' since we have no tmp file.
21536
7de3329e
AD
215372000-12-19 Akim Demaille <akim@epita.fr>
21538
21539 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
21540 New macros.
21541 * src/files.c (open_files): Less dependency on MSDOS etc.
21542
3abcd459
AD
215432000-12-14 Akim Demaille <akim@epita.fr>
21544
21545 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
21546 Provide a default definition.
21547 Use it when executing the default @ action.
21548 * src/reader.c (reader_output_yylsp): No longer include
21549 `timestamp' and `text' in the default YYLTYPE.
21550
2a91a95e
AD
215512000-12-12 Akim Demaille <akim@epita.fr>
21552
21553 * src/reader.c (copy_definition, parse_union_decl, copy_action)
21554 (copy_guard): Quote the file names.
21555 Reported by Laurent Mascherpa.
21556
14d3eb9b
AD
215572000-12-12 Akim Demaille <akim@epita.fr>
21558
21559 * src/output.c (output_headers, output_program, output): Be sure
21560 to escape special characters when outputting filenames.
21561 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
21562 (output_headers): Don't depend on them, Use ACTSTR.
21563
d7045ec6
AD
215642000-11-17 Akim Demaille <akim@epita.fr>
21565
21566 * lib/obstack.h: Formatting changes.
21567 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
21568 prevents type checking.
21569 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
21570 cast the value to (void *): assigning a `foo *' to a `void *'
21571 variable is valid.
21572 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
21573 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
21574 append characters.
21575
6fd54b73
AD
215762000-11-17 Akim Demaille <akim@epita.fr>
21577
21578 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
21579 as...
21580 (suite.m4, regression.m4, calc.m4): these.
21581 * tests/atgeneral.m4: Update from CVS Autoconf.
21582
4c50eae6
AD
215832000-11-17 Akim Demaille <akim@epita.fr>
21584
21585 * tests/regression.m4 (%union and --defines): New test,
21586 demonstrating a current bug in the obstack implementation.
21587
a35f64ea
AD
215882000-11-17 Akim Demaille <akim@epita.fr>
21589
21590 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
21591 macros.
21592 Use them to declare the variables which are global or local to
21593 `yyparse'.
21594
7de23534
AD
215952000-11-17 Akim Demaille <akim@epita.fr>
21596
21597 * acconfig.h: Remove, no longer used.
21598
aa7815f5
AD
215992000-11-07 Akim Demaille <akim@epita.fr>
21600
21601 * src: s/Copyright (C)/Copyright/g.
21602
5af1f549
AD
216032000-11-07 Akim Demaille <akim@epita.fr>
21604
21605 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
21606 defining.
21607 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
21608
553e2b22
AD
216092000-11-07 Akim Demaille <akim@epita.fr>
21610
21611 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
21612 Merge in a single CPP if/else.
21613
8a4f41d6
AD
216142000-11-07 Akim Demaille <akim@epita.fr>
21615
21616 * src/output.c (output): Remove useless variables.
21617 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
21618 argument `data' for consistency with the prototypes.
21619 Qualify it `const'.
21620 (obstack_copy, obstack_copy0): Rename the second argument as
21621 `address' for consistency. Qualify it `const'.
21622 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
21623 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
21624 `const' their input argument (`data' or `address').
21625 Adjust the corresponding macros to include `const' in casts.
21626
095a3fb5
AD
216272000-11-03 Akim Demaille <akim@epita.fr>
21628
21629 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
21630 s/PFILE1/BISON_HAIRY/.
21631 Adjust dependencies.
21632
d1cdce7c
AD
216332000-11-03 Akim Demaille <akim@epita.fr>
21634
090c5ebf 21635 For some reason, this was not applied.
d1cdce7c
AD
21636
21637 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
21638 `unlink': it's no longer used.
21639
9311529b
AD
216402000-11-03 Akim Demaille <akim@epita.fr>
21641
21642 * src/files.c (skeleton_find): New function, eved out of...
21643 (open_files, open_extra_files): here.
21644
d8880f69
AD
216452000-11-03 Akim Demaille <akim@epita.fr>
21646
21647 Don't use `atexit'.
21648
21649 * src/files.c (obstack_save): New function.
21650 (done): Rename as...
21651 (output_files): this.
21652 Use `obstack_save'.
21653 * src/main.c (main): Don't use `atexit' to register `done', since
21654 it no longer has to remove tmp files, just call `output_files'
21655 when there are no errors.
21656
0dbb648e
AD
216572000-11-02 Akim Demaille <akim@epita.fr>
21658
21659 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
21660 `unlink': it's no longer used.
21661 * src/files.h: Formatting changes.
21662
896fe5c1
AD
216632000-11-02 Akim Demaille <akim@epita.fr>
21664
21665 Remove the last uses of mktemp and unlink/delete.
21666
21667 * src/files.c (fdefines, ftable): Removed.
21668 (defines_ostack, table_obstack): New.
21669 Adjust dependencies of the former into uses of the latter.
21670 * src/output.c (output_short_or_char_table, output_short_table):
21671 Convert to using obstacks.
21672 * src/reader.c (copy_comment2): Accept one FILE * and two
21673 obstacks.
21674 (output_token_defines, reader_output_yylsp): Use obstacks.
21675 * src/system.h (obstack_fgrow3): New.
1f65350a 21676 * po/POTFILES.in: Adjust.
896fe5c1 21677
dd60faec
AD
216782000-11-01 Akim Demaille <akim@epita.fr>
21679
21680 Change each use of `fattrs' into a use of `attrs_obstack'.
21681
21682 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
21683 * src/files.c (fattrs): Remove.
21684 (attrs_obstack): New.
21685 Adjust all dependencies.
21686 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
21687
8c7ebe49
AD
216882000-11-01 Akim Demaille <akim@epita.fr>
21689
21690 Introduce obstacks.
21691 Change each use of `faction' into a use of `action_obstack'.
21692
21693 * lib/obstack.h, lib/obstack.c: New files.
21694 * src/files.c (faction): Remove.
21695 (action_obstack): New.
21696 Adjust all dependencies.
21697
77aee789
AD
216982000-10-20 Akim Demaille <akim@epita.fr>
21699
21700 * lib/quote.h (PARAMS): New macro. Use it.
21701
43591cec
AD
217022000-10-16 Akim Demaille <akim@epita.fr>
21703
21704 * src/output.c (output_short_or_char_table): New function.
21705 (output_short_table, output_token_translations): Use it.
21706 (goto_actions): Use output_short_table.
21707
1e9798d5
AD
217082000-10-16 Akim Demaille <akim@epita.fr>
21709
21710 * src/symtab.c (bucket_new): New function.
21711 (getsym): Use it.
21712
21713 * src/output.c (output_short_table): New argument to display the
21714 comment associated with the table.
21715 Adjust dependencies.
21716 (output_gram): Use it.
21717 (output_rule_data): Nicer output layout for YYTNAME.
21718
f282676b
AD
217192000-10-16 Akim Demaille <akim@epita.fr>
21720
21721 * src/lex.c (read_typename): New function.
21722 (lex): Use it.
21723 * src/reader.c (copy_dollar): Likewise.
21724
550a72a3
AD
217252000-10-16 Akim Demaille <akim@epita.fr>
21726
21727 * src/reader.c (copy_comment2): Expect the input stream to be on
21728 the `/' which is suspected to open a comment, instead of being
21729 called after `//' or `/*' was read.
21730 (copy_comment, copy_definition, parse_union_decl, copy_action)
21731 (copy_guard): Adjust.
21732
131e2fef
AD
217332000-10-16 Akim Demaille <akim@epita.fr>
21734
21735 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
21736 `read_signed_integer'.
21737
79282c5a
AD
217382000-10-16 Akim Demaille <akim@epita.fr>
21739
21740 * src/reader.c (copy_dollar): New function.
21741 (copy_guard, copy_action): Use it.
21742
ff4a34be
AD
217432000-10-16 Akim Demaille <akim@epita.fr>
21744
21745 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
21746 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
21747 New files, from Fileutils 4.0.27.
21748 * src/main.c (printable_version): Remove.
21749 * src/lex.c, src/reader.c: Use `quote'.
21750
217512000-10-04 Akim Demaille <akim@epita.fr>
21752
21753 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
21754
14ded682
AD
217552000-10-04 Akim Demaille <akim@epita.fr>
21756
21757 * doc/bison.texinfo: Various typos spotted by Neil Booth.
21758
8e03724b
AD
217592000-10-04 Akim Demaille <akim@epita.fr>
21760
21761 When a literal string is used to define two different tokens,
21762 `bison -v' segfaults.
21763 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
21764
21765 * tests/regression.m4: New file.
21766 Include the core of the sample provided by Piotr Gackiewicz.
21767 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
21768 properly.
21769
a9e64249
AD
217702000-10-04 Akim Demaille <akim@epita.fr>
21771
21772 * src/reader.c (parse_expect_decl): Keep `count' within the size
21773 of `buffer'.
21774 From Neil Booth.
21775
da9abf43
AD
217762000-10-02 Paul Eggert <eggert@twinsun.com>
21777
21778 * bison.s1 (yyparse): Assign the default value
21779 unconditionally, to avoid a GCC warning and make the parser a
21780 tad smaller.
21781
c33638bb
AD
217822000-10-02 Akim Demaille <akim@epita.fr>
21783
21784 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
21785 options.
21786
444c570a
AD
217872000-10-02 Akim Demaille <akim@epita.fr>
21788
21789 * src/derives.c, src/print.c, src/reduce.c: To ease the
21790 translation, move some `\n' out of the translated strings.
21791
89cab50d
AD
217922000-10-02 Akim Demaille <akim@epita.fr>
21793
21794 The location tracking mechanism is precious for parse error
21795 messages. Nevertheless, it is enabled only when `@n' is used in
21796 the grammar, which is a different issue (you can use it in error
21797 message, but not in the grammar per se). Therefore, there should
21798 be another means to enable it.
21799
21800 * src/getargs.c (getargs): Support `--locations'.
21801 (usage): Report it.
21802 * src/getargs.h (locationsflag): Export it.
21803 * src/lex.c (percent_table): Support `%locations'.
21804 * src/reader.c (yylsp_needed): Remove this variable, now replaced
21805 with `locationsflag'.
21806 * doc/bison.texinfo: Document `--locations' and `%locations'.
21807 Sort the options.
21808 * tests/calc.m4: Test it.
21809
21810 For regularity of the names, replace each
21811 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
21812 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
21813 In addition replace each `flag' with `_flag'.
21814
d6c2cba0
AD
218152000-10-02 Akim Demaille <akim@epita.fr>
21816
21817 Also test parse error messages, including with YYERROR_VERBOSE.
21818
21819 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
21820 associative).
21821 Use it to check the computations.
21822 Use it to check `nonassoc' is honored.
21823 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
21824 `--yyerror-verbose'.
21825 (_AT_CHECK_CALC): Adjust to this option.
21826 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
21827
5a35a6cb
AD
218282000-10-02 Akim Demaille <akim@epita.fr>
21829
21830 Test also `--verbose', `--defines' and `--name-prefix'. Testing
21831 the latter demonstrates a flaw in the handling of non debugging
21832 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
21833 was used in order to simplify:
21834
21835 #if YYDEBUG
21836 if (yydebug)
21837 {
21838 ...
21839 }
21840 #endif
21841
21842 into
21843
21844 if (yydebug)
21845 {
21846 ...
21847 }
21848
21849 unfortunately this leads to a CPP conflict when
21850 `--name-prefix=foo' is used since it produces `#define yydebug
21851 foodebug'.
21852
21853 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
21854 (YYDPRINTF): New macro.
21855 Spread its use.
21856 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
21857 the bison options.
21858 Also test `--verbose', `--defines' and `--name-prefix'.
21859
71da9eea
AD
218602000-10-02 Akim Demaille <akim@epita.fr>
21861
21862 Improve the readability of the produced parsers.
21863
21864 * src/bison.s1: Formatting changes.
21865 Improve the comment related to the `$' mark.
21866 (yydefault): Don't fall through to `yyresume': `goto' there.
21867 * src/output.c (output_parser): When the `$' is met, skip the end
21868 of its line.
21869 New variable, `number_of_dollar_signs', to check there's exactly
21870 one `$' in the parser skeleton.
21871
95e36146
AD
218722000-10-02 Akim Demaille <akim@epita.fr>
21873
21874 * lib/xstrdup.c: New file, from the fileutils.
21875 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
21876 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
21877 instead of strlen + xmalloc + strcpy.
21878 * src/symtab.c (copys): Remove, use xstrdup instead.
21879
d7020c20
AD
218802000-10-02 Akim Demaille <akim@epita.fr>
21881
21882 * src/gram.h (associativity): New enum type which replaces the
21883 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
21884 `right_assoc', `left_assoc' and `non_assoc'.
21885 Adjust all dependencies.
21886 * src/reader.c: Formatting changes.
21887 (LTYPESTR): Don't define it, use it as a literal in
21888 `reader_output_yylsp'.
21889 * src/symtab.h (symbol_class): New enum type which replaces the
21890 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
21891 `sunknown', `stoken and `snterm'.
21892
1916f98e
AD
218932000-10-02 Akim Demaille <akim@epita.fr>
21894
21895 * src/getargs.c (fixed_outfiles): Rename as...
21896 (yaccflag): for consistency and accuracy.
21897 Adjust dependencies.
21898
d7913476
AD
218992000-10-02 Akim Demaille <akim@epita.fr>
21900
21901 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
21902 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
21903 difficult and introduced a lot of core dump. It turns out that
21904 Bison used an implementation of `xmalloc' based on `calloc', and
21905 at various places it does depend upon the initialization to 0. I
21906 have not tried to isolate the pertinent places, and all the former
21907 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
21908 someone should address this issue.
21909
21910 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
21911 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
21912 files.
21913 Adjust dependencies.
21914 * src/warshall.h: New file.
21915 Propagate.
21916
340ef489
AD
219172000-10-02 Akim Demaille <akim@epita.fr>
21918
21919 Various anti-`extern in *.c' changes.
21920
21921 * src/system.h: Include `assert.h'.
21922
b2ca4022
AD
219232000-10-02 Akim Demaille <akim@epita.fr>
21924
21925 * src/state.h (nstates, final_state, first_state, first_shift)
21926 (first_reduction): Move their exportation from here...
21927 * src/LR0.h: to here.
21928 Adjust dependencies.
21929 * src/getargs.c (statisticsflag): New variable.
21930 Add support for `--statistics'.
21931 Adjust dependencies.
21932
21933 Remove a lot of now useless `extern' statements in most files.
21934
403b315b
AD
219352000-10-02 Akim Demaille <akim@epita.fr>
21936
21937 * src/LR0.h: New file.
21938 Propagate its use.
21939
07a58c13
AD
219402000-10-02 Akim Demaille <akim@epita.fr>
21941
21942 * src/print.h: New file.
21943 Propagate its use.
21944 * src/print.c: Formatting and ordering changes.
21945 (verbose, terse): Replace with...
21946 (print_results): this new function.
21947 Adjust dependencies.
21948
0619caf0
AD
219492000-10-02 Akim Demaille <akim@epita.fr>
21950
21951 * src/conflicts.c (conflict_report): New function.
21952 (conflict_log, verbose_conflict_log): Replace with...
21953 (print_conflicts): this function.
21954 Adjust dependencies.
21955 * src/conflicts.h: New file.
21956 Propagate its inclusion.
21957
3519ec76
AD
219582000-10-02 Akim Demaille <akim@epita.fr>
21959
21960 * src/nullable.h: New file.
21961 Propagate its inclusion.
21962 * src/nullable.c: Formatting changes.
21963
015acc48
AD
219642000-10-02 Akim Demaille <akim@epita.fr>
21965
21966 * src/reduce.h: New file.
21967 Propagate its inclusion.
21968 * src/reduce.c: Topological sort and other formatting changes.
21969 (bool, TRUE, FALSE): Move their definition to...
21970 * src/system.h: here.
21971
8963a27b
AD
219722000-10-02 Akim Demaille <akim@epita.fr>
21973
21974 * src/files.c: Formatting changes.
21975 (tryopen, tryclose, openfiles): Rename as...
21976 (xfopen, xfclose, open_files): this.
21977 (stringappend): static.
21978 * src/files.h: Complete the list of exported symbols.
21979 Propagate its use.
21980
a70083a3
AD
219812000-10-02 Akim Demaille <akim@epita.fr>
21982
21983 * src/reader.h: New file.
21984 Propagate its use instead of tedious list of `extern' and
21985 prototypes.
21986 * src/reader.c: Formatting changes, topological sort,
21987 s/register//.
21988
abadc117
AD
219892000-10-02 Akim Demaille <akim@epita.fr>
21990
21991 * src/lex.h: Prototype `lex.c' exported functions.
21992 * src/reader.c: Adjust.
21993 * src/lex.c: Formatting changes.
21994 (safegetc): Rename as...
21995 (xgetc): this.
21996
720d742f
AD
219972000-10-02 Akim Demaille <akim@epita.fr>
21998
21999 * src/lalr.h: New file.
22000 Propagate its inclusion instead of prototypes and `extern'.
22001 * src/lalr.c: Formatting changes, topological sorting etc.
22002
f2acea59
AD
220032000-10-02 Akim Demaille <akim@epita.fr>
22004
22005 * src/output.c (token_actions): Introduce a temporary array,
22006 YYDEFACT, that makes it possible for this function to use
22007 output_short_table.
22008
d019d655
AD
220092000-10-02 Akim Demaille <akim@epita.fr>
22010
22011 `user_toknums' is output as a `short[]' in `output.c', while it is
22012 defined as a `int[]' in `reader.c'. For consistency with the
22013 other output tables, `user_toknums' is now defined as a table of
22014 shorts.
22015
22016 * src/reader.c (user_toknums): Be a short table instead of an int
22017 table.
22018 Adjust dependencies.
22019
22020 Factor the short table outputs.
22021
22022 * src/output.c (output_short_table): New function.
22023 * src/output.c (output_gram, output_stos, output_rule_data)
22024 (output_base, output_table, output_check): Use it.
22025
6c89f1c1
AD
220262000-10-02 Akim Demaille <akim@epita.fr>
22027
22028 * src/output.c (output): Topological sort of the functions, in
22029 order to get rid of the `static' prototypes.
22030 No longer use `register'.
22031 * src/output.h: New file.
22032 Propagate its inclusion in files explicitly prototyping functions
22033 from output.c.
22034
d9efd181
AD
220352000-09-21 Akim Demaille <akim@epita.fr>
22036
22037 * src/atgeneral.m4: Update from Autoconf.
22038
c29240e7 220392000-09-21 Akim Demaille <akim@epita.fr>
2fa6973e
AD
22040
22041 * src/closure.h: New file.
22042 * src/closure.c: Formatting changes, topological sort over the
22043 functions, use of closure.h.
22044 (initialize_closure, finalize_closure): Rename as...
22045 (new_closure, free_closure): these. Adjust dependencies.
22046 * src/LR0.c: Formatting changes, topological sort, use of
22047 cloture.h.
22048 (initialize_states): Rename as...
22049 (new_states): this.
22050 * src/Makefile.am (noinst_HEADERS): Adjust.
22051
499daa50
AD
220522000-09-20 Akim Demaille <akim@epita.fr>
22053
22054 * src/acconfig.h: Don't protect config.h against multiple
22055 inclusion.
22056 Don't define PARAMS.
22057 * src/system.h: Define PARAMS.
22058 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
22059 purpose of config.h. system.h must not try to fix wrong
22060 definitions in config.h.
22061
cc84fd5d
AD
220622000-09-20 Akim Demaille <akim@epita.fr>
22063
22064 * src/derives.h: New file.
22065 * src/main.c, src/derives.h: Use it.
22066 Formatting changes.
22067 * src/Makefile.am (noinst_HEADERS): Adjust.
22068
db5b3a89
AD
220692000-09-20 Akim Demaille <akim@epita.fr>
22070
22071 * tests/atgeneral.m4: Update from Autoconf.
22072 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
22073 (AT_CHECK_CALC): New macros.
22074 Use these macros to test bison with options `', `--raw',
22075 `--debug', `--yacc', `--yacc --debug'.
22076
ceed8467
AD
220772000-09-19 Akim Demaille <akim@epita.fr>
22078
22079 * src/output.c: Formatting changes.
22080 * src/machine.h: Remove, leaving its contents in...
22081 * src/system.h: here.
22082 Include stdio.h.
22083 Adjust all dependencies on stdio.h and machine.h.
22084 * src/getargs.h: New file.
22085 Let all `extern' declarations about getargs.c be replaced with
22086 inclusion of `getargs.h'.
22087 * src/Makefile.am (noinst_HEADERS): Adjust.
22088
22089 * tests/calc.m4 (yyin): Be initialized in main, not on the global
22090 scope.
22091 (yyerror): Returns void, not int.
22092 * doc/bison.texinfo: Formatting changes.
22093
05a1d24b
AD
220942000-09-19 Akim Demaille <akim@epita.fr>
22095
22096 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
22097 portable.
22098
cbd25751
AD
220992000-09-18 Akim Demaille <akim@epita.fr>
22100
22101 * configure.in: Append WARNING_CFLAGS to CFLAGS.
22102 * src/Makefile.am (INCLUDES): Don't.
22103 Be ready to fetch headers in lib/.
22104
13863333
AD
221052000-09-18 Akim Demaille <akim@epita.fr>
22106
22107 * doc/bison.texinfo: Update the copyright.
22108 ANSIfy and GNUify the examples.
22109 Remove the old menu.
22110
0d533154
AD
221112000-09-18 Akim Demaille <akim@epita.fr>
22112
22113 First set of tests: use the `calc' example from the documentation.
22114
22115 * src/bison.s1 (yyparse): Condition the code using `yytname' which
22116 is defined only when YYDEBUG is.
22117 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
22118 * src/files.c (tryopen, tryclose): Formatting changes.
22119 Move to the top and be static.
22120 * src/reader.c (read_signed_integer): Likewise.
22121 * tests/calc.m4: New file.
22122 * Makefile.am, suite.m4: Adjust.
22123 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
22124
e79137ac
AD
221252000-09-18 Akim Demaille <akim@epita.fr>
22126
22127 Add support for an Autotest test suite for Bison.
22128
22129 * m4/m4.m4, m4/atconfig.m4: New files.
22130 * m4/Makefile.am (EXTRA_DIST): Adjust.
22131 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
22132 files.
22133 * src/getargs.c: Display a more standard --version message.
22134 * src/reader.c (reader): Formatting changes.
22135 No longer depend upon VERSION_STRING.
22136 * configure.in: No longer use `dnl'.
22137 Set up the test suite and the new directory `tests/.
22138 (VERSION_STRING): Remove.
22139
27821bff
AD
221402000-04-14 Akim Demaille <akim@epita.fr>
22141
22142 * src/reader.c (copy_comment2): New function, same as former
22143 `copy_comment', but outputs into two FILE *.
22144 (copy_comment): Use it.
22145 (parse_union_decl): Use it.
22146 (get_type, parse_start_decl): Use the same `invalid' message.
22147 (parse_start_decl, parse_union_decl): Use the same `multiple'
22148 message.
22149 (parse_union_decl, copy_guard, copy_action): Use the same
22150 `unmatched' message.
22151 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
22152
cfe5fbc0
AD
221532000-03-31 Akim Demaille <akim@epita.fr>
22154
22155 * src/files.c (tryopen, tryclose): Move to the top.
22156 Be static.
22157
cb7db13e
AD
221582000-03-31 Akim Demaille <akim@epita.fr>
22159
22160 * src/main.c (main): Don't call `done', exit does it.
22161
a0f6b076
AD
221622000-03-31 Akim Demaille <akim@epita.fr>
22163
36281465
AD
22164 * allocate.c: s/return (foo)/return foo/.
22165 * lalr.c: Likewise.
22166 * LR0.c: Likewise.
22167 * output.c: Likewise.
22168 * reader.c: Likewise.
22169 * symtab.c: Likewise.
22170 * vmsgetargs.c: Likewise.
22171
221722000-03-31 Akim Demaille <akim@epita.fr>
22173
22174 Clean up the error reporting functions.
a0f6b076
AD
22175
22176 * src/report.c: New file.
22177 * src/report.h: Likewise.
22178 * src/Makefile.am: Adjust.
22179 * m4/error.m4: New file.
22180 * m4/Makefile.am: Adjust.
22181 * configure.in (jm_PREREQ_ERROR): Call it.
22182 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
22183 Remove.
22184 (fatal, fatals): Remove. All callers use complain.c::fatal.
22185 (warn, warni, warns, warnss, warnss): Remove. All callers use
22186 complain.c::complain.
22187 (toomany): Remove, use fatal instead.
22188 * src/files.c (done): No argument, use complain_message_count.
22189 * src/main.c (main): Register `done' to `atexit'.
22190
22191 * src/getargs.c (usage): More `fputs', less `fprintf'.
22192
18539825
AD
221932000-03-28 Akim Demaille <akim@epita.fr>
22194
22195 * lib/: New directory.
22196 * Makefile.am (SUBDIRS): Adjust.
22197 * configure.in: Adjust.
22198 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
22199 useless.
22200 * src/alloca.c: Moved to lib/.
22201 * src/getopt.c: Likewise.
22202 * src/getopt1.c: Likewise.
22203 * src/getopt.h: Likewise.
22204 * src/ansi2knr.c: Likewise.
22205 * src/ansi2knr.1: Likewise.
22206 * src/Makefile.am: Adjust.
22207 * lib/Makefile.am: New file.
22208
9f306f2a
AD
222092000-03-28 Akim Demaille <akim@epita.fr>
22210
22211 * src/getargs.c (usage): Refresh the help message.
22212
0ba347b6
AD
222132000-03-17 Akim Demaille <akim@epita.fr>
22214
22215 * src/getopt1.c: Updated from textutils 2.0e
22216 * src/getopt.c: Likewise.
22217 * src/getopt.h: Likewise.
22218
dbe7f271
AD
222192000-03-17 Akim Demaille <akim@epita.fr>
22220
22221 * src/Makefile.am (bison.simple): Fix the awk program: quote only
22222 the file name, not the whole `#line LINE FILE'.
22223
75bbe78d
AD
222242000-03-17 Akim Demaille <akim@epita.fr>
22225
22226 On syntax errors, report the token on which we choked.
22227
aa5fd0ee
AD
22228 * src/bison.s1 (yyparse): In the label yyerrlab, when
22229 YYERROR_VERBOSE, add yychar in msg.
75bbe78d 22230
7b306f52
AD
222312000-03-17 Akim Demaille <akim@epita.fr>
22232
aa5fd0ee 22233 * src/reader.c (copy_at): New function.
7b306f52
AD
22234 (copy_guard): Use it.
22235 (copy_action): Use it.
22236
e87b5700
AD
222372000-03-17 Akim Demaille <akim@epita.fr>
22238
22239 Be kind to translators, save some useless translations.
22240
aa5fd0ee 22241 * src/main.c (banner): New function.
e87b5700
AD
22242 (fatal_banner): Use it.
22243 (warn_banner): Use it.
22244
ae3c3164
AD
222452000-03-17 Akim Demaille <akim@epita.fr>
22246
aa5fd0ee
AD
22247 * src/reader.c (copy_definition): Use copy_string and
22248 copy_comment. Removed now unused `match', `ended',
22249 `cplus_comment'.
ae3c3164
AD
22250 (copy_comment, copy_string): Moved, to be visible from
22251 copy_definition.
22252
4dc58e7c
AD
222532000-03-17 Akim Demaille <akim@epita.fr>
22254
aa5fd0ee
AD
22255 * src/reader.c (copy_string): Declare `static inline'. No
22256 problems with inline, since it is checked by configure.
4dc58e7c
AD
22257 (copy_comment): Likewise.
22258
0a6384c4
AD
222592000-03-17 Akim Demaille <akim@epita.fr>
22260
aa5fd0ee 22261 * src/reader.c (packsymbols): Formatting changes.
0a6384c4 22262
3cef001a
AD
222632000-03-17 Akim Demaille <akim@epita.fr>
22264
aa5fd0ee 22265 * src/reader.c (copy_comment): New function, factored out from:
3cef001a
AD
22266 (copy_action): Use it. Removed now unused `match', `ended',
22267 `cplus_comment'.
22268 (copy_guard): Likewise.
22269
ca36d2ef
AD
222702000-03-17 Akim Demaille <akim@epita.fr>
22271
aa5fd0ee 22272 * src/reader.c (copy_string): New function, factored out from:
ca36d2ef
AD
22273 (copy_action): Use it.
22274 (copy_guard): Likewise.
22275
6666f98f
AD
222762000-03-17 Akim Demaille <akim@epita.fr>
22277
22278 Change the handling of @s so that they behave exactly like $s.
22279 There is now a pseudo variable @$ (readble and writable), location
22280 of the lhs of the rule (by default ranging from the location of
22281 the first symbol of the rhs, to the location of the last symbol,
22282 or, if the rhs is empty, YYLLOC).
22283
22284 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
22285 yyval.
22286 (yyparse): When providing a default semantic action, provide a
22287 default location action.
22288 (after the $): No longer change `*YYLSP', just stack YYLOC the
22289 same way you stack YYVAL.
22290 * src/reader.c (read_declarations): Use warns.
22291 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
22292 (copy_action, case '@'): Likewise.
22293 Use a standard error message, to save useless work from
22294 translators.
22295
41aca2e0
AD
222962000-03-17 Akim Demaille <akim@epita.fr>
22297
aa5fd0ee
AD
22298 * src/bison.s1: Formatting and cosmetics changes.
22299 * src/reader.c: Likewise.
41aca2e0
AD
22300 Update the Copyright notice.
22301
dc08c1d5
AD
223022000-03-17 Akim Demaille <akim@epita.fr>
22303
aa5fd0ee
AD
22304 * src/bison.s1 (#line): All set to `#line' only, since the
22305 Makefile now handles them.
dc08c1d5 22306
9ee3c97b
AD
223072000-03-16 Akim Demaille <akim@epita.fr>
22308
22309 * src/output.c (output_rule_data): Output the documentation of
22310 some of the tables.
22311 (Copyright notice): Update.
22312 Formatting changes.
22313
0de741ca
AD
223142000-03-16 Akim Demaille <akim@epita.fr>
22315
22316 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
22317 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
22318 One `#if YYDEBUG' remains, since it uses variables which are
22319 defined only if `YYDEBUG != 0'.
22320
bb10be54
AD
223212000-03-16 Akim Demaille <akim@epita.fr>
22322
22323 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
22324 and related variables so that the similarities are highlighted.
22325
b07b484a
AD
223262000-03-16 Akim Demaille <akim@epita.fr>
22327
22328 * src/bison.s1: Properly indent CPP directives.
22329
361f60b3
AD
223302000-03-16 Akim Demaille <akim@epita.fr>
22331
22332 * src/bison.s1: Properly indent the `alloca' CPP section.
22333
8c44d3ec
AD
223342000-03-16 Akim Demaille <akim@epita.fr>
22335
22336 Do not hard code values of directories in `configure.in'.
22337 Update the `configure' tool chain.
22338
22339 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
22340 src/makefile.am.
22341 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
22342 (AC_OUTPUT): Add m4/Makefile.
22343 Bump to bison 1.28a, 1.29 has never been released.
22344 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
22345 handled via src/Makefile.am.
22346 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
22347 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
22348 autoheader.
22349 * Makefile.am (SUBDIRS): Add m4.
22350 (ACLOCAL_AM_FLAGS): New variable.
22351 (AUTOMAKE_OPTIONS): Add check-news.
22352 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
22353 the proper line number and file name.
22354 (DEFS): Propagate the location of bison library files and of the
22355 locale files.
22356 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
22357 builddir.
22358 * acinclude.m4: Remove, replaced by the directory m4.
22359 * m4/Makefile.am (EXTRA_DIST): New variable.
22360 * m4/gettext.m4: New file, from the fileutils.
22361 * m4/lcmessage.m4: Likewise
22362 * m4/progtest.m4: Likewise.
22363 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
22364
f95997e7
AD
223652000-03-10 Akim Demaille <akim@epita.fr>
22366
22367 * src/closure.c:
22368 Formatting changes of various comments.
22369 Respect the GNU coding standards at various places.
22370 Don't use `_()' when no translation is needed.
22371
223721999-12-13 Jesse Thilo <jthilo@gnu.org>
22373
22374 * src/files.c:
22375 OS/2 honors TMPDIR environment variable.
22376
223771999-12-13 Jesse Thilo <jthilo@gnu.org>
22378
22379 * doc/bison.texinfo: Tweaked spelling and grammar.
22380 Updated ISBN.
22381 Removed reference to price of printed copy.
22382 Mention BISON_SIMPLE and BISON_HAIRY.
22383
223841999-12-13 Jesse Thilo <jthilo@gnu.org>
22385
22386 * configure.in, NEWS:
22387 Bison 1.29 released.
22388
223891999-10-27 Jesse Thilo <jthilo@gnu.org>
22390
22391 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
22392 Added reference card.
22393
223941999-07-26 Jesse Thilo <jthilo@gnu.org>
22395
22396 * po/ru.po: Added Russian translation.
22397
223981999-07-26 Jesse Thilo <jthilo@gnu.org>
22399
22400 * configure.in: Added Russian translation.
22401
224021999-07-06 Jesse Thilo <jthilo@gnu.org>
22403
22404 * configure.in, NEWS, README:
22405 Released version 1.28.
22406
224071999-06-14 Jesse Thilo <jthilo@gnu.org>
22408
22409 * src/system.h:
22410 Squashed redefinition warning on some systems.
22411
22412 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
22413 Have configure build version string instead of relying on ANSI string
22414 concatentation.
22415
224161999-06-14 Jesse Thilo <jthilo@gnu.org>
22417
22418 * po/POTFILES.in: Got rid of version.c.
22419
224201999-06-14 Jesse Thilo <jthilo@gnu.org>
22421
22422 * acconfig.h, configure.in:
22423 Have configure build version string instead of relying on ANSI string
22424 concatentation.
22425
224261999-06-08 Jesse Thilo <jthilo@gnu.org>
22427
22428 * doc/bison.1:
22429 Dropped mention of `+' for long-named options.
22430
224311999-05-30 Jesse Thilo <jthilo@gnu.org>
22432
22433 * src/files.c: Added <unistd.h> for unlink().
22434
22435 * src/Makefile.am, src/system.h:
22436 I18n fixes.
22437
224381999-05-30 Jesse Thilo <jthilo@gnu.org>
22439
22440 * README: Added a FAQ list.
22441
22442 * configure.in, acconfig.h:
22443 I18n fixes.
22444
224451999-05-30 Jesse Thilo <jthilo@gnu.org>
22446
22447 * doc/FAQ, doc/Makefile.am:
22448 Added a FAQ list.
22449
224501999-05-19 Jesse Thilo <jthilo@gnu.org>
22451
22452 * src/alloc.h, src/symtab.h, src/version.c:
22453 Protected inclusion of "config.h" with HAVE_CONFIG_H.
22454
224551999-04-18 Jesse Thilo <jthilo@gnu.org>
22456
22457 * src/.cvsignore, src/Makefile.am:
22458 Reorganized: sources in `src', documentation in `doc'.
22459
22460 * src/lex.c (literalchar):
22461 fixed the code for escaping double quotes (thanks
22462 Jonathan Czisny.)
22463
224641999-04-18 Jesse Thilo <jthilo@gnu.org>
22465
22466 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
22467 Adjusted paths to reflect directory reorganization.
22468
224691999-04-18 Jesse Thilo <jthilo@gnu.org>
22470
22471 * doc/.cvsignore, doc/Makefile.am:
22472 Reorganized: sources in `src', documentation in `doc'.
22473
224741999-04-18 Jesse Thilo <jthilo@gnu.org>
22475
22476 * configure.in:
22477 Updated AC_INIT file to reflect directory reorganization.
22478
22479 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
22480 Reorganized: sources in `src', documentation in `doc'.
22481
224821999-04-13 Jesse Thilo <jthilo@gnu.org>
22483
22484 * src/allocate.c:
22485 Don't declare calloc() and realloc() if not necessary.
22486
224871999-04-13 Jesse Thilo <jthilo@gnu.org>
22488
22489 * configure.in, acconfig.h, acinclude.m4:
22490 Don't declare calloc() and realloc() if not necessary.
22491
224921999-03-23 Jesse Thilo <jthilo@gnu.org>
22493
22494 * po/.cvsignore: Added i18n support.
22495
224961999-03-23 Jesse Thilo <jthilo@gnu.org>
22497
22498 * acconfig.h, configure.in, Makefile.am:
22499 Added i18n support.
22500
225011999-03-22 Jesse Thilo <jthilo@gnu.org>
22502
22503 * src/bison.s1: Fixed #line numbers.
22504
225051999-03-15 Jesse Thilo <jthilo@gnu.org>
22506
22507 * po/es.po, po/fr.po, po/nl.po, po/de.po:
22508 Added PO files from Translation Project.
22509
225101999-03-03 Jesse Thilo <jthilo@gnu.org>
22511
22512 * Makefile.am:
22513 Added support for non-ANSI compilers (ansi2knr).
22514
225151999-02-16 Jesse Thilo <jthilo@gnu.org>
22516
22517 * configure.in: Bumped version number to 1.27.
22518
22519 * Makefile.am:
22520 Added `bison.simple' to list of files removed by `make distclean'.
22521
225221999-02-12 Jesse Thilo <jthilo@gnu.org>
22523
22524 * src/files.c, src/files.h:
22525 Defined locations of parser files in config.h instead of Makefile.
22526
225271999-02-12 Jesse Thilo <jthilo@gnu.org>
22528
22529 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
22530 Defined locations of parser files in config.h instead of Makefile.
22531
225321999-02-09 Jesse Thilo <jthilo@gnu.org>
22533
22534 * Makefile.am:
22535 Removed inappropriate use of $< macro.
22536
225371999-02-05 Jesse Thilo <jthilo@gnu.org>
22538
22539 * po/Makefile.in.in, po/POTFILES.in:
22540 Add `po' directory skeleton.
22541
225421999-01-27 Jesse Thilo <jthilo@gnu.org>
22543
22544 * README: Document help-bison list.
22545
22546 * configure.in: Add check for mkstemp().
22547
225481999-01-20 Jesse Thilo <jthilo@gnu.org>
22549
22550 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
22551 Hush a few compiler warnings.
22552
22553 * src/files.c:
22554 Add tryclose(), which verifies that fclose was successful.
22555 Hush a couple of compiler warnings.
22556
225571999-01-20 Jesse Thilo <jthilo@gnu.org>
22558
22559 * Makefile.am, OChangeLog:
22560 ChangeLog is now automatically generated. Include the old version as
22561 OChangeLog.
22562
225631999-01-14 Jesse Thilo <jthilo@gnu.org>
22564
22565 * 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:
22566 Update FSF address.
22567
225681999-01-14 Jesse Thilo <jthilo@gnu.org>
22569
22570 * doc/bison.texinfo: Fix formatting glitch.
22571
22572 * doc/bison.texinfo: Update FSF address.
22573
225741999-01-14 Jesse Thilo <jthilo@gnu.org>
22575
22576 * acconfig.h: Update FSF address.
22577
225781999-01-08 Jesse Thilo <jthilo@gnu.org>
22579
22580 * src/system.h:
22581 Don't define PACKAGE here, since config.h defines it.
22582
225831998-12-30 Jesse Thilo <jthilo@gnu.org>
22584
22585 * src/reader.c: Update copyright date.
22586
22587 * src/main.c:
22588 Ditch sprintf to statically-sized buffers in fatal/warn functions in
22589 favor of output directly to stderr (avoids buffer overruns).
22590
22591 * src/reader.c: Some checks for premature EOF.
22592
22593 * 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:
22594 Use prototypes if the compiler understands them.
22595
22596 * src/files.c: Honor TMPDIR on Unix hosts.
22597 Use prototypes if the compiler understands them.
22598
22599 * src/reader.c:
22600 Fix a couple of buffer overrun bugs.
22601 Use prototypes if the compiler understands them.
22602
22603 * src/system.h: Include unistd.h and ctype.h.
22604 Use #ifdef instead of #if for NLS symbols.
22605
226061998-12-30 Jesse Thilo <jthilo@gnu.org>
22607
22608 * doc/bison.texinfo:
22609 Delete comment "consider using @set for edition number, etc..." since
22610 we now are doing so.
22611
226121998-12-30 Jesse Thilo <jthilo@gnu.org>
22613
22614 * configure.in:
22615 Use prototypes if the compiler understands them.
22616
22617 * NEWS: Document 1.26 highlights.
22618
22619 * Makefile.am: Require Automake 1.3 or later.
22620
22621 * acconfig.h:
22622 Use prototypes if the compiler understands them.
22623
226241998-12-29 Jesse Thilo <jthilo@gnu.org>
22625
22626 * src/version.c:
22627 Use VERSION symbol from automake for version number.
22628
226291998-12-29 Jesse Thilo <jthilo@gnu.org>
22630
22631 * acconfig.h, configure.in, version.cin:
22632 Use VERSION symbol from automake for version number.
22633
226341998-11-28 Jesse Thilo <jthilo@gnu.org>
22635
22636 * Makefile.am:
22637 Distribute original version of simple parser (bison.s1), not built
22638 version (bison.simple).
22639
226401998-11-28 Jesse Thilo <jthilo@gnu.org>
22641
22642 * doc/bison.texinfo: Add info dir entry.
22643
22644 * doc/bison.texinfo:
22645 Let automake put version number into documentation.
22646
226471998-11-26 Jesse Thilo <jthilo@gnu.org>
22648
22649 * src/bison.cld, src/build.com, src/vmshlp.mar:
22650 Add non-RCS files from /gd/gnu/bison.
22651
226521998-11-26 Jesse Thilo <jthilo@gnu.org>
22653
22654 * doc/bison.1:
22655 Document the BISON_HAIRY and BISON_SIMPLE variables.
22656
226571998-11-25 Jesse Thilo <jthilo@gnu.org>
22658
22659 * src/version.c: Build version.c automatically.
22660
22661 * src/reader.c:
22662 Fix token numbering (used to start at 258, not 257).
22663
22664 * src/system.h: Include config.h.
22665
22666 * src/getargs.c: Update bug report address.
22667
22668 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
22669 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
22670
226711998-11-25 Jesse Thilo <jthilo@gnu.org>
22672
22673 * Makefile.am:
22674 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
22675
22676 * configure.in, version.cin:
22677 Build version.c automatically.
22678
22679 * AUTHORS: Add AUTHORS file.
22680
22681 * README: Update bug report address.
22682
22683 * bison.simple:
22684 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
22685
22686 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
22687 Add automake stuff.
22688
226891998-11-25 Jesse Thilo <jthilo@gnu.org>
22690
22691 * doc/bison.texinfo: Clean up some formatting.
22692
226931998-05-05 Richard Stallman <rms@gnu.org>
22694
22695 * doc/bison.texinfo:
22696 Explain better why to make a pure parser.
22697
226981998-01-05 Richard Stallman <rms@gnu.org>
22699
22700 * src/files.c (openfiles):
22701 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
22702 find a temporary directory, if possible. Do not unlink files while
22703 they are open.
22704
227051997-08-25 Richard Stallman <rms@gnu.org>
22706
22707 * src/reader.c (stack_offset;):
22708 Change some warni to warns.
22709
22710 * src/lex.c (literalchar): Use warns, not warni.
22711
227121997-06-28 Richard Stallman <rms@gnu.org>
22713
22714 * src/bison.s1: Add a Bison version comment.
22715
22716 * src/main.c (fatal, warn, berror):
22717 Use program_name.
22718
227191997-06-28 Richard Stallman <rms@gnu.org>
22720
22721 * Makefile.in (bison_version): New variable.
22722 (dist): Use that variable.
22723 (bison.s1): Substitute the Bison version into bison.simple.
22724
22725 * bison.simple: Add a Bison version comment.
22726
227271997-06-18 Richard Stallman <rms@gnu.org>
22728
22729 * src/main.c (fatal, warn, berror):
22730 Make error messages standard.
22731 (toomany): Improve error message text.
22732
22733 * 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:
22734 new.h renamed to alloc.h.
22735
227361997-06-18 Richard Stallman <rms@gnu.org>
22737
22738 * Makefile.in: new.h renamed to alloc.h.
22739
227401997-05-24 Richard Stallman <rms@gnu.org>
22741
22742 * src/lex.c (literalchar):
22743 Fix the code for escaping \, " and '.
22744
22745 (lex): Avoid trouble when there are many chars
22746 to discard in a char literal with just several chars in it.
22747
227481997-05-17 Richard Stallman <rms@gnu.org>
22749
22750 * src/bison.s1:
22751 Use malloc, if using alloca is troublesome.
22752 (YYSTACK_USE_ALLOCA): New flag macro.
22753 Define it for some systems and compilers.
22754 (YYSTACK_ALLOC): New macro.
22755 (yyparse): Use YYSTACK_ALLOC to allocate stack.
22756 If it was malloc'd, free it.
22757
227581997-05-17 Richard Stallman <rms@gnu.org>
22759
22760 * bison.simple:
22761 Use malloc, if using alloca is troublesome.
22762 (YYSTACK_USE_ALLOCA): New flag macro.
22763 Define it for some systems and compilers.
22764 (YYSTACK_ALLOC): New macro.
22765 (yyparse): Use YYSTACK_ALLOC to allocate stack.
22766 If it was malloc'd, free it.
22767
227681997-04-23 Richard Stallman <rms@gnu.org>
22769
22770 * src/bison.s1:
22771 (alloca) [__hpux]: Always define as __builtin_alloca.
22772
227731997-04-23 Richard Stallman <rms@gnu.org>
22774
22775 * bison.simple:
22776 (alloca) [__hpux]: Always define as __builtin_alloca.
22777
227781997-04-22 Richard Stallman <rms@gnu.org>
22779
22780 * src/bison.s1:
22781 [__hpux]: Include alloca.h (right for HPUX 10)
22782 instead of declaring alloca (right for HPUX 9).
22783
22784 * src/bison.s1 (__yy_memcpy):
22785 Declare arg `count' as unsigned int.
22786 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
22787
227881997-04-22 Richard Stallman <rms@gnu.org>
22789
22790 * bison.simple:
22791 [__hpux]: Include alloca.h (right for HPUX 10)
22792 instead of declaring alloca (right for HPUX 9).
22793
22794 * bison.simple (__yy_memcpy):
22795 Declare arg `count' as unsigned int.
22796 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
22797
227981997-01-03 Richard Stallman <rms@gnu.org>
22799
22800 * src/allocate.c: [__STDC__ or _MSC_VER]:
22801 Declare calloc and realloc to return void *.
22802
228031997-01-02 Richard Stallman <rms@gnu.org>
22804
22805 * src/system.h:
22806 [_MSC_VER]: Include stdlib.h and process.h.
22807 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
22808
22809 * src/main.c (main): Return FAILURE as a value.
22810 (printable_version): Declare arg as int, not char.
22811
228121997-01-02 Richard Stallman <rms@gnu.org>
22813
22814 * Makefile.in (dist):
22815 Explicitly check for symlinks, and copy them.
22816
228171996-12-19 Richard Stallman <rms@gnu.org>
22818
22819 * src/files.c:
22820 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
22821
228221996-12-18 Paul Eggert <eggert@gnu.org>
22823
22824 * src/bison.s1 (yyparse):
22825 If __GNUC__ and YYPARSE_PARAM are both defined,
22826 declare yyparse to have a void * argument.
22827
228281996-12-18 Paul Eggert <eggert@gnu.org>
22829
22830 * bison.simple (yyparse):
22831 If __GNUC__ and YYPARSE_PARAM are both defined,
22832 declare yyparse to have a void * argument.
22833
228341996-12-17 Richard Stallman <rms@gnu.org>
22835
22836 * src/reduce.c (nbits): Add some casts.
22837
228381996-08-12 Richard Stallman <rms@gnu.org>
22839
22840 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
22841
228421996-08-12 Richard Stallman <rms@gnu.org>
22843
22844 * bison.simple: Test _MSDOS as well as _MSDOS_.
22845
228461996-07-31 Richard Stallman <rms@gnu.org>
22847
22848 * src/bison.s1:
22849 [__sun && __i386]: Include alloca.h.
22850
228511996-07-31 Richard Stallman <rms@gnu.org>
22852
22853 * bison.simple:
22854 [__sun && __i386]: Include alloca.h.
22855
228561996-07-30 Richard Stallman <rms@gnu.org>
22857
22858 * src/bison.s1: Comment change.
22859
22860 * src/bison.s1: Test _MSDOS_, not MSDOS.
22861
228621996-07-30 Richard Stallman <rms@gnu.org>
22863
22864 * bison.simple: Comment change.
22865
22866 * bison.simple: Test _MSDOS_, not MSDOS.
22867
228681996-06-01 Richard Stallman <rms@gnu.org>
22869
22870 * 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:
22871 Insert `_' macro around many string constants.
22872
22873 * src/main.c:
22874 Insert `_' macro around many string constants.
22875
22876 (main): Call setlocale, bindtextdomain and textdomain.
22877
22878 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
22879 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
22880 [ENABLE_NLS]: Include libintl.h.
22881 [ENABLE_NLS] (gettext): Define.
22882 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
22883 (N_, PACKAGE, LOCALEDIR): New macros.
22884
228851996-06-01 Richard Stallman <rms@gnu.org>
22886
22887 * POTFILES.in: New file.
22888
22889 * Makefile.in (allocate.o):
22890 Define target explicitly.
22891
22892 * Makefile.in (CFLAGS): Set to @CFLAGS@.
22893 (LDFLAGS): Set to @LDFLAGS@.
22894 (configure): Run autoconf only if preceding `cd' succeeds.
22895 (bison.s1): Redirect output to temporary file then move the
22896 temporary to the target, rather than redirecting directly to bison.s1.
22897 (clean): Remove config.status and config.log.
22898 (distclean): Don't remove config.status here.
22899
229001996-05-12 Richard Stallman <rms@gnu.org>
22901
22902 * src/bison.s1:
22903 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
22904
229051996-05-12 Richard Stallman <rms@gnu.org>
22906
22907 * bison.simple:
22908 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
22909
229101996-05-11 Richard Stallman <rms@gnu.org>
22911
22912 * src/bison.s1 (__yy_memcpy):
22913 Really reorder the args, as was supposedly done on Feb 14 1995.
22914 (yyparse): Calls changed accordingly.
22915
229161996-05-11 Richard Stallman <rms@gnu.org>
22917
22918 * Makefile.in (dist): Don't use $(srcdir).
22919
22920 * bison.simple (__yy_memcpy):
22921 Really reorder the args, as was supposedly done on Feb 14 1995.
22922 (yyparse): Calls changed accordingly.
22923
229241996-01-27 Richard Stallman <rms@gnu.org>
22925
22926 * src/output.c (output_rule_data):
22927 Test YYERROR_VERBOSE in the conditional
22928 around the definition of ttyname.
22929
229301995-12-29 Richard Stallman <rms@gnu.org>
22931
22932 * src/bison.s1:
22933 Fix line numbers in #line commands.
22934
229351995-12-29 Richard Stallman <rms@gnu.org>
22936
22937 * bison.simple:
22938 Fix line numbers in #line commands.
22939
229401995-12-27 Richard Stallman <rms@gnu.org>
22941
22942 * src/bison.s1 (YYPARSE_PARAM_DECL):
22943 In C++, make it always null.
22944 (YYPARSE_PARAM_ARG): New macro.
22945 (yyparse): Use YYPARSE_PARAM_ARG.
22946
229471995-12-27 Richard Stallman <rms@gnu.org>
22948
22949 * bison.simple (YYPARSE_PARAM_DECL):
22950 In C++, make it always null.
22951 (YYPARSE_PARAM_ARG): New macro.
22952 (yyparse): Use YYPARSE_PARAM_ARG.
22953
229541995-11-29 Richard Stallman <rms@gnu.org>
22955
22956 * doc/bison.texinfo:
22957 Describe literal string tokens, %raw, %no_lines, %token_table.
22958
229591995-11-29 Daniel Hagerty <hag@gnu.org>
22960
22961 * doc/bison.texinfo: Fixed update date
22962
229631995-10-16 Richard Stallman <rms@gnu.org>
22964
22965 * src/version.c: Version 1.25.
22966
229671995-10-16 Richard Stallman <rms@gnu.org>
22968
22969 * NEWS: *** empty log message ***
22970
229711995-10-16 Richard Stallman <rms@gnu.org>
22972
22973 * doc/bison.1, doc/bison.rnh:
22974 Add new options.
22975
229761995-10-15 Richard Stallman <rms@gnu.org>
22977
22978 * src/vmsgetargs.c, src/getargs.c:
22979 Added -n, -k, and -raw switches.
22980 (noparserflag, toknumflag, rawtoknumflag): New variables.
22981
22982 * src/symtab.h (SALIAS):
22983 New #define for adding aliases to %token.
22984 (struct bucket): Added `alias' field.
22985
22986 * src/reduce.c (reduce_grammar):
22987 Revise error message.
22988 (print_notices): Remove final `.' from error message.
22989
22990 * src/reader.c (reader_output_yylsp):
22991 New function.
22992 (readgram): Use `#if 0' around code that accepted %command
22993 inside grammar rules: The documentation doesn't allow it,
22994 and it will fail since the %command processors scan for the next %.
22995 (parse_token_decl): Extended the %token
22996 declaration to allow a multi-character symbol as an alias.
22997 (parse_thong_decl): New function.
22998 (read_declarations): Added %thong declarations.
22999 (read_declarations): Handle NOOP to deal with allowing
23000 % declarations as another means to specify the flags.
23001 (readgram): Allow %prec prior to semantics embedded in a rule.
23002 (skip_to_char, read_declarations, copy_definition)
23003 (parse_token_decl, parse_start_decl, parse_type_decl)
23004 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
23005 (get_type_name, copy_guard, copy_action, readgram)
23006 (get_type, packsymbols): Revised most error messages.
23007 Changed `fatal' to `warnxxx' to avoid aborting for error.
23008 Revised and use multiple warnxxx functions to avoid using VARARGS1.
23009 (read_declarations): Improve the error message for
23010 an invalid character. Do not abort.
23011 (read_declarations, copy_guard, copy_action): Use
23012 printable_version to avoid unprintable characters in printed output.
23013 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
23014 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
23015 Allow the type of a non-terminal can be given
23016 more than once, as long as all specifications give the same type.
23017
23018 * src/output.c:
23019 (output_headers, output_trailers, output, output_gram)
23020 (output_rule_data): Implement noparserflag variable.
23021 Implement toknumflag variable.
23022 (output): Call reader_output_yylsp to output LTYPESTR.
23023
23024 * src/main.c (main):
23025 If reader sees an error, don't process the grammar.
23026 (fatals): Updated to not use VARARGS1.
23027 (printable_version, int_to_string, warn, warni, warns, warnss)
23028 (warnsss): New error reporting functions. Avoid abort for error.
23029
23030 * src/lex.h:
23031 Added THONG and NOOP for alias processing.
23032 Added SETOPT for the new code that allows setting options with %flags.
23033
23034 * src/lex.c:
23035 Include getopt.h. Add some extern decls.
23036 (safegetc): New function to deal with EOF gracefully.
23037 (literalchar); new function to deal with reading \ escapes.
23038 (lex): Use literalchar.
23039 (lex): Implemented "..." tokens.
23040 (literalchar, lex, parse_percent_token): Made tokenbuffer
23041 always contain the token. This includes growing the token
23042 buffer while reading an integer.
23043 (parse_percent_token): Replaced if-else statement with percent_table.
23044 (parse_percent_token): Added % declarations as another
23045 way to specify the flags -n, -l, and -r. Also added hooks for
23046 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
23047 major changes to files.c.
23048 (lex) Retain in the incoming stream a character following
23049 an incorrect '/'.
23050 (skip_white_space, lex): Revised most error messages
23051 and changed fatal to warn to avoid aborting.
23052 (percent_table): Added %thong declarations.
23053
23054 * src/gram.h: Comment changes.
23055
23056 * src/files.c (openfiles, open_extra_files, done):
23057 Add faction flag
23058 and actfile file. Handle noparserflag. Both for -n switch.
23059
23060 * src/conflicts.c (resolve_sr_conflict):
23061 Remove use of alloca.
23062
230631995-06-01 Jim Meyering <meyering@gnu.org>
23064
23065 * doc/bison.texinfo: *** empty log message ***
23066
230671995-05-06 Richard Stallman <rms@gnu.org>
23068
23069 * src/bison.s1: Comment change.
23070
230711995-05-06 Richard Stallman <rms@gnu.org>
23072
23073 * bison.simple: Comment change.
23074
230751995-05-03 Richard Stallman <rms@gnu.org>
23076
23077 * src/version.c: Version now 1.24.
23078
23079 * src/bison.s1: Change distribution terms.
23080
23081 * src/version.c: Version now 1.23.
23082
230831995-05-03 Richard Stallman <rms@gnu.org>
23084
23085 * doc/bison.texinfo:
23086 Rewrite "Conditions for Using Bison".
23087 Update version to 1.24.
23088
230891995-05-03 Richard Stallman <rms@gnu.org>
23090
23091 * bison.simple: Change distribution terms.
23092
230931995-02-23 Richard Stallman <rms@gnu.org>
23094
23095 * src/files.c: Test __VMS_POSIX as well as VMS.
23096
230971995-02-14 Jim Meyering <meyering@gnu.org>
23098
23099 * src/bison.s1 (__yy_memcpy):
23100 Renamed from __yy_bcopy to avoid
23101 confusion. Reverse FROM and TO arguments to be consistent with
23102 those of memcpy.
23103
231041995-02-14 Jim Meyering <meyering@gnu.org>
23105
23106 * bison.simple (__yy_memcpy):
23107 Renamed from __yy_bcopy to avoid
23108 confusion. Reverse FROM and TO arguments to be consistent with
23109 those of memcpy.
23110
231111994-11-10 David J. MacKenzie <djm@gnu.org>
23112
23113 * NEWS: reformat
23114
23115 * NEWS: New file.
23116
23117 * Makefile.in (DISTFILES): Include NEWS.
23118
23119 * Makefile.in (DISTFILES):
23120 Include install-sh, not install.sh.
23121
23122 * configure.in: Update to Autoconf v2 macro names.
23123
231241994-10-05 David J. MacKenzie <djm@gnu.org>
23125
23126 * Makefile.in: fix typo
23127
23128 * Makefile.in (prefix, exec_prefix):
23129 Let configure set them.
23130
231311994-09-28 David J. MacKenzie <djm@gnu.org>
23132
23133 * Makefile.in: Set datadir to $(prefix)/share.
23134
231351994-09-15 Richard Stallman <rms@gnu.org>
23136
23137 * src/bison.s1:
23138 Update copyright notice and GPL version.
23139
231401994-09-15 Richard Stallman <rms@gnu.org>
23141
23142 * bison.simple:
23143 Update copyright notice and GPL version.
23144
231451994-07-12 Richard Stallman <rms@gnu.org>
23146
23147 * src/reduce.c, src/reader.c:
23148 entered into RCS
23149
231501994-05-05 David J. MacKenzie <djm@gnu.org>
23151
23152 * Makefile.in: entered into RCS
23153
231541994-03-26 Richard Stallman <rms@gnu.org>
23155
23156 * src/bison.s1: entered into RCS
23157
231581994-03-26 Richard Stallman <rms@gnu.org>
23159
23160 * bison.simple: entered into RCS
23161
231621994-03-25 Richard Stallman <rms@gnu.org>
23163
23164 * src/main.c: entered into RCS
23165
231661994-03-24 Richard Stallman <rms@gnu.org>
23167
23168 * src/conflicts.c: entered into RCS
23169
231701994-01-02 Richard Stallman <rms@gnu.org>
23171
23172 * Makefile.in: *** empty log message ***
23173
231741993-11-21 Richard Stallman <rms@gnu.org>
23175
23176 * src/bison.s1: *** empty log message ***
23177
231781993-11-21 Richard Stallman <rms@gnu.org>
23179
23180 * doc/bison.texinfo: entered into RCS
23181
23182 * doc/bison.texinfo: *** empty log message ***
23183
231841993-11-21 Richard Stallman <rms@gnu.org>
23185
23186 * bison.simple: *** empty log message ***
23187
231881993-10-25 David J. MacKenzie <djm@gnu.org>
23189
23190 * doc/bison.texinfo: *** empty log message ***
23191
231921993-10-19 Richard Stallman <rms@gnu.org>
23193
23194 * src/bison.s1: *** empty log message ***
23195
231961993-10-19 Richard Stallman <rms@gnu.org>
23197
23198 * bison.simple: *** empty log message ***
23199
232001993-10-14 Richard Stallman <rms@gnu.org>
23201
23202 * src/bison.s1: *** empty log message ***
23203
232041993-10-14 Richard Stallman <rms@gnu.org>
23205
23206 * bison.simple: *** empty log message ***
23207
232081993-09-14 David J. MacKenzie <djm@gnu.org>
23209
23210 * doc/bison.texinfo: *** empty log message ***
23211
232121993-09-13 Noah Friedman <friedman@gnu.org>
23213
23214 * Makefile.in: *** empty log message ***
23215
232161993-09-10 Richard Stallman <rms@gnu.org>
23217
23218 * src/conflicts.c: *** empty log message ***
23219
23220 * src/system.h: entered into RCS
23221
232221993-09-10 Richard Stallman <rms@gnu.org>
23223
23224 * doc/bison.1: entered into RCS
23225
232261993-09-06 Noah Friedman <friedman@gnu.org>
23227
23228 * src/version.c: entered into RCS
23229
232301993-09-06 Noah Friedman <friedman@gnu.org>
23231
23232 * Makefile.in: *** empty log message ***
23233
232341993-07-30 David J. MacKenzie <djm@gnu.org>
23235
23236 * Makefile.in: *** empty log message ***
23237
232381993-07-24 Richard Stallman <rms@gnu.org>
23239
23240 * src/bison.s1: *** empty log message ***
23241
232421993-07-24 Richard Stallman <rms@gnu.org>
23243
23244 * bison.simple: *** empty log message ***
23245
232461993-07-08 David J. MacKenzie <djm@gnu.org>
23247
23248 * Makefile.in: *** empty log message ***
23249
232501993-07-04 Richard Stallman <rms@gnu.org>
23251
23252 * src/bison.s1: *** empty log message ***
23253
232541993-07-04 Richard Stallman <rms@gnu.org>
23255
23256 * bison.simple: *** empty log message ***
23257
232581993-06-26 David J. MacKenzie <djm@gnu.org>
23259
23260 * src/getargs.c: entered into RCS
23261
232621993-06-26 David J. MacKenzie <djm@gnu.org>
23263
23264 * doc/bison.texinfo: *** empty log message ***
23265
23266 * doc/bison.1: New file.
23267
232681993-06-25 Richard Stallman <rms@gnu.org>
23269
23270 * src/getargs.c: New file.
23271
232721993-06-16 Richard Stallman <rms@gnu.org>
23273
23274 * src/bison.s1: *** empty log message ***
23275
232761993-06-16 Richard Stallman <rms@gnu.org>
23277
23278 * bison.simple: *** empty log message ***
23279
232801993-06-03 Richard Stallman <rms@gnu.org>
23281
23282 * src/bison.s1: New file.
23283
232841993-06-03 Richard Stallman <rms@gnu.org>
23285
23286 * doc/bison.texinfo: *** empty log message ***
23287
232881993-06-03 Richard Stallman <rms@gnu.org>
23289
23290 * bison.simple: New file.
23291
232921993-05-19 Richard Stallman <rms@gnu.org>
23293
23294 * doc/bison.texinfo: New file.
23295
232961993-05-07 Noah Friedman <friedman@gnu.org>
23297
23298 * Makefile.in: *** empty log message ***
23299
233001993-04-28 Noah Friedman <friedman@gnu.org>
23301
23302 * src/reader.c: *** empty log message ***
23303
233041993-04-23 Noah Friedman <friedman@gnu.org>
23305
23306 * src/alloc.h: entered into RCS
23307
233081993-04-20 David J. MacKenzie <djm@gnu.org>
23309
23310 * src/version.c: *** empty log message ***
23311
23312 * src/files.c, src/allocate.c:
23313 entered into RCS
23314
23315 * src/reader.c: *** empty log message ***
23316
23317 * src/lex.c: entered into RCS
23318
23319 * src/conflicts.c: New file.
23320
23321 * src/symtab.c: entered into RCS
23322
23323 * src/alloc.h: New file.
23324
23325 * src/LR0.c: entered into RCS
23326
233271993-04-18 Noah Friedman <friedman@gnu.org>
23328
23329 * src/reader.c: New file.
23330
23331 * src/version.c: *** empty log message ***
23332
233331993-04-18 Noah Friedman <friedman@gnu.org>
23334
23335 * Makefile.in: *** empty log message ***
23336
233371993-04-17 Noah Friedman <friedman@gnu.org>
23338
23339 * Makefile.in: *** empty log message ***
23340
233411993-04-15 Richard Stallman <rms@gnu.org>
23342
23343 * src/main.c, src/files.c:
23344 New file.
23345
233461993-04-15 Noah Friedman <friedman@gnu.org>
23347
23348 * configure.in: entered into RCS
23349
23350 * configure.in: *** empty log message ***
23351
23352 * configure.in: New file.
23353
233541993-04-14 Richard Stallman <rms@gnu.org>
23355
23356 * Makefile.in: New file.
23357
233581993-04-13 Richard Stallman <rms@gnu.org>
23359
23360 * src/version.c: New file.
23361
233621993-03-25 Richard Stallman <rms@gnu.org>
23363
23364 * src/output.c: entered into RCS
23365
233661992-09-25 Richard Stallman <rms@gnu.org>
23367
23368 * configure.bat: entered into RCS
23369
233701992-06-22 Richard Stallman <rms@gnu.org>
23371
23372 * src/vmsgetargs.c: entered into RCS
23373
233741992-06-22 Richard Stallman <rms@gnu.org>
23375
23376 * doc/bison.rnh: entered into RCS
23377
233781992-04-20 David J. MacKenzie <djm@gnu.org>
23379
23380 * README: entered into RCS
23381
233821992-01-22 Richard Stallman <rms@gnu.org>
23383
23384 * src/machine.h: entered into RCS
23385
233861991-12-21 Richard Stallman <rms@gnu.org>
23387
23388 * src/lalr.c, src/closure.c:
23389 entered into RCS
23390
233911991-12-20 Richard Stallman <rms@gnu.org>
23392
23393 * src/state.h: entered into RCS
23394
233951991-12-18 Richard Stallman <rms@gnu.org>
23396
23397 * src/print.c, src/nullable.c, src/derives.c:
23398 entered into RCS
23399
234001991-11-03 David J. MacKenzie <djm@gnu.org>
23401
23402 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
23403 entered into RCS
23404
234051988-09-09 Richard Stallman <rms@gnu.org>
23406
23407 * src/bison.hairy: entered into RCS
23408
234091987-12-16 Richard Stallman <rms@gnu.org>
23410
23411 * REFERENCES: entered into RCS
dc546b0f 23412
f294a2c2 23413
04098407 23414 -----
f294a2c2 23415
04098407 23416 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
e021191b
JD
23417 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
23418 2008, 2009 Free Software Foundation, Inc.
f294a2c2 23419
04098407
PE
23420 Copying and distribution of this file, with or without
23421 modification, are permitted provided the copyright notice and this
23422 notice are preserved.