]> git.saurik.com Git - bison.git/blob - ChangeLog
doc: minor fixes.
[bison.git] / ChangeLog
1 2009-04-14 Akim Demaille <demaille@gostai.com>
2
3 doc: minor fixes.
4 * doc/bison.texinfo (Decl Summary): Fix entry about %debug.
5 (Table of Symbols): Remove duplicate entry for %debug.
6
7 2009-04-10 Eric Blake <ebb9@byu.net>
8
9 submodules: update to latest
10 * submodules/autoconf: Use latest upstream Autoconf.
11
12 2009-04-06 Eric Blake <ebb9@byu.net>
13
14 Work around autoconf 2.63b bug in testsuite.
15 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Avoid tripping
16 autoconf bug related to # in test.
17
18 2009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
19
20 * NEWS (2.5): New section. Describe new -D/--define feature.
21
22 2009-04-06 Akim Demaille <demaille@gostai.com>
23
24 Regen.
25 * src/parse-gram.h, src/parse-gram.c: Regen.
26
27 2009-04-06 Akim Demaille <demaille@gostai.com>
28
29 rename muscle_tab.* as muscle-tab.* for consistency.
30 * src/muscle_tab.h, src/muscle_tab.c: Rename as...
31 * src/muscle-tab.h, src/muscle-tab.c: these.
32 * src/getargs.c, src/local.mk, src/main.c, src/output.c,
33 * src/parse-gram.y, src/reader.c, src/scan-code.l: Adjust.
34
35 2009-04-06 Akim Demaille <demaille@gostai.com>
36
37 Makefile: introduce $(BISON).
38 * src/local.mk (BISON): New.
39 (YACC): Use it.
40
41 2009-04-06 Akim Demaille <demaille@gostai.com>
42
43 parser: handle %locations as %define locations.
44 * src/getargs.h, src/getargs.c (locations_flag): Remove.
45 * src/getargs.c, src/scan-code.l: Use muscle_percent_define_ensure
46 to set "locations" to true.
47 * src/output.c (prepare): Don't output "locations".
48 * src/scan-gram.l (%locations): Handle it as a %<flag>.
49 * src/parse-gram.y: It's no longer a token.
50 Don't handle it.
51 * data/bison.m4 (b4_locations_if): Define it with
52 b4_percent_define_if_define.
53 * data/c.m4, data/glr.cc: Adjust.
54
55 2009-04-06 Akim Demaille <demaille@gostai.com>
56
57 Regen.
58 * src/parse-gram.c: Regen.
59
60 2009-04-06 Akim Demaille <demaille@gostai.com>
61
62 muscle: factor the handling of obsolete of obsolete directives.
63 Suggested by Joel E. Denny.
64
65 * src/muscle_tab.h, src/muscle_tab.c (muscle_percent_define_ensure):
66 New, extracted from...
67 * src/parse-gram.y (prologue_declaration: pure-parser): here.
68 Remove it.
69 (prologue_declaration: "%<flag>"): Use
70 muscle_percent_define_ensure.
71 (%error-verbose, %pure-parser): No longer tokens.
72 * src/scan-gram.l (pure-parser): Return as a %<flag>.
73
74 2009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
75
76 Fix options documentation.
77 * build-aux/cross-options.pl: As in --help output, write optional
78 arguments as [=ARG] not =[ARG].
79 * doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
80
81 2009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
82
83 Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4.
84 If the first m4 in $PATH is wrong, it keeps looking. Moreover, its
85 requirements for a correct m4 are stricter.
86 * m4/m4.m4: Make it a symbolic link to submodules/autoconf/m4/m4.m4.
87 * configure.ac: Update to use AC_PROG_GNU_M4.
88 Reported by Eric Blake.
89
90 2009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
91
92 Help with updating web manual.
93 * HACKING: Incorporate instructions from gnulib/doc/README.
94 * bootstrap.conf (gnulib_modules): Add gendocs.
95
96 2009-04-03 Akim Demaille <demaille@gostai.com>
97
98 Regen.
99 * src/parse-gram.h, src/parse-gram.c: Regen.
100
101 2009-04-03 Akim Demaille <demaille@gostai.com>
102
103 Factor %FLAG at scan level.
104 * src/parse-gram.y (PERCENT_DEBUG, PERCENT_ERROR_VERBOSE): Token
105 definitions and associated rules, replaced by....
106 (PERCENT_FLAG): this new token type, and rule.
107 * src/scan-gram.l (RETURN_PERCENT_FLAG): New.
108 Use it for %debug and %error-verbose.
109
110 2009-04-03 Akim Demaille <demaille@gostai.com>
111
112 Regen.
113 * src/parse-gram.h, src/parse-gram.c: Regen.
114
115 2009-04-03 Akim Demaille <demaille@gostai.com>
116
117 Treat %debug as %define debug.
118 * data/bison.m4 (b4_debug_if): New.
119 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c,
120 * data/lalr1.java: Use it instead of b4_debug_flag.
121 * src/getargs.h, src/getargs.c (debug_flag): Remove.
122 * src/output.c (prepare): Don't output it.
123 * src/parse-gram.y: Treat %debug as %define debug.
124
125 2009-04-03 Akim Demaille <demaille@gostai.com>
126
127 Treat %error-verbose as %define error_verbose.
128 This allows to pass -Derror_verbose on the command line. Better
129 yet, it allows to pass -Derror_verbose=$(ERROR_VERBOSE), with
130 ERROR_VERBOSE being defined as false or true.
131 * data/bison.m4 (b4_percent_define_if_define): Instead of relying
132 on b4_percent_define_ifdef, for does not check the defined value,
133 but only whether the symbol is defined, rely on
134 b4_percent_define_flag_if, so that a value of "false" is processed
135 as a false.
136 If not defined, define the flag to "false".
137 (b4_error_verbose_if): New.
138 * data/glr.c, data/lalr1.cc, data/yacc.c: Use it instead of
139 b4_error_verbose_flag.
140 * src/getargs.h, src/getargs.c (error_verbose_flag): Remove.
141 * src/output.c (prepare): Don't output it.
142 * src/parse-gram.y (%error-verbose): Treat as %define error_verbose.
143
144 2009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
145
146 Fix strange %define locations for default values.
147 Reported by Akim Demaille at
148 <http://lists.gnu.org/archive/html/bug-bison/2007-12/msg00001.html>
149 and discussed again starting at
150 <http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00102.html>.
151 * data/bison.m4 (b4_percent_define_default): Leave syncline blank
152 because location information is bogus.
153 Use angle brackets to delimit fake file name because square brackets
154 look like underexpanded m4. Choose a better fake file name.
155 Use negative line numbers.
156 * src/muscle_tab.c (muscle_percent_define_default): Likewise.
157 * src/location.c (location_print): If line for a boundary is negative,
158 only print that boundary's file name.
159 * src/location.h: Document that.
160 * tests/skeletons.at (%define Boolean variables: invalid skeleton
161 defaults): Update output.
162
163 2009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
164
165 Pacify ./configure --enable-gcc-warnings.
166 * Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS) because many files
167 in lib won't compile with it.
168 * src/local.mk (src_bison_CFLAGS): Use $(WERROR_CFLAGS) here only.
169
170 2009-03-31 Akim Demaille <demaille@gostai.com>
171
172 bootstrap: --help to stdout.
173 * bootstrap (usage): Don't send --help to stderr.
174 Use a here doc instead of a long string.
175
176 2009-03-31 Akim Demaille <demaille@gostai.com>
177
178 bootstrap: README-hacking no longer exists
179 * bootstrap (checkout_only_file): Set to HACKING.
180
181 2009-03-26 Akim Demaille <demaille@gostai.com>
182
183 doc: merge HACKING and README-hacking.
184 Two files is confusing.
185 Reported by Alexandre Duret-Lutz.
186
187 * README-hacking: Merge into...
188 * HACKING (Working from the repository): here.
189
190 2009-03-26 Akim Demaille <demaille@gostai.com>
191
192 doc: update README-hacking.
193 * README-hacking: We now use git and git submodules.
194 Reported by Ralf Wildenhues and Alexandre Duret-Lutz.
195
196 2009-03-26 Akim Demaille <demaille@gostai.com>
197
198 lalr1.cc: avoid GCC 4.3 warnings.
199 GCC 4.3 now warns about "a || b && c" and asks for explicit
200 parentheses.
201 Reported by Alexandre Duret-Lutz.
202 * data/location.cc: Update copyright years.
203 (Position::operator==): Use parens to make precedence explicit.
204 Compare lines and columns first, as they are more likely to be
205 different, and they are faster to compare.
206
207 2009-03-26 Akim Demaille <demaille@gostai.com>
208
209 gnulib: update.
210 * gnulib: Update to latest.
211 * src/local.mk (AM_CFLAGS): Move to...
212 * Makefile.am: here.
213 * etc/prefix-gnulib-mk (prefix_assignment): Also transform
214 AM_CFLAGS.
215
216 2009-03-02 Akim Demaille <demaille@gostai.com>
217
218 Comment changes.
219
220 2009-03-02 Akim Demaille <demaille@gostai.com>
221
222 Share b4_yytranslate_define.
223 * data/lalr1.cc (b4_yytranslate_define): Move to...
224 * data/c++.m4: here.
225
226 2009-03-02 Akim Demaille <demaille@gostai.com>
227
228 Use locations in the variant example.
229 Yes, this obfuscates the point of this example, variants only.
230 But glr.cc cannot work (yet?) without locations. This change
231 makes it easier to use this example with glr.cc.
232
233 * examples/variant.yy (assert): %define it.
234 (locations): Request them.
235 (yylex): Bind the location to the stage.
236
237 2009-03-02 Akim Demaille <demaille@gostai.com>
238
239 Dub make_TOKEN as a public type interface.
240 * data/c++.m4 (b4_symbol_constructor_declare)
241 (b4_symbol_constructor_define): New empty stubs.
242 (b4_public_types_declare, b4_public_types_define): Use them.
243 * data/lalr1.cc (b4_symbol_constructor_declare)
244 (b4_symbol_constructor_declare_)
245 (b4_symbol_constructor_define_, b4_symbol_constructor_define):
246 Move to...
247 * data/variant.hh: here.
248 Remove the "b4_variant_if" parts, as variant.hh is loaded only if
249 needed.
250 * data/lalr1.cc: No longer invoke b4_symbol_constructor_define and
251 b4_symbol_constructor_declare, as it is now done by
252 b4_public_types_define and b4_public_types_declare.
253
254 2009-03-02 Akim Demaille <demaille@gostai.com>
255
256 Coding style changes.
257 * data/lalr1.cc (b4_symbol_constructor_declaration_)
258 (b4_symbol_constructor_declarations)
259 (b4_symbol_constructor_definition_)
260 (b4_symbol_constructor_definitions)
261 (b4_yytranslate_definition): Rename as...
262 (b4_symbol_constructor_declare_)
263 (b4_symbol_constructor_declare)
264 (b4_symbol_constructor_define_)
265 (b4_symbol_constructor_define)
266 (b4_yytranslate_define): these.
267 * data/variant.hh (b4_variant_definition): Rename as...
268 (b4_variant_define): this.
269
270 2009-03-02 Akim Demaille <demaille@gostai.com>
271
272 Factor b4_assert_if, b4_lex_symbol_if, and b4_variant_if.
273 * data/bison.m4 (b4_percent_define_if_define): New.
274 * data/c++.m4 (b4_variant_if): Move to...
275 * data/bison.m4: Here, using b4_percent_define_if_define.
276 * data/lalr1.cc (b4_assert_if, b4_lex_symbol_if): Move to...
277 * data/bison.m4: Here, using b4_percent_define_if_define.
278
279 2009-03-02 Akim Demaille <demaille@gostai.com>
280
281 Dub symbol_type_base as a public type.
282 * data/c++.m4 (b4_public_types_declare): Now define
283 symbol_type_base and symbol_type.
284 (b4_public_types_define): New.
285 In both cases, the definitions are taken verbatim from lalr1.cc.
286 * data/lalr1.cc: Adjust.
287
288 2009-03-02 Akim Demaille <demaille@gostai.com>
289
290 b4_public_types_declare.
291 * data/c++.m4 (b4_public_types_declare): New.
292 * data/glr.cc, data/lalr1.cc: Use it.
293
294 2009-03-02 Akim Demaille <demaille@gostai.com>
295
296 b4_semantic_type_declare.
297 * data/c++.m4 (b4_semantic_type_declare): New.
298 Factors and generalizes what was in glr.cc and lalr1.cc.
299 * data/variant.hh (b4_semantic_type_declare): Redefine it for
300 variants.
301 * data/lalr1.cc, data/glr.cc: Use it.
302
303 2009-02-26 Akim Demaille <demaille@gostai.com>
304
305 Upgrade gnulib.
306 * gnulib: Upgrade from master.
307 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore, m4/.gitignore:
308 Regen.
309
310 2009-02-25 Akim Demaille <demaille@gostai.com>
311
312 Remove useless arguments.
313 * data/glr.c (yy_reduce_print): $$ and @$ are not used and not
314 relevant.
315
316 2009-02-25 Akim Demaille <demaille@gostai.com>
317
318 Comment changes.
319 * data/lalr1.cc: here.
320
321 2009-02-25 Akim Demaille <demaille@gostai.com>
322
323 Fix glr.cc's debug level handling.
324 * data/glr.cc (yydebug_): Remove, as it is actually yydebug from
325 glr.c which is used.
326 (debug_level, set_debug_level): Adjust.
327
328 2009-02-25 Akim Demaille <demaille@gostai.com>
329
330 Copyright years.
331 * data/glr.c: Add 2007 and 2008 here, consistenly with the comments.
332
333 2009-02-25 Akim Demaille <demaille@gostai.com>
334
335 Style changes.
336 * etc/bench.pl.in (generate_grammar_list): Consitently use
337 location_type, not yy::location.
338
339 2009-02-25 Akim Demaille <demaille@gostai.com>
340
341 Comment change.
342 * data/lalr1.cc: here.
343
344 2009-02-19 Akim Demaille <demaille@gostai.com>
345
346 Make yyparser::error public.
347 * data/lalr1.cc: here.
348 There is no good reason to keep it private (and it is convenient
349 to use it from the scanner for instance). It is already public in
350 glr.cc.
351
352 2009-02-19 Akim Demaille <demaille@gostai.com>
353
354 Comment changes.
355 * data/glr.cc: here.
356
357 2009-02-19 Akim Demaille <demaille@gostai.com>
358
359 Remove trailing blanks.
360 The epilogue has its own ending \n, no need to add another.
361
362 * data/glr.c, data/lalr1.java, data/yacc.c: dnl when outputing the
363 epilogue.
364 * data/glr.cc: dnl when extending the epilogue.
365 Remove stray "private:".
366
367 2009-02-19 Akim Demaille <demaille@gostai.com>
368
369 Use b4_c_modern.
370 * data/c.m4 (b4_c_function_decl): Here.
371
372 2009-02-19 Akim Demaille <demaille@gostai.com>
373
374 Comment changes.
375 * data/lalr1.cc: here.
376
377 2009-02-19 Akim Demaille <demaille@gostai.com>
378
379 Extract variant.hh
380 * data/variant.hh: New, extracted from...
381 * data/lalr1.cc: here.
382 Adjust.
383 * data/local.mk: Adjust.
384
385 2009-02-19 Akim Demaille <demaille@gostai.com>
386
387 Extract stack.hh from lalr1.cc.
388 * data/stack.hh: New.
389 * data/lalr1.cc: Extract from here.
390 * data/local.mk: Adjust.
391
392 2009-02-03 Joel E. Denny <jdenny@ces.clemson.edu>
393
394 Add reminder about uploading public key to keys.gnupg.net.
395 * HACKING (Release Procedure): Here.
396
397 2009-01-28 Akim Demaille <demaille@gostai.com>
398
399 * NEWS: Update information about 2.4.1 and 2.4.2.
400
401 2008-11-04 Akim Demaille <demaille@gostai.com>
402
403 Reformat NEWS.
404 * NEWS: Use more outline-mode markup.
405 Suggested by Jim Meyering.
406
407 2009-01-08 Akim Demaille <demaille@gostai.com>
408
409 Fix grep portability issues.
410 Grep on Solaris does not support -q.
411 Reported by Summum Bonum.
412
413 * NEWS: Add a stub for 2.4.2.
414 * THANKS: Add Summum Bonum.
415 * tests/atlocal.in (EGREP): New.
416 (CC, CXX, XSLTPROC): Make it possible to override them via
417 envvars.
418 * tests/java.at: Use $EGREP instead of egrep.
419 Use AT_CHECK's ignore instead of grep's -q.
420
421 2008-12-11 Akim Demaille <demaille@gostai.com>
422
423 Pass the token type to yysyntax_error.
424 * data/yacc.c (yysyntax_error): Take the transated token instead
425 of the raw number.
426 Adjust callers.
427 * TODO: Update.
428
429 2008-12-11 Akim Demaille <demaille@gostai.com>
430
431 Formatting changes.
432 * data/glr.c: Formatting changes.
433
434 2008-12-11 Akim Demaille <demaille@gostai.com>
435
436 Propagate i18n changes into glr.c.
437 * TODO: Update.
438 * data/glr.c (yyreportSyntaxError): Use "switch" instead of
439 building the error message format dynamically.
440 * data/lalr1.java: Formatting changes.
441
442 2008-12-11 Akim Demaille <demaille@gostai.com>
443
444 Use testsuite -C.
445 * tests/local.mk: Replace "cd && testsuite" by "testsuite -C".
446 Solves problems when top_srcdir is an absolute path.
447 Suggested by Eric Blake.
448 * configure.ac: Require Autoconf 2.62.
449
450 2008-12-11 Akim Demaille <demaille@gostai.com>
451
452 Simplify the i18n of the error messages.
453 * data/lalr1.cc: Comment changes.
454 * data/yacc.c (yysyntax_error): Rewrite, using a switch as in
455 lalr1.cc instead of building dynamically the format string.
456
457 2008-12-08 Akim Demaille <demaille@gostai.com>
458
459 Fix portability issue in the test suite.
460 * tests/local.at (AT_MATCHES_CHECK): New.
461 Based on Perl instead of Sed. Sed has too many portability
462 pitfalls, not ever Sed is GNU Sed.
463 * tests/actions.at (Fix user actions without a trailing semicolon):
464 Use it.
465
466 2008-12-08 Akim Demaille <demaille@gostai.com>
467
468 Update data/README.
469 * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
470
471 2008-12-08 Akim Demaille <demaille@gostai.com>
472
473 Install autoconf as a submodule to get m4sugar.
474 * .gitmodules: Add submodules/autoconf.
475 * data/m4sugar/foreach.m4, data/m4sugar/m4sugar.m4: Now links into
476 submodules/autoconf.
477
478 2008-12-08 Akim Demaille <demaille@gostai.com>
479
480 Test token.prefix in all the skeletons.
481 * data/java.m4 (b4_token_enum): Use the token.prefix.
482 * tests/local.at (AT_BISON_OPTION_PUSHDEFS): Define AT_TOKEN_PREFIX.
483 * tests/calc.at (_AT_DATA_CALC_Y): Use it.
484 Add checks for yacc.c, glr.c, lalr1.cc and glr.cc.
485 * tests/java.at: Comment changes.
486 (AT_CHECK_JAVA_MINIMAL): Define the END token.
487 (Java parser class and package names): Add token.prefix check.
488
489 2008-12-08 Akim Demaille <demaille@gostai.com>
490
491 Fix regeneration of atconfig.
492 * tests/local.mk (tests/atconfig): The rule was incorrect, but
493 remove it: now that there is no tests/Makefile.am, the top-level
494 Makefile properly updates atconfig when needed.
495
496 2008-12-07 Di-an Jan <dianj@freeshell.org>
497
498 Implement the FIXME that ends an user action with a semicolon
499 if it seems necessary.
500 * src/scan-code.l (flex rules section): Flag cpp directive from
501 any `#' to the first unescaped end-of-line. Semicolon is not
502 needed after `;', `{', '}', or cpp directives and is needed after
503 any other token (whitespaces and comments have no effect).
504 * tests/actions.at (Fix user actions without a trailing semicolon):
505 New test.
506 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to
507 to make user actions complete statements.
508 Adjust column numbers in error messages.
509 * tests/regression.at (Fix user actions without a trailing semicolon):
510 Remove. Covered by new test.
511
512 2008-12-07 Akim Demaille <demaille@gostai.com>
513
514 Update gnulib.
515 * gnulib: Update from master.
516
517 2008-12-05 Eric Blake <ebb9@byu.net>
518
519 Avoid compiler warning.
520 * src/output.c (muscle_insert_item_number_table): Delete unused
521 function.
522
523 2008-12-02 Eric Blake <ebb9@byu.net>
524
525 Build testsuite with newer autoconf.
526 * tests/output.at (m4_expand): Don't override in newer autoconf,
527 where the underlying implementation changed.
528 * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
529 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
530 (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
531 (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
532 since some of them contain unbalanced ')'.
533
534 2008-12-01 Akim Demaille <demaille@gostai.com>
535
536 Use b4_symbol for printers and destructors everywhere.
537 * data/bison.m4 (b4_symbol_action_location): New.
538 * data/c.m4 (b4_symbol_actions): Remove.
539 Adjust all callers to use by b4_symbol_foreach and the corresponding
540 b4_symbol_printer/destructor macro.
541 * data/glr.cc: Adjust.
542 * data/lalr1.java: Adjust the %destructor sanity check.
543 * src/output.c (symbol_code_props_output): Remove, we no longer
544 need the b4_symbol_printers/destructors tables.
545
546 2008-12-01 Akim Demaille <demaille@gostai.com>
547
548 Use b4_symbol_case_.
549 * data/lalr1.cc, data/bison.m4 (b4_symbol_action): Use
550 b4_symbol_case_.
551
552 2008-12-01 Akim Demaille <demaille@gostai.com>
553
554 Move b4_symbol based macro to bison.m4.
555 * data/lalr1.cc (b4_symbol_, b4_symbol, b4_symbol_if)
556 (b4_symbol_action, b4_symbol_destructor, b4_symbol_printer)
557 (b4_symbol_case_, b4_symbol_foreach, b4_type_action_)
558 (b4_type_foreach): Move to...
559 * data/bison.m4: Here.
560 * data/lalr1.cc (b4_symbol_action): Specialize for C++: use
561 b4_symbol_value_template instead of b4_symbol_value.
562
563 2008-12-01 Akim Demaille <demaille@gostai.com>
564
565 b4_symbol/type_foreach.
566 * data/lalr1.cc (b4_symbol_foreach, b4_type_foreach): New.
567 Use them.
568
569 2008-12-01 Akim Demaille <demaille@gostai.com>
570
571 Use the symbol properties to output the printer/destructor for lalr1.cc.
572 Instead of defining complex list of tuples to define various
573 properties of the symbols, we now prefer to define symbols as
574 "structs" in m4: using the symbol key (its number), and the
575 property name, b4_symbol gives it value. Use this to handle
576 destructors and printers.
577
578 * src/output.c (CODE_PROP): New.
579 (prepare_symbol_definitions): Use it to define the printer and
580 destructor related attributes of the symbols.
581 * data/lalr1.cc (b4_symbol_actions): Rename as...
582 (b4_symbol_action): this.
583 Use b4_symbol instead of 6 arguments.
584 (b4_symbol_printer, b4_symbol_destructor): New.
585 Use them instead of b4_symbol_actions.
586
587 2008-12-01 Akim Demaille <demaille@gostai.com>
588
589 Avoid capturing variables too easily.
590 * src/muscle_tab.h (MUSCLE_INSERT_BOOL, MUSCLE_OBSTACK_SGROW): Use
591 v__ and p__ instead of v and p.
592
593 2008-12-01 Akim Demaille <demaille@gostai.com>
594
595 Remove spurious empty line before syncline.
596 * data/bison.m4 (b4_syncline): Don't output an empty line before
597 the output.
598
599 2008-11-26 Akim Demaille <demaille@gostai.com>
600
601 Convert lib/Makefile.am into lib/local.mk.
602 The real problem is rather gnulib.mk, which itself is extracted
603 from a Makefile.am that gnulib expects to the "recursive". The
604 tool prefix-gnulib-mk converts such a gnulib.mk to be
605 non-recursive. Also, some AC_SUBST variables need to be adjusted.
606
607 * etc/prefix-gnulib-mk: New.
608 * bootstrap (slurp): Use it to convert further gnulib.mk.
609 No longer try to avoid re-creation of lib/gnulib.mk as the changes
610 are deeper.
611 * lib/Makefile.am: Rename as...
612 * lib/local.mk: this.
613 Adjust to be prefixed.
614 * Makefile.am, configure.ac: Adjust.
615 * src/local.mk (AM_CPPFLAGS): Extend it, don't define it.
616
617 2008-11-26 Akim Demaille <demaille@gostai.com>
618
619 s/_FLAGS/FLAGS/.
620 * tests/local.mk (TESTSUITE_FLAGS, AUTOTEST_FLAGS): Rename as...
621 (TESTSUITEFLAGS, AUTOTESTFLAGS): these to compy with the GCS.
622 Reported by Eric Blake.
623
624 2008-11-26 Akim Demaille <demaille@gostai.com>
625
626 Use b4_parser_tables_define in glr.cc.
627 * data/glr.c: Use b4_parser_tables_define instead of defining the
628 (deterministic integral) tables by hand.
629
630 2008-11-26 Akim Demaille <demaille@gostai.com>
631
632 Use b4_parser_tables_define in Java.
633 * data/java.m4 (b4_typed_parser_table): Rename as...
634 (b4_typed_parser_table_define): this, for consistency.
635 Accept a comment as $4.
636 Move $2 into yy*_.
637 (b4_integral_parser_table): Rename as...
638 (b4_integral_parser_table_define): this.
639 * data/lalr1.java: Adjust all uses.
640 Use b4_parser_tables_define instead of generation by hand.
641
642 2008-11-26 Akim Demaille <demaille@gostai.com>
643
644 Prepare the convergence bw C style and Java table generation.
645 * data/bison.m4 (b4_tables_map, b4_tables_declare)
646 (b4_tables_define): Rename as...
647 (b4_integral_parser_tables_map, b4_parser_tables_declare)
648 (b4_parser_tables_define): these.
649 * data/c.m4 (b4_table_define): Rename as...
650 (b4_integral_parser_table_define): this.
651 * data/lalr1.cc: Adjust.
652 (b4_table_define, b4_table_declare): Rename as...
653 (b4_integral_parser_table_define)
654 (b4_integral_parser_table_declare): these.
655 (yyrline_): Move the comment where it is actually used.
656 * data/yacc.c: Adjust.
657 (yyrline): Use b4_integral_parser_table_define.
658
659 2008-11-26 Akim Demaille <demaille@gostai.com>
660
661 Regen.
662 * src/parse-gram.h, src/parse-gram.c: Regen.
663
664 2008-11-26 Akim Demaille <demaille@gostai.com>
665
666 Factor the generation of the (integral) tables bw yacc.c and lalr1.cc.
667 * data/lalr1.cc (b4_tables_map): Move to...
668 * data/bison.m4: here.
669 Update the comment for yytable during the flight.
670 (b4_tables_declare, b4_tables_define): New.
671 * data/lalr1.cc: Use them.
672 * data/c.m4 (b4_table_define): New.
673 * data/yacc.c: Use b4_tables_define instead of output the tables
674 by hand.
675 * tests/regression.at (Web2c Actions): Adjust the expected output,
676 the order of the tables changed.
677
678 2008-11-26 Akim Demaille <demaille@gostai.com>
679
680 Get rid of (yy)rhs and (yy)prhs.
681 These tables are no longer needed in the parsers, and they don't seem to
682 be useful. They are not documented either.
683
684 * src/output.c (prepare_rules): Get rid of rhs and prhs.
685 Adjust the computation of (yy)r2.
686
687 2008-11-26 Akim Demaille <demaille@gostai.com>
688
689 Rule length is unsigned.
690 * src/gram.h, src/gram.c (rule_rhs_length): Return a size_t.
691
692 2008-11-26 Akim Demaille <demaille@gostai.com>
693
694 Get rid of lalr1-split.cc.
695 It was no longer maintainer.
696
697 * data/lalr1-split.cc: Remove.
698 * etc/bench.pl.in (bench_fusion_parser): Remove.
699 Adjust.
700
701 2008-11-26 Akim Demaille <demaille@gostai.com>
702
703 Use yy* consistently.
704 * data/glr.c: Now that yyrhs no longer exists as a global
705 variable, rename local "rhs" variables into "yyrhs" for
706 consistency.
707
708 2008-11-25 Akim Demaille <demaille@gostai.com>
709
710 Get rid of yyrhs and yyprhs in glr.c.
711 * data/glr.c (yyrhs, yyprhs): Remove.
712 Instead, use the state stack and yystos.
713
714 2008-11-25 Akim Demaille <demaille@gostai.com>
715
716 Flag glr tests.
717 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): If glr, declare it
718 as an Autotest keyword.
719
720 2008-11-25 Akim Demaille <demaille@gostai.com>
721
722 Prefer TESTSUITE_FLAGS.
723 TESTSUITEFLAGS is barely readable.
724
725 * tests/local.mk (TESTSUITE_FLAGS): Default to $(TESTSUITEFLAGS)
726 for backward compatibility.
727 Use the former instead of the latter.
728
729 2008-11-25 Akim Demaille <demaille@gostai.com>
730
731 Get rid of yyrhs and yyprhs in larl1.java.
732 * data/lalr1.java (yyrhs_, yyprhs_): Remove.
733 (yy_reduce_print): Rather, use yystos_ and the state stack.
734
735 2008-11-25 Akim Demaille <demaille@gostai.com>
736
737 Formatting changes.
738
739 2008-11-25 Akim Demaille <demaille@gostai.com>
740
741 Get rid of yyrhs and yyprhs in yacc.c.
742 They were used to get the symbol types, given a rule number, when
743 displaying the top of the stack before a reduction. But the
744 symbol type is available from the state stack. This has two be
745 benefits: two tables less in the parser (making it smaller), and a
746 more consistent use of the three stacks which will help to fuse
747 them.
748
749 * data/yacc.c (yyprhs, yyrhs): Remove.
750 (YY_REDUCE_PRINT): Pass yyssp to yy_reduce_print.
751 (yy_reduce_print): Take yyssp as argument.
752 Use it, together with yystos, to get the symbol type.
753 * tests/regression.at (Web2c Report): Remove these tables from the
754 expected output.
755
756 2008-11-25 Akim Demaille <demaille@gostai.com>
757
758 b4_tables_map.
759 The point is to factor the generation of the tables across skeletons.
760 This is language dependant.
761
762 * data/c.m4 (b4_comment_): New.
763 Should be usable to define how to generate tables independently of
764 the language.
765 (b4_c_comment): New.
766 (b4_comment): Bounce to b4_c_comment.
767 Now support $2 = [PREFIX] for indentation.
768 * data/lalr1.cc (b4_table_declare): Don't output a comment if
769 there is no comment.
770 Indent it properly when there is one.
771 Output the ending semicolon.
772 (b4_table_define): Space changes.
773 Output the ending semicolon.
774 (b4_tables_map): New.
775 Use it twice instead of declaring and defining the (integral)
776 tables by hand.
777
778 2008-11-25 Akim Demaille <demaille@gostai.com>
779
780 b4_table_declare.
781 * data/lalr1.cc (b4_table_declare): New.
782 Use it to declare the tables defined with b4_table_define.
783 (b4_table_define): Declare a third arg to match b4_table_declare
784 signature.
785 Move all the comments around invocations of b4_table_define into
786 the invocations itselves.
787 Move things around to have the order for declarations and
788 definitions.
789
790 2008-11-25 Akim Demaille <demaille@gostai.com>
791
792 Formatting changes.
793 * data/lalr1.java: here.
794
795 2008-11-25 Akim Demaille <demaille@gostai.com>
796
797 b4_args is more general than only C++.
798 * data/lalr1.cc (b4_args, _b4_args): Move to...
799 * data/bison.m4: here.
800
801 2008-11-21 Di-an Jan <dianj@freeshell.org>
802
803 Implement no-XXX arguments for --warnings, --report, --trace.
804 * src/getargs.c (flags_argmatch): Handles no-XXX.
805 Fix typo in doxygen comment.
806
807 2008-11-21 Akim Demaille <demaille@gostai.com>
808
809 Display the changes in cross-options.texi.
810 * build-aux/cross-options.pl ($sep): New, to separate items.
811 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Use diff to display the
812 changes.
813
814 2008-11-20 Di-an Jan <dianj@freeshell.org>
815
816 Improves options in the manual.
817 * doc/bison.texinfo (-g, -x): Add space before argument.
818 (Option Cross Key): Implement FIXME: listing directives also.
819 * build-aux/cross-options.pl: Read from <STDIN> rather than <>.
820 (Short Option): Special case -d. Put arguments inside @option.
821 (Bison Directive): Add column, automatically extracted from
822 src/scan-gram.l (actual name passed as the first argument)
823 with special case for %define.
824 * doc/local.mk (doc/cross-options.texi): Pass src/scan-gram.l
825 to build-aux/cross-options.pl.
826 * src/getargs.c (usage): Document limitations of cross-options.pl.
827 * src/scan-gram.l: Likewise.
828
829 2008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
830
831 Fix unexpanded macros in GLR defines file.
832 Reported by Csaba Raduly at
833 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
834 * THANKS (Csaba Raduly): Add.
835 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
836 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
837 lexer in a separate module that includes the defines file.
838 (AT_CHECK_CALC): From AT_FULL_COMPILE, request compilation of lexer
839 source.
840 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
841 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
842 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
843 (AT_DATA_SOURCE_PROLOGUE): New.
844 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
845 (AT_DATA_SOURCE): New.
846 (AT_FULL_COMPILE): Extend to support an additional source file.
847
848 2008-11-18 Akim Demaille <demaille@gostai.com>
849
850 More TODO.
851 * TODO: More short term issues.
852
853 2008-11-18 Akim Demaille <demaille@gostai.com>
854
855 Regen.
856 * src/parse-gram.h, src/parse-gram.c: Regen.
857
858 2008-11-18 Akim Demaille <demaille@gostai.com>
859
860 Use b4_subtract where possible.
861 * data/lalr1.cc (b4_subtract): Move to...
862 * data/bison.m4: here.
863 * data/glr.c (b4_rhs_data): Use it.
864 * data/yacc.c (b4_rhs_value, b4_rhs_location): Use it.
865
866 2008-11-18 Akim Demaille <demaille@gostai.com>
867
868 Remove incorrect mode specification.
869 * data/glr.cc: Don't pretend it's C code.
870
871 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
872
873 Simplify last patch slightly.
874 * src/getargs.c (getargs): Here.
875
876 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
877
878 Fix last warning from --enable-gcc-warnings.
879 * src/getargs.c (getargs): Don't assign const address to non-const
880 pointer.
881
882 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
883
884 Don't let maintainer-*-check targets force a version update.
885 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
886 handled.
887
888 2008-11-17 Di-an Jan <dianj@freeshell.org>
889
890 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
891 Align menus. Adjust word wrapping. Use node names for menu names.
892 (Examples): Don't abbreviate node names.
893 (LocalWords): Remove abbreviations.
894 (Copying): Make description a sentence.
895 (Java Action Features): Remove period to match the rest of menu.
896
897 2008-11-17 Di-an Jan <dianj@freeshell.org>
898
899 Handles several --enable-gcc-warnings.
900 * src/getargs.c (command_line_location): Set parameters to void.
901 * src/output.c (symbol_type_name_cmp): Make static.
902 (symbols_by_type_name): Set parameters to void.
903 (symbol_definitions_output): Remove unused parameter. Rename as...
904 (prepare_symbol_definitions): this.
905 (muscles_output): Move symbol_definitions_output to...
906 (output): here as prepare_symbol_definitions.
907 * tests/c++.at (AT_CHECK_VARIANTS): Remove unused parameters of main.
908 (AT_CHECK_NAMESPACE): Make unused parameter lloc unnamed.
909
910 2008-11-17 Di-an Jan <dianj@freeshell.org>
911
912 * tests/c++.at (AT_CHECK_VARIANTS): Fixes tests 198-202.
913 Use AT_DATA_GRAMMAR instead of AT_DATA for compiled tests.
914
915 2008-11-16 Akim Demaille <demaille@gostai.com>
916
917 Add missing $(EXEEXT).
918 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): The target is
919 "src/bison$(EXEEXT)".
920 Reported by Di-an Jan.
921
922 2008-11-15 Akim Demaille <demaille@gostai.com>
923
924 * TODO: Update.
925
926 2008-11-15 Akim Demaille <demaille@gostai.com>
927
928 Formatting changes.
929 * tests/input.at: here.
930
931 2008-11-15 Akim Demaille <demaille@gostai.com>
932
933 Remove duplicate header inclusion.
934 * src/LR0.c: here.
935
936 2008-11-15 Akim Demaille <demaille@gostai.com>
937
938 * src/parse-gram.h, src/parse-gram.c: Regen.
939
940 2008-11-15 Akim Demaille <demaille@gostai.com>
941
942 Support parametric types.
943
944 There are two issues to handle: first scanning nested angle
945 bracket pairs to support types such as std::pair< std::string,
946 std::list<std::string> > >.
947
948 Another issue is to address idiosyncracies of C++: do not glue two
949 closing angle brackets together (otherwise it's operator>>), and
950 avoid sticking blindly a TYPE to the opening <, as it can result
951 in '<:' which is a digraph for '['.
952
953 * src/scan-gram.l (brace_level): Rename as...
954 (nesting): this.
955 (SC_TAG): New.
956 Implement support for complex tags.
957 (tag): Accept
958 , but not <.
959 * data/lalr1.cc (b4_symbol_value, b4_symbol_value_template)
960 (b4_symbol_variant): Leave space around types as parameters.
961 * examples/variant.yy: Use nested template types and leading ::.
962 * src/parse-gram.y (TYPE, TYPE_TAG_ANY, TYPE_TAG_NONE, type.opt):
963 Rename as...
964 (TAG, TAG_ANY, TAG_NONE, tag.opt): these.
965 * tests/c++.at: Test parametric types.
966
967 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
968
969 Test token.prefix.
970 This is not sufficient, but we test at least that the make_SYMBOL
971 interface is not affected by token.prefix. A more general test
972 will be implemented when the support of token.prefix is generalized
973 to more skeletons.
974
975 * tests/c++.at: One more variant test, using token.prefix.
976
977 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
978
979 Test the make_TOKEN interface.
980 * tests/c++.at (AT_CHECK_VARIANTS): Require and use locations.
981 Factor the common code in yylex.
982 Use it to test "%define lex_symbol".
983
984 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
985
986 Formatting change.
987
988 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
989
990 Simplify code for variants bench marks.
991 * etc/bench.pl.in (&generate_grammar_list): Define and use
992 location_type.
993 Factor the common code in yylex.
994
995 2008-11-15 Akim Demaille <demaille@gostai.com>
996
997 Better error message.
998 * bootstrap (find_tool): Fix the error message.
999
1000 2008-11-15 Akim Demaille <demaille@gostai.com>
1001
1002 Update variant.yy to newest interface.
1003 * examples/variant.yy: Define lex_symbol.
1004 Adjust.
1005
1006 2008-11-15 Akim Demaille <demaille@gostai.com>
1007
1008 Don't use locations in variant.yy.
1009 * examples/variant.yy: Adjust to not using locations.
1010
1011 2008-11-15 Akim Demaille <demaille@gostai.com>
1012
1013 Comment changes.
1014 * data/local.mk, etc/local.mk, examples/local.mk: Use Automake
1015 comments for the license.
1016
1017 2008-11-15 Akim Demaille <demaille@gostai.com>
1018
1019 Remove tests/Makefile.am.
1020 * tests/Makefile.am: Rename as...
1021 * tests/local.mk: this.
1022 * Makefile.am, configure.ac: Adjust.
1023 * Makefile.am (DISTCLEANFILES): Define.
1024 (maintainer-check, maintainer-xml-check, maintainer-push-check):
1025 Remove, we no longer need to bounce to the real targets.
1026
1027 2008-11-15 Akim Demaille <demaille@gostai.com>
1028
1029 Comment changes.
1030
1031 2008-11-15 Akim Demaille <demaille@gostai.com>
1032
1033 djgpp/local.mk.
1034 * Makefile.am (EXTRA_DIST): Move djgpp related part to...
1035 * djgpp/local.mk: this new file.
1036
1037 2008-11-15 Akim Demaille <demaille@gostai.com>
1038
1039 Remove doc/Makefile.am.
1040 * doc/Makefile.am: Rename as...
1041 * doc/local.mk: this.
1042 Adjust paths
1043 * Makefile.am, configure.ac: Adjust.
1044 * Makefile.am (MOSTLYCLEANFILES): New.
1045 * src/local.mk: Adjust.
1046
1047 2008-11-15 Akim Demaille <demaille@gostai.com>
1048
1049 Move sc_tight_scope into maint.mk.
1050 It does not work, and I don't know how it was supposed to work: it
1051 seems to be looking for sources in the build tree. I just moved
1052 it at a better place, fixing it is still required.
1053
1054 * src/local.mk (echo): Remove.
1055 (sc_tight_scope): Move to...
1056 * maint.mk: here.
1057
1058 2008-11-15 Akim Demaille <demaille@gostai.com>
1059
1060 Regen.
1061 * src/parse-gram.h, src/parse-gram.h: Regen.
1062
1063 2008-11-15 Akim Demaille <demaille@gostai.com>
1064
1065 Remove src/Makefile.am.
1066 * src/Makefile.am: Rename as...
1067 * src/local.mk: this.
1068 Prefix all the paths with src/.
1069 (AUTOMAKE_OPTIONS): Build object files in the sub dirs.
1070 (AM_CPPFLAGS): Find find in builddir/src.
1071 (YACC): Move the flags into...
1072 (AM_YFLAGS): here.
1073 * maint.mk (sc_tight_scope): Disable.
1074 It used to bounce to the version in src/Makefile.am which is now
1075 part of this very Makefile.
1076 * Makefile.am, configure.ac: Adjust.
1077 * src/scan-code-c.c, src/scan-code.l: We can no longer rely on
1078 include "..." to find files "here": we are no longer in src/, so
1079 qualify the includes with src/.
1080 * doc/Makefile.am (PREPATH): No longer include the top_builddir
1081 prefix.
1082 (.x.1): Adjust to be able to create src/foo from the top level
1083 Makefile, instead of going bounce to src/Makefile the creation of
1084 foo.
1085
1086 2008-11-15 Akim Demaille <demaille@gostai.com>
1087
1088 Remove useless variable.
1089 * doc/Makefile.am (srcsrcdir): Remove.
1090
1091 2008-11-15 Akim Demaille <demaille@gostai.com>
1092
1093 Remove data/Makefile.am.
1094 * data/Makefile.am: Rename as...
1095 * data/local.mk: this.
1096 Adjust paths.
1097 * Makefile.am, configure.ac: Adjust.
1098
1099 2008-11-15 Akim Demaille <demaille@gostai.com>
1100
1101 Remove etc/Makefile.am.
1102 * etc/Makefile.am: Rename as...
1103 * etc/local.mk: this.
1104 Adjust.
1105 * Makefile.am, configure.ac: Adjust.
1106
1107 2008-11-15 Akim Demaille <demaille@gostai.com>
1108
1109 Remove examples/local.mk.
1110 examples/calc++/Makefile.am might be interesting to keep as is, since
1111 it is an example in itself.
1112
1113 * examples/Makefile.am: Rename as...
1114 * examples/local.mk: this.
1115 Adjust.
1116 * Makefile.am, configure.ac: Adjust.
1117
1118 2008-11-15 Akim Demaille <demaille@gostai.com>
1119
1120 Remove build-aux/Makefile.am.
1121 Recursive Makefiles are really way too slow, let's get rid of some of
1122 them.
1123
1124 * build-aux/Makefile.am: Rename as...
1125 * build-aux/local.mk: this.
1126 Adjust paths.
1127 * Makefile.am, configure.ac: Adjust.
1128
1129 2008-11-15 Akim Demaille <demaille@gostai.com>
1130
1131 Provide convenience constructors for locations and positions.
1132 * data/location.cc (position::position): Accept file, line and
1133 column as arguments with default values.
1134 Always qualify initial line and column literals as unsigned.
1135 (location::location): Provide convenience constructors.
1136
1137 2008-11-15 Akim Demaille <demaille@gostai.com>
1138
1139 Instead of using make_symbol<TOK_FOO>, generate make_FOO for each
1140 token type.
1141 Using template buys us nothing, and makes it uselessly complex to
1142 construct a symbol. Besides, it could not be generalized to other
1143 languages, while make_FOO would work in C/Java etc.
1144
1145 * data/lalr1.cc (b4_symbol_): New.
1146 (b4_symbol): Use it.
1147 (b4_symbol_constructor_declaration_)
1148 (b4_symbol_constructor_definition_): Instead of generating
1149 specializations of an overloaded template function, just generate
1150 several functions whose names are forged from the token names
1151 without the token.prefix.
1152 (b4_symbol_constructor_declarations): Generate them for all the
1153 symbols, not just by class of symbol type, now that instead of
1154 specializing a function template by the token, we generate a
1155 function named after the token.
1156 (b4_symbol_constructor_specialization_)
1157 (b4_symbol_constructor_specializations): Remove.
1158 * etc/bench.pl.in: Adjust to this new API.
1159
1160 2008-11-13 Akim Demaille <demaille@gostai.com>
1161
1162 %define token.prefix.
1163 Provide a means to add a prefix to the name of the tokens as
1164 output in the generated files. Because of name clashes, it is
1165 good to have such a prefix such as TOK_ that protects from names
1166 such as EOF, FILE etc. But it clutters the grammar itself.
1167
1168 * data/bison.m4 (token.prefix): Empty by default.
1169 * data/c.m4 (b4_token_enum, b4_token_define): Use it.
1170 * data/lalr1.cc (b4_symbol): Ditto.
1171
1172 2008-11-13 Akim Demaille <demaille@gostai.com>
1173
1174 Compute at M4 time some of the subtractions.
1175 * data/lalr1.cc (b4_subtract): New.
1176 (b4_rhs_data): Use it.
1177
1178 2008-11-13 Akim Demaille <demaille@gostai.com>
1179
1180 symbol::token.
1181 This allows the user to get the type of a token returned by yylex.
1182
1183 * data/lalr1.cc (symbol::token): New.
1184 (yytoknum_): Define when %define lex_symbol, independently of
1185 %debug.
1186 (yytoken_number_): Move into...
1187 (symbol::token): here, since that's the only use.
1188 The other one is YYPRINT which was not officially supported
1189 by lalr1.cc, and anyway it did not work since YYPRINT uses this
1190 array under a different name (yytoknum).
1191
1192 2008-11-13 Akim Demaille <demaille@gostai.com>
1193
1194 YYERRCODE.
1195 * TODO (YYERRCODE): Mention the case of $undef.
1196
1197 2008-11-13 Akim Demaille <demaille@gostai.com>
1198
1199 TODO: YYPRINT.
1200 * TODO (YYPRINT): New.
1201
1202 2008-11-13 Akim Demaille <demaille@gostai.com>
1203
1204 Comment changes.
1205 * data/lalr1.cc, data/yacc.c: Fix the description of the
1206 yytranslate and yytoknum tables.
1207
1208 2008-11-13 Akim Demaille <demaille@gostai.com>
1209
1210 Define make_symbol in the header.
1211 To reach good performances these functions should be inlined (yet
1212 this is to measure precisely). To this end they must be available
1213 to the caller.
1214
1215 * data/lalr1.cc (b4_symbol_constructor_definition_): Qualify
1216 location_type with the class name.
1217 Since will now be output in the header, declare "inline".
1218 No longer use b4_symbol_constructor_specializations, but
1219 b4_symbol_constructor_definitions in the header.
1220 Don't call it in the *.cc file.
1221
1222 2008-11-13 Akim Demaille <demaille@gostai.com>
1223
1224 Define yytranslate in the header for lex_symbol.
1225 * data/lalr1.cc: Move the invocation of b4_yytranslate_definition
1226 into the header file when using %define lex_symbol.
1227 (yytranslate_): Declare inline.
1228
1229 2008-11-13 Akim Demaille <demaille@gostai.com>
1230
1231 Define the constructors of symbol_type in
1232 b4_symbol_constructor_definitions.
1233 The constructors are called by the make_symbol functions, which a
1234 forthcoming patch will move elsewhere. Hence the interest of
1235 putting them together.
1236
1237 The stack_symbol_type does not need to be moved, it is used only
1238 by the parser.
1239
1240 * data/lalr1.cc: Move symbol_type and symbol_base_type
1241 constructors into...
1242 (b4_symbol_constructor_definitions): here.
1243 Adjust.
1244
1245 2008-11-13 Akim Demaille <demaille@gostai.com>
1246
1247 Make it easier to move the definition of yytranslate_.
1248 Forthcoming changes will make it possible to use yytranslate_
1249 from outside the parser implementation file.
1250
1251 * data/lalr1.cc (b4_yytranslate_definition): New.
1252 Use it.
1253
1254 2008-11-13 Akim Demaille <demaille@gostai.com>
1255
1256 Remove useless class specification.
1257 * data/lalr1.cc (b4_symbol_constructor_specialization_): No need
1258 to refer to the class name to use a type defined by the class for
1259 arguments of member functions.
1260
1261 2008-11-13 Akim Demaille <demaille@gostai.com>
1262
1263 Finer input type for yytranslate.
1264 This patch is debatable: the tradition expects yylex to return an int
1265 which happens to correspond to token_number (which is an enum). This
1266 allows for instance to return characters (such as '*' etc.). But this
1267 goes against the stronger typing I am trying to have with the new
1268 lex interface which return a symbol_type. So in this case, feed
1269 yytranslate_ with a token_type.
1270
1271 * data/lalr1.cc (yytranslate_): When in %define lex-symbol,
1272 expect a token_type.
1273
1274 2008-11-13 Akim Demaille <demaille@gostai.com>
1275
1276 Honor lex-params in %define lex_symbol mode.
1277 * data/lalr1.cc: Use b4_lex_param.
1278
1279 2008-11-13 Akim Demaille <demaille@gostai.com>
1280
1281 Simplify names.
1282 * src/output.c (symbol_definitions_output): Rename symbol
1283 attributes type_name and has_type_name as type and has_type.
1284 * data/lalr1.cc: Adjust uses.
1285
1286 2008-11-13 Akim Demaille <demaille@gostai.com>
1287
1288 Use b4_type_names for the union type.
1289 The union used to compute the size of the variant used to iterate
1290 over the type of all the symbols, with a lot of redundancy. Now
1291 iterate over the lists of symbols having the same type-name.
1292
1293 * data/lalr1.cc (b4_char_sizeof_): New.
1294 (b4_char_sizeof): Use it.
1295 Adjust to be called with a list of numbers instead of a single
1296 number.
1297 Adjust its caller for new-line issues.
1298
1299 2008-11-13 Akim Demaille <demaille@gostai.com>
1300
1301 Define the "identifier" of a symbol.
1302 Symbols may have several string representations, for instance if
1303 they have an alias. What I call its "id" is a string that can be
1304 used as an identifier. May not exist.
1305
1306 Currently the symbols which have the "tag_is_id" flag set are
1307 those that don't have an alias. Look harder for the id.
1308
1309 * src/output.c (is_identifier): Move to...
1310 * src/symtab.c (is_identifier): here.
1311 * src/symtab.h, src/symtab.c (symbol_id_get): New.
1312 * src/output.c (symbol_definitions_output): Use it to define "id"
1313 and "has_id".
1314 Remove the definition of "tag_is_id".
1315 * data/lalr1.cc: Use the "id" and "has_id" whereever "tag" and
1316 "tag_is_id" were used to produce code.
1317 We still use "tag" for documentation.
1318
1319 2008-11-11 Akim Demaille <demaille@gostai.com>
1320
1321 Locations are no longer required by lalr1.cc.
1322 * data/lalr1.cc (_b4_args, b4_args): New.
1323 Adjust all uses of locations to make them optional.
1324 * tests/c++.at (AT_CHECK_VARIANTS): No longer use the locations.
1325 (AT_CHECK_NAMESPACE): Check the use of locations.
1326 * tests/calc.at (_AT_DATA_CALC_Y): Adjust to be usable with or
1327 without locations with lalr1.cc.
1328 Test these cases.
1329 * tests/output.at: Check lalr1.cc with and without location
1330 support.
1331 * tests/regression.at (_AT_DATA_EXPECT2_Y, _AT_DATA_DANCER_Y):
1332 Don't use locations.
1333
1334 2008-11-11 Akim Demaille <demaille@gostai.com>
1335
1336 AT_FULL_COMPILE.
1337 * tests/local.at (AT_FULL_COMPILE): New.
1338 * tests/actions.at, tests/calc.at, tests/regression.at: Use it.
1339
1340 2008-11-11 Akim Demaille <demaille@gostai.com>
1341
1342 Support parens in calc++.
1343 * doc/bison.texinfo (Calc++ Scanner, Calc++ Parser): Support parens.
1344 * examples/calc++/test (run): Check the expected output.
1345 Adjust callers.
1346 Check parens too.
1347
1348 2008-11-11 Akim Demaille <demaille@gostai.com>
1349
1350 Simplify lalr1.cc since %defines is mandatory.
1351 * data/lalr1.cc: Remove useless calls to b4_defines_if.
1352
1353 2008-11-11 Akim Demaille <demaille@gostai.com>
1354
1355 TODO: yyfmt.
1356 * TODO (yysyntax_error): New item.
1357
1358 2008-11-11 Akim Demaille <demaille@gostai.com>
1359
1360 Prefer M4 to CPP.
1361 * data/lalr1.cc: Use b4_error_verbose_if instead of #if
1362 YYERROR_VERBOSE.
1363
1364 2008-11-11 Akim Demaille <demaille@gostai.com>
1365
1366 Support i18n of the parse error messages.
1367 * TODO (lalr1.cc/I18n): Remove.
1368 * data/lalr1.cc (yysyntax_error_): Support the translation of the
1369 error messages, as done in yacc.c.
1370 Stay within the yy* pseudo namespace.
1371
1372 2008-11-11 Akim Demaille <demaille@gostai.com>
1373
1374 More TODO.
1375 * TODO (single stack, yysyntax_error): New.
1376
1377 2008-11-11 Akim Demaille <demaille@gostai.com>
1378
1379 Make it possible to return a symbol_type from yylex.
1380 * data/lalr1.cc (b4_lex_symbol_if): New.
1381 (parse): When lex_symbol is defined, expected yylex to return the
1382 complete lookahead.
1383 * etc/bench.pl.in (generate_grammar_list): Extend to support this
1384 yylex interface.
1385 (bench_variant_parser): Exercise it.
1386
1387 2008-11-11 Akim Demaille <demaille@gostai.com>
1388
1389 Remove useless bench case.
1390 * etc/bench.pl.in (bench_variant_parser): VARIANT_DESTROY is
1391 no longer used.
1392
1393 2008-11-11 Akim Demaille <demaille@gostai.com>
1394
1395 Improve display of directives.
1396 * etc/bench.pl.in (parse_term): Don't add useless eol.
1397
1398 2008-11-11 Akim Demaille <demaille@gostai.com>
1399
1400 Use string_cast in the bench.
1401 * etc/bench.pl.in (generate_grammar_list): Define and use
1402 string_cast.
1403
1404 2008-11-11 Akim Demaille <demaille@gostai.com>
1405
1406 Replace yychar with a Boolean.
1407 * data/lalr1.cc (parse::yychar): Replace by...
1408 (parse::yyempty): this.
1409
1410 2008-11-11 Akim Demaille <demaille@gostai.com>
1411
1412 Factor the tables.
1413 * TODO: New item.
1414
1415 2008-11-11 Akim Demaille <demaille@gostai.com>
1416
1417 Let yytranslate handle the eof case.
1418 * data/lalr1.cc (yytranslate_): Handle the EOF case.
1419 Adjust callers.
1420 No longer expect yychar to be equal to yyeof_, rather, test the
1421 lookahead's (translated) kind.
1422
1423 2008-11-11 Akim Demaille <demaille@gostai.com>
1424
1425 yychar cannot be empty in yyerrlab.
1426 * TODO (yychar == yyempty_): New.
1427 * data/lalr1.cc: Remove the handling of this case.
1428 This eases forthcoming changes related to yychar and yytranslate.
1429
1430 2008-11-11 Akim Demaille <demaille@gostai.com>
1431
1432 Bench: syntactic sugar for %define/#define.
1433 * etc/bench.pl.in (parse_dirs): Support %d and #d with arguments.
1434 (&bench_push_parser, bench_variant_parser): Use this feature.
1435 (&eat): New.
1436 Use it.
1437
1438 2008-11-11 Akim Demaille <demaille@gostai.com>
1439
1440 Less memory pressure on the "list" bench.
1441 * etc/bench.pl.in (generate_grammar_list): Do not accumulate all
1442 the values, to limit memory pressure.
1443
1444 2008-11-11 Akim Demaille <demaille@gostai.com>
1445
1446 Introduce make_symbol.
1447 make_symbol provides a means to construct a full symbol (kind,
1448 value, location) in a single shot. It is meant to be a Symbol
1449 constructor, parameterized by the symbol kind so that overloading
1450 would prevent incorrect kind/value pairs. Unfortunately
1451 parameterized constructors do not work well in C++ (unless the
1452 parameter also appears as an argument, which is not acceptable),
1453 hence the use of a function instead of a constructor.
1454
1455 * data/lalr1.cc (b4_symbol_constructor_declaration_)
1456 (b4_symbol_constructor_declarations)
1457 (b4_symbol_constructor_specialization_)
1458 (b4_symbol_constructor_specializations)
1459 (b4_symbol_constructor_definition_)
1460 (b4_symbol_constructor_definitions): New.
1461 Use them where appropriate to generate declaration, declaration of
1462 the specializations, and implementations of the templated
1463 overloaded function "make_symbol".
1464 (variant::variant): Always define a default ctor.
1465 Also provide a copy ctor.
1466 (symbol_base_type, symbol_type): New ctor overloads for value-less
1467 symbols.
1468 (symbol_type): Now public, so that functions such as yylex can use
1469 it.
1470
1471 2008-11-11 Akim Demaille <demaille@gostai.com>
1472
1473 Inform m4 whether a tag is a valid id.
1474 * src/output.c (is_identifier): New.
1475 (symbol_definitions_output): Use it to define tag_is_id.
1476 But maybe this should be done at m4 level?
1477
1478 2008-11-11 Akim Demaille <demaille@gostai.com>
1479
1480 Test 214 was failing: it greps with a pattern containing [ ]*
1481 which obviously meant to catch spaces and tabs, but contained only
1482 spaces. Tabulations in sources are a nuisance, so to simplify the
1483 matter, get rid of all the tabulations in the Java sources. The
1484 other skeletons will be treated equally later.
1485
1486 * data/java.m4, data/lalr1.java: Untabify.
1487 * tests/java.at: Simplify AT_CHECK_JAVA_GREP invocations:
1488 tabulations are no longer generated.
1489
1490 2008-11-11 Paolo Bonzini <bonzini@gnu.org>
1491
1492 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
1493 * configure.ac: Adjust usage.
1494 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
1495 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
1496 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
1497
1498 2008-11-10 Di-an Jan <dianj@freeshell.org>
1499
1500 Workaround Java's ``code too large'' problem for parser tables
1501 in most cases, by using one function per initialization.
1502 * data/java.m4 (b4_typed_parser_table, b4_integral_parser_table): New.
1503 * data/lalr1.java (yypact_, yydefact_, yypgoto_, yydefgoto_,
1504 yytable_, yycheck_, yystos_, yytoken_number_, yyr1_, yyr2_, yyrhs_
1505 yyprhs_, yyrline_, yytranslate_table_): Use b4_integral_parser_table.
1506 (yytname_): Use b4_typed_parser_table.
1507 * doc/bison.texinfo (Java Bison Interface): Add note on Java's
1508 ``code too large'' error.
1509
1510 2008-11-10 Di-an Jan <dianj@freeshell.org>
1511
1512 * NEWS: Document them.
1513
1514 General Java skeleton improvements.
1515 * configure.ac (gt_JAVACOMP): Request target of 1.4, which allows
1516 using gcj < 4.3 in the testsuite, according to comments in
1517 gnulib/m4/javacomp.m4.
1518 * data/java.m4 (stype, parser_class_name, lex_throws, throws,
1519 location_type, position_type): Remove extraneous brackets from
1520 b4_percent_define_default.
1521 (b4_lex_param, b4_parse_param): Remove extraneous brackets from
1522 m4_define and m4_define_default.
1523 * data/lalr1.java (b4_pre_prologue): Change to b4_user_post_prologue,
1524 which marks the end of user code with appropriate syncline, like all
1525 the other skeletons.
1526 (b4_user_post_prologue): Add. Don't silently drop.
1527 (yylex): Remove.
1528 (parse): Inline yylex.
1529 * doc/bison.texinfo (bisonVersion, bisonSkeleton): Document.
1530 (%{...%}): Fix typo of %code imports.
1531 * tests/java.at (AT_JAVA_COMPILE): Add "java" keyword.
1532
1533 Support annotations on parser class with %define annotations.
1534 * data/lalr1.java (annotations): Add to parser class modifier.
1535 * doc/bison.texinfo (Java Parser Interface): Document
1536 %define annotations.
1537 (Java Declarations Summary): Document %define annotations.
1538 * tests/java.at (Java parser class modifiers): Test annotations.
1539
1540 Do not generate code for %error-verbose unless requested.
1541 * data/lalr1.java (errorVerbose): Rename to yyErrorVerbose.
1542 Make private. Make conditional on %error-verbose.
1543 (getErrorVerbose, setErrorVerbose): New.
1544 (yytnamerr_): Make conditional on %error-verbose.
1545 (yysyntax_error): Make some code conditional on %error-verbose.
1546 * doc/bison.texinfo (Java Bison Interface): Remove the parts
1547 about %error-verbose having no effect.
1548 (getErrorVerbose, setErrorVerbose): Document.
1549
1550 Move constants for token names to Lexer interface.
1551 * data/lalr1.java (Lexer): Move EOF, b4_token_enums(b4_tokens) here.
1552 * data/java.m4 (b4_token_enum): Indent for move to Lexer interface.
1553 (parse): Qualify EOF to Lexer.EOF.
1554 * doc/bison.texinfo (Java Parser Interface): Move documentation of
1555 EOF and token names to Java Lexer Interface.
1556 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove Calc qualifier.
1557
1558 Make yyerror public.
1559 * data/lalr1.java (Lexer.yyerror): Use longer parameter name.
1560 (yyerror): Change to public. Add Javadoc comments. Use longer
1561 parameter names. Make the body rather than the declarator
1562 conditional on %locations.
1563 * doc/bison.texinfo (yyerror): Document. Don't mark as protected.
1564
1565 Allow user to add code to the constructor with %code init.
1566 * data/java.m4 (b4_init_throws): New, for %define init_throws.
1567 * data/lalr1.java (YYParser.YYParser): Add b4_init_throws.
1568 Add %code init to the front of the constructor body.
1569 * doc/bison.texinfo (YYParser.YYParser): Document %code init
1570 and %define init_throws.
1571 (Java Declarations Summary): Document %code init and
1572 %define init_throws.
1573 * tests/java.at (Java %parse-param and %lex-param): Adjust grep.
1574 (Java constructor init and init_throws): Add tests.
1575
1576 2008-11-10 Akim Demaille <demaille@gostai.com>
1577
1578 Update TODO.
1579 * TODO (-D): is implemented.
1580 (associativity): Same precedence must have the same associativity.
1581 For instance, how can a * b / c be parsed if * is %left and / is
1582 %right?
1583 (YYERRORCODE, YYFAIL, YYBACKUP): New.
1584
1585 2008-11-10 Akim Demaille <demaille@gostai.com>
1586
1587 Formatting changes.
1588
1589 2008-11-10 Akim Demaille <demaille@gostai.com>
1590
1591 More information about the symbols.
1592 * src/output.c (type_names_output): Document all the symbols,
1593 including those that don't have a type-name.
1594 (symbol_definitions_output): Define "is_token" and
1595 "has_type_name".
1596 * data/lalr1.cc (b4_type_action_): Skip symbols that have an empty
1597 type-name, now that they are defined too in b4_type_names.
1598
1599 2008-11-10 Akim Demaille <demaille@gostai.com>
1600
1601 Regen.
1602
1603 2008-11-10 Akim Demaille <demaille@gostai.com>
1604
1605 Make parser::yytranslate static.
1606 Small speedup (1%) on the list grammar. And makes yytranslate_
1607 available in non member functions.
1608
1609 * data/lalr1.cc (yytranslate_): Does not need to be a instance
1610 function.
1611
1612 2008-11-10 Akim Demaille <demaille@gostai.com>
1613
1614 Avoid trailing spaces.
1615 * data/c.m4: b4_comment(TEXT): Don't indent empty lines.
1616 * data/lalr1.cc: Don't indent before rule and symbol actions, as
1617 they can be empty, and anyway this incorrectly indents the first
1618 action.
1619
1620 2008-11-10 Akim Demaille <demaille@gostai.com>
1621
1622 Comment changes.
1623
1624 2008-11-10 Akim Demaille <demaille@gostai.com>
1625
1626 Use "enum" for integral constants.
1627 This is just nicer to read, I observed no speedup.
1628
1629 * data/lalr1.cc (yyeof_, yylast_, yynnts_, yyempty_, yyfinal_)
1630 (yterror_, yyerrcode_, yyntokens_): Define as members of an enum.
1631 (yyuser_token_number_max_, yyundef_token_): Move into...
1632 (yytranslate_): here.
1633
1634 2008-11-10 Akim Demaille <demaille@gostai.com>
1635
1636 Shortcuts in bench directives.
1637 * etc/bench.pl.in (parse_dirs): New.
1638 Use it.
1639 (bench_variant_parser, bench_fusion_parser): Use %s and %d.
1640 Create the benches in "benches/".
1641
1642 2008-11-10 Akim Demaille <demaille@gostai.com>
1643
1644 Formatting changes.
1645 * data/lalr1.cc: here.
1646
1647 2008-11-10 Akim Demaille <demaille@gostai.com>
1648
1649 Adjust verbose message to using emacs.
1650 * etc/bench.pl.in: Inform compilation-mode when we change the
1651 directory.
1652 (generate_grammar_list): Recognize %define "variant" in addition
1653 to %define variant.
1654
1655 2008-11-10 Akim Demaille <demaille@gostai.com>
1656
1657 Classify symbols by type-name.
1658 * src/uniqstr.h (UNIQSTR_CMP): New.
1659 * src/output.c (symbol_type_name_cmp, symbols_by_type_name)
1660 (type_names_output): New.
1661 (muscles_output): Use it.
1662 * data/lalr1.cc (b4_symbol_action_): Remove.
1663 (b4_symbol_case_, b4_type_action_): New.
1664 Adjust uses of b4_symbol_action_ to use b4_type_action_.
1665
1666 2008-11-10 Akim Demaille <demaille@gostai.com>
1667
1668 Change the handling of the symbols in the skeletons.
1669 Before we were using tables which lines were the symbols and which
1670 columns were things like number, tag, type-name etc. It is was
1671 difficult to extend: each time a column was added, all the numbers had
1672 to be updated (you asked for colon $2, not for "tag"). Also, it was
1673 hard to filter these tables when only a subset of the symbols (say the
1674 tokens, or the nterms, or the tokens that have and external number
1675 *and* a type-name) was of interest.
1676
1677 Now instead of monolithic tables, we define one macro per cell. For
1678 instance "b4_symbol(0, tag)" is a macro name which contents is
1679 self-decriptive. The macro "b4_symbol" provides easier access to
1680 these cells.
1681
1682 * src/output.c (type_names_output): Remove.
1683 (symbol_numbers_output, symbol_definitions_output): New.
1684 (muscles_output): Call them.
1685 (prepare_symbols): Define b4_symbols_number.
1686
1687 2008-11-10 Akim Demaille <demaille@gostai.com>
1688
1689 --trace=muscles
1690 * src/getargs.h, src/getargs.c (trace_muscle): New.
1691 (trace_types, trace_args): Support it.
1692 * src/output.c (output_skeleton): Use it.
1693
1694 2008-11-10 Akim Demaille <demaille@gostai.com>
1695
1696 muscles_output.
1697 * src/output.c (muscles_output): New, extracted from...
1698 (output_skeleton): here.
1699 Adjust.
1700
1701 2008-11-10 Akim Demaille <demaille@gostai.com>
1702
1703 Formatting changes.
1704
1705 2008-11-10 Akim Demaille <demaille@gostai.com>
1706
1707 Update the variant example.
1708 * examples/variant.yy: Formatting changes.
1709 One stage build.
1710
1711 2008-11-10 Akim Demaille <demaille@gostai.com>
1712
1713 Support constructor with an argument.
1714 This improves the "list" bench by 2%.
1715
1716 * data/lalr1.cc (variant::build): Add an overloaded version with
1717 an argument.
1718 * tests/c++.at (AT_CHECK_VARIANT): Check it.
1719
1720 2008-11-10 Akim Demaille <demaille@gostai.com>
1721
1722 Test variants.
1723 * tests/c++.at (AT_CHECK_VARIANTS): New.
1724 Use it with and without %define assert.
1725
1726 2008-11-10 Akim Demaille <demaille@gostai.com>
1727
1728 Add %precedence support.
1729 Unfortunately it is not possible to reuse the %prec directive. This
1730 is because to please POSIX, we do not require to end the rules with a
1731 semicolon. As a result,
1732
1733 foo: bar %prec baz
1734
1735 is ambiguous: either a rule which precedence is that of baz, or a rule,
1736 and then a declaration of the precedence of the token baz.
1737
1738 * doc/bison.texinfo: Document %precedence.
1739 (Precedence Only): New.
1740 * src/assoc.h, src/assoc.c (precedence_assoc): New.
1741 * src/conflicts.c (resolve_sr_conflict): Support it.
1742 * src/scan-gram.l, src/parse-gram.y (%precedence): New token.
1743 Parse it.
1744 * tests/calc.at: Use %precedence for NEG.
1745 * tests/conflicts.at (%precedence does not suffice)
1746 (%precedence suffices): New tests.
1747
1748 2008-11-09 Akim Demaille <demaille@gostai.com>
1749
1750 Make benches in a sub dirs.
1751 * etc/bench.pl.in ($dir): New.
1752 Use it.
1753 Check the use of constructors with an argument.
1754 (bench_variant_parser): Fix.
1755
1756 2008-11-09 Akim Demaille <demaille@gostai.com>
1757
1758 fix eof condition
1759
1760 2008-11-09 Akim Demaille <demaille@gostai.com>
1761
1762 Fix --help.
1763
1764 2008-11-09 Akim Demaille <demaille@gostai.com>
1765
1766 Require the generation of parse-gram.output.
1767 * src/Makefile.am (YACC): Pass --report=all.
1768
1769 2008-11-09 Akim Demaille <demaille@gostai.com>
1770
1771 Formatting changes.
1772
1773 2008-11-09 Akim Demaille <demaille@gostai.com>
1774
1775 Update TODO.
1776 * TODO: Remove obsolete items.
1777 Update others.
1778
1779 2008-11-09 Akim Demaille <demaille@gostai.com>
1780
1781 Enhance bench.pl.
1782 * etc/bench.pl.in (parse, parse_expr, parse_term, parse_fact)
1783 (@token, $grammar, $bench): New.
1784 (generate_grammar_variant): Rename as...
1785 (generate_grammar_list): this.
1786 (generate_grammar): Adjust.
1787 (bench_grammar): Rename as...
1788 (bench): this.
1789 Use it in the various bench-marking routines.
1790 (-b, -g): New options.
1791
1792 2008-11-09 Akim Demaille <demaille@gostai.com>
1793
1794 Use a static hierarchy for symbols in the C++ parser.
1795 * data/lalr1.cc (symbol_base_type, symbol_type)
1796 (stack_symbol_type): Make it a static hierarchy.
1797 Adjust dependencies.
1798
1799 2008-11-09 Akim Demaille <demaille@gostai.com>
1800
1801 bench.pl -d, --directive.
1802 * etc/bench.pl.in (@directive): New.
1803 (&bench_grammar): Use it.
1804 (&bench_list_grammar): New, to provide access to the "variant"
1805 grammar.
1806 Use it.
1807 (getopts): Support -d, --directive.
1808
1809 2008-11-09 Akim Demaille <demaille@gostai.com>
1810
1811 Use inline for small operations.
1812 * data/lalr1.cc (symbol_base_type, symbol_type)
1813 (stack_symbol_type): Declare constructor and other operations as
1814 inline.
1815 (yy_destroy_): Inline.
1816
1817 2008-11-09 Akim Demaille <demaille@gostai.com>
1818
1819 Introduce a hierarchy for symbols.
1820 * data/lalr1.cc (symbol_base_type, symbol_type): New.
1821 (data_type): Rename as...
1822 (stack_symbol_type): this.
1823 Derive from symbol_base_type.
1824 (yy_symbol_value_print_): Merge into...
1825 (yy_symbol_print_): this.
1826 Rename as...
1827 (yy_print_): this.
1828 (yydestruct_): Rename as...
1829 (yy_destroy_): this.
1830 (b4_symbols_actions, YY_SYMBOL_PRINT): Adjust.
1831 (parser::parse): yyla is now of symbol_type.
1832 Use its type member instead of yytoken.
1833
1834 2008-11-09 Akim Demaille <demaille@gostai.com>
1835
1836 Rename data_type and stack_symbol_type.
1837 * data/lalr1.cc (data_type): Rename as...
1838 (stack_symbol_type): this.
1839
1840 2008-11-09 Akim Demaille <demaille@gostai.com>
1841
1842 Handle semantic value and location together.
1843 * data/lalr1.cc (b4_symbol_actions): Bounce $$ and @$ to
1844 yydata.value and yydata.location.
1845 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_)
1846 (YY_SYMBOL_PRINT): Now take semantic value and location as a
1847 single arg.
1848 Adjust all callers.
1849 (yydestruct_): New overload for a stack symbol.
1850
1851 2008-11-09 Akim Demaille <demaille@gostai.com>
1852
1853 Push a complete symbol, not connected parts.
1854 * data/lalr1.cc (yypush_): Take a data_type&, not disconnected
1855 state, value and location.
1856 Adjust callers.
1857
1858 2008-11-09 Akim Demaille <demaille@gostai.com>
1859
1860 Agregate yylval and yylloc.
1861 * data/lalr1.cc (parser::yylval, parser::yylloc): Replace by...
1862 (parser::yyla): this.
1863
1864 2008-11-09 Akim Demaille <demaille@gostai.com>
1865
1866 Rely on the state stack to display reduction traces.
1867 To display rhs symbols before a reduction, we used information
1868 about the rule reduced, which required the tables yyrhs and
1869 yyprhs. Now use rely only on the state stack to get the same
1870 information.
1871
1872 * data/lalr1.cc (b4_rhs_data, b4_rhs_state): New.
1873 Use them.
1874 (parser::yyrhs_, parser::yyprhs_): Remove.
1875 (parser::yy_reduce_print_): Use the state stack.
1876
1877 2008-11-09 Akim Demaille <demaille@gostai.com>
1878
1879 Fuse yyval and yyloc into yylhs.
1880 * data/lalr1.cc (b4_lhs_value, b4_lhs_location): Adjust to using
1881 yylhs.
1882 (parse): Replace yyval and yyloc with yylhs.value and
1883 yylhs.location.
1884 After a user action, compute yylhs.state earlier.
1885 (yyerrlab1): Do not play tricks with yylhs.location, rather, use a
1886 fresh error_token.
1887
1888 2008-11-09 Di-an Jan <dianj@freeshell.org>
1889
1890 Remove unused variable.
1891 * src/output.c (type_names_output): Remove unused variable sep.
1892
1893 2008-11-09 Paolo Bonzini <bonzini@gnu.org>
1894
1895 Change tests/output.at quoting.
1896 * tests/output.at (AT_CHECK_OUTPUT): Use conventional m4 quoting when
1897 expanding arguments.
1898
1899 2008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
1900
1901 Don't add a semicolon to actions for %skeleton or %language.
1902 It breaks Java test cases as reported by Akim Demaille.
1903 * src/scan-code.l: Implement.
1904
1905 2008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
1906
1907 Clean up %skeleton and %language priority implementation.
1908 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
1909 remove static qualifier because others will soon need to see it.
1910 (language_prio): Likewise.
1911 (getargs): Use command_line_prio rather than 0.
1912 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
1913 enum fields.
1914 (skeleton_prio): Extern it.
1915 (language_prio): Extern it.
1916 * src/parse-gram.y: Use grammar_prio rather than 1.
1917
1918 2008-11-07 Akim Demaille <demaille@gostai.com>
1919
1920 Moving push traces into yypush_.
1921 * data/lalr1.cc (yypush_): Now takes a optional trace message.
1922 Adjust all uses.
1923
1924 2008-11-07 Akim Demaille <demaille@gostai.com>
1925
1926 The single-stack C++ parser is now the standard one.
1927 * data/lalr1.cc: Rename as...
1928 * data/lalr1-split.cc: this.
1929 * data/lalr1-fusion.cc: Rename as...
1930 * data/lalr1.cc: this.
1931 * etc/bench.pl.in: Adjust.
1932
1933 2008-11-07 Akim Demaille <demaille@gostai.com>
1934
1935 Avoid empty-if warnings.
1936 Reported by Quentin Hocquet.
1937
1938 * data/lalr1-fusion.cc (YY_SYMBOL_PRINT, YY_REDUCE_PRINT)
1939 (YY_STACK_PRINT): Provide some contents even when !YYDEBUG.
1940
1941 2008-11-07 Akim Demaille <demaille@gostai.com>
1942
1943 Pass command line location to skeleton_arg and language_argmatch.
1944 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
1945 The location argument is now mandatory.
1946 Adjust all dependencies.
1947 (getargs): Use command_line_location.
1948
1949 2008-11-07 Akim Demaille <demaille@gostai.com>
1950
1951 -D, --define.
1952 * src/getargs.c (usage): Document -D.
1953 Fix help string for --locations.
1954 (command_line_location): New.
1955 (short_options, long_options, getargs): Support -D, --define.
1956 (getargs): Move -d support at the right place.
1957 * doc/bison.texinfo (Bison Options): Update.
1958 * tests/input.at (%define, --define): New.
1959
1960 2008-11-07 Akim Demaille <demaille@gostai.com>
1961
1962 Initialize the muscle table before parsing the command line.
1963 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
1964 (getargs): Define file_name.
1965 * src/main.c (main): Initialize muscle_tab before calling
1966 getargs.
1967 * src/muscle_tab.c (muscle_init): No longer define file_name, as
1968 its value is not available yet.
1969
1970 2008-11-07 Akim Demaille <demaille@gostai.com>
1971
1972 Locations without columns for command line arguments.
1973 * src/location.c (location_print): Don't display negative columns.
1974 * src/location.h: Document this.
1975
1976 2008-11-07 Akim Demaille <demaille@gostai.com>
1977
1978 Fix --help.
1979 * src/getargs.c (usage): Fix help string for -W.
1980
1981 2008-11-07 Akim Demaille <demaille@gostai.com>
1982
1983 Handle more general types of option arguments.
1984 * build-aux/cross-options.pl: The argument ends at the first
1985 space, not the first non-symbol character.
1986 Use @var for each word appearing the argument description.
1987
1988 2008-11-07 Akim Demaille <demaille@gostai.com>
1989
1990 Destroy the variants that remain on the stack in case of error.
1991 * data/lalr1-fusion.cc (yydestruct_): Invoke the variant's
1992 destructor.
1993 Display the value only if yymsg is nonnull.
1994 (yyreduce): Invoke yydestruct_ when popping lhs symbols.
1995
1996 2008-11-07 Akim Demaille <demaille@gostai.com>
1997
1998 Add "%define assert" to variants.
1999 This is used to help the user catch cases where some value gets
2000 ovewritten by a new one. This should not happen, as this will
2001 probably leak.
2002
2003 Unfortunately this uncovered a bug in the C++ parser itself: the
2004 lookahead value was not destroyed between two calls to yylex. For
2005 instance if the previous lookahead was a std::string, and then an int,
2006 then the value of the std::string was correctly taken (i.e., the
2007 lookahead was now an empty string), but std::string structure itself
2008 was not reclaimed.
2009
2010 This is now done in variant::build(other&) (which is used to take the
2011 value of the lookahead): other is not only stolen from its value, it
2012 is also destroyed. This incurs a new performance penalty of a few
2013 percent, and union becomes faster again.
2014
2015 * data/lalr1-fusion.cc (variant::build(other&)): Destroy other.
2016 (b4_variant_if): New.
2017 (variant::built): New.
2018 Use it whereever the status of the variant changes.
2019 * etc/bench.pl.in: Check the penalty of %define assert.
2020
2021 2008-11-07 Akim Demaille <demaille@gostai.com>
2022
2023 Use "%define variant" in bench.pl.
2024 * etc/bench.pl.in: No longer use the pseudo directive %variants,
2025 just use %define variants.
2026
2027 2008-11-07 Akim Demaille <demaille@gostai.com>
2028
2029 Regen.
2030 * src/parse-gram.h, src/parse-gram.c: Regen.
2031
2032 2008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
2033
2034 Fix user actions without a trailing semicolon.
2035 Reported by Sergei Steshenko at
2036 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
2037 * THANKS (Sergei Steshenko): Add.
2038 * src/scan-code.l (SC_RULE_ACTION): Fix it.
2039 * tests/regression.at (Fix user actions without a trailing semicolon):
2040 New test case.
2041
2042 2008-11-04 Akim Demaille <demaille@gostai.com>
2043
2044 Use b4_copyright_years.
2045 * data/yacc.c (b4_copyright_years): New.
2046 Fix its value according to the comments in the file.
2047 Use it and undefine it.
2048
2049 2008-11-04 Akim Demaille <demaille@gostai.com>
2050
2051 Formatting changes.
2052 * data/lalr1-fusion.cc, src/parse-gram.y: here.
2053
2054 2008-11-04 Akim Demaille <demaille@gostai.com>
2055
2056 Formatting changes.
2057 * data/lalr1-fusion.cc: here.
2058
2059 2008-11-04 Akim Demaille <demaille@gostai.com>
2060
2061 Use strict on bench.pl.
2062 * etc/bench.pl.in (&run, &generate_grammar): New.
2063 Rename the grammar generating functions for consistency.
2064 Change the interface so that the list of benches to run is passed
2065 as (optionless) arguments.
2066 (&compile): Use &run.
2067
2068 2008-11-04 Akim Demaille <demaille@gostai.com>
2069
2070 Remove spurious initial empty lines.
2071 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
2072 * data/yacc.c: End the @output lines with an @.
2073
2074 2008-11-04 Akim Demaille <demaille@gostai.com>
2075
2076 Improve the display of sizes.
2077 * etc/bench.p.in: Higher precision.
2078 Sort by decreasing size.
2079
2080 2008-11-04 Akim Demaille <demaille@gostai.com>
2081
2082 Don't memcpy C++ structures.
2083 * data/lalr1-fusion.cc (b4_symbol_variant): Adjust additional
2084 arguments.
2085 (variant::build): New overload for
2086 copy-construction-that-destroys.
2087 (variant::swap): New.
2088 (parser::yypush_): Use it in variant mode.
2089
2090 2008-11-04 Akim Demaille <demaille@gostai.com>
2091
2092 Better defaults for bench.pl.
2093 * etc/bench.pl.in ($verbose, $cflags, $iterations): Change the
2094 default values.
2095 Adjust &verbose uses.
2096 (-q, --quiet): New.
2097
2098 2008-11-04 Akim Demaille <demaille@gostai.com>
2099
2100 Make variant.yy more complex.
2101 std::list cannot be copied via memcpy, they are more demanding than
2102 std::string. Use one std::list to strengthen the test.
2103
2104 * examples/variant.yy: Use lalr1-fusion.cc, not lalr1.cc.
2105 Adjust.
2106 Create a list of strings, instead of a single large string.
2107
2108 2008-11-04 Akim Demaille <demaille@gostai.com>
2109
2110 bench.pl --bench.
2111 * etc/bench.pl.in (--bench, $bench): New.
2112
2113 2008-11-04 Akim Demaille <demaille@gostai.com>
2114
2115 Sort methods.
2116 * data/lalr1-fusion.cc (destroy): Use as() in its definition.
2117 Define it after as().
2118
2119 2008-11-04 Akim Demaille <demaille@gostai.com>
2120
2121 Useless parens.
2122 * data/lalr1-fusion.cc (b4_rhs_location): Remove useless parens.
2123
2124 2008-11-04 Akim Demaille <demaille@gostai.com>
2125
2126 Issue missing synclines after user actions.
2127 * data/c.m4 (b4_case): Issue synclines on the output file.
2128
2129 2008-11-04 Akim Demaille <demaille@gostai.com>
2130
2131 Remove trailing empty line.
2132 * data/lalr1-fusion.cc: Don't add an empty line after the user's
2133 epilogue.
2134
2135 2008-11-04 Akim Demaille <demaille@gostai.com>
2136
2137 Fix output of copyright years.
2138 * data/bison.m4 (b4_copyright): Fix the indentation of the
2139 copyright year paragraph.
2140 Use b4_copyright_years when no years are given.
2141 * data/lalr1.cc, data/lalr1-fusion.cc, data/location.cc
2142 (b4_copyright_years): New.
2143 Use it.
2144
2145 2008-11-04 Akim Demaille <demaille@gostai.com>
2146
2147 Avoid the spurious initial empty line.
2148 * data/lalr1-fusion.cc, data/location.cc: Put a trailing "@" at
2149 the end of @output request to suppress the empty line that
2150 results.
2151
2152 2008-11-04 Akim Demaille <demaille@gostai.com>
2153
2154 Remove parser::rhs_number_type.
2155 * data/lalr1-fusion.cc (rhs_number_type): No longer define it.
2156 (yyrhs_): Use b4_table_define.
2157
2158 2008-11-04 Akim Demaille <demaille@gostai.com>
2159
2160 Fix iteration type.
2161 * data/lalr1-fusion.cc: Use an int to iterate up to an int.
2162
2163 2008-11-04 Akim Demaille <demaille@gostai.com>
2164
2165 Factor the declaration of the integer tables.
2166 * data/lalr1-fusion.cc (b4_table_define): New.
2167 Use it.
2168
2169 2008-11-03 Akim Demaille <demaille@gostai.com>
2170
2171 Fix indentation of tables in lalr1.cc
2172 * data/lalr1-fusion.cc: Fix the indentation.
2173
2174 2008-11-03 Akim Demaille <demaille@gostai.com>
2175
2176 Destroy the lhs symbols after reduction.
2177 * data/lalr1-fusion.cc (parse): After the user action, when in
2178 variant mode, destroy the lhs symbols.
2179
2180 2008-11-03 Akim Demaille <demaille@gostai.com>
2181
2182 Simplify yysyntax_error_ use.
2183 * data/lalr1-fusion.cc (yysyntax_error_): Always pass it the token
2184 type, but make it unnamed in the declaration when it is not used.
2185
2186 2008-11-03 Akim Demaille <demaille@gostai.com>
2187
2188 Let yy::variant::build return an lvalue.
2189 * data/lalr1-fusion.cc (variant::build): Return a reference to the
2190 object.
2191
2192 2008-11-03 Akim Demaille <demaille@gostai.com>
2193
2194 Define yy::variant only when needed.
2195 * data/lalr1-fusion.cc (yy::variant): Define only if variants are
2196 used.
2197
2198 2008-11-03 Akim Demaille <demaille@gostai.com>
2199
2200 Bench the three-stack lalr1.cc.
2201 * etc/bench.pl.in: Bench the three-stack lalr1.cc vs. the
2202 one-stack one.
2203
2204 2008-11-03 Akim Demaille <demaille@gostai.com>
2205
2206 Fail on parse error in calc++.
2207 * doc/bison.texinfo (calc++.cc): Propagate failures to the exit
2208 status.
2209 * examples/calc++/test ($me, $number, $exit, run): New.
2210 Use them to propagate errors to the exit status.
2211
2212 2008-11-03 Akim Demaille <demaille@gostai.com>
2213
2214 Don't specify the skeleton twice in the example.
2215 * examples/calc++/Makefile.am: Don't pass -S to Bison, the grammar
2216 file does what is needed.
2217
2218 2008-11-03 Akim Demaille <demaille@gostai.com>
2219
2220 bench: Improve output.
2221 * etc/bench.pl.in (bench_grammar): Tune the printf format.
2222
2223 2008-11-03 Akim Demaille <demaille@gostai.com>
2224
2225 bench: check impact of %debug on variants.
2226 * etc/bench.pl.in (variant_grammar): Fix the computation of
2227 $variant.
2228 Generate a grammar file that can work with or without %debug.
2229 Do use the @directive.
2230 (bench_variant_parser): Check impact of %debug.
2231 (@directives): Rename all the occurrences to...
2232 (@directive): this, for consistency.
2233
2234 2008-11-03 Akim Demaille <demaille@gostai.com>
2235
2236 bench: report the size too.
2237 * etc/bench.pl.in ($iterations): Defaults to -3.
2238 (&bench_grammar): Require hireswallclock.
2239 Compute and display the size of the result.
2240 More comments.
2241
2242 2008-11-03 Akim Demaille <demaille@gostai.com>
2243
2244 bench: More use of the verbosity level.
2245 * etc/bench.pl.in ($verbose, &verbose): New.
2246 Use them.
2247 More POD documentation.
2248
2249 2008-11-03 Akim Demaille <demaille@gostai.com>
2250
2251 bench.pl: a command line interface
2252 * etc/bench.pl.in: More doc.
2253 Some fixes in the documentation.
2254 ($cflags, $iterations, &help, &getopt): New.
2255 Use them.
2256 (&variant_grammar): Let the number of stages be 10 times what is
2257 specified.
2258
2259 2008-11-03 Akim Demaille <demaille@gostai.com>
2260
2261 Bench the use of Boost.Variants.
2262 * etc/bench.pl.in ($cxx, &variant_grammar, &bench_variant_parser):
2263 New.
2264 (&compile): Be ready to compile C++ parsers.
2265 (&bench_push_parser): Move debug information to the outermost
2266 level.
2267 * THANKS: Add Michiel De Wilde.
2268
2269 2008-11-03 Akim Demaille <demaille@gostai.com>
2270
2271 bench.pl: Pass directives as a list instead of as a string.
2272 * etc/bench.pl.in (&directives): New.
2273 (&triangular_grammar, &calc_grammar): Use it to format the Bison
2274 directives.
2275 (&triangular_grammar): Do use the directives (were ignored).
2276 (&bench_grammar, &bench_push_parser): Adjust to pass lists of
2277 directives.
2278
2279 2008-11-03 Akim Demaille <demaille@gostai.com>
2280
2281 Improve genericity of bench.pl.
2282 * etc/bench.pl.in (&bench_grammar): Take the set of benches as
2283 argument.
2284 (&bench_push_parser): New.
2285 Call it.
2286
2287 2008-11-03 Akim Demaille <demaille@gostai.com>
2288
2289 Add documentation to bench.pl.
2290 * etc/bench.pl.in: Comment changes.
2291
2292 2008-11-03 Akim Demaille <demaille@gostai.com>
2293
2294 Fuse the three stacks into a single one.
2295
2296 In order to make it easy to perform benchmarks to ensure that
2297 there are no performance loss, lalr1.cc is forked into
2298 lalr1-fusion.cc. Eventually, lalr1-fusion.cc will replace
2299 lalr1.cc.
2300
2301 Meanwhile, to make sure that lalr1-fusion.cc is correctly
2302 exercized by the test suite, the user must install a symbolic link
2303 from lalr1.cc to it.
2304
2305 Instead of having three stacks (state, value, location), use a
2306 stack of triples. This considerably simplifies the code (and it
2307 will be easier not to require locations as currently does the C++
2308 parser), and also gives a 10% speedup according to
2309 etc/bench (probably mainly since memory allocation is done once
2310 instead of three times).
2311
2312 Another motivation is to make it easier to destruct properly
2313 semantic values: now that they are bound to their state (hence
2314 symbol type) it will be easier to call the appropriate destructor.
2315
2316 These changes should probably benefit the C parser too.
2317
2318 * data/lalr1.cc: Copy as...
2319 * data/lalr1-fusion.cc: this new file.
2320 (b4_rhs_value, b4_rhs_location): New definitions overriding those
2321 from c++.m4.
2322 (state_stack_type, semantic_stack_type, location_stack_type)
2323 (yystate_stack_, yysemantic_stack_, yylocation_stack_): Remove.
2324 (data_type, stack_type, yystack_): New.
2325 (YYLLOC_DEFAULT, yypush_): Adjust.
2326 (yyerror_range): Now based on data_type, not location_type.
2327
2328 2008-11-03 Akim Demaille <demaille@gostai.com>
2329
2330 Push the state, value, and location at the same time.
2331 This is needed to prepare a forthcoming patch that fuses the three
2332 stacks into one.
2333
2334 * data/lalr1.cc (parser::yypush_): New.
2335 (parser::yynewstate): Change the semantics: instead of arriving to
2336 this label when value and location have been pushed, but yystate
2337 is to be pushed on the state stack, now the three of them must
2338 have been pushed before. yystate still must be the new state.
2339 This allows to use yypush_ everywhere instead of individual
2340 handling of the stacks.
2341
2342 2008-11-03 Akim Demaille <demaille@gostai.com>
2343
2344 Prefer references to pointers.
2345 * data/lalr1.cc (b4_symbol_actions): New, overrides the default C
2346 definition to use references instead of pointers.
2347 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_):
2348 Take the value and location as references.
2349 Adjust callers.
2350
2351 2008-11-03 Akim Demaille <demaille@gostai.com>
2352
2353 stack::size instead of stack::height.
2354 * data/lalr1.cc (stack::height): Rename as...
2355 (stack::size): this.
2356 Fix the output type.
2357 Comment changes.
2358
2359 2008-11-03 Akim Demaille <demaille@gostai.com>
2360
2361 Use variants to support objects as semantic values.
2362 This patch was inspired by work by Michiel De Wilde. But he used
2363 Boost variants which (i) requires Boost on the user side, (ii) is
2364 slow, and (iii) has useless overhead (the parser knows the type of
2365 the semantic value there is no reason to duplicate this
2366 information as Boost.Variants do).
2367
2368 This implementation reserves a buffer large enough to store the
2369 largest objects. yy::variant implements this buffer. It was
2370 implemented with Quentin Hocquet.
2371
2372 * src/output.c (type_names_output): New.
2373 (output_skeleton): Invoke it.
2374 * data/c++.m4 (b4_variant_if): New.
2375 (b4_symbol_value): If needed, provide a definition for variants.
2376 * data/lalr1.cc (b4_symbol_value, b4_symbol_action_)
2377 (b4_symbol_variant, _b4_char_sizeof_counter, _b4_char_sizeof_dummy)
2378 (b4_char_sizeof, yy::variant): New.
2379 (parser::parse): If variants are requested, define
2380 parser::union_type, parser::variant, change the definition of
2381 semantic_type, construct $$ before running the user action instead
2382 of performing a default $$ = $1.
2383 * examples/variant.yy: New.
2384 Based on an example by Michiel De Wilde.
2385
2386 2008-11-03 Akim Demaille <demaille@gostai.com>
2387
2388 Parameterize the extraction of semantic values.
2389 To make future changes easier, no longer rely on ".TYPE" being the
2390 way to get a semantic value.
2391
2392 * data/c.m4 (b4_symbol_value): New.
2393 Use it.
2394 * data/c++.m4, data/yacc.c: Use it.
2395 * data/glr.c: Use b4_symbol_value.
2396 (b4_rhs_data): New.
2397 Use it.
2398
2399 2008-11-03 Akim Demaille <demaille@gostai.com>
2400
2401 Prepare easier M4 changes.
2402 * data/lalr1.cc: Use escaped [] instead of literals to prepare
2403 future changes.
2404
2405 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
2406
2407 Initiate further development.
2408 * NEWS: Create an empty section for new entries.
2409 * gnulib: Update submodule to HEAD.
2410
2411 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
2412
2413 * NEWS: Version 2.4.
2414
2415 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
2416
2417 Prepare for next release.
2418 * NEWS: Briefly mention changes since 2.3b.
2419 * README: Say GNU m4 1.4.6, which we've been requiring in release
2420 announcements already, not 1.4.3, which breaks the build.
2421
2422 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
2423
2424 Say %language is experimental.
2425 We're thinking of extending it's effect on output file naming. See the
2426 thread at
2427 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
2428 * NEWS: Say it's experimental.
2429 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
2430 recommend it over %skeleton for now.
2431 (Bison Options): Likewise.
2432 (C++ Bison Interface): Use %skeleton not %language.
2433 (Calc++ Parser): Use %skeleton not %language.
2434 * src/getargs.c (usage): Say it's experimental.
2435
2436 2008-11-01 Di-an Jan <dianj@freeshell.org>
2437 Paolo Bonzini <bonzini@gnu.org>
2438
2439 Support all Java parser class modifiers.
2440 * data/java.m4 (b4_percent_define_get3): New.
2441 (b4_final_if, b4_strictfp_if): New.
2442 * data/lalr1.java (final, strictfp, extends, implements): Support.
2443 * doc/bison.texinfo (final, strictfp, extends, implements): Add
2444 documentation.
2445 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
2446 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
2447 (AT_CHECK_JAVA_GREP): New.
2448 (Java parser class modifiers): New test.
2449 (Java parser class extends and implements): New test.
2450
2451 Model exception propagation better with throws and lex_throws.
2452 * data/java.m4 (b4_list2): New.
2453 (throws): Change default.
2454 * data/lalr1.java (yyaction): Add throws.
2455 (parse): Add lex_throws in addition to throws.
2456 * doc/bison.texinfo (throws, lex_throws): Add documentation.
2457 * tests/java.at (Java throws specifications): New test.
2458
2459 Improve documentation for Java parsers.
2460 * doc/bison.texinfo (Java Parsers): Add subsections.
2461 Don't quote first argument of %define.
2462 (Java Bison Interface): Document output files. Move documentation
2463 of parser class and merge into Java Parser Interface. Document
2464 features that error out. Document directives with no effect.
2465 Move note about Javadoc higher.
2466 (Java Semantic Values): Explicitly mention stype.
2467 Document that generic types cannot be used.
2468 (Java Location Values): Use @deftypeivar. Document constructors.
2469 Correct return value for toString.
2470 (Java Parser Interface): List undocumented constants/fields.
2471 Move documentation of fields added by %parse-param closer to list
2472 of members. Document that token names are added as fields.
2473 Document constructors accurately. Remove error method.
2474 (Java Scanner Interface): Move note on %pure-parser to Java Bison
2475 Interface. Describe %code lexer and yylex accutately.
2476 Remove documentation that does not match the code.
2477 (Java Action Features): New.
2478 (Java Differences): Add reference. Add item on semantic values.
2479 Add note about @{ ... @}. Clarify %% epilogue placement.
2480 (Java Declarations Summary): New.
2481
2482 Fix Java skeleton.
2483 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
2484 (b4_remove_comma): Quote test argument.
2485 (b4_identification): Remove "bison" field.
2486 * tests/java.at (Java parser class and package names): New test.
2487 (Java %parse-param and %lex-param): New test.
2488 (Java stype, position_class and location_class): New test.
2489
2490 2008-10-31 Di-an Jan <dianj@freeshell.org>
2491
2492 * data/lalr1.jave: Update copyright years.
2493 (YYParser): Correct name of "generated from" file in Javadoc:
2494 use b4_file_name instead of @ofile@.
2495 (Location constructor): Correct Javadoc parameter name.
2496 (yylloc): Add missing opening m4 quote after b4_location_if.
2497 This removes a stray [ in the Javadoc of Lexer.getStartPos.
2498 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
2499 (YYParser constructor): Correct Javadoc parameter name.
2500
2501 2008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
2502
2503 Always put auxiliary code files in the same dir as other output files.
2504 * src/files.c (compute_file_name_parts): When the user specifies
2505 --output but not --file-prefix, extract the directory prefix from the
2506 file prefix not from the grammar file name. This affects the location
2507 of files like location.hh generated by the C++ skeleton. The includes
2508 in the other output files require this fix.
2509 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
2510 for expected output files.
2511 (Output files): Add a test for the above.
2512
2513 2008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
2514
2515 * gnulib: Update submodule to HEAD.
2516
2517 2008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
2518
2519 Update copyright year.
2520 * src/files.c: Here.
2521
2522 2008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
2523
2524 Don't overwrite the input file.
2525 * src/files.c (output_file_name_check): Fatal error if using input file
2526 for output.
2527 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
2528 argument.
2529 (Conflicting output files): Add test.
2530
2531 2008-10-28 Akim Demaille <demaille@gostai.com>
2532
2533 Space changes.
2534 * data/lalr1.cc: Formatting changes.
2535
2536 2008-10-28 Akim Demaille <demaille@gostai.com>
2537
2538 Don't define debugging functions when !YYDEBUG.
2539 * data/lalr1.cc (debug_stream, set_debug_stream)
2540 (debug_level_type, debug_level, set_debug_level): Don't
2541 declare them when YYDEBUG is not defined.
2542 The implementation are already YYDEBUG-aware.
2543
2544 2008-10-28 Akim Demaille <demaille@gostai.com>
2545
2546 Prefer "continue" for empty loop bodies.
2547 * etc/bench.pl.in: Use "continue" instead of {}.
2548
2549 2008-10-28 Akim Demaille <demaille@gostai.com>
2550
2551 Space and comments changes.
2552 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
2553 * data/c.m4, data/lalr1.cc: Space changes.
2554
2555 2008-10-28 Akim Demaille <demaille@gostai.com>
2556
2557 Make gnulib a submodule.
2558 * gnulib: New.
2559 * .gitmodules (gnulib): New.
2560
2561 2008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
2562
2563 Fix yyerror_range for user-defined location type in C++. Reported by
2564 Georg Sauthoff at
2565 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
2566 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
2567 * THANKS (Georg Sauthoff): Add.
2568
2569 2008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
2570
2571 Update several administrative files mainly to facilitate releasing.
2572 * HACKING (Administrivia): Make the git-merge-changelog notes more
2573 helpful.
2574 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
2575 (Release Procedure): Update for git and add numerous details that were
2576 previously missing.
2577 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
2578 * maint.mk (announcement): Don't list bison as a bootstrap tool so
2579 that announcements don't claim we bootstrapped with whatever bison
2580 happened to be in PATH. Add flex as a bootstrap tool.
2581 * Makefile.maint: Remove, previously replaced by maint.mk.
2582 * Makefile.cfg: Remove, and migrate settings to...
2583 * cfg.mk: ... here for the sake of `make announcement'.
2584 * bootstrap.conf (gnulib_modules): Add announce-gen.
2585 * README: Say GNU Bison instead of just Bison. Suggested by Karl
2586 Berry.
2587
2588 2008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
2589
2590 Small but important bugfixes for the Java skeleton.
2591 * data/lalr1.java (yyerror): Change Location to b4_location_type.
2592 (yy_symbol_print): Call toString on yyvaluep.
2593
2594 2008-08-29 Akim Demaille <demaille@gostai.com>
2595
2596 Clarify UPDATED use.
2597 * doc/bison.texinfo: It refers to the last edition of this file,
2598 not to the release date of Bison.
2599 Reported by Joel E. Denny.
2600
2601 2008-08-29 Akim Demaille <demaille@gostai.com>
2602
2603 * README: Update FAQ pointer.
2604 Reported by Joel E. Denny.
2605
2606 2008-08-27 Eric Blake <ebb9@byu.net>
2607
2608 Resync m4sugar from autoconf.
2609 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
2610 (m4_init): Adjust to latest m4.git changes.
2611 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
2612 effects.
2613 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
2614 (_m4_list_cmp): Reduce side effects.
2615
2616 2008-08-27 Akim Demaille <demaille@gostai.com>
2617
2618 Check yyerrok in calc.at.
2619 * tests/calc.at (calc.y): Use yyerrok on "( error )".
2620 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
2621 expected.
2622
2623 2008-08-27 Akim Demaille <demaille@gostai.com>
2624
2625 Support yyerrok in lalr1.cc.
2626 YYBACKUP is still to import back into lalr1.cc.
2627 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
2628
2629 2008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
2630
2631 For maintainer-check*, don't recompile for a $(VERSION) update.
2632 * cfg.mk: New file.
2633 (_is-dist-target): Override the one in GNUmakefile.
2634 * Makefile.am (EXTRA_DIST): Add cfg.mk.
2635
2636 2008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
2637
2638 Update for recent change to gnulib.
2639 * src/parse-gram.y: Don't include strverscmp.h. It comes from
2640 string.h now.
2641
2642 2008-08-15 Eric Blake <ebb9@byu.net>
2643
2644 Remaining m4sugar merge from autoconf.
2645 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
2646 * data/m4sugar/foreach.m4: New file, copied from autoconf.
2647 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
2648 * src/output.c (output_skeleton): Tell m4 how to find it.
2649
2650 Partial m4sugar merge from autoconf: m4_map.
2651 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
2652 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
2653 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
2654 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
2655 for empty list.
2656 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
2657 Likewise.
2658 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
2659 declares it.
2660
2661 2008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
2662
2663 Keep .version and PACKAGE_VERSION in sync.
2664 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
2665 dependency, and add comments justifying this in more detail. Discussed
2666 starting at
2667 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
2668
2669 2008-08-06 Eric Blake <ebb9@byu.net>
2670
2671 Partial m4sugar merge from autoconf: m4_shiftn.
2672 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
2673 (m4_shift2, m4_shift3): New macros.
2674 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
2675 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
2676 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
2677 * data/java.m4 (b4_remove_comma): Likewise.
2678
2679 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
2680 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
2681 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
2682 (m4_init): Consolidate wrapped text into single m4_wrap.
2683 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
2684 in wrapped text.
2685
2686 2008-08-05 Eric Blake <ebb9@byu.net>
2687
2688 Partial m4sugar merge from autoconf: builtins, version.m4.
2689 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
2690 (m4_prepend): Remove, as it is unused and inherently quadratic,
2691 whereas m4_append is linear in newer m4.
2692 (m4_mkstemp): New builtin.
2693 (m4_symbols): Make rename conditional.
2694 (m4_version_prereq): Ensure fatal error if used in bison, which
2695 intentionally lacks version.m4.
2696
2697 Fix comments in m4sugar.
2698 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
2699
2700 2008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
2701
2702 Update for recent .gitignore fix in Gnulib.
2703 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
2704 anchored .gitignore entries.
2705
2706 2008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
2707
2708 Set gnu or gnits strictness.
2709 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
2710 development and gnits strictness for releases. Based on Eric Blake's
2711 suggestion at
2712 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
2713
2714 2008-07-31 Paolo Bonzini <bonzini@gnu.org>
2715
2716 * NEWS: Clarify documentation of %language.
2717
2718 2008-07-31 Paolo Bonzini <bonzini@gnu.org>
2719
2720 Support usage of git-merge-changelog.
2721 * .gitattributes: New.
2722 * HACKING: Document usage of git-merge-changelog.
2723 * bootstrap: Install git-merge-changelog entries in .git/config
2724 if appropriate.
2725
2726 2008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
2727
2728 Remove remaining dependence on CVS Id keyword.
2729 * ChangeLog: For the sake of people still using CVS, don't use dollars
2730 when mentioning Id.
2731 * data/xslt/bison.xsl: Remove Id from header comments, where it was
2732 unusual anyway.
2733 * data/xslt/xml2dot.xsl: Likewise.
2734 * data/xslt/xml2text.xsl: Likewise.
2735 * data/xslt/xml2xhtml.xsl: Likewise.
2736 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
2737 * doc/Makefile.am (neutralize): Remove, no longer needed.
2738 (.x.1): Don't use neutralize.
2739 (edit): Don't substitute for ID.
2740 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
2741
2742 2008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
2743
2744 Fix dependence on computed configure variables.
2745 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
2746 $(top_srcdir)/configure.ac so that changes to computed variables, such
2747 as PACKAGE_VERSION, are seen.
2748 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
2749
2750 2008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
2751
2752 Update copyright dates for recent changes.
2753 * Makefile.am: Here.
2754 * src/Makefile.am: Here.
2755 * src/reduce.c: Here.
2756 * tests/reduce.at: Here.
2757
2758 2008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
2759
2760 Use git-version-gen for version names between releases.
2761 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
2762 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
2763 * .prev-version: New.
2764 * .version.in: Remove.
2765 * ChangeLog: Remove the Id previously used for capturing the CVS
2766 revision.
2767 * GNUmakefile: Remove, now copied from Gnulib.
2768 * Makefile.am: Add code suggested by comments in
2769 build-aux/git-version-gen.
2770 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
2771 .prev-version, and .version.
2772 * NEWS (2.3b+): Rename to...
2773 (?.?): ... this because we're dropping the "+" version naming scheme,
2774 but, in general, we still can't be sure of our next release name.
2775 * bootstrap: Add a quick hack to remove from .gitignore the
2776 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
2777 entry. This should really be fixed in gnulib instead.
2778 * bootstrap.conf (gnulib_modules): Add gnumakefile.
2779 * configure.ac (AC_INIT): Set version name by invoking
2780 build-aux/git-version-gen.
2781 (AC_CONFIG_FILES): Remove .version, now generated by
2782 build-aux/git-version-gen.
2783 * maint.mk: New, copied from coreutils.
2784 * doc/.cvsignore (bison.1): Add.
2785 * doc/.gitignore (/bison.1): Add.
2786 * doc/bison.1: Remove, generated.
2787 * src/.cvsignore (revision.c): Remove.
2788 * src/.gitignore (/revision.c): Remove.
2789 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
2790 (BUILT_SOURCES): Remove revision.c.
2791 (revision.c): Remove.
2792 * src/getargs.c (version): Don't print revision after the VERSION.
2793 * src/revision.h: Remove.
2794
2795 2008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
2796
2797 Fix untranslatable composition of sentences. Reported by Goran
2798 Uddeborg at
2799 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
2800 * THANKS (Goran Uddeborg): Add.
2801 * src/reduce.c (reduce_print): Report the number of nonterminals and
2802 rules useless in the grammar in separate sentences.
2803 * tests/reduce.at (Useless Rules): Update output.
2804 (Reduced Automaton): Likewise.
2805 (Underivable Rules): Likewise.
2806 (Empty Language): Likewise.
2807
2808 2008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
2809
2810 Fix some .gitignore and .cvsignore problems.
2811 * bootstrap (insert_sorted_if_absent): Replace all uses with...
2812 (insert_vc_ignore): ... this new function, which prepends `/' to all
2813 .gitignore entries before passing them to insert_sorted_if_absent.
2814 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
2815 .cvsignore files are maintained even though Bison developers run
2816 bootstrap while using Git.
2817 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
2818 unneeded by Bison.
2819 (gnulib): Add.
2820 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
2821 unneeded. Reported by Eric Blake.
2822 * lib/.gitignore (/*~): Add.
2823 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
2824 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
2825 Blake.
2826 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
2827
2828 2008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
2829
2830 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
2831 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
2832 * bootstrap.conf (gnulib_modules): Add unsetenv.
2833 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
2834 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
2835 (/setenv.m4): Add.
2836 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
2837 the first argument because it may become position-dependent, and unset
2838 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
2839 Add comments explaining these issues in more detail.
2840
2841 2008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
2842
2843 Add .gitignore everywhere based on .cvsignore.
2844 * .gitignore: New.
2845 * build-aux/.gitignore: New.
2846 * data/.gitignore: New.
2847 * doc/.gitignore: New.
2848 * etc/.gitignore: New.
2849 * examples/.gitignore: New.
2850 * examples/calc++/.gitignore: New.
2851 * lib/.gitignore: New.
2852 * m4/.gitignore: New.
2853 * po/.gitignore: New.
2854 * runtime-po/.gitignore: New.
2855 * src/.gitignore: New.
2856 * tests/.gitignore: New.
2857
2858 2008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
2859
2860 * NEWS (2.3b+): New section, empty for now.
2861 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
2862
2863 2008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
2864
2865 * NEWS (2.3b): Update release date since there has been a delay in
2866 getting the announcements and tarballs out.
2867
2868 2008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
2869
2870 * NEWS: Version 2.3b.
2871 * configure.ac (AC_INIT): Likewise.
2872 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
2873
2874 2008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
2875
2876 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
2877 been doing it for years.
2878 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
2879 (Release Procedure): Add FIXME about make alpha being unmaintained.
2880
2881 2008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
2882
2883 * data/yacc.c: Reformat m4 a little for readability.
2884 * src/lalr.c (build_relations): Correct comment.
2885
2886 2008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2887
2888 DJGPP specific issue.
2889 * djgpp/config.sed: Fixes required to run configure scripts generated
2890 by autoconf 2.62.
2891
2892 2008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
2893
2894 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
2895 coordinator@translationproject.org.
2896
2897 2008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
2898
2899 * THANKS: Add Eric Blake.
2900
2901 2008-04-23 Eric Blake <ebb9@byu.net>
2902
2903 Revert prior patch, by working around autoconf regression.
2904 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
2905 ("Output file name: ("): Uncomment test.
2906 ("Output file name: )"): Likewise.
2907 Based on an idea from Noah Misch.
2908
2909 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2910
2911 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
2912 2.61. Reported by Juan Manuel Guerrero at
2913 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
2914 * tests/output.at ("Output file name: ("): Comment out test case for
2915 now.
2916 ("Output file name: )"): Likewise.
2917
2918 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2919
2920 * GNUmakefile: Update git-version-gen invocation so make dist
2921 succeeds.
2922
2923 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2924
2925 Update to the current gnulib CVS repository, and fix trigraph handling
2926 in Bison.
2927 * bootstrap: Update gnulib CVS repository URL.
2928 (symlink_to_dir): Encapsulate the code that guarantees the destination
2929 directory exists into...
2930 (check_dst_dir): ... this new function, and...
2931 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
2932 fail when copying files into lib/uniwidth/.
2933 * src/output.c (prepare_symbols): When writing yytname muscles, where
2934 symbol names will be encoded in C-string literals, tell quotearg to
2935 escape trigraphs. This used to be the default in gnulib.
2936 * tests/regression.at (Token definitions): Because of the change in
2937 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
2938 escapes trigraphs in symbol names. Thus, yytname no longer has
2939 trigraphs unnecessarily doubly escaped. Update test case output.
2940 Extend test case to be sure Bison's own error messages will no longer
2941 have trigraphs in symbol names unnecessarily escaped once.
2942
2943 2008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
2944
2945 Fix make dist infinite loop reported by Juan Manuel Guerrero at
2946 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
2947 * .cvsignore: Add .version.
2948 * .version.in: New.
2949 * bootstrap.conf (gnulib_modules): Add git-version-gen.
2950 * configure.ac (AC_CONFIG_FILES): Add .version.
2951 * build-aux/.cvsignore: Add git-version-gen.
2952
2953 2008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
2954
2955 * NEWS (2.3a+): Mention that -g now takes an argument.
2956 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
2957 consistency. Update the -g and -x entries now that they take
2958 arguments. Use brackets to indicate optional arguments.
2959 * src/getargs.c (usage): Explain the relationship between arguments of
2960 long and short options more completely. Document --defines and -d
2961 separately since the former takes an argument but, for POSIX Yacc, the
2962 latter does not.
2963 (short_options): Let -W take an optional argument like --warnings.
2964 (getargs): Sort cases.
2965
2966 2008-02-28 Akim Demaille <demaille@gostai.com>
2967
2968 * doc/bison.texinfo: Fix a few typos.
2969
2970 2008-02-28 Akim Demaille <akim@epita.fr>
2971
2972 * doc/bison.texinfo (Bison Options): Document -W.
2973 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
2974
2975 2008-02-28 Akim Demaille <akim@epita.fr>
2976
2977 * src/getargs.c (short_options): Split and sort for readability.
2978 -g and -x take optional arguments, just like their long options.
2979 * build-aux/cross-options.pl: Use /x to make the regexp easier to
2980 understand.
2981 Fix the handling of $opt which resulted in all the argument to be
2982 considered as optional.
2983
2984 2008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
2985
2986 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
2987 say its interface is experimental.
2988 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
2989 Java.
2990 (Bison Options): In the -L and --language entry, mention Java.
2991 (Java Bison Interface): Say the interface is experimental.
2992 * src/getargs.c (usage): Mention -L and --language.
2993
2994 * NEWS (2.3a+): Say the push parsing interface is experimental.
2995 * doc/bison.texinfo (Push Decl): Likewise.
2996 (Decl Summary): Likewise in the "%define api.push_pull" entry.
2997 (Push Parser Function): Likewise.
2998 (Pull Parser Function): Likewise.
2999 (Parser Create Function): Likewise.
3000 (Parser Delete Function): Likewise.
3001 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
3002 yypull_parse, and yypush_parse entries.
3003
3004 * NEWS (2.3a+): Mention XML support, and say the schema is
3005 experimental.
3006 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
3007 * src/getargs.c (usage): Say the XML schema is experimental.
3008
3009 * NEWS (2.3a+): Say option instead of flag.
3010
3011 2008-02-21 Wojciech Polak <polak@gnu.org>
3012
3013 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
3014 text.
3015
3016 2008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
3017
3018 Fix impure push parser compile error reported by Bob Rossi at
3019 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
3020 * data/yacc.c: Clean up whitespace in the output a little.
3021 (yypstate_allocated): Define for impure push parsers regardless of
3022 whether the pull interface is also requested.
3023 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
3024 check impure push parsers without the pull interface.
3025
3026 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
3027 yyerror takes arguments specified by %parse-param while yypstate_new
3028 does not.
3029 * doc/bison.texinfo (Parser Create Function): Document that
3030 yypstate_new returns 0 for multiple impure parser instances.
3031 * tests/push.at (Push Parsing: Multiple impure instances): Update
3032 expected stderr output.
3033
3034 2008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
3035
3036 * runtime-po/POTFILES.in (push.c): Remove.
3037
3038 2008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
3039
3040 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
3041 * data/push.c: Rename to...
3042 * data/yacc.c: ... this, overwriting it.
3043 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
3044 `%push-pull-parser' -> `%define api.push_pull "both"'.
3045 Remove old yacc.c tests, and update push.c tests to yacc.c.
3046
3047 2008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
3048
3049 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
3050 `"%code top" blocks' instead of `%code "top" blocks'.
3051 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
3052 Clean up whitespace in the output a little.
3053
3054 2008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
3055
3056 Fix documentation problems reported by Tim Josling at
3057 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
3058 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
3059 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
3060 integers. Explain the effect of literal string aliases on error
3061 messages. Copy token 0 documentation from the C++ skeleton
3062 documentation.
3063
3064 2008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
3065
3066 Accept a token number in a %left, %right, or %nonassoc for POSIX
3067 conformance. Reported by Tim Josling at
3068 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
3069 * NEWS (2.3a+): Mention.
3070 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
3071 and code numbers are treated by precedence declarations.
3072 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
3073 of symbols.1.
3074 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
3075 of symbol.
3076 (symbol.prec): New, just like symbol but allows INT.
3077 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
3078 longer holds.
3079 * tests/regression.at (Token number in precedence declaration): New
3080 test case.
3081
3082 2008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3083
3084 DJGPP specific issues.
3085 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
3086 be changed. Copyright timestamp adjusted.
3087 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
3088 be changed. Copyright timestamp adjusted.
3089 * djgpp/config.site: Copyright timestamp adjusted.
3090 * djgpp/config_h.sed: Copyright timestamp adjusted.
3091 * djgpp/djunpack.bat: Copyright timestamp adjusted.
3092 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
3093 filename translation list.
3094 * djgpp/subpipe.c (init_subpipe): Check the environment variables
3095 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
3096 files shall be created. Before trying to use the temp dir where the
3097 environment variable points to check that the dir really exists. If
3098 not default to the cwd as temp dir. Copyright timestamp adjusted.
3099 * djgpp/subpipe.h: Copyright timestamp adjusted.
3100 * djgpp/testsuite.sed: Copyright timestamp adjusted.
3101
3102 2008-01-30 Paul Eggert <eggert@cs.ucla.edu>
3103
3104 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
3105
3106 2008-01-09 Paul Eggert <eggert@cs.ucla.edu>
3107
3108 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
3109 Problem reported by Claudio Saavedra in
3110 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
3111
3112 2008-01-05 Wojciech Polak <polak@gnu.org>
3113
3114 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
3115 document's title with the input grammar file name.
3116
3117 2007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
3118
3119 Automate regression testing of the XML/XSLT implementation. Discussed
3120 starting at
3121 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
3122 * configure.ac (XSLTPROC): New substitution.
3123 * Makefile.am (maintainer-xml-check): New phony target invoking...
3124 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
3125 invoking make maintainer-check with BISON_TEST_XML=1.
3126 * tests/atlocal.in (XSLTPROC): New.
3127 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
3128 not to report reachable memory when Bison is expected to have a
3129 non-zero exit status and (2) to compare XML/XSLT output with --graph
3130 and --report=all output for every working grammar when
3131 BISON_TEST_XML=1.
3132 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
3133 (AT_BISON_CHECK_XML): New.
3134 (AT_QUELL_VALGRIND): New.
3135 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
3136 (AT_CHECK): ... don't redefine this since this was the old way to
3137 quell Valgrind.
3138 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
3139 AT_BISON_CHECK invocations.
3140 * tests/c++.at: Likewise.
3141 * tests/calc.at: Likewise.
3142 * tests/conflicts.at: Likewise.
3143 * tests/cxx-type.at: Likewise.
3144 * tests/existing.at: Likewise.
3145 * tests/glr-regression.at: Likewise.
3146 * tests/headers.at: Likewise.
3147 * tests/input.at: Likewise.
3148 * tests/java.at: Likewise.
3149 * tests/output.at: Likewise.
3150 * tests/push.at: Likewise.
3151 * tests/reduce.at: Likewise.
3152 * tests/regression.at: Likewise.
3153 * tests/sets.at: Likewise.
3154 * tests/skeletons.at: Likewise.
3155 * tests/synclines.at: Likewise.
3156 * tests/torture.at: Likewise.
3157 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
3158 tends to hang xsltproc.
3159 (Big horizontal): Likewise.
3160
3161 2007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
3162
3163 In XML output, remove redundant class attribute on symbol element.
3164 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
3165 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
3166 look up a symbol to determine whether it's a nonterminal or terminal.
3167 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
3168 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
3169
3170 Add prec/assoc information to XML output.
3171 * src/gram.c (grammar_rules_print_xml): For each rule that has a
3172 %prec, add a percent_prec attribute.
3173 * src/print-xml.c (print_grammar): For each terminal that has a
3174 precedence or associativity, add a prec or assoc attribute.
3175 (xml_indent): New.
3176 (xml_puts): Use xml_indent.
3177 (xml_printf): Use xml_indent.
3178 * src/print-xml.h (xml_indent): Prototype.
3179
3180 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
3181 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
3182
3183 2007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
3184
3185 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
3186 (bison:ruleByNumber): ... this for clarity.
3187 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
3188 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
3189 (xsl:template match="reduction"): Update.
3190 (xsl:template match="item"): Update.
3191 (xsl:template match="reduction"): Update.
3192
3193 In the XML output, don't print the list of rules where symbols appear.
3194 Compute it in XSLT instead. Discussed at
3195 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
3196 * data/xslt/bison.xsl (bison:ruleByLhs): New.
3197 (bison:ruleByRhs): New.
3198 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
3199 bison:ruleByRhs.
3200 (xsl:template match="terminal/rule"): Remove.
3201 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
3202 bison:ruleByRhs.
3203 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
3204 Remove.
3205 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
3206 bison:ruleByRhs and mode="number-link" for rule template.
3207 (xsl:template match="terminal/rule"): Remove.
3208 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
3209 bison:ruleByRhs and mode="number-link" for rule template.
3210 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
3211 Rewrite as...
3212 (xsl:template match="rule" mode="number-link"): ... this.
3213 * src/print-xml.c (print_grammar): Don't print the list of rules.
3214
3215 2007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
3216
3217 Don't let --report affect XML output; always print all information.
3218 Discussed at
3219 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
3220 * src/conflicts.c (log_resolution): Implement.
3221 * src/print-xml.c (print_core): Implement.
3222 (print_state): Implement.
3223 (print_xml): Implement.
3224
3225 * NEWS (2.3a+): Fix quotes.
3226 * src/parse-gram.y (prologue_declaration): For consistency with -v,
3227 don't let %verbose clear the list specified by --report.
3228
3229 2007-11-26 Akim Demaille <akim@epita.fr>
3230
3231 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
3232
3233 2007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
3234
3235 In the XML output, list useless and unused symbols and rules with the
3236 useful ones and add a "usefulness" attribute. Discussed starting at
3237 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
3238 * src/gram.c (grammar_rules_partial_print_xml): Remove.
3239 (grammar_rules_print_xml): Print all rules instead of just those
3240 useful in the grammar, and add a "usefulness" attribute.
3241 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
3242 * src/print-xml.c (print_rules_useless_in_parser): Remove.
3243 (print_grammar): Print all nonterminals instead of just useful ones,
3244 and add a "usefulness" attribute to nonterminals and terminals.
3245 (print_xml): Don't print a separate "reductions" or
3246 "rules-useless-in-parser" element.
3247 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
3248 (reduce_xml): Remove.
3249 (reduce_token_unused_in_grammar): New.
3250 (reduce_nonterminal_useless_in_grammar): New.
3251 * src/reduce.h (reduce_xml): Remove prototype.
3252 (reduce_token_unused_in_grammar): Add prototype.
3253 (reduce_nonterminal_useless_in_grammar): Add prototype.
3254 * data/xslt/xml2text.xsl: Update for XML changes.
3255 * data/xslt/xml2xhtml.xsl: Update for XML changes.
3256 * tests/reduce.at (Useless Terminals): Update output.
3257 (Useless Rules): Update output.
3258 (Reduced Automaton): Update output.
3259
3260 Say "Terminals unused in grammar" instead of "Unused terminals".
3261 * NEWS (2.3a+): Update.
3262 * doc/bison.texinfo (Understanding): Update example output.
3263 * src/reduce.c (reduce_output): Implement.
3264 * data/xslt/xml2text.xsl: Implement.
3265 * data/xslt/xml2xhtml.xsl: Implement.
3266
3267 2007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
3268
3269 Accept --report-file=FILE to override the default `.output' filename.
3270 * NEWS (2.3a+): Mention.
3271 * doc/bison.texinfo (Bison Options): Add an entry.
3272 * src/files.c (compute_output_file_names): Don't override
3273 spec_verbose_file if already set.
3274 * src/getargs.c (usage): Document --report-file.
3275 (REPORT_FILE_OPTION): New anonymous enum member.
3276 (long_options): Add entry for it.
3277 (getargs): Add case for it setting spec_verbose_file.
3278
3279 * build-aux/cross-options.pl: Don't record a short option just because
3280 there's an arg.
3281 * doc/.cvsignore: Add yacc.1.
3282
3283 2007-11-14 Akim Demaille <akim@epita.fr>
3284
3285 * doc/yacc.1.in: New.
3286 * configure.ac, doc/Makefile.am: Adjust.
3287 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
3288 config.h symbol.
3289 Use AC_SUBST for assignments too.
3290 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
3291
3292 2007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
3293
3294 * src/gram.c: Remove comments that duplicate comments in gram.h.
3295
3296 When reporting useless rules and nonterminals, say "useless in grammar"
3297 instead of "useless", and say "useless in parser" instead of "never
3298 reduced". Discussed starting at
3299 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
3300 * NEWS (2.3a+): Mention this change.
3301 * data/xslt/xml2text.xsl: Update output text and expected input XML
3302 element names to match changes below.
3303 * data/xslt/xml2xhtml.xsl: Likewise.
3304 (xsl:template match="bison-xml-report"): Add missing entry in Table of
3305 Contents: "Rules useless in parser due to conflicts".
3306 * doc/bison.texinfo (Decl Summary): Reword a little.
3307 (Understanding): Update example output for changes below.
3308 * src/gram.c: (rule_useful_p): Rename to...
3309 (rule_useful_in_grammar_p): ... this.
3310 (rule_useless_p): Rename to...
3311 (rule_useless_in_grammar_p): ... this.
3312 (rule_never_reduced_p): Rename to...
3313 (rule_useless_in_parser_p): ... this.
3314 (grammar_rules_print): Update for renames.
3315 (grammar_rules_print_xml): Update for renames.
3316 (grammar_rules_never_reduced_report): Rename to...
3317 (grammar_rules_useless_report): ... this since it is used for either
3318 kind of useless rule.
3319 * src/gram.h: Reword comments and update function names in prototypes.
3320 * src/main.c (main): Say "rule useless in parser due to conflicts".
3321 * src/print-xml.c (print_rules_never_reduced): Rename to...
3322 (print_rules_useless_in_parser): ... this, and rename output XML
3323 element "rules-never-reduced" to "rules-useless-in-parser".
3324 (print_xml): Update for rename.
3325 * src/print.c (print_results): Say "Rules useless in parser due to
3326 conflicts".
3327 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
3328 (nonterminals_reduce): Say "nonterminal useless in grammar".
3329 (reduce_output): Say "Nonterminals useless in grammar".
3330 Say "Rules useless in grammar".
3331 (reduce_xml): Rename output XML element "useless" to
3332 "useless-in-grammar".
3333 (reduce_print): Don't report the count of grammatically useless rules
3334 as "rules never reduced" just because %yacc is specified.
3335 In the correct report of this count, say nonterminal(s) and rule(s)
3336 "useless in grammar".
3337 * tests/conflicts.at (S/R in initial): Update expected output.
3338 (Defaulted Conflicted Reduction): Likewise.
3339 (Unreachable States After Conflict Resolution): Likewise.
3340 * tests/existing.at (GNU pic Grammar): Likewise.
3341 * tests/reduce.at (Useless Nonterminals): Likewise.
3342 (Useless Rules): Likewise.
3343 (Reduced Automaton): Likewise.
3344 (Underivable Rules): Likewise.
3345 (Empty Language): Likewise.
3346
3347 2007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
3348
3349 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
3350 here document and before the EOF so that BSD's implementation of Bourne
3351 shell doesn't parse the delimiter as part of the here document.
3352 * doc/.cvsignore: Add cross-options.texi.
3353 * src/getargs.c (usage): Add a blank line after the warning categories.
3354
3355 2007-11-08 Paolo Bonzini <bonzini@gnu.org>
3356
3357 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
3358
3359 2007-11-05 Akim Demaille <akim@epita.fr>
3360
3361 Remove Id: from bison.1.
3362 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
3363 (perl -0777 -pi -e 's/\.PP\nId): New.
3364 (.x.1): Use it to ignore the version control revision.
3365
3366 2007-11-05 Akim Demaille <demaille@gostai.com>
3367
3368 * build-aux/Makefile.am: Ship cross-options.pl.
3369 * doc/Makefile.am: Always refer to cross-options.texi with
3370 $(srcdir).
3371 (MAINTAINERCLEANFILES): Add it.
3372
3373 2007-11-04 Akim Demaille <demaille@gostai.com>
3374
3375 Generate the long/short option cross-table.
3376 * build-aux/cross-options.pl: New.
3377 * doc/Makefile.am (cross-options.texi): New.
3378 * doc/bison.texinfo: Use it.
3379
3380 2007-11-04 Akim Demaille <demaille@gostai.com>
3381
3382 Generate bison.1 using help2man.
3383 * doc/common.x, doc/bison.x: New.
3384 * doc/Makefile.am (bison.1, .x.1): New.
3385 The code is taken from autoconf-2.61/man/Makefile.am.
3386 * configure.ac: Look for help2man.
3387
3388 2007-11-04 Akim Demaille <demaille@gostai.com>
3389
3390 Complete --help.
3391 * src/getargs.c (usage): Document -W, make it clear that -d,
3392 -g and -x have optional arguments.
3393
3394 2007-11-04 Akim Demaille <demaille@gostai.com>
3395
3396 Find sha1sum when named gsha1sum.
3397 * bootstrap (find_tool): New.
3398 ($SHA1SUM): New.
3399
3400 2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
3401
3402 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
3403 at
3404 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
3405 * NEWS (2.3a+): Mention.
3406 * data/bison.m4 (b4_pure_if): Don't define it here.
3407 * data/c.m4 (b4_identification): Depend on individual skeletons to
3408 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
3409 values of the %define variables api.pure or api.push_pull. Define
3410 YYPURE, YYPUSH, and YYPULL accordingly.
3411 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
3412 glr.cc has already defined b4_pure_flag.
3413 * data/push.c: Define b4_pure_if based on `%define api.pure'.
3414 Remove YYPUSH and YYPULL since they're back in b4_identification again.
3415 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
3416 * doc/bison.texinfo (Pure Decl): Update.
3417 (Push Decl): Update.
3418 (Decl Summary): Add api.pure to %define entry.
3419 In %pure-parser entry, say it's deprecated and reference %define.
3420 (Pure Calling): Update.
3421 (Error Reporting): Update.
3422 (C++ Scanner Interface): Update.
3423 (How Can I Reset the Parser): Update.
3424 (Table of Symbols): In %pure-parser entry, say it's deprecated and
3425 reference %define.
3426 * src/getargs.c (pure_parser): Remove global variable.
3427 * src/getargs.h (pure_parser): Remove extern.
3428 * src/output.c (prepare): Don't define pure_flag muscle.
3429 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
3430 wrapper around `%define api.pure'.
3431 * tests/calc.at (Simple LALR Calculator): Update.
3432 (Simple GLR Calculator): Update.
3433 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
3434 Update.
3435 (GLR: Resolve ambiguity, pure, locations): Update.
3436 (GLR: Merge conflicting parses, pure, no locations): Update.
3437 (GLR: Merge conflicting parses, pure, locations): Update.
3438 * tests/glr-regression.at (Uninitialized location when reporting
3439 ambiguity): Update
3440 * tests/input.at (Unused %define api.pure): New test case.
3441 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
3442 AT_PURE_IF and AT_PURE_AND_LOC_IF.
3443 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
3444
3445 2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
3446
3447 %define push_pull -> %define api.push_pull. Discussed starting at
3448 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
3449 * data/push.c: Expect the new name.
3450 * data/yacc.c: Likewise.
3451 * doc/bison.texinfo (Push Decl): Update.
3452 (Decl Summary): Update %define entry.
3453 (Push Parser Function): Update.
3454 (Pull Parser Function): Update.
3455 (Parser Create Function): Update.
3456 (Parser Delete Function): Update.
3457 * tests/calc.at (Simple LALR Calculator): Update.
3458 * tests/input.at (%define enum variables): Update.
3459 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
3460 (Push Parsing: Multiple impure instances): Update.
3461 (Push Parsing: Unsupported Skeletons): Update.
3462 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
3463 (Exploding the Stack Size with Malloc): Update.
3464
3465 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
3466 other entries some.
3467
3468 2007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
3469
3470 For the XML output's terminal element, rename @number to @token-number,
3471 and add @symbol-number. In the nonterminal element, rename @number to
3472 @symbol-number. Discussed starting at
3473 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
3474 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
3475 renames.
3476 (xsl:template match="nonterminal"): Likewise.
3477 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
3478 (xsl:template match="nonterminal"): Likewise.
3479 * src/print-xml.c (print_grammar): Implement.
3480
3481 2007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
3482
3483 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
3484 2007-10-11 change, the child elements here are items not rules.
3485 (xsl:template match="item"): New.
3486 (xsl:template match="rule"): Update for new reduced itemset.
3487 (xsl:template match="point"): Remove.
3488 (xsl:template match="empty"): For consistency with --graph, don't
3489 output "/* empty */".
3490 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
3491 line-wrap, don't pass a negative value as first-line-length since this
3492 won't work with the following changes.
3493 (xsl:template name="line-wrap"): Simplify slightly.
3494 (xsl:template name="ws-search"): Eliminate recursion.
3495 * src/print_graph.c (print_core): Don't print a reduction's lookahead
3496 set next to an item whose dot is not at the end of the RHS even if it
3497 happens to be associated with the same rule.
3498
3499 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
3500
3501 Add %define lr.keep_unreachable_states.
3502 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
3503 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
3504 * src/main.c (main): Implement it.
3505 * tests/conflicts.at (Unreachable States After Conflict Resolution):
3506 Extend to test it, and fix a typo.
3507
3508 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
3509
3510 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
3511 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
3512 the example .output text.
3513 * tests/regression.at (Extra lookahead sets in report): Improve wording
3514 of comments.
3515
3516 2007-10-17 Wojciech Polak <polak@gnu.org>
3517
3518 * src/print-xml.c (print_grammar): Renamed
3519 <terminal> and <nonterminal> attributes:
3520 "type" to "number" and "symbol" to "name".
3521 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
3522 Use new attribute names.
3523 (xsl:template match="nonterminal"): Likewise.
3524 * data/xslt/xml2xhtml.xsl: Likewise.
3525
3526 2007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
3527
3528 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
3529 (Option Cross Key): Likewise.
3530
3531 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
3532 next to an item whose dot is not at the end of the RHS even if it
3533 happens to be associated with the same rule.
3534 * src/print.c (print_core): Likewise.
3535 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
3536 (Resolved SR Conflicts): Update output.
3537 * tests/regression.at (Extra lookahead sets in report): New test case.
3538
3539 2007-10-11 Wojciech Polak <polak@gnu.org>
3540
3541 * src/print-xml.c (print_core): Remove item set
3542 redundancy.
3543 * data/xslt/bison.xsl (bison:ruleNumber): New key.
3544 Improve processing time. Suggested by Joel E. Denny.
3545 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
3546 Write xsl:param "required" attribute as comment.
3547 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
3548 (xsl:template match="rule"): Support new reduced itemset.
3549 (xsl:template match="point"): Remove.
3550 * data/xslt/xml2xhtml.xsl: Likewise.
3551
3552 2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
3553
3554 * src/getargs.c (version): Update copyright year.
3555
3556 2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
3557
3558 Make xml2dot.xsl and --graph produce the same output.
3559 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
3560 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
3561 escaped later.
3562 (xsl:template name="output-node"): Use the new escape template instead
3563 of the string-replace template directly.
3564 (xsl:template name="output-edge"): Likewise.
3565 (xsl:template name="escape"): New, escapes backslashes and newlines in
3566 addition to quotation marks.
3567 * src/graphviz.c (start_graph, output_node, output_edge): Add
3568 whitespace to output for legibility.
3569
3570 Make xml2text.xsl and --report produce the same output, and remove the
3571 XML "conflicts" element since a conflict summary is easily extracted
3572 from the automaton.
3573 * data/xslt/bison.xsl: New.
3574 (xsl:template match="state" mode="bison:count-conflicts): New.
3575 * data/xslt/xml2text.xsl: Import bison.xsl.
3576 (xsl:template match="bison-xml-report"): Instead of styling the
3577 "conflicts" element, style the "automaton" element with mode
3578 "conflicts". Unlike the former, the latter lists S/R and R/R
3579 conflicts for a state on the same line.
3580 (xsl:template match="conflicts"): Remove.
3581 (xsl:template match="conflict"): Remove.
3582 (xsl:template match="terminal"): Line-wrap the list of rules in which
3583 the terminal is used.
3584 (xsl:template match="nonterminal"): Likewise for nonterminals.
3585 (xsl:template match="automaton" mode="conflicts"): New.
3586 (xsl:template match="state" mode="conflicts"): New.
3587 (xsl:template name="line-wrap"): New.
3588 (xsl:template name="ws-search"): New.
3589 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
3590 (xsl:template match="bison-xml-report"): Instead of styling the
3591 "conflicts" element, style the "automaton" element with mode
3592 "conflicts."
3593 (xsl:template match="conflicts"): Remove.
3594 (xsl:template match="conflict"): Remove.
3595 (xsl:template match="automaton" mode="conflicts"): New.
3596 (xsl:template match="state" mode="conflicts): New.
3597 * src/conflicts.c (conflicts_output_xml): Remove.
3598 * src/conflicts.h (conflicts_output_xml): Remove prototype.
3599 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
3600 * src/print.c (print_grammar): Consistently wrap at the 66th column so
3601 the corresponding XSLT is easier. Also, never wrap between a word and
3602 the comma that follows it.
3603
3604 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
3605
3606 Improve C++ namespace support. Discussed starting at
3607 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
3608 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
3609 b4_namespace_close): New macros that interpret the %define variable
3610 "namespace" so its value can contain "::" to indicate nested
3611 namespaces.
3612 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
3613 the above macros.
3614 * data/lalr1.cc (b4_namespace): Likewise.
3615 * data/location.cc (b4_namespace): Likewise.
3616 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
3617 inside a new table in the general %define entry. Document `%define
3618 namespace' there as well. Point the %name-prefix entry to it since it
3619 explains it more completely in the case of C++.
3620 (C++ Bison Interface): Mention `%define namespace' instead of
3621 %name-prefix.
3622 (Table of Symbols): Remove the `%define push_pull' entry. The %define
3623 entry suffices.
3624 * tests/c++.at (Relative namespace references): New test case.
3625 (Absolute namespace references): New test case.
3626 (Syntactically invalid namespace references): New test case.
3627 * tests/input.at (C++ namespace reference errors): New test case.
3628
3629 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
3630
3631 Add syncline support and location accessor to internal %define
3632 interfaces.
3633 * data/bison.m4 (b4_percent_define_get_loc): New.
3634 (b4_percent_define_get_syncline): New.
3635 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
3636 (b4_percent_define_default): Record defining location as line 1 rather
3637 than 0 for the sake of synchronizing #line's, and define
3638 b4_percent_define_syncline(VARIABLE).
3639 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
3640 * src/muscle_tab.c (muscle_syncline_grow): New.
3641 (muscle_code_grow): Use muscle_syncline_grow.
3642 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
3643 define b4_percent_define_syncline(VARIABLE).
3644 (muscle_percent_define_get_loc): New.
3645 (muscle_percent_define_get_syncline): New.
3646 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
3647 remove some unused variables.
3648 (muscle_percent_define_default): Record defining location as line 1
3649 rather than 0 for the sake of synchronizing #line's, and define
3650 b4_percent_define_syncline(VARIABLE).
3651 (muscle_percent_define_check_values): Use
3652 muscle_percent_define_get_loc.
3653 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
3654 (muscle_percent_define_get_syncline): Prototype.
3655 * tests/skeletons.at (%define Boolean variables: invalid skeleton
3656 defaults): Update output for location change.
3657 (Complaining during macro argument expansion): Extend to test
3658 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
3659
3660 2007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
3661
3662 Fix some error-reporting macro bugs.
3663 * data/bison.m4 (b4_cat): New.
3664 (b4_error, b4_error_at): Use b4_cat to send error directives directly
3665 to stdout so they don't become arguments to other macros. Update
3666 comments and add examples.
3667 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
3668 add examples.
3669 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
3670 after printing the error directive so that M4 doesn't report subsequent
3671 problems that are induced by this problem.
3672 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
3673 instead of just in them. Recognize @\n in both places. Both expand to
3674 the empty string. Needed by b4_cat.
3675 * tests/skeletons.at (Complaining during macro argument expansion):
3676 New test case.
3677 (Fatal errors make M4 exit immediately): New test case.
3678
3679 2007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
3680
3681 Implement --print-datadir.
3682 * src/getargs.c (usage): Mention.
3683 (PRINT_DATADIR_OPTION): New anonymous enum member.
3684 (long_options): Add entry for it.
3685 (getargs): Add case for it calling compute_pkgdatadir.
3686 * src/output.c (output_skeleton): Encapsulate data directory
3687 computation from here...
3688 (prepare): ... and from here...
3689 (compute_pkgdatadir): ... into this new function.
3690 * src/output.h (compute_pkgdatadir): Prototype.
3691
3692 2007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
3693
3694 * src/print-xml.c (escape_bufs): New static global variable
3695 replacing...
3696 (xml_escape_n): ... the static local variable buf here.
3697 (print_xml): Free memory for escape_bufs.
3698 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
3699
3700 2007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
3701
3702 Replace `%push-parser' and `%push-pull-parser' with
3703 `%define push_pull "push"' and `%define push_pull "both"'.
3704 `%define push_pull "pull"' is the default.
3705 * doc/bison.texinfo (Push Decl, Push Parser Function,
3706 Pull Parser Function, Parser Create Function, Parser Delete Function):
3707 Update declarations.
3708 (Decl Summary, Table of Symbols): Replace %push-parser and
3709 %push-pull-parser entries with a %define push_pull entry.
3710 * data/bison.m4 (b4_percent_define_check_values): New macro.
3711 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
3712 definitions...
3713 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
3714 definitions...
3715 * data/push.c: ... to here and compute them from the value of the
3716 %define variable push_pull.
3717 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
3718 parsing requests here...
3719 * data/yacc.c: ... hack this to switch to push.c any time
3720 b4_use_push_pull_flag or the %define variable push_pull is set. This
3721 will go away when we mv push.c yacc.c.
3722 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
3723 push parsing is not supported since unused %define variables are
3724 reported anyway.
3725 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
3726 * src/muscle_tab.h (muscle_percent_define_check_values): Update
3727 comments for consistency with b4_percent_define_check_values.
3728 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
3729 muscles.
3730 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
3731 Remove.
3732 (prologue_declaration): Remove %push-parser and %push-pull-parser
3733 rules.
3734 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
3735 * tests/calc.at: Update declarations.
3736 * tests/input.at (%define enum variables): New test case.
3737 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
3738 declaration.
3739 (Push Parsing: Multiple impure instances): Update declaration.
3740 (Push Parsing: Unsupported Skeletons): New test case.
3741 * tests/torture.at (Exploding the Stack Size with Alloca): Update
3742 declaration.
3743 (Exploding the Stack Size with Malloc): Update declaration.
3744
3745 2007-09-24 Wojciech Polak <polak@gnu.org>
3746
3747 Add XSLT transformations.
3748
3749 * data/xslt/xml2dot.xsl: Transform XML into DOT.
3750 * data/xslt/xml2text.xsl: Transform XML into plain text.
3751 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
3752 * data/Makefile.am (xsltdir): New variable.
3753 (dist_xslt_DATA): Add xslt/*.xsl files.
3754
3755 2007-09-23 Paul Eggert <eggert@cs.ucla.edu>
3756
3757 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
3758 Problem reported by Wojciech Polak.
3759 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
3760 (xml_printf): Undo change I made on 21 September; that is,
3761 indent 2 spaces, not 1.
3762
3763 2007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
3764
3765 Pacify ./configure --enable-gcc-warnings.
3766 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
3767 `char const *' instead of `char *'.
3768 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
3769 local variable `sep'.
3770
3771 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
3772
3773 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
3774 elsewhere.
3775 * src/print-xml.c: Prefer "const" after types; that's more consistent.
3776 (xml_printf): Indent just 1 space for level.
3777 (e_char, xlate_char): Remove.
3778 (xml_escape_string): Rewrite to avoid undefined behavior (used
3779 storage that was freed from the stack).
3780 (xml_escape_n): Don't bother checking for subscript error.
3781
3782 2007-09-21 Wojciech Polak <polak@gnu.org>
3783
3784 Add Bison XML Automaton Report.
3785
3786 Add support for an -x option to generate an XML report.
3787 It is not documented yet.
3788 * src/print-xml.c: New file.
3789 * src/print-xml.h: Likewise.
3790 * lib/timevar.def (TV_XML): New var.
3791 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
3792 * src/conflicts.c: Include print-xml.h.
3793 (solved_conflicts_xml_obstack): New var.
3794 (log_resolution, conflicts_solve, conflicts_free):
3795 Add support for XML report.
3796 (conflicts_output_val): New function.
3797 * src/conflicts.h (conflicts_output_val): New decl.
3798 * src/files.c (spec_xml_file): New var.
3799 (compute_output_file_names, output_file_names_free): Add XML support.
3800 * src/files.h (spec_xml_file): New decl.
3801 * src/getargs.c (xml_flag): New var.
3802 (usage, short_options, long_options, getargs): Add XML support.
3803 * src/getargs.h (xml_flag): New decl.
3804 * src/gram.c: Include print-xml.h.
3805 (rule_lhs_print_xml, rule_rhs_print_xml):
3806 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
3807 New functions.
3808 * src/gram.h: Declare external ones.
3809 * src/main.c: Include print-xml.h.
3810 (main): Add XML support.
3811 * src/reduce.c: Include print-xml.h.
3812 (reduce_xml): New function.
3813 * src/reduce.h: Declare it.
3814 * src/state.c: Include print-xml.h.
3815 (state_new): Add XML support.
3816 (state_rule_lookahead_tokens_print_xml): New function.
3817 * src/state.h: Declare it.
3818 (struct state): New member solved_conflicts_xml.
3819 * src/symtab.c (symbol_class_get_string): New function.
3820 * src/symtab.h: Declare it.
3821
3822 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
3823
3824 * GNUmakefile: Switch to coreutils's version.
3825 * bootstrap: Likewise.
3826 * Makefile.cfg: Adjust to new GNUmakefile.
3827 * README-hacking: Likewise.
3828
3829 Import from gnulib:
3830
3831 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
3832 Bruno Haible <bruno@clisp.org>
3833
3834 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
3835 and is a script that invokes bison. Tighten the code. Add comments.
3836
3837 2007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
3838
3839 Spell "boolean" as "Boolean". Reported by Akim Demaille.
3840 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
3841 * doc/bison.texinfo (Decl Summary): Fix.
3842 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
3843 * tests/input.at (Boolean %define variables): Update output.
3844 * tests/skeletons.at (%define boolean variables: invalid skeleton
3845 defaults): Rename to...
3846 (%define Boolean variables: invalid skeleton defaults): ... this and
3847 update output.
3848
3849 2007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
3850
3851 In impure push mode, don't allow more than one yypstate to be allocated
3852 since multiple impure parsers would corrupt yynerrs.
3853 * data/push.c (yypstate_allocated): New static global variable
3854 initialized to 0.
3855 (yypull_parse): If yypstate_new returns 0, don't report it as memory
3856 exhaustion if yypstate_allocated is 1, but still return 2.
3857 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
3858 already 1. Otherwise, set it to 1.
3859 (yypstate_delete): Set it to 0.
3860 * tests/push.at (Push Parsing: Multiple impure instances): New test
3861 case.
3862
3863 2007-08-17 Bob Rossi <bob@brasko.net>
3864
3865 * doc/bison.texinfo (Push Decl): Document the push parser.
3866 (Table of Symbols): Ditto.
3867 (Pure Decl): Ditto.
3868 (Decl Summary): Ditto.
3869 (Multiple Parsers, Push Parser Function, Pull Parser Function,
3870 Parser Create Function, Parser Delete Function):
3871 Add new push parser symbols.
3872 (Table of Symbols): Document push-parser, push-pull-parser,
3873 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
3874
3875 2007-08-15 Paul Eggert <eggert@cs.ucla.edu>
3876
3877 Update to GPLv3.
3878 * doc/gpl-3.0.texi: New file.
3879 * doc/gpl.texi: Remove.
3880 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
3881 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
3882 * README-hacking, TODO, bootstrap, bootstrap.conf:
3883 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
3884 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
3885 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
3886 * data/lalr1.cc, data/lalr1.java, data/location.cc:
3887 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
3888 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
3889 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
3890 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
3891 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
3892 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
3893 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
3894 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
3895 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
3896 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
3897 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
3898 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
3899 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
3900 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
3901 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
3902 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
3903 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
3904 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
3905 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
3906 * src/complain.c, src/complain.h, src/conflicts.c:
3907 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
3908 * src/files.h, src/flex-scanner.h, src/getargs.c:
3909 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
3910 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
3911 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
3912 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
3913 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
3914 * src/print.c, src/print.h, src/print_graph.c:
3915 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
3916 * src/reduce.h, src/relation.c, src/relation.h:
3917 * src/revision.h, src/scan-code.h, src/scan-code.l:
3918 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
3919 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
3920 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
3921 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
3922 * tests/Makefile.am, tests/actions.at, tests/c++.at:
3923 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
3924 * tests/existing.at, tests/glr-regression.at:
3925 * tests/headers.at, tests/input.at, tests/java.at:
3926 * tests/local.at, tests/output.at, tests/push.at:
3927 * tests/reduce.at, tests/regression.at, tests/sets.at:
3928 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
3929 * tests/torture.at:
3930 Update to GPLv3.
3931
3932 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
3933
3934 Get rid of broken %no-parser, -n, and --no-parser implementation and
3935 documentation.
3936 * TODO: Don't mention them.
3937 * doc/bison.1: Likewise.
3938 * doc/bison.texinfo (Decl Summary): Likewise.
3939 (Bison Options): Likewise.
3940 (Option Cross Key): Likewise.
3941 * src/getargs.c (no_parser_flag): Remove global variable.
3942 (usage): Don't print description of -n and --no-parser.
3943 (long_options): Remove --no-parser entry here.
3944 (getargs): Remove -n case in the switch here.
3945 * src/getargs.h (no_parser_flag): Remove extern.
3946 * tests/regression.at (Web2c Actions): Remove comment that mentions
3947 --no-parser.
3948
3949 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
3950
3951 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
3952 name user variables starting with `yy'. Just pass NULL instead of a
3953 dummy local &yylval to yypush_parse.
3954 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
3955 starting with `yy'.
3956
3957 2007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
3958
3959 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
3960 true since it's then always used regardless of whether yyoverflow is
3961 defined. Reported by Christian Burger at
3962 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
3963 * THANKS: Add Christian Burger.
3964
3965 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
3966 node names: say "Decl Summary" not "Bison Declaration Summary".
3967
3968 2007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
3969
3970 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
3971 determine whether this function has already complained about an invalid
3972 value for a %define boolean variable, don't check whether Bison has
3973 ever examined the value. As written, the check was a tautology.
3974 Instead, record and check for this complaint using a separate muscle.
3975
3976 2007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
3977
3978 Fix push parsing memory leak reported by Brandon Lucia at
3979 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
3980 * THANKS: Add Brandon Lucia.
3981 * data/push.c (yypstate_delete): Free the stack if it was reallocated
3982 but the parse never completed and thus freed it.
3983 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
3984 * tests/testsuite.at: Include push.at.
3985 * test/push.at: New.
3986 (Push Parsing: Memory Leak for Early Deletion): New test case.
3987
3988 2007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
3989
3990 Improve handling of multiple S/R conflicts in the same state and of S/R
3991 conflicts involving multiple reductions.
3992 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
3993 set for a state here or Bison will abort if it is reassigned on a
3994 later conflicted reduction in the same state.
3995 Similarly, don't finalize and assign the solved conflicts report here
3996 or it will be lost if it is reassigned on a later conflicted reduction
3997 in the same state.
3998 (set_conflicts): Instead, assign them both here after all S/R conflicts
3999 in the state have been fully examined.
4000 * src/print.c (shift_set): Rename to...
4001 (no_reduce_set): ... this.
4002 (print_reductions): Update for rename, and add %nonassoc error action
4003 tokens to no_reduce_set so that, when printing the first remaining
4004 reduction on an error action token, the reduction is enclosed in
4005 brackets.
4006 (print_results): Update for rename.
4007 * tests/conflicts.at (Solved conflicts report for multiple reductions
4008 in a state): New test case.
4009 (%nonassoc error actions for multiple reductions in a state): New test
4010 case.
4011
4012 * src/main.c (main): Don't depend on C99 features.
4013
4014 2007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
4015
4016 * build-aux/.cvsignore: Add compile.
4017 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
4018 uniwidth.
4019
4020 2007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
4021
4022 * bootstrap (slurp): Create target directories that don't exist.
4023 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
4024
4025 2007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
4026
4027 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
4028 than item number.
4029 * closure.c (closure): Likewise.
4030 * state.h (reductions): Comment sorting of rules.
4031 (state): Comment sorting of items.
4032
4033 2007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
4034
4035 Fix C++ test cases after recent Gnulib changes. Discussed starting at
4036 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
4037 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
4038 definition in order to avoid Gnulib headers since we don't use config.h
4039 here.
4040 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
4041 rather than AT_DATA so that config.h is included.
4042
4043 2007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
4044
4045 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
4046 instead of fprintf. Guard these functions with #if YYDEBUG instead of
4047 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
4048 and so that YYFPRINTF is guaranteed to be defined here.
4049
4050 2007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
4051
4052 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
4053 with...
4054 (muscle_percent_define_check_values): ... this more helpful function.
4055 Again, it's not used yet, but it will be.
4056 * src/muscle_tab.h: Likewise.
4057
4058 Improve some comments in parser table construction.
4059 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
4060 (generate_states): Don't mention ruleset, which is internal to closure.
4061 * src/closure.c (closure): Explain sorting of core and itemset, which
4062 is required for this function to behave correctly.
4063 * src/closure.h (closure): Mention sorting.
4064
4065 2007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
4066
4067 * src/lalr.c (state_lookahead_tokens_count): For code readability,
4068 move the check for disabled transitions to an aver since conflict
4069 resolution hasn't happened yet.
4070
4071 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
4072 labels a state as inconsistent just because it has error transitions.
4073 The original form of this check appeared in revision 1.1 of lalr.c,
4074 which was committed on 1991-12-21. Now (at least), changing the
4075 consistency label on such a state appears to have no useful effect in
4076 any of the places it is examined, which I enumerate below. The key
4077 point to understanding each item in this enumeration is that a state
4078 with an error transition is labelled consistent in the first place only
4079 if it has no rules, so the check cannot matter for states that have
4080 rules. (1) Labelling a state as inconsistent will cause set_conflicts
4081 to try to identify its conflicts, and a state must have *rules* to have
4082 conflicts. (2) Labelling a state as inconsistent will affect how
4083 action_row sets the default *rule* for the state. (3) Labelling a
4084 state as inconsistent will cause build_relations to add lookback edges
4085 to *rules* in that state.
4086 * src/state.h (struct state): Word the comment for member consistent
4087 more carefully.
4088
4089 2007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
4090
4091 Don't depend on C99 features.
4092 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
4093 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
4094 * src/reader.c (check_and_convert_grammar): Fix for-loop.
4095 * src/state.c (state_mark_reachable_states): Fix for-loop.
4096 (state_remove_unreachable_states): Fix for-loop.
4097
4098 Don't widen struct state with member reachable just to temporarily
4099 record reachability. Instead, use a local bitset.
4100 * src/state.h (struct state): Remove member.
4101 * src/state.c (state_new): Don't initialize it.
4102 (state_mark_reachable_states): Rename to...
4103 (state_record_reachable_states): ... this, and use bitset.
4104 (state_remove_unreachable_states): Use bitset.
4105
4106 2007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
4107
4108 * src/Makefile.am (yacc): Quote target action commands properly so
4109 that the yacc script isn't corrupt. Reported by Hans Aberg at
4110 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
4111
4112 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
4113 the case of pure parsers. Reported by Frans Englich at
4114 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
4115 * THANKS: Add Frans Englich.
4116
4117 * NEWS (2.3a+): In the %code entry, reference section `Bison
4118 Declaration Summary' from the manual now since the %code summary has
4119 moved there.
4120 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
4121 in the rules section must be terminated by semicolons.
4122
4123 2007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
4124
4125 Extend the front-end API for %define variables to more completely
4126 mirror the back-end. This will be useful in the future.
4127 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
4128 Update comments to mention the new front-end counterparts of these
4129 macros.
4130 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
4131 for muscle_string_decode and muscle_location_decode.
4132 (muscle_string_decode): New static function.
4133 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
4134 (muscle_percent_define_get, muscle_percent_define_ifdef): New
4135 functions.
4136 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
4137 muscle_percent_define_get to mimic the b4_percent_define_flag_if
4138 implementation more closely.
4139 (muscle_percent_define_invalid_value): New function.
4140 * src/muscle_tab.h (muscle_percent_define_get,
4141 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
4142 Prototype.
4143
4144 2007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
4145
4146 * NEWS (2.3a+): Mention yesterday's state-removal change.
4147 (2.3a): Remove the %language entry, which was added after 2.3a.
4148 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
4149 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
4150 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
4151 tests/existing.at: Update copyright date.
4152
4153 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
4154
4155 If conflict resolution makes states unreachable, remove those states,
4156 report rules that are then unused, and don't report conflicts in those
4157 states.
4158 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
4159 New global function.
4160 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
4161 function.
4162 * src/main.c (main): After conflict resolution, remove the unreachable
4163 states and update all data structures that reference states by number.
4164 * src/state.c (state_new): Initialize each state's reachable member to
4165 false.
4166 (state_mark_reachable_states): New static function.
4167 (state_remove_unreachable_states): New global function.
4168 * src/state.h (struct state): Add member bool reachable.
4169 (state_remove_unreachable_states): Prototype.
4170 * tests/conflicts.at (Unreachable States After Conflict Resolution):
4171 New test case.
4172 * tests/existing.at (GNU pic Grammar): Update test case output now that
4173 an unused rule is discovered.
4174
4175 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
4176
4177 Minor code cleanup in parser table construction.
4178 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
4179 (new_itemsets, save_reductions): Update for rename to nitemset.
4180 * src/closure.c (nritemset): Rename to...
4181 (nitemset): ... this since the "r" appears to meaningless and isn't
4182 used in the comments.
4183 (closure): Update for rename.
4184 * src/closure.h (nritemset): Update extern to...
4185 (nitemset): ... this.
4186 * src/lalr.c (LA): Fix a typo in comments.
4187 * src/print.c (print_core): Update for rename to nitemset.
4188 * src/print_graph.c (print_graph): Likewise.
4189 * src/state.h: Fix some typos in header comments.
4190
4191 2007-04-04 Paul Eggert <eggert@cs.ucla.edu>
4192
4193 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
4194 still sticks to ASCII. Sorry!
4195
4196 * README-hacking: New file, taken mostly from coreutils, with changes
4197 for Bison. Contains much of the contents of:
4198 * README-cvs: Remove.
4199 * bootstrap: Sync from gnulib.
4200 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
4201 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
4202
4203 2007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
4204
4205 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
4206 Setzer.
4207 (Java Differences): Fix some typos.
4208 * THANKS: Add Sebastian Setzer.
4209
4210 2007-03-07 Paolo Bonzini <bonzini@gnu.org>
4211
4212 * data/java.m4 (b4_single_class_if): Remove.
4213 (b4_abstract_if): Look at "%define abstract".
4214 (b4_lexer_if): New.
4215 (b4_union_name): Rename...
4216 (b4_yystype): ... to this. Map to "%define stype".
4217 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
4218 b4_maybe_throws): Fix quoting.
4219 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
4220 * data/lalr1.java (Lexer interface): Always define.
4221 (Lexer interface within parser class): Remove.
4222 (YYLexer class): New, used when "%code lexer" is present.
4223 (constructor): When "%code lexer" is used, pass %lex-param
4224 to the lexer constructor.
4225 (yylex, yyparse): Remove %lex-param from method invocations
4226 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
4227
4228 * doc/bison.texinfo (Java Bison Interface): Mention "%define
4229 abstract". Rename "%define union_name" to "%define stype".
4230 Rename method names according to previous patch.
4231 (Java Scanner Interface): Describe "%code lexer" instead of
4232 "%pure-parser" and "%define single_class".
4233 (Java Differences): Mention "%code lexer".
4234
4235 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
4236 Include scanner here, using macros from tests/local.at.
4237 (AT_DATA_CALC_Y): Remove final argument.
4238 (_AT_CHECK_JAVA_CALC): Likewise.
4239 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
4240 of %locations and %error-verbose.
4241 (main): Test with and without %lex-param.
4242 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
4243 (AT_BISON_OPTION_POPDEFS): Pop it.
4244
4245 2007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4246
4247 DJGPP spefic issue. Inhibit the use of disallowed characters for
4248 file name genertion on Win98, WinXP, etc. These are |<>":?*\
4249 and concern testsuite case 46.
4250 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
4251 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
4252 * djgpp/config.bat: Inhibit the use of disallowed characters.
4253
4254 2007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
4255
4256 Miscellaneous %define and %code cleanup.
4257 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
4258 values are interpreted.
4259 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
4260 documentation a little more.
4261 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
4262 muscle_percent_define_insert, muscle_percent_code_grow): New
4263 functions/macros.
4264 * src/muscle_tab.h (muscle_percent_define_insert,
4265 muscle_percent_code_grow): Prototype.
4266 * src/parse-gram.y (prologue_declaration): Use
4267 muscle_percent_define_insert and muscle_percent_code_grow when parsing
4268 %define and %code directives.
4269
4270 Make it easy to share %define boolean variables between the front-end
4271 and back-end. Though not used yet, this will be useful in the future.
4272 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
4273 Bison uses of names rather than just skeleton uses of names.
4274 (b4_percent_define_get, b4_percent_define_ifdef): Rename
4275 b4_percent_define_skeleton_variables(VARIABLE) to
4276 b4_percent_define_bison_variables(VARIABLE).
4277 (b4_percent_code_get, b4_percent_code_ifdef): Rename
4278 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
4279 b4_percent_code_bison_qualifiers(QUALIFIER).
4280 (b4_check_user_names_wrap): Update for renames.
4281 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
4282 muscle_percent_define_default): New functions mimicking
4283 b4_percent_define_flag_if and b4_percent_define_default.
4284
4285 For %define variables, report locations for invalid values and
4286 redefinitions.
4287 * data/bison.m4 (b4_percent_define_flag_if): Read
4288 b4_percent_define_loc(VARIABLE) to report the location of an invalid
4289 value for VARIABLE.
4290 (b4_percent_define_default): Save a special location in
4291 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
4292 must later be reported as invalid.
4293 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
4294 functions.
4295 (muscle_percent_define_insert): Record the location of VARIABLE in
4296 muscle percent_define_loc(VARIABLE), and use it to report the previous
4297 location for a redefinition.
4298 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
4299 (muscle_percent_define_default): Update like b4_percent_define_default.
4300 (muscle_grow_user_name_list): Rename to...
4301 (muscle_user_name_list_grow): ... this for consistency and use
4302 muscle_location_grow.
4303 * src/muscle_tab.h (muscle_location_grow): Prototype.
4304 * tests/input.at (%define errors): Update expected output.
4305 * tests/skeletons.at (%define boolean variables: invalid skeleton
4306 defaults): New test case.
4307
4308 2007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
4309
4310 * src/print.c (lookahead_set, state_default_rule): Remove.
4311 (print_reductions): Replace state_default_rule invocation with
4312 equivalent use of yydefact, which was computed in token_actions in
4313 tables.c.
4314 (print_results): Don't allocate lookahead_set.
4315
4316 2007-02-27 Paolo Bonzini <bonzini@gnu.org>
4317
4318 * data/lalr1.java: Prefix all private members with yy.
4319
4320 2007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
4321
4322 Use YYFPRINTF instead of fprintf where appropriate. Reported by
4323 Sebastien Fricker at
4324 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
4325 * THANKS: Add Sebastien Fricker.
4326 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
4327 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
4328 accept a variable number of arguments.
4329
4330 2007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
4331
4332 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
4333
4334 2007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4335
4336 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
4337 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
4338 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
4339
4340 2007-02-11 Paul Eggert <eggert@cs.ucla.edu>
4341
4342 Undo my 2007-02-07 change, switching back to the c-strcase module
4343 introduced in the 2007-02-03 change. Bruno Haible reported that
4344 the 2007-02-07 change would be dangerous in Turkish if we add a
4345 language whose name contains "i", since "i" is not lowercase "I"
4346 in Turkish.
4347 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
4348 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
4349 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
4350 * m4/.cvsignore: Remove strcase.m4.
4351 * src/getargs.c: Revert 2007-02-07 change, as follows.
4352 Include c-strcase.h.
4353 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
4354
4355 2007-02-11 Bruno Haible <bruno@clisp.org>
4356
4357 Enable the Java related testsuite tests when the only Java compiler
4358 found is a gcj < 4.3. Discussed at
4359 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
4360 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
4361
4362 2007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
4363
4364 * data/Makefile.am: Update copyright date.
4365 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
4366 yypstate_new returns NULL.
4367 (yypstate_new): Return NULL if malloc does.
4368 * src/reader.c (packgram): Move translation of rule actions from the
4369 beginning of packgram to...
4370 (check_and_convert_grammar): ... here right before packgram is invoked
4371 so it's easier to write more complete comments, and remove redundant
4372 code.
4373
4374 2007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
4375
4376 As in semantic actions, make @$ in %initial-action, %destructor, and
4377 %printer imply %locations.
4378 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
4379 scanning @$.
4380 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
4381 (@$ in %initial-action implies %locations,
4382 @$ in %destructor implies %locations,
4383 @$ in %printer implies %locations): ... these new test cases.
4384
4385 2007-02-07 Paul Eggert <eggert@cs.ucla.edu>
4386
4387 Undo most of the 2007-02-03 change, switching to the strcase module
4388 now that gnulib strcase has been fixed.
4389 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
4390 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
4391 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
4392 * m4/.cvsignore: Add strcase.m4.
4393 * src/getargs.c: Revert 2007-02-03 change, as follows.
4394 Don't include c-strcase.h.
4395 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
4396 strcasecmp has "unspecified behavior" outside the POSIX locale,
4397 but it works fine in practice if at least one argument is ASCII,
4398 as is the case in Bison.
4399
4400 2007-02-07 Paolo Bonzini <bonzini@gnu.org>
4401
4402 * tests/java.at: Skip tests if only one of javac/java is present.
4403 Reported by Joel E. Denny.
4404 * tests/atlocal.in: Adjust copyright years.
4405
4406 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
4407
4408 * data/lalr1.java (Stack): Work around old verifiers that disallow
4409 access to the private fields of an inner class, from the outer class.
4410 We can make Stack's fields public because user code doesn't have access
4411 to the instance of Stack used by parse(). Reported by Paul Eggert.
4412
4413 2007-02-03 Paul Eggert <eggert@cs.ucla.edu>
4414
4415 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
4416 the right spot for these files?
4417 * bootstrap.conf (gnulib_modules): Add c-strcase.
4418 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
4419 c-strncasecmp.c.
4420 * src/getargs.c: Include c-strcase.h.
4421 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
4422 to avoid unspecified behavior.
4423
4424 2007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
4425
4426 * doc/bison.texinfo (Decl Summary): Correct typo.
4427
4428 2007-01-30 Paolo Bonzini <bonzini@gnu.org>
4429
4430 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
4431 Complain if the value does not match empty, "true" or "false".
4432 * data/c++.m4: Adjust default definitions of %define variables.
4433 * data/java.m4: Adjust default definitions of %define variables.
4434 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
4435 to above behavior.
4436 * tests/input.at (Boolean %define variables): Test new behavior.
4437
4438 2007-01-29 Paolo Bonzini <bonzini@gnu.org>
4439
4440 * NEWS: Mention java.
4441 * TODO: Remove things that are done.
4442 * bootstrap.conf: Add javacomp-script and javaexec-script.
4443 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
4444
4445 * data/Makefile.am: Add new files.
4446 * data/java-skel.m4: New.
4447 * data/java.m4: New.
4448 * data/lalr1.java: New.
4449
4450 * doc/bison.texinfo: Put "A Complete C++ Example" under
4451 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
4452 under Other Languages.
4453
4454 * src/getargs.c (valid_languages): Add Java.
4455 * src/getargs.h (struct bison_language): Update size of string fields.
4456
4457 * tests/Makefile.am: Add java.at.
4458 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
4459 * tests/java.at: New.
4460 * tests/testsuite.at: Include it.
4461
4462 2007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
4463
4464 Clean up.
4465 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
4466 at_directive_argv arguments so these no longer have to be global
4467 variables. Also, update the implementation for the following changes.
4468 (fail_for_at_directive_too_many_args,
4469 fail_for_at_directive_too_few_args): Add at_directive_name argument.
4470 (at_directive_name): Remove as at_directive_argv[0] will be used for
4471 this now.
4472 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
4473 for the directive name.
4474 (at_directive_argc, at_directive_argv): Make these local within
4475 skel_lex instead of global.
4476 (INITIAL): Update directive start action for above changes.
4477 (SC_AT_DIRECTIVE_ARG): Rename to...
4478 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
4479 (SC_AT_DIRECTIVE_SKIP_WS): Update.
4480 (scan_skel): Move yylex_destroy to...
4481 (skel_scanner_free): ... here.
4482 * tests/skeletons.at (installed skeleton file name): Rename to...
4483 (installed skeleton file names): ... this.
4484
4485 2007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
4486
4487 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
4488 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
4489 Summary" not "Directives".
4490 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
4491 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
4492 since the former is now the more complete one.
4493 (Prologue Alternatives): Likewise and do the same for %defines.
4494 (Table of Symbols): Add summary of %code, add summary of %define, and
4495 move full %code documentation to...
4496 (Decl Summary): ... here for consistency with other entries in these
4497 sections.
4498 Move %define entry in order to keep this list alphabetized.
4499 Reword %define entry a little to put less emphasis on the skeleton
4500 concept, which most users shouldn't have to think about.
4501
4502 2007-01-26 Paul Eggert <eggert@cs.ucla.edu>
4503
4504 Adjust to recent gnulib changes.
4505 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
4506 Add string.h, string_.h, unistd_.h, wchar_.h.
4507 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
4508 * src/system.h: Don't include <stpcpy.h>; this is now done by
4509 <string.h>.
4510
4511 2007-01-23 Paolo Bonzini <bonzini@gnu.org>
4512
4513 Simplify implementation of unqualified %code, implement macros for
4514 uniform treatment of boolean %define flags. Document %define.
4515 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
4516 b4_percent_code_ifdef): New.
4517 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
4518 * data/c++.m4: Define default value for global_tokens_and_yystype.
4519 * data/glr.cc: Likewise.
4520 * data/location.cc: Use b4_percent_define_flag_if.
4521
4522 * doc/bison.texinfo (Decl Summary): Document %define.
4523
4524 * src/parse-gram.y (Unqualified %code): Change muscle name to
4525 b4_percent_code().
4526 (content.opt): Default to empty.
4527
4528 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
4529
4530 Implement support for relative and absolute skeleton file names.
4531 Discussed starting at
4532 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
4533 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
4534 (Bison Options): Document in --skeleton entry.
4535 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
4536 full_skeleton can't necessarily hold all of pkgdatadir.
4537 If the specified skeleton file name contains a `/', don't prepend
4538 pkgdatadir.
4539 * src/parse-gram.y (prologue_declaration): If the specified skeleton
4540 file name contains a `/', prepend the grammar file directory.
4541 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
4542 * skeletons.at: New file.
4543 (relative skeleton file names): New test case.
4544 (installed skeleton file names): New test case.
4545 * tests/testsuite.at: Include skeletons.at.
4546
4547 * bootstrap: Update copyright to 2007.
4548
4549 2007-01-17 Paolo Bonzini <bonzini@gnu.org>
4550
4551 * bootstrap: Remove occurrences of .#bootmp from the files.
4552
4553 2007-01-17 Akim Demaille <akim@epita.fr>
4554
4555 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
4556 nonterminals.
4557 Use per-type %printer.
4558
4559 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
4560
4561 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
4562 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
4563 djgpp/config.site, src/files.c, src/files.h, src/main.c,
4564 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
4565 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
4566 tests/glr-regression.at, tests/input.at, tests/local.at,
4567 tests/output.at, tests/torture.at: Update copyright to 2007.
4568
4569 2007-01-16 Akim Demaille <akim@epita.fr>
4570
4571 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
4572 error code.
4573 (Calc++ Scanner): Exit with failure if we can't open the input
4574 file.
4575 Accept "-" standing for stdin.
4576 (Calc++ Top Level): Print the result only if the parsing was
4577 successful.
4578
4579 2007-01-16 Akim Demaille <akim@epita.fr>
4580
4581 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
4582
4583 2007-01-15 Paolo Bonzini <bonzini@gnu.org>
4584 and Joel E. Denny <jdenny@ces.clemson.edu>
4585
4586 Clean up %define and %code implementation in M4 some. Most
4587 importantly, rename all related macros to be in the b4_percent_define
4588 and b4_percent_code namespaces. Also, complete support for `.' in
4589 %define variable names and %code qualifiers.
4590 * data/bison.m4 (b4_check_user_names): Check for special
4591 "SKELETON-NAMESPACE(name)" macros instead of using two nested
4592 m4_foreach loops.
4593 (b4_get_percent_define, b4_get_percent_code): Rename to...
4594 (b4_percent_define_get, b4_percent_code_get): ... these.
4595 Extend documentation with examples.
4596 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
4597 b4_percent_define_skeleton_variables and
4598 b4_percent_code_skeleton_qualifiers.
4599 Expect any value for the %define variable `foo' to be stored in the
4600 macro named `b4_percent_define(foo)'; expect any %code blocks for the
4601 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
4602 expect any unqualified %code blocks to be stored in a macro named
4603 `b4_percent_code_unqualified'.
4604 Use m4_indir so that %define variable names and %code qualifiers can
4605 contain `.', which is allowed by the grammar parser.
4606 (b4_percent_define_default): New macro to set a default value for a
4607 %define variable.
4608 (m4_wrap): Update wrapped code, and fix some underquoting.
4609 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
4610 Expect grammar uses of %define variables and %code qualifiers to be
4611 defined in b4_percent_define_user_variables and
4612 b4_percent_code_user_qualifiers.
4613 * data/c++.m4: Use b4_percent_define_default rather than
4614 m4_define_default. Fix some underquoting. Skeleton usage of %define
4615 variable define_location_comparison now implies skeleton usage of
4616 %define variable filename_type.
4617 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
4618 data/push.c, data/yacc.c: Update macro names.
4619 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
4620 muscle names.
4621
4622 2007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4623
4624 DJGPP specific issues.
4625
4626 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
4627 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
4628
4629 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
4630
4631 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
4632 run parsers in all tests so that Valgrind is invoked during
4633 maintainer-check-valgrind.
4634 (Duplicate representation of merged trees): Free all semantic values.
4635 (Duplicated user destructor for lookahead): Likewise.
4636
4637 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
4638
4639 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
4640 command-line prefix.
4641 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
4642 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
4643 miss Valgrind messages.
4644 (Exploding the Stack Size with Malloc): Likewise.
4645
4646 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
4647
4648 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
4649 locals. Reported by Juan Manuel Guerrero at
4650 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
4651 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
4652 Fix some indentation also.
4653 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
4654 explaining this issue.
4655
4656 2007-01-09 Paolo Bonzini <bonzini@gnu.org>
4657 and Joel E. Denny <jdenny@ces.clemson.edu>
4658
4659 Simplify union and prologue handling, and escape union and lex/parse
4660 params with digraphs.
4661 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
4662 values to the empty string since these are no longer guaranteed
4663 initialized by the front-end.
4664 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
4665 braces around b4_user_stype since this is no longer done by the
4666 front-end.
4667 * src/files.c, src/files.h (pre_prologue_obstack,
4668 post_prologue_obstack): Remove.
4669 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
4670 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
4671 with digraphs. This fixes lex params and parse params.
4672 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
4673 * src/output.c (prepare): Remove muscle insertion of the prologues.
4674 (output): Remove freeing of pre_prologue_obstack and
4675 post_prologue_obstack.
4676 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
4677 than prologue_augment for prologue parsing so you don't need prologue
4678 obstacks.
4679 (grammar_declaration): For %union RHS, use `braceless' instead of
4680 "{...}" so that braces are already stripped and code is escaped with
4681 digraphs.
4682 * src/reader.c (prologue_augment): Remove.
4683 (reader): Remove initialization of pre_prologue_obstack and
4684 post_prologue_obstack.
4685 * src/reader.h (prologue_augment): Remove.
4686
4687 * data/c.m4: Remove stray parenthesis.
4688
4689 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
4690
4691 Remove quotes from variables names in %define directives and from
4692 qualifiers in %code directives, and restrict the characters that are
4693 allowed in them to M4-friendly ones. For %define, continue to support
4694 the quoted form as a deprecated feature. Discussed starting at
4695 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
4696 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
4697 %code.
4698 * doc/bison.texinfo (Prologue Alternatives): Update.
4699 (Decl Summary): In %defines entry, update mention of `%code requires'
4700 and `%code provides'.
4701 (C++ Location Values): Update %define uses.
4702 (Calc++ Parser Interface): Likewise.
4703 (Calc++ Parser): Likewise, and update `%code requires' uses.
4704 (Table of Symbols): Update %code documentation.
4705 * src/parse-gram.y (prologue_declaration): For %define variables, use
4706 `variable' instead of `STRING'.
4707 (grammar_declaration): For %code qualifiers, use `ID' instead of
4708 `STRING'.
4709 (variable): New nonterminal that takes an `ID' or a `STRING'.
4710 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
4711 and %define uses.
4712 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
4713 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
4714 (%define errors): Update %define uses.
4715
4716 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
4717
4718 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
4719 instead of muscle_insert for %define values so that M4-special
4720 characters are replaced with digraphs.
4721 * tests/input.at (%define errors): Extend to check weird values.
4722
4723 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
4724
4725 Instead of having skeletons declare all valid %define variables and
4726 %code qualifiers, provide macros that retrieve the associated values
4727 and build these lists automatically. Thus Bison will now warn when a
4728 variable or qualifier is not used by the skeleton in the current
4729 invocation regardless of whether it might sometimes be used by that
4730 skeleton in other invocations. Also, move all %define value macros to
4731 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
4732 form, which is replaced by %code.
4733 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
4734 (b4_check_user_names): ... this, and change the series of valid name
4735 arguments to a single list argument for names used in the skeleton
4736 similar to the existing list argument for names used in the grammar.
4737 Warn instead of complaining.
4738 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
4739 values and %code code, to format %code code properly, and to build
4740 lists of all %define variables and %code qualifiers used in the
4741 skeleton: b4_skeleton_percent_define_variables and
4742 b4_skeleton_percent_code_qualifiers.
4743 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
4744 Remove, and...
4745 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
4746 the skeleton names lists can finish building first. In place of
4747 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
4748 expect the lists b4_user_percent_define_variables and
4749 b4_user_percent_code_qualifiers.
4750 * data/c++.m4: Where setting default values for b4_parser_class_name,
4751 b4_location_type, b4_filename_type, b4_namespace, and
4752 b4_define_location_comparison, update their names to the
4753 b4_percent_define_ namespace.
4754 * data/glr.c: Don't use b4_check_percent_define_variables and
4755 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
4756 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
4757 (b4_parser_class_name, b4_namespace): Define these using
4758 b4_get_percent_define for parser_class_name and namespace.
4759 * data/location.cc: Use b4_get_percent_define.
4760 * data/push.c: Don't use b4_check_percent_define_variables and
4761 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
4762 * data/yacc.c: Likewise, and don't call m4_exit in
4763 b4_use_push_for_pull_if or m4_wrap code will never execute.
4764 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
4765 Rename to...
4766 (muscle_grow_user_name_list): ... this for consistency with the
4767 terminology used in bison.m4.
4768 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
4769 %define variable names, and rename muscle used_percent_define_variables
4770 to user_percent_define_variables.
4771 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
4772 user_percent_code_qualifiers.
4773 (content): Remove.
4774 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
4775 {CODE} form is no longer accepted.
4776 * tests/input.at (Reject bad %code qualifiers): Rename to...
4777 (Reject unused %code qualifiers): ... this, and update test output.
4778 (%define error): Update test output.
4779
4780 2007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
4781
4782 Check for unrecognized %define variables similar to checking for
4783 unrecognized %code qualifiers. Check for redefined %define variables.
4784 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
4785 generalizes...
4786 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
4787 (b4_check_percent_define_variables): New, also wraps it.
4788 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
4789 variables using b4_check_percent_define_variables.
4790 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
4791 all those exercised in the test suite and all those listed in the
4792 `Default values' section of c++.m4. Are there others?
4793 * data/push.c, data/yacc.c: Declare no valid %define variables.
4794 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
4795 similar to muscle_find, but it works even when the muscle stores a
4796 const value.
4797 (muscle_grow_used_name_list): New function for constructing the used
4798 name list muscles that b4_check_for_unrecognized_names requires.
4799 * src/parse-gram.y (prologue_declaration): Warn if a variable is
4800 %define'd more than once. Define the b4_used_percent_define_variables
4801 muscle with muscle_grow_used_name_list.
4802 (grammar_declaration): Abbreviate %code code with
4803 muscle_grow_used_name_list.
4804 * tests/input.at (%define errors): New.
4805
4806 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
4807
4808 Provide warn_at, complain_at, and fatal_at function callbacks to the
4809 skeletons, and use this for %code qualifier complaints.
4810 * data/bison.m4 (b4_error_at): New, invoked by...
4811 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
4812 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
4813 @fatal_at(...@) directives.
4814 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
4815 qualifiers in b4_used_percent_code_qualifiers and to use
4816 b4_complain_at.
4817 * src/location.c, src/location.h (boundary_set_from_string): New global
4818 function.
4819 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
4820 function.
4821 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
4822 to b4_used_percent_code_qualifiers.
4823 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
4824 function.
4825 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
4826 (lineno): Rename to...
4827 (out_lineno): ... this so I don't misunderstand it again.
4828 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
4829 here; these newlines are in the input but not the output file.
4830 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
4831 (at_directive_perform): ... this new static function, and add handling
4832 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
4833 directives.
4834 * tests/input.at (Reject bad %code qualifiers): Update test output with
4835 locations and extend.
4836
4837 * tests/output.at (Output file name: [, Output file name: ]): Remove
4838 bogus comment about these tests failing.
4839
4840 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
4841
4842 Clean up b4_check_percent_code_qualifiers a little.
4843 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
4844 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
4845 documentation and add examples.
4846 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
4847 qualifiers here.
4848
4849 2007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
4850
4851 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
4852 unreliable -- especially when they're hidden inside another macro.
4853 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
4854 data/c.m4: Remove m4_divert(-1).
4855 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
4856 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
4857 m4_divert_push(0) and m4_divert_pop(0).
4858 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
4859 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
4860 pushed and popped by m4sugar, should be first on the stack.
4861
4862 Provide warn, complain, and fatal function callbacks to the skeletons.
4863 This provides more flexibility than m4_fatal, improves the error
4864 message format, and captures messages for translation. Discussed
4865 starting at
4866 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
4867 * data/bison.m4 (b4_error): New, invoked by...
4868 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
4869 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
4870 directives. Because these M4 macros might be called when the current
4871 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
4872 the previous removal of uses of m4_divert, which caused trouble.
4873 (b4_check_percent_code_qualifiers): Use b4_complain instead of
4874 m4_fatal to report unrecognized %code qualifiers.
4875 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
4876 push parser requests.
4877 * data/glr.c: Use b4_complain instead of m4_fatal to report
4878 non-deterministic push parser requests.
4879 Update @output usage to @output(...@) form.
4880 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
4881 report missing %defines. Update @output usage to @output(...@) form.
4882 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
4883 @output(...@) form.
4884 * src/main.c (main): Invoke skel_scanner_free.
4885 * src/scan-skel.h (skel_scanner_free): Prototype new function.
4886 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
4887 obstack_for_string from flex-scanner.h.
4888 (YY_DECL): Use to declare skel_lex static.
4889 (decode_at_digraphs): Remove; now handled in the new
4890 SC_AT_DIRECTIVE_ARG start condition.
4891 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
4892 functions.
4893 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
4894 at_directive_argv): New static globals.
4895 (INITIAL): Use fail_for_invalid_at.
4896 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
4897 recognize the start of a generalized `@directive(...@)' form and
4898 start...
4899 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
4900 directive args (using the new obstack_for_string), to decode the
4901 contained @ diagraphs, and to perform the directive. It recognizes
4902 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
4903 @output(...@).
4904 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
4905 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
4906 `@,'.
4907 (scan_skel): Initialize obstack_for_string on the first call.
4908 (skel_scanner_free): New function to free obstack_for_string.
4909 * tests/input.at (Reject bad %code qualifiers): Update test output.
4910
4911 2007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
4912
4913 Consolidate the 4 prologue alternative directives (%code, %requires,
4914 %provides, and %code-top) into a single %code directive with an
4915 optional qualifier field. Discussed at
4916 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
4917 * NEWS (2.3a+): Rewrite the existing entry for the prologue
4918 alternatives.
4919 * doc/bison.texinfo (Prologue Alternatives): Update.
4920 (Decl Summary): Update to %code "requires" and %code "provides".
4921 (Calc++ Parser): Update to %code "requires".
4922 (Table of Symbols): Remove entries for %requires, %provides, and
4923 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
4924 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
4925 are replaced by b4_percent_code_provides and b4_percent_code_requires,
4926 which are skeleton-specific.
4927 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
4928 declare what %code qualifiers it supports and to complain if any other
4929 qualifiers were used in the grammar.
4930 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
4931 and b4_user_code([b4_percent_code_provides]) in place of
4932 b4_user_requires and b4_user_provides.
4933 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
4934 Add b4_user_code([b4_percent_code_top]) and
4935 b4_user_code([b4_percent_code]).
4936 Invoke b4_check_percent_code_qualifiers.
4937 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
4938 PERCENT_REQUIRES): Remove.
4939 (grammar_declaration): Remove RHS's for %code-top, %provides, and
4940 %requires. Rewrite the %code RHS as the unqualified form defining the
4941 muscle b4_percent_code. Add another RHS for the qualified %code form,
4942 which defines muscles of the form b4_percent_code_QUALIFIER and the
4943 b4_used_percent_code_qualifiers muscle.
4944 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
4945 PERCENT_REQUIRES): Remove.
4946 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
4947 %code "requires" and %code "provides".
4948 * tests/input.at (Reject bad %code qualifiers): New.
4949
4950 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
4951
4952 Use the new code_props interface for destructors and printers.
4953 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
4954 printer_location members, and change the type of the destructor and
4955 printer members to code_props.
4956 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
4957 symbol_printer_get, semantic_type_destructor_set,
4958 semantic_type_printer_set, default_tagged_destructor_set,
4959 default_tagless_destructor_set, default_tagged_printer_set,
4960 default_tagless_printer_set): Use code_props in arguments and return
4961 types in place of char const * and location.
4962 (symbol_destructor_location_get, symbol_printer_location_get): Remove
4963 since the locations are now contained in the return of
4964 symbol_destructor_get and symbol_printer_get.
4965 * src/output.c (symbol_destructors_output, symbol_printers_output):
4966 Replace with...
4967 (symbol_code_props_output): ... this to eliminate duplicate code.
4968 (output_skeleton): Update to use symbol_code_props_output.
4969 * src/reader.c (symbol_should_be_used): Update use of
4970 symbol_destructor_get.
4971 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
4972 Update uses of the various _destructor_set and _printer_set functions.
4973 * src/symtab.c: (default_tagged_destructor_location,
4974 default_tagless_destructor_location, default_tagged_printer_location,
4975 default_tagless_printer_location): Remove since we...
4976 (default_tagged_destructor, default_tagless_destructor,
4977 default_tagged_printer, default_tagless_printer): ... change the type
4978 of these to code_props.
4979 (symbol_new, semantic_type_new, symbol_destructor_set,
4980 semantic_type_destructor_set, symbol_destructor_get,
4981 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
4982 symbol_check_alias_consistency, default_tagged_destructor_set,
4983 default_tagless_destructor_set, default_tagged_printer_set,
4984 default_tagless_printer_set): Update.
4985 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
4986 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
4987 code_props members.
4988 (symbol_print): Use SYMBOL_CODE_PRINT.
4989
4990 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
4991
4992 Use the new code_props interface for rule actions.
4993 * src/symlist.h (symbol_list): Replace action, action_location, and
4994 used members with a code_props action_props member.
4995 * src/reader.c (symbol_should_be_used, grammar_rule_check,
4996 grammar_midrule_action, grammar_current_rule_merge_set,
4997 grammar_current_rule_symbol_append, packgram): Update.
4998 * src/scan-code.h (translate_rule_action): Remove, no longer used.
4999 * src/scan-code.l (handle_action_dollar): Update.
5000 (translate_rule_action): Remove, no longer used.
5001 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
5002
5003 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
5004
5005 Use the new code_props interface in parse-gram.y.
5006 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
5007 Update all uses of translate_* functions to use the new code_props
5008 interface and to use gram_scanner_last_string_free and
5009 code_scanner_last_string_free where possible.
5010 (grammar_declaration): symbol_list_destructor_set and
5011 symbol_list_printer_set now perform the translation, so don't do it
5012 here. Use gram_scanner_last_string_free where possible.
5013 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
5014 translate_code): Remove, no longer used.
5015 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
5016 symbol_list_printer_set): Perform code translation here rather than
5017 depending on the caller to do so.
5018
5019 * src/symlist.h (struct symbol_list): Correct some documentation typos.
5020 * src/scan-gram.h (gram_last_string): Remove declaration.
5021 * src/scan-gram.l (last_string): Declare it static.
5022
5023 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
5024
5025 Encapsulate code properties and related functionality for the various
5026 destructors, printers, and actions into a code_props structure and
5027 interface. This patch merely implements code_props in scan-code.h and
5028 scan-code.l. Future patches will rewrite other modules to use it.
5029 Discussed starting at
5030 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
5031 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
5032 consistently initialize const structs that have an empty location
5033 field.
5034 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
5035 to ensure consistency.
5036 * src/scan-code.h (code_props): New structure.
5037 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
5038 function, macro, and const global variable for initializing a
5039 code_props with no code.
5040 (code_props_plain_init, code_props_symbol_action_init,
5041 code_props_rule_action_init, code_props_translate_code): The rest of
5042 the new code_props functional interface. Among other things, the init
5043 functions set the code_props kind field so that
5044 code_props_translate_code will know whether to behave like
5045 translate_symbol_action, translate_rule_action, or translate_code.
5046 These old translate functions must remain until all other modules are
5047 updated to use the new code_props interface.
5048 (code_scanner_last_string_free): New function similar to
5049 gram_scanner_last_string_free.
5050 (code_scanner_free): Add documentation.
5051 * src/scan-code.l: Implement the new interface.
5052 (code_lex): Make it static, add a code_props* argument, and remove the
5053 rule argument.
5054 (last_string): New static global similar to the one in scan-gram.l.
5055 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
5056 instead of rule.
5057 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
5058 code_props since Bison may one day use this information for destructors
5059 and printers.
5060 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
5061 (handle_action_dollar): Use symbol_list_n_get and set used flag
5062 directly since symbol_list_n_used_set is removed.
5063 (translate_action): Add a code_props* argument and remove the rule,
5064 action, and location arguments. Pass the code_props* on to code_lex.
5065 (translate_rule_action, translate_symbol_action, translate_code):
5066 Rewrite as wrappers around the new code_props interface.
5067 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
5068 it would eventually need to break the encapsulation of code_props.
5069
5070 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
5071
5072 * etc/.cvsignore: New.
5073
5074 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
5075
5076 Add maintainer-push-check to run maintainer-check using push parsing in
5077 place of pull parsing where available.
5078 * Makefile.am (maintainer-push-check): New.
5079 * data/bison.m4 (b4_use_push_for_pull_if): New.
5080 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
5081 appropriately based on their existing values.
5082 (yypush_parse): Don't print push-parser-specific diagnostics if push
5083 parsing is being used in place of pull parsing.
5084 * data/yacc.c: If push parsing should replace pull parsing, redirect to
5085 push.c.
5086 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
5087 variable, and insert b4_use_push_for_pull_flag into muscles.
5088 * tests/Makefile.am (maintainer-push-check): New.
5089
5090 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
5091
5092 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
5093 (whether successful or failed) so that yypush_parse can be invoked
5094 again to start a new parse using the same yypstate.
5095 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
5096 check multiple yypull_parse invocations on the same yypstate. For pull
5097 mode, extend to check multiple yyparse invocations.
5098 (Exploding the Stack Size with Alloca): Extend to try with
5099 %push-pull-parser.
5100 (Exploding the Stack Size with Malloc): Likewise.
5101
5102 * tests/calc.at (Simple LALR Calculator): Don't specify
5103 %skeleton "push.c" since %push-pull-parser implies that now.
5104 * tests/headers.at (export YYLTYPE): Don't check for the push
5105 declarations. Otherwise, this test case can't be used to see if push
5106 mode can truly emulate pull mode.
5107 * tests/input.at (Torturing the Scanner): Likewise.
5108 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
5109 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
5110 AT_YACC_IF, which now includes the case of push mode since %skeleton
5111 need not be used for push mode. This will be more intuitive once
5112 push.c is renamed to yacc.c.
5113
5114 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
5115
5116 For push mode, convert yyparse from a macro to a function, invoke yylex
5117 instead of passing a yylexp argument to yypull_parse, and don't
5118 generate yypull_parse or yyparse unless %push-pull-parser is declared.
5119 Discussed starting at
5120 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
5121 * data/bison.m4 (b4_pull_if): New.
5122 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
5123 * data/push.c: Improve M4 quoting a little.
5124 (b4_generate_macro_args, b4_parenthesize): Remove.
5125 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
5126 any time a pull parser is requested.
5127 Don't #define this as a wrapper around yypull_parse. Instead, when
5128 both push and pull are requested, make it a function that does that
5129 same thing.
5130 (yypull_parse): If there's a b4_prefix, #define this to
5131 b4_prefix[pull_parse] when both push and pull are requested.
5132 Don't define this as a function unless both push and pull are
5133 requested.
5134 Remove the yylexp argument and hard-code yylex invocation instead.
5135 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
5136 %push-parser.
5137 * src/getargs.c (pull_parser): New global initialized to true.
5138 * getargs.h (pull_parser): extern it.
5139 * src/output.c (prepare): Insert pull_flag muscle.
5140 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
5141 (prologue_declaration): Set both push_parser and pull_parser = true for
5142 %push-pull-parser. Set push_parser = true and pull_parser = false for
5143 %push-parser.
5144 * src/scan-gram.l: Don't accept %push_parser as an alternative to
5145 %push-parser since there's no backward-compatibility concern here.
5146 Scan %push-pull-parser.
5147 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
5148 instead of %push-parser.
5149 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
5150 prototype it in the module that calls yyparse.
5151 * tests/input.at (Torturing the Scanner): Likewise.
5152 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
5153
5154 2006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
5155
5156 Update etc/bench.pl. Optimize push mode a little (the yyn change
5157 deserves most of the credit).
5158 * Makefile.am (SUBDIRS): Add etc subdirectory.
5159 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
5160 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
5161 yytoken, yyval, and yyloc declarations to...
5162 (yyparse or yypush_parse): ... here to improve performance. For
5163 yypush_parse invocations after the first, be sure to assign yyn its old
5164 value again.
5165 (yypstate_new): Don't bother initializing the yyresult field since the
5166 initial value isn't used.
5167 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
5168 remove the #define that, in push mode, set it to yyps->NAME.
5169 * etc/Makefile.am: New.
5170 * etc/bench.pl: Remove and build it instead from...
5171 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
5172 "tests/bison" from the build directory by default rather than just
5173 invoking "bison" from $PATH.
5174 (calc_grammar): Update push parser code: don't declare yylval globally,
5175 don't define yyparse_wrapper, and don't #define yyparse.
5176 (bench_grammar): Update to check all working combinations of yacc.c,
5177 push.c, impure, pure, pull, and push.
5178
5179 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
5180
5181 For push mode, add pull wrappers around yypush_parse.
5182 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
5183 (yypull_parse): New function wrapping yypush_parse.
5184 (yyparse): New #define wrapping yypull_parse.
5185 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
5186 is declared.
5187 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
5188 prototype yylex in the module that calls yyparse, and don't prototype
5189 yyparse there. Otherwise, the yyparse expansion won't compile.
5190 * tests/input.at (Torturing the Scanner): Likewise.
5191
5192 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
5193
5194 Enable push parsers to operate in impure mode. Thus, %push-parser no
5195 longer implies %pure-parser. The point of this change is to move
5196 towards being able to test the push parser code by running the entire
5197 test suite as if %push-parser had been declared.
5198 * data/push.c (yypush_parse): For impure mode, remove the
5199 yypushed_char, yypushed_val, and yypushed_loc arguments.
5200 Instead, declare these as local variables initialized to the global
5201 yychar, yylval, and yylloc.
5202 For the first yypush_parse invocation only, restore the initial values
5203 of these global variables when it's time to read a token since they
5204 have been overwritten.
5205 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
5206 %push-parser.
5207 * tests/calc.at (Simple LALR(1) Calculator): Always declare
5208 %pure-parser along with %push-parser since this test case was designed
5209 for pure push parsers.
5210 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
5211 (AT_YACC_OR_PUSH_IF): New.
5212 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
5213 add a note that it's still wrong for some cases (as it has been for a
5214 while).
5215 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
5216 %push-parser no longer implies %pure-parser.
5217
5218 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
5219
5220 Remove some unnecessary differences between the pull parser code and
5221 the push parser code. This patch enables yynerrs in push mode.
5222 * data/push.c: Reformat M4 a little.
5223 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
5224 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
5225 because push mode is on. Instead, if pure mode is on, move yynerrs
5226 to...
5227 (b4_declare_parser_state_variables): ... here.
5228 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
5229 to yyps->NAME so it can be used in yypush_parse.
5230 (yypush_parse): Don't omit uses of yynerrs in push mode.
5231
5232 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
5233
5234 Fix bug such that the first pushed token's value and location are
5235 sometimes overwritten (sometimes by %initial-action) before being used.
5236 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
5237 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
5238 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
5239 more closely mimic the pull parser logic.
5240 Don't copy the pushed token to yychar, yylval, and yylloc until it's
5241 time to read a token, which is after any initialization of yylval and
5242 yylloc.
5243 (gottoken): Rename label to...
5244 (yyread_pushed_token): ... for clarity and to avoid infringing on the
5245 user namespace.
5246
5247 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
5248
5249 Rearrange initialization of the parser state variables so that the
5250 skeleton doesn't have to have a copy for pull mode and another for push
5251 mode. This patch also fixes at least a bug such that yylloc was not
5252 initialized (with b4_location_initial_line and
5253 b4_location_initial_column) upon calling yypush_parse. However, that
5254 initialization now overwrites the first token's location;
5255 %initial-action assigning @$ already did the same thing, and both bugs
5256 will be fixed in a later patch.
5257 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
5258 (b4_declare_parser_state_variables): Remove initialization of yytoken,
5259 yyss, yyvs, yyls, and yystacksize.
5260 (yypstate_new): Remove initialization of some yypstate fields: yystate,
5261 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
5262 yylsp.
5263 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
5264 yyps->NAME so it can be used in yypush_parse.
5265 (yyparse or yypush_parse): For yypush_parse, don't print the
5266 "Starting parse" diagnostic for invocations after the first.
5267 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
5268 yypush_parse, only do it for the first invocation.
5269 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
5270 initialization to occur in yypush_parse but only on the first
5271 invocation.
5272
5273 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
5274
5275 * data/push.c: Add CPP guards around push parser declarations in both
5276 the header and the code file.
5277 In the code file, move the push parser declarations to the same place
5278 they appear in the header file.
5279 Clean up the M4 some, especially the inconsistent underquoting in
5280 some b4_c_function_def and b4_c_function_decl uses.
5281
5282 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
5283
5284 Encapsulate the push parser state variables into an M4 macro so the
5285 push skeleton doesn't have to list them again for pull mode's yyparse.
5286 For push mode, remove yypush_parse's local equivalents of these
5287 variables to eliminate unnecessary copying between the two sets at
5288 run-time. This patch also fixes at least a bug related to multiple
5289 %initial-action invocations in push mode.
5290 * data/push.c (b4_declare_parser_variables): Rename to...
5291 (b4_declare_scanner_communication_variables): ... this for clarity and
5292 update both uses.
5293 (b4_declare_yyparse_variables): Remove and move its contents to the one
5294 spot where it was invoked.
5295 (b4_declare_parser_state_variables): New macro containing the parser
5296 state variables required by push mode.
5297 (struct yypstate): Replace all fields but yynew with
5298 b4_declare_parser_state_variables.
5299 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
5300 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
5301 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
5302 (yyparse or yypush_parse): For yyparse in pull mode, replace local
5303 parser state variable declarations with
5304 b4_declare_parser_state_variables.
5305 Don't initialize parser state variables when calling yypush_parse since
5306 yypstate_new already does that.
5307 Invoke the user's initial action only upon the first yypush_parse
5308 invocation.
5309 Remove all code that copies between the local parser state variables
5310 and the yypstate.
5311
5312 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
5313
5314 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
5315 prevent a name collision in a future patch where these names will
5316 sometimes be #define'd.
5317 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
5318 since it no longer has the same name as the existing argument.
5319 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
5320
5321 2006-12-19 Paolo Bonzini <bonzini@gnu.org>
5322 and Joel E. Denny <jdenny@ces.clemson.edu>
5323
5324 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
5325 that the argument is case-insensitive, and there's no `=' here.
5326 For the %skeleton entry, mention that %language is better.
5327 (Bison Options): Likewise for --language and --skeleton. Move the
5328 --skeleton entry so that the `Tuning the parser' section is sorted
5329 alphabetically on long options.
5330 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
5331 %language directive in detail here; cross-reference the %language
5332 documentation instead.
5333 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
5334 `%require "2.3b"' so that the example is always up-to-date.
5335 (Table of Symbols): Add entries for %language and %skeleton.
5336 * examples/extexi (normalize): Instead of replacing every %require
5337 argument with the current Bison version, just substitute for
5338 `@value{VERSION}'. This guarantees that we're testing what actually
5339 appears in the documentation.
5340 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
5341 rather than `@VERSION@'.
5342
5343 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
5344
5345 * NEWS: Reword the %language news a bit, and put it earlier.
5346
5347 * src/getargs.c (skeleton_arg): Last arg is now location const *.
5348 Rewrite to simplify the logic.
5349 (language_argmatch): Likewise.
5350 (program_name): We now own this var.
5351 * src/getargs.h (struct bison_language): Use char[] rather than
5352 const char *.
5353
5354 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
5355 Java is supported.
5356 * src/complain.c (program_name): Remove decl; no longer needed.
5357 * src/main.c (program_name): Remove; now belongs to getargs.
5358
5359 2006-12-18 Paolo Bonzini <bonzini@gnu.org>
5360
5361 * NEWS: Document %language.
5362
5363 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
5364
5365 * data/c-skel.m4, data/c++-skel.m4: New files.
5366 * data/glr.c: Complain on push parsers.
5367
5368 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
5369 over %skeleton.
5370 (Decl Summary): Document %language and %skeleton.
5371 (Command line): Document -L.
5372
5373 * examples/extexi: Rewrite %require directive.
5374 * examples/calc++/Makefile.am: Pass VERSION to extexi.
5375
5376 * src/files.c (compute_exts_from_gc): Look in language structure
5377 for .y extension.
5378 (compute_file_name_parts): Check whether .tab should be added.
5379 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
5380 (language, skeleton_arg, language_argmatch): New.
5381 (long_options): Add --language.
5382 (getargs): Use skeleton_arg, add -L/--language.
5383 * src/getargs.h: Include location.h.
5384 (struct bison_language, language, skeleton_arg, language_argmatch): New.
5385 * src/output.c (prepare): Pick default skeleton from struct language.
5386 Don't dispatch C skeletons here.
5387 * src/parse-gram.y (PERCENT_LANGUAGE): New.
5388 (prologue_declaration): Add "%language" rule, use skeleton_arg.
5389 * src/scan-gram.l ("%language"): New rule.
5390
5391 * tests/calc.at: Test %skeleton and %language.
5392 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
5393 (AT_GLR_IF): Look for %skeleton "glr.cc".
5394 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
5395 (AT_YACC_IF): Reject %language.
5396
5397 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
5398
5399 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
5400 since it wasn't used; only the typedef name 'semantic_type' is needed.
5401 Also, omit trailing white space.
5402
5403 * bootstrap: Sync from coreutils.
5404 (gnulib_extra_files): Add build-aux/announce.gen.
5405 (slurp): Adjust .gitignore files like .cvsignore files.
5406 * build-aux/announce-gen: Remove from CVS, since bootstrap
5407 now creates this.
5408
5409 2006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
5410
5411 Make %push-parser imply %pure-parser. This fixes several bugs; see
5412 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
5413 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
5414 pure_parser = true.
5415 * data/push.c: Don't bother testing b4_push_if when deciding whether
5416 to expand b4_declare_parser_variables globally.
5417 (yypush_parse): Likewise in here.
5418
5419 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
5420 (yy_reduce_print): Reformat M4 for readability.
5421
5422 2006-12-15 Bob Rossi <bob@brasko.net>
5423 and Joel Denny <jdenny@ces.clemson.edu>
5424
5425 * data/push.c (yypstate): Add typedef, and update all uses of
5426 struct yypstate to just yypstate.
5427 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
5428
5429 2006-12-14 Bob Rossi <bob@brasko.net>
5430
5431 * data/push.c (yypush_parse): Declare prototype regardless of
5432 %locations option.
5433
5434 2006-12-14 Bob Rossi <bob@brasko.net>
5435
5436 * data/push.c (yyparse): Remove the prototype and the #define when in
5437 push-parser mode.
5438
5439 2006-12-13 Bob Rossi <bob@brasko.net>
5440
5441 * data/push.c (yypstate_init): Rename to...
5442 (yypstate_new): ... this and use b4_c_function_def.
5443 (yypstate_delete): New.
5444 (yypush_parse): Change parameters yynval and yynlloc to be const.
5445 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
5446 yypstate_delete functions.
5447
5448 2006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
5449
5450 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
5451 strange test case titles. Reported by Bob Rossi.
5452
5453 2006-12-13 Paul Eggert <eggert@cs.ucla.edu>
5454
5455 * TODO: Add pointer to Sylvain Schmitz's work on static detection
5456 of potential ambiguities in GLR grammers.
5457
5458 2006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
5459
5460 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
5461 `bison ', use m4_index instead of m4_substr since chopping up a string
5462 containing M4-special characters causes problems here.
5463
5464 Fix a couple of bugs related to special characters in user-specified
5465 file names, and make it easier for skeletons to compute output file
5466 names with the same file name prefix as Bison-computed output file
5467 names.
5468 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
5469 b4_parser_file_name and b4_spec_defines_file instead of
5470 @output_parser_name@ and @output_header_name@, which are now redundant.
5471 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
5472 b4_parser_file_name, b4_spec_defines_file, and the new
5473 @basename(FILENAME@) instead of @output_parser_name@ and
5474 @output_header_name@, which inappropriately escaped the file names as
5475 C string literals.
5476 * src/files.c (all_but_ext): Remove static qualifier.
5477 (compute_output_file_names): Move `free (all_but_ext)' to...
5478 (output_file_names_free): ... here since all_but_ext is needed later.
5479 * src/files.h (all_but_ext): Extern.
5480 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
5481 exactly what MUSCLE_INSERT_STRING used to do.
5482 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
5483 characters are escaped properly.
5484 * src/output.c (prepare): Define muscle file_name_all_but_ext as
5485 all_but_ext.
5486 For pkgdatadir muscle, maintain previous functionality by using
5487 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
5488 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
5489 digraphs would never be expanded. Hopefully no one has M4-special
5490 characters in his Bison installation path.
5491 * src/scan-skel.l: Don't parse @output_header_name@ and
5492 @output_parser_name@ anymore since they're now redundant.
5493 In @output, use decode_at_digraphs.
5494 Parse a new @basename command that invokes last_component.
5495 (decode_at_digraphs): New.
5496 (BASE_QPUTS): Remove unused.
5497 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
5498 (Output file name): New tests.
5499
5500 2006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
5501
5502 Warn about output files that are generated by the skeletons and that
5503 conflict with other output files.
5504 * data/glr.c: Don't generate the header file here when glr.cc does.
5505 * src/files.c (file_names, file_names_count): New static globals.
5506 (compute_output_file_names): Invoke output_file_name_check for files
5507 not generated by the skeletons and remove existing checks.
5508 (output_file_name_check): New function that warns about conflicting
5509 output file names.
5510 (output_file_names_free): Free file_names.
5511 * src/files.h (output_file_name_check): Declare.
5512 * src/scan-skel.l: Invoke output_file_name_check for files generated by
5513 the skeletons.
5514 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
5515 (Conflicting output files): New tests.
5516
5517 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5518
5519 * doc/bison.texinfo: Fix a couple of typos.
5520
5521 2006-12-08 Bob Rossi <bob@brasko.net>
5522
5523 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
5524 Rename to...
5525 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
5526 update all uses.
5527 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
5528 (yypush_parse): Rename yypvars argument to yyps and remove redundant
5529 local pv.
5530 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
5531 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
5532
5533 2006-12-07 Bob Rossi <bob@brasko.net>
5534 and Joel Denny <jdenny@ces.clemson.edu>
5535
5536 * data/push.c (yypvarsinit): Change return type from void* to struct
5537 yypvars*. No longer cast to void* on return.
5538 (struct yypvars): Remove yylen since it need not be remembered between
5539 yypushparse invocations.
5540 (yypushparse): Don't copy between yylen and pv->yylen.
5541
5542 2006-12-05 Bob Rossi <bob@brasko.net>
5543
5544 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
5545 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
5546 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
5547 (struct yypvars): Remove b4_declare_parser_variables.
5548 (yypvarsinit): Remove init code for removed variables.
5549 (global scope): Do not declare b4_declare_parser_variables if
5550 push or pure mode.
5551 (yypushparse): Add b4_declare_parser_variables.
5552 Init new local variables, and remove init code for removed
5553 yypvars variables.
5554 (yyparse): Delete.
5555 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
5556 and yyparse for other modes.
5557 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
5558 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
5559 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
5560 (AT_PURE_LEX_IF): True if pure or push parser.
5561
5562 2006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
5563
5564 Document Yacc prologue alternatives and default %destructor's and
5565 %printer's as experimental. Don't mention Java yet. Discussed at
5566 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
5567 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
5568 (2.3a): Annotate this entry to say the old forms of these features were
5569 also experimental.
5570 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
5571 Table of Symbols): Say they're experimental. Comment out any mention
5572 of Java (we'll want this back eventually).
5573
5574 2006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
5575
5576 Support a file name argument to %defines. Deprecate `=' in
5577 %file-prefix, %name-prefix, and %output. Discussed at
5578 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
5579 * NEWS (2.3a+): Mention.
5580 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
5581 form of %defines, and remove `=' from entries for %file-prefix,
5582 %name-prefix, and %output.
5583 * src/parse-gram.y (prologue_declaration): Implement.
5584 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
5585 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
5586 all but one occurrence of %name-prefix.
5587 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
5588 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
5589 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
5590 occurrence of each of %file-prefix and %output. Add check for %defines
5591 with argument.
5592 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
5593 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
5594 Remove the `=' from %output.
5595
5596 2006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
5597
5598 Don't escape $ in test case titles since Autoconf 2.61 now does that
5599 correctly.
5600 * tests/actions.at (Default %printer and %destructor are not for error
5601 or $undefined): Here.
5602 (Default %printer and %destructor are not for $accept): Here.
5603 * tests/input.at (Invalid $n and @n): Here.
5604
5605 2006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
5606
5607 Rename <!> to <>. Discussed starting at
5608 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
5609 * NEWS (2.3a+): Update.
5610 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
5611 Update.
5612 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
5613 * src/scan-gram.l (INITIAL): Implement.
5614 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
5615 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
5616 comment.
5617 * tests/actions.at (Default tagless %printer and %destructor,
5618 Default tagged and per-type %printer and %destructor,
5619 Default %printer and %destructor are not for error or $undefined,
5620 Default %printer and %destructor are not for $accept,
5621 Default %printer and %destructor for mid-rule values): Update.
5622 * tests/input.at (Default %printer and %destructor redeclared,
5623 Unused values with default %destructor): Update.
5624
5625 2006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
5626
5627 Don't let %prec take a nonterminal.
5628 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
5629 token.
5630 * tests/input.at (%prec takes a token): New test checking that %prec
5631 won't take a nonterminal.
5632
5633 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
5634
5635 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
5636 it was double-quoted.
5637 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
5638 grammar is maintained with Bison's highest standards.
5639 * src/getargs.c: Fix some typos in Doxygen comments.
5640
5641 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
5642
5643 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
5644 later. Reported by Paul Eggert in
5645 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
5646 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
5647 * src/scan-code.l (translate_action): Don't bother invoking
5648 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
5649 (code_scanner_free): Instead of invoking
5650 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
5651 which frees more.
5652 * src/scan-gram.l (gram_scanner_free): Likewise.
5653 * src/scan-skel.l (scan_skel): Likewise.
5654
5655 2006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
5656
5657 * src/files.c (tr): Change return type to void.
5658 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
5659 has been called previously for the same key.
5660 (muscle_find): Return storage instead of value so that
5661 --enable-gcc-warnings doesn't produce warnings that the return discards
5662 const. aver that the value and storage are the same since storage
5663 could potentially be NULL when value is not.
5664 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
5665 same as 0.
5666
5667 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
5668
5669 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
5670 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
5671 us a slightly cleaner distribution, and also works.
5672 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
5673 gnulib changes.
5674
5675 2006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
5676 and Paul Eggert <eggert@cs.ucla.edu>
5677
5678 Don't let Bison leak memory except when it complains.
5679 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
5680 (spec_defines_file, dir_prefix): Now char *, not const char *,
5681 since they are freed.
5682 * src/files.c: Likewise.
5683 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
5684 Likewise.
5685 (tr): Now operates in-place. All uses changed.
5686 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
5687 values.
5688 (compute_file_name_parts, compute_output_file_names): Don't store
5689 read-only data in variables that will be freed.
5690 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
5691 src_extension, and header_extension.
5692 (output_file_names_free): New public function to free
5693 spec_verbose_file, spec_graph_file, spec_defines_file,
5694 parser_file_name, and dir_prefix.
5695 * src/getargs.c (getargs): Don't store read-only data in variables that
5696 will be freed.
5697 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
5698 (which previously existed but was unused), and quotearg_free.
5699 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
5700 * src/muscle_tab.c: Likewise.
5701 (muscle_entry): Make the value char const *,
5702 and add a new storage member that is char * and can be freed.
5703 (muscle_entry_free): New private function.
5704 (muscle_init): Use it instead of free.
5705 (muscle_insert, muscle_grow): Update and use new storage member.
5706 (muscle_code_grow): Free the string passed to muscle_grow
5707 since it's not needed anymore.
5708 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
5709 add a new `char *code' member.
5710 ("{...}"): Declare semantic type as code.
5711 * src/scan-code.h (translate_rule_action):
5712 (translate_symbol_action, translate_code, translate_action): Return
5713 `char const *' rather than `char *' since external code should not free
5714 these strings.
5715 * src/scan-code.l: Likewise.
5716 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
5717 which is "{...}" in the parser.
5718 * tests/Makefile.am (maintainer-check-valgrind): Set
5719 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
5720 Valgrind.
5721 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
5722 complain.
5723 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
5724 expecting a non-zero exit status sets --leak-check=summary and
5725 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
5726 this case, and we don't want to hear about it.
5727
5728 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
5729
5730 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
5731 instead of from the template, to simplify configuration a bit.
5732 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
5733 and m4/wint_t.m4, as they are needed with the latest gnulib.
5734
5735 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
5736
5737 Disable unset/unused mid-rule value warnings by default, and recognize
5738 --warnings=midrule-values to enable them. Discussed starting at
5739 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
5740 * NEWS (2.3a+): Mention.
5741 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
5742 warnings): Add entry for midrule-values subargument.
5743 * src/reader.c (symbol_should_be_used): Don't return true just because
5744 the value is a set/used mid-rule value unless
5745 --warnings=midrule-values was specified.
5746 * tests/input.at (Unused values, Unused values before symbol
5747 declarations): Run tests with and without --warnings=midrule-values.
5748
5749 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
5750 than LIST_FREE directly.
5751
5752 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
5753
5754 Finish implementing --warnings=error, which should not be implied by
5755 --warnings=all (or by its synonyms -W and --warnings without
5756 subarguments).
5757 * src/complain.c (set_warning_issued): New function to report that
5758 warnings are being treated as errors and to record an error if so.
5759 Invoke...
5760 (warn_at, warn): ... here.
5761 * src/getargs.c (warnings_args, warnings_types): Reorder so that
5762 "error - warnings are errors" does not appear above "all - all of the
5763 above".
5764 (getargs): For -W and --warnings without subarguments, don't let
5765 FLAGS_ARGMATCH set warnings_error in warnings_flag.
5766 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
5767
5768 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
5769
5770 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
5771 empty subargument list. For example: `bison --warnings= parser.y'.
5772
5773 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
5774
5775 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
5776 the parser header file so that gcc doesn't warn.
5777
5778 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
5779
5780 Split the default %destructor/%printer into two kinds: <*> and <!>.
5781 Discussed starting at
5782 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
5783 * NEWS (2.3a+): Mention.
5784 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
5785 previous change today related to mid-rules.
5786 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
5787 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
5788 (TYPE_TAG_ANY): Add as <*>.
5789 (TYPE_TAG_NONE): Add as <!>.
5790 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
5791 for <*> and <!>.
5792 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
5793 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
5794 * src/symlist.c (symbol_list_default_new): Split into tagged and
5795 tagless versions.
5796 (symbol_list_destructor_set, symbol_list_printer_set): Split
5797 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
5798 SYMLIST_DEFAULT_TAGLESS.
5799 * src/symlist.h: Update symbol_list_default*_new prototypes.
5800 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
5801 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
5802 * src/symtab.c (default_destructor, default_destructor_location,
5803 default_printer, default_printer_location): Split each into tagged and
5804 tagless versions.
5805 (symbol_destructor_get, symbol_destructor_location_get,
5806 symbol_printer_get, symbol_printer_location_get): Implement tagged
5807 default and tagless default cases.
5808 (default_destructor_set, default_printer_set): Split each into tagged
5809 and tagless versions.
5810 * src/symtab.h: Update prototypes.
5811 * tests/actions.at (Default %printer and %destructor): Rename to...
5812 (Default tagless %printer and %destructor): ... this, and extend.
5813 (Per-type %printer and %destructor): Rename to...
5814 (Default tagged and per-type %printer and %destructor): ... this, and
5815 extend.
5816 (Default %printer and %destructor for user-defined end token): Extend.
5817 (Default %printer and %destructor are not for error or $undefined):
5818 Update.
5819 (Default %printer and %destructor are not for $accept): Update.
5820 (Default %printer and %destructor for mid-rule values): Extend.
5821 * tests/input.at (Default %printer and %destructor redeclared): Extend.
5822 (Unused values with default %destructor): Extend.
5823
5824 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
5825
5826 Don't apply the default %destructor/%printer to an unreferenced midrule
5827 value. Mentioned at
5828 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
5829 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
5830 like $@n instead of just @n so that the default %destructor/%printer
5831 logic doesn't see them as user-defined symbols.
5832 (symbol_is_dummy): Check for both forms of the name.
5833 * src/reader.c (packgram): Remove the `$' from each midrule symbol
5834 name for which the midrule value is referenced in any action.
5835 * tests/actions.at (Default %printer and %destructor for mid-rule
5836 values): New test.
5837 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
5838 for change to dummy symbol names.
5839
5840 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
5841
5842 Warn about unset midrule $$ if the corresponding $n is used.
5843 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
5844 $n usage.
5845 (packgram): Before invoking grammar_rule_check on any rule, make sure
5846 all actions have already been scanned in order to set `used' flags.
5847 Otherwise, checking that a midrule's $$ is set will not always work
5848 properly because the midrule check must forward-reference the midrule's
5849 parent rule.
5850 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
5851 warning.
5852
5853 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
5854
5855 More improvements to the documentation of the prologue alternatives:
5856 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
5857 Bison manual.
5858 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
5859 some text to clarify the relative importance of the new directives and
5860 to show how these directives may be viewed as code labels.
5861
5862 2006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
5863
5864 Similar to the recently removed %before-header, add %code-top as the
5865 alternative to the pre-prologue. Mentioned at
5866 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
5867 Also, let the prologue alternatives appear in the grammar section.
5868 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
5869 (prologue_declaration): Move the existing prologue alternatives to...
5870 (grammar_declaration): ... here and add %code-top.
5871 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
5872
5873 Clean up and extend documentation for the prologue alternatives.
5874 * NEWS (2.3a+): Describe prologue alternatives.
5875 * doc/bison.texinfo (Prologue): Move discussion of prologue
5876 alternatives to...
5877 (Prologue Alternatives): ... this new section, and extend it to discuss
5878 all 4 directives in detail.
5879 (Table of Symbols): Clean up discussion of prologue alternatives and
5880 add %code-top.
5881
5882 2006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5883
5884 DJGPP specific issues.
5885
5886 * djgpp/config.bat: config.hin has been moved to lib. Adjust
5887 config.bat accordingly.
5888 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
5889 * djgpp/config.site: Likewise.
5890
5891 2006-10-16 Paolo Bonzini <bonzini@gnu.org>
5892
5893 Replace %*-header with %provides, %requires, %code. See discussion at
5894 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
5895
5896 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
5897 (b4_user_start_header): Remove.
5898 * data/glr.c: Use new macros instead of b4_*start_header
5899 and b4_*end_header.
5900 * data/glr.cc: Likewise.
5901 * data/lalr1.cc: Likewise.
5902 * data/push.c: Likewise.
5903 * data/yacc.c: Likewise.
5904
5905 * doc/bison.texinfo: Remove %before-header, rename
5906 %{start,end,after}-header to %requires, %provides, %code.
5907
5908 * src/parse-gram.y: Likewise (also rename token names accordingly).
5909 * src/scan-gram.l: Likewise.
5910 * tests/actions.at: Likewise.
5911
5912 2006-10-14 Paul Eggert <eggert@cs.ucla.edu>
5913
5914 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
5915 Problem reported by Joel E. Denny.
5916
5917 2006-10-14 Jim Meyering <jim@meyering.net>
5918
5919 (Sync from coreutils.)
5920 Work also when the working directory (with e.g. coreutils sources)
5921 is version controlled with git, rather than CVS.
5922 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
5923 rather than CVS.
5924 In messages and comments, say e.g., "checked-out sources",
5925 rather than "CVS sources".
5926 (version_controlled_file): New function. Work for git as well as
5927 for CVS. Don't use grep's -q option.
5928 (slurp): Call it here, in place of CVS-specific code.
5929
5930 2006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
5931
5932 Fix testsuite for ./configure --enable-gcc-warnings:
5933 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
5934 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
5935 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
5936 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
5937 * test/regression.at (Diagnostic that expects two alternatives):
5938 Likewise.
5939
5940 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
5941
5942 * bootstrap.conf (gnulib_modules): Add config-h.
5943 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
5944 worry about HAVE_CONFIG_H.
5945 * lib/abitset.c: Likewise.
5946 * lib/bitset.c: Likewise.
5947 * lib/bitset_stats.c: Likewise.
5948 * lib/bitsetv-print.c: Likewise.
5949 * lib/bitsetv.c: Likewise.
5950 * lib/ebitset.c: Likewise.
5951 * lib/get-errno.c: Likewise.
5952 * lib/lbitset.c: Likewise.
5953 * lib/subpipe.c: Likewise.
5954 * lib/timevar.c: Likewise.
5955 * lib/vbitset.c: Likewise.
5956 * lib/bitset.c: Include "bitset.h" first, to test interface.
5957 * lib/bitset_stats.c: Include "bitset_stats.h" first.
5958 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
5959 * lib/bitsetv.c: Include "bitsetv.h" first.
5960 * lib/get-errno.c: Include "get-errno.h" first.
5961 * m4/.cvsignore: Add config-h.m4.
5962 * tests/actions.at (Default %printer and %destructor for ...):
5963 Adjust expected line numbers in output to reflect removal of #if
5964 HAVE_CONFIG_H lines.
5965 * tests/glr-regression.at (Missed %merge type warnings when ...):
5966 Likewise.
5967 * tests/regression.at (Braced code in declaration in rules section):
5968 Likewise.
5969 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
5970 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
5971 Include <config.h> unconditionally.
5972
5973 * bootstrap: Sync from coreutils, as follows:
5974
5975 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
5976
5977 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
5978 variable was sometimes used without being initialized. This
5979 messed up the installation of the INSTALL file in some cases.
5980
5981 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
5982
5983 * bootstrap (usage, main program, symlink_to_gnulib): Add option
5984 --copy. Inspired by a suggestion from Bruno Haible.
5985
5986 2006-10-03 Jim Meyering <jim@meyering.net>
5987
5988 * bootstrap: Undo last change to this file, since now gnulib-tool
5989 sticks with the automake default in generating dependencies.
5990
5991 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
5992
5993 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
5994 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
5995
5996 * doc/bison.1: Add copyright notice.
5997
5998 * data/glr.c: Don't include <stdarg.h>; not used.
5999
6000 * NEWS: The -g and --graph options now output graphs in Graphviz
6001 DOT format, not VCG format.
6002 * doc/bison.1: Likewise.
6003 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
6004 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
6005 of this change in
6006 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
6007 * TODO: Remove Graphviz entry.
6008 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
6009 remove vcg.c, vcg.h, vcg_defaults.h.
6010 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
6011 * src/graphviz.c, src/graphviz.h: New files.
6012 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
6013 * src/files.h: Make comment more generic.
6014 * src/main.c (main): Likewise.
6015 * src/print_graph.h: Likewise.
6016 * src/getargs.c (usage): Make usage description more generic.
6017 * src/print_graph.c: Include graphviz.h rather than vcg.h.
6018 (static_graph, fgraph): Remove. All uses changed to pass
6019 arguments instead of sharing a static var.
6020 (print_core, print_actions, print_state, print_graph):
6021 Output graphviz format rather than VCG format.
6022 * tests/.cvsignore: Remove *.vcg; add *.dot.
6023 * tests/output.at: Expect *.dot files, not *.vcg files.
6024
6025 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
6026 accommodates the 2006-10-08 change.
6027
6028 2006-10-11 Bob Rossi <bob@brasko.net>
6029
6030 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
6031 (b4_yyssa, b4_yyerror_range): New macros.
6032 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
6033 (yypvarsinit): Remove init of removed fields.
6034 (yypushparse): Remove use of removed fields; use new macros instead.
6035
6036 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
6037
6038 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
6039 in a push parser. Reindent slightly to match yacc.c better.
6040
6041 2006-10-11 Bob Rossi <bob@brasko.net>
6042
6043 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
6044 yymsg_alloc fields.
6045 (yypvarsinit, yypushparse): Remove init of removed fields.
6046 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
6047
6048 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
6049
6050 * THANKS: Add Paolo Bonzini and Bob Rossi.
6051
6052 2006-10-08 Paolo Bonzini <bonzini@gnu.org>
6053
6054 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
6055 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
6056 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
6057 b4_define_user_cde and uses): Remove.
6058 (b4_comment, b4_prefix, b4_sync_start): New.
6059 * data/bison.m4: New file, with most of the content removed from c.m4.
6060 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
6061 * src/output.c (output_skeleton): Pass bison.m4.
6062 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
6063 only if specified.
6064
6065 2006-10-05 Paul Eggert <eggert@cs.ucla.edu>
6066
6067 Fix test failure reported by Tom Lane in
6068 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
6069 and try to make such failures easier to catch in the future.
6070 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
6071 that's now the caller's responsibility.
6072 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
6073 Set yychar = YYEOF if it's negative.
6074 * tests/actions.at (yylex): Abort if asked to read past EOF.
6075 * tests/conflicts.at (yylex): Likewise.
6076 * tests/cxx-type.at (yylex): Likewise.
6077 * tests/glr-regression.at (yylex): Likewise.
6078 * tests/input.at (yylex): Likewise.
6079 * tests/regression.at (yylex): Likewise.
6080 * tests/torture.at (yylex): Likewise.
6081
6082 2006-10-01 Paul Eggert <eggert@cs.ucla.edu>
6083
6084 Fix problems with translating English-language diagnostics.
6085 * bootstrap: Fix bug introduced in recent bootstrap changes, with
6086 respect to bison-runtime pot generation. The YY_ stuff
6087 wasn't being captured.
6088 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
6089 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
6090 * runtime-po/POTFILES.in: Add data/push.c.
6091
6092 2006-09-29 Paul Eggert <eggert@cs.ucla.edu>
6093
6094 Merge bootstrap changes from coreutils.
6095
6096 2006-09-28 Jim Meyering <jim@meyering.net>
6097
6098 Automatically generated dependencies are important even
6099 when all of the sources in a directory come from gnulib.
6100 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
6101 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
6102
6103 2006-09-23 Jim Meyering <jim@meyering.net>
6104
6105 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
6106
6107 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
6108
6109 * bootstrap: Add support for --force.
6110 (usage): New function. Describe usage less tersely.
6111 (CVS_only_file): New var.
6112
6113 2006-09-21 Paul Eggert <eggert@cs.ucla.edu>
6114
6115 * data/push.c (YYPUSH_MORE): Make it an enum instead.
6116 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
6117 Adjust white space and comments to match GNU style better.
6118
6119 2006-09-20 Bob Rossi <bob@brasko.net>
6120
6121 * data/push.c (yyresult_get): Remove function.
6122 (YYPUSH_MORE): Add #define.
6123 (yypushparse): Modify return value.
6124
6125 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
6126
6127 * stamp-h.in: Remove; no longer needed.
6128 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
6129 Remove config.h, config.hin, intl (no longer created).
6130 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
6131 stamp-h1.
6132
6133 Sync bootstrap from coreutils, as follows:
6134
6135 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
6136
6137 * bootstrap (symlink_to_gnulib): New function.
6138 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
6139 to copies-of-gnulib.
6140 (cp_mark_as_generated, slurp, gnulib_files):
6141 Avoid making a copy if it's the same as the old version.
6142 (gnulib_files): Add support for this variable (used by Bison).
6143
6144 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
6145
6146 * src/getargs.c (usage): Rework to use conventions similar to
6147 coreutils, to make translation a bit easier and the code a bit
6148 smaller. Problem reported by Tim Van Holder.
6149
6150 2006-09-15 Paul Eggert <eggert@cs.ucla.edu>
6151
6152 Use some of gnulib's new modules, taken from coreutils.
6153
6154 * bootstrap: Sync from coreutils, except add support for gnulib_files.
6155 * bootstrap.conf: New file.
6156 (gnulib_modules): Add configmake, inttypes, unistd.
6157 (XGETTEXT_OPTIONS): Add complain, complain_at,
6158 fatal, fatal_at, warn, warn_at, unexpected_end.
6159 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
6160 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
6161 (gl_EARLY): Add.
6162 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
6163 (gl_INIT): Add
6164 (GNULIB_AUTOCONF_SNIPPET): Remove.
6165 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
6166 the pickiest.
6167 * lib/.cvsignore: Add inttypes_.h.
6168 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
6169 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
6170 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
6171 no-longer-necessary initializations.
6172 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
6173 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
6174 use the unistd module.
6175 * src/system.h: Likewise.
6176 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
6177 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
6178 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
6179 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
6180 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
6181 * src/system.h: Include inttypes.h unconditionally, now that we
6182 use the inttypes module. Don't bother to include stdint.h, since
6183 inttypes.h now does that for us.
6184 (LOCALEDIR): Remove, now that we use the configmake module.
6185 * src/getargs.c: Include configmake.h.
6186 * src/main.c: Likewise.
6187 * src/output.c: Likewise.
6188 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
6189 not from $abs_top_builddir, since config.h moved.
6190
6191
6192 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
6193 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
6194
6195 * src/parse-gram.y (symbol_declaration): Don't put statements
6196 before declarations; it's not portable to C89.
6197 * src/scan-code.l (handle_action_at): Likewise.
6198
6199 * src/scan-code.l: Always initialize braces_level; the old code
6200 left it uninitialized and therefore had undefined behavior.
6201
6202 Don't attempt to redefine 'assert', since it runs afoul of
6203 systems where standard headers (mistakenly) include <assert.h>.
6204 Instead, define and use our own alternative, called 'aver'.
6205 * src/reader.c: Don't include assert.h, since we no longer
6206 use assert.
6207 * src/scan-code.l: Likewise.
6208 * src/system.h (assert): Remove, replacing with....
6209 (aver): New function, taking a bool arg. All uses changed.
6210 * src/tables.c (pack_vector): Ensure that aver arg is bool,
6211 not merely an integer.
6212
6213 2006-09-15 Bob Rossi <bob@brasko.net>
6214
6215 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
6216 * data/c.m4 (YYPUSH): New.
6217 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
6218 * src/getargs.c (push_parser): New var.
6219 * src/getargs.h (push_parser): New declaration.
6220 * src/output.c (prepare): Add macro insertion of `push_flag'.
6221 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
6222 (prologue_declaration): Parse %push-parser.
6223 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
6224 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
6225 list of removed lines from the traces observed.
6226 (AT_CHECK_CALC_LALR): Added push parser tests.
6227
6228 2006-09-13 Paul Eggert <eggert@cs.ucla.edu>
6229
6230 * NEWS: Version 2.3a.
6231 * configure.ac (AC_INIT): Likewise.
6232
6233 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
6234 "#define YYSTYPE int" that caused "make maintainer-check" to fail
6235 due to header ordering dependencies. I don't know why the #define
6236 was there.
6237
6238 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
6239 runtime cost when YYDEBUG is not defined, and so that some tests
6240 that used to fail now work. Problem and initial suggestion by
6241 Paolo Bonzini.
6242 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
6243 * data/glr.cc (b4_parser_class_name):
6244 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
6245 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
6246 (yydebug_) [YYDEBUG]: New member.
6247 (yycdebug_): Now defined only if YYDEBUG.
6248 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
6249 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
6250 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
6251 if YYYDEBUG.
6252 (debug_stream, set_debug_stream, debug_level, set_debug_level):
6253 Define only if YYDEBUG.
6254 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
6255 set_debug_level.
6256 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
6257 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
6258 AT_CHECK_CALC_GLR_CC that are working now.
6259
6260 2006-09-12 Paul Eggert <eggert@cs.ucla.edu>
6261
6262 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
6263 We don't need them in glr.cc, and glr.c defines them.
6264 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
6265 assumes that defining it to anything is the same as defining
6266 it to 1. Problem reported by Paolo Bonzini.
6267
6268 2006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
6269
6270 * data/c.m4 (b4_null, b4_case): Define.
6271 * src/output.c (prepare_symbols): Use b4_null.
6272 (user_actions_output): Use b4_case.
6273
6274 2006-09-11 Paul Eggert <eggert@cs.ucla.edu>
6275
6276 * data/glr.c (b4_shared_declarations): Put start-header first,
6277 before any #includes that we generate, so that feature-test
6278 macros work. Problem reported by Michael Deutschmann in
6279 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
6280 * data/lalr1.cc: Likewise.
6281 * doc/bison.texinfo (Prologue): Document that feature-test macros
6282 should be defined before any Bison declarations.
6283 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
6284 that depend on location.hh after, not before, Bison decls, since
6285 we now include location.hh after the first user prologue.
6286
6287 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
6288 Sander Brandenburg in
6289 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
6290 Also, fix minor white space and comment issues.
6291 (Prologue): Mention that it's better to define feature-test macros
6292 before Bison declarations. Problem reported by Michael Deutschmann.
6293
6294 * README-cvs: Fix typo: "&" should be "&&". Problem reported
6295 by Jim Meyering.
6296 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
6297 This adjusts to recent gnulib changes.
6298
6299 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
6300
6301 Finish implementation of per-type %destructor/%printer. Discussed
6302 starting at
6303 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
6304 and
6305 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
6306 * NEWS (2.3+): Add a description of this feature to the default
6307 %destructor/%printer description.
6308 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
6309 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
6310 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
6311 list node contains a semantic type.
6312 * src/symtab.c, src/symtab.h: Extend with a table that associates
6313 semantic types with their %destructor's and %printer's.
6314 (semantic_type_from_uniqstr, semantic_type_get,
6315 semantic_type_destructor_set, semantic_type_printer_set): New functions
6316 composing the public interface of that table.
6317 (symbol_destructor_get, symbol_destructor_location_get,
6318 symbol_printer_get, symbol_printer_location_get): If there's no
6319 per-symbol %destructor/%printer, look up the per-type before trying
6320 the default.
6321 * tests/actions.at (Per-type %printer and %destructor): New test case.
6322 * tests/input.at (Default %printer and %destructor redeclared):
6323 Extend to check that multiple occurrences of %symbol-default in a
6324 single %destructor/%printer declaration is an error.
6325 (Per-type %printer and %destructor redeclared, Unused values with
6326 per-type %destructor): New test cases.
6327
6328 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
6329
6330 Require default %destructor/%printer to be declared using
6331 %symbol-default instead of an empty symbol list, and start working on
6332 new per-type %destructor/%printer. Discussed at
6333 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
6334 * NEWS (2.3+): Add %symbol-default to example.
6335 * bison.texinfo (Freeing Discarded Symbols): Likewise.
6336 (Table of Symbols): Add entry for %symbol-default.
6337 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
6338 (generic_symlist, generic_symlist_item): New nonterminals for creating
6339 a list in which each item is a symbol, semantic type, or
6340 %symbol-default.
6341 (grammar_declaration): Use generic_symlist in %destructor and %printer
6342 declarations instead of symbols.1 or an empty list.
6343 (symbol_declaration, precedence_declaration, symbols.1): Update actions
6344 for changes to symbol_list.
6345 * src/reader.c: Update for changes to symbol_list.
6346 * src/scan-code.l: Likewise.
6347 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
6348 * src/symlist.c, src/symlist.h: Extend such that a list node may
6349 represent a semantic type or a %symbol-default in addition to just an
6350 ordinary symbol. Add switched functions for setting %destructor's and
6351 %printer's.
6352 * tests/actions.at, tests/input.at: Add %symbol-default to all default
6353 %destructor/%printer declarations.
6354
6355 2006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
6356
6357 Whether the default %destructor/%printer applies to a particular symbol
6358 isn't a question of whether the user *declares* that symbol (in %token,
6359 for example). It's a question of whether the user by any means
6360 *defines* the symbol at all (by simply using a char token, for
6361 example). $end is defined by Bison whereas any other token with token
6362 number 0 is defined by the user. The error token is always defined by
6363 Bison regardless of whether the user declares it with %token, but we
6364 may one day let the user define error as a nonterminal instead.
6365 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
6366 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
6367 the meaning of "user-defined".
6368 * tests/actions.at (Default %printer and %destructor for user-declared
6369 end token): Rename to...
6370 (Default %printer and %destructor for user-defined end token): ...
6371 this.
6372
6373 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
6374 computation of whether to apply the default, don't maintain a list of
6375 every Bison-defined symbol. Instead, just check for a first character
6376 of '$', which a user symbol cannot have, and check for the error token.
6377
6378 2006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
6379
6380 Don't apply the default %destructor or %printer to the error token,
6381 $undefined, or $accept. This change fits the general rule that the
6382 default %destructor and %printer are only for user-declared symbols,
6383 and it solves several difficulties that are described in the new test
6384 cases listed below.
6385 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
6386 * tests/actions.at (Default %printer and %destructor are not for error
6387 or $undefined, Default %printer and %destructor are not for $accept):
6388 New test cases.
6389
6390 2006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
6391
6392 Allow %start after the first rule.
6393 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
6394 when parsing the first rule.
6395 (check_and_convert_grammar): Search for it here after all grammar
6396 declarations have been parsed. Skip midrules, which have dummy LHS
6397 nonterminals.
6398 * src/symtab.c (symbol_is_dummy): New function.
6399 * src/symtab.h (symbol_is_dummy): Declare it.
6400 * tests/input.at (%start after first rule): New test.
6401
6402 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
6403
6404 Redo some of the previous commit: add back the ability to use
6405 non-aliased/undeclared string literals since it might be useful to
6406 those declaring %token-table.
6407 * src/reader.c (check_and_convert_grammar): Undo changes in previous
6408 commit: don't worry about complaints from symbols_pack.
6409 * src/symtab.c (symbol_new, symbol_class_set,
6410 symbol_check_alias_consistency): Undo changes in previous commit: count
6411 each string literal as a new symbol and token, assign it a symbol
6412 number, and don't complain about non-aliased string literals.
6413 (symbols_pack): Since symbol_make_alias still does not decrement symbol
6414 and token counts but does still set aliased tokens to the same number,
6415 symbol_pack_processor now leaves empty slots in the symbols array.
6416 Remove those slots.
6417 * tests/regression.at (Undeclared string literal): Remove test case
6418 added in previous commit since non-aliased string literals are allowed
6419 again.
6420 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
6421 remove unnecessary string literal declarations.
6422 * tests/sets.at (Firsts): Likewise.
6423
6424 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
6425
6426 Don't allow an undeclared string literal, but allow a string literal to
6427 be used before its declaration.
6428 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
6429 symbols_pack complained.
6430 * src/symtab.c (symbol_new): Don't count a string literal as a new
6431 symbol.
6432 (symbol_class_set): Don't count a string literal as a new token, and
6433 don't assign it a symbol number since symbol_make_alias does that.
6434 (symbol_make_alias): It's not necessary to decrement the symbol and
6435 token counts anymore. Don't assume that an alias declaration occurs
6436 before any uses of the identifier or string, and thus don't assert that
6437 one of them has the highest symbol number so far.
6438 (symbol_check_alias_consistency): Complain if there's a string literal
6439 that wasn't declared as an alias.
6440 (symbols_pack): Bail if symbol_check_alias_consistency failed since
6441 symbol_pack asserts that every token has been assigned a symbol number
6442 although undeclared string literals have not.
6443 * tests/regression.at (String alias declared after use, Undeclared
6444 string literal): New test cases.
6445 (Characters Escapes, Web2c Actions): Declare string literals as
6446 aliases.
6447 * tests/sets.at (Firsts): Likewise.
6448
6449 2006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
6450
6451 In the grammar scanner, STRING_FINISH unclosed constructs and return
6452 them to the parser in order to improve error messages.
6453 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
6454 SC_BRACED_CODE, SC_PROLOGUE): Implement.
6455 * tests/input.at (Unclosed constructs): New test case.
6456 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
6457 seen.
6458
6459 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
6460 unused global.
6461
6462 2006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
6463
6464 Handle string aliases for character tokens correctly.
6465 * src/symtab.c (symbol_user_token_number_set): If the token has an
6466 alias, check and set its alias's user token number instead of its own,
6467 which is set to indicate the alias. Previously, every occurrence of
6468 the character token in the grammar overwrote that alias indicator with
6469 the character code.
6470 * tests/input.at (String aliases for character tokens): New test.
6471
6472 2006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
6473
6474 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
6475
6476 2006-08-11 Paul Eggert <eggert@cs.ucla.edu>
6477
6478 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
6479 to prevent failures when building on older platforms.
6480 Check for autopoint failure.
6481 Set XGETTEXT_OPTIONS to values that check for C format strings,
6482 so that translators are warned about them (this also helps
6483 prevent core dumps).
6484
6485 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
6486 function, since it simplifies our code a bit.
6487
6488 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
6489 rather than -W, so we don't get bogus warnings about sign comparisons.
6490 Add -Wpointer-arith, since that warning is useful (it reports code
6491 that does not conform to C89 and that some compilers reject).
6492 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
6493 since it's no longer needed.
6494
6495 2006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
6496
6497 Clean up scanners a bit.
6498 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
6499 definitions so gcc won't warn when obstack_for_string is unused.
6500 * src/scan-code.l: config.h and system.h are already #include'd by
6501 scan-code-c.c, so get rid of them here.
6502 * src/scan-gram.l: Likewise.
6503 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
6504 definitions rather than duplicating the rest of it.
6505 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
6506
6507 2006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
6508
6509 Suppress signed/unsigned comparison warnings for yycheck.
6510 * data/c.m4 (b4_safest_int_type): New macro.
6511 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
6512 a signed int type, cast it to b4_safest_int_type first.
6513 * data/yacc.c: Likewise.
6514 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
6515 also overwritten.
6516
6517 2006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
6518
6519 * doc/bison.texinfo: Fix some typos.
6520
6521 2006-08-02 Paul Eggert <eggert@cs.ucla.edu>
6522
6523 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
6524 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
6525
6526 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
6527 the latest gnulib does this a different way.
6528 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
6529 translation was patched, so stop omitting it.
6530
6531 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
6532
6533 Enable declaration of default %printer/%destructor. Make the parser
6534 use these for all user-declared grammar symbols for which the user does
6535 not declare a specific %printer/%destructor. Thus, the parser uses it
6536 for token 0 if the user declares it but not if Bison generates it as
6537 $end. Discussed starting at
6538 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
6539 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
6540 and
6541 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
6542 * NEWS (2.3+): Mention.
6543 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
6544 declare a %destructor for a mid-rule's semantic value. It's just
6545 impossible to declare one specific to it.
6546 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
6547 code. Describe default %destructor form.
6548 * src/parse-gram.y (grammar_declaration): Parse default
6549 %printer/%destructor declarations.
6550 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
6551 and symbol_destructor_location_get rather than accessing the destructor
6552 and destructor_location members of struct symbol.
6553 (symbol_printers_output): Likewise but for %printer's.
6554 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
6555 again.
6556 * src/symtab.c (default_destructor, default_destructor_location,
6557 default_printer, default_printer_location): New static global
6558 variables to record the default %destructor and %printer.
6559 (symbol_destructor_get, symbol_destructor_location_get,
6560 symbol_printer_get, symbol_printer_location_get): New functions to
6561 compute the appropriate %destructor and %printer for a symbol.
6562 (default_destructor_set, default_printer_set): New functions to set the
6563 default %destructor and %printer.
6564 * src/symtab.h: Prototype all those new functions.
6565 * tests/actions.at (Default %printer and %destructor): New test to
6566 check that the right %printer and %destructor are called, that they're
6567 not called for $end, and that $$ and @$ work correctly.
6568 (Default %printer and %destructor for user-declared end token): New
6569 test to check that the default %printer and %destructor are called for
6570 a user-declared end token.
6571 * tests/input.at (Default %printer and %destructor redeclared, Unused
6572 values with default %destructor): New tests to check related grammar
6573 warnings and errors.
6574
6575 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
6576
6577 Clean up handling of %destructor for the end token (token 0).
6578 Discussed starting at
6579 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
6580 and
6581 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
6582
6583 Make the skeletons consistent in how they pop the end token and invoke
6584 its %destructor.
6585 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
6586 state, which has token number 0, since this would invoke the
6587 %destructor for the end token.
6588 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
6589 until after shifting the end token, or else it won't be popped.
6590 * data/yacc.c (yyparse): Likewise.
6591
6592 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
6593 it's the end token. Upon termination, destroy an unshifted lookahead
6594 even when it's the end token.
6595 * data/lalr1.cc (yy::parser::parse): Likewise.
6596 * data/yacc.c (yyparse): Likewise.
6597
6598 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
6599 value warnings for the end token when the user gives the end token a
6600 %destructor.
6601
6602 * tests/actions.at (Printers and Destructors): Test all the above.
6603
6604 2006-07-24 Paul Eggert <eggert@cs.ucla.edu>
6605
6606 Update to latest gnulib and gettext versions.
6607 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
6608 Add fopen-safer.
6609 (gnulib_files): Add m4/warning.m4. Don't worry about files
6610 overwritten by autopoint.
6611 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
6612 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
6613 rejects them.
6614 Don't use autoreconf; instead, invoke autopoint etc. by hand,
6615 so that we can remove the intl files at a better time.
6616 (intl_files_to_remove): Remove aclocal.m4, since it gets
6617 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
6618 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
6619 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
6620 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
6621 Remove datarootdir hack; no longer needed.
6622 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
6623 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
6624 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
6625 strdup.h.
6626 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
6627 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
6628
6629 2006-07-20 Paul Eggert <eggert@cs.ucla.edu>
6630
6631 * bootstrap: Adjust to today's change to gnulib-tool by invoking
6632 it with --assume-autoconf='latest-stable'.
6633
6634 2006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
6635
6636 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
6637 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
6638 YYSTYPE' and `{'.
6639 * src/muscle_tab.h (muscle_grow): Replace the header comments with
6640 those from muscle_tab.c since the old ones are misleading.
6641
6642 2006-07-13 Akim Demaille <akim@epita.fr>
6643
6644 Support %define "KEY" {VALUE}.
6645 * src/scan-code.h, src/scan-code.l (translate_action)
6646 (translate_rule_action, translate_symbol_action, translate_code):
6647 Return char *, not const char *.
6648 * src/parse-gram.y (declaration): Rename as...
6649 (prologue_declaration): this.
6650 (string_content): Remove this nonterminal, use STRING.
6651 (braceless, content, content.opt): New nonterminal.
6652 Use them.
6653 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
6654 as value.
6655 * src/scan-gram.l (getargs.h): Don't include it.
6656
6657 2006-07-12 Paul Eggert <eggert@cs.ucla.edu>
6658
6659 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
6660 rather than a for-loop that declares a local bool variable. This
6661 should work around a compatibility problem with a Cray x1e C++
6662 compiler reported by Hung Nguyen in
6663 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
6664 The for-loop was introduced in the 2004-11-17 change but I don't
6665 know why it was needed.
6666
6667 2006-07-12 Akim Demaille <akim@epita.fr>
6668
6669 * data/c.m4: Comment changes.
6670
6671 2006-07-10 Akim Demaille <akim@lrde.epita.fr>
6672
6673 * src/complain.c (error_message, ERROR_MESSAGE): New.
6674 To factor...
6675 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
6676 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
6677
6678 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
6679
6680 * NEWS: Instead of %union, you can define and use your own union type
6681 YYSTYPE if your grammar contains at least one <type> tag.
6682 Your YYSTYPE need not be a macro; it can be a typedef.
6683 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
6684 (Union Decl, Decl Summary): Document this.
6685 * data/glr.c (YYSTYPE): Implement this.
6686 * data/glr.cc (YYSTYPE): Likewise.
6687 * data/lalr1.cc (YYSTYPE): Likewise.
6688 * data/yacc.c (YYSTYPE): Likewise.
6689 * src/output.c (prepare): Output tag_seen_flag.
6690 * src/parse-gram.y (declaration, grammar_declaration):
6691 Use 'union_seen' rather than 'typed' to determine whether
6692 %union has been seen, since grammars can now be typed without
6693 %union.
6694 (symbol_declaration, type.opt, symbol_def):
6695 Keep track of whether a tag has been seen.
6696 * src/reader.c (union_seen, tag_seen): New vars.
6697 (typed): remove.
6698 * src/reader.h (union_seen, tag_seen, typed): Likewise.
6699 * src/scan-code.l (untyped_var_seen): New variable.
6700 (handle_action_dollar): Adjust to above changes.
6701 (handle_action_dollar, handle_action_at):
6702 Improve overflow checking for outlandish numbers.
6703 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
6704 avoid new diagnostics generated by above changes.
6705 * tests/regression.at (YYSTYPE typedef): Add test to check
6706 for type tags without %union.
6707
6708 * src/symlist.c (symbol_list_length): Return int, not unsigned
6709 int, since callers expect int. This may need to get revisited
6710 once we have proper integer overflow checking.
6711
6712 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
6713 object is now static.
6714
6715 * src/getargs.c (flags_argmatch): Return void, not int,
6716 to pacify ./configure --enable-gcc-warnings.
6717
6718 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
6719 since last_string is already defined to FLEX_PREFIX (last_string).
6720
6721 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
6722
6723 Implement --warnings/-W.
6724 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
6725 replaced by...
6726 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
6727 Adjust callers.
6728 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
6729 (warnings_args, warnings_types): New.
6730 (getargs, short_options, long_options): Accept -W/--warnings.
6731 Sort the options by alphabetical order, upper case letter right
6732 before its lower case.
6733
6734 2006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
6735
6736 Change %merge result type clash warnings to errors. Discussed at
6737 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
6738 * src/reader.c (record_merge_function_type): Use complain_at.
6739 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
6740 declared later): Update test case results.
6741
6742 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
6743
6744 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
6745 to be in alphabetical order.
6746 (trace_args): Spelling fixes.
6747
6748 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
6749
6750 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
6751 so they don't collide with user-defined macros.
6752 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
6753 this was never guaranteed, and now that we're using gnulib stdint,
6754 which defines int_fast16_t to long int, the problem is exposed.
6755
6756 2006-07-08 Paul Eggert <eggert@cs.ucla.edu>
6757
6758 * data/c.m4 (b4_basename): Simplify a bit, since we don't
6759 need the full POSIX semantics (and weren't implementing them
6760 anyway).
6761
6762 Adjust to Autoconf 2.60 and today's gnulib.
6763 * bootstrap (gnulib_modules): Add stdint.
6764 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
6765 no longer copies it.
6766 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
6767 since stdint needs the former and wcwidth (which is now required
6768 by mbswidth) needs the latter.
6769 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
6770 work around a compatibility glitch between gettext 0.14.6 and
6771 Autoconf 2.60.
6772 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
6773 Do not check for uintptr_t, since new stdint module does the right
6774 thing.
6775 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
6776 Add stdint.h, stdint_.h, wcwidth.h.
6777 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
6778 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
6779 stdint.m4, wchar_t.m4, wcwidth.m4.
6780 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
6781 usual order for ../lib/*.h files.
6782 (file_name_split): Use last_component, not base_name, to adjust
6783 to gnulib changes.
6784 * src/parse-gram.h: Include <strverscmp.h> in the usual order
6785 for ../lib/*.h files.
6786 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
6787 Define unconditionally, since we now assume the stdint module.
6788 * src/scan-skel.l: Include <dirname.h>.
6789 (BASE_QPUTS): Use last_component, not base_name.
6790 * src/system.h: Include <unlocked-io.h> in the usual order
6791 for ../lib/*.h files. Include <stdint.h> unconditionally,
6792 since we now use the stdint module.
6793 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
6794 HAVE_UINTPTR_T, since we now use the stdint module.
6795 (base_name): Remove decl, since files now include <dirname.h>
6796 to get the decl.
6797
6798 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
6799
6800 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
6801 New, default to 1.
6802 * data/yacc.c, data/glr.c, data/location.cc: Use them.
6803 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
6804 default.
6805 * tests/calc.at: Adjust.
6806
6807 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
6808
6809 * data/c.m4 (b4_basename): New.
6810 (b4_syncline): Also output the location of its invocation (from
6811 the skeleton).
6812 (b4_user_action, b4_define_user_action, b4_user_actions)
6813 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
6814 (b4_user_stype): New.
6815 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
6816
6817 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
6818
6819 In the grammar file, the first column is 1 not 0 on the first line as
6820 on every other line.
6821 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
6822 * tests/input.at (Torturing the Scanner): Update output.
6823
6824 * src/scan-gram.l (scanner_cursor): Declare it static.
6825
6826 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
6827
6828 In warnings, say "previous declaration" rather than "first
6829 declaration".
6830 * src/symtab.c (redeclaration): Do that here.
6831 * src/reader.c (record_merge_function_type): In the case of a result
6832 type clash, report the previous declaration rather than the very first
6833 one in the grammar file.
6834 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
6835 declared later): Add a third declaration to check this behavior.
6836 * tests/input.at (Incompatible Aliases): Update output.
6837
6838 2006-06-27 Akim Demaille <akim@epita.fr>
6839
6840 * doc/Doxyfile.in: New.
6841 * doc/Makefile.am: Use it.
6842 * src/lalr.h, src/symtab.h: Initial doxygenation.
6843
6844 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
6845
6846 Don't miss %merge result type warnings just because the LHS types are
6847 declared after the %merge. This continues the effort of the previous
6848 patch.
6849 * src/reader.c (get_merge_function): Don't set the merger type yet.
6850 (record_merge_function_type): New function for setting the merger type
6851 and checking for clashes.
6852 (grammar_current_rule_merge_set): Set the location of the %merge for
6853 the current rule.
6854 (packgram): Invoke record_merge_function_type for each rule now that
6855 all symbol type declarations have been parsed.
6856 * src/reader.h (merger_list.type_declaration_location): New member
6857 storing the location of the first %merge from which the type for this
6858 merging function was derived.
6859 * src/symlist.h (symbol_list.merger_declaration_location): New member
6860 storing the location of a rule's %merge, if any.
6861 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
6862 declared later): New test to catch the error fixed by the above patch.
6863
6864 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
6865
6866 Get action warnings (grammar_rule_check) right even when symbol
6867 declarations appear after the rules. Discussed at
6868 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
6869 and
6870 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
6871 Don't mistake the type of $$ in a midrule to be that of its parent
6872 rule's $$.
6873 * src/reader.c (grammar_current_rule_end): Don't invoke
6874 grammar_rule_check yet since not all symbol declarations may have been
6875 parsed yet.
6876 (grammar_midrule_action): Likewise.
6877 Don't record whether the midrule's $$ has been used yet since actions
6878 haven't been translated yet.
6879 Record the midrule's parent rule and its RHS index within the parent
6880 rule.
6881 (grammar_current_rule_action_append): Don't translate the action yet
6882 since not all symbol declarations may have been parsed yet and, thus,
6883 warnings about types for $$, $n, @$, and @n can't be reported yet.
6884 (packgram): Translate the action and invoke grammar_rule_check now that
6885 all symbol declarations have been parsed.
6886 * src/scan-code.l (handle_action_dollar): Now that this is invoked
6887 after parsing the entire grammar file, the symbol list here in the case
6888 of a midrule is actually the midrule's empty RHS, so reference its
6889 parent rule's RHS where necessary.
6890 On the other hand, now that you can already know it's a midrule, you
6891 aren't forced to think $$ has the same type as its parent rule's $$.
6892 (handle_action_at): In the case of a midrule, reference the parent rule
6893 where necessary.
6894 * src/symlist.c (symbol_list_new): Initialize new midrule-related
6895 members.
6896 (symbol_list_length): Now that this is invoked after all rules have
6897 been parsed, a NULL symbol (rather than a NULL symbol list node)
6898 terminates a rule. symbol_list_print already does this correctly.
6899 * src/symlist.h (symbol_list.midrule_parent_rule,
6900 symbol_list.midrule_parent_rhs_index): New members so that midrules can
6901 remember their relationships with their parents.
6902 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
6903 fixed by the above patch.
6904 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
6905 implementing...
6906 (Unused values): ... this old test case and...
6907 (Unused values before symbol declarations): ... this new test case.
6908 This one is the same as `Unused values' except that all symbol
6909 declarations appear after the rules in order to catch the rest of the
6910 errors fixed by the above patch.
6911
6912 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
6913
6914 More cleanup.
6915 * src/reader.c (current_rule): Declare it static since it's no longer
6916 used outside this file.
6917 (grammar_current_rule_action_append): Remove redundant arguments from
6918 translate_rule_action invocation.
6919 * src/reader.h (current_rule): Remove this unused extern.
6920 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
6921 * src/scan-code.l (translate_rule_action): Likewise.
6922
6923 2006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
6924
6925 Clean up yesterday's patch.
6926 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
6927 to...
6928 * src/reader.c (grammar_current_rule_action_append): ... here for
6929 consistency with grammar_current_rule_symbol_append.
6930 * tests/regression.at (Braced code in declaration in rules section):
6931 Make yyerror and yylex static as usual.
6932
6933 2006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
6934
6935 Fix bug that mistakes braced code in a declaration in the rules section
6936 to be a rule action. Mentioned at
6937 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
6938 * src/scan-gram.l: Move midrule action detection from the start of the
6939 scanning of any braced code to...
6940 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
6941 action. For readability, use $2 and @2 rather than the equivalent
6942 global variables.
6943 * tests/regression.at (Braced code in declaration in rules section):
6944 New test to catch the error fixed by the above patch.
6945
6946 Work on code readability some.
6947 * src/scan-code.l (current_rule): Get rid of this misleading and
6948 redundant declaration: it's actually extern'ed in reader.h.
6949 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
6950 translate_action): Add a rule argument and use it instead of the global
6951 current_rule.
6952 (translate_rule_action): This already receives current_rule through an
6953 argument, so pass it on to translate_action instead of assigning
6954 current_rule to current_rule.
6955 (translate_symbol_action, translate_code): Pass rule = NULL to
6956 translate_action.
6957
6958 2006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
6959
6960 Rename %before-definitions to %start-header and %after-definitions to
6961 %end-header. Don't use these declarations to separate pre-prologue
6962 blocks from post-prologue blocks. Add new order-independent
6963 declarations %before-header and %after-header as alternatives to the
6964 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
6965 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
6966 * NEWS (2.3+): Update for these changes.
6967 * data/glr.c (b4_before_definitions): Update to...
6968 (b4_start_header): ... this.
6969 (b4_after_definitions): Update to...
6970 (b4_end_header): ... this.
6971 * data/glr.cc: Likewise.
6972 * data/lalr1.cc: Likewise.
6973 * data/yacc.c: Likewise.
6974 * doc/bison.texinfo (The prologue): Update names, and replace remaining
6975 prologue blocks with %*-header declarations.
6976 (Calc++ Parser): Likewise.
6977 (Decl Summary): Update names.
6978 (Table of Symbols): Update description.
6979 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
6980 (PERCENT_END_HEADER): ... this.
6981 (PERCENT_BEFORE_DEFINITIONS): Update to...
6982 (PERCENT_START_HEADER): ... this.
6983 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
6984 (declaration): Update token names and m4 macro names.
6985 When parsing %end-header and %start-header, invoke translate_code
6986 before muscle_code_grow, and no longer set global booleans to remember
6987 whether these declarations have been seen.
6988 Parse new %after-header and %before-header.
6989 * src/reader.c (before_definitions, after_definitions): Remove.
6990 (prologue_augment): Accept a new bool argument to specify whether to
6991 augment the pre-prologue or post-prologue.
6992 * src/reader.h (before_definitions, after_definitions): Remove these
6993 extern's.
6994 (prologue_augment): Add new bool argument.
6995 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
6996 (PERCENT_END_HEADER): ... this.
6997 (PERCENT_BEFORE_DEFINITIONS): Update to...
6998 (PERCENT_START_HEADER): ... this.
6999 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
7000 * tests/actions.at (Printers and Destructors): Update names.
7001
7002 2006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
7003
7004 Add comparison operators for C++ location classes. Discussed at
7005 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
7006 * data/c++.m4 (b4_define_location_comparison): New boolean %define
7007 declaration indicating whether filename_type has an operator==. If
7008 filename_type is `std::string', it defaults to `1', `0' otherwise.
7009 * data/location.cc: Iff b4_define_location_comparison is `1', add
7010 operator== and operator!= for class position and for class location.
7011
7012 Some minor fixes.
7013 * src/scan-action.l: Remove unused file.
7014 * src/symtab.c (symbol_printer_set): Use printer_location not
7015 destructor_location.
7016 * src/symtab.h (struct symbol): Replace incorrect source comment for
7017 printer members.
7018 * tests/input.at (Incompatible Aliases): Update output with correct
7019 printer location.
7020
7021 2006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
7022
7023 Don't put the pre-prologue in the header file. For the yacc.c code
7024 file and the glr.c header and code files, move the pre-prologue before
7025 the token definitions. Add new %before-definitions and
7026 %after-definitions to declare code that will go in both the header file
7027 and code file. Discussed at
7028 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
7029 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
7030 and
7031 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
7032 * NEWS (2.3+): Describe these changes.
7033 * data/glr.c (b4_pre_prologue): Move from within to before...
7034 (b4_shared_declarations): ... this.
7035 Add new b4_before_definitions before b4_token_enums.
7036 Add new b4_after_definitions at the end.
7037 * data/glr.cc (b4_pre_prologue): Replace with...
7038 (b4_before_definitions): ... this in the header file.
7039 (b4_after_definitions): New near the end of the header file.
7040 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
7041 code file right before including the header file.
7042 (b4_before_definitions): New in the previous position of
7043 b4_pre_prologue in the header file.
7044 (b4_after_definitions): New near the end of the header file.
7045 * data/yacc.c: Clean up some m4 quoting especially in the header file.
7046 (b4_token_enums_defines): In the code file, move to right before
7047 YYSTYPE for consistency with the header file.
7048 (b4_before_definitions): New right before b4_token_enums_defines in
7049 both the header and code file.
7050 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
7051 header and code file.
7052 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
7053 of prologues for %union dependencies.
7054 (Decl Summary): In %defines description, mention the effect of
7055 %before-definitions and %after-definitions on the header file.
7056 (Calc++ Parser): Forward declare driver in a %before-definitions rather
7057 than in the pre-prologue so that make check succeeds.
7058 (Table of Symbols): Add entries for %before-definitions and
7059 %after-definitions.
7060 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
7061 %before-definitions.
7062 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
7063 (declaration): Parse those declarations and append to
7064 b4_before_definitions and b4_after_definitions, respectively.
7065 * src/reader.c (before_definitions, after_definitions): New bools to
7066 track whether those declarations have been seen.
7067 (prologue_augment): Add to the post-prologue if %union,
7068 %before-definitions, or %after-definitions has been seen.
7069 * src/reader.h (before_definitions, after_definitions): New extern's.
7070 * src/scan-gram.l: Scan the new declarations.
7071 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
7072 prologue block in a %before-definitions or a %after-definitions based
7073 on whether the %union is declared.
7074 * tests/regression.at (Early token definitions with --yacc, Early token
7075 definitions without --yacc): Move tests for token definitions into the
7076 post-prologue since token names are no longer defined in the
7077 pre-prologue.
7078
7079 2006-06-20 Akim Demaille <akim@epita.fr>
7080
7081 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
7082 (symbol_get): Use it.
7083 * src/parse-gram.y: Use it.
7084
7085 2006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
7086
7087 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
7088 build succeeds when configured with --enable-gcc-warnings.
7089
7090 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
7091
7092 * src/parse-gram.y (char_name): New function.
7093 (CHAR, STRING, string_content): For %printer, properly escape.
7094 (ID): Prefer fputs to fprintf.
7095 (id): Reindent to be consistent with other rules.
7096 Properly quote char.
7097
7098 The Translation Project changed its way of publishing translations
7099 to maintainers. I haven't received any responses to my request
7100 for supporting the old way, or for documenting the new way. I
7101 have modified 'bootstrap' to use screen scraping
7102 (in this case, HTML scraping). This is unreliable and inelegant,
7103 but I don't see any better way. Yuck.
7104 * bootstrap (TP_URL, WGET_COMMAND): New vars.
7105 (get_translations): New function, which uses HTML scraping to
7106 deduce locations of latest translations.
7107 Use this function to grab both bison and bison-runtime .po files.
7108 Don't bother priming the pump for the runtime-po domain any more,
7109 as it's now translated better than bison is.
7110
7111 2006-06-19 Akim Demaille <akim@epita.fr>
7112
7113 * src/scan-gram.l: No longer "parse" things after `%union' until
7114 `{'. Rather, return a single "%union" token.
7115 No longer make symbols: return strings, and leave the conversion
7116 to symbols to the parser.
7117 (SC_PRE_CODE, token_type): Remove.
7118 * src/parse-gram.y (%union): New field `character'.
7119 Sort tokens.
7120 (CHAR): New token.
7121 (ID, ID_COLON): Now that the scanner no longer makes them
7122 identifiers, adjust all uses to invoke symbol_get.
7123 (id_colon): New, wraps the conversion from string to symbol.
7124 (%union): Accept a possible union_name.
7125 (symbol): Now can be a char.
7126 * data/c.m4 (b4_union_name): Leave a default value.
7127 * data/glr.c, data/yacc.c: Use it.
7128
7129 2006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
7130
7131 For associating token numbers with token names for "yacc.c", don't use
7132 #define statements unless `--yacc' is specified; always use enum
7133 yytokentype. Most important discussions start at:
7134 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
7135 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
7136 and
7137 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
7138 * NEWS (2.3+): Mention.
7139 * data/c.m4 (b4_yacc_if): New.
7140 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
7141 token #define's.
7142 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
7143 on token name definitions.
7144 * src/getargs.c (usage): Capitalize `Yacc' in English.
7145 * src/output.c (prepare): Define b4_yacc_flag.
7146 * tests/regression.at (Early token definitions): Test that tokens names
7147 are defined before the pre-prologue not just before the post-prologue.
7148 Remove this test case and copy to...
7149 (Early token definitions with --yacc): ... this to test #define's.
7150 (Early token definitions without --yacc): ... and this to test enums.
7151
7152 2006-06-11 Paul Eggert <eggert@cs.ucla.edu>
7153
7154 * NEWS: Reword the post-2.3 change to not be so optimistic about
7155 removing the old "look-ahead" spelling.
7156 Update previous look-ahead/lookahead change reports.
7157 * REFERENCES: look-ahead -> lookahead (since that's
7158 what he actually wrote).
7159 * doc/refcard.tex: look ahead -> lookahead,
7160 look-ahead -> lookahead
7161
7162 2006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
7163
7164 For consistency, use `lookahead' instead of `look-ahead' or
7165 `look_ahead'. Discussed starting at
7166 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
7167 and then at
7168 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
7169 * NEWS: For the next release, note the change to `--report'.
7170 * TODO, doc/bison.1: Update English.
7171 * doc/bison.texinfo: Update English.
7172 (Understanding Your Parser, Bison Options): Document as
7173 `--report=lookahead' rather than `--report=look-ahead'.
7174 * src/conflicts.c: Update English in comments.
7175 (lookahead_set): Rename from look_ahead_set.
7176 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
7177 (resolve_sr_conflict): Rename local look_ahead_tokens to
7178 lookahead_tokens, and update other uses.
7179 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
7180 count_rr_conflicts, conflicts_free): Update uses.
7181 * src/getargs.c (report_args): Move "lookahead" before alternate
7182 spellings.
7183 (report_types): Update uses.
7184 (usage): For `--report' usage description, state `lookahead' spelling
7185 rather than `look-ahead'.
7186 * src/getargs.h (report.report_lookahead_tokens): Rename from
7187 report_look_ahead_tokens.
7188 * src/lalr.c: Update English in comments.
7189 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
7190 (state_lookahead_tokens_count): Rename from
7191 state_look_ahead_tokens_count.
7192 Rename local n_look_ahead_tokens to n_lookahead_tokens.
7193 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
7194 Rename local n_look_ahead_tokens to n_lookahead_tokens.
7195 Update other uses.
7196 Update English in output.
7197 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
7198 * src/print.c: Update English in comments.
7199 (lookahead_set): Rename from look_ahead_set.
7200 (print_reduction): Rename argument lookahead_token from
7201 look_ahead_token.
7202 (print_core, state_default_rule, print_reductions, print_results):
7203 Update uses.
7204 * src/print_graph.c: Update English in comments.
7205 (print_core): Update uses.
7206 * src/state.c: Update English in comments.
7207 (reductions_new): Update uses.
7208 (state_rule_lookahead_tokens_print): Rename from
7209 state_rule_look_ahead_tokens_print, and update other uses.
7210 * src/state.h: Update English in comments.
7211 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
7212 (state_rule_lookahead_tokens_print): Rename from
7213 state_rule_look_ahead_tokens_print.
7214 * src/tables.c: Update English in comments.
7215 (conflict_row, action_row): Update uses.
7216 * tests/glr-regression.at
7217 (Incorrect lookahead during deterministic GLR,
7218 Incorrect lookahead during nondeterministic GLR): Rename
7219 print_look_ahead to print_lookahead.
7220 * tests/torture.at: Update English in comments.
7221 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
7222 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
7223 (Many lookahead tokens): Update uses.
7224 * data/glr.c: Update English in comments.
7225 * lalr1.cc: Likewise.
7226 * yacc.c: Likewise.
7227 * src/conflicts.h: Likewise.
7228 * src/lalr.h: Likewise.
7229 * src/main.c: Likewise.
7230 * src/output.c: Likewise.
7231 * src/parse-gram.c: Likewise.
7232 * src/tables.h: Likewise.
7233 * tests/calc.at: Likewise.
7234
7235 2006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
7236
7237 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
7238
7239 2006-06-07 Paul Eggert <eggert@cs.ucla.edu>
7240
7241 * TODO: Add request from Nelson H. F. Beebe to be able to install
7242 Bison without installing the yacc script.
7243
7244 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
7245
7246 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
7247 and yytext if they're already #define'd.
7248 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
7249 * src/scan-code-c.c: ... here.
7250 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
7251 <config.h>.
7252
7253 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
7254
7255 Get Bison to build again when configured with --enable-gcc-warnings.
7256 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
7257 missing #include's.
7258 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
7259 loc argument as it shadows a global.
7260 * src/scan-gram.l: Remove stray comma that prevents boundary_set
7261 invocation.
7262
7263 * src/.cvsignore: Add scan-code.c.
7264
7265 2006-06-07 Akim Demaille <akim@epita.fr>
7266
7267 * src/scan-gram.l: Move the "add a trailing ; to actions" code
7268 to...
7269 * src/scan-code.l: here.
7270 * tests/input.at (Torturing the Scanner): Fix another location
7271 error.
7272
7273 2006-06-07 Akim Demaille <akim@epita.fr>
7274
7275 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
7276
7277 2006-06-06 Akim Demaille <akim@epita.fr>
7278
7279 Extract the parsing of user actions from the grammar scanner.
7280 As a consequence, the relation between the grammar scanner and
7281 parser is much simpler. We can also split "composite tokens" back
7282 into simple tokens.
7283 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
7284 * src/scan-gram.l (add_column_width, adjust_location): Move to and
7285 rename as...
7286 * src/location.h, src/location.c (add_column_width)
7287 (location_compute): these.
7288 Fix the column count: the initial column is 0.
7289 (location_print): Be robust to ending column being 0.
7290 * src/location.h (boundary_set): New.
7291 * src/main.c: Adjust to scanner_free being renamed as
7292 gram_scanner_free.
7293 * src/output.c: Include scan-code.h.
7294 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
7295 Use boundary_set.
7296 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
7297 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
7298 which is now, again, a separate token.
7299 Adjust all dependencies.
7300 Whereever actions with $ and @ are used, use translate_code.
7301 (action): Remove this nonterminal which is now useless.
7302 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
7303 (grammar_current_rule_action_append): Use translate_code.
7304 (packgram): Bound check ruleno, itemno, and rule_length.
7305 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
7306 (last_string, last_braced_code_loc, max_left_semantic_context)
7307 (scanner_initialize, scanner_free, scanner_last_string_free)
7308 (gram_out, gram_lineno, YY_DECL_): Move to...
7309 * src/scan-gram.h: this new file.
7310 (YY_DECL): Rename as...
7311 (GRAM_DECL): this.
7312 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
7313 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
7314 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
7315 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
7316 Move these declarations, and...
7317 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
7318 these to...
7319 * src/flex-scanner.h: this new file.
7320 * src/scan-gram.l (rule_length, rule_length_overflow)
7321 (increment_rule_length): Remove.
7322 (last_braced_code_loc): Rename as...
7323 (gram_last_braced_code_loc): this.
7324 Adjust to the changes of the parser.
7325 Move all the handling of $ and @ into...
7326 * src/scan-code.l: here.
7327 * src/scan-gram.l (handle_dollar, handle_at): Remove.
7328 (handle_action_dollar, handle_action_at): Move to...
7329 * src/scan-code.l: here.
7330 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
7331 scan-code.h, scan-code-c.c, scan-gram.h.
7332 (EXTRA_bison_SOURCES): Add scan-code.l.
7333 (BUILT_SOURCES): Add scan-code.c.
7334 (yacc): Be robust to white spaces.
7335
7336 * tests/conflicts.at, tests/input.at, tests/reduce.at,
7337 * tests/regression.at: Adjust the column numbers.
7338 * tests/regression.at: Adjust the error message.
7339
7340 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
7341
7342 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
7343 Use Akim's wording from
7344 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
7345
7346 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
7347
7348 Between Bison releases, manually append `+' to the previous Bison
7349 release number, and use that as a signal to automatically print the
7350 ChangeLog's CVS Id keyword from --version. Discussed starting at
7351 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
7352 * ChangeLog: Add Id header.
7353 * configure.ac (AC_INIT): Append `+' to `2.3'.
7354 * src/.cvsignore: Add revision.c.
7355 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
7356 (BUILT_SOURCES): Add revision.c.
7357 (revision.c): New target rule. This file defines a new global variable
7358 named revision. It initializes it with either the Id from ChangeLog
7359 or, if VERSION doesn't contain `+', with the empty string.
7360 * src/getargs.c (version): Print the value of revision.
7361 * src/revision.h: Extern revision.
7362
7363 2006-06-05 Paul Eggert <eggert@cs.ucla.edu>
7364
7365 * NEWS: Version 2.3.
7366 * configure.ac (AC_INIT): Likewise.
7367
7368 2006-05-30 Paul Eggert <eggert@cs.ucla.edu>
7369
7370 * data/glr.c (YYRECOVERING): Define to be a function-like macro
7371 with no arguments, not as an object-like macro. This is for
7372 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
7373 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
7374 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
7375 Document this.
7376
7377 2006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
7378
7379 * src/getargs.c (usage): Back out yesterday's modification of the
7380 --help output so that we don't have to wait for translation before
7381 releasing 2.3.
7382
7383 2006-05-29 Paul Eggert <eggert@cs.ucla.edu>
7384
7385 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
7386 Problem reported by Akim Demaille.
7387
7388 2006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
7389
7390 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
7391
7392 2006-05-26 Paul Eggert <eggert@cs.ucla.edu>
7393
7394 * data/yacc.c (yy_reduce_print): Omit trailing white space in
7395 generated source code. Problem reported by Frans Englich in
7396 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
7397
7398 2006-05-22 Paul Eggert <eggert@cs.ucla.edu>
7399
7400 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
7401 shell, not within 'make', so that 'make' by an ordinary builder
7402 (using GNU make) does not worry about configuring gzip. This also
7403 works around a bug reported independently by Keith Thompson and by
7404 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
7405 stderr rather than stdout, messing up the build logs.
7406
7407 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
7408
7409 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
7410 to make sure that YYID will never be unused. This fixes a 'make
7411 maintainer-check' failure caused by the recent changes to the 'Trivial
7412 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
7413 not used.
7414 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
7415
7416 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
7417
7418 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
7419 state before an empty RHS is always resolved here. Only the location
7420 of that state is guaranteed to be resolved, and that's enough. This
7421 fixes the remaining bug reported by Derek M. Jones in
7422 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
7423 * tests/glr-regression.at (Uninitialized location when reporting
7424 ambiguity): Test the above case.
7425 Also, the embedded comments in this test case claim it checks the case
7426 of an empty RHS that has inherited the initial location. However, the
7427 corresponding LHS was already resolved, so yyresolveLocations didn't
7428 actually have reason to modify it. Fix this by forcing
7429 nondeterministic operation at the beginning of the parse.
7430
7431 2006-05-20 Paul Eggert <eggert@cs.ucla.edu>
7432
7433 * data/c.m4 (b4_yy_symbol_print_generate):
7434 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
7435 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
7436 of the bugs reported today by Derek M Jones in
7437 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
7438 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
7439 defined to be a type name without parens or brackets.
7440 (Location Type): Similarly for YYLTYPE.
7441 * tests/regression.at (Trivial grammars): Put in a test for this
7442 bug that will be caught by 'make maintainer-check' (though not,
7443 alas, by 'make check' unless your compiler is picky).
7444
7445 2006-05-19 Paul Eggert <eggert@cs.ucla.edu>
7446
7447 * NEWS: Version 2.2.
7448 * configure.ac (AC_INIT): Likewise.
7449
7450 2006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
7451
7452 * data/glr.c (yyreportTree): Make room in yystates for the state
7453 preceding the RHS. This fixes the segmentation fault reported by Derek
7454 M. Jones in
7455 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
7456 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
7457 to the user. Reported for yyreportTree by Derek M. Jones later in the
7458 same thread.
7459 * THANKS: Add Derek M. Jones.
7460 Update my email address.
7461 Fix typo in Steve Murphy's name.
7462
7463 2006-05-14 Paul Eggert <eggert@cs.ucla.edu>
7464
7465 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
7466 checking against YYLAST that caused the parser to miss a potential
7467 alternative in its diagnostic.
7468 Problem reported by Maria Jose Moron Fernandez in
7469 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
7470 * data/lalr1.cc (yysyntax_error_): Likewise.
7471 * data/yacc.c (yysyntax_error): Likewise.
7472 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
7473 tokens, in case we run into an older C compiler.
7474 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
7475 Use them to check for the off-by-one error fixed above.
7476
7477 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
7478 YYSIZE_T, not size_t.
7479 * tests/regression.at (Trivial grammars): New test, to catch
7480 the error fixed by the above patch.
7481
7482 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
7483
7484 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
7485 scheme.
7486 Reported by Steve Murphy.
7487
7488 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
7489
7490 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
7491 * data/glr.cc: b4_location_flag is now b4_locations_flag.
7492
7493 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
7494
7495 Implement --trace=m4.
7496 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
7497 * src/output.c (output_skeleton): When set, pass -dV to m4.
7498
7499 Factor the handling of flags in m4.
7500 * src/output.c (prepare): Rename the muscle names debug, defines,
7501 error_verbose to debug_flag, defines_flag, error_verbose_flag.
7502 * data/c.m4: Adjust.
7503 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
7504 Use b4_define_flag_if to define other b4_FLAG_if macros.
7505 (b4_location_if): As a consequence, rename as...
7506 (b4_locations_if): this, for consistency.
7507 Adjust all the skeletons.
7508
7509 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
7510
7511 * etc/bench.pm: Shorten bench names.
7512
7513 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
7514
7515 * src/output.h, src/output.c (error_verbose): Move to...
7516 * src/getargs.h, src/getargs.c: here.
7517 Sort the flags.
7518 Adjust dependencies.
7519
7520 2006-05-13 Paul Eggert <eggert@cs.ucla.edu>
7521
7522 * data/c.m4 (b4_copyright): Put the special exception for Bison
7523 skeletons here, so we don't have to put it in each skeleton. All
7524 uses changed. Suggested by Akim Demaille. Also, wrap the
7525 copyright notice, in case it is longer than 80 columns. Replace
7526 comma by newline after title.
7527
7528 2006-05-11 Paul Eggert <eggert@cs.ucla.edu>
7529
7530 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
7531 incompatibility, not a bug. Mention that it wasn't fixed as of
7532 flex 2.5.33.
7533
7534 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
7535
7536 * examples/extexi: Enforce the precedence of concatenation over
7537 >>.
7538 Reported by Tommy Nordgren.
7539
7540 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
7541
7542 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
7543 with the member "token".
7544 Reported by Martin Nylin.
7545
7546 2006-05-08 Paul Eggert <eggert@cs.ucla.edu>
7547
7548 * data/glr.c: Switch to Bison 2.2 special-exception language in
7549 the copyright notice. Use more-regular format for titles and
7550 copyright notices.
7551 * data/glr.cc: Likewise.
7552 * data/location.cc: Likewise.
7553 * data/yacc.cc: Likewise.
7554 * doc/bison.texinfo (Conditions): Document this.
7555 * NEWS: likewise. Upgrade version to 2.2.
7556
7557 2006-04-27 Akim Demaille <akim@lrde.epita.fr>
7558
7559 * data/glr.cc: Remove dead code.
7560
7561 2006-04-25 Paul Eggert <eggert@cs.ucla.edu>
7562
7563 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
7564 that variable and the line breaks the bootstrap. Problem reported
7565 by Juan M. Guerrero.
7566
7567 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
7568
7569 * doc/bison.texinfo (Multiple start-symbols): New.
7570
7571 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
7572
7573 * etc/README, etc/bench.pl: New.
7574
7575 2006-04-03 Akim Demaille <akim@lrde.epita.fr>
7576
7577 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
7578 rule.
7579 Reported by Mickael Labau.
7580 * tests/input.at (Torturing the Scanner): Test it.
7581
7582 2006-03-16 Paul Eggert <eggert@cs.ucla.edu>
7583
7584 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
7585 Problem reported by Bob Rossi.
7586
7587 2006-03-13 Paul Eggert <eggert@cs.ucla.edu>
7588
7589 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
7590 and didn't really work.
7591 For the index, use @ifnotinfo, not @iftex.
7592 Minor cleanups of spacing and terminology.
7593
7594 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
7595
7596 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
7597 of AT_NAME_PREFIX when %name-prefix is not used.
7598
7599 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
7600
7601 Apply --prefix to C++ skeletons too: they change the namespace.
7602 The test suite already exercize these cases.
7603 * data/c++.m4 (b4_namespace): New.
7604 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
7605 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
7606 * data/yacc.c, data/glr.c: Remove a useless `[]'.
7607 * doc/bison.texinfo: Document it.
7608 (Option Cross Key): Use @multitable in all formats. It looks
7609 nicer, even in TeX outputs.
7610 (Rules): Use the same code whatever the output type is.
7611 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
7612 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
7613 * tests/calc.at: Use it, instead of hard coding `yy'.
7614
7615 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
7616
7617 * TODO: Remove dead items.
7618
7619 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
7620
7621 * doc/FAQ: Remove, merged into...
7622 * doc/bison.texinfo (FAQ): this.
7623 * doc/Makefile.am (EXTRA_DIST): Adjust.
7624
7625 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
7626
7627 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
7628 even if empty.
7629 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
7630 * doc/bison.texinfo (Calc++ Scanner): Use it.
7631
7632 2006-03-09 Paul Eggert <eggert@cs.ucla.edu>
7633
7634 Fix two nits reported by twlevo, plus one more that I discovered.
7635
7636 * src/assoc.h (assoc_to_string): Give a name to the arg, as
7637 this is the usual Bison style.
7638 * src/location.h (location_print): Likewise.
7639
7640 * src/reader.h (token_name): Likewise.
7641
7642 2006-03-08 Paul Eggert <eggert@cs.ucla.edu>
7643
7644 Fix some nits reported by twlevo.
7645 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
7646 and "POSIX". Use more-modern syntax for URLs. Mention C++
7647 and ask for Java. Don't hardwire OS version numbers. Add
7648 copyright notice.
7649 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
7650 * src/conflicts.c (solved_conflicts_obstack): Now static.
7651
7652 2006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
7653
7654 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
7655 page. Say "you can use it" not "you may use it" as on the web page;
7656 we're describing capabilities not granting permission.
7657
7658 2006-03-06 Paul Eggert <eggert@cs.ucla.edu>
7659
7660 * data/glr.c (yyresolveLocations): Rename local variables to avoid
7661 shadowing warnings. Use usual patter for iterating through RHS.
7662 * tests/glr-regression.at
7663 (Uninitialized location when reporting ambiguity):
7664 Modify yylex so that it uses its argument, rather than trying
7665 to rely on ARGSUSED (which doesn't work for gcc with warnings).
7666 const char -> char const.
7667
7668 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
7669 Don't use tabs inside commands; it messes up 'ps'.
7670 Problem reported by twlevo.
7671
7672 2006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
7673
7674 * tests/glr-regression.at (Uninitialized location when reporting
7675 ambiguity): New test case.
7676 * data/glr.c (yyresolveLocations): New function, which uses
7677 YYLLOC_DEFAULT.
7678 (yyresolveValue): Invoke yyresolveLocations before reporting an
7679 ambiguity.
7680 * doc/bison.texinfo (Default Action for Locations): Note
7681 YYLLOC_DEFAULT's usage for ambiguity locations.
7682 (GLR Semantic Actions): Cross-reference those notes.
7683
7684 2006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
7685
7686 * tests/glr-regression.at (Leaked semantic values when reporting
7687 ambiguity): Remove unnecessary union and type declarations.
7688 (Leaked lookahead after nondeterministic parse syntax error): New test
7689 case.
7690 * data/glr.c (yyparse): Check for zero stacks remaining before
7691 attempting to shift the lookahead so that you don't lose it.
7692
7693 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
7694
7695 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
7696 * tests/glr-regression.at (Leaked semantic values when reporting
7697 ambiguity): New test case.
7698 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
7699 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
7700 now unnecessary yystackp parameter.
7701 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
7702 destructors can be called.
7703
7704 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
7705 in existing testcases.
7706
7707 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
7708
7709 Don't leak semantic values for parent RHS when a user action cuts the
7710 parser, and clean up related code a bit.
7711 * tests/glr-regression.at (Leaked merged semantic value if user action
7712 cuts parse): Rename to...
7713 (Leaked semantic values if user action cuts parse): ... this. Add check
7714 for leaked parent RHS values.
7715 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
7716 between an unresolved state (non-empty chain of semantic options) and
7717 an incomplete one (signaled by an empty chain).
7718 (yyresolveStates): Document the interface. Move all manipulation of a
7719 successfully or unsuccessfully resolved yyGLRState to...
7720 (yyresolveValue): ... here so that yyresolveValue always leaves a
7721 yyGLRState with consistent data and thus is easier to understand.
7722 Remove the yyvalp and yylocp parameters since they are always just
7723 taken from the yys parameter. When reporting a discarded merged value
7724 in debugging output, note that it is incompletely merged. Document the
7725 interface.
7726 (yyresolveAction): If resolving any of the RHS states fails, destroy
7727 them all rather than leaking them. Thus, as long as user actions are
7728 written to clean up the RHS correctly, yyresolveAction always cleans up
7729 the RHS of a semantic option. Document the interface.
7730
7731 2006-02-27 Paul Eggert <eggert@cs.ucla.edu>
7732
7733 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
7734 led to a segmentation fault in GNU Pascal. Problem reported
7735 by Waldek Hebisch.
7736
7737 2006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
7738
7739 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
7740 mid-rule action inside a nonterminal symbol in order to declare a
7741 destructor for its semantic value.
7742
7743 2006-02-16 Paul Eggert <eggert@cs.ucla.edu>
7744
7745 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
7746 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
7747 __cplusplus && ! defined _STDLIB_H && !
7748 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
7749 defined free))]: Include <stdlib.h> rather than rolling our own
7750 declarations of malloc and free, to avoid problems with
7751 incompatible declarations (using 'throw') C++'s stdlib.h. This
7752 should fix Debian bug 340012
7753 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
7754 reported by Guillaume Melquiond.
7755
7756 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
7757
7758 * NEWS: Clarify symbols versus types in unused-value warnings.
7759
7760 * configure.ac (AC_INIT): Bump version number.
7761
7762 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
7763
7764 * NEWS: Version 2.1a.
7765 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
7766 since C99 requires this.
7767
7768 2006-02-11 Paul Eggert <eggert@cs.ucla.edu>
7769
7770 * m4/c-working.m4: New file.
7771 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
7772
7773 2006-02-10 Paul Eggert <eggert@cs.ucla.edu>
7774
7775 * Makefile.maint: Merge from coreutils.
7776
7777 2006-02-09 Paul Eggert <eggert@cs.ucla.edu>
7778
7779 More portability fixes for problems summarized by Nelson H. F. Beebe.
7780
7781 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
7782 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
7783 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
7784 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
7785 messes up because C++ code is compiled in 32-bit mode but linked
7786 in 64-bit mode.
7787
7788 2006-02-08 Paul Eggert <eggert@cs.ucla.edu>
7789
7790 More portability fixes for problems summarized by Nelson H. F. Beebe.
7791
7792 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
7793 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
7794
7795 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
7796 nodist_PROGRAMS, since we don't need to actually compile the
7797 example if we're just doing a plain 'make'. This avoids bothering
7798 the installer unnecessarily about problems due to weird C++
7799 compilers.
7800
7801 2006-02-06 Paul Eggert <eggert@cs.ucla.edu>
7802
7803 More portability fixes for problems summarized by Nelson H. F. Beebe.
7804
7805 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
7806 than #include "...", and compile with -I'.'. The old method was
7807 not portable, according to Posix and the C standard, and it does
7808 not work with Sun C 5.7, where previous #line directives affect
7809 the working directory used in later #include "..." directives.
7810
7811 2006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7812
7813 Various DJGGP specific issues in /djgpp
7814
7815 2006-02-02 Paul Eggert <eggert@cs.ucla.edu>
7816
7817 More portability fixes for problems summarized by Nelson H. F. Beebe.
7818
7819 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
7820 '#include <map>' works and that you can apply ++ to iterators.
7821
7822 2006-02-01 Paul Eggert <eggert@cs.ucla.edu>
7823
7824 Work around portability problems summarized by Nelson H. F. Beebe in
7825 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
7826
7827 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
7828 that '#include <string>' works.
7829
7830 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
7831 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
7832 "warning: sorry: semantics of inline function static data `const
7833 unsigned char translate_table[262]' are wrong (you'll wind up with
7834 multiple copies)".
7835
7836 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
7837 or, xor to not_, and_, or_, and xor_, respectively. This works
7838 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
7839 random system header somewhere that includes the equivalent of
7840 <iso646.h>.
7841
7842 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
7843 -E" works; it apparently doesn't work with PathScale EKO Compiler
7844 Suite Version 2.0.
7845
7846 2006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
7847
7848 During deterministic GLR operation, user actions should be able to
7849 influence the parse by changing yychar. To make this easier to fix and
7850 to make glr.c easier to evolve in general, don't maintain yytoken in
7851 parallel with yychar; just compute yytoken when needed.
7852 * tests/glr-regression.at (Incorrect lookahead during deterministic
7853 GLR): Check that setting yychar in a user action has the intended
7854 effect.
7855 * data/glr.c (yyGLRStack): Remove yytokenp member.
7856 (yyclearin): Don't set *yytokenp.
7857 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
7858 yychar rather than *yytokenp to determine the current lookahead.
7859 Compute yytoken locally when needed.
7860 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
7861 point to.
7862
7863 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
7864 after `--report' documentation.
7865
7866 2006-01-30 Paul Eggert <eggert@cs.ucla.edu>
7867
7868 * src/parse-gram.y (grammar_declaration): Location of printer
7869 symbol is @1, not list->location. Bug reported by twlevo.
7870 * tests/input.at (Incompatible Aliases): Adjust to above change.
7871
7872 2006-01-29 Paul Eggert <eggert@cs.ucla.edu>
7873
7874 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
7875 all the test at once. This makes the output easier to read in the
7876 normal case.
7877
7878 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
7879 got from <http://bro-ids.org/download.html>. The bug is that
7880 when two actions appeared in succession, the second one was
7881 scanned before the first one was added to the grammar rule
7882 as a midrule action. Bison then output the incorrect warning
7883 "parse.y:905.17-906.36: warning: unused value: $3".
7884 * src/parse-gram.y (BRACED_CODE, action): These are no longer
7885 associated with a value.
7886 (rhs): Don't invoke grammar_current_rule_action_append.
7887 (action): Invoke it here instead.
7888 * src/reader.c (grammar_midrule_action): Now extern.
7889 (grammar_current_rule_action_append): Don't invoke
7890 grammar_midrule_action; that is now the scanner's job.
7891 * src/reader.h (last_string, last_braced_code_loc):
7892 (grammar_midrule_action): New decls.
7893 * src/scan-gram.l (last_string): Now extern, sigh.
7894 (last_braced_code_loc): New extern variable.
7895 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
7896 rule already has an action.
7897 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
7898 * tests/input.at (AT_CHECK_UNUSED_VALUES):
7899 Add some tests to check that the above changes fixed the bug.
7900
7901 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
7902
7903 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
7904 All used changed. Check whether the symbol has a destructor,
7905 not whether it is typed.
7906 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
7907 that the values are still reported as unused. All line numbers
7908 adjusted.
7909
7910 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
7911
7912 Work around a bug in bro 0.8, which underparenthesizes its
7913 definition of YYLLOC_DEFAULT.
7914 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
7915 their arguments.
7916 * data/lalr1.cc: Likewise.
7917 * data/yacc.cc: Likewise.
7918
7919 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
7920
7921 Work around a bug in Pike 7.0, and give the Pike folks a
7922 better way to override the usual int widths.
7923 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
7924 user can override the types.
7925 (short): #undef, to work around a bug in Pike 7.0.
7926 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
7927 (union yyalloc.yyss): Use yytype_int16 rather than short.
7928 All uses changed.
7929 (yysigned_char): Remove.
7930 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
7931 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
7932 * tests/regression.at (Web2c Actions): Adjust to above changes.
7933
7934 * src/reader.c (check_and_convert_grammar): New function.
7935 (reader): Close the input file even if something went wrong during
7936 parsing. Minor file descriptor leak reported by twlevo.
7937
7938 * src/assoc.c (assoc_to_string): Use a default: abort (); case
7939 to pacify gcc -Wswitch-default.
7940 * src/scan-gram.l (adjust_location): Use a default: break; case
7941 to pacify gcc -Wswitch-default.
7942 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
7943 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
7944 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
7945 Move these decls to scan-skel.l, since they don't need to be
7946 visible elsewhere.
7947 * src/scan-skel.l: Accept the above decls.
7948 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
7949 is used.
7950
7951 2006-01-21 Paul Eggert <eggert@cs.ucla.edu>
7952
7953 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
7954 since we don't want to insist on a version number at the start
7955 of the changelog every time.
7956 * Makefile.maint: Sync from coreutils a bit better.
7957 (sc_trailing_blank): Renamed from sc_trailing_space.
7958 All uses changed.
7959 (sc_no_if_have_config_h, sc_require_config_h):
7960 (sc_prohibit_assert_without_use): New rules.
7961 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
7962 (sc_dd_max_sym_length): Fix leading spaces in rule.
7963 (sc_system_h_headers): Prefix with @.
7964 (sc_useless_cpp_parens, m4-check): Output line numbers.
7965 (changelog-check): Allow version only in head.
7966 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
7967 satisfy new Makefile.maint rule.
7968 * data/glr.c: Likewise.
7969 * data/glr.cc: Likewise.
7970 * data/lalr1.cc: Likewise.
7971 * data/yacc.c: Likewise.
7972 * lib/ebitsetv.c: Likewise.
7973 * lib/lbitset.c: Likewise.
7974 * lib/subpipe.c: Likewise.
7975 * lib/timevar.c: Likewise.
7976 * src/system.h: Likewise.
7977 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
7978 * djgpp/Makefile.maint: Add copyright notice.
7979 * djgpp/README.in: Likewise.
7980 * djgpp/config.bat: Likewise.
7981 * djgpp/config.site: Likewise.
7982 * djgpp/config_h.sed: Likewise.
7983 * djgpp/djunpack.bat: Likewise.
7984 * djgpp/config.sed: Fix copyright notice to match standard format.
7985 * djgpp/subpipe.h: Likewise.
7986 * lib/bitsetv-print.c: Likewise.
7987 * lib/bitsetv.c: Likewise.
7988 * lib/subpipe.h: Likewise.
7989 * lib/timevar.c: Likewise.
7990 * lib/timevar.h: Likewise.
7991 * djgpp/subpipe.c: Use standard recipe for config.h.
7992 * lib/abitset.c: Likewise.
7993 * lib/bitset.c: Likewise.
7994 * lib/bitset_stats.c: Likewise.
7995 * lib/bitsetv-print.c: Likewise.
7996 * lib/bitsetv.c: Likewise.
7997 * lib/ebitsetv.c: Likewise.
7998 * lib/get-errno.c: Likewise.
7999 * lib/lbitset.c: Likewise.
8000 * lib/subpipe.c: Likewise.
8001 * lib/timevar.c: Likewise.
8002 * lib/vbitset.c: Likewise.
8003 * tests/local.at: Likewise.
8004 * src/scan-gram.l: Don't include verify.h, since system.h does
8005 that for us.
8006 * .x-sc_require_config_h: New file.
8007 * .x-sc_unmarked_diagnostics: New file.
8008
8009 2006-01-20 Paul Eggert <eggert@cs.ucla.edu>
8010
8011 Be a bit more systematic about using 'abort'.
8012 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
8013 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
8014 Put 'default: abort ();' before some other case, to satisfy older
8015 pedantic compilers.
8016 * lib/bitset_stats.c (bitset_stats_init): Likewise.
8017 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
8018 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
8019 * src/conflicts.c (resolve_sr_conflict): Likewise.
8020 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
8021 (get_decision_str, get_orientation_str, get_node_alignment_str):
8022 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
8023 (get_linestyle_str, get_arrowstyle_str): Likewise.
8024 * src/conflicts.c (resolve_sr_conflict):
8025 Use a default case rather than one for the one remaining enum
8026 value, to catch invalid enum values as well.
8027 * src/lalr.c (set_goto_map, map_goto):
8028 Prefer "assert (FOO);" to "if (!FOO) abort ();".
8029 * src/nullable.c (nullable_compute, token_definitions_output):
8030 Likewise.
8031 * src/reader.c (packgram, reader): Likewise.
8032 * src/state.c (transitions_to, state_new, state_reduction_find):
8033 Likewise.
8034 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
8035 (symbol_pack): Likewise.
8036 * src/tables.c (conflict_row, pack_vector): Likewise.
8037 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
8038 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
8039 * src/system.h: Don't include <assert.h>.
8040 (assert): New macro.
8041
8042 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
8043 (Destructor Decl, Parser Function, Pure Calling):
8044 Describe rules for braces inside C code more carefully.
8045
8046 2006-01-19 Paul Eggert <eggert@cs.ucla.edu>
8047
8048 Fix some porting glitches found by Nelson H. F. Beebe.
8049 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
8050 compilers that don't understand that abort () does not return.
8051 * src/state.c (transitions_to): Likewise.
8052 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
8053 that '#include <cstdlib>' works.
8054 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
8055 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
8056 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
8057 for the benefit of some pre-C99 compilers.
8058
8059 * bootstrap: Undo changes to gnulib files that autoreconf made.
8060
8061 Minor fixups to get 'make maintainer-check' to work.
8062 * configure.ac: Don't use -Wnested-externs, as it's incompatible
8063 with the new verify.h implementation.
8064 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
8065 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
8066 * data/yacc.c (YYUSE): Likewise.
8067 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
8068 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
8069 * src/parse-gram.y (declaration): Don't pass a string constant
8070 to a function that expects char *, since GCC might complain
8071 about the constant value.
8072 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
8073 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
8074 before #defining them.
8075 * tests/glr-regression.at
8076 (Incorrectly initialized location for empty right-hand side in GLR):
8077 In yyerror, use the msg arg.
8078 (Corrupted semantic options if user action cuts parse):
8079 (Incorrect lookahead during deterministic GLR):
8080 (Incorrect lookahead during nondeterministic GLR):
8081 Don't name a local var 'index'; it shadows string.h's 'index'.
8082
8083 2006-01-19 Akim Demaille <akim@epita.fr>
8084
8085 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
8086 location, not just parts of it.
8087
8088 2006-01-18 Paul Eggert <eggert@cs.ucla.edu>
8089
8090 * NEWS: Document the fact that multiple %unions are now allowed.
8091 * doc/bison.texinfo (Union Decl): Likewise.
8092 * TODO: This feature is now implemented, so remove it from
8093 the wishlist.
8094
8095 * Makefile.maint: Merge with coreutils Makefile.maint.
8096 (CVS_LIST): Use build-aux version if available.
8097 (VERSION_REGEXP): New macro.
8098 (syntax-check-rules): Add sc_no_if_have_config_h,
8099 sc_prohibit_assert_without_use, sc_require_config_h,
8100 sc_useless_cpp_parens.
8101 (sc_obsolete_symbols): Check for O_NDELAY.
8102 (sc_dd_max_sym_length): Track coreutils.
8103 (sc_unmarked_diagnostics): Look in all files, not just *.c.
8104 (sc_useless_cpp_parens): New rule.
8105 (news-date-check): Look for version or today's date.
8106 (changelog-check): Don't require version number near head.
8107 (copyright-check): Use current year instead of hardwiring 2005.
8108 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
8109 (announcement): Add --gpg-key-ID.
8110
8111 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
8112 with "file system".
8113
8114 Avoid undefined behavior that addressed just before the start of an
8115 array. Problem reported by twlevo.
8116 * src/reader.c (packgram): Prepend a new sentinel before ritem.
8117 * src/lalr.c (build_relations): Rely on new sentinel.
8118 * src/gram.c (gram_free): Adjust to new sentinel.
8119
8120 2006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
8121
8122 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
8123 yylookaheadNeeds. All uses updated.
8124 (yysplitStack): Rename local yynewLookaheadStatuses to
8125 yynewLookaheadNeeds.
8126 * data/glr-regression.at (Incorrect lookahead during nondeterministic
8127 GLR): In comments, change `lookahead status' to `lookahead need'.
8128
8129 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8130
8131 * data/glr.c (yysplitStack): A little stylistic rewrite.
8132
8133 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8134
8135 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
8136
8137 2006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
8138
8139 * doc/bison.texinfo: Fix some typos.
8140 (GLR Semantic Actions): New subsection discussing special
8141 considerations because GLR semantic actions might be deferred.
8142 (Actions): Mention look-ahead usage of yylval.
8143 (Actions and Locations): Mention look-ahead usage of yylloc.
8144 (Special Features for Use in Actions): Add YYEOF entry and mention it
8145 in the yychar entry.
8146 In the yychar entry, remove mention of the local yychar case (pure
8147 parser) since this is irrelevant information when writing semantic
8148 actions and since it's already discussed in `Table of Symbols' where
8149 yychar is otherwise described as an external variable.
8150 In the yychar entry, don't call it the `current' look-ahead since it
8151 isn't when semantic actions are deferred.
8152 In the yychar and yyclearin entries, add note about deferred semantic
8153 actions.
8154 Add yylloc and yylval entries discussing look-ahead usage.
8155 (Look-Ahead Tokens): When discussing yychar, don't call it the
8156 `current' look-ahead, and do mention yylval and yylloc.
8157 (Error Recovery): Cross-reference `Action Features' when mentioning
8158 yyclearin.
8159 (Table of Symbols): In the yychar entry, don't call it the `current'
8160 look-ahead.
8161 In the yylloc and yylval entries, mention look-ahead usage.
8162
8163 2006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
8164
8165 * tests/glr-regression.at: Update copyright year to 2006.
8166
8167 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
8168
8169 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
8170 use during nondeterministic operation to track which stacks have
8171 actually needed the current lookahead.
8172 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
8173 Allocate, deallocate, resize, and otherwise shuffle space for
8174 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
8175 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
8176 appropriately during nondeterministic operation.
8177 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
8178 members to store the current lookahead to be used by the deferred
8179 user action.
8180 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
8181 from which the RHS is taken. Set the lookahead members of the new
8182 yySemanticOption according to the lookahead status for stack yyk.
8183 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
8184 yyaddDeferredAction.
8185 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
8186 members of yySemanticOption before invoking yyuserAction, and then set
8187 them back to their current values afterward.
8188 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
8189 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
8190 * tests/glr-regression.at: Remove `.' from the ends of recent test case
8191 titles for consistency.
8192 (Leaked merged semantic value if user action cuts parse): In order to
8193 suppress lint warnings, use arguments in merge function, and assign
8194 char value < 128 in main.
8195 (Incorrect lookahead during deterministic GLR): New test case.
8196 (Incorrect lookahead during nondeterministic GLR): New test case.
8197
8198 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
8199
8200 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
8201 !yyvaluep as signal that no semantic value is available to print.
8202 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
8203 to print a semantic value.
8204
8205 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
8206
8207 * tests/glr-regression.at: For consistency with my newer test cases,
8208 don't thank myself.
8209
8210 2006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
8211
8212 * data/glr.c (yyresolveValue): When merging semantic options, if at
8213 least one user action succeeds but a later one cuts the parse, then
8214 destroy the semantic value before returning rather than leaking it.
8215 (yyresolveStates): If a user action cuts the parse and thus
8216 yyresolveValue fails, ignore the (unset) semantic value rather than
8217 corrupting the yyGLRState, and empty the semantic options list since
8218 the user actions should have called all necessary destructors.
8219 Simplify code with YYCHK.
8220 * tests/glr-regression.at (Corrupted semantic options if user action
8221 cuts parse): New test case.
8222 (Undesirable destructors if user action cuts parse): New test case.
8223 Before applying any of this patch, this test case never actually failed
8224 for me... but only because the corrupted semantic options usually
8225 masked this bug.
8226 (Leaked merged semantic value if user action cuts parse): New test
8227 case.
8228
8229 2006-01-05 Akim Demaille <akim@epita.fr>
8230
8231 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
8232
8233 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
8234
8235 * data/c.m4 (b4_c_modern): New macro, with a new provision for
8236 _MSC_VER. Problem reported by Cenzato Marco.
8237 (b4_c_function_def): Use it.
8238 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
8239 b4_c_modern.
8240 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
8241 than rolling our own.
8242
8243 2006-01-04 Akim Demaille <akim@epita.fr>
8244
8245 Also warn about non-used mid-rule values.
8246 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
8247 member.
8248 (symbol_list_new): Adjust.
8249 * src/reader.c (symbol_typed_p): New.
8250 (grammar_rule_check): Use it.
8251 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
8252 Check its rule.
8253 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
8254 Use it.
8255 * tests/actions.at (Exotic Dollars): Adjust.
8256
8257 2006-01-04 Akim Demaille <akim@epita.fr>
8258
8259 * src/reader.c (grammar_midrule_action): If $$ is set in a
8260 mid-rule, move the `used' bit to its lhs.
8261 * tests/input.at (Unused values): New.
8262 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
8263
8264 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
8265
8266 * doc/bison.texinfo (Bison Options): Say more accurately what
8267 --yacc does.
8268 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
8269 about declarations in the grammar when in Yacc mode, as POSIX does
8270 not require a diagnostic when the grammar uses extensions.
8271
8272 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
8273
8274 Warn about dubious constructions like "%token T T".
8275 Reported by twlevo.
8276 * src/symtab.h (struct symbol.declared): New member.
8277 * src/symtab.c (symbol_new): Initialize it to false.
8278 (symbol_class_set): New arg DECLARING, specifying whether
8279 this is a declaration that we want to warn about, if there
8280 is more than one of them. All uses changed.
8281
8282 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
8283 Allow multiple %union directives, whose contents concatenate.
8284 * src/parse-gram.y (grammar_declaration): Likewise.
8285 Use muscle_code_grow, so that we don't need stype_line any more.
8286 All uses changed.
8287
8288 * src/muscle_tab.c (muscle_grow): Fix comment.
8289
8290 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
8291 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
8292 Update copyright year to 2006.
8293
8294 2006-01-03 Akim Demaille <akim@epita.fr>
8295
8296 Have glr.cc pass (some of) the calc.at tests.
8297 * data/glr.cc (b4_parse_param_orig): New.
8298 (b4_parse_param): Improve its definition, and bound it more
8299 clearly in the skeleton.
8300 (b4_epilogue): Append, instead of prepending, in order to keep
8301 #line consistency.
8302 Simplify the generation of auxiliary functions: locations and
8303 purity are mandated.
8304 (b4_global_tokens_and_yystype): Honor it.
8305 * data/location.cc (c++.m4): Don't include it.
8306 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
8307 and AT_SKEL_CC_IF.
8308 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
8309 AT_LALR1_CC_IF.
8310 Be sure to initialize the first position's filename.
8311 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
8312 mandated anyway.
8313 (AT_CHECK_CALC_GLR_CC): New.
8314 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
8315
8316 2006-01-02 Akim Demaille <akim@epita.fr>
8317
8318 * src/output.c (output_skeleton): Don't hard wire the inclusion of
8319 c.m4.
8320 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
8321 * data/glr.cc: Do not include stack.hh.
8322
8323 2006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
8324
8325 * data/glr.c: Reformat whitespace with tabs.
8326 (b4_lpure_formals): Remove this unused m4 macro.
8327 * tests/cxx-type.at: Reformat whitespace with tabs.
8328 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
8329 since it's a member. Rename type to isNterm for clarity.
8330
8331 2005-12-29 Akim <akim@sulaco.local>
8332
8333 Let glr.cc catch up with symbol_value_print.
8334 * data/glr.cc (b4_yysymprint_generate): Replace by...
8335 (b4_yy_symbol_print_generate): this.
8336 (yy_symbol_print, yy_symbol_value_print): Declare them.
8337
8338 2005-12-28 Paul Eggert <eggert@cs.ucla.edu>
8339
8340 * src/location.h (boundary): Note that a line or column equal
8341 to INT_MAX indicates an overflow.
8342 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
8343 (rule_length_overflow, increment_rule_length, add_column_width):
8344 New functions.
8345 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
8346 (<SC_BRACED_CODE>"}"):
8347 Use increment_rule_length rather than incrementing it by hand.
8348 (adjust_location, handle_syncline): Diagnose overflow.
8349 (handle_action_dollar, handle_action_at):
8350 Fix bug with monstrosities like $-2147483648.
8351 Remove now-unnecessary checks.
8352 (scan_integer): Verify assumptions and remove now-unnecessary checks.
8353 (convert_ucn_to_byte): Verify assumptions.
8354 (handle_syncline): New arg LOC. All callers changed.
8355 Don't store through a value derived from char const * pointer.
8356
8357 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
8358 GCC warnings.
8359
8360 2005-12-27 Paul Eggert <eggert@cs.ucla.edu>
8361
8362 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
8363 Remove unnecessary forward static decls.
8364
8365 2005-12-27 Akim Demaille <akim@epita.fr>
8366
8367 * src/reader.c (grammar_current_rule_check): Also check that $$
8368 is used.
8369 Take the rule to check as argument, hence rename as...
8370 (grammar_rule_check): this.
8371 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
8372 Rename as...
8373 (grammar_rule_begin, grammar_rule_end): these, for consistency.
8374 (grammar_midrule_action, grammar_symbol_append): Now static.
8375 * tests/torture.at (input): Don't rely on the default action
8376 being always performed.
8377 * tests/calc.at: "Set" $$ even when the action is "cut" with
8378 YYERROR or other.
8379 * tests/actions.at (Exotic Dollars): Instead of using unused
8380 values, check that the warning is issued.
8381
8382 2005-12-22 Paul Eggert <eggert@cs.ucla.edu>
8383
8384 * NEWS: Improve wording for unused-value warnings.
8385
8386 2005-12-22 Akim Demaille <akim@epita.fr>
8387
8388 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
8389 (b4_yysymprint_generate): Rename as...
8390 (b4_yy_symbol_print_generate): this.
8391 Generate yy_symbol_print instead of yysymprint.
8392 Generate also yy_symbol_value_print, and use it.
8393
8394 2005-12-22 Akim Demaille <akim@epita.fr>
8395
8396 * NEWS: Warn about unused values.
8397 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
8398 a `used' member.
8399 (symbol_list_n_get, symbol_list_n_used_set): New.
8400 (symbol_list_n_type_name_get): Use symbol_list_n_get.
8401 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
8402 * src/reader.c (grammar_current_rule_check): Check that values are
8403 used.
8404 * src/symtab.c (symbol_print): Accept 0.
8405 * tests/existing.at: Remove the type information.
8406 Empty the actions.
8407 Remove useless actions (beware of mid-rule actions: perl -000
8408 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
8409 * tests/actions.at (Exotic Dollars): Use unused values.
8410 * tests/calc.at: Likewise.
8411 * tests/glr-regression.at (No users destructors if stack 0 deleted):
8412 Likewise.
8413
8414 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
8415 rule_useful_p.
8416
8417 2005-12-21 Paul Eggert <eggert@cs.ucla.edu>
8418
8419 Undo 2005-12-01 tentative license wording change. The wording is
8420 still being reviewed by the lawyers, and we don't want to wait for
8421 them before publishing a test release. For now, revert to the
8422 previous wording.
8423 * NEWS: Undo 2005-12-01 change.
8424 * data/glr.c: Revert to previous license wording.
8425 * data/glr.cc: Likewise.
8426 * data/lalr1.cc: Likewise.
8427 * data/location.cc: Likewise.
8428 * data/yacc.c: Likewise.
8429
8430 * NEWS: Reword %destructor vs YYABORT etc.
8431 * data/glr.c: Use American spacing, for consistency.
8432 * data/glr.cc: Likewise.
8433 * data/lalr1.cc: Likewise.
8434 * data/yacc.c: Likewise.
8435 * data/yacc.c: Reformat comments slightly.
8436 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
8437 for consistency. Fix some spelling errors and reword recently-included
8438 text slightly.
8439 * tests/cxx-type.at: Cast results of malloc, for C++.
8440
8441 2005-12-21 Joel E. Denny <address@hidden>
8442
8443 * tests/cxx-type.at: Construct a tree, count the parents of shared
8444 nodes, and free each node once and only once. Previously, the memory
8445 for semantic values was leaked instead.
8446
8447 2005-12-21 Joel E. Denny <address@hidden>
8448
8449 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
8450 (yylval, yylloc): If pure, #define to yystackp->yyval and
8451 yystackp->yyloc similar to yychar and yynerrs.
8452 (yyparse): If pure, remove local yylval and yylloc. Add local
8453 yystackp to accommodate pure definitions of yylval and yylloc.
8454 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
8455 yylvalp and yyllocp to &yylval and &yylloc.
8456 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
8457 namespace. Previously, nerrs and char were missing, but lval and lloc
8458 weren't necessary.
8459 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
8460 yylvalp and yyllocp parameters since, if pure, these are now always
8461 accessible through yystackp. If not pure, they are still accessible
8462 globally.
8463 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
8464 `if (YYID (N))' to pacify lint.
8465
8466 2005-12-21 Akim Demaille <akim@epita.fr>
8467
8468 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
8469 destroy the RHS symbols of a rule.
8470 * data/yacc.c (yylen): Initialize to 0.
8471 Keep its value to the number of items to possibly shift.
8472 In particular, a regular successful parse that ends on YYFINAL by
8473 a (internal) YYACCEPT must not have yylen != 0.
8474 (yyerrorlab, yyreturn): Pop the RHS.
8475 Reorder a bit to emphasize the `shifting' bits of code.
8476 (YYPOPSTACK): Now accept a number of items to pop.
8477 * data/lalr1.cc: Likewise.
8478 * data/glr.c: Formatting changes.
8479 Use goto instead of fall through.
8480 * doc/bison.texinfo (Destructor Decl): Complete.
8481
8482 2005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8483
8484 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
8485 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
8486 * djgpp/config.bat: Replace every occurence of the file name
8487 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
8488 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
8489 * djgpp/config.sed: Replace every occurence of the file name
8490 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
8491 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
8492 * djgpp/djunpack.bat: DJGPP specific file.
8493 * djgpp/fnchange.lst: DJGPP specific file.
8494 * djgpp/README.in: Add new information about how to unpack the bison
8495 source on MSDOS and other systems which have 8.3 file name restrictions
8496 using djunpack.bat and fnchange.lst.
8497
8498 2005-12-12 Paul Eggert <eggert@cs.ucla.edu>
8499
8500 * bootstrap (build_cvs_prefix): Remove; unused.
8501 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
8502 when getting gnulib.
8503
8504 2005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
8505
8506 * data/glr.c: Reorder typedef declarations for structs to match order
8507 of struct declarations.
8508 Rename yystack everywhere to yystackp except in yyparse where it's not
8509 a pointer.
8510 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
8511 consistency.
8512 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
8513 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
8514 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
8515 lint.
8516
8517 2005-12-09 Paul Eggert <eggert@cs.ucla.edu>
8518
8519 * tests/sets.at (Accept): Fix typos in regular expression used to
8520 sed out the final state number.
8521
8522 Work around portability problem on Solaris 10: flex-generated
8523 files include <stdio.h> before <config.h>, which messes up
8524 because the latter defines __EXTENSIONS__. Address the problem
8525 by creating two new little files that include <config.h> first,
8526 then include the flex-generated files. Rewrite everyone else
8527 to include <config.h> first, as well.
8528 * lib/timevar.c: Always include "config.h".
8529 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
8530 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
8531 (EXTRA_bison_SOURCES): New macro.
8532 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
8533 * src/system.h: Don't include config.h.
8534 * src/LR0.c: Include <config.h> first.
8535 * src/assoc.c: Likewise.
8536 * src/closure.c: Likewise.
8537 * src/complain.c: Likewise.
8538 * src/conflicts.c: Likewise.
8539 * src/derives.c: Likewise.
8540 * src/files.c: Likewise.
8541 * src/getargs.c: Likewise.
8542 * src/gram.c: Likewise.
8543 * src/lalr.c: Likewise.
8544 * src/location.c: Likewise.
8545 * src/main.c: Likewise.
8546 * src/muscle_tab.c: Likewise.
8547 * src/nullable.c: Likewise.
8548 * src/output.c: Likewise.
8549 * src/parse-gram.y: Likewise.
8550 * src/print.c: Likewise.
8551 * src/print_graph.c: Likewise.
8552 * src/reader.c: Likewise.
8553 * src/reduce.c: Likewise.
8554 * src/relation.c: Likewise.
8555 * src/state.c: Likewise.
8556 * src/symlist.c: Likewise.
8557 * src/symtab.c: Likewise.
8558 * src/tables.c: Likewise.
8559 * src/uniqstr.c: Likewise.
8560 * src/vcg.c: Likewise.
8561
8562 * src/parse-gram.y: Fix minor problems uncovered by lint.
8563 (current_lhs, current_lhs_location): Now static.
8564 (current_assoc): Remove unused variable.
8565
8566 Cleanups so that Bison-generated parsers have less lint.
8567 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
8568 Prepend /*ARGSUSED*/, for lint's sake.
8569 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
8570 definition if 'lint' is defined.
8571 (YYID): New macro (or function, if lint).
8572 All uses of /*CONSTCOND*/0 replaced by YYID(0).
8573 * data/yacc.c: Likewise.
8574 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
8575 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
8576 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
8577 is C++ only.
8578 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
8579 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
8580 Use YYID(0) rather than 0, for lint.
8581 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
8582 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
8583
8584 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
8585
8586 * tests/glr-regression.at
8587 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
8588 Close memory leak reported by twlevo.
8589
8590 2005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
8591
8592 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
8593 all stacks.
8594 (yyparse): Iterate another stack in order to call user destructors.
8595 * tests/glr-regression.at (No users destructors if stack 0 deleted):
8596 New test case.
8597 (Duplicated user destructor for lookahead): This test now is expected
8598 to succeed.
8599
8600 2005-12-01 Paul Eggert <eggert@cs.ucla.edu>
8601
8602 * NEWS: Document the following change.
8603 * data/yacc.c: Say "parser skeleton" rather than "file", since
8604 it's no longer just a file.
8605 * data/glr.c: Grant a special exception for C GLR parsers, that
8606 reads like the already-existing exception for C LALR(1) parsers.
8607 * data/glr.cc: Likewise.
8608 * data/lalr1.cc: Likewise.
8609 * data/location.cc: Likewise.
8610 * data/yacc.c: Reword the "written by" statement to clarify that
8611 it was the parser skeleton, not the entire output file.
8612 * data/glr.c: Written by Paul Hilfinger.
8613 * data/glr.cc: Written by Akim Demaille.
8614 * data/lalr1.cc: Likewise.
8615
8616 2005-11-18 Paul Eggert <eggert@cs.ucla.edu>
8617
8618 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
8619 Fix typos in previous change that broke 'make check'.
8620 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
8621 supported in C.
8622 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
8623 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
8624 We can revert this once things settle down.
8625
8626 * src/conflicts.c (conflicts_print): Don't print file name twice
8627 when %expect fails because there were no conflicts.
8628 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
8629 change.
8630 * tests/conflicts.at (%expect not enough, %expect too much):
8631 (%expect with reduce conflicts): Adjust to new behavior.
8632
8633 2005-11-18 Akim Demaille <akim@epita.fr>
8634
8635 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
8636 errors.
8637 * NEWS: Document this.
8638 * doc/bison.texinfo (Expect Decl): Likewise.
8639
8640 2005-11-16 Akim Demaille <akim@epita.fr>
8641
8642 Generalize the display of semantic values and locations in traces.
8643 * data/glr.c (yy_reduce_print): Fix indices (again).
8644 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
8645 literal integers.
8646 * data/lalr1.cc (yyreduce_print): Rename as...
8647 (yy_reduce_print): this.
8648 Display values and locations.
8649 * data/yacc.c (yy_reduce_print): Likewise.
8650 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
8651 (yysymprint): Move higher to be visible from yy_reduce_print).
8652 (yyparse): Adjust.
8653 * tests/calc.at: Adjust the expected length of the traces.
8654
8655 2005-11-14 Akim Demaille <akim@epita.fr>
8656
8657 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
8658 from 1 to N, while values and location start at 0.
8659 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
8660
8661 2005-11-14 Akim Demaille <akim@epita.fr>
8662
8663 * data/glr.c (yy_reduce_print): Fix the $ number.
8664
8665 2005-11-14 Akim Demaille <akim@epita.fr>
8666
8667 "Use" parse parameters.
8668 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
8669 * data/glr.c, data/glr.cc: Use them.
8670 * data/glr.c (YYUSE): Have a C++ definition that supports
8671 non-pointer types.
8672
8673 2005-11-14 Akim Demaille <akim@epita.fr>
8674
8675 * data/glr.c (yyexpandGLRStack): Declare only if defined.
8676
8677 2005-11-14 Akim Demaille <akim@epita.fr>
8678
8679 * data/glr.cc: New.
8680 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
8681
8682 2005-11-12 Akim Demaille <akim@epita.fr>
8683
8684 Let position and location be PODs.
8685 * data/location.cc (position::initialize, location::initialize): New.
8686 (position::position, location::location): Define only if
8687 b4_location_constructors is defined.
8688 * data/lalr1.cc (b4_location_constructors): Define it for backward
8689 compatibility.
8690 * doc/bison.texinfo (Initial Action Decl): Use initialize.
8691
8692 2005-11-12 Akim Demaille <akim@epita.fr>
8693
8694 * data/lalr1.cc: Move the body of the ctor and dtor into the
8695 parser file (instead of the header).
8696 Wrap the implementations in a "namespace yy".
8697
8698 2005-11-12 Akim Demaille <akim@epita.fr>
8699
8700 Have glr.c include its header file when created.
8701 * data/glr.c (b4_shared_declarations): New.
8702 Output them verbatim in the parser if !%defines, otherwise
8703 output then in the header file, and include it instead.
8704
8705 2005-11-11 Akim Demaille <akim@epita.fr>
8706
8707 * data/glr.c: Comment changes.
8708
8709 2005-11-11 Akim Demaille <akim@epita.fr>
8710
8711 When yydebug, report semantic and location values for reductions.
8712 * data/glr.c (yy_reduce_print): Report the semantic values and the
8713 locations.
8714 (YY_REDUCE_PRINT): Adjust.
8715 (yyglrReduce): Use them.
8716 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
8717 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
8718 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
8719 traces.
8720
8721 2005-11-10 Akim Demaille <akim@epita.fr>
8722
8723 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
8724 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
8725 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
8726
8727 2005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
8728
8729 * m4/cxx.m4, examples/Makefile.am: Don't build
8730 examples/calc++ if no C++ compiler is available. (trivial change)
8731
8732 2005-11-09 Akim Demaille <akim@epita.fr>
8733
8734 * src/scan-skel.l: Use a couple of asserts.
8735
8736 2005-11-03 Akim Demaille <akim@epita.fr>
8737
8738 In some (weird) cases, the final state number is incorrect.
8739 Reported by Alexandre Duret-Lutz.
8740 * src/LR0.c (state_list_append): Remove the computation of
8741 final_state.
8742 (save_reductions): Do it here.
8743 (get_state): Alpha conversion.
8744 (generate_states): Use a for loop.
8745 * src/gram.h (item_number_is_rule_number)
8746 (item_number_is_symbol_number): New.
8747 * src/state.c: Use assert.
8748 * src/system.h: Include assert.h.
8749 * tests/sets.at (Accept): New.
8750
8751 2005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8752
8753 * data/glr.c (yyfill): Adjust comment.
8754 (yyresolveAction): Initialize default location properly
8755 for empty right-hand sides.
8756 (yydoAction): Ditto.
8757 Add comment explaining apparently dead code.
8758 * tests/glr-regression.at
8759 (Incorrectly initialized location for empty right-hand side in GLR):
8760 New test.
8761
8762 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
8763
8764 * bootstrap (cleanup_gnulib): New function. Use it to clean up
8765 gnulib when interrupted. This fixes some race conditions and
8766 works around some portability problems (one noted by Paul
8767 Hilfinger).
8768
8769 2005-10-22 Akim <akim@epita.fr>
8770
8771 * Makefile.cfg: Adjust to config -> build-aux.
8772 Reported by twledo.
8773
8774 2005-10-21 Akim Demaille <akim@epita.fr>
8775
8776 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
8777 the %parse-params.
8778 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
8779 * data/yacc.c (b4_Pure_if): Rename as...
8780 (b4_yacc_pure_if): this.
8781 (YY_SYMBOL_PRINT, yyparse): Adjust.
8782 * doc/bison.texinfo: Formatting changes.
8783
8784 2005-10-21 Akim Demaille <akim@epita.fr>
8785
8786 Finish the transition config -> build-aux.
8787 * configure.ac, Makefile.am: Use build-aux.
8788 * config/prev-version, config/announce-gen, config/Makefile.am:
8789 Move to...
8790 * build-aux/prev-version, build-aux/announce-gen,
8791 * build-aux/Makefile.am: here.
8792
8793 2005-10-14 Akim Demaille <akim@epita.fr>
8794
8795 * examples/calc++/test: Use set -x only when VERBOSE.
8796
8797 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
8798
8799 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
8800 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
8801
8802 2005-10-13 Akim Demaille <akim@epita.fr>
8803
8804 * src/scan-skel.l: Output the base name parts of the parser and
8805 header file names.
8806 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
8807 additional checks.
8808 Use this to exercise C++ outputs in subdirs.
8809 Reported by Oleg Smolsky.
8810
8811 2005-10-12 Paul Eggert <eggert@cs.ucla.edu>
8812
8813 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
8814 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
8815 Problem reported by John P. Hartmann.
8816 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
8817 already defined it.
8818
8819 2005-10-12 Akim Demaille <akim@epita.fr>
8820
8821 * src/parse-gram.y (version_check): Exit 63 to please missing
8822 (stands for "version mismatch).
8823 * tests/input.at, doc/bison.texinfo: Adjust.
8824
8825 2005-10-10 Paul Eggert <eggert@cs.ucla.edu>
8826
8827 Work around portability problems with Visual Age C compiler
8828 (xlc and xlC_r) reported by John P. Hartmann.
8829 * data/location.cc (initial_column, initial_line): Remove.
8830 All uses replaced by 0 and 1.
8831 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
8832 that xlc complains about.
8833 * src/scan-skel.l (skel_wrap): Likewise.
8834 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
8835 as __STDC__.
8836 * data/yacc.c (YYMODERN_C): New macro, which also looks at
8837 __STDC_VERSION__. Use it everywhere instead of looking at
8838 __STDC__ and __cplusplus.
8839
8840 2005-10-10 Akim Demaille <akim@epita.fr>
8841
8842 * examples/calc++/test: Be quiet unless VERBOSE.
8843
8844 2005-10-05 Paul Eggert <eggert@cs.ucla.edu>
8845
8846 * data/c.m4 (yydestruct, yysymprint):
8847 Use YYUSE instead of casting to void.
8848 * data/glr.c (YYUSE): New macro.
8849 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
8850 Use it instead of rolling our own.
8851 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
8852 (YYCHK1):
8853 Use /*CONSTCOND*/ to suppress lint warnings.
8854 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
8855 (YY_STACK_PRINT): Use 'false' not '0'.
8856 (YYUSE): New macro.
8857 (yysymprint_, yydestruct_): Use it instead of rolling our own.
8858 * data/yacc.c (YYUSE): New macro.
8859 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
8860 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
8861 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
8862
8863
8864 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
8865 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
8866
8867 2005-10-04 Paul Eggert <eggert@cs.ucla.edu>
8868
8869 Undo the parts of the unlocked-I/O change that substituted
8870 putc or puts for printf. This might hurt performance a bit,
8871 but some people prefer the printf style.
8872 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
8873 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
8874 All uses replaced by YYFPRINTF and YYDPRINTF.
8875 * data/yacc.c: Likewise.
8876 * lib/bitset.c (bitset_print): Likewise.
8877 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
8878 putc and puts.
8879 * lib/lbitset.c (debug_lbitset): Likewise.
8880 * src/closure.c (print_firsts, print_fderives): Likewise.
8881 * src/gram.c (grammar_dump): Likewise.
8882 * src/lalr.c (look_ahead_tokens_print): Likewise.
8883 * src/output.c (escaped_output): Likewise.
8884 (user_actions_output): Break apart two printfs.
8885 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
8886 * src/reduce.c (reduce_print): Likewise.
8887 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
8888 * src/system.h: Include unlocked-io.h rathe than stdio.h.
8889
8890 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
8891 Use assignments rather than casts-to-void to suppress
8892 unused-variable warnings. This pacifies 'lint'.
8893 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
8894 unused-variable warnings.
8895
8896 2005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8897
8898 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
8899
8900 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
8901
8902 Use unlocked I/O for a minor performance improvement on hosts like
8903 GNU/Linux and Solaris that support unlocked I/O. The basic idea
8904 is to use the gnlib unlocked-io module, and to prefer putc and
8905 puts to printf when either will work (since the latter doesn't
8906 come in an unlocked flavor).
8907 * bootstrap (gnulib_modules): Add unlocked-io.
8908 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
8909 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
8910 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
8911 and similarly for puts and putc and printf.
8912 * data/yacc.c: Likewise.
8913 * lib/bitset.c (bitset_print): Likewise.
8914 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
8915 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
8916 to printf.
8917 * lib/lbitset.c (debug_lbitset): Likewise.
8918 * src/closure.c (print_firsts, print_fderives): Likewise.
8919 * src/gram.c (grammar_dump): Likewise.
8920 * src/lalr.c (look_ahead_tokens_print): Likewise.
8921 * src/output.c (escaped_output): Likewise.
8922 (user_actions_output): Coalesce two printfs.
8923 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
8924 * src/reduce.c (reduce_print): Likewise.
8925 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
8926 * src/system.h: Include unlocked-io.h rather than stdio.h.
8927
8928 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
8929 this confuses xgettext.
8930
8931 2005-10-02 Akim Demaille <akim@epita.fr>
8932
8933 * bootstrap (gnulib_modules): Add strverscmp.
8934 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
8935 * m4/.cvsignore: Add strverscmp.m4.
8936 * src/parse-gram.y (%require): New token, new rule.
8937 (version_check): New.
8938 * src/scan-gram.l (%require): Adjust.
8939 * tests/input.at (AT_REQUIRE): New.
8940 Use it.
8941 * doc/bison.texinfo (Require Decl): New.
8942 (Calc++ Parser): Use %require.
8943
8944 2005-10-02 Akim Demaille <akim@epita.fr>
8945
8946 * data/location.cc: New.
8947
8948 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
8949 Akim Demaille <akim@epita.fr>
8950
8951 Make sure -odir/foo.cc creates dir/location.hh etc.
8952 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
8953 (spec_file_prefix, spec_verbose_file, spec_graph_file)
8954 (spec_defines_file): Now const.
8955 (dir_prefix): New.
8956 (short_base_name): Remove.
8957 * src/files.c: Adjust.
8958 (dirname.h): Include.
8959 (base_name): Don't prototype it.
8960 (finput): Remove, duplicates gram_in.
8961 (full_base_name, short_base_name): Replace by...
8962 (all_but_ext, all_but_tab_ext): these.
8963 (compute_base_names): Rename as...
8964 (compute_file_name_parts): this.
8965 Update to compute the new variables, including dir_prefix.
8966 Adjust dependencies.
8967 * src/output.c (prepare): Output them.
8968 * src/reader.c: Adjust to use gram_in, not finput.
8969 * src/scan-skel.l (@dir_prefix@): New.
8970
8971 2005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8972
8973 * lib/subpipe.c: New function end_of_output_subpipe() added
8974 to allow support for non-posix systems. This is a no-op function
8975 for posix systems.
8976
8977 * lib/subpipe.h: New function end_of_output_subpipe() added
8978 to allow support for non-posix systems. This is a no-op function
8979 for posix systems.
8980
8981 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
8982 handle the lack of pipe/fork functionality on non-posix systems.
8983
8984 * djgpp/Makefile.maint: DJGPP specific file.
8985
8986 * djgpp/README.in: DJGPP specific file.
8987
8988 * djgpp/config.bat: DJGPP specific configuration file.
8989
8990 * djgpp/config.sed: DJGPP specific configuration file.
8991
8992 * djgpp/config.site: DJGPP specific configuration file.
8993
8994 * djgpp/config_h.sed: DJGPP specific configuration file.
8995
8996 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
8997
8998 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
8999
9000 2005-10-02 Akim Demaille <akim@epita.fr>
9001
9002 * data/location.cc: New, extract from...
9003 * data/lalr1.cc: here.
9004 (location.hh): Include it after the user prologue, in case the
9005 filename type is defined by the user.
9006 Forward declation location and position before the pre-prologue.
9007 (yyresult_): Rename as...
9008 (yyresult): this, it's a local variable, not an attribute.
9009 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
9010
9011 2005-10-01 Akim Demaille <akim@epita.fr>
9012
9013 * examples/extexi: Restore the #line generation.
9014
9015 2005-09-30 Akim Demaille <akim@epita.fr>,
9016 Alexandre Duret-Lutz <adl@gnu.org>
9017
9018 Move the token type and YYSTYPE in the parser class.
9019 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
9020 (parser::token): New, from the moved free definition of tokens.
9021 (parser::semantic_value): Now a full definition instead of an
9022 indirection to YYSTYPE.
9023 (b4_post_prologue): No longer included in the header file, but
9024 in the implementation file.
9025 * doc/bison.texi (C+ Language Interface): Update.
9026 * src/parse-gram.y: Support unary %define.
9027 * tests/actions.at: Define global_tokens_and_yystype for backward
9028 compatibility until we update the tests.
9029 * tests/calc.at: Idem.
9030 (first_line, first_column, last_line, last_column): Define for lalr1.cc
9031 to simplify the code.
9032
9033 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
9034
9035 Port to SunOS 4.1.4, which lacks strtoul and strerror.
9036 Ah, the good old days! Problem reported by Peter Klein.
9037 * bootstrap (gnulib_modules): Add strerror, strtoul.
9038 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
9039 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
9040
9041 2005-09-29 Akim Demaille <akim@epita.fr>
9042
9043 * data/c.m4 (b4_error_verbose_if): New.
9044 * data/lalr1.cc: Use it.
9045 (YYERROR_VERBOSE_IF): Remove.
9046 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
9047 parser members, replaced by...
9048 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
9049 local variables.
9050 (yysyntax_error_): Takes the state number as argument.
9051 (yyreduce_print_): Use the argument yyrule, not the former
9052 attribute yyn_.
9053
9054 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
9055
9056 * bootstrap (gnulib_modules): Add verify.
9057 * lib/.cvsignore: Add verify.h.
9058 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
9059 * src/system.h (verify): Remove.
9060 Include verify.h instead.
9061 * src/tables.c (tables_generate): Use new API for 'verify'.
9062
9063 2005-09-21 Paul Eggert <eggert@cs.ucla.edu>
9064
9065 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
9066 local variables whose names begin with 'yy'.
9067 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
9068 Trivial changes from Joel E. Denny.
9069
9070 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
9071 it itself.
9072 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
9073 don't use alloca any more.
9074
9075 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
9076 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
9077 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
9078 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
9079 to match yacc.c, to test more hosts.
9080
9081 2005-09-20 Paul Eggert <eggert@cs.ucla.edu>
9082
9083 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
9084 doesn't affect behavior.
9085 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
9086 Solaris, AIX, MSC.
9087 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
9088 This works a bit better with glibc, if user code has already included
9089 stdlib.h.
9090 * doc/bison.texinfo (Bison Parser): Document that users can't
9091 arbitrarily use malloc and free for other purposes. Document
9092 that <alloca.h> and <malloc.h> might be included.
9093 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
9094 user must declare alloca.
9095
9096 * HACKING (release): Forwarn the Translation Project about
9097 stable releses.
9098
9099 2005-09-20 Akim Demaille <akim@epita.fr>
9100
9101 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
9102
9103 2005-09-19 Paul Eggert <eggert@cs.ucla.edu>
9104
9105 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
9106 (YYSTACK_ALLOC_MAXIMUM): Use it.
9107 (yysyntax_error): New function.
9108 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
9109 multiple syntax errors are reported, and alloca is being used.
9110 Instead, reallocate buffers twice as big each time, so that
9111 we waste at most half the allocated memory. Start with a small
9112 (128-byte) buffer that will suffice in most cases anyway.
9113 Use yysyntax_error to do most of the work.
9114
9115 * doc/bison.texinfo (Error Reporting, Table of Symbols):
9116 yynerrs is the number of errors reported, not the number of
9117 errors encountered.
9118
9119 * tests/glr-regression.at (Duplicated user destructor for lookahead):
9120 Mark it as expected to fail.
9121 Cast result of malloc; problem reported by twlevo@xs4all.nl.
9122 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
9123 Don't start user-code symbols with "yy", to avoid name space problems.
9124
9125 2005-09-19 Akim Demaille <akim@epita.fr>
9126
9127 Remove the traits, failed experiment.
9128 It never proved useful, and anyway because of the current
9129 definition, it was not possible to have several specialization of
9130 this traits, making it useless.
9131 * data/lalr1.cc (yy:traits): Remove.
9132 Inline its definitions in the parser class.
9133
9134 2005-09-19 Akim Demaille <akim@epita.fr>
9135
9136 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
9137 least Mac OSX with a /usr/local install of gettext.
9138
9139 2005-09-19 Akim Demaille <akim@epita.fr>
9140
9141 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
9142 and yytoken for similarity with the other skeletons.
9143
9144 2005-09-19 Akim Demaille <akim@epita.fr>
9145
9146 * NEWS, configure.ac: update version number to 2.1a.
9147
9148 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
9149
9150 * NEWS: Version 2.1.
9151
9152 * NEWS: Remove notice of yytname change, since it was never in an
9153 official release.
9154 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
9155 diagnostic.
9156 * src/output.c (prepare): Likewise.
9157 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
9158 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
9159 is not defined. This is an awful hack, but it's enough for now.
9160 All callers changed.
9161 * tests/glr-regression-at (make_value): Args are const pointers now,
9162 to avoid GCC warning.
9163 (Duplicated user destructor for lookahead): New test. Currently
9164 skipped. It fails on my host but I'm not sure it'll always fail.
9165
9166 2005-09-16 Akim Demaille <akim@epita.fr>
9167
9168 * src/symtab.h (struct symbol): Declare the printer and destructor
9169 as const, to avoid accidental calls to free.
9170 (symbol_destructor_set, symbol_printer_set): Adjust.
9171 * src/symtab.c: Adjust.
9172
9173 2005-09-16 Akim Demaille <akim@epita.fr>
9174
9175 * data/c.m4 (b4_token_enums): New.
9176 (b4_token_defines): Rename as...
9177 (b4_token_enums_defines): this.
9178 (b4_token_defines): New, output only the #defines.
9179 * data/yacc.c, data/glr.c: Adjust.
9180 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
9181 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
9182 as default values.
9183
9184 2005-09-16 Akim Demaille <akim@epita.fr>
9185
9186 * data/lalr1.cc (yylex_): Remove, inline its code.
9187 (yyreport_syntax_error_): Remove, replaced by...
9188 (yysyntax_error_): this which returns a string and leaves to the
9189 caller the call to the users' error function.
9190 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
9191 Move from members of the parser object...
9192 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
9193 to local variables of the parse function.
9194
9195 2005-09-16 Akim Demaille <akim@epita.fr>
9196
9197 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
9198 since it's in Bison's name space.
9199
9200 2005-09-15 Paul Eggert <eggert@cs.ucla.edu>
9201
9202 * data/glr.c (yyresolveValue): Add default case to pacify
9203 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
9204
9205 * NEWS: Document when yyparse started to return 2.
9206 * doc/bison.texinfo (Parser Function): Document when yyparse
9207 returns 2.
9208
9209 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
9210 (b4_filename_type): Renamed back from b4_file_name_type. All uses
9211 changed.
9212 (class position): file_name -> filename (reverting). All uses changed.
9213
9214 2005-09-14 Paul Eggert <eggert@cs.ucla.edu>
9215
9216 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
9217 do anything if $@ exists. This reverts part of the 2005-07-07
9218 patch.
9219
9220 2005-09-11 Paul Eggert <eggert@cs.ucla.edu>
9221
9222 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
9223 contains obsolete information and isn't worth distributing as a
9224 separate file anyway.
9225 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
9226 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
9227 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
9228 (yyparse): Abort if user code uses longjmp to throw an unexpected
9229 value.
9230
9231 2005-09-09 Paul Eggert <eggert@cs.ucla.edu>
9232
9233 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
9234 Suggested by twlevo@xs4all.nl.
9235
9236 * data/glr.c (YYCHK1): Do not assume YYE is in range.
9237 This avoids a diagnostic from gcc -Wswitch-enum.
9238 Problem reported by twlevo@xs4all.nl.
9239
9240 * doc/bison.texinfo: Don't use "filename", as per GNU coding
9241 standards. Use "file name" or "file" or "name", depending on
9242 the context.
9243 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
9244 not to hack/foo.tab.c.
9245 (Calc++ Top Level): 2nd arg of main is not const.
9246 * data/glr.c: b4_filename -> b4_file_name.
9247 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
9248 All uses changed.
9249 (class position): filename -> file_name. All uses changed.
9250 * data/yacc.c: b4_filename -> b4_file_name.
9251 * lib/bitset.h: filename -> file_name in local vars.
9252 * lib/bitset_stats.c: Likewise.
9253 * src/files.c: Likewise.
9254 * src/scan-skel.l ("@output ".*\n): Likewise.
9255 * src/files.c (file_name_split): Renamed from filename_split.
9256 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
9257
9258 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
9259
9260 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
9261 to accommodate latest gnulib.
9262
9263 * tests/glr-regression.at (Duplicate representation of merged trees):
9264 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
9265
9266 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
9267 needed.
9268
9269 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
9270
9271 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
9272 All uses changed. Invoke user destructor after an error during a
9273 split parse (trivial change from Joel E. Denny).
9274
9275 * tests/glr-regression.at
9276 (User destructor after an error during a split parse): New test case.
9277 Problem reported by Joel E. Denny in:
9278 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
9279
9280 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
9281
9282 * README-cvs: Give URLs for recommended tools.
9283 Mention Gzip version problem, and bootstrapping issues.
9284 Remove troubleshooting section, as it's somewhat obsolete.
9285
9286 * bootstrap (no_cache): New var, to accommodate different wget
9287 variants. Use it instead of '-C off'. Problem reported by
9288 twlevo@xs4all.nl.
9289
9290 * data/glr.c (yydestroyStackItem): New function.
9291 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
9292 debugging information. Problem reported by Joel E. Denny.
9293
9294 2005-08-25 Akim Demaille <akim@epita.fr>
9295
9296 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
9297
9298 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
9299
9300 * data/glr.c (yyrecoverSyntaxError, yyreturn):
9301 Don't invoke destructor on unresolved entries.
9302 * tests/glr-regression.at
9303 (User destructor for unresolved GLR semantic value): New test case.
9304 Problem reported by Joel E. Denny in:
9305 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
9306
9307 2005-08-21 Paul Eggert <eggert@cs.ucla.edu>
9308
9309 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
9310 Add strnlen.c.
9311 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
9312 lib-prefix.m4, po.m4.
9313
9314 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
9315 in yydestruct diagnostic, since it might not be an error.
9316 Problem reported by Joel Denny near end of
9317 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
9318 * data/lalr1.cc (yyerturn): Likewise.
9319 * data/yacc.c (yyreturn): Likewise.
9320 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
9321
9322 * src/files.c: Remove obsolete FIXME comment.
9323
9324 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
9325 with the other templates, and to fix bogus run-on messages such
9326 as the one reported at the end of
9327 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
9328 All callers changed to avoid the newline.
9329 (yyprocessOneStack): Output two lines rather than one, to accommodate
9330 the above change. This changes the debug output format slightly.
9331
9332 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
9333 reported by Joel E. Denny in
9334 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
9335 (trivial change).
9336 * tests/glr-regression.at (Duplicate representation of merged trees):
9337 New test, from Joel E. Denny in:
9338 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
9339 * THANKS: Add Joel E. Denny.
9340
9341 * configure.ac (AC_INIT): Bump to 2.0c.
9342
9343 2005-07-24 Paul Eggert <eggert@cs.ucla.edu>
9344
9345 * NEWS: Version 2.0b.
9346
9347 * Makefile.am (SUBDIRS): Put examples before tests, so that
9348 "make check" doesn't finish with "All 1 tests passed".
9349
9350 * tests/regression.at (Token definitions): Don't rely on
9351 AT_PARSER_CHECK for data that contains backslashes. It currently
9352 uses 'echo', and 'echo' isn't portable if its argument contains
9353 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
9354 that the byte '\0xff' is not printable in the C locale; it is,
9355 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
9356 not printable, so use '\0x81' to test.
9357
9358 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
9359 version of GCC, since the macro is used with non-GCC compilers.
9360
9361 Fix core dump reported by Pablo De Napoli in
9362 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
9363 * tests/regression.at (Invalid inputs with {}): New test.
9364 * src/parse-gram.y (token_name): Translate type before using
9365 it as an index.
9366
9367 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
9368 the user's name space. All uses changed to __attribute__
9369 ((__unused__)).
9370 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
9371 Add __attribute__ ((__noreturn__)).
9372
9373 * etc/clcommit: Remove. We weren't using it, and it failed
9374 "make maintainer-distcheck".
9375 * Makefile.maint: Merge from coreutils.
9376 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
9377 (syntax-check-rules): Change list of rules as described below.
9378 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
9379 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
9380 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
9381 (sc_trailing_space): New rules.
9382 (sc_xalloc_h_in_src): Remove.
9383 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
9384 (sc_space_tab, sc_error_exit_success, sc_changelog):
9385 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
9386 (makefile-check, po-check, author_mark_check):
9387 (makefile_path_separator_check, copyright-check):
9388 Use grep -n, to make it easier to find violations.
9389 Use CVS_LIST and CVS_LIST_EXCEPT.
9390 (header_regexp, h_re): Remove.
9391 (dd_c): New macro.
9392 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
9393 (my-distcheck): Use more-modern GCC flags.
9394 (signatures, %.asc): Remove.
9395 (rel-files, announcement): Remove signatures.
9396 Restore old updating code, even though we don't use it, so
9397 that we're the same as coreutils.
9398 (alpha, beta, major): Depend on news-date-check.
9399 Make the upload commands.
9400
9401 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
9402 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
9403 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
9404 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
9405 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
9406 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
9407 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
9408 * tests/sets.at: Likewise.
9409
9410 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
9411 we comment out the Autoconf version number.
9412 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
9413 it's error-prone and "make maintainer-distcheck" rejects it.
9414
9415 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
9416 Indent calls to "error" to pacify "make maintainer-distcheck",
9417 when the calls are not intended to be translated.
9418 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
9419
9420 * src/Makefile.am (DEFS): Use +=, to pacify
9421 "make maintainer-distcheck".
9422 (bison_SOURCES): Add scan-skel.h.
9423 (sc_tight_scope): New rule, from coreutils.
9424
9425 * src/files.c (src_extension, header_extension):
9426 Now static, not extern.
9427 * src/getargs.c (short_options): Likewise.
9428 * src/muscle_tab.c (muscle_table): Likewise.
9429 * src/parse-gram.y (current_class, current_type, current_prec):
9430 Likewise.
9431 * src/reader.c (grammar_end, previous_rule_end): Likewise.
9432 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
9433 * src/main.c (main): Cast bindtextdomain and textdomain calls to
9434 void, to avoid warning when NLS is disabled.
9435 * src/output.c: Include scan-skel.h.
9436 (scan_skel): Remove decl, since scan-skel.h does this.
9437 (output_skeleton):
9438 Indent calls to "error" to pacify "make maintainer-distcheck".
9439 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
9440 * src/reader.h (gram_end, gram_lineno): New decls to pacify
9441 "make maintainer-distcheck".
9442 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
9443 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
9444 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
9445 (skel_lex_destroy, scan_skel): Move these decls to...
9446 * src/scan-skel.h: New file.
9447 * src/uniqstr.c (uniqstr_assert):
9448 Indent calls to "error" to pacify "make maintainer-distcheck".
9449
9450 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
9451 not @VAR@.
9452
9453 * tests/torture.at: Revamp to avoid misuse of atoi that
9454 "make maintainer-distcheck" complained about.
9455
9456 * examples/extexi (message): Don't print a message more than once,
9457 and omit line-number decoration that makes Emacs compile think
9458 that informative messages are worth worrying about.
9459
9460 2005-07-22 Paul Eggert <eggert@cs.ucla.edu>
9461
9462 * configure.ac: Update version number.
9463
9464 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
9465 accidentally.
9466 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
9467 autogenerated by the maintainer.
9468 * examples/calc++/.cvsignore: Add *.yy.
9469
9470 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
9471 * lib/bitset_stats.c (bitset_stats_init): Likewise.
9472 * lib/bitsetv.c (bitsetv_alloc): Likewise.
9473
9474 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
9475
9476 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
9477 from maintainer-distcheck about casting the argument of 'free'.
9478
9479 * NEWS: Mention recent yytname changes.
9480 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
9481
9482 * bootstrap: For translations that have not yet been upgraded to
9483 the new runtime-po domain, prime the pump by extracting the
9484 relevant strings from the obsolete translations. This code can be
9485 removed once the bison-runtime domain has been translated by each
9486 team.
9487
9488 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
9489 now that token names are already quoted.
9490
9491 Fix problem reported by Anthony Heading.
9492 * data/glr.c (YYTOKEN_TABLE): New macro.
9493 (yytname): Define if YYTOKEN_TABLE.
9494 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
9495 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
9496 (YYERROR_VERBOSE): Define the same way the other skeletons do.
9497 * src/output.c (prepare_symbols): Output token_table_flag.
9498
9499 2005-07-21 Paul Eggert <eggert@cs.ucla.edu>
9500
9501 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
9502 again if the first call fails.
9503
9504 * data/glr.c (yytnamerr): New function.
9505 (yyreportSyntaxError): Use it to dequote most string literals.
9506 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
9507 with other skeletons. All uses changed.
9508 (yytnameerr_): New function.
9509 (yyreport_syntax_error): Use it to dequote most string literals.
9510 * data/yacc.c (yytnamerr): New function.
9511 (yyerrlab): Use it to decode most string literals.
9512 * doc/bison.texinfo (Decl Summary, Calling Convention):
9513 Clarify quoting convention of yytname.
9514 * src/output.c (prepare_symbols): Quote all names. This undoes
9515 the 2005-04-17 change, which is now accomplished (mostly) via
9516 changes in the parsers as described above.
9517 * tests/regression.at (Token definitions, Web2c Actions):
9518 Undo most 2005-04-17 change here, too.
9519
9520 2005-07-20 Paul Eggert <eggert@cs.ucla.edu>
9521
9522 Fix more problems reported by twlevo@xs4all.nl.
9523 * tests/cxx-type.at: Don't pipe output of ./types through sed to
9524 remove trailing spaces. This loses the exit status of ./types,
9525 and isn't needed since ./types shouldn't be emitting trailing
9526 spaces.
9527 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
9528 as the stack isn't valid in that case.
9529
9530 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
9531 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
9532 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
9533 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
9534 is used.
9535 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
9536 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
9537 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
9538 Likewise.
9539
9540 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
9541 overly-picky compilers that reject 'char *foo = "bar";'.
9542
9543 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
9544 to FILE * parameter, not to stderr. This fixes a typo introduced
9545 in the 2005-07-12 change.
9546
9547 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
9548 warnings from GCC 4.
9549
9550 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
9551 (yyglrShiftDefer, yysplitStack):
9552 Remove unused parameters b4_pure_formals. All uses changed.
9553 (yyglrShift): Remove unused parameters b4_user_formals.
9554 All uses changed.
9555 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
9556
9557 2005-07-18 Paul Eggert <eggert@cs.ucla.edu>
9558
9559 Destructor cleanups and regularization among the three skeletons.
9560 * NEWS: Document the behavior changes.
9561 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
9562 stack before failing, as the cleanup code will do it for us now.
9563 * data/lalr1.cc (yyerrlab): Likewise.
9564 * data/glr.c (yyparse): Pop everything off the stack before
9565 freeing it, so that destructors get called properly.
9566 * data/lalr1.cc (yyreturn): Likewise.
9567 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
9568 This is more consistent.
9569 * doc/bison.texinfo (Destructor Decl): Mention more reasons
9570 why destructors might be called. 1.875 -> 2.1.
9571 (Destructor Decl, Decl Summary, Table of Symbols):
9572 Some English-language cleanups for %destructor.
9573 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
9574 Add output line for destructor of start symbol.
9575 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
9576 because of that same extra output line.
9577
9578 * NEWS: Document minor wording changes in diagnostics of
9579 Bison-generated parsers.
9580 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
9581 Remove unused formals. All uses changed.
9582 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
9583 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
9584 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
9585 Rename yyoverflowab to yyexhaustedlab.
9586 When memory exhaustion occurs during syntax-error reporting,
9587 report it separately rather than in a single diagnostic; this
9588 eases translation.
9589 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
9590 (Memory Exhausted): Renamed from Parser Stack Overflow.
9591 Revamp wording slightly to prefer "memory exhaustion".
9592 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
9593
9594 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
9595
9596 Add i18n support to the GLR skeleton. Partially fix the C++
9597 skeleton; a C++ expert needs to finish this. Remove debugging
9598 msgids; there's little point to having them translated, since they
9599 can be understood only by someone who can read the
9600 (English-language) source code.
9601
9602 Generate runtime-po/bison-runtime.pot automatically, so that we
9603 don't have to worry about garbage getting in that file. We'll
9604 make sure after the next official release that old msgids don't
9605 get lost. See
9606 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
9607
9608 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
9609 Now auto-generated.
9610 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
9611 Fix typos in explanations of the runtime file.
9612 * bootstrap: Change gettext keyword from YYI18N to YY_.
9613 Use standard Makefile.in.in in runtime-po, since we'll arrange
9614 for backward-compatible bison-runtime.po files in a different way.
9615 * data/glr.c (YY_): New macro, from yacc.c.
9616 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
9617 Translate messages intended for users.
9618 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
9619 the wording in the other skeletons. We don't know that the memory
9620 is virtual.
9621 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
9622 Use same method that yacc.c uses.
9623 Don't translate debugging messages.
9624 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
9625 it doesn't work (yet), and requires C++ expertise to fix.
9626 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
9627 Move defn to a more logical place, to be consistent with other
9628 skeletons.
9629 Don't translate debugging messages.
9630 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
9631 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
9632 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
9633 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
9634
9635 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
9636 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
9637 void, not int.
9638 * tests/glr-regression.at (Badly Collapsed GLR States):
9639 Likewise.
9640 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
9641 yylex should return 0 at EOF rather than aborting.
9642
9643 Improve tests for stack overflow in GLR parser.
9644 Problem reported by twlevo@xs4all.nl.
9645 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
9646 All uses removed.
9647 (yyStackOverflow): Just longjmp, but with value 2 so that caller
9648 can handle the problem.
9649 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
9650 (yyparse): New local variable yyresult to record the result.
9651 Use result of setjmp to set it, rather than storing itinto
9652 struct.
9653 (yyDone): Remove label.
9654 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
9655 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
9656 if YYABORT is used).
9657 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
9658 yyparse status; put status > 1 into diagnostic.
9659 Check that status==2 works.
9660 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
9661 Use exit status 3 for failure to open (which shouldn't happen).
9662
9663 2005-07-17 Paul Eggert <eggert@cs.ucla.edu>
9664
9665 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
9666 1 on syntax error; just let yyparse do its thing.
9667 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
9668 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
9669 (Exploding the Stack Size with Alloca):
9670 (Exploding the Stack Size with Malloc):
9671 Expect exit status 2, not 1, since the parser is supposed to blow
9672 its stack. Problem reported by twlevo@xs4all.nl.
9673
9674 * data/glr.c (yyparse): Don't assume that the initial calls
9675 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
9676 Print a stack-overflow message and fail instead.
9677 Initialize the line-number information before creating the stack,
9678 so that the stack-overflow message can report line zero safely.
9679
9680 2005-07-14 Paul Eggert <eggert@cs.ucla.edu>
9681
9682 Fix problems reported by twlevo@xs4all.nl.
9683 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
9684 (yyuserMerge): Provide a default case if b4_mergers is empty.
9685 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
9686 * tests/glr-regression.at
9687 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
9688 Add casts to pacify C++ compilers.
9689 * tests/glr-regression.at (Improper merging of GLR delayed action
9690 sets): Declare yylex before using it.
9691 * tests/Makefile.am (maintainer-check-g++): Fix a stray
9692 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
9693 test for valgrind; valgrind is independent of g++.
9694 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
9695 for compatibility with POSIX 1003.1-2001 (if running coreutils).
9696 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
9697 Use a destructor, so that we can expand the stack. Change
9698 YYSTYPE to char * so that we can free it. Cast result of malloc.
9699
9700 2005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
9701
9702 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
9703 a valgrind failure. Problem reported by twlevo@xs4all.nl.
9704
9705 2005-07-13 Paul Eggert <eggert@cs.ucla.edu>
9706
9707 * PACKAGING: New file, suggested by Bruno Haible and taken from
9708 similar wording in gettext's PACKAGING file.
9709 * NEWS: Mention PACKAGING.
9710 * Makefile.am (EXTRA_DIST): Add PACKAGING.
9711
9712 2005-07-12 Paul Eggert <eggert@cs.ucla.edu>
9713
9714 * NEWS: Document recent i18n improvements.
9715 * bootstrap: Get runtime translations into runtime-po.
9716 Create runtime-po files automatically, if possible.
9717 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
9718 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
9719 does not infringe on the user's name space.
9720 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
9721 * doc/bison.texinfo (Internationalization): Revamp the English
9722 and Texinfo syntax a bit, to try to make it clearer.
9723 (Bison Options, Option Cross Key): Mention --print-localedir.
9724 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
9725 YYENABLE_NLS. Quote a bit more.
9726 * runtime-po/.cvsignore: New file.
9727 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
9728 * runtime-po/Rules-quot: Remove; now created by bootstrap.
9729 * runtime-po/quot.sed: Likewise.
9730 * runtime-po/boldquot.sed: Likewise.
9731 * runtime-po/en@quot.header: Likewise.
9732 * runtime-po/en@boldquot.header: Likewise.
9733 * runtime-po/insert-header.sin: Likewise.
9734 * runtime-po/remove-potcdate.sin: Likewise.
9735 * runtime-po/Makevars: Likewise.
9736 * runtime-po/LINGUAS: Likewise.
9737 * runtime-po/de.po: Likewise; we will rely on the translation project
9738 to maintain this, so "bootstrap" should get it.
9739 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
9740 its value.
9741 * src/main.c (main): Bind the bison-runtime domain, too.
9742
9743 2005-07-12 Bruno Haible <bruno@clisp.org>
9744
9745 * data/yacc.c: Include <libintl.h> when NLS is enabled.
9746 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
9747 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
9748 * runtime-po: New directory.
9749 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
9750 $(DOMAIN).pot-update rule, so that old messages are never dropped.
9751 * runtime-po/Rules-quot: New file, copied from po/.
9752 * runtime-po/quot.sed: Likewise.
9753 * runtime-po/boldquot.sed: Likewise.
9754 * runtime-po/en@quot.header: Likewise.
9755 * runtime-po/en@boldquot.header: Likewise.
9756 * runtime-po/insert-header.sin: Likewise.
9757 * runtime-po/remove-potcdate.sin: Likewise.
9758 * runtime-po/Makevars: New file.
9759 * runtime-po/POTFILES.in: New file.
9760 * runtime-po/LINGUAS: New file.
9761 * runtime-po/bison-runtime.pot: New file.
9762 * runtime-po/de.po: New file.
9763 * m4/bison.m4: New file.
9764 * Makefile.am (SUBDIRS): Add runtime-po.
9765 (aclocaldir, aclocal_DATA): New variables.
9766 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
9767 Define aclocaldir.
9768 * src/getargs.c (usage): Document --print-localedir option.
9769 (PRINT_LOCALEDIR_OPTION): New enum item.
9770 (long_options): Add --print-localedir option.
9771 (getargs): Handle --print-localedir option.
9772 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
9773 (Internationalization): New section.
9774
9775 2005-07-12 Akim Demaille <akim@epita.fr>
9776
9777 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
9778 for consistency with the rest of the code.
9779 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
9780 Add separators.
9781
9782 2005-07-12 Akim Demaille <akim@epita.fr>
9783
9784 * src/parse-gram.y: Use %printer instead of YYPRINT.
9785
9786 2005-07-12 Akim Demaille <akim@epita.fr>
9787
9788 * src/symtab.h, src/symtab.c (symbol_print): New.
9789 * src/symlist.h, src/symlist.c (symbol_list_print): New.
9790 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
9791
9792 2005-07-12 Akim Demaille <akim@epita.fr>
9793
9794 * data/glr.c (b4_syncline): Fix (swap) the definitions of
9795 b4_at_dollar and b4_dollar_dollar.
9796
9797 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
9798
9799 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
9800 and Pennello's paper.
9801
9802 2005-07-09 Paul Eggert <eggert@cs.ucla.edu>
9803
9804 * data/yacc.c (yyparse): Undo previous patch. Instead,
9805 set yylsp[0] and yyvsp[0] only if the initial action
9806 sets yylloc and yylval, respectively.
9807
9808 * data/yacc.c (yyparse): In the initial action, set
9809 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
9810 This avoids the use of undefined variables if the initial
9811 action does not set yylloc and/or yylval.
9812
9813 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
9814
9815 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
9816 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
9817 Remove from CVS. These files are automatically generated.
9818 * examples/extexi: Clarify that this file is now part of Bison,
9819 not GNU M4, and that it works with any POSIX-compatible Awk.
9820 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
9821 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
9822 so that we also get calc++-parser.yy. Geneate it.
9823 Use $(AWK), not gawk, since any conforming Awk will do.
9824 Put comment before action, since older 'make' can't handle comment
9825 in action.
9826 $(BUILT_SOURCES): List all built sources, not just some of them.
9827 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
9828 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
9829 $($(calc_sources_generated)): Remove unnecessary test for existence
9830 of target. (This had a shell syntax error anyway; a stray "x".)
9831 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
9832 calc++-parser.yy.
9833 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
9834
9835 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
9836 implied by the other modules.
9837
9838 2005-07-06 Akim Demaille <akim@epita.fr>
9839
9840 Bind examples/calc++ to the package.
9841 * examples/calc++/Makefile: Remove, replaced by...
9842 * examples/calc++/Makefile.am: ... this new file.
9843 * examples/calc++/test: Remove input.
9844 * examples/calc++/compile: Remove.
9845 * examples/Makefile.am: New.
9846 * configure.ac, Makefile.am: Adjust.
9847 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
9848
9849 2005-07-05 Paul Eggert <eggert@cs.ucla.edu>
9850
9851 * data/glr.c (yyFail): Drastically simplify; since the format argument
9852 never had any % directives, we can simply pass it to yyerror.
9853 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
9854 be modified later, as that is the usual style in glr.c.
9855 Problems reported by Paul Hilfinger.
9856
9857 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
9858 and size overflow errors.
9859 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
9860 in case the user prolog sets feature-test macros like _GNU_SOURCE.
9861 (YYSIZEMAX): New macro.
9862 (yystpcpy): New function, taken from yacc.c.
9863 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
9864 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
9865 so that we don't have to maintain their signatures.
9866 (yyFail): Check for buffer overflow, by using vsnprintf rather
9867 than vsprintf. Allocate a bigger buffer if possible.
9868 Report an error if buffer allocation fails.
9869 (yyStackOverflow): New function.
9870 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
9871 the initialization was successful. It might fail if storage was
9872 exhausted.
9873 (yyexpandGLRStack): Add more checks for storage allocation failure.
9874 Use yyStackOverflow to report failures.
9875 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
9876 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
9877 Don't assume stack number fits in int.
9878 (yysplitStack): Check for storage allocation failure.
9879 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
9880 can print diagnostics on storage allocation failure. All callers
9881 changed.
9882 (yyresolveValue): Use yybool for boolean.
9883 (yyreportSyntaxError): Check for size-calculation overflow.
9884 This code is taken from yacc.c.
9885 (yyparse): Check for storage allocation errors when allocating
9886 the initial stack.
9887
9888 2005-07-05 Akim Demaille <akim@epita.fr>
9889
9890 Extract calc++ from the documentation.
9891 * doc/bison.texinfo (Calc++): Add the extraction marks.
9892 * examples/extexi: New, from the aborted GNU Programming 2E.
9893 Separate the different paragraph of a file with empty lines.
9894 * examples/Makefile: Use it to extract the whole calc++ example.
9895
9896 2005-06-24 Akim Demaille <akim@epita.fr>
9897
9898 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
9899 class typedefs.
9900
9901 2005-06-22 Akim Demaille <akim@epita.fr>
9902
9903 * doc/bison.texinfo (C++ Language Interface): First stab.
9904 (C++ Parsers): Remove.
9905
9906 2005-06-22 Akim Demaille <akim@epita.fr>
9907
9908 * data/lalr1.cc (yylex_): Honor %lex-param.
9909
9910 2005-06-22 Akim Demaille <akim@epita.fr>
9911
9912 Start a set of simple examples.
9913 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
9914 * examples/calc++/calc++-driver.hh,
9915 * examples/calc++/calc++-parser.yy,
9916 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
9917 * examples/calc++/compile, examples/calc++/test: New.
9918
9919 2005-06-09 Paul Eggert <eggert@cs.ucla.edu>
9920
9921 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
9922 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
9923 which stems from the 2005-05-27 patch.
9924
9925 2005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
9926
9927 * data/glr.c: Modify treatment of unused parameters to permit use
9928 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
9929
9930 2005-05-30 Paul Eggert <eggert@cs.ucla.edu>
9931
9932 Fix infringement on user name space reported by Janos Zoltan Szabo.
9933 * data/yacc.c (yyparse): strlen -> yystrlen.
9934
9935 2005-05-30 Akim Demaille <akim@epita.fr>
9936
9937 * data/lalr1.cc (_): New.
9938 Translate the various messages.
9939
9940 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
9941
9942 Fix infringement on user name space reported by Bruno Haible.
9943 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
9944 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
9945 the user's name space.
9946 (alloca): Include <stdlib.h> to get it, if it's not built in.
9947 (YYMALLOC, YYFREE): Define only if needed.
9948 (malloc, free): Declare, but only if needed, as this infringes on
9949 the user name space.
9950
9951 2005-05-25 Paul Eggert <eggert@cs.ucla.edu>
9952
9953 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
9954 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
9955 with %d format.
9956 * lib/ebitset.c (min, max): Undef before defining.
9957 * lib/vbitset.c (min, max): Likewise.
9958 * lib/subpipe.c (create_subpipe): Save local variables in case
9959 vfork clobbers them.
9960
9961 2005-05-24 Bruno Haible <bruno@clisp.org>
9962
9963 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
9964 error message syntax used by gcc-4.0.
9965
9966 2005-05-23 Paul Eggert <eggert@cs.ucla.edu>
9967
9968 * README: Mention m4 1.4.3. Remove obsolete advice about
9969 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
9970
9971 * bootstrap: Remove workaround for problem I encountered with
9972 gettext 0.14.1; it seems to be fixed now.
9973
9974 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
9975
9976 * NEWS: Version 2.0a.
9977
9978 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
9979 the previous change.
9980
9981 Various maintainer cleanups.
9982 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
9983 conftest*, for benefit of CVS commands run at the same time as
9984 "configure". Add build-aux, since "bootstrap" now creates it and
9985 its subfiles.
9986 * Makefile.cfg (move_if_change): Remove.
9987 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
9988 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
9989 (po_repo, do-po-update, po-update, wget_files, get-targets):
9990 (config.guess-url_prefix, config.sub-url_prefix):
9991 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
9992 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
9993 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
9994 Remove.
9995 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
9996 this is now the recommended name.
9997 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
9998 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
9999 ylwrap. These files now go into build-aux.
10000 * config/move-if-change: Remove.
10001 * config/prev-version.txt: Bump from 1.75 to 2.0.
10002
10003 * bootstrap: Add stdio-safer, unistd-safer modules.
10004 Remove m4/glibc2.m4 (introduced by latest gnulib, but
10005 we don't need it).
10006 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
10007 fopen-safer.c, stdio-safer.h, unistd-safer.h.
10008 * lib/subpipe.c: Include "unistd-safer.h".
10009 (create_subpipe): Make sure all the newly-created
10010 file descriptors are > 2, so that diagnostics don't
10011 get sent down them (which might cause Bison to hang, in theory).
10012 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
10013 * src/files.c (xfopen): Use fopen_safer, not fopen.
10014
10015 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
10016 yesterday's yacc.c fix.
10017
10018 2005-05-21 Paul Eggert <eggert@cs.ucla.edu>
10019
10020 * data/glr.c, data/lalr1.cc: Update copyright date.
10021
10022 Fix a destructor bug reported by Wolfgang Spraul in
10023 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
10024 * data/yacc.c (yyabortlab): Don't call destructor, and
10025 don't set yychar to EMPTY.
10026 (yyoverflowlab): Don't call destructor.
10027 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
10028 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
10029 since we no longer output the message "discarding lookahead token
10030 end of input ()".
10031
10032 2005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10033
10034 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
10035 fix a small glitch in debugging output.
10036 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
10037 after YY_SYMBOL_PRINT where needed.
10038
10039 (struct yyGLRState): Add some comments.
10040 (struct yySemanticOption): Add some comments.
10041 (union yyGLRStackItem): Add comment.
10042
10043 (yymergeOptionSets): Correct this to properly perform the union,
10044 avoiding infinite reported by Michael Rosien.
10045 Update comment.
10046
10047 * tests/glr-regression.at: Add test for GLR merging error reported
10048 by M. Rosien.
10049
10050 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
10051
10052 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
10053 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
10054 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
10055 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
10056 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
10057 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
10058 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
10059 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
10060 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
10061 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
10062 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
10063 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
10064 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
10065 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
10066 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
10067 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
10068 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
10069 src/derives.h, src/files.c, src/files.h, src/getargs.c,
10070 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
10071 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
10072 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
10073 src/output.h, src/parse-gram.c, src/parse-gram.h,
10074 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
10075 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
10076 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
10077 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
10078 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
10079 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
10080 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
10081 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
10082 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
10083 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
10084 tests/reduce.at, tests/regression.at, tests/sets.at,
10085 tests/synclines.at, tests/testsuite.at, tests/torture.at:
10086 Update FSF postal mail address.
10087
10088 2005-05-11 Paul Eggert <eggert@cs.ucla.edu>
10089
10090 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
10091 Problem reported by Ralf Menzel.
10092
10093 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
10094
10095 * tests/actions.at: Test that stack overflow invokes destructors.
10096 From Marcus Holland-Moritz.
10097 * data/yacc.c (yyerrlab): Move the code that destroys the stack
10098 from here....
10099 (yyreturn): to here. That way, destructors are called properly
10100 even if the stack overflows, or the user calls YYACCEPT or
10101 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
10102 (yyoverflowlab): Destroy the lookahead.
10103
10104 2005-04-24 Paul Eggert <eggert@cs.ucla.edu>
10105
10106 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
10107
10108 2005-04-17 Paul Eggert <eggert@cs.ucla.edu>
10109
10110 * NEWS: Bison-generated C parsers no longer quote literal strings
10111 associated with tokens.
10112 * src/output.c (prepare_symbols): Don't escape strings,
10113 since users don't want to see C escapes.
10114 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
10115 in diagnostics.
10116 * tests/input.at (Torturing the Scanner): Likewise.
10117 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
10118
10119 2005-04-16 Paul Eggert <eggert@cs.ucla.edu>
10120
10121 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
10122 the data size is known to be too small and we can't increase it.
10123 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
10124
10125 2005-04-15 Paul Eggert <eggert@cs.ucla.edu>
10126
10127 * src/parse-gram.y: Include quotearg.h.
10128 (string_as_id): Quote $1 before using it as a key, since the
10129 lexer no longer quotes it for us.
10130 (string_content): Don't strip quotes, since lexer no longer
10131 quotes it for us.
10132 * src/scan-gram.l: Include quotearg.h.
10133 ("\""): Omit quote.
10134 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
10135 a key, since the rest of the lexer doesn't quote it.
10136 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
10137 * tests/regression.at (Token definitions): Check for backslashes
10138 in token strings.
10139
10140 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
10141 (YYSIZE_T): Define to unsigned long int when using an older compiler.
10142 (yyparse): Revamp code to generate long syntax error message, to
10143 make it easier to translate, and to avoid problems with arithmetic
10144 overflow. Change "virtual memory" to "memory" in diagnostic, since
10145 we don't know whether the memory is virtual.
10146
10147 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
10148
10149 * NEWS: Bison-generated C parsers now use the _ macro to
10150 translate strings.
10151 * data/yacc.c (_) [!defined _]: New macro.
10152 All English strings wrapped inside this macro.
10153 * doc/bison.texinfo (Bison Parser): Document _.
10154 * po/POTFILES.in: Include src/parse-gram.c, since it now
10155 includes translateable strings that parse-gram.y doesn't.
10156
10157 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
10158
10159 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
10160 reverting the 2004-10-11 change to this function.
10161 (symbol_check_alias_consistency): Don't call symbol_type_set
10162 if the type name is already correct.
10163 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
10164
10165 2005-03-25 Paul Eggert <eggert@cs.ucla.edu>
10166
10167 * tests/regression.at (Token definitions): Don't use a token named
10168 c, as that generates a "#define c ..." that runs afoul of buggy
10169 stdlib.h that uses the identifier c as a member of struct
10170 drand48_data. Problem reported by Horst Wente.
10171
10172 2005-03-21 Paul Eggert <eggert@cs.ucla.edu>
10173
10174 * bootstrap: Change translation URL from
10175 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
10176 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
10177 redirection glitches. Problem reported by twlevo@xs4all.nl.
10178
10179 2005-03-20 Paul Eggert <eggert@cs.ucla.edu>
10180
10181 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
10182 after operands; POSIX says this isn't portable for the c99 command.
10183
10184 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
10185
10186 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
10187 immediately if a data overrun has occurred; this may help us track
10188 down what may be a spurious failure on MacOS.
10189
10190 2005-03-17 Paul Eggert <eggert@cs.ucla.edu>
10191
10192 Respond to problems reported by twlevo@xs4all.nl.
10193
10194 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
10195
10196 * src/vcg.h: Comment fix.
10197 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
10198 (G_CMAX): Change to -1 instead of INT_MAX.
10199
10200 * data/yacc.c (yyparse): Omit spaces before #line.
10201
10202 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
10203
10204 * src/tables.c (state_number_to_vector_number): Put it inside an
10205 "#if 0", since it's not currently used. Problem reported by
10206 Roland McGrath.
10207
10208 2005-03-06 Paul Eggert <eggert@cs.ucla.edu>
10209
10210 * src/output.c (escaped_output): Renamed from
10211 escaped_file_name_output, since we now use it for symbol tags as
10212 well. All uses changed.
10213 (symbol_destructors_output, symbol_printers_output):
10214 Escape symbol tags too.
10215 Problem reported by Matyas Forstner in
10216 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
10217
10218 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
10219 not needed.
10220 * src/output.c (user_actions_output, token_definitions_output,
10221 symbol_destructors_output, symbol_printers_output): Likewise.
10222 * src/reader.c (prologue_augment): Likewise.
10223 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
10224
10225 * src/vcg.c (output_edge): Don't quote linestyle arg.
10226 Problem reported by twlevo@xs4all.nl.
10227
10228 2005-02-28 Paul Eggert <eggert@cs.ucla.edu>
10229
10230 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
10231 example, reported by Derek M Jones. Also, make the example even
10232 more outrageous, to better illustrate how bad the problem is.
10233
10234 2005-02-24 Paul Eggert <eggert@cs.ucla.edu>
10235
10236 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
10237 putsym. Typo reported by Sebastian Piping.
10238
10239 2005-02-23 Paul Eggert <eggert@cs.ucla.edu>
10240
10241 * doc/bison.texinfo (Language and Grammar): some -> same
10242 (Epilogue): int he -> in the
10243 Typos reported by Sebastian Piping via Justin Pence.
10244
10245 2005-02-07 Paul Eggert <eggert@cs.ucla.edu>
10246
10247 * tests/glr-regression.at (Improper handling of embedded actions
10248 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
10249 embedded actions and $-N in GLR parsers", work around an Autoconf bug
10250 with dollar signs in test names.
10251 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
10252 for a similar reason.
10253
10254 2005-01-28 Paul Eggert <eggert@cs.ucla.edu>
10255
10256 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
10257 wants to redefine G_VIEW.
10258
10259 2005-01-27 Paul Eggert <eggert@cs.ucla.edu>
10260
10261 * src/vcg.c (get_view_str): Remove case for normal_view.
10262 Problem reported by twlevo@xs4all.nl.
10263
10264 2005-01-24 Paul Eggert <eggert@cs.ucla.edu>
10265
10266 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
10267 Problem reported by twlevo@xs4all.nl.
10268
10269 * doc/bison.texinfo: Change @dircategory from "GNU programming
10270 tools" to "Software development". Requested by Richard Stallman
10271 via Karl Berry.
10272
10273 2005-01-23 Paul Eggert <eggert@cs.ucla.edu>
10274
10275 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
10276 Problem reported by twlevo@xs4all.nl.
10277
10278 2005-01-21 Paul Eggert <eggert@cs.ucla.edu>
10279
10280 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
10281 keyword; it's not needed with modern compilers, and it doesn't
10282 affect correctness with older compilers. Suggested by
10283 twlevo@xs4all.nl.
10284
10285 2005-01-17 Paul Eggert <eggert@cs.ucla.edu>
10286
10287 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
10288 gcc -Wswitch-default.
10289 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
10290 * data/yacc.c (yyparse): Likewise.
10291
10292 2005-01-12 Paul Eggert <eggert@cs.ucla.edu>
10293
10294 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
10295 already. Let config.h define any nonstandard values.
10296
10297 2005-01-10 Paul Eggert <eggert@cs.ucla.edu>
10298
10299 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
10300 for the benefit of slower hosts. Problem reported by
10301 Nelson H. F. Beebe.
10302
10303 2005-01-07 Paul Eggert <eggert@cs.ucla.edu>
10304
10305 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
10306 being defined and not used.
10307 * data/lalr1.cc (yyparse): Likewise.
10308 Use "if (false)" rather than "if (0)".
10309
10310 2005-01-05 Paul Eggert <eggert@cs.ucla.edu>
10311
10312 * TODO: Mention that we should allow NUL bytes in tokens.
10313
10314 2005-01-02 Paul Eggert <eggert@cs.ucla.edu>
10315
10316 * src/scan-skel.l (<<EOF>>): Don't close standard output.
10317 Problem reported by Hans Aberg.
10318
10319 2005-01-01 Paul Eggert <eggert@cs.ucla.edu>
10320
10321 * src/getargs.c (version): Happy new year; update overall
10322 program copyright date from 2004 to 2005.
10323
10324 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
10325 Problem reported by Hans Aberg.
10326 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
10327 (Output file names.): Add a test for the case when standard output
10328 is closed.
10329
10330 2004-12-26 Paul Eggert <eggert@cs.ucla.edu>
10331
10332 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
10333 to fix an oversight in the Bison 2.0 manual.
10334
10335 2004-12-25 Paul Eggert <eggert@cs.ucla.edu>
10336
10337 * NEWS: Version 2.0. Reformat the existing news items since
10338 1.875, so that related items are grouped together.
10339 * configure.ac (AC_INIT): Bump version to 2.0.
10340 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
10341
10342 * tests/torture.at (Exploding the Stack Size with Alloca): Set
10343 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
10344 otherwise, we're not testing alloca. Unfortunately there's no
10345 simple way to consult HAVE_ALLOCA here.
10346
10347 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
10348 for yymsg, too.
10349
10350 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
10351 hand. This avoids a warning about comparing int to size_t when
10352 GCC warnings are enabled.
10353
10354 2004-12-22 Paul Eggert <eggert@cs.ucla.edu>
10355
10356 * NEWS: Bison-generated parsers no longer default to using the
10357 alloca function (when available) to extend the parser stack, due
10358 to widespread problems in unchecked stack-overflow detection.
10359 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
10360 responsibility to set it to a positive value. This lets the user
10361 specify a value that is not a preprocessor constant.
10362 * data/yacc.c (YYMAXDEPTH): Likewise.
10363 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
10364 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
10365 to be a compile-time constant. However, explain the constraints on it.
10366 Also, explain the constraints on YYINITDEPTH.
10367 (Table of Symbols): Explain that alloca is no longer the default.
10368 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
10369 to 1.
10370
10371 * doc/bison.texinfo (Location Default Action): Mention that n must
10372 be zero when k is zero. Suggested by Frank Heckenbach.
10373
10374 2004-12-22 Akim Demaille <akim@epita.fr>
10375
10376 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
10377 (parser::state_type, parser::semantic_type, parser::location_type):
10378 Private, not public.
10379 (parser::parse): Return ints, not bool.
10380 Returning a bool introduces a problem: 0 corresponds to false, and
10381 it seems weird to return false on success. Returning true changes
10382 the conventions for yyparse.
10383 Alternatively we could return void and send an exception.
10384 There is no clear consensus (yet?).
10385 (state_stack, semantic_stack, location_stack): Rename as...
10386 (state_stack_type, semantic_stack_type, location_stack_type): these.
10387 Private, not public.
10388 * tests/c++.at: New.
10389 * tests/testsuite.at, tests/Makefile.am: Adjust.
10390
10391 2004-12-21 Akim Demaille <akim@epita.fr>
10392
10393 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
10394
10395 2004-12-21 Akim Demaille <akim@epita.fr>
10396
10397 Don't impose std::string for filenames.
10398
10399 * data/lalr1.cc (b4_filename_type): New.
10400 (position::filename): Use it.
10401 (parser.hh): Move the inclusion of stack.hh and location.hh below
10402 the user code, so that needed headers for the filename type can be
10403 included first.
10404 Forward declare them before the user code.
10405 * tests/Makefile.am (check-local, installcheck-local): Pass
10406 TESTSUITEFLAGS to the TESTSUITE.
10407
10408 2004-12-20 Akim Demaille <akim@epita.fr>
10409
10410 Use more STL like names: my_class instead of MyClass.
10411
10412 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
10413 (SemanticStack, SemanticType, StateStack, StateType)
10414 (TokenNumberType, Stack, Slice, Traits, Parser::location)
10415 (Parser::value): Rename as...
10416 (location_stack, location_type, rhs_number_type, semantic_stack)
10417 (semantic_type, state_stack, state_type, token_number_type, stack)
10418 (slice, traits, parser::yylloc, parser::yylval): these.
10419
10420 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
10421
10422 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
10423
10424 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
10425 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
10426
10427 2004-12-17 Paul Eggert <eggert@cs.ucla.edu>
10428
10429 Remove uses of 'short int' and 'unsigned short int'. This raises
10430 some arbitrary limits. It uses more memory but nowadays that's
10431 not much of an issue.
10432
10433 This change does not affect the generated parsers; that's a different
10434 task, as some users will want to conserve memory there.
10435
10436 Ideally we should use size_t to represent all object counts, and
10437 something like ptrdiff_t to represent signed differences of object
10438 counts; but that will require more code-cleanup than I have the
10439 time to do right now.
10440
10441 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
10442 Use size_t, not int or short int, to count objects.
10443 * src/closure.c (nritemset, closure): Likewise.
10444 * src/closure.h (nritemset, closure): Likewise.
10445 * src/nullable.c (nullable_compute): Likewise.
10446 * src/print.c (print_core): Likewise.
10447 * src/print_graph.c (print_core): Likewise.
10448 * src/state.c (state_compare, state_hash): Likewise.
10449 * src/state.h (struct state): Likewise.
10450 * src/tables.c (default_goto, goto_actions): Likewise.
10451
10452 * src/gram.h (rule_number, rule): Use int, not short int.
10453 * src/output.c (prepare_rules): Likewise.
10454 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
10455 errs, reductions): Likewise.
10456 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
10457 Likewise.
10458 * src/tables.c (vector_number, tally, action_number,
10459 ACTION_NUMBER_MINIMUM): Likewise.
10460 * src/output.c (muscle_insert_short_int_table): Remove.
10461
10462 2004-12-17 Akim Demaille <akim@epita.fr>
10463
10464 * data/lalr1.cc: Extensive Doxygenation.
10465 (error_): Rename as...
10466 (error): this, since it is visible to the user.
10467 Adjust callers.
10468 (Parser::message): Now an automatic variable from...
10469 (Parser::yyreport_syntax_error_): here.
10470 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
10471 Parser::error.
10472 * tests/input.at: Escape $.
10473
10474 2004-12-16 Paul Eggert <eggert@cs.ucla.edu>
10475
10476 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
10477 Parenthesize rhs to avoid obscure problems with mistakes like
10478 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
10479 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
10480 b4_rhs_location): Likewise.
10481 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
10482 b4_rhs_location): Likewise.
10483
10484 2004-12-16 Akim Demaille <akim@epita.fr>
10485
10486 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
10487 yacc.c: be sure to stay within yycheck_.
10488 * tests/actions.at: Re-enable C++ tests.
10489
10490 2004-12-16 Akim Demaille <akim@epita.fr>
10491
10492 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
10493 real.
10494
10495 2004-12-16 Akim Demaille <akim@epita.fr>
10496
10497 Use #define to handle the %name-prefix.
10498
10499 * data/glr.c, data/yacc.c: Comment changes.
10500 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
10501 so that one can refer to yylex in the parser file, and have it
10502 renamed, as is the case with other skeletons.
10503
10504 2004-12-16 Akim Demaille <akim@epita.fr>
10505
10506 Move lalr1.cc internals into yy*.
10507
10508 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
10509 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
10510 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
10511 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
10512 (empty_, final_, terror_, errcode_, ntokens_)
10513 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
10514 (looka_, ilooka_, error_range_, nerrs_):
10515 Rename as...
10516 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
10517 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
10518 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
10519 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
10520 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
10521 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
10522 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
10523 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
10524 these.
10525
10526 2004-12-15 Paul Eggert <eggert@cs.ucla.edu>
10527
10528 Fix some problems reported by twlevo at xs4all.
10529 * src/symtab.c (symbol_new): Report an error if the input grammar
10530 contains too many symbols. This is better than calling abort() later.
10531 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
10532 (struct node, struct graph):
10533 Rename member expand to stretch. All uses changed.
10534 (struct graph): Remove member layoutalgorithm. All uses removed.
10535 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
10536 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
10537 All uses changed.
10538 (N_STRETCH): Rename from N_EXPAND. All uses changed.
10539
10540 2004-12-15 Akim Demaille <akim@epita.fr>
10541
10542 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
10543 Add more Doxygen comments.
10544 (symprint_, stack_print_, reduce_print_, destruct_, pop)
10545 (report_syntax_error_, translate_): Rename as...
10546 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
10547 (yypop_, yyreport_syntax_error_, yytranslate_): this.
10548
10549 2004-12-15 Akim Demaille <akim@epita.fr>
10550
10551 * data/lalr1.cc (lex_): Rename as...
10552 (yylex_): this.
10553 Move the trace here.
10554 Take the %name-prefix into account.
10555 Reported by Alexandre Duret-Lutz.
10556
10557 2004-12-15 Akim Demaille <akim@epita.fr>
10558
10559 Simplify the C++ parser constructor.
10560
10561 * data/lalr1.cc (debug_): Rename as...
10562 (yydebug_): so that the parser's internals are always in the yy*
10563 pseudo namespace.
10564 Adjust uses.
10565 (b4_parse_param_decl): Remove the leading comma as it is now only
10566 called as unique argument list.
10567 (Parser::Parser): Remove the constructor accepting a location and
10568 an initial debugging level.
10569 Remove from the other ctor the argument for the debugging level.
10570 (debug_level_type, debug_level, set_debug_level): New.
10571
10572 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
10573 constructor calls.
10574
10575 2004-12-15 Akim Demaille <akim@epita.fr>
10576
10577 Remove b4_root related material: failure experiment
10578 (which goal was to allow to derive from a class).
10579
10580 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
10581 definitions and uses.
10582
10583 2004-12-14 Paul Eggert <eggert@cs.ucla.edu>
10584
10585 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
10586 not 2, since it's not portable to subtract 1 from the start of an
10587 array. The new item 0 is never set or used. All uses changed.
10588
10589 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
10590 the default definition of YYLLOC_DEFAULT. Problem reported
10591 by Frank Heckenbach.
10592
10593 2004-12-12 Paul Eggert <eggert@cs.ucla.edu>
10594
10595 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
10596 the normal case and one for the error case. Just use the
10597 first one uniformly. Problem reported by Frank Heckenbach.
10598 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
10599 use exactly the same macro in both places.
10600 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
10601 so that the normal-case YYRHSLOC works for the error case too.
10602 All uses changed.
10603 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
10604 (YYLLOC_DEFAULT): Use the same macro as glr.c.
10605 * doc/bison.texinfo (Location Default Action): Don't claim that
10606 we have an array of locations. Use the same macro for both glr
10607 and lalr parsers. Mention YYRHSLOC. Mention what happens when
10608 the index is 0.
10609
10610 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
10611
10612 * HACKING: Update email addresses to send announcements to.
10613
10614 * configure.ac (AC_INIT): Bump version to 1.875f.
10615
10616 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
10617
10618 * NEWS: Version 1.875e.
10619 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
10620
10621 * src/scan-skel.l: Include "complain.h", for "fatal".
10622
10623 * src/relation.h (relation_print, relation_digraph):
10624 Relation sizes are of type relation_node, not size_t (this is
10625 merely a doc fix, since the two types are equivalent).
10626 (relation_transpose): Relation sizes are of type relation_node,
10627 not int.
10628 * src/relation.c: Likewise.
10629 (top, infinity): Now of type relation_node, not int.
10630 (traverse, relation_transpose): Use relation_node, not int.
10631
10632 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
10633 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
10634 (yyparse): Remove unused local introduced in 2004-10-25 patch.
10635
10636 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
10637 specifying whether the test should be skipped. Use it tp
10638 specify that the [%defines %skeleton "lalr1.cc"] tests currently
10639 fail on some hosts, and should be skipped.
10640
10641 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
10642
10643 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
10644 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
10645 unless otherwise specified below.
10646
10647 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
10648 to allocate kernel_base, kernel_items, kernel_size, since
10649 they needn't be initialized to 0.
10650 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
10651 * src/closure.c (new_closure): Likewise, for itemset.
10652 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
10653 * src/lalr.c (set_goto_map): Likewise, for temp_map.
10654 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
10655 (build_relations): Likewise for edge, states1, includes.
10656 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
10657 * src/reader.c (packgram): Likewise, for ritem, rules.
10658 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
10659 * src/relation.c (relation_digraph): Likewise for VERTICES.
10660 (relation_transpose): Likewise for new_R, end_R.
10661 * src/symtab.c (symbols_token_translations_init): Likewise for
10662 token_translations.
10663 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
10664 (token_actions): Likewise for yydefact, actrow, conflrow,
10665 conflict_list.
10666 (save_column): Likewise for froms[symno], tos[symno].
10667 (goto_actions): Likewise for state_count.
10668 (pack_table): Likewise for base, pos, check.
10669 (tables_generate): Likewise for width.
10670
10671 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
10672 for initial core. Just have a separate core, so we needn't worry
10673 about whether kernel_size and kernel_base are initialized.
10674
10675 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
10676 kernel_size, kernel_items): Remove unnecessary initialization.
10677 * src/conflicts.c (conflicts): Likewise.
10678 * src/derives.c (derives): Likewise.
10679 * src/muscle_tablc (muscle_insert): Likewise.
10680 * src/relation.c (relation_digraph): Likewise.
10681 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
10682 conflrow, conflict_table, conflict_list, table, check):
10683 Likewise.
10684
10685 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
10686 This is because all callers pass unsigned int.
10687 * src/closure.h (new_closure): Likewise.
10688
10689 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
10690 (build_relations): Initialize includes[i] in all cases.
10691 * src/reader.c (packgram): Always initialize rules[ruleno].prec
10692 and rules[ruleno].precsym. Initialize members in order.
10693 * src/relation.c (relation_transpose): Always initialize new_R[i]
10694 and end_R[i].
10695 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
10696
10697 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
10698 conflict_list[0] was always 0, but now it isn't initialized.
10699
10700 * src/table.c (table_grow): When conflict_table grew, the grown
10701 area wasn't cleared. Fix this.
10702
10703 * lib/.cvsignore: Add strdup.c, strdup.h.
10704 * m4/.cvsignore: Add strdup.m4.
10705
10706 2004-12-07 Paul Eggert <eggert@cs.ucla.edu>
10707
10708 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
10709 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
10710 GOTO_NUMBER_MAXIMUM, since we occasionally compute
10711 ngotos + 1 without checking for overflow.
10712 (build_relations): Use END_NODE, not -1, to denote end of edges.
10713 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
10714 build_relations): Use goto_number, not int, for goto numbers.
10715 * src/tables.c (save_column, default_goto): Likewise.
10716
10717 2004-11-23 Akim Demaille <akim@epita.fr>
10718
10719 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
10720 of #defining from yystype.
10721 Don't typedef yystype, C++ does not need it.
10722 This lets it possible to forward declare it as union.
10723
10724 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
10725
10726 * bootstrap (gnulib_modules): Add extensions.
10727 Problem reported by Jim Meyering.
10728
10729 2004-11-22 Paul Eggert <eggert@cs.ucla.edu>
10730
10731 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
10732 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
10733 src/system.h, src/tables.c: XFREE -> free, to accommodate
10734 recent change to gnulib xalloc.h.
10735 Problem reported by Jim Meyering.
10736
10737 2004-11-17 Akim Demaille <akim@epita.fr>
10738
10739 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
10740
10741 2004-11-17 Akim Demaille <akim@epita.fr>,
10742 Alexandre Duret-Lutz <adl@gnu.org>
10743
10744 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
10745 changes.
10746 (YYCDEBUG): Adjust.
10747 Use it instead of cdebug_.
10748 (Parser::debug_stream, Parser::set_debug_stream): New.
10749 (Parser::symprint_): Define cdebug_ for temporary backward
10750 compatibility.
10751 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
10752 debug_stream ().
10753
10754 2004-11-17 Akim Demaille <akim@epita.fr>
10755
10756 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
10757 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
10758 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
10759 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
10760
10761 2004-10-27 Paul Eggert <eggert@cs.ucla.edu>
10762
10763 * data/glr.c (yyloc_default): Remove; not used.
10764 Problem reported by Frank Heckenbach.
10765
10766 2004-10-25 Akim Demaille <akim@epita.fr>
10767
10768 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
10769 Introduce another definition to address simple location arrays.
10770 (yyGLRStack): New member: yyerror_range.
10771 (yyrecoverSyntaxError, yyparse): Update it.
10772 (yyrecoverSyntaxError): Use it when shifting the error token to
10773 have an accurate range, equivalent to the one computed by both
10774 yacc.c and lalr1.cc.
10775 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
10776 that column numbers start at column 0, as per GNU Coding
10777 Standards, the others tests, and the doc.
10778 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
10779 Adjust to the above change (first column is 0).
10780 And adjust the location of the "<error>", now covering the whole
10781 line.
10782
10783 2004-10-22 Akim Demaille <akim@epita.fr>
10784 and Paul Eggert <eggert@cs.ucla.edu>
10785
10786 Remove some arbitrary limits on goto numbers and relations.
10787 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
10788 initial values, since they're never used.
10789 (set_goto_map): ngotos is now unsigned, so test for overflow
10790 by seeing whether it wraps around to zero.
10791 * src/lalr.h (goto_number): Now size_t, not short int.
10792 (GOTO_NUMBER_MAXIMUM): Remove.
10793 * src/relation.c (relation_print, traverse, relation_transpose):
10794 Check for END_NODE rather than looking at sign.
10795 * src/relation.h (END_NODE): New macro.
10796 (relation_node): Now size_t, not short int.
10797
10798 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
10799
10800 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
10801 keyword, not an identifier. Problem reported by Baron Schwartz in
10802 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
10803
10804 2004-10-11 Akim Demaille <akim@epita.fr>
10805
10806 * src/symtab.c (symbol_check_alias_consistency): Also check
10807 type names, destructors, and printers.
10808 Reported by Alexandre Duret-Lutz.
10809 Recode the handling of associativity and precedence in terms
10810 of symbol_precedence_set.
10811 Accept no redeclaration at all, not even equal to the previous
10812 value.
10813 (redeclaration): New.
10814 Use it to factor redeclaration complaints.
10815 (symbol_make_alias): Don't set the type of the alias, let
10816 symbol_check_alias_consistency do it as for other features.
10817 * src/symtab.h (symbol): Add new member prec_location, and
10818 type_location.
10819 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
10820 * tests/input.at (Incompatible Aliases): New.
10821
10822 2004-10-09 Paul Eggert <eggert@cs.ucla.edu>
10823
10824 .cvsignore fixes to accommodate gnulib changes,
10825 and the practice of naming build directories "_build".
10826 * .cvsignore: Add "_*". Sort.
10827 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
10828 * m4/.cvsignore: Add "*_gl.m4".
10829
10830 2004-10-06 Akim Demaille <akim@epita.fr>
10831
10832 * src/parse-gram.y (add_param): Fix the truncation of trailing
10833 spaces.
10834
10835 2004-10-05 Akim Demaille <akim@epita.fr>
10836
10837 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
10838 whether the reducion was empty or not. This leaves room to
10839 improve the use of YYLLOC_DEFAULT in such a case.
10840 lalr1.cc is still experimental, so changing this is acceptable.
10841 And finally, there are probably not many users who changed the
10842 handling of locations in GLR, so changing is admissible too.
10843
10844 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
10845 empty reduction, set @$ to an empty location ending the previously
10846 stacked symbol.
10847 Adjust uses to make sure the code is triggered on empty
10848 reductions.
10849 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
10850 expected output: empty reductions have empty locations.
10851
10852 2004-09-29 Akim Demaille <akim@epita.fr>
10853
10854 * data/lalr1.cc: Move towards a more standard C++ coding style
10855 for templates: Class < T > -> Class<T>.
10856
10857 2004-09-29 Akim Demaille <akim@epita.fr>
10858
10859 * data/lalr1.cc: Reinstall the former ctor, for sake of
10860 compatibility, but warn it will be removed.
10861 Move towards a more standard C++ coding style (i.e., type *var ->
10862 type* var).
10863
10864 2004-09-27 Paul Eggert <eggert@cs.ucla.edu>
10865
10866 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
10867 since it's less likely to work if NULs are involved in the future.
10868
10869 2004-09-27 Akim Demaille <akim@epita.fr>
10870
10871 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
10872
10873 2004-09-27 Akim Demaille <akim@epita.fr>
10874
10875 * data/lalr1.cc (b4_parse_param_decl_1): New.
10876 (b4_parse_param_decl): Use it to have different names between attribute
10877 and argument names.
10878 (b4_cc_constructor_call): Likewise.
10879
10880 2004-09-24 Akim Demaille <akim@epita.fr>
10881
10882 * src/parse-gram.y (add_param): Strip the leading and trailing
10883 blanks from a formal argument declaration.
10884 (YY_LOCATION_PRINT): New.
10885
10886 2004-09-24 Akim Demaille <akim@epita.fr>
10887
10888 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
10889 after the location.
10890
10891 2004-09-24 Akim Demaille <akim@epita.fr>
10892
10893 * doc/bison.texinfo (Table of Symbols): Sort.
10894
10895 2004-09-21 Akim Demaille <akim@epita.fr>
10896
10897 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
10898 the useless parentheses.
10899 Suggested by Paul Eggert.
10900
10901 2004-09-20 Akim Demaille <akim@epita.fr>
10902
10903 Let the initial-action act on the look-ahead, and use it for the
10904 "initial push" (corresponding to an hypothetical beginning-of-file).
10905 And let lalr1.cc honor %initial-action.
10906
10907 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
10908 example.
10909 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
10910 (Parser::Parser): Remove the ctor that used to initialize it.
10911 (Parser::parse): Like in the other skeletons, issue the "starting
10912 parse" message before any action.
10913 Honor %initial-action.
10914 Initialize the stacks with the lookahead.
10915 * data/yacc.c: Let $$ and @$ in %initial-action designate the
10916 look-ahead.
10917 Push them in the stacks.
10918 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
10919
10920 2004-09-20 Akim Demaille <akim@epita.fr>
10921
10922 * doc/bison.texinfo (Initial Action Decl): New.
10923
10924 2004-09-20 Akim Demaille <akim@epita.fr>
10925
10926 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
10927 clearer criterion to define it.
10928 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
10929 When reducing on an empty RHS, use the latest stacked location as
10930 location.
10931 yylloc is not always available.
10932 * data/glr.c: Likewise.
10933 Also, honor initial-actions.
10934
10935 2004-09-20 Akim Demaille <akim@epita.fr>
10936
10937 * data/yacc.c (YY_LOCATION_PRINT): New.
10938 Define when we know YYLTYPE's structure, i.e., when the default
10939 YYLLOC_DEFAULT is used.
10940 * data/c.m4 (b4_yysymprint_generate): Use it.
10941 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
10942 value of the result.
10943 (error_start_): Replace with...
10944 (error_range_): this location array.
10945 This allows to replace code relying on the implementation of
10946 locations by portable code.
10947 * data/yacc.c (yylerrsp): Replace with...
10948 (yyerror_range): this.
10949 Every time a token is popped, update yyerror_range[0], to have an
10950 accurate location for the error token.
10951 * data/glr.c (YY_LOCATION_PRINT): New.
10952 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
10953 deference a pointer.
10954 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
10955 report the location in %printers.
10956
10957 * src/scan-skel.l: Instead of abort, report error messages to ease
10958 understanding skeleton scanning failures.
10959
10960 2004-09-16 Akim Demaille <akim@epita.fr>
10961
10962 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
10963 (iterator, const_iterator): these, to be more in the C++ spirit.
10964 Also, return reverse iterators so that when displaying the stack
10965 we display its bottom first.
10966 (Parser::stack_print_, Parser::reduce_print_): Match the messages
10967 from yacc.c.
10968 We should probably use vector here though.
10969
10970 2004-09-16 Akim Demaille <akim@epita.fr>
10971
10972 Have more complete shift traces.
10973
10974 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
10975 to report Shifts instead of ad hoc YYDPRINTF invocations,
10976 including for the error token.
10977 * data/lalr1.cc (symprint_): Output the location.
10978 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
10979 output the location within the %printer.
10980 Activate GLR tests, at least to make sure they compile properly.
10981 They still don't pass though.
10982 * tests/calc.at: Adjust expect verbose output, since now "Entering
10983 state..." is on a different line than the "Shifting" message.
10984
10985 2004-09-08 Akim Demaille <akim@epita.fr>
10986
10987 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
10988 Bison directive from the Bison file to the invocation of this
10989 macro, so that these directives are passed to
10990 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
10991 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
10992 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
10993 the extra Bison directives instead of the whole series.
10994 Change the grammar so that there are recoverable errors, and
10995 unrecoverable errors. Now we can have the parser give up before
10996 consuming the whole input. As a result we now can observe that
10997 the lookahead is freed when needed.
10998 Change the parser source to parse argv[1] instead of a hard coded
10999 string.
11000 Simplify yylex, and give a value and location to EOF.
11001 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
11002 passed directives already coded in the file.
11003 Add some tests to check the location of "error".
11004 For some tests, the C++ parser is correct, and not yacc.c.
11005 For other tests, they provide different, but unsatisfying, values,
11006 so keep the C++ value so that at least one parser is "correct"
11007 according to the test suite.
11008 (Actions after errors): Remove, this is subsumed by the
11009 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
11010
11011 2004-09-06 Akim Demaille <akim@epita.fr>
11012
11013 * data/lalr1.cc: Adjust the indentation of the labels.
11014 (Parser::pop): New.
11015 Use it.
11016
11017 2004-09-06 Akim Demaille <akim@epita.fr>
11018
11019 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
11020 argument, an informative message.
11021 Call YY_SYMBOL_PRINT.
11022 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
11023 * data/lalr1.cc (destruct_): Likewise.
11024 In addition, no longer depend on b4_yysymprint_generate and
11025 b4_yydestruct_generate to generate these functions, do it "by
11026 hand".
11027
11028 2004-09-03 Akim Demaille <akim@epita.fr>
11029
11030 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
11031 invoked, yydestruct the lookahead.
11032 * tests/calc.at (Calculator $1): Update the expected lengths of
11033 traces: there is an added line for the discarded lookahead.
11034 * doc/bison.texinfo (Destructor Decl): Some rewording.
11035 Define "discarded" symbols.
11036
11037 2004-09-02 Akim Demaille <akim@epita.fr>
11038
11039 * data/lalr1.cc (translate_, destruct_): No reason to be static.
11040
11041 2004-09-02 Akim Demaille <akim@epita.fr>
11042
11043 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
11044 (YYDSYMPRINTF): Rename as...
11045 (YY_SYMBOL_PRINT): this.
11046 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
11047 two.
11048 Use it instead of direct symprint_ calls.
11049 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
11050 one.
11051
11052 2004-09-02 Akim Demaille <akim@epita.fr>
11053
11054 * data/lalr1.cc (b4_yysymprint_generate): New.
11055 (symprint_): New member function, defined when YYDEBUG.
11056 Use it consistently instead of token/nterm debugging output by
11057 hand.
11058 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
11059 %printer calls to use cdebug_ when using lalr1.cc.
11060
11061 2004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
11062
11063 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
11064 with #ifdef YYDEBUG.
11065
11066 2004-08-26 Akim Demaille <akim@epita.fr>
11067
11068 * doc/bison.texinfo (Implementing Loops): Rename as...
11069 (Implementing Gotos/Loops): this.
11070
11071 2004-08-13 Paul Eggert <eggert@cs.ucla.edu>
11072
11073 Adjust to latest gnulib.
11074 * bootstrap (gnulib_modules): Add xalloc-die.
11075 Set LC_ALL=C so that file names sort consistently.
11076 Prefer the gnulib copies of gettext.m4, glibc21.m4,
11077 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
11078 uintmax_t.m4, ulonglong.m4.
11079 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
11080 po.m4 since we are now using _gl.m4 instead.
11081
11082 2004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
11083
11084 * src/scan-action.l: Remove. Scanning of semantic actions is
11085 handled in scan-gram.l.
11086
11087 2004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
11088
11089 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
11090
11091 * src/location.h (struct): The file member is a uniqstr.
11092 (equal_boundaries): Use UNIQSTR_EQ for comparison.
11093
11094 2004-07-22 Paul Eggert <eggert@cs.ucla.edu>
11095
11096 Fix bug with non-%union parsers that have printers or destructors,
11097 which led to a Bison core dump. Reported by Peter Fales in
11098 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
11099
11100 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
11101 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
11102 not to our own type.
11103 * src/output.c (symbol_destructors_output, symbol_printers_output):
11104 Don't assume %union.
11105 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
11106 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
11107 UNION-FLAG. All callers changed.
11108 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
11109 Use type char, not unsigned int, when declaring an array of char;
11110 this lets us remove a cast.
11111 (Printers and Destructors): Add non-%union test cases.
11112
11113 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
11114
11115 * doc/bison.texinfo: Minor editorial changes, mostly to the new
11116 GLR writeups. E.g., avoid frenchspacing and the future tense,
11117 change "lookahead" to "look-ahead", and change "wrt" to "with
11118 respect to".
11119
11120 2004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
11121
11122 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
11123 New sections, split off from the GLR Parsers section. Put the new
11124 Simple GLR Parser near the start of the GLR section, for clarity.
11125 Rewrite connective text.
11126
11127 2004-06-21 Frank Heckenbach <frank@g-n-u.de>
11128
11129 * doc/bison.texinfo (Simple GLR Parsers): New section.
11130
11131 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
11132
11133 * NEWS, TODO, doc/bison.texinfo:
11134 Use "look-ahead" instead of "lookahead", to be consistent.
11135 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
11136 while we're fixing "look-ahead".
11137 * src/conflicts.c (shift_set): Renamed from shiftset.
11138 (look_ahead_set): Renamed from lookaheadset.
11139 * src/print.c: Likewise.
11140 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
11141 name for "lookahead".
11142 (report_types, usage): Likewise.
11143 * src/getargs.h (report_look_ahead_tokens): Renamed from
11144 report_lookaheads.
11145 * src/lalr.c (compute_look_ahead_tokens): Renamed from
11146 compute_lookaheads.
11147 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
11148 (look_ahead_tokens_print): Renamed from lookaheads_print.
11149 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
11150 state_rule_lookaheads_print.
11151 * src/state.h: Likewise.
11152 (reductions.look_ahead_tokens): Renamed from lookaheads.
11153 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
11154 AT_DATA_LOOKAHEADS_GRAMMAR.
11155
11156 2004-06-03 Paul Eggert <eggert@cs.ucla.edu>
11157
11158 * README: Update location of patched M4 distribution.
11159
11160 2004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
11161
11162 Don't assume the C++ compiler takes the same arguments as the C compiler
11163 (trivial change).
11164 * configure.ac (O0CXXFLAGS): New var.
11165 * tests/atlocal.in (CXXFLAGS): Use it.
11166
11167 2004-05-29 Paul Eggert <eggert@cs.ucla.edu>
11168
11169 Fix some "make check" problems with C++ reported by
11170 Albert Chin-A-Young for Tru64 C++ in this thread:
11171 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
11172
11173 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
11174 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
11175 Output to a .cc file for C++, not to a .c file.
11176 * tests/calc.at (AT_CHECK_CALC): Likewise.
11177 * tests/regression.at (AT_CHECK_DANCER): Likewise.
11178 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
11179
11180 2004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
11181
11182 * tests/calc.at, tests/actions.at: Workaround for SGI
11183 C++ compiler. (trivial change)
11184
11185 2004-05-27 Paul Eggert <eggert@cs.ucla.edu>
11186
11187 Spent a few hours checking out which prerequisite versions the
11188 current sources actually require. I went all the way back to
11189 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
11190 a seemingly endless set of combinations of versions more recent
11191 than that. The bottom line is that the current sources require
11192 fairly recent versions of the build tools, and it'll be some work
11193 to change this.
11194 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
11195 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
11196 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
11197 Add comments explaining why those particular versions are
11198 currently needed.
11199
11200 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
11201 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
11202 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
11203
11204 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
11205 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
11206
11207 2004-05-26 Paul Eggert <eggert@cs.ucla.edu>
11208
11209 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
11210 0.11.5. Suggested by Bruno Haible.
11211 * bootstrap: Remove gettext version checking.
11212
11213 * doc/bison.texinfo (Decl Summary): Also mention that %union
11214 can depend on prerequisite types. Problem reported by Tim
11215 Van Holder.
11216
11217 2004-05-25 Paul Eggert <eggert@cs.ucla.edu>
11218
11219 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
11220 * README-alpha: Don't tell people not to package this.
11221
11222 * bootstrap: Don't assume $(...) works; use `...` instead.
11223 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
11224 gettext better.
11225
11226 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
11227 put into the -d output file, and mention what to do if YYSTYPE is
11228 defined as a macro.
11229
11230 2004-05-24 Paul Eggert <eggert@cs.ucla.edu>
11231
11232 Undo change made earlier today: it caused autopoint to not bring
11233 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
11234 autopoint's.
11235
11236 * bootstrap: Check that gettext version matches what's in
11237 configure.ac. Warn users to ignore robots.txt ERROR 404.
11238 * bootstrap: Undo today's earlier change (logged below).
11239 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
11240
11241 The gettext version checking is causing more trouble than it's
11242 curing; remove it. Problem reported by Paul Hilfinger.
11243
11244 * bootstrap: Issue a warning that one can expect a message
11245 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
11246 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
11247
11248 2004-05-23 Paul Eggert <eggert@cs.ucla.edu>
11249
11250 Ensure that the C++ compiler used for testing actually works on a
11251 simple test program; if not, skip the C++-related tests. Problem
11252 reported by Vin Shelton in:
11253 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
11254
11255 * m4/cxx.m4: New file.
11256 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
11257 * tests/atlocal.in (BISON_CXX_WORKS): Add.
11258 * tests/local.at (AT_COMPILE_CXX): Use it.
11259
11260 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
11261
11262 * data/glr.c (yylloc): Output this macro even if locations are not
11263 being generated, as the GLR parser needs it even in that case.
11264 Problem reported by Troy A. Johnson
11265 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
11266
11267 * configure.ac (AC_INIT): Update to 1.875e.
11268
11269 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
11270
11271 * NEWS: Version 1.875d.
11272 * configure.ac (AC_INIT): Likewise.
11273 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
11274
11275 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
11276 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
11277 lalr1.cc runs afoul of the first, and the last two are no longer
11278 supported by GCC 3.4.0.
11279 * README: Mention GNU m4 1.4 or later; mention m4 patches.
11280 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
11281
11282 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
11283
11284 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
11285 unsigned int, for compatibility with latest gnulib hash module.
11286 * src/state.c (state_hash, state_hasher): Likewise.
11287 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
11288 * src/uniqstr.c (hash_uniqstr): Likewise.
11289
11290 2004-05-03 Paul Eggert <eggert@cs.ucla.edu>
11291
11292 * NEWS: Unescaped newlines are no longer allowed in char & strings.
11293
11294 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
11295 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
11296 character and string literals.
11297 (unexpected_end): New function.
11298 (unexpected_eof): Use it.
11299 (unexpected_newline): New function.
11300 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
11301 actions.
11302
11303 * NEWS: Document %expect-rr.
11304
11305 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
11306 Fix typo by replacing $1 with $option.
11307 Remove more 'intl'-related files.
11308 Don't DEFUN AM_INTL_SUBDIR twice.
11309
11310 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
11311 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
11312 strtoul.c.
11313 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
11314 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
11315 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
11316 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
11317 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
11318 * src/.cvsignore: Add *.output.
11319
11320 * src/parse-gram.y: Put copyright notice inside %{ %} so it
11321 gets copied to the output file.
11322
11323 2004-04-28 Paul Eggert <eggert@twinsun.com>
11324
11325 Get files from the gnulib and po repositories, instead of relying
11326 on them being in our CVS. Upgrade to latest versions of gnulib
11327 and Automake.
11328
11329 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
11330 * bootstrap: Bootstrap from gnulib and po repositories.
11331 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
11332 * README-cvs: Document these changes. Remove version numbers from
11333 mentions of build tools, since they change so often. Mention Flex.
11334
11335 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
11336 (gl_USE_SYSTEM_EXTENSIONS): Add.
11337 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
11338 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
11339 does this for us.
11340 (AC_ISC_POSIX): Remove; we no longer support this
11341 ancient OS, as it gets in the way of latest Autoconf & gnulib.
11342 (AC_HEADER_STDC): Remove: we now assume C89 or better.
11343 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
11344 Do not check for C89 headers, except for locale.h which is used
11345 by the Yacc library and must port to K&R hosts.
11346 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
11347 Do not check for C89 functions, except for setlocale which is
11348 used by the Yacc library.
11349 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
11350 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
11351 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
11352 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
11353 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
11354 AM_GNU_GETTEXT): Remove; now done by:
11355 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
11356 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
11357 for us.
11358
11359 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
11360 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
11361 Define to empty, as gnulib.mk will do the rest for us.
11362 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
11363 for us.
11364 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
11365 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
11366
11367 * src/files.c: Include gnulib's xstrndup.h.
11368
11369 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
11370 (REALLOC): Use xnrealloc, for likewise.
11371 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
11372 (strnlen, memrchr): Remove decls; functions no longer used.
11373 Include <stpcpy.h>.
11374
11375 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
11376 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
11377 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
11378 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
11379 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
11380 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
11381 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
11382 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
11383 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
11384 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
11385 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
11386 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
11387 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
11388 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
11389 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
11390 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
11391 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
11392 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
11393 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
11394 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
11395 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
11396 Remove, as these files are now generated automatically
11397 by bootstrap or automake.
11398
11399 * po/ChangeLog: Remove: all but one entry was a duplicate
11400 of this file, and I moved that 2000-11-02 entry here.
11401
11402 * config/.cvsignore: Add Makefile, depcomp, install-sh.
11403 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
11404 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
11405 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
11406 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
11407 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
11408 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
11409 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
11410 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
11411 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
11412 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
11413 xstrndup.h.
11414 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
11415 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
11416 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
11417 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
11418 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
11419 * src/.cvsignore: Remove *_.c.
11420
11421
11422 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
11423 support it. (The latest stable gzip doesn't.)
11424
11425 2004-04-27 Paul Eggert <eggert@twinsun.com>
11426
11427 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
11428 case, as stos_ is now used by destructors due to the 2004-02-09
11429 change.
11430
11431 Remove more K&R C support.
11432 * lib/libiberty.y (PARAMS): Remove. All uses removed.
11433 * lib/subpipe.c (errno): Remove decl.
11434 Include <stdlib.h> unconditionally.
11435 (EXIT_FAILURE): Remove macro.
11436 * src/complain.c (vfprintf, strerror): Remove.
11437 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
11438 unconditionally.
11439 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
11440 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
11441 (strchr, strspn, memchr): Remove decls.
11442 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
11443 unconditionally. Do not declare perror.
11444 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
11445 unconditionally.
11446
11447 * src/complain.c (_): Remove useless defn, as system.h defines this.
11448
11449 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
11450 with latest obstack.h.
11451 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
11452 to procedure types, as obstack.h now does that for us.
11453 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
11454
11455 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
11456 so that this include file can stand alone.
11457 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
11458 does this now. Include subpipe.h first after config.h, to
11459 test whether it can stand alone.
11460
11461 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
11462 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
11463 unused declaration.
11464
11465 * tests/synclines.at (%union synch line): Put a dummy member in
11466 the union, because empty unions aren't allowed in C. Caught
11467 by GCC 3.4.0.
11468
11469 2004-04-13 Jim Meyering <jim@meyering.net>
11470
11471 * src/conflicts.c (conflicts_print): Correct format string typo:
11472 use `%%' to produce literal `%'. (trivial change)
11473
11474 2004-03-30 Paul Eggert <eggert@twinsun.com>
11475
11476 * src/getargs.c (version): Update copyright year to 2004.
11477
11478 * data/c.m4 (b4_int_type): Use 'short int' rather than
11479 'short', and similarly for 'long', 'unsigned', etc.
11480 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
11481 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
11482 yy_yypstack, yydumpstack): Likewise.
11483 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
11484 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
11485 Likewise.
11486 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
11487 yy_stack_print, yyparse): Likewise.
11488 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
11489 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
11490 * lib/bitset.c (bitset_print): Likewise.
11491 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
11492 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
11493 * lib/bitsetv.c (bitsetv_dump): Likewise.
11494 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
11495 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
11496 Likewise.
11497 * src/LR0.c (allocate_itemsets): Likewise.
11498 * src/gram.h (rule_number, rule): Likewise.
11499 * src/lalr.h (goto_number): Likewise.
11500 * src/nullable.c (nullable_compute): Likewise.
11501 * src/output.c (prepare_rules): Likewise.
11502 * src/relation.c (relation_print, relation_digraph): Likewise.
11503 * src/relation.h (relation_node): Likewise.
11504 * src/state.h (state_number, transitions, errs, reductions,
11505 struct state): Likewise.
11506 * src/symtab.h (symbol_number, struct symbol): Likewise.
11507 * src/tables.c (vector_number, tally, action_number,
11508 default_goto, goto_actions): Likewise.
11509 * tests/existing.at (GNU Cim Grammar): Likewise.
11510 * tests/regression.at (Web2c Actions): Likewise.
11511
11512 * src/output.c (muscle_insert_short_int_table): Renamed from
11513 muscle_insert_short_table. All uses changed.
11514
11515 2004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
11516
11517 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
11518 (declaration): Replace expected_conflicts with expected_sr_conflicts.
11519 Add %expect-rr rule.
11520
11521 * src/scan-gram.l: Recognize %expect-rr.
11522
11523 * src/conflicts.h (expected_sr_conflicts): Rename from
11524 expected_conflicts.
11525 (expected_rr_conflicts): Declare.
11526
11527 * src/conflicts.c (expected_sr_conflicts): Rename from
11528 expected_conflicts.
11529 (expected_rr_conflicts): Define.
11530 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
11531 for GLR parsers.
11532 Use expected_sr_conflicts in place of expected_conflicts.
11533 Warn if expected_rr_conflicts used in non-GLR parser.
11534
11535 * doc/bison.texinfo: Add documentation for %expect-rr.
11536
11537 2004-03-08 Paul Eggert <eggert@gnu.org>
11538
11539 Add support for hex token numbers. Suggested by Odd Arild Olsen in
11540 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
11541
11542 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
11543 in lalr1.cc.
11544 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
11545 * src/scan-gram.l (scan_integer): New function.
11546 ({int}): Use it.
11547 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
11548 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
11549 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
11550 Say "long int", not "long", for uniformity with GNU style.
11551
11552 2004-02-25 Paul Eggert <eggert@twinsun.com>
11553
11554 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
11555 compilers. This fixes a problem with Intel's C++ compiler being
11556 chatty, reported by Guido Trentalancia in
11557 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
11558
11559 2004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
11560
11561 Support %destructor and merge error locations in lalr1.cc.
11562
11563 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
11564 (Parser::stos_): Define unconditionally.
11565 (Parser::destruct_): New method. Generate its body with
11566 b4_yydestruct_generate.
11567 (Parser::error_start_): New attribute.
11568 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
11569 token which are discarded.
11570 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
11571 error_start_ when erroneous token are discarded.
11572 (Parser::parse) <yyerrlab1>: Compute the location of the error
11573 token so that it covers all the discarded tokens.
11574 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
11575 it can be called with `%skeleton "lalr1.cc"', and do that.
11576
11577 2004-02-02 Paul Eggert <eggert@twinsun.com>
11578
11579 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
11580 $(top_srcdir)/lib and ../lib. This fixes a bug reported
11581 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
11582 There's no need to mention top_builddir since Automake does that
11583 for us.
11584 (INCLUDES): Remove, as Automake says it's obsolescent.
11585 Contents migrated into AM_CPPFLAGS as described above.
11586 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
11587
11588 2004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
11589
11590 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
11591 (yyreportSyntaxError): Handle case where lookahead token is
11592 YYEMPTY.
11593
11594 2004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11595
11596 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
11597 resulting parsers are compilable with C++.
11598
11599 2003-12-23 Paul Eggert <eggert@twinsun.com>
11600
11601 * config/depcomp, config/install-sh: Sync with Automake 1.8.
11602 * src/output.c (output_skeleton): Rename local var.
11603 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
11604 Bison tokens, as this runs afoul of the 2003-10-07 change that
11605 disallowed NUL bytes in character constants or string literals.
11606
11607 * tests/local.at: Require Autoconf 2.59's Autotest.
11608 * tests/testsuite.at: Don't include local.at, since we now assume
11609 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
11610 including it.
11611 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
11612 multiple inclusion warnings.
11613
11614 2003-12-02 Akim Demaille <akim@epita.fr>
11615
11616 * doc/bison.texinfo (How Can I Reset the Parser): More about start
11617 conditions.
11618 From Bruno Haible.
11619
11620 2003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
11621
11622 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
11623
11624 2003-10-07 Paul Eggert <eggert@twinsun.com>
11625
11626 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
11627 if testsuite doesn't exist.
11628
11629 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
11630 literals, unfortunately.
11631 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
11632 Complain about NUL bytes in character constants or string literals.
11633
11634 2003-10-05 Paul Eggert <eggert@twinsun.com>
11635
11636 * NEWS: Don't document %no-default-prec, as it's still
11637 too experimental.
11638 * doc/bison.texinfo: Document %no-default-prec only if
11639 the defaultprec flag is set. Normally it's not.
11640
11641 2003-10-04 Paul Eggert <eggert@twinsun.com>
11642
11643 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
11644 non-modifiable lvalue, instead of a modifiable one.
11645 * doc/bison.texinfo (Actions): Document that $$ can
11646 be assigned to. Do not claim that $$ and $N are
11647 array element references: user code should not rely on this.
11648
11649 2003-10-01 Paul Eggert <eggert@twinsun.com>
11650
11651 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
11652 (grammar_declaration): Use it.
11653 * src/scan-gram.l: New token %no-default-prec.
11654 * tests/conflicts.at: Revamp tests to use %no-default-prec.
11655 * NEWS, doc/bison.texinfo: Document the above.
11656
11657 2003-10-01 Akim Demaille <akim@epita.fr>
11658
11659 VCG no longer supports long_straight_phase.
11660
11661 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
11662 * src/print_graph.c (print_graph): Adjust.
11663
11664 2003-09-30 Frank Heckenbach <frank@g-n-u.de>
11665 and Paul Eggert <eggert@twinsun.com>
11666
11667 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
11668 Table of Symbols): Document %default-prec.
11669 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
11670 (grammar_declaration): Set default_prec on %default-prec.
11671 * src/scan-gram.l (%default-prec): New token.
11672 * src/reader.h (default_prec): New flag.
11673 * src/reader.c: Likewise.
11674 (packgram): Handle it.
11675 * tests/conflicts.at (%default-prec without %prec,
11676 %default-prec with %prec, %default-prec 1): New tests.
11677
11678 2003-09-30 Paul Eggert <eggert@twinsun.com>
11679
11680 * tests/testsuite.at: Include local.at, not input.at, fixing
11681 a typo in the 2003-08-25 patch.
11682
11683 2003-08-27 Akim Demaille <akim@epita.fr>
11684
11685 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
11686 GCC warnings.
11687
11688 2003-08-26 Akim Demaille <akim@epita.fr>
11689
11690 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
11691 "<\#" to avoid magic from Gnus when posting parts of this script.
11692
11693 2003-08-26 Akim Demaille <akim@epita.fr>
11694
11695 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
11696 (Parser::parse): here.
11697 Adjust: nerrs and errstatus is now replaced by...
11698 (Parser::nerrs_, Parser::errstatus_): New.
11699
11700 2003-08-25 Akim Demaille <akim@epita.fr>
11701
11702 * config/announce-gen, Makefile.cfg: New.
11703 * Makefile.am: Adjust.
11704 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
11705 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
11706
11707 2003-08-25 Akim Demaille <akim@epita.fr>
11708
11709 When reducing initial empty rules, Bison parser read an initial
11710 location that is not defined. This results in garbage, and that
11711 affects Bison's own parser. Therefore we need (i) to extend Bison
11712 to support a means to initialize this location, and (ii) to use
11713 this CVS Bison to fix CVS Bison's parser.
11714
11715 * src/reader.h, reader.c (epilogue_augment): Remove, replace
11716 with...
11717 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
11718 * src/parse-gram.y: Adjust.
11719 (%initial-action): New.
11720 (%error-verbose): Since we require CVS Bison, there is no reason
11721 not to use it.
11722 * src/scan-gram.l: Adjust.
11723 * src/Makefile.am (YACC): New, to make sure we use our own parser.
11724 * data/yacc.c (yyparse): Use b4_initial_action.
11725
11726 2003-08-25 Akim Demaille <akim@epita.fr>
11727
11728 * doc/bison.texinfo: Don't promote stdout for error messages.
11729
11730 2003-08-25 Akim Demaille <akim@epita.fr>
11731
11732 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
11733 From Alexandre Duret-Lutz.
11734
11735 2003-08-25 Akim Demaille <akim@epita.fr>
11736
11737 Version 1.875c.
11738
11739 2003-08-25 Akim Demaille <akim@epita.fr>
11740
11741 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
11742 Use them.
11743
11744 2003-08-25 Akim Demaille <akim@epita.fr>
11745
11746 * data/lalr1.cc (Parser::reduce_print_): New.
11747 Use it.
11748
11749 2003-08-25 Akim Demaille <akim@epita.fr>
11750
11751 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
11752 error recovery loops. This patch is based on
11753 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
11754 Also, augment the similarity between lalr1.cc and yacc.c.
11755 Note: the locations of error recovery rules are not correct yet.
11756
11757 * data/lalr1.cc: Comment changes to augment the similarity between
11758 lalr1.cc and yacc.c.
11759 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
11760 (yyerrlab1): Remove, but where it used to be (now the bottom part of
11761 yyerrlab), when hitting EOF, pop the whole stack here instead of
11762 merely falling thru the default error handling mechanism.
11763 (yyerrorlab): New label, with the old contents of YYERROR,
11764 plus the following change: pop the stack of rhs corresponding
11765 to the production that invoked YYERROR. That is how Yacc
11766 behaves (required by POSIX).
11767 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
11768 fail.
11769
11770 2003-08-25 Akim Demaille <akim@epita.fr>
11771
11772 Tune local.at so that people can "autom4te -l autotest calc.at -o
11773 calc" for instance, to extract a sub test suite.
11774
11775 * tests/testsuite.at: Move the initialization, Autotest version
11776 requirement, and AT_TESTED invocation into...
11777 * tests/local.at: here.
11778 * tests/testsuite.at: Include it for compatibility with Autoconf
11779 2.57.
11780 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
11781 be ignore.
11782
11783 2003-08-04 Paul Eggert <eggert@twinsun.com>
11784
11785 Rework code slightly to avoid gcc -Wtraditional warnings.
11786 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
11787 The returned value is now stored in *YY0. All callers changed.
11788 * src/output.c (merge_output): Adjust to the above change.
11789
11790 2003-07-26 Paul Eggert <eggert@twinsun.com>
11791
11792 * data/glr.c (YYASSERT): New macro.
11793 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
11794 yyresolveStates, yyprocessOneStack):
11795 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
11796 Derived from a suggestion by Frank Heckenbach.
11797
11798 2003-07-25 Paul Eggert <eggert@twinsun.com>
11799
11800 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
11801 for portability to K&R C (after ansi2knr, presumably). See
11802 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
11803 by Frank Heckenbach, though I have omitted the structure-initialization
11804 part of his glr-knr.diff patch since I recall that the Portable
11805 C Compiler didn't require that change.
11806
11807 Let the user specify how to allocate and free memory.
11808 Derived from a suggestion by Frank Heckenbach in
11809 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
11810 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
11811 All uses of free, malloc, realloc changed to use these macros,
11812 and unnecessary casts removed.
11813 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
11814
11815 2003-07-06 Matthias Mann <MatthiasMann@gmx.de>
11816
11817 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
11818 use s.empty() rather than s == "" to test for empty string; see
11819 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
11820 (trivial change)
11821
11822 2003-06-25 Akim Demaille <akim@epita.fr>
11823
11824 * config/depcomp, config/install-sh: Update from masters.
11825
11826 2003-06-20 Paul Eggert <eggert@twinsun.com>
11827
11828 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
11829 and return properly parenthesized result.
11830 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
11831 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
11832 Remove unnecessary parentheses from uses.
11833 * doc/bison.texinfo (Location Default Action): Describe the
11834 conventions for parentheses.
11835
11836 2003-06-19 Paul Eggert <eggert@twinsun.com>
11837
11838 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
11839 yyreportTree): Do not assume that size_t is the same width as int,
11840 when printing sizes. Print sizes using an unsigned format.
11841 Problem reported by Frank Heckenbach in
11842 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
11843
11844 Port to Forte Developer 7 C compiler.
11845 * data/glr.c (struct YYLTYPE): If locations are not being used,
11846 declare a single dummy member, as empty structs do not conform
11847 to the C standard.
11848 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
11849 the Forte Developer 7 C compiler complains that end-of-loop
11850 code is not reached.
11851
11852 2003-06-17 Paul Eggert <eggert@twinsun.com>
11853
11854 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
11855 avoid warnings from picky compilers about redefinition of PARAMS.
11856
11857 2003-06-17 Paul Eggert <eggert@twinsun.com>
11858
11859 Version 1.875b.
11860
11861 * NEWS: Document 1.875b.
11862
11863 * lib/bbitset.h: Do not include config.h; that's the includer's job.
11864 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
11865 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
11866 Don't use 'index' in comments, as it's a builtin fn on some hosts.
11867 * lib/bitset_stats.c: Include gettext.h unconditionally, as
11868 per recent gettext manual's suggestion.
11869 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
11870 Use prototypes, not old-style definitions.
11871 * lib/lbitset.c (lbitset_unused_clear): Likewise.
11872 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
11873 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
11874 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
11875 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
11876 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
11877 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
11878 vbitset_or_and_cmp, vbitset_copy): Likewise.
11879
11880 * lib/libiberty.h: Do not include config.h; that's the includer's job.
11881 Do not include <stdlib.h>.
11882 (PARAMS): Define unconditionally for C89.
11883 (ATTRIBUTE_NORETURN): Remove.
11884 (ATTRIBUTE_UNUSED): Define unconditionally.
11885
11886 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
11887 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
11888 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
11889 * lib/vbitset.c, lib/vbitset.h: New files.
11890 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
11891 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
11892 from libbitset.
11893
11894 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
11895 `How Can I Reset @code{yyparse}', since texinfo does not allow
11896 arbitrary @ in node names.
11897
11898 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
11899 shouldn't be needed according to the gettext 0.12.1 documentation
11900 but which seem to be needed anyway: codeset.m4 glibc21.m4
11901 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
11902 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
11903 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
11904
11905 * lib/.cvsignore: Add stdbool.h.
11906 * m4/.cvsignore: Add nls.m4, po.m4.
11907
11908 Upgrade to CVS gnulib.
11909 * stdbool_.h: File renamed from stdbool.h.in.
11910 * configure.ac (AM_STDBOOL_H): Invoke this instead of
11911 AC_HEADER_STDBOOL.
11912 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
11913 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
11914 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
11915 (MOSTLYCLEANFILES): New var.
11916 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
11917 (stdbool.h): New rule.
11918 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
11919 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
11920 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
11921 m4/quote.m4: Upgrade to today's gnulib.
11922
11923 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
11924 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
11925 the tests right now.
11926 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
11927 yyerror are declared before use; C99 requires this.
11928
11929 2003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11930
11931 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
11932 first.
11933 (yyrecoverSyntaxError): Correct the logic for setting and testing
11934 yyerrState.
11935 Correct comment on handling EOF.
11936 Allow states with only a default reduction, rather than failing
11937 (I can't quite reconstruct why these were not allowed before).
11938
11939 Fixes to avoid problem that $-N rules in GLR parsers can cause
11940 buffer overruns, corrupting state.
11941
11942 * src/output.c (prepare_rules): Output max_left_semantic_context
11943 definition.
11944 * src/reader.h (max_left_semantic_context): New variable declaration.
11945 * src/scan-gram.l (max_left_semantic_context): Define.
11946 (handle_action_dollar): Update max_left_semantic_context.
11947 * data/glr.c (YYMAXLEFT): New definition.
11948 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
11949 (yyresolveAction): Ditto.
11950
11951 Fixes to problems with location handling in GLR parsers reported by
11952 Frank Heckenbach (2003/06/05).
11953
11954 * data/glr.c (YYLTYPE): Make trivial if locations not used.
11955 (YYRHSLOC): Add parentheses, and define only if locations used.
11956 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
11957 locations not used.
11958 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
11959 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
11960
11961 * tests/cxx-type.at: Exercise location information; update tests
11962 to differentiate output with and without locations.
11963 Remove forward declarations of yylex and yyerror---caused errors
11964 because default YYLTYPE not yet defined.
11965 Change semantic actions to compute strings, rather than printing
11966 them directly (to test proper passing of semantics values). Change
11967 output to prefix notation and update test data and expected results.
11968 (yylex): Track locations.
11969 (stmtMerge): Return value rather than printing, and include arguments
11970 in value.
11971
11972 2003-06-03 Paul Eggert <eggert@twinsun.com>
11973
11974 Avoid warnings generated by GCC 2.95.4 when Bison is
11975 configured with --enable-gcc-warnings.
11976 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
11977 yy::]b4_parser_class_name[::translate_,
11978 yy::Stack::operator[] (unsigned),
11979 yy::Stack::operator[] (unsigned) const,
11980 yy::Slice::operator[] (unsigned),
11981 yy::Slice::operator[] (unsigned) const):
11982 Rename local vars to avoid warnings.
11983 * tests/glr-regression.at (Improper handling of embedded actions
11984 and $-N in GLR parsers): Remove unused local variable from yylex.
11985 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
11986 (void) as arg when not pure, since we now assume C89 when building
11987 Bison. Pacify GCC by using parameter.
11988
11989 2003-06-02 Paul Eggert <eggert@twinsun.com>
11990
11991 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
11992 yy::Location::lines, yy::Location::columns): Rename arguments
11993 to avoid shadowing; this removes a warning generated by GCC 3.3.
11994
11995 2003-06-01 Paul Eggert <eggert@twinsun.com>
11996
11997 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
11998 to g++, as GCC 3.3 complains if you do it.
11999 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
12000 everything that WARNING_CFLAGS has, except omit warnings
12001 not suitable for C++.
12002 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
12003 * tests/atlocal.in (CXXFLAGS): New var.
12004 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
12005
12006 Fix a GLR parser bug I reported in February; see
12007 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
12008 The problem was that GLR parsers did not conform to the C standard,
12009 because actions like { $1 = $2 + $3; } expanded to expressions
12010 that invoked YYFILL in separate subexpressions, and YYFILL assigned
12011 to a local variable. The C standard says that expressions
12012 like (var = f ()) + (var = f ()) have undefined behavior.
12013 Another problem was that GCC sometimes issues warnings that
12014 yyfill and its parameters are unused.
12015
12016 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
12017 as possibly unused.
12018 (yyfill): New function.
12019 (YYFILL): Use it.
12020 (yyuserAction): Change type of yynormal to bool, so that it matches
12021 the new yyfill signature. Mark it as possibly unused.
12022
12023
12024 Follow up on a bug I reported in February, where a Bison-generated
12025 parser can loop. Provide a test case and a fix for yacc.c. I
12026 don't have a fix for lalr1.cc or for glr.c, unfortunately.
12027 The original bug report is in:
12028 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
12029
12030 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
12031 macro's size was becoming unwieldy.
12032 (yyerrlab): Do not discard an empty lookahead symbol, as this
12033 might destroy garbage.
12034 (yyerrorlab): New label, with the old contents of YYERROR,
12035 plus the following change: pop the stack of rhs corresponding
12036 to the production that invoked YYERROR. That is how Yacc
12037 behaves, and POSIX requires this behavior.
12038 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
12039 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
12040 Define 'alarm' to do nothing if unistd.h is not available.
12041 Add a new rule "exp: '-' error;" to test the above change to
12042 data/yacc.c. Use 'alarm' to abort any test taking longer than
12043 10 seconds, as it's probably looping.
12044 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
12045 Also, the new yacc.c generates two fewer diagnostics for an
12046 existing test.
12047
12048 2003-05-24 Paul Eggert <eggert@twinsun.com>
12049
12050 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
12051 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
12052 This fixes a problem reported by John Bowman when the Compaq/HP
12053 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
12054 -ansi -Wall -gall).
12055 * data/yacc.c (union yyalloc): Likewise.
12056 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
12057
12058 Switch from 'int' to 'bool' where that makes sense.
12059
12060 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
12061 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
12062 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
12063 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
12064 Return or accept bool, not int. All callers changed.
12065 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
12066 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
12067 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
12068 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
12069 bitset_or_and_cmp_): Likewise.
12070 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
12071 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
12072 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
12073 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
12074 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
12075 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
12076 bitset_stats_or_and_cmp): Likewise.
12077 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
12078 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
12079 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
12080 ebitset_xor_cmp): Likewise.
12081 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
12082 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
12083 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
12084 lbitset_xor_cmp): Likewise.
12085 * lib/bbitset.h: Include <stdbool.h>.
12086 (struct bitset_vtable): The following members now return bool, not
12087 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
12088 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
12089 or_and_cmp).
12090 * src/conflicts.c (count_rr_conflicts): Likewise.
12091 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
12092 All uses changed.
12093 * lib/ebitset.c (ebitset_obstack_init): Likewise.
12094 * lib/lbitset.c (lbitset_obstack_init): Likewise.
12095 * src/getargs.c (debug_flag, defines_flag, locations_flag,
12096 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
12097 graph_flag): Likewise.
12098 * src/getargs.h (debug_flag, defines_flag, locations_flag,
12099 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
12100 graph_flag): Likewise.
12101 * src/output.c (error_verbose): Likewise.
12102 * src/output.h (error_verbose): Likewise.
12103 * src/reader.c (start_flag, typed): Likewise.
12104 * src/reader.h (typed): Likewise.
12105 * src/getargs.c (LOCATIONS_OPTION): New constant.
12106 (long_options, getargs): Use it.
12107 * src/lalr.c (build_relations): Use bool, not int.
12108 * src/nullable.c (nullable_compute): Likewise.
12109 * src/print.c (print_reductions): Likewise.
12110 * src/tables.c (action_row, pack_vector): Likewise.
12111 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
12112 * src/output.c (prepare): Use it.
12113 * src/output.c (token_definitions_output,
12114 symbol_destructors_output, symbol_destructors_output): Use string,
12115 not boolean integer, to keep track of whether to output separator.
12116 * src/print_graph.c (print_core): Likewise.
12117 * src/state.c (state_rule_lookaheads_print): Likewise.
12118
12119 * config/install-sh: Sync from automake 1.7.5.
12120
12121 2003-05-14 Paul Eggert <eggert@twinsun.com>
12122
12123 * src/parse-gram.y (rules_or_grammar_declaration): Require a
12124 semicolon after a grammar declaration, in the interest of possible
12125 future changes to the Bison input language.
12126 Do not allow a stray semicolon at the start of the grammar.
12127 (rhses.1): Allow one or more semicolons after any rule, including
12128 just before "|" as required by POSIX.
12129 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
12130 grammar.
12131
12132 2003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
12133
12134 %parse-param support for lalr1.cc.
12135
12136 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
12137 b4_cc_constructor_calls, b4_cc_constructor_call,
12138 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
12139 definitions.
12140 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
12141 parse-param arguments.
12142 (yy::b4_parser_class_name): Declare instance variables to
12143 hold parse-param arguments.
12144 * tests/calc.at: s/value/semantic_value/ because value clashes
12145 with a member of yy::b4_parser_class_name. Adjust C++ code
12146 to handle %parse-param. Enable %parse-param test in C++.
12147
12148 2003-05-12 Paul Eggert <eggert@twinsun.com>
12149
12150 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
12151 English a bit. Fix fclose typo. Change "const char" to "char
12152 const", and use ANSI C rather than K&R for "main". Suggest
12153 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
12154 and suggest yy_switch_to_buffer.
12155
12156 2003-05-05 Paul Eggert <eggert@twinsun.com>
12157
12158 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
12159 C89. This avoids a diagnostic on compilers that define __STDC__
12160 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
12161 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
12162
12163 2003-05-03 Paul Eggert <eggert@twinsun.com>
12164
12165 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
12166 Do not overrun array bounds.
12167 This should fix a bug reported today by Olatunji Oluwabukunmi in
12168 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
12169
12170 2003-04-29 Akim Demaille <akim@epita.fr>
12171
12172 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
12173 * src/getargs.c, src/getargs.h: here, as bool, not int.
12174 (nondeterministic_parser): New.
12175 * src/parse-gram.y, src/scan-gram.l: Support
12176 %nondeterministic-parser.
12177 * src/output.c (prepare): Use nondeterministic_parser instead
12178 of glr_parser where appropriate.
12179 * src/tables.c (conflict_row, action_row, save_row)
12180 (token_actions, token_actions, pack_vector): Ditto.
12181
12182 2003-04-29 Akim Demaille <akim@epita.fr>
12183
12184 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
12185
12186 2003-04-29 Akim Demaille <akim@epita.fr>
12187
12188 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
12189 with %pure-parser and %locations to exercise the patch from Yakov
12190 Markovitch below.
12191
12192 2003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
12193
12194 * data/yacc.c: (b4_lex_param): Corrected for the case where
12195 %lex-param is provided and %pure-parser isn't.
12196
12197 2003-04-27 Paul Eggert <eggert@twinsun.com>
12198
12199 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
12200 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
12201 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
12202 if it is not defined.
12203 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
12204
12205 2003-04-26 Paul Eggert <eggert@twinsun.com>
12206
12207 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
12208 Declare to be of type suitable for the ninf value itself, not of
12209 type suitable for the corresponding table, since the latter might
12210 be unsigned but the ninf value might be negative. This fixes a
12211 bug reported by Alexandre Duret-Lutz in
12212 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
12213
12214 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
12215 invokes it. We shouldn't invoke it twice because it will attempt
12216 to put error.o in the archive twice. This fixes a glitch reported
12217 by Martin Mokrejs in
12218 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
12219
12220 2003-04-21 Paul Eggert <eggert@twinsun.com>
12221
12222 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
12223 to gnulib.
12224
12225 2003-04-21 Yakov Markovitch <Markovitch@iso.ru>
12226
12227 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
12228 Fix obvious typo that results in uncompilable GLR parsers
12229 when both %pure-parser and %locations are used. (trivial change)
12230
12231 2003-04-17 Paul Eggert <eggert@twinsun.com>
12232
12233 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
12234 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
12235 Do not insert the expected token via unput, as this runs afoul
12236 of a POSIX-compatibility bug in flex 2.5.31.
12237 All uses changed to BEGIN the parent state,
12238 since we no longer insert the expected token via unput.
12239 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
12240 that is no longer emitted after the above change.
12241
12242 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
12243 the first one. This change is from Paul Hilfinger, and it fixes
12244 regression reported by Werner Lemberg in
12245 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
12246
12247 (resolve_sr_conflict): Don't invoke state_errs_set
12248 unless one or more tokens have been explicitly made errors.
12249 Otherwise, the above change causes Bison to abort.
12250
12251 * tests/existing.at (GNU pic Grammar): New test case, taken from
12252 Lemberg's email.
12253
12254 2003-03-31 Akim Demaille <akim@epita.fr>
12255
12256 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
12257
12258 2003-03-31 Akim Demaille <akim@epita.fr>
12259
12260 * src/output.c (prepare_symbols): Avoid trailing spaces in the
12261 output.
12262
12263 2003-03-31 Akim Demaille <akim@epita.fr>
12264
12265 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
12266 From Paul Hilfinger.
12267
12268 2003-03-29 Akim Demaille <akim@epita.fr>
12269
12270 * m4/error.m4: Do not put under dynamic conditions some code which
12271 expansion is under static control.
12272
12273 2003-03-29 Akim Demaille <akim@epita.fr>
12274
12275 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
12276
12277 2003-03-29 Akim Demaille <akim@epita.fr>
12278
12279 * doc/bison.texinfo (Strings are Destroyed): New.
12280
12281 2003-03-13 Paul Eggert <eggert@twinsun.com>
12282
12283 * .cvsignore: Add configure.lineno.
12284 * src/.cvsignore: Add yacc.
12285 * tests/.cvsignore: Add testsuite.log.
12286 * doc/fdl.texi: Sync with latest FSF version.
12287
12288 2003-03-12 Paul Eggert <eggert@twinsun.com>
12289
12290 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
12291 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
12292 cursor, instead of leaving it undefined. This fixes a bug
12293 reported by Tim Van Holder in
12294 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
12295 * tests/input.at (Torturing the Scanner): Test the scanner on
12296 an empty input file, which was Tim Van Holder's test case.
12297
12298 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
12299 <sys/resource.h> can be included, include sys/time.h and
12300 sys/times.h first, if available. This works around the SunOS
12301 4.1.4 porting bug reported by Bruce Becker in
12302 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
12303
12304 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
12305 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
12306 AC_HEADER_SYS_WAIT.
12307
12308 Merge changes from gnulib. This was prompted because the CVS
12309 snapshot didn't build on Solaris 7 due to strnlen problems.
12310
12311 These changes need to be merged back into gnulib:
12312 * lib/hash.c: Include <stdbool.h> unconditionally.
12313 * m4/onceonly.m4 (m4_quote): New macro.
12314 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
12315 Quote AC_FOREACH variable-expansions properly.
12316 The 2003-01-03 obstack.h change also needs merging.
12317 {end of changes requiring merging}
12318
12319 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
12320 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
12321 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
12322 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
12323 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
12324 New files, imported from gnulib.
12325 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
12326 above.
12327
12328 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
12329 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
12330 gnulib sources.
12331
12332 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
12333 Add.
12334 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
12335 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
12336 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
12337 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
12338 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
12339 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
12340 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
12341 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
12342 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
12343 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
12344 (jm_PREREQ_ARGMATCH): Remove.
12345 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
12346 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
12347
12348 * src/system.h: Include <stdbool.h> unconditionally.
12349
12350 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
12351 assuming at least C89 in the bitset code for some time now.
12352
12353 2003-03-03 Akim Demaille <akim@epita.fr>
12354
12355 * ro.po: New.
12356
12357 2003-03-02 Akim Demaille <akim@epita.fr>
12358
12359 * doc/bison.texinfo (Table of Symbols): Reactivate the
12360 documentation for %lex-param, and %parse-param.
12361
12362 2003-03-02 Akim Demaille <akim@epita.fr>
12363
12364 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
12365 generate verbose error messages.
12366 Use the number of tokens as an upper bound in yytname, as it
12367 cannot be a non terminal.
12368
12369 2003-03-02 Akim Demaille <akim@epita.fr>
12370
12371 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
12372 message.
12373
12374 2003-03-02 Akim Demaille <akim@epita.fr>
12375
12376 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
12377 Use them to exercise yycheck overrun.
12378 Based on Andrew Suffield's grammar.
12379
12380 2003-03-02 Akim Demaille <akim@epita.fr>
12381
12382 Create tests/local.at for Bison generic testing macros.
12383
12384 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
12385 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
12386 This new file.
12387 * tests/calc.at (AT_CHECK_CALC): Adjust.
12388 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
12389 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
12390 * tests/local.at: here.
12391 (AT_COMPILE_CXX): Tags the tests using it as c++.
12392 Ignore the test if CXX is not functional.
12393
12394 2003-03-01 Paul Eggert <eggert@twinsun.com>
12395
12396 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
12397 not loc->end, since loc->end might contain garbage and this leads
12398 to undefined behavior on some platforms.
12399 (id_loc, token_start): Use (IF_LINTed) initial values that do not
12400 depend on *loc, so that the reader doesn't give the the false
12401 impression that *loc is initialized.
12402 (<INITIAL>"%%"): Do not bother setting code_start, since its value
12403 does not survive the return.
12404
12405 2003-03-01 Akim Demaille <akim@epita.fr>
12406
12407 * src/scan-gram.l (code_start): Always initialize it when entering
12408 into yylex, as SC_EPILOGUE is activated *before* the corresponding
12409 yylex invocation. An alternative would be making it static, but
12410 then it starts with the second %%'s beginning, instead of its end.
12411
12412 2003-02-28 Paul Eggert <eggert@twinsun.com>
12413
12414 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
12415 around a UnixWare 7.1.1 porting bug reported by John Hughes in
12416 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
12417
12418 2003-02-26 Paul Eggert <eggert@twinsun.com>
12419
12420 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
12421 Remove Sequent/Pyramid discussion (nobody uses them any more).
12422 Merge VMS and MS-DOS discussion; these ports may well be dead
12423 but let's keep mentioning them for now. Put <> around email
12424 addresses. Add copyright notice.
12425
12426 2003-02-24 Paul Eggert <eggert@twinsun.com>
12427
12428 * data/glr.c (yy_reduce_print): yylineno -> yylno,
12429 to avoid collision with flex use of yylineno.
12430 Problem reported by Bruce Lilly in
12431 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
12432 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
12433 * data/yacc.c (yy_reduce_print): Likewise.
12434
12435 * config/depcomp: Sync with Automake 1.7.3.
12436
12437 2003-02-21 Akim Demaille <akim@epita.fr>
12438
12439 * data/lalr1.cc: Use temporary variables instead of casts to
12440 change integer types.
12441 Suggested by Paul Eggert.
12442
12443 2003-02-21 Akim Demaille <akim@epita.fr>
12444
12445 * doc/bison.texinfo: Use "location" consistently to refer to @n,
12446 to avoid confusions with lalr1.cc's notion of Position.
12447 Suggested by Paul Eggert.
12448
12449 2003-02-20 Akim Demaille <akim@epita.fr>
12450
12451 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
12452 before initial_columns.
12453 (location.hh): Use consistent variable names when defining the
12454 operator<<.
12455 Use "last" so that we subtract from Positions, not from unsigned.
12456
12457 2003-02-20 Akim Demaille <akim@epita.fr>
12458
12459 * data/lalr1.cc (position.hh): New subfile, including the extended
12460 and Doxygen'ed documentation of class Position.
12461 (location.hh): Use it.
12462 Document a` la Doxygen.
12463 With the help of Benoit Perrot.
12464
12465 2003-02-20 Akim Demaille <akim@epita.fr>
12466
12467 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
12468 AT_YACC_IF.
12469 Redefine AT_YYERROR_SEES_LOC_IF using it.
12470 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
12471 not defined.
12472 Don't use the location in yy::Parser::error_ and
12473 yy::Parser::print_ when not %locations.
12474 Activate more lalr1.cc tests.
12475
12476 2003-02-19 Akim Demaille <akim@epita.fr>
12477
12478 * data/lalr1.cc: When displaying a line number, be sure to make it
12479 an int.
12480
12481 2003-02-19 Akim Demaille <akim@epita.fr>
12482
12483 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
12484 Remove, useless.
12485 (YYABORT, YYACCEPT, YYERROR): New.
12486 * tests/calc.at: Renable the lalr1.cc test.
12487
12488 2003-02-19 Akim Demaille <akim@epita.fr>
12489
12490 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
12491 error recovery, mixing with/without pops and discarding of the
12492 lookahead.
12493 Exercise YYERROR.
12494 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
12495
12496 2003-02-17 Paul Eggert <eggert@twinsun.com>
12497
12498 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
12499 * tests/testsuite.at (AT_COMPILE): Use them.
12500 This fixes the testsuite problem reported by Robert Lentz in
12501 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
12502
12503 2003-02-12 Paul Eggert <eggert@twinsun.com>
12504
12505 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
12506 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
12507 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
12508 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
12509 Check for malloc failure, for consistency with yacc.c.
12510 (yytname_size): Remove, for consistency with yacc.c.
12511
12512 The bug still remains in data/lalr1.cc, as I didn't have time
12513 to fix it there.
12514
12515 2003-02-06 Akim Demaille <akim@epita.fr>
12516
12517 * configure.ac (GXX): Rename as...
12518 (CXX): this, to keep the original Autoconf semantics.
12519 Require 2.57.
12520 * data/lalr1.cc: Fix b4_copyright invocations.
12521 If YYDEBUG is not defined, don't depend upon name_ being defined.
12522 (location.hh): Include string and iostream.
12523 (Position::filename): New member.
12524 (Position::Position ()): New.
12525 (operator<< (Position)): New.
12526 (operator- (Position, int)): New.
12527 (Location::first, Location::last): Rename as...
12528 (Location::begin, Location::end): these, to mock the conventional
12529 iterator names.
12530 (operator<< (Location)): New.
12531 * tests/atlocal.in (CXX): New.
12532 * tests/testsuite.at (AT_COMPILE_CXX): New.
12533 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
12534 locations in a more synthetic way.
12535 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
12536 lalr1.cc is used.
12537 Adjust the C locations to match those from Emacs: first column is
12538 column 0.
12539 Change all the expected results.
12540 Conform to the GCS: simplify the locations when applicable.
12541 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
12542 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
12543 these CPP macros with the m4 macros new defined by...
12544 (AT_CHECK_PUSHDEFS): this, i.e.:
12545 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
12546 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
12547 New macros.
12548 (AT_CHECK_POPDEFS): Undefine them.
12549 (AT_CHECK_CALC_LALR1_CC): New.
12550 Use it for the first lalr1.cc test.
12551
12552 2003-02-04 Akim Demaille <akim@epita.fr>
12553
12554 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
12555 Location as is defined.
12556
12557 2003-02-04 Akim Demaille <akim@epita.fr>
12558
12559 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
12560 name_ being defined.
12561
12562 2003-02-03 Paul Eggert <eggert@twinsun.com>
12563
12564 * src/gram.h (start_symbol): Remove unused decl.
12565
12566 Use more-consistent naming conventions for local vars.
12567
12568 * src/derives.c (derives_compute): Change type of local var from
12569 int to rule_number.
12570 * src/gram.c (grammar_rules_partial_print): Likewise.
12571 * src/print.c (print_core): Likewise.
12572 * src/reduce.c (reduce_grammar_tables): Likewise.
12573
12574 * src/gram.c (grammar_dump): Change name of item_number *
12575 local var from r to rp.
12576 * src/nullable.c (nullable_compute): Likewise.
12577
12578 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
12579
12580 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
12581 for symbol or symbol_number var.
12582 * src/reader.c (grammar_start_symbol_set): Likewise.
12583 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
12584 Likewise.
12585 * src/state.c (transitions_to): Likewise.
12586 * src/state.h: Likewise.
12587 * src/tables.c (symbol_number_to_vector_number): Likewise.
12588
12589 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
12590 char * var.
12591
12592 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
12593 var.
12594
12595 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
12596 var.
12597
12598 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
12599 Use str, not s, for char * var. Use ch, not c, for character var.
12600 Use size for size var.
12601
12602 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
12603 char * var.
12604 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
12605 uniqstr var.
12606 * src/uniqstr.h: Likewise.
12607
12608 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
12609 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
12610 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
12611 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
12612 param to have same name as that of enum, so that we don't use
12613 "s" to stand for a non-state.
12614
12615 2003-02-02 Akim Demaille <akim@epita.fr>
12616
12617 * src/scan-skel.l: Scan more than one inert character per yylex
12618 invocation.
12619
12620 2003-02-01 Paul Eggert <eggert@twinsun.com>
12621
12622 Version 1.875a.
12623
12624 * po/LINGUAS: Add ms.
12625
12626 2003-01-30 Akim Demaille <akim@epita.fr>
12627
12628 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
12629
12630 2003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12631
12632 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
12633 of $1.
12634
12635 Changes in response to error report by S. Eken: GLR mode does not
12636 handle negative $ indices or $ indices in embedded rules correctly.
12637 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
12638
12639 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
12640 (b4_rhs_location): Ditto.
12641 (yyfill): New function to copy from stack tree into array
12642 incrementally.
12643 (yyuserAction): Modify to allow incremental move of semantic values
12644 to rhs array when in GLR mode.
12645 Define YYFILL to use in user-defined actions to fill semantic array
12646 as needed.
12647 Remove dummy use of yystack, as there is now a guaranteed use.
12648 (yydoAction): Modify to allow incremental move of semantic values
12649 to rhs array when in GLR mode.
12650 (yyresolveAction): Ditto.
12651 (yyglrShiftDefer): Update comment.
12652 (yyresolveStates): Use X == NULL for pointers, not !X.
12653 (yyglrReduce): Ditto.
12654 (yydoAction): Ditto
12655
12656 * tests/glr-regr1.at: Rename to ...
12657 * tests/glr-regression.at: Add new regression test for the problems
12658 described above (adapted from S. Eken).
12659 Update copyright notice.
12660 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
12661 * tests/Makefile.am: Ditto.
12662
12663 2003-01-28 Paul Eggert <eggert@twinsun.com>
12664
12665 * data/lalr1.cc: Do not use @output_header_name@ unless
12666 b4_defines_flag is set. This fixes two bugs reported by
12667 Tim Van Holder in
12668 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
12669 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
12670
12671 2003-01-21 Paul Eggert <eggert@twinsun.com>
12672
12673 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
12674 we don't need to worry about yyerrlab1 being reported as an
12675 "unused label" by non-GCC C compilers. The downside is that if
12676 locations are used then a couple of statements are duplicated each
12677 time YYERROR is invoked, but the upside is that the warnings
12678 should vanish.
12679 (yyerrlab1): Move code to YERROR.
12680 (yyerrlab2): Remove. Change uses back to yyerrlab1.
12681 This reverts some of the 2002-12-27 change.
12682
12683 2003-01-17 Paul Eggert <eggert@twinsun.com>
12684
12685 * src/output.c (symbol_printers_output): Fix typo that led
12686 to core dump. Problem reported by Antonio Rus in
12687 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
12688
12689 2003-01-13 Akim Demaille <akim@epita.fr>,
12690 Quoc Peyrot <chojin@lrde.epita.fr>,
12691 Robert Anisko <anisko_r@lrde.epita.fr>
12692
12693 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
12694 when the stacks contain one element, as the loop would otherwise
12695 free the last state, and then use the top state (the one we just
12696 popped). This means that the initial elements will not be freed
12697 explicitly, as is the case in yacc.c; it is not a problem, as
12698 these elements have fake values.
12699
12700 2003-01-11 Paul Eggert <eggert@twinsun.com>
12701
12702 * NEWS: %expect-violations are now just warnings, reverting
12703 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
12704 bootstrapping problem reported by Matthias Klose; see
12705 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
12706 * src/conflicts.c (conflicts_print): Likewise.
12707 * tests/conflicts.at (%expect not enough, %expect too much,
12708 %expect with reduce conflicts): Likewise.
12709 * doc/bison.texinfo (Expect Decl): Document this. Also mention
12710 that the warning is enabled if the number of conflicts changes
12711 (not necessarily increases).
12712
12713 * src/getargs.c (version): Update copyright year.
12714
12715 2003-01-09 Akim Demaille <akim@epita.fr>
12716
12717 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
12718
12719 2003-01-08 Paul Eggert <eggert@twinsun.com>
12720
12721 * Makefile.maint (WGETFLAGS):
12722 New macro, containing "-C off" to disable proxy caches.
12723 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
12724 (rel-check): Use $(WGET) instead of wget.
12725
12726 2003-01-06 Paul Eggert <eggert@twinsun.com>
12727
12728 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
12729 the GLR paper of Scott, Johnstone and Hussain.
12730
12731 2003-01-04 Paul Eggert <eggert@twinsun.com>
12732
12733 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
12734 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
12735 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
12736 (EXTRA_LIBRARIES): New var, for liby.a.
12737 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
12738 (EXTRA_SCRIPTS): New var, for yacc.
12739
12740 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
12741 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
12742 Problem reported by Nelson H. F. Beebe.
12743
12744 2003-01-03 Paul Eggert <eggert@twinsun.com>
12745
12746 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
12747 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
12748 when compiling Bison 1.875's `bitset bset = obstack_alloc
12749 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
12750
12751 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
12752 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
12753 grow to a huge size with typical invocation.
12754
12755 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
12756 Use the pattern recommended by Autoconf 2.57, except also protect
12757 against double-definition.
12758 * src/system.h: Likewise.
12759 Portability issues reported by Nelson H. F. Beebe.
12760
12761 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
12762 All uses changed. Provide a definition in both C and C++.
12763 (yytrue, yyfalse): Define even if defined (__cplusplus).
12764
12765 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
12766 Reported by Nelson H. F. Beebe.
12767
12768 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
12769
12770 2003-01-02 Paul Eggert <eggert@twinsun.com>
12771
12772 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
12773 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
12774 Bug reported by Nelson H. F. Beebe.
12775
12776 2003-01-01 Paul Eggert <eggert@twinsun.com>
12777
12778 * Version 1.875.
12779
12780 2002-12-30 Paul Eggert <eggert@twinsun.com>
12781
12782 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
12783 Moved here from...
12784 (<INITIAL>","): Here. This causes stray "," to be treated
12785 more uniformly.
12786
12787 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
12788 last brace in braced code when not in Yacc mode, for compatibility
12789 with Bison 1.35. This resurrects the 2001-12-15 patch to
12790 src/reader.c.
12791
12792 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
12793 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
12794
12795 2002-12-28 Paul Eggert <eggert@twinsun.com>
12796
12797 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
12798 that of SYM's type. This fixes Debian bug 168069, reported by
12799 Thomas Olsson.
12800
12801 2002-12-28 Paul Eggert <eggert@twinsun.com>
12802
12803 Version 1.75f.
12804
12805 Switch back to the Yacc style of conflict reports, undoing some
12806 of the 2002-07-30 change.
12807 * doc/bison.texinfo (Understanding): Use Yacc style for
12808 conflict reports. Also, use new way of locating rules.
12809 * src/conflicts.c (conflict_report):
12810 Renamed from conflict_report_yacc, removing the old
12811 'conflict_report'. Translate the entire conflict report at once,
12812 so that we don't assume that "," has the same interpretation in
12813 all languages.
12814 (conflicts_output): Use Yacc-style conflict report for each state,
12815 instead of our more-complicated style.
12816 (conflicts_print): Use Yacc-style conflict report, except print
12817 the input file name when not emulating Yacc.
12818 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
12819 Conflicted Reduction, %expect not enough, %expect too much,
12820 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
12821 * tests/existing.at (GNU Cim Grammar): Likewise.
12822 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
12823
12824 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
12825 fatal): Don't invoke fflush; it's not needed and it might even be
12826 harmful for stdout, as stdout might not be open.
12827 * src/reduce.c (reduce_print): Likewise.
12828
12829 2002-12-27 Paul Eggert <eggert@twinsun.com>
12830
12831 Fix a bug where error locations were not being recorded correctly.
12832 This problem was originally reported by Paul Hilfinger in
12833 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
12834
12835 * data/yacc.c (yyparse): New local var yylerrsp, to record the
12836 top of the location stack's error locations.
12837 (yyerrlab): Set it. When discarding a token, push its location
12838 onto yylerrsp so that we don't lose track of the error's end.
12839 (yyerrlab1): Now is only the target of YYERROR, so that we can
12840 properly record the location of the action that failed. For GCC
12841 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
12842 GCC warning about yyerrlab1 being unused if YYERROR is unused.
12843 (yyerrlab2): New label, which yyerrlab now falls through to.
12844 Compute the error's location by applying YYLLOC_DEFAULT to
12845 the locations of all the symbols that went into the error.
12846 * doc/bison.texinfo (Location Default Action): Mention that
12847 YYLLOC_DEFAULT is also invoked for syntax errors.
12848 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
12849 Error locations include the locations of all the tokens that were
12850 discarded, not just the last token.
12851
12852 2002-12-26 Paul Eggert <eggert@twinsun.com>
12853
12854 * src/files.c: Include quote.h.
12855 (compute_output_file_names): Warn if we detect conflicting
12856 outputs to the same file. This should catch the misunderstanding
12857 exemplified by Debian Bug 165349, reported by Bruce Stephens..
12858
12859 * src/conflicts.c (conflicts_print): If the user specifies
12860 "%expect N", report an error if there are any reduce/reduce
12861 conflicts. This is what the manual says should happen.
12862 This fixes Debian bug 130890, reported by Anthony DeRobertis.
12863 * tests/conflicts.at (%expect with reduce conflicts): New test.
12864
12865 Don't use m4_include on relative file names, as it doesn't work as
12866 desired if there happens to be a file with that name under ".".
12867
12868 * m4sugar/version.m4: Remove; it was included but it wasn't used.
12869 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
12870 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
12871 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
12872 * src/output.c (output_skeleton): Use full path names when
12873 specifying a file to include; don't rely on include path, as
12874 it's unreliable when the working file contains a file with
12875 that name.
12876
12877 2002-12-25 Paul Eggert <eggert@twinsun.com>
12878
12879 Remove obsolete references to bison.simple and bison.hairy.
12880 Problem mentioned by Aubin Mahe in
12881 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
12882 * data/glr.c: Comment fix.
12883 * doc/bison.1: Remove references. Also, mention "yacc".
12884
12885 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
12886 with -g option.
12887
12888 * src/parse-gram.y (declaration): Use enum "report_states" rather
12889 than its numeric value 1.
12890
12891 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
12892 opening a new one. This fixes Debian bug 165349, reported by
12893 Bruce Stephens.
12894
12895 2002-12-24 Paul Eggert <eggert@twinsun.com>
12896
12897 Version 1.75e.
12898
12899 * Makefile.maint (cvs-update): Don't assume that the shell
12900 supports $(...), as Solaris sh doesn't.
12901
12902 * src/parse-gram.y (lloc_default): Remove test for empty
12903 nonterminals at the end, since it didn't change the result.
12904
12905 2002-12-24 Paul Eggert <eggert@twinsun.com>
12906
12907 If the user does not define YYSTYPE as a macro, Bison now declares it
12908 using typedef instead of defining it as a macro. POSIX requires this.
12909 For consistency, YYLTYPE is also declared instead of defined.
12910
12911 %union directives can now have a tag before the `{', e.g., the
12912 directive `%union foo {...}' now generates the C code
12913 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
12914 The default union tag is `YYSTYPE', for compatibility with Solaris 9
12915 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
12916 instead of `yyltype'.
12917
12918 `yystype' and `yyltype' are now obsolescent macros instead of being
12919 typedefs or tags; they are no longer documented and will be
12920 withdrawn in a future release.
12921
12922 * data/glr.c (b4_location_type): Remove.
12923 (YYSTYPE): Renamed from yystype.
12924 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
12925 (struct YYLTYPE): Renamed from struct yyltype.
12926 (YYLTYPE): Renamed from yyltype.
12927 (yyltype, yystype): New (and obsolescent) macros,
12928 for backward compatibility.
12929 * data/yacc.c: Likewise.
12930
12931 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
12932 does not specify a union tag. This is for compatibility with
12933 Solaris 9 yacc.
12934
12935 * src/parse-gram.y (add_param): 2nd arg is now char * not char
12936 const *, since it is now modified by stripping surrounding { }.
12937 (current_braced_code): Remove.
12938 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
12939 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
12940 trailing " {...}". Now of type <chars>.
12941 (grammar_declaration): Adjust to bundled tokens.
12942 (code_content): Remove; stripping is now done by add_param.
12943 (print_token_value): Print contents of bundled tokens.
12944 (token_name): New function.
12945
12946 * src/reader.h (braced_code, current_braced_code): Remove.
12947 (token_name): New decl.
12948
12949 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
12950 token_type, not braced_code code_kind. All uses changed.
12951 (SC_PRE_CODE): New state, for scanning after a keyword that
12952 has (or usually has) an immediately-following braced code.
12953 (token_type): New local var, to keep track of which token type
12954 to return when scanning braced code.
12955 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
12956 <INITIAL>"%parse-param", <INITIAL>"%printer",
12957 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
12958 instead of returning a token type immediately.
12959 (<INITIAL>"{"): Set token type.
12960 (<SC_BRACED_CODE>"}"): Use it.
12961 (handle_action_dollar, handle_action_at): Now returns bool
12962 indicating success. Fail if ! current_rule; this prevents a core dump.
12963 (handle_symbol_code_dollar, handle_symbol_code_at):
12964 Remove; merge body into caller.
12965 (handle_dollar, handle_at): Complain in invalid contexts.
12966
12967 * NEWS, doc/bison.texinfo: Document the above.
12968 * NEWS: Fix years and program names in copyright notice.
12969
12970 2002-12-17 Paul Eggert <eggert@twinsun.com>
12971
12972 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
12973 Reporting, Table of Symbols): Omit mentions of %lex-param and
12974 %parse-param from the documentation for now.
12975
12976 2002-12-15 Paul Eggert <eggert@twinsun.com>
12977
12978 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
12979 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
12980 lookahead symbol, and which sets yychar in parser actions) and it
12981 disagreed with the Bison documentation. Bug
12982 reported by Andrew Walrond.
12983
12984 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
12985 as the caller now does that.
12986 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
12987 (YYEMPTY): Parenthesize right hand side, since others use it.
12988 (yyparse): Don't assume that our generated code is the only code
12989 that sets yychar.
12990
12991 2002-12-13 Paul Eggert <eggert@twinsun.com>
12992
12993 Version 1.75d.
12994
12995 POSIX requires a "yacc" command.
12996 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
12997 (MOSTLYCLEANFILES): Add yacc.
12998 (yacc): New rule.
12999 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
13000 as an alias for bison y.
13001
13002 * po/LINGUAS: Add da.
13003
13004 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
13005 problem with latest <getopt.h>.
13006 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
13007
13008 * doc/fdl.texi: Upgrade to 1.2.
13009 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
13010 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
13011 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
13012 gnulib.
13013 * config/install-sh: Sync with autotools.
13014
13015 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
13016 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
13017 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
13018 locations are requested.
13019 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
13020 locations are requested.
13021
13022 2002-12-12 Paul Eggert <eggert@twinsun.com>
13023
13024 Remove unportable casts and storage allocation tricks.
13025 While we're at it, remove almost all casts, since they
13026 usually aren't needed and are a sign of trouble.
13027
13028 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
13029
13030 * src/derives.c (derives_compute): Do not subtract NTOKENS from
13031 the pointer DSET returned by malloc; this isn't portable.
13032 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
13033 Similarly for DERIVES.
13034 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
13035 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
13036 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
13037
13038 * src/derives.c (derives_compute): Do not bother invoking
13039 int_of_rule_number, since rule numbers are integers.
13040
13041 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
13042 rather than XMALLOC (char, N).
13043
13044 * src/files.c (filename_split): Rewrite to avoid cast.
13045
13046 * src/gram.h (symbol_number_as_item_number,
13047 item_number_as_symbol_number, rule_number_as_item_number,
13048 item_number_as_rule_number):
13049 Now inline functions rather than macros, to avoid casts.
13050 * src/state.h (state_number_as_int): Likewise.
13051 * src/tables.c (state_number_to_vector_number,
13052 symbol_number_to_vector_number): Likewise.
13053
13054 * src/gram.h (int_of_rule_number): Remove; no longer used.
13055
13056 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
13057 since the resulting storage is always stored into.
13058
13059 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
13060 where it's needed.
13061
13062 * src/muscle_tab.c (muscle_m4_output):
13063 Now inline. Return bool, not int.
13064 * src/state.c (state_compare): Likewise.
13065 * src/symtab.c (symbol_check_defined,
13066 symbol_check_alias_consistency, symbol_pack, symbol_translation,
13067 hash_compare_symbol, hash_symbol):
13068 Likewise.
13069 * src/uniqstr.c (uniqstr_print): Likewise.
13070 * src/muscle_tab.c (muscle_m4_output_processor):
13071 New function, to avoid casts.
13072 * src/state.c (state_comparator, stage_hasher): Likewise.
13073 * src/symtab.c (symbol_check_defined_processor,
13074 symbol_check_alias_consistency_processor, symbol_pack_processor,
13075 symbol_translation_processor, hash_symbol_comparator,
13076 hash_symbol_hasher): Likewise.
13077 * src/uniqstr.c (uniqstr_print_processor): Likewise.
13078 * src/muscle_tab.c (muscles_m4_output):
13079 Use new functions instead of casting old functions unportably.
13080 * src/state.c (state_hash_new): Likewise.
13081 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
13082 symbols_token_translations_init):
13083 Likewise.
13084 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
13085
13086 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
13087 var instead of casting to long, to avoid casts.
13088 (prepare_states): Use MALLOC rather than alloca, so that we don't
13089 have to worry about alloca.
13090 * src/state.c (state_hash_lookup): Likewise.
13091
13092 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
13093 local var instead of casting to unsigned char, to avoid casts.
13094
13095 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
13096 STATE_ALLOC): Remove.
13097 (transitions_new, errs_new, reductions_new, state_new): Use malloc
13098 rather than calloc, and use offsetof to avoid allocating slightly
13099 too much storage.
13100 (state_new): Initialize all members.
13101
13102 * src/state.c (state_hash): Use unsigned accumulator, not signed.
13103
13104 * src/symtab.c (symbol_free): Remove; unused.
13105 (symbol_get): Remove cast in lhs of assignment.
13106 (symbols_do): Now static. Accept generic arguments, not
13107 hashing-related ones.
13108
13109 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
13110 (symbol_processor): Remove.
13111 (symbols_do): Remove decl; now static.
13112
13113 * src/system.h (alloca): Remove; decl no longer needed.
13114 (<stddef.h>): Include, for offsetof.
13115 (<inttypes.>, <stdint.h>): Include if available.
13116 (uintptr_t): New type, if system lacks it.
13117 (CALLOC, MALLOC, REALLOC): New macros.
13118 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
13119 new macros.
13120
13121 * src/tables.c (table_size): Now int, to pacify GCC.
13122 (table_grow, table_ninf_remap): Use signed table size.
13123 (save_row): Don't bother initializing locals when not needed.
13124 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
13125 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
13126
13127 * src/vcg.h: Correct misspellings.
13128
13129 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
13130
13131
13132 * src/getargs.c (getargs): Don't assume EOF == -1.
13133
13134 2002-12-09 Paul Eggert <eggert@twinsun.com>
13135
13136 Change identifier spellings to avoid collisions with names
13137 that are reserved by POSIX.
13138
13139 Don't use names ending in _t, since POSIX reserves them.
13140 For consistency, remove _e and _s endings -- they're weren't
13141 needed to remove ambiguity. All uses changed.
13142 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
13143 turn was just renamed from struniq_t.
13144 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
13145 which in turn was just renamed from struniq_processor_t.
13146 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
13147 in turn was renamed from hash_compare_struniq_t.
13148 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
13149 (state_list): Renamed from state_list_t.
13150 * src/assoc.h (assoc): Renamed from assoc_t.
13151 * src/conflicts.c (enum conflict_resolution): Renamed from
13152 enum conflict_resolution_e.
13153 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
13154 (rule_list): Renamed from rule_list_t.
13155 * src/getargs.h (enum trace): Renamed from enum trace_e.
13156 (enum report): Renamed from enum report_e.
13157 * src/gram.h (item_number): Renamed from item_number_t.
13158 (rule_number): Renamed from rule_number_t.
13159 (struct rule_s): Remove the "rule_s" part; not used.
13160 (rule): Renamed from rule_t.
13161 (rule_filter): Renamed from rule_filter_t.
13162 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
13163 (goto_list): Renamed from goto_list_t.
13164 * src/lalr.h (goto_number): Renamed from goto_number_t.
13165 * src/location.h (location): Renamed from location_t.
13166 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
13167 and moved here from:
13168 * src/muscle_tab.h (muscle_entry_t): here.
13169 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
13170 (rule_list): Renamed from rule_list_t.
13171 * src/print_graph.c (static_graph): Renamed from graph.
13172 * src/reader.h (braced_code): Renamed from braced_code_t.
13173 Remove brace_code_e tag.
13174 * src/relation.h (relation_node): Renamed from relation_node_t.
13175 (relation_nodes): Renamed from relation_nodes_t.
13176 (relation): Renamed from relation_t.
13177 * src/state.h (state_number): Renamed from state_number_t.
13178 (struct state): Renamed from struct state_s.
13179 (state): Renamed from state_t.
13180 (transitions): Renamed from transitions_t. Unused (and
13181 misspelled) transtion_s tag removed.
13182 (errs): Renamed from errs_t. Unused errs_s tag removed.
13183 (reductions): Renamed from reductions_t. Unused tag
13184 reductions_s removed.
13185 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
13186 (struct symbol_list): Renamed from struct symbol_list_s.
13187 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
13188 (struct symbol): Renamed from struct symbol_s.
13189 (symbol): Renamed from symbol_t.
13190 * src/tables.c (vector_number): Renamed from vector_number_t.
13191 (action_number): Renamed from action_t.
13192 * src/tables.h (base_number): Renamed from base_t.
13193 * src/vcg.h (enum color): Renamed from enum color_e.
13194 (enum textmode): Renamed from enum textmode_e.
13195 (enum shape): Renamed from enum shape_e.
13196 (struct colorentry): Renamed from struct colorentry_s.
13197 (struct classname): Renamed from struct classname_s.
13198 (struct infoname): Renamed from struct infoname_s.
13199 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
13200 (enum decision): Renamed from enum decision_e.
13201 (enum orientation): Renamed from enum orientation_e.
13202 (enum alignment): Renamed from enum alignment_e.
13203 (enum arrow_mode): Renamed from enum arrow_mode_e.
13204 (enum crossing_type): Renamed from enum crossing_type_e.
13205 (enum view): Renamed from enum view_e.
13206 (struct node): Renamed from struct node_s.
13207 (node): Renamed from node_t.
13208 (enum linestyle): Renamed from enum linestyle_e.
13209 (enum arrowstyle): Renamed from enum arrowstyle_e.
13210 (struct edge): Renamed from struct edge.
13211 (edge): Renamed from edge_t.
13212 (struct graph): Renamed from struct graph_s.
13213 (graph): Renamed from graph_t.
13214 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
13215 Rename value_t -> value.
13216 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
13217 value_t_as_yystype -> value_as_yystype.
13218
13219 Don't include <errno.h> in the mainstream code, since it
13220 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
13221 * lib/get-errno.c, lib/get-errno.h: New files.
13222 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
13223 get-errno.c.
13224 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
13225 * src/output.c (output_skeleton): Likewise.
13226 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
13227 instead of errno.
13228 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
13229 Likewise.
13230 (handle_action_dollar, handle_action_at): Likewise.
13231 * src/system.h: Do not include <errno.h>.
13232 (TAB_EXT): Renamed from EXT_TAB.
13233 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
13234
13235 Avoid str[a-z]*, since <string.h> reserves that name space.
13236 Change all instances of "struniq" in names to "uniqstr", and
13237 likewise for "STRUNIQ" and "UNIQSTR".
13238 * src/uniqstr.c: Renamed from src/struniq.c.
13239 * src/uniqstr.h: Renamed from src/struniq.h.
13240 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
13241 * src/files.c (strsuffix): Remove; unused.
13242 (concat2): Renamed from stringappend. Now static.
13243 * src/files.h (strsuffix, stringappend): Remove; unused.
13244 * src/parse-gram.y (<chars>): Renamed from <string>.
13245 (<uniqstr>): Renamed from <struniq>.
13246 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
13247 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
13248 (struct graph_s.expand): Renamed from struct graph_s.stretch.
13249 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
13250 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
13251 (N_EXPAND): Renamed from N_STRETCH.
13252
13253 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
13254 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
13255 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
13256 Remove; unused.
13257 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
13258 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
13259 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
13260 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
13261 (BASE_MAXIMUM): Renamed from BASE_MAX.
13262 (BASE_MINIMUM): Renamed from BASE_MIN.
13263 (ACTION_MAX): Remove; unused.
13264 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
13265 Unnecessary casts removed from above defines.
13266
13267
13268 Fix misspelling in names.
13269 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
13270 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
13271 G_NODE_ALIGNEMENT.
13272
13273
13274 * lib/timevar.c (timevar_report): Renamed from time_report,
13275 for consistency with other names.
13276 * lib/timevar.h (timevar_report): New decl.
13277 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
13278
13279
13280 Sort include-file uses.
13281
13282 Reorder all include files under src to be in the order "system.h".
13283 then the ../lib include files in angle brackets (alphabetized),
13284 then the . include files in double-quotes (alphabetized). Fix
13285 dependency breakages encountered in this process, as follows:
13286 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
13287 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
13288 * src/state.h: Include "symtab.h".
13289
13290 2002-12-08 Paul Eggert <eggert@twinsun.com>
13291
13292 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
13293 since this causes problems when __file__ contains character
13294 sequences like "@" that are treated specially by src/scan-skel.l.
13295 Instead, just use the file's basename. This fixes the bug
13296 reported by Martin Mokrejs in
13297 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
13298
13299 2002-12-06 Paul Eggert <eggert@twinsun.com>
13300
13301 Add support for rules that do not have trailing semicolons, as
13302 POSIX requires. Improve the quality of locations in Bison
13303 diagnostics.
13304
13305 * src/location.c: Include <quotearg.h>.
13306 (empty_location): Now const.
13307 (location_print): New function. Follow the recommendation of the
13308 GNU Coding Standards for locations that span file boundaries.
13309 * src/location.h: Do not include <quotearg.h>; no longer needed.
13310 (boundary): New type.
13311 (location_t): Use it. This allows locations to span file boundaries.
13312 All member uses changed: file -> start.file or end.file (as needed),
13313 first_line -> start.line, first_column -> start.column,
13314 last_line -> end.line, last_column -> end.column.
13315 (equal_boundaries): New function.
13316 (LOCATION_RESET, LOCATION_STEP): Remove.
13317 (LOCATION_PRINT): Remove. All callers changed to use location_print.
13318 (empty_location): Now const.
13319 (location_print): New decl.
13320 * src/parse-gram.y (lloc_default): New function, which handles
13321 empty locations more accurately.
13322 (YYLLOC_DEFAULT): Use it.
13323 (%token COLON): Remove.
13324 (%token ID_COLON): New token.
13325 (rules): Use it.
13326 (declarations, rules): Remove trailing semicolon.
13327 (declaration, rules_or_grammar_declaration):
13328 Allow empty (";") declaration.
13329 (symbol_def): Remove empty actions; no longer needed.
13330 (rules_or_grammar_declaration): Remove trailing semicolon.
13331 (semi_colon.opt): Remove.
13332 * src/reader.h: Include location.h.
13333 (scanner_cursor): New decl.
13334 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
13335 rolling our own.
13336 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
13337 of *loc.
13338 (STEP): Remove. No longer needed, now that adjust_location does
13339 the work. All uses removed.
13340 (scanner_cursor): New var.
13341 (adjust_location): Renamed from extend_location. It now sets
13342 *loc and adjusts the scanner cursor. All uses changed.
13343 Don't bother testing for CR.
13344 (handle_syncline): Remove location arg; now updates scanner cursor.
13345 All callers changed.
13346 (unexpected_end_of_file): Now accepts start boundary of token or
13347 comment, not location. All callers changed. Update scanner cursor,
13348 not the location.
13349 (SC_AFTER_IDENTIFIER): New state.
13350 (context_state): Renamed from c_context. All uses changed.
13351 (id_loc, code_start, token_start): New local vars.
13352 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
13353 processing of Yacc white space and equivalents here.
13354 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
13355 instead of returning ID immediately, since we need to search for
13356 a subsequent colon.
13357 (<INITIAL>"'", "\""): Save token_start.
13358 (<INITIAL>"%{", "{", "%%"): Save code_start.
13359 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
13360 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
13361 BEGIN context_state at end, not INITIAL.
13362 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
13363 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
13364 Return correct token start.
13365 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
13366 the start of a character, string or multiline comment is found.
13367 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
13368 Reduction): Adjust reported locations to match the more-precise
13369 results now expected.
13370 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
13371 * tests/reduce.at (Useless Rules, Reduced Automaton,
13372 Underivable Rules): Likewise.
13373 * tests/regression.at (Invalid inputs): No longer `expecting ";"
13374 or "|"' now that so many other tokens are allowed by the new grammar.
13375
13376 * src/complain.h (current_file): Remove duplicate decl;
13377 current_file is now owned by files.h.
13378 * src/complain.c, src/scan-gram.l: Include files.h.
13379
13380 2002-12-06 Paul Eggert <eggert@twinsun.com>
13381
13382 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
13383 promotes to int; it might be unsigned int.
13384 * data/yacc.c (yy_reduce_print): Likewise.
13385
13386 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
13387 be #defined in the prologue, not in the Bison declarations.
13388 This fixes Debian Bug 102878, reported by Shaul Karl.
13389
13390 2002-12-02 Paul Eggert <eggert@twinsun.com>
13391
13392 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
13393 * lib/strtoul.c: New file, from gnulib.
13394 This fixes a porting bug reported by Peter Klein in
13395 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
13396
13397 2002-11-30 Paul Eggert <eggert@twinsun.com>
13398
13399 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
13400 and put only a forward declaration in the prologue. This is for
13401 consistency with the other scanner helper functions.
13402
13403 Type clashes now generate warnings, not errors, since it
13404 appears that POSIX may allow some grammars with type clashes.
13405 * src/reader.c (grammar_current_rule_check): Warn about
13406 type clashes instead of complaining.
13407 * tests/input.at (Type Clashes): Expect warnings, not complaints.
13408
13409 Add Yacc library, since POSIX requires it.
13410 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
13411 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
13412 * lib/main.c, lib/yyerror.c: New files.
13413
13414 gram_error can be static; it need not be extern.
13415 * src/reader.h (gram_error): Remove decl.
13416 * src/parse-gram.y (gram_error): Now static. Add static decl.
13417 (print_token_value): Omit parameter names from forward decl,
13418 for consistency.
13419
13420 2002-11-29 Paul Eggert <eggert@twinsun.com>
13421
13422 * doc/bison.texinfo: Emphasize that yylex and yyerror must
13423 be declared before being used. E.g., one should typically
13424 declare them in the prologue. Use GNU coding style in examples.
13425 Put "const" consistently after the type it modifies. Mention
13426 that C99 supports "inline". Mention that yyerror traditionally
13427 returns "int".
13428
13429 %parse-param and %lex-param now take just one argument, the
13430 declaration; the argument name is deduced from the declaration.
13431
13432 * doc/bison.texinfo (Parser Function, Pure Calling, Error
13433 Reporting, Table of Symbols): Document this.
13434 * src/parse-gram.y (add_param): New function.
13435 (COMMA): Remove.
13436 (declaration): Implement new rule for %parse-param and %lex-param.
13437 * src/scan-gram.l: "," now elicits a warning, rather than being
13438 a token; this is more compatible with byacc.
13439 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
13440
13441 2002-11-27 Paul Eggert <eggert@twinsun.com>
13442
13443 Rename identifiers to avoid real and potential collisions.
13444
13445 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
13446 to avoid collision with lex macro described by Bruce Lilly in
13447 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
13448 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
13449 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
13450 * src/parse-gram.y (print_token_value): Renamed from yyprint.
13451 All uses changed.
13452 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
13453 The name "yycontrol" violates the name space rules, and this stuff
13454 wasn't being used anyway.
13455 (input): Remove action; this stuff wasn't being used.
13456 (gram_error): Rename local variable yylloc -> loc.
13457 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
13458 (YY_DECL): Don't use "yy" at start of local variables.
13459 All uses changed, e.g., yylloc -> loc.
13460 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
13461 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
13462 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
13463 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
13464
13465 * src/parse-gram.y (gram_error): loc is now const *.
13466 * src/reader.h (gram_error): Likewise.
13467
13468 2002-11-24 Paul Eggert <eggert@twinsun.com>
13469
13470 Version 1.75c.
13471
13472 * tests/actions.at (Actions after errors): Use an output format
13473 more similar to that of the Printers and Destructors test.
13474 Test the position of the ';' token too.
13475 (Printers and Destructors): Likewise.
13476 (Printers and Destructors: %glr-parser): Remove for now, to avoid
13477 unnecessarily alarming people when the test fails.
13478
13479 * data/yacc.c (yyerrlab1): Move this label down, so that the
13480 parser does not discard the lookahead token if the user code
13481 invokes YYERROR. This change is required for POSIX conformance.
13482
13483 * lib/error.c: Sync with gnulib.
13484
13485 2002-11-22 Paul Eggert <eggert@twinsun.com>
13486
13487 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
13488 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
13489 * lib/xmalloc.c: Likewise.
13490
13491 2002-11-20 Paul Eggert <eggert@twinsun.com>
13492
13493 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
13494
13495 2002-11-20 Paul Eggert <eggert@twinsun.com>
13496
13497 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
13498 should use `if (! x) abort ();' rather than `assert (x);', and
13499 anyway it's one less thing to worry about configuring.
13500
13501 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
13502 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
13503 and replace all instances of assert with abort.
13504 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
13505 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
13506
13507 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
13508 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
13509 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
13510 hash_find_entry, hash_rehash, hash_insert): Likewise.
13511 * src/conflicts.c (resolve_sr_conflict): Likewise.
13512 * src/lalr.c (set_goto_map, map_goto): Likewise.
13513 * src/nullable.c (nullable_compute): Likewise.
13514 * src/output.c (prepare_rules, token_definitions_output): Likewise.
13515 * src/reader.c (packgram, reader): Likewise.
13516 * src/state.c (state_new, state_free, state_transitions_set,
13517 state_reduction_find): Likewise.
13518 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
13519 symbol_pack): Likewise.
13520 * src/tables.c (conflict_row, pack_vector): Likewise.
13521 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
13522 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
13523 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
13524 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
13525
13526 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
13527 (ARGMATCH_CONSTRAINT): New macro.
13528 (ARGMATCH_ASSERT): Use it.
13529
13530 * src/system.h (verify): New macro.
13531 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
13532 rather than assert.
13533 * src/tables.c (tables_generate): Likewise.
13534
13535 * src/struniq.c (struniq_assert): Now returns void, and aborts
13536 if the assertion is false.
13537 (struniq_assert_p): Remove.
13538 * src/struniq.h: Likewise.
13539
13540 2002-11-18 Paul Eggert <eggert@twinsun.com>
13541
13542 * data/glr.c (yygetLRActions): Replace `yyindex' with
13543 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
13544 This fixes the regression with Sun ONE Studio 7 cc that I reported in
13545 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
13546
13547 2002-11-18 Akim Demaille <akim@epita.fr>
13548
13549 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
13550 space.
13551 From Tim Van Holder.
13552
13553 2002-11-17 Paul Eggert <eggert@twinsun.com>
13554
13555 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
13556 to "SyntaxError" for consistency with my 2002-11-15 change.
13557
13558 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
13559 not define to {}, since this breaks the common use of `YYDPRINTF
13560 ((...));' if a single statement is desired (e.g. before `else').
13561 Work around GCC warnings by surrounding corresponding calls with
13562 {} if needed.
13563 (yyhasResolvedValue): Remove unused function.
13564 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
13565 loop body.
13566 (yyreportSyntaxError): Renamed from yyreportParseError.
13567 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
13568 All uses changed.
13569 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
13570 extern when possible. Remove unused initializations.
13571
13572 2002-11-16 Akim Demaille <akim@epita.fr>
13573
13574 Augment the similarity between GLR and LALR traces.
13575
13576 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
13577 (YY_REDUCE_PRINT): New.
13578 (yyparse): Use them.
13579 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
13580 YYDPRINT here.
13581 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
13582 state reached after the reduction/recovery, since...
13583 (yyparse, yyprocessOneStack): Report the state we are entering in.
13584
13585 2002-11-16 Akim Demaille <akim@epita.fr>
13586
13587 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
13588 Add support for --trace=skeleton.
13589 * src/scan-skel.l: %option debug.
13590 Scan strings of non-@ or \n instead of character by character.
13591 (scan_skel): Handle trace_skeleton.
13592 (QPUTS): New.
13593 (@output_parser_name@, @output_header_name@): ``Restore'' their
13594 support (used to be M4 macros).
13595 * data/yacc.c: Quote larger chunks, a la glr.c.
13596 * data/lalr1.cc: Likewise.
13597 The header guards are no longer available, so use some other
13598 string than `YYLSP_NEEDED'.
13599
13600 2002-11-16 Akim Demaille <akim@epita.fr>
13601
13602 Make the ``Printers and Destructors'' test more verbose, taking
13603 `yacc.c''s behavior as (possibly wrong) reference.
13604
13605 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
13606 instead of fprint on stdout.
13607 Set and report the last_line of the symbols.
13608 Consistently display values and locations.
13609
13610 2002-11-16 Paul Eggert <eggert@twinsun.com>
13611
13612 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
13613
13614 2002-11-15 Paul Eggert <eggert@twinsun.com>
13615
13616 * tests/actions.at (Actions after errors): New test case.
13617
13618 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
13619 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
13620 tests/action.at, tests/calc.at, tests/conflicts.at,
13621 tests/cxx-type.at, tests/regression.at:
13622 "parse error" -> "syntax error" for POSIX compatibility.
13623 "parsing stack overflow..." -> "parser stack overflow" so
13624 that code matches Bison documentation.
13625
13626 2002-11-15 Akim Demaille <akim@epita.fr>
13627
13628 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
13629 take two BRACED_CODE, not two string_content.
13630 Free the scanner's obstack when we are done.
13631 (code_content): New.
13632 * tests/calc.at: Adjust.
13633 * doc/bison.texinfo: Adjust.
13634 Also, make sure to include the `,' for these declarations.
13635
13636 2002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
13637
13638 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
13639 definition; avoids potential autoreconf problems.
13640
13641 2002-11-15 Akim Demaille <akim@epita.fr>
13642
13643 Always check the value returned by yyparse.
13644
13645 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
13646 returned by yyparse.
13647 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
13648 Adjust calls.
13649 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
13650 returned by yyparse.
13651
13652 2002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13653
13654 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
13655 on input.at test.
13656
13657 2002-11-14 Paul Eggert <eggert@twinsun.com>
13658
13659 * src/output.c (output_skeleton): Call xfopen instead of
13660 duplicating xfopen's body.
13661
13662 Fix bugs reported by Nelson H. F. Beebe in
13663 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
13664
13665 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
13666 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
13667 Group compiler. Instead, use "$CC -E bar.c". Include the .h
13668 file twice in the grammar, as an extra check.
13669
13670 * tests/input.at (Torturing the Scanner): Surround the
13671 backslash-newline tests with "#if 0", to make it less likely that
13672 we'll run into compiler bugs. Bring back solitary \ inside
13673 comment, but add a closing comment to work around HP C bug. Don't
13674 test backslash-newline in C character constant.
13675
13676 2002-11-14 Akim Demaille <akim@epita.fr>
13677
13678 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
13679 status of the compiler.
13680 Calling `exit 1' is no longer needed.
13681 Reported by Nelson H. F. Beebe.
13682
13683 2002-11-14 Akim Demaille <akim@epita.fr>
13684
13685 * tests/atlocal.in (CPPFLAGS): We have config.h.
13686 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
13687 New.
13688 * tests/actions.at, tests/calc.at, tests/conflicts.at,
13689 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
13690 * tests/regression.at, tests/torture.at: Use them for all the
13691 grammars that are to be compiled.
13692 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
13693 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
13694 * doc/bison.texinfo (GLR Parsers): Document `inline'.
13695
13696 2002-11-14 Akim Demaille <akim@epita.fr>
13697
13698 * doc/bison.texinfo: Various formatting changes (alignments in
13699 samples, additional @group/@end group, GCS in samples.
13700 Use @deffn instead of simple @table to define the directives,
13701 macros, variables etc.
13702
13703 2002-11-13 Paul Eggert <eggert@twinsun.com>
13704
13705 Fix some bugs reported by Albert Chin-A-Young in
13706 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
13707
13708 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
13709 -o c"; the HP C compiler chatters during compilation.
13710 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
13711 * tests/headers.at (export YYLTYPE): Likewise.
13712
13713 * tests/input.at (Torturing the Scanner): Remove lines containing
13714 solitary backslashes, as they tickle a bug in the HP C compiler.
13715
13716 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
13717 comments, since they're not portable. Use GNU coding style.
13718
13719 2002-11-13 Akim Demaille <akim@epita.fr>
13720
13721 * data/yacc.c: Leave bigger chunks of quoted text.
13722 (YYDSYMPRINTF): New.
13723 Use it to report symbol activities.
13724 * data/glr.c (YYDSYMPRINTF): New.
13725 Use it.
13726
13727 2002-11-12 Paul Eggert <eggert@twinsun.com>
13728
13729 Version 1.75b.
13730
13731 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
13732 (yyglrReduce): Return yyok, not 0.
13733 This should avoid the enumerated-type warnings reported
13734 by Nelson H. F. Beebe in
13735 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
13736
13737 * lib/bbitset.h (BITSET_INLINE): Remove.
13738 * lib/bitset.h [! BITSET_INLINE]: Remove.
13739 (bitset_set, bitset_reset, bitset_test): Rename local vars
13740 to avoid shadowing warnings by GCC.
13741
13742 * data/glr.c (inline): Remove #define. It's the user's
13743 responsibility to #define it away, just like 'const'.
13744 This fixes one of the bugs reported by Nelson H. F. Beebe in
13745 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
13746
13747 * Makefile.maint (po-check): Scan .l and .y files instead of the
13748 .c and the .h files that they generate. This fixes the bug
13749 reported by Tim Van Holder in:
13750 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
13751 Look for N_ as well as for _. Try to avoid matching #define for
13752 N_ and _.
13753 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
13754 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
13755 * src/scan-gram.l: Revamp regular expressions so that " and '
13756 do not confuse xgettext.
13757
13758 * src/struniq.h (struniq_new): Do not declare the return type
13759 to be 'const'; this violates the C standard.
13760 * src/struniq.c (struniq_new): Likewise.
13761
13762 2002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
13763
13764 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
13765 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
13766 linker.
13767
13768 2002-11-12 Akim Demaille <akim@epita.fr>
13769
13770 * Makefile.maint: Sync with Autoconf:
13771 (local_updates): New.
13772
13773 2002-11-12 Akim Demaille <akim@epita.fr>
13774
13775 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
13776
13777 2002-11-12 Akim Demaille <akim@epita.fr>
13778
13779 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
13780 locations.
13781
13782 2002-11-12 Akim Demaille <akim@epita.fr>
13783
13784 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
13785 not yyvalue.
13786
13787 2002-11-12 Akim Demaille <akim@epita.fr>
13788
13789 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
13790 Use it to test the GLR parser.
13791
13792 2002-11-12 Akim Demaille <akim@epita.fr>
13793
13794 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
13795 defines it.
13796 * data/glr.c (yystos): New.
13797 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
13798 (YYDSYMPRINT): New.
13799 (yyval): Don't define it, it is handled via M4.
13800 (yyrecoverParseError): Free verbosely the discarded symbols.
13801 * data/yacc.c (yysymprint): Remove, rather...
13802 (b4_yysymprint_generate): invoke.
13803 * data/c.m4 (b4_yysymprint_generate): New.
13804 Accept pointers as arguments, as opposed to the version from
13805 yacc.c.
13806 (b4_yydestruct_generate): Likewise.
13807 * tests/cations.at (Printers and Destructors): Use Bison directives
13808 instead of CPP macros.
13809 Don't rely on internal details.
13810
13811 2002-11-12 Akim Demaille <akim@epita.fr>
13812
13813 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
13814 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
13815 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
13816 it against YYEMPTY and so forth), work on yytoken (i.e., set
13817 it to YYEMPTY etc.).
13818 (yydestruct): Replace with a b4_yydestruct_generate invocation.
13819 (b4_symbol_actions): Remove.
13820 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
13821 for 0, end-of-input.
13822
13823 2002-11-12 Akim Demaille <akim@epita.fr>
13824
13825 * doc/bison.texinfo (Destructor Decl): New.
13826
13827 2002-11-12 Akim Demaille <akim@epita.fr>
13828
13829 * src/tables.c (tables_generate): Use free for pointers that
13830 cannot be NULL, not XFREE.
13831 (pack_vector): Use assert, not fatal, for bound violations.
13832 * src/state.c (state_new): Likewise.
13833 * src/reader.c (reader): Likewise.
13834 * src/lalr.c (set_goto_map): Likewise.
13835 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
13836 the file name.
13837
13838 2002-11-12 Akim Demaille <akim@epita.fr>
13839
13840 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
13841 Restore.
13842 * src/scan-gram.l (last_string): Is global to the file, not to
13843 yylex.
13844 * src/parse-gram.y (input): Don't append the epilogue here,
13845 (epilogue.opt): do it here, and free the scanner's obstack.
13846 * src/reader.c (epilogue_set): Rename as...
13847 (epilogue_augment): this.
13848 * data/c.m4 (b4_epilogue): Defaults to empty.
13849
13850 2002-11-12 Akim Demaille <akim@epita.fr>
13851
13852 * src/getargs.c (long_options): Remove duplicates.
13853 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
13854 Remove.
13855 * doc/bison.rnh: Remove.
13856 * doc/bison.texinfo (VMS Invocation): Remove.
13857
13858 2002-11-12 Akim Demaille <akim@epita.fr>
13859
13860 * src/struniq.h, src/struniq.c (struniq_t): Is const.
13861 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
13862
13863 Use struniq for symbols.
13864
13865 * src/symtab.h (symbol_t): The tag member is a struniq.
13866 (symbol_type_set): Adjust.
13867 * src/symtab.c (symbol_new): Takes a struniq.
13868 (symbol_free): Don't free the tag member.
13869 (hash_compare_symbol_t, hash_symbol_t): Rename as...
13870 (hash_compare_symbol, hash_symbol): these.
13871 Use the fact that tags as struniqs.
13872 (symbol_get): Use struniq_new.
13873 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
13874 Returns a strniq.
13875 * src/reader.h (merger_list, grammar_currentmerge_set): The name
13876 and type members are struniqs.
13877 * src/reader.c (get_merge_function)
13878 (grammar_current_rule_merge_set): Adjust.
13879 (TYPE, current_type): Are struniq.
13880
13881 Use struniq for file names.
13882
13883 * src/files.h, src/files.c (infile): Split into...
13884 (grammar_file, current_file): these.
13885 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
13886 * src/reduce.c (reduce_print): Likewise.
13887 * src/getargs.c (getargs): Likewise.
13888 * src/complain.h, src/complain.c: Likewise.
13889 * src/main.c (main): Call struniqs_new early enough to use it for
13890 file names.
13891 Don't free the input file name.
13892
13893 2002-11-12 Akim Demaille <akim@epita.fr>
13894
13895 * src/symtab.c (symbol_free): Remove dead deactivated code:
13896 type_name are properly removed.
13897 Don't use XFREE to free items that cannot be NULL.
13898 * src/struniq.h, src/struniq.c: New.
13899 * src/main.c (main): Initialize/free struniqs.
13900 * src/parse-gram.y (%union): Add astruniq member.
13901 (yyprint): Adjust.
13902 * src/scan-gram.l (<{tag}>): Return a struniq.
13903 Free the obstack bit that used to store it.
13904 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
13905
13906 2002-11-11 Paul Eggert <eggert@twinsun.com>
13907
13908 Revamp to fix many (but not all) of the C- and M4-related quoting
13909 problems. Among other things, this fixes the Bison bug reported
13910 by Jan Hubicka when processing the Bash grammar; see:
13911 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
13912
13913 Use new @ escapes consistently. Represent brackets with @{ and @}
13914 rather than @<:@ and @:>@, since this works a bit better with dumb
13915 editors like vi. Represent @ with @@, since @ is now consistently
13916 an escape. Use @oline@ and @ofile@ rather than __oline__ and
13917 __ofile__, to avoid unexpected expansions. Similarly, use @output
13918 rather than #output.
13919
13920 * data/c.m4 (b4_copyright): Omit file name from comment, since
13921 the file name could contain "*/".
13922 (b4_synclines_flag): Don't quote the 2nd argument; it should already
13923 be quoted. All uses changed.
13924
13925 * data/glr.c: Use new @ escapes consistently.
13926 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
13927 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
13928 Remove, since they couldn't handle arbitrary characters in file
13929 names.
13930 * data/lalr1.cc: Likewise.
13931 * data/yacc.c: Likewise.
13932
13933 * src/files.c (output_infix): Remove; all uses removed.
13934 * src/files.h: Likewise.
13935
13936 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
13937 mishandled funny characters in file names, and anyway it isn't
13938 needed any more.
13939 * data/yacc.c: Likewise.
13940 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
13941
13942 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
13943 * data/yacc.c: Likewise.
13944
13945 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
13946 strings now.
13947 (muscle_init): Quote filename as a C string.
13948 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
13949 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
13950 * src/output.c (escaped_file_name_output): New function.
13951 (prepare_symbols): Quote tokens for M4.
13952 (prepare): Don't insert output_infix, output_prefix,
13953 output_parser_name, output_header_name; this is now down by scan-skel.
13954 Insert skeleton as a C string.
13955
13956 * src/output.c (user_actions_output, symbol_destructors_output,
13957 symbol_printers_output): Quote filenames for C and M4.
13958 * src/reader.c (prologue_augment, epilogue_set): Likewise.
13959
13960 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
13961 escapes other than \\ and \'; this simplifies the code.
13962 (<SC_STRING>): Likewise, for \\ and \".
13963 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
13964 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
13965 Use new escapes @{ and @} for [ and ].
13966
13967 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
13968 them with auto vars.
13969 Switch to new escape scheme, where @ is the escape character uniformly.
13970 Abort if a stray escape character is found. Avoid unbounded input
13971 buffer when parsing non-escaped text.
13972
13973 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
13974 __oline__, #output, $@, and @{ do not have unintended meanings.
13975
13976 2002-11-09 Paul Eggert <eggert@twinsun.com>
13977
13978 Fix the test failure due to GCC warnings described in
13979 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
13980 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
13981 evaluate to 0 if it's impossible for NINF to be in the respective
13982 table.
13983 (yygetLRActions, yyrecoverParseError): Use them.
13984
13985 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
13986 counted in the token inserted at end of file. Now takes
13987 location_t *, not location_t, so that the location can be
13988 adjusted. All uses changed.
13989
13990 * tests/regression.at (Invalid inputs): Adjust wording in
13991 diagnostic to match the new behavior.
13992
13993 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
13994 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
13995 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
13996 abort ();'. This reduces the runtime of the "Many lookaheads"
13997 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
13998 GCC 3.2.
13999
14000 2002-11-07 Paul Eggert <eggert@twinsun.com>
14001
14002 * src/parse-gram.y (CHARACTER): Remove unused token.
14003 All uses removed.
14004
14005 * src/scan-gram.l: Remove stack option. We no longer use the
14006 stack, since the stack was never deeper than 1; instead, use the
14007 new auto var c_context to record the stacked value.
14008
14009 Remove nounput option. At an unexpected end of file, we now unput
14010 the minimal input necessary to end cleanly; this simplifies the
14011 code.
14012
14013 Avoid unbounded token sizes where this is easy.
14014
14015 (unexpected_end_of_file): New function.
14016 Use it to systematize the error message on unexpected EOF.
14017 (last-string): Now auto, not static.
14018 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
14019 (scanner_last_string_free): Remove; not used.
14020 (percent_percent_count): Move decl to just before use.
14021 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
14022 not the (never otherwised-used) CHARACTER.
14023
14024 2002-11-07 Akim Demaille <akim@epita.fr>
14025
14026 Let yyerror always receive the msg as last argument, so that
14027 yyerror can be variadic.
14028
14029 * data/yacc.c (b4_yyerror_args): New.
14030 Use it when calling yyerror.
14031 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
14032 Use it when calling yyerror.
14033 * doc/bison.texinfo (Error Reporting): Adjust.
14034 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
14035 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
14036
14037 2002-11-06 Akim Demaille <akim@epita.fr>
14038
14039 #line should have quoted strings.
14040 Ideally, this should be done by m4_quotearg.
14041
14042 * src/scan-skel.l: Include quotearg.h.
14043 Quote __ofile__.
14044 * src/output.c (symbol_printers_output)
14045 (symbol_destructors_output): Quote the file name.
14046
14047 2002-11-06 Akim Demaille <akim@epita.fr>
14048
14049 * tests/regression.at (Invalid inputs): Adjust to the recent
14050 messages.
14051
14052 2002-11-06 Akim Demaille <akim@epita.fr>
14053
14054 Restore --no-lines.
14055 Reported by Jim Kent.
14056
14057 * data/c.m4 (b4_syncline): New.
14058 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
14059 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
14060 * src/output.c (user_actions_output): Likewise.
14061 (prepare): Define 'b4_synclines_flag'.
14062 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
14063
14064 2002-11-06 Akim Demaille <akim@epita.fr>
14065
14066 * src/main.c (main): Free `infile'.
14067 * src/scan-gram.l (handle_syncline): New.
14068 Recognize `#line'.
14069 * src/output.c (user_actions_output, symbol_destructors_output)
14070 (symbol_printers_output): Use the location's file name, not
14071 infile.
14072 * src/reader.c (prologue_augment, epilogue_set): Likewise.
14073
14074 2002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14075
14076 * src/tables.c (matching_state): Don't allow states to match if
14077 either has GLR conflict entries.
14078
14079 2002-11-05 Paul Eggert <eggert@twinsun.com>
14080
14081 * src/scan-gram.l: Use more accurate diagnostics, e.g.
14082 "integer out of range" rather than "invalid value".
14083 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
14084 accordingly.
14085
14086 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
14087 Also, remove one static variable in the scanner.
14088
14089 * src/scan-gram.l (braces_level): Now auto, not static.
14090 Initialize to zero if the compiler is being picky.
14091 (INITIAL): Clear braces_level instead of incrementing it.
14092 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
14093 as POSIX 1003.1-2001 requires.
14094 * src/system.h (IF_LINT): New macro, taken from coreutils.
14095 * configure.ac: Define "lint" if --enable-gcc-warnings.
14096
14097 2002-11-05 Akim Demaille <akim@epita.fr>
14098
14099 * src/scan-gram.l: When it starts with `%', complain about the
14100 whole directive, not just that `invalid character: %'.
14101
14102 2002-11-04 Akim Demaille <akim@epita.fr>
14103
14104 * Makefile.maint: Update from Autoconf.
14105 (update, cvs-update, po-update, do-po-update): New.
14106
14107 2002-11-04 Akim Demaille <akim@epita.fr>
14108
14109 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
14110 and yyerror.
14111 Have yyerror `use' its arguments.
14112 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
14113 returns true when location & yacc & pure & parse-param.
14114 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
14115
14116 2002-11-04 Akim Demaille <akim@epita.fr>
14117
14118 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
14119 clashes.
14120 * src/scan-gram.l: Use [\'] instead of ['] to pacify
14121 font-lock-mode.
14122 Use complain_at.
14123 Use quote, not quote_n since LOCATION_PRINT no longer uses the
14124 slot 0.
14125
14126 2002-11-03 Paul Eggert <eggert@twinsun.com>
14127
14128 * src/reader.c (get_merge_function, grammar_current_rule_check):
14129 Use consistent diagnostics for reporting type name clashes.
14130 Quote the types with <>, for consistency with Yacc.
14131 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
14132
14133 2002-11-03 Akim Demaille <akim@epita.fr>
14134
14135 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
14136 New.
14137 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
14138 (b4_parse_param): Remove.
14139 Use b4_identification.
14140 Propagate b4_pure_args where needed to pass them to yyerror.
14141 * data/glr.m4 (b4_parse_param): Remove.
14142 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
14143 (b4_lpure_formals): New.
14144 Use b4_identification.
14145 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
14146 b4_user_formals and b4_user_args.
14147 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
14148 (yyreportAmbiguity): When using a pure parser, also need
14149 the location, and the parse-params.
14150 Adjust callers.
14151 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
14152 When using a pure parser, also need the parse-params.
14153 Adjust callers.
14154 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
14155 (%pure-parser + %parse-param) LALR and GLR parsers.
14156 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
14157 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
14158 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
14159 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
14160 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
14161 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
14162 * doc/bison.texinfo: Untabify the whole file.
14163 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
14164 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
14165 (Error Reporting): Adjust to these new directives.
14166 Document %error-verbose, deprecate YYERROR_VERBOSE.
14167
14168 2002-11-03 Akim Demaille <akim@epita.fr>
14169
14170 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
14171 AT_CHECK_CALC_GLR invocations to use % directives, instead of
14172 command line options.
14173 * tests/cxx-type.at: Formatting changes.
14174
14175 2002-11-03 Paul Eggert <eggert@twinsun.com>
14176
14177 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
14178 to count columns correctly, and to check for invalid inputs.
14179
14180 Use mbsnwidth to count columns correctly. Account for tabs, too.
14181 Include mbswidth.h.
14182 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
14183 (extend_location): New function.
14184 (YY_LINES): Remove.
14185
14186 Handle CRLF in C code rather than in Lex code.
14187 (YY_INPUT): New macro.
14188 (no_cr_read): New function.
14189
14190 Scan UCNs, even though we don't fully handle them yet.
14191 (convert_ucn_to_byte): New function.
14192
14193 Handle backslash-newline correctly in C code.
14194 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
14195 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
14196 all uses changed.
14197 (tag, splice): New EREs. Do not allow NUL or newline in tags.
14198 Use {splice} wherever C allows backslash-newline.
14199 YY_STEP after space, newline, vertical-tab.
14200 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
14201
14202 (letter, id): Don't assume ASCII; e.g., spell out a-z.
14203
14204 ({int}, handle_action_dollar, handle_action_at): Check for integer
14205 overflow.
14206
14207 (YY_STEP): Omit trailing semicolon, so that it's more like C.
14208
14209 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
14210 as well as \000. Check for UCHAR_MAX, not 255.
14211 Allow \x with an arbitrary positive number of digits, as in C.
14212 Check for overflow here.
14213 Allow \? and UCNs, for compatibility with C.
14214
14215 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
14216 with quote slot used by complain_at.
14217
14218 * tests/input.at: Add tests for backslash-newline, m4 quotes
14219 in symbols, long literals, and funny escapes in strings.
14220
14221 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
14222 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
14223 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
14224 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
14225 * m4/mbswidth.m4: New file, from GNU coreutils.
14226
14227 * doc/bison.texinfo (Grammar Outline): Document // comments.
14228 (Symbols): Document that trigraphs have no special meaning in Bison,
14229 nor is backslash-newline allowed.
14230 (Actions): Document that trigraphs have no special meaning.
14231
14232 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
14233 no longer used.
14234
14235 2002-11-02 Paul Eggert <eggert@twinsun.com>
14236
14237 * src/reader.c: Don't include quote.h; not needed.
14238 (get_merge_function): Reword warning to be consistent with
14239 type clash diagnostic in grammar_current_rule_check.
14240
14241 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
14242 bug in trigraph handling.
14243
14244 * src/output.c (prepare_symbols): When printing token names,
14245 escape "[" as "@<:@" and likewise for "]".
14246
14247 * src/system.h (errno): Remove declaration, as we are now
14248 assuming C89 or better, and C89 guarantees errno.
14249
14250 2002-10-30 Paul Eggert <eggert@twinsun.com>
14251
14252 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
14253 Check for close failures.
14254 * src/files.h (xfclose): Return void, not int, since it always
14255 returned zero.
14256 * src/files.c (xfclose): Likewise. Report I/O error if ferror
14257 indicates one.
14258 * src/output.c (output_skeleton): Use xfclose rather than fclose
14259 and ferror. xfclose now checks ferror.
14260
14261 * data/glr.c (YYLEFTMOST_STATE): Remove.
14262 (yyreportTree): Use a stack-based leftmost state. This avoids
14263 our continuing battles with bogus warnings about initializers.
14264
14265 2002-10-30 Akim Demaille <akim@epita.fr>
14266
14267 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
14268 #if.
14269
14270 2002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14271
14272 * tests/glr-regr1.at: New test for reported regressions.
14273 * tests/testsuite.at: Add glr-regr1.at test.
14274 * tests/Makefile.am: Add glr-regr1.at test.
14275
14276 2002-10-24 Paul Eggert <eggert@twinsun.com>
14277
14278 Version 1.75a.
14279
14280 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
14281 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
14282 we use malloc. Don't assume 'A' through 'Z' are contiguous.
14283 Don't assume strdup exists; POSIX says its an XSI extension.
14284 Check for buffer overflow on input.
14285
14286 2002-10-24 Akim Demaille <akim@epita.fr>
14287
14288 * src/output.c (output_skeleton): Don't disable M4sugar comments
14289 too soon: it results in comments being expanded.
14290 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
14291 first output.
14292
14293 2002-10-24 Akim Demaille <akim@epita.fr>
14294
14295 * data/yacc.c (m4_int_type): New.
14296 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
14297 char' as only yacc.c wants K&R portability.
14298 * data/glr.c (yysigned_char): Remove.
14299 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
14300 Reported by Quoc Peyrot.
14301
14302 2002-10-23 Paul Eggert <eggert@twinsun.com>
14303
14304 * src/main.c (main): With --trace=time, report times even if a
14305 non-fatal error occurs. Formerly, the times were reported in some
14306 such cases but not in others.
14307 * src/reader.c (reader): Just return if a complaint has been issued,
14308 instead of exiting, so that 'main' can report times.
14309
14310 2002-10-22 Akim Demaille <akim@epita.fr>
14311
14312 * src/system.h: Include sys/types.
14313 Reported by Bert Deknuydt.
14314
14315 2002-10-23 Paul Eggert <eggert@twinsun.com>
14316
14317 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
14318 Suggested by Art Haas.
14319
14320 2002-10-22 Paul Eggert <eggert@twinsun.com>
14321
14322 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
14323 decl; not needed any more.
14324 * src/main.c (main): Use return to exit, undoing yesterday's change.
14325 The last OS that we could find where this wouldn't work is
14326 SunOS 3.5, and that's too old to worry about now.
14327
14328 * data/glr.c (struct yyltype): Define members even when not
14329 doing locations. This is more consistent with yacc.c, and it
14330 works around the following bug reports:
14331 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
14332 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
14333
14334 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
14335 @acronym consistently. Standardize on "Yacc" instead of "YACC",
14336 "Algol" instead of "ALGOL". Give a bit more history about BNF.
14337
14338 2002-10-22 Akim Demaille <akim@epita.fr>
14339
14340 * data/README: New.
14341
14342 2002-10-21 Paul Eggert <eggert@twinsun.com>
14343
14344 Be consistent about 'bool'; the old code used an enum in one
14345 module and an int in another, and this violates the C standard.
14346 * m4/stdbool.m4: New file, from coreutils 4.5.3.
14347 * configure.ac (AC_HEADER_STDBOOL): Add.
14348 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
14349 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
14350 * src/symtab.c (hash_compare_symbol_t): Likewise.
14351 * src/system.h (bool, false, true): Use a definition consistent
14352 with ../lib/hash.c. All uses changed.
14353
14354 * src/complain.c (warning_issued): Renamed from warn_message_count,
14355 so that we needn't worry about integer overflow (!).
14356 Now of type bool. All uses changed.
14357 (complaint_issued): Renamed from complain_message_count; likewise.
14358
14359 * src/main.c (main): Use exit to exit with failure.
14360
14361 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
14362 rather than 1 and 0.
14363 * src/main.c (main): Likewise.
14364 * src/getargs.c (getargs): Likewise.
14365 * src/reader.c (reader): Likewise.
14366
14367 * src/getarg.c (getargs): Remove duplicate code for
14368 "Try `bison --help'".
14369
14370 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
14371 What was that "2" for?
14372
14373 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
14374 * src/getargs.c (usage): Likewise.
14375
14376 * src/getargs.c (getargs): When there are too few operands, report
14377 the last one. When there are too many, report the first extra
14378 one. This is how diffutils does it.
14379
14380 2002-10-20 Paul Eggert <eggert@twinsun.com>
14381
14382 Remove K&R vestiges.
14383 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
14384 * src/complain.c (VA_START): Remove. Assume prototypes.
14385 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
14386 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
14387 fatal): Assume prototypes.
14388 * src/complain.h: Assume prototypes.
14389 * src/system.h (PARAMS): Remove.
14390 Include <limits.h> unconditionally, since it's guaranteeed even
14391 for a freestanding C89 compiler.
14392 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
14393 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
14394
14395 2002-10-20 Akim Demaille <akim@epita.fr>
14396
14397 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
14398 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
14399 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
14400 (yyresolveStates, yyresolveAction, yyresolveStack)
14401 (yyprocessOneStack): Use them.
14402 (yy_reduce_print): New.
14403 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
14404
14405 2002-10-20 Akim Demaille <akim@epita.fr>
14406
14407 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
14408 arguments and output `void'.
14409 (b4_c_function): Rename as...
14410 (b4_c_function_def): this.
14411 (b4_c_function_decl, b4_c_ansi_function_def)
14412 (b4_c_ansi_function_decl): New.
14413 Change the interpretation of the arguments: before `int, foo', now
14414 `int foo, foo'.
14415 * data/yacc.c (yyparse): Prototype and define thanks to these.
14416 Adjust b4_c_function_def uses.
14417 * data/glr.c (yyparse): Likewise, but ANSI only.
14418
14419 2002-10-20 Akim Demaille <akim@epita.fr>
14420
14421 * src/output.c (prepare): Move the definition of `tokens_number',
14422 `nterms_number', `undef_token_number', `user_token_number_max'
14423 to...
14424 (prepare_tokens): Here.
14425 (prepare_tokens): Rename as...
14426 (prepare_symbols): this.
14427 (prepare): Move the definition of `rules_number' to...
14428 (prepare_rules): here.
14429 (prepare): Move the definition of `last', `final_state_number',
14430 `states_number' to...
14431 (prepare_states): here.
14432 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
14433
14434 2002-10-20 Akim Demaille <akim@epita.fr>
14435
14436 * src/tables.h, src/tables.c, src/output.c: Comment changes.
14437
14438 2002-10-20 Akim Demaille <akim@epita.fr>
14439
14440 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
14441 * data/c.m4: here.
14442
14443 2002-10-20 Akim Demaille <akim@epita.fr>
14444
14445 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
14446 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
14447 `pair'.
14448 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
14449 `name' to...
14450 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
14451 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
14452 These.
14453
14454 2002-10-19 Paul Eggert <eggert@twinsun.com>
14455
14456 Do not create a temporary file, as that involves security and
14457 cleanup headaches. Instead, use a pair of pipes.
14458 Derived from a suggestion by Florian Krohm.
14459 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
14460 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
14461 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
14462 (BISON_PREREQ_SUBPIPE): Add.
14463 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
14464 Add subpipe.h, subpipe.c.
14465 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
14466 * po/POTFILES.in: Add lib/subpipe.c.
14467 * src/output.c: Include "subpipe.h".
14468 (m4_invoke): Remove decl.
14469 (scan_skel): New decl.
14470 (output_skeleton): Use pipe rather than temporary file for m4 input.
14471 Check that m4sugar.m4 is readable, to avoid deadlock.
14472 Check for pipe I/O error.
14473 * src/scan-skel.l (readpipe): Remove decl.
14474 (scan_skel): New function, to be used in place of m4_invoke.
14475 Read from stream rather than file.
14476
14477 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
14478 float, as this generates a warning on Solaris 8 + GCC 3.2 with
14479 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
14480 this generates a more-accurate value anyway.
14481
14482 * lib/timevar.c (timervar_accumulate): Rename locals to
14483 avoid confusion with similarly-named more-global.
14484 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
14485
14486 * src/output.c (prepare): Use xstrdup to convert char const *
14487 to char *, to avoid GCC warning.
14488
14489 2002-10-19 Akim Demaille <akim@epita.fr>
14490
14491 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
14492 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
14493 Use them to have `calc.y' ready for %pure-parser.
14494 * data/yacc.c (YYLEX): Pass a yylex return type to
14495 b4_c_function_call.
14496
14497 2002-10-19 Akim Demaille <akim@epita.fr>
14498
14499 Prototype support of %lex-param and %parse-param.
14500
14501 * src/parse-gram.y: Add the definition of the %lex-param and
14502 %parse-param tokens, plus their rules.
14503 Drop the `_' version of %glr-parser.
14504 Add the "," token.
14505 * src/scan-gram.l (INITIAL): Scan them.
14506 * src/muscle_tab.c: Comment changes.
14507 (muscle_insert, muscle_find): Rename `pair' as `probe'.
14508 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
14509 (muscle_entry_s): The `value' member is no longer const.
14510 Adjust all dependencies.
14511 * src/muscle_tab.c (muscle_init): Adjust: use
14512 MUSCLE_INSERT_STRING.
14513 Initialize the obstack earlier.
14514 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
14515 (muscle_pair_list_grow): New.
14516 * data/c.m4 (b4_c_function_call, b4_c_args): New.
14517 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
14518 * tests/calc.at: Use %locations, not --locations.
14519 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
14520
14521 2002-10-19 Akim Demaille <akim@epita.fr>
14522
14523 * src/getargs.c (usage): Take status as argument and exit
14524 accordingly.
14525 Report the traditional `Try ... --help' message when status != 0.
14526 (usage, version): Don't take a FILE * as arg, it is pointless.
14527 (getargs): When there is an incorrect number of arguments, make it
14528 an error, and report it GNUlically thanks to `usage ()'.
14529
14530 2002-10-18 Paul Eggert <eggert@twinsun.com>
14531
14532 * data/glr.c (yyreportParseError): Don't assume that sprintf
14533 yields the length of the printed string, as this is not true
14534 on SunOS 4.1.4. Reported by Peter Klein.
14535
14536 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
14537 * tests/conflicts.at (%nonassoc and eof): Likewise.
14538 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
14539
14540 2002-10-17 Akim Demaille <akim@epita.fr>
14541
14542 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
14543 * src/getargs.c (trace_types, trace_args): Adjust.
14544 * src/reader.c (grammar_current_rule_prec_set)
14545 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
14546 Standardize error messages.
14547 And s/@prec/%prec/!
14548 (reader): Use trace_flag to enable scanner/parser debugging,
14549 instead of an adhoc scheme.
14550 * src/scan-gram.l: Remove trailing debugging code.
14551
14552 2002-10-16 Paul Eggert <eggert@twinsun.com>
14553
14554 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
14555 MUSCLE_TAB_H.
14556
14557 * NEWS: Officially drop support for building Bison with K&R C,
14558 since it didn't work anyway and it's not worth worrying about.
14559 * Makefile.maint (wget_files): Remove ansi2knr.c.
14560 (ansi2knr.c-url_prefix): Remove.
14561 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
14562 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
14563 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
14564
14565 2002-10-15 Paul Eggert <eggert@twinsun.com>
14566
14567 Stop using the "enum_" trick for K&R-style function definitions;
14568 it confused me, and I was the author! Instead, assume that people
14569 who want to use K&R C compilers (when using these modules in GCC,
14570 perhaps?) will run ansi2knr.
14571
14572 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
14573 All uses of "enum_" changed to "enum ".
14574 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
14575 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
14576
14577 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
14578 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
14579 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
14580 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
14581 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
14582 abitset_not, abitset_ones, abitset_or, abitset_or_and,
14583 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
14584 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
14585 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
14586 Use function prototypes; this removes the need for declaring
14587 static functions simply to provide their prototypes.
14588 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
14589 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
14590 bitset_count_, bitset_create, bitset_dump, bitset_first,
14591 bitset_free, bitset_init, bitset_last, bitset_next,
14592 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
14593 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
14594 bitset_print, bitset_release_memory, bitset_toggle_,
14595 bitset_type_choose, bitset_type_get, bitset_type_name_get,
14596 debug_bitset): Likewise.
14597 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
14598 * lib/bitset_stats.c (bitset_log_histogram_print,
14599 bitset_percent_histogram_print, bitset_stats_and,
14600 bitset_stats_and_cmp, bitset_stats_and_or,
14601 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
14602 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
14603 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
14604 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
14605 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
14606 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
14607 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
14608 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
14609 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
14610 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
14611 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
14612 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
14613 bitset_stats_zero): Likewise.
14614 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
14615 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
14616 bitsetv_dump, debug_bitsetv): Likewise.
14617 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
14618 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
14619 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
14620 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
14621 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
14622 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
14623 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
14624 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
14625 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
14626 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
14627 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
14628 Likewise.
14629 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
14630 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
14631 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
14632 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
14633 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
14634 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
14635 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
14636 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
14637 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
14638 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
14639 lbitset_xor_cmp, lbitset_zero): Likewise.
14640
14641 2002-10-14 Akim Demaille <akim@epita.fr>
14642
14643 Version 1.75.
14644
14645 2002-10-14 Akim Demaille <akim@epita.fr>
14646
14647 * tests/Makefile.am (maintainer-check-posix): New.
14648
14649 2002-10-14 Akim Demaille <akim@epita.fr>
14650
14651 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
14652 member.
14653
14654 2002-10-14 Akim Demaille <akim@epita.fr>
14655
14656 * src/tables.c (table_ninf_remap): base -> tab.
14657 Reported by Matt Rosing.
14658
14659 2002-10-14 Paul Eggert <eggert@twinsun.com>
14660
14661 * tests/action.at, tests/calc.at, tests/conflicts.at,
14662 tests/cxx-type.at, tests/headers.at, tests/input.at,
14663 tests/regression.at, tests/synclines.at, tests/torture.at:
14664 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
14665 so that the tests still work even if POSIXLY_CORRECT is set.
14666 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
14667
14668 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
14669 for portability to K&R hosts. Fix typo: signed char is guaranteed
14670 only to 127, not to 128.
14671 * data/glr.c (yysigned_char): New type.
14672 * data/yacc.c (yysigned_char): Likewise.
14673 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
14674
14675 2002-10-13 Paul Eggert <eggert@twinsun.com>
14676
14677 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
14678 true due to limited range of data type" warning from GCC.
14679
14680 * data/c.m4 (b4_token_defines): Protect against double-inclusion
14681 by wrapping enum yytokentype's definition inside #ifndef
14682 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
14683
14684 2002-10-13 Akim Demaille <akim@epita.fr>
14685
14686 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
14687 Un yy- yyrhs to avoid the name clash with the global YYRHS.
14688
14689 2002-10-13 Akim Demaille <akim@epita.fr>
14690
14691 * Makefile.maint: Update from Autoconf 2.54.
14692 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
14693
14694 2002-10-13 Akim Demaille <akim@epita.fr>
14695
14696 * src/print.c (print_state): Separate the list of solved conflicts
14697 from the other items.
14698 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
14699
14700 2002-10-13 Akim Demaille <akim@epita.fr>
14701
14702 Let nondeterministic skeletons be usable with deterministic
14703 tables.
14704
14705 With the patch, GAWK compiled by GCC without -O2 passes its test
14706 suite using a GLR parser driven by LALR tables. It fails with -O2
14707 because `struct stat' gives two different answers on my machine:
14708 88 (definition of an auto var) and later 96 (memset on this var).
14709 Hence the stack is badly corrumpted. The headers inclusion is to
14710 blame: if I move the awk.h inclusion before GLR's system header
14711 inclusion, the two struct stat have the same size.
14712
14713 * src/tables.c (pack_table): Always create conflict_table.
14714 (token_actions): Always create conflict_list.
14715 * data/glr.c (YYFLAG): Remove, unused.
14716
14717 2002-10-13 Akim Demaille <akim@epita.fr>
14718
14719 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
14720 (O0FLAGS): New.
14721 (VALGRIND, GXX): New.
14722 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
14723 * tests/bison.in: Run $PREBISON a pre-command.
14724 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
14725 (maintainer-check-g++): New.
14726 * Makefile.am (maintainer-check): New.
14727
14728 2002-10-13 Akim Demaille <akim@epita.fr>
14729
14730 * data/glr.c: Formatting changes.
14731 Tweak some trace messages to match yacc.c's.
14732
14733 2002-10-13 Akim Demaille <akim@epita.fr>
14734
14735 GLR parsers sometimes raise parse errors instead of performing the
14736 default reduction.
14737 Reported by Charles-Henry de Boysson.
14738
14739 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
14740 check the length of the traces when %glr.
14741 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
14742 GLR's traces.
14743 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
14744 Test GLR parsers.
14745 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
14746 (yyltype): Remove the yy prefix from the member names.
14747 (yytable): Complete its comment.
14748 (yygetLRActions): Map error action number from YYTABLE from
14749 YYTABLE_NINF to 0.
14750 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
14751 (which was a bug: it should have been YYTABEL_NINF, and yet it was
14752 not satisfying as we could compare an YYACTION computed from
14753 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
14754 only value for error actions.
14755 (yyreportParseError): In verbose parse error messages, don't issue
14756 `error' in the list of expected tokens.
14757 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
14758 next action to perform to match glr.c's decoding.
14759 (yytable): Complete its comment.
14760
14761 2002-10-13 Paul Eggert <eggert@twinsun.com>
14762
14763 Fix problem reported by Henrik Grubbstroem in
14764 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
14765 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
14766 because the Bison parser reads the second action before reducing
14767 the first one.
14768 * src/scan-gram.l (rule_length): New static var.
14769 Use it to keep track of the rule length in the scanner, since
14770 we can't expect the parser to be in lock-step sync with the scanner.
14771 (handle_action_dollar, handle_action_at): Use this var.
14772 * tests/actions.at (Exotic Dollars): Test for the problem.
14773
14774 2002-10-12 Paul Eggert <eggert@twinsun.com>
14775
14776 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
14777 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
14778 Include <sys/time.h> when checking for clock_t and struct tms.
14779 Use same include order as source.
14780 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
14781 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
14782
14783 * lib/timevar.c: Update copyright date and clarify comments.
14784 (get_time) [IN_GCC]: Keep the GCC version for reference.
14785
14786 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
14787 GCC version as of today, then merge Bison's changes.
14788 Change "GCC" to "Bison" in copyright notice. timevar.def's
14789 author is Akim, so change that too.
14790
14791 * src/reader.c (grammar_current_rule_check):
14792 Don't worry about the default action if $$ is untyped.
14793 Prevents bogus warnings reported by Jim Gifford in
14794 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
14795
14796 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
14797 * data/glr.c, data/lalr1.cc, data/yacc.c:
14798 Output token definitions before the first part of user declarations.
14799 Fixes compatibility problem reported by Jim Gifford for kbd in
14800 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14801
14802 2002-10-11 Paul Eggert <eggert@twinsun.com>
14803
14804 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
14805 (yyparse): here. This undoes some of the 2002-07-25 change.
14806 Compatibility problem reported by Ralf S. Engelschall with
14807 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
14808
14809 2002-10-11 Akim Demaille <akim@epita.fr>
14810
14811 * tests/regression.at Characters Escapes): New.
14812 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
14813 characters.
14814 Reported by Jan Nieuwenhuizen.
14815
14816 2002-10-11 Akim Demaille <akim@epita.fr>
14817
14818 * po/id.po: New.
14819
14820 2002-10-10 Paul Eggert <eggert@twinsun.com>
14821
14822 Portability fixes for bitsets; this also avoids several GCC
14823 warnings.
14824
14825 * lib/abitset.c: Include <stddef.h>, for offsetof.
14826 * lib/lbitset.c: Likewise.
14827
14828 * lib/abitset.c (abitset_bytes): Return a size that is aligned
14829 properly for vectors of objects. Do not assume that adding a
14830 header size to a multiple of a word size yields a value that is
14831 properly aligned for the whole union.
14832 * lib/bitsetv.c (bitsetv_alloc): Likewise.
14833
14834 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
14835 unique names for structures.
14836 * lib/ebitset.c (ebitset_bytes): Likewise.
14837 * lib/lbitset.c (lbitset_bytes): Likewise.
14838
14839 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
14840 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
14841 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
14842 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
14843 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
14844 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
14845 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
14846 to improve the type-checking that GCC can do.
14847 * lib/bitset.c (bitset_op4_cmp): Likewise.
14848 * lib/bitset_stats.c (bitset_stats_count,
14849 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
14850 bitset_stats_copy, bitset_stats_disjoint_p,
14851 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
14852 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
14853 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
14854 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
14855 bitset_stats_and_or_cmp, bitset_stats_andn_or,
14856 bitset_stats_andn_or_cmp, bitset_stats_or_and,
14857 bitset_stats_or_and_cmp): Likewise.
14858 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
14859 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
14860 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
14861 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
14862
14863 * lib/abitset.h: Include bitset.h, not bbitset.h.
14864 * lib/ebitset.h: Likewise.
14865 * lib/lbitset.h: Likewise.
14866
14867 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
14868 All instances of parameters of type enum bitset_opts are now of
14869 type enum_bitset_opts, to conform to the C Standard, and similarly
14870 for enum_bitset_type.
14871 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
14872 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
14873
14874 Do not use "struct bitset_struct" to mean different things in
14875 different modules. Not only is this confusing, it violates
14876 the C Standard, which requires that structure types in different
14877 modules must be compatible if one is to be passed to the other.
14878 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
14879 All instances of "struct bitset_struct *" replaced with "bitset".
14880 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
14881 (union bitset_union, struct abitset_struct, struct ebitset_struct,
14882 struct lbitset_struct, struct bitset_stats_struct): New types.
14883 All uses of struct bitset_struct changed to union bitset_union,
14884 etc.
14885 * lib/abitset.c (struct abitset_struct, abitset,
14886 struct bitset_struct): Remove.
14887 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
14888 struct bitset_struct): Remove.
14889 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
14890 bitset_struct): Remove.
14891 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
14892 Likewise.
14893
14894 Do not call a function of type T using a call that assumes the
14895 function is of a different type U. Standard C requires that a
14896 function must be called with a type that is compatible with its
14897 definition.
14898 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
14899 New decls.
14900 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
14901 New functions.
14902 * lib/ebitset.c (PFV): Remove.
14903 * lib/lbitset.c (PFV): Likewise.
14904 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
14905 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
14906 decls.
14907 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
14908 (ebitset_vtable): Use them.
14909 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
14910 lbitset_xor): New functions.
14911 (lbitset_vtable): Use them.
14912
14913 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
14914 Declare.
14915
14916 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
14917 GCC warning.
14918 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
14919 Use offsetof, for simplicity.
14920
14921 2002-10-06 Paul Eggert <eggert@twinsun.com>
14922
14923 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
14924 the same width as int. This reapplies a hunk of the 2002-08-12 patch
14925 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
14926 which was inadvertently undone by the 2002-09-30 patch.
14927 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
14928 the same width as int.
14929
14930 2002-10-04 Paul Eggert <eggert@twinsun.com>
14931
14932 Version 1.50.
14933
14934 * configure.ac (AC_INIT), NEWS: Increment version number.
14935
14936 * doc/bison.texinfo: Minor spelling, grammar, and white space
14937 fixes.
14938 (Symbols): Mention that any negative value returned from yylex
14939 signifies end-of-input. Warn about negative chars. Mention
14940 the portable Standard C character set.
14941
14942 The GNU coding standard says CFLAGS and YFLAGS are reserved
14943 for the installer to set.
14944 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
14945 * src/Makefile.am (AM_CFLAGS): Likewise.
14946 (AM_YFLAGS): Renamed from YFLAGS.
14947
14948 Fix some MAX and MIN problems.
14949 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
14950 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
14951 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
14952 * src/reader.c (reader): Use it.
14953
14954 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
14955 POSIX 1003.1-2001 has removed fgrep.
14956
14957 2002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
14958
14959 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
14960 interpreted as signed.
14961 * lib/ebitset.c (ebitset_list): Fix bug.
14962
14963 2002-10-01 Paul Eggert <eggert@twinsun.com>
14964
14965 More fixes for 64-bit hosts and large bitsets.
14966
14967 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
14968 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
14969 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
14970 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
14971 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
14972 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
14973 bitset_count_): Likewise.
14974 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
14975 bitset_first, bitset_last): Likewise.
14976 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
14977 bitset_stats_list_reverse, bitset_stats_size,
14978 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
14979 Likewise.
14980 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
14981 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
14982 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
14983 bitsetv_reflexive_transitive_closure): Likewise.
14984 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
14985 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
14986 Likewise.
14987 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
14988 Likewise.
14989
14990 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
14991 Use size_t, not unsigned int, to count bytes.
14992 * lib/abitset.h (abitset_bytes): Likewise.
14993 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
14994 Likewise.
14995 * lib/bitset.h (bitset_bytes): Likewise.
14996 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
14997 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
14998 * lib/bitsetv.c (bitsetv_alloc): Likewise.
14999 * lib/ebitset.c (ebitset_bytes): Likewise.
15000 * lib/ebitset.h (ebitset_bytes): Likewise.
15001 * lib/lbitset.c (lbitset_bytes): Likewise.
15002 * lib/lbitset.h (lbitset_bytes): Likewise.
15003
15004 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
15005 abitset_subset_p, abitset_disjoint_p, abitset_and,
15006 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
15007 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
15008 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
15009 abitset_or_and, abitset_or_and_cmp):
15010 Use bitset_windex instead of unsigned int.
15011 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
15012 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
15013 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
15014 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
15015 Likewise.
15016 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
15017
15018 * lib/bitset.c (bitset_print):
15019 Use proper printf formats for widths of integer types.
15020 * lib/bitset_stats.c (bitset_percent_histogram_print,
15021 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
15022 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
15023 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
15024 * lib/lbitset.c (lbitset_bytes): Likewise.
15025
15026 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
15027 BITSET_SIZE_MAX): New macros.
15028 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
15029 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
15030 to BITSET_WINDEX_MAX.
15031
15032 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
15033 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
15034 since we now return the bitset_bindex type (not int).
15035
15036 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
15037 when computing sizes.
15038 * lib/ebitset.c (ebitset_elts_grow): Likewise.
15039
15040 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
15041 and avoid cast to unsigned.
15042
15043 2002-09-30 Akim Demaille <akim@epita.fr>
15044
15045 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
15046 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
15047 Updates from Michael Hayes.
15048
15049 2002-09-30 Art Haas <ahaas@neosoft.com>
15050
15051 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
15052 invocations.
15053 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
15054 defined.
15055
15056 2002-09-27 Akim Demaille <akim@epita.fr>
15057
15058 Version 1.49c.
15059
15060 2002-09-27 Akim Demaille <akim@epita.fr>
15061
15062 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
15063 (Because of AC_LIBSOURCE).
15064
15065 2002-09-27 Akim Demaille <akim@epita.fr>
15066
15067 Playing with Autoscan.
15068
15069 * configure.ac: Remove the old LIBOBJ tweaks.
15070 (AC_REPLACE_FUNCS): Add strrchr and strtol.
15071 * lib/strrchr.c: New.
15072 * lib/strtol.c: New, from the Coreutils 4.5.1.
15073
15074 2002-09-27 Akim Demaille <akim@epita.fr>
15075
15076 Playing with Autoscan.
15077
15078 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
15079 * lib/Makefile.am (libbison_a_SOURCES): No longer include
15080 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
15081 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
15082 Coreutils 4.5.1.
15083
15084 2002-09-24 Akim Demaille <akim@epita.fr>
15085
15086 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
15087 (Frequently Asked Questions, Parser Stack Overflow): New.
15088
15089 2002-09-13 Akim Demaille <akim@epita.fr>
15090
15091 Playing with autoscan.
15092
15093 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
15094 * src/files.c (skeleton_find): Remove, unused.
15095 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
15096 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
15097
15098 2002-09-13 Akim Demaille <akim@epita.fr>
15099
15100 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
15101 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
15102
15103 2002-09-13 Akim Demaille <akim@epita.fr>
15104
15105 * configure.ac: Require 2.54.
15106 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
15107 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
15108 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
15109 Remove, provided by Autoconf macros.
15110
15111 2002-09-12 Akim Demaille <akim@epita.fr>
15112
15113 * m4/prereq.m4: Update, from Coreutils 4.5.1.
15114
15115 2002-09-12 Akim Demaille <akim@epita.fr>
15116
15117 * m4/prereq.m4: Update, from Fileutils 4.1.5.
15118 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
15119 Reported by Martin Mokrejs.
15120
15121 2002-09-10 Akim Demaille <akim@epita.fr>
15122
15123 * src/parse-gram.y: Associate a human readable string to each
15124 token type.
15125 * tests/regression.at (Invalid inputs): Adjust.
15126
15127 2002-09-10 Gary V. Vaughan <gary@gnu.org>
15128
15129 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
15130 with an Autoconf-2.5x style configure.ac.
15131
15132 2002-09-06 Paul Eggert <eggert@twinsun.com>
15133
15134 * doc/bison.texinfo (Conditions): Make explicit that the GPL
15135 exception applies only to yacc.c. This is a modification of a
15136 patch originally suggested by Akim Demaille.
15137
15138 2002-09-06 Akim Demaille <akim@epita.fr>
15139
15140 * data/c.m4 (b4_copyright): Move the GPL exception comment from
15141 here to...
15142 * data/yacc.c: here.
15143
15144 * data/lalr1.cc (struct yyltype): Don't define it, since we use
15145 LocationType.
15146 (b4_ltype): Default to yy::Location from location.hh.
15147
15148 2002-09-04 Jim Meyering <jim@meyering.net>
15149
15150 * data/yacc.c: Guard the declaration of yytoknum also with
15151 `#ifdef YYPRINT', so it is declared only when used.
15152
15153 2002-09-04 Akim Demaille <akim@epita.fr>
15154
15155 * configure.in: Rename as...
15156 * configure.ac: this.
15157 Bump to 1.49c.
15158
15159 2002-09-04 Akim Demaille <akim@epita.fr>
15160
15161 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
15162 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
15163 translate maintainer only messages.
15164
15165 2002-08-12 Paul Eggert <eggert@twinsun.com>
15166
15167 Version 1.49b.
15168
15169 * Makefile.am (SUBDIRS): Remove intl.
15170 (DISTCLEANFILES): Remove.
15171 * NEWS: Mention that GNU M4 is now required. Clarify what is
15172 meant by "larger grammars". Mention the pt_BR translation.
15173 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
15174 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
15175 Bump version from 0.11.2 to 0.11.5.
15176 (BISON_PREREQ_STAGE): Remove.
15177 (AM_GNU_GETTEXT): Use external gettext.
15178 (AC_OUTPUT): Remove intl/Makefile.
15179
15180 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
15181
15182 * data/glr.c: Include string.h, for strlen.
15183 (yyreportParseError): Use size_t for yysize.
15184 (yy_yypstack): No longer nested inside yypstates, as nested
15185 functions are not portable. Do not assume size_t is the
15186 same width as int.
15187 (yypstates): Do not assume that ptrdiff_t is the same width
15188 as int, and similarly for yyposn and YYINDEX.
15189
15190 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
15191
15192 * lib/Makefile.am (INCLUDES): Do not include from the intl
15193 directory, which has been removed.
15194 * src/Makefile.am (INCLUDES): Likewise.
15195
15196 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
15197 (bitsets_sources, additional_bitsets_sources, timevars_sources):
15198 New vars.
15199
15200 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
15201 * tests/Makefile.am (EXTRA_DIST): Likewise.
15202
15203 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
15204 Do not assume that bitset_windex is the same width as unsigned.
15205
15206 * lib/abitset.c (abitset_unused_clear): Do not assume that
15207 bitset_word is the same width as int.
15208 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
15209 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
15210 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
15211 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
15212 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
15213
15214 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
15215 portability to one's complement hosts!).
15216 * lib/ebitset.c (ebitset_op1): Likewise.
15217 * lib/lbitset.c (lbitset_op1): Likewise.
15218
15219 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
15220 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
15221 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
15222 Sync with fileutils.
15223 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
15224 lib/gettext.h: Sync with diffutils.
15225
15226 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
15227 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
15228
15229 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
15230 PROTOTYPES to check for prototypes, and "defined __STDC__" to
15231 check for void *.
15232
15233 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
15234 size_t; the old version tried to do this but casted improperly.
15235 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
15236 (bitset_test): Now returns int, not unsigned long.
15237
15238 * lib/bitset_stats.c: Include "gettext.h".
15239 (_): New macro.
15240 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
15241 name locals "index", as it generates unnecessary warnings on some
15242 hosts that have an "index" function.
15243
15244 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
15245 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
15246 they need translation.
15247 * src/LR0.c (state_list_append, new_itemsets, get_state,
15248 append_states, generate_states): Likewise.
15249 * src/assoc.c (assoc_to_string): Likewise.
15250 * src/closure.c (print_closure, set_firsts, closure): Likewise.
15251 * src/gram.c (grammar_dump): Likewise.
15252 * src/injections.c (injections_compute): Likewise.
15253 * src/lalr.c (lookaheads_print): Likewise.
15254 * src/relation.c (relation_transpose): Likewise.
15255 * src/scan-gram.l: Likewise.
15256 * src/tables.c (table_grow, pack_vector): Likewise.
15257
15258 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
15259 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
15260 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
15261 * m4/mbstate_t.m4: Sync with fileutils.
15262 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
15263
15264 * po/LINGUAS: Add pt_BR.
15265 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
15266 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
15267 lib/timevar.c.
15268 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
15269 manual recommends.
15270 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
15271
15272 * src/complain.c (strerror_r): Remove decl; not needed.
15273 (strerror): Use same pattern as ../lib/error.c.
15274
15275 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
15276
15277 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
15278
15279 * src/main.c (main): Cast result of bindtextdomain and textdomain
15280 to void, to avoid a GCC warning when --disable-nls is in effect.
15281
15282 * src/scan-gram.l: Use strings rather than escapes when possible,
15283 to minimize the number of warnings from xgettext.
15284 (handle_action_dollar, handle_action_at): Don't use isdigit,
15285 as it mishandles negative chars and it may not work as expected
15286 outside the C locale.
15287
15288 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
15289 this is a GCC extension and is not portable to other compilers.
15290
15291 * src/system.h (alloca): Use same pattern as ../lib/error.c.
15292 Do not include <ctype.h>; no longer needed.
15293 Do not include <malloc.h>; no longer needed (and generates
15294 warnings on OpenBSD 3.0).
15295
15296 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
15297 it's not portable.
15298
15299 * tests/regression.at: Do not use 'cc -c input.c -o input';
15300 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
15301
15302 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
15303 exit status as failure, not just exit status 1. Sun C exits
15304 with status 2 sometimes.
15305
15306 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
15307 Use it for the two large tests.
15308
15309 2002-08-02 Akim Demaille <akim@epita.fr>
15310
15311 * src/conflicts.c (conflicts_output): Don't output rules never
15312 reduced here, since anyway that computation doesn't work.
15313 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
15314 (rule_useless_p, rule_never_reduced_p): New.
15315 (grammar_rules_partial_print): Use a filter instead of a range.
15316 Display the title only if needed.
15317 (grammar_rules_print): Adjust.
15318 (grammar_rules_never_reduced_report): New.
15319 * src/tables.c (action_row): Move the computation of rules never
15320 reduced to...
15321 (token_actions): here.
15322 * src/main.c (main): Make the parser before making the report, so
15323 that rules never reduced are computed.
15324 Call grammar_rules_never_reduced_report.
15325 * src/print.c (print_results): Report rules never reduced.
15326 * tests/conflicts.at, tests/reduce.at: Adjust.
15327
15328 2002-08-01 Akim Demaille <akim@epita.fr>
15329
15330 Instead of attaching lookaheads and duplicating the rules being
15331 reduced by a state, attach the lookaheads to the reductions.
15332
15333 * src/state.h (state_t): Remove the `lookaheads',
15334 `lookaheads_rule' member.
15335 (reductions_t): Add a `lookaheads' member.
15336 Use a regular array for the `rules'.
15337 * src/state.c (reductions_new): Initialize the lookaheads member
15338 to 0.
15339 (state_rule_lookaheads_print): Adjust.
15340 * src/state.h, src/state.c (state_reductions_find): New.
15341 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
15342 (count_rr_conflicts): Adjust.
15343 * src/lalr.c (LArule): Remove.
15344 (add_lookback_edge): Adjust.
15345 (state_lookaheads_count): New.
15346 (states_lookaheads_initialize): Merge into...
15347 (initialize_LA): this.
15348 (lalr_free): Adjust.
15349 * src/main.c (main): Don't free nullable and derives too early: it
15350 is used by --verbose.
15351 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
15352
15353 2002-08-01 Akim Demaille <akim@epita.fr>
15354
15355 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
15356 `rule_number_t**'.
15357 (set_derives, free_derives): Rename as...
15358 (derives_compute, derives_free): this.
15359 Adjust all dependencies.
15360 * src/nullable.c (set_nullable, free_nullable): Rename as...
15361 (nullable_compute, nullable_free): these.
15362 (rule_list_t): Store rule_t *, not rule_number_t.
15363 * src/state.c (state_rule_lookaheads_print): Directly compare rule
15364 pointers, instead of their numbers.
15365 * src/main.c (main): Call nullable_free, and derives_free earlier,
15366 as they were lo longer used.
15367
15368 2002-08-01 Akim Demaille <akim@epita.fr>
15369
15370 * lib/timevar.c (get_time): Include children time.
15371 * src/lalr.h (LA, LArule): Don't export them: used with the
15372 state_t.
15373 * src/lalr.c (LA, LArule): Static.
15374 * src/lalr.h, src/lalr.c (lalr_free): New.
15375 * src/main.c (main): Call it.
15376 * src/tables.c (pack_vector): Check whether loc is >= to the
15377 table_size, not >.
15378 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
15379 (tables_generate): do it, since that's also it which allocates
15380 them.
15381 Don't free LA and LArule, main does.
15382
15383 2002-07-31 Akim Demaille <akim@epita.fr>
15384
15385 Separate parser tables computation and output.
15386
15387 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
15388 (conflict_list, conflict_list_cnt, table, check, table_ninf)
15389 (yydefgoto, yydefact, high): Move to...
15390 * src/tables.h, src/tables.c: here.
15391 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
15392 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
15393 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
15394 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
15395 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
15396 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
15397 (action_row, save_row, token_actions, save_column, default_goto)
15398 (goto_actions, sort_actions, matching_state, pack_vector)
15399 (table_ninf_remap, pack_table, prepare_actions): Move to...
15400 * src/tables.c: here.
15401 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
15402 * src/output.c (token_actions, output_base, output_conflicts)
15403 (output_check): Merge into...
15404 (prepare_actions): this.
15405 (actions_output): Rename as...
15406 (user_actions_output): this.
15407 * src/main.c (main): Call tables_generate and tables_free.
15408
15409 2002-07-31 Akim Demaille <akim@epita.fr>
15410
15411 Steal GCC's --time-report support.
15412
15413 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
15414 stolen/adjusted from GCC.
15415 * m4/stage.m4: Remove time related checks.
15416 * m4/timevar.m4: New.
15417 * configure.in: Adjust.
15418 * src/system.h: Adjust to using timevar.h.
15419 * src/getargs.h, src/getargs.c: Support trace_time for
15420 --trace=time.
15421 * src/main.c (stage): Remove.
15422 (main): Replace `stage' invocations with timevar calls.
15423 * src/output.c: Insert pertinent timevar calls.
15424
15425 2002-07-31 Akim Demaille <akim@epita.fr>
15426
15427 Let --trace have arguments.
15428
15429 * src/getargs.h (enum trace_e): New.
15430 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
15431 (long_options, short_options): --trace/-T takes an optional
15432 argument.
15433 Change all the uses of trace_flag to reflect the new flags.
15434 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
15435
15436 Strengthen `stage' portability.
15437
15438 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
15439 * configure.in: Use it.
15440 Don't check for malloc.h and sys/times.h.
15441 * src/system.h: Include them when appropriate.
15442 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
15443 times and struct tms are available.
15444
15445 2002-07-30 Akim Demaille <akim@epita.fr>
15446
15447 In verbose parse error message, don't report `error' as an
15448 expected token.
15449 * tests/actions.at (Printers and Destructors): Adjust.
15450 * tests/calc.at (Calculator $1): Adjust.
15451 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
15452 error message, do not report the parser accepts the error token in
15453 that state.
15454
15455 2002-07-30 Akim Demaille <akim@epita.fr>
15456
15457 Normalize conflict related messages.
15458
15459 * src/complain.h, src/complain.c (warn, complain): New.
15460 * src/conflicts.c (conflicts_print): Use them.
15461 (conflict_report_yacc): New, extracted from...
15462 (conflicts_print): here.
15463 * tests/conflicts.at, tests/existing.at: Adjust.
15464
15465 2002-07-30 Akim Demaille <akim@epita.fr>
15466
15467 Report rules which are never reduced by the parser: those hidden
15468 by conflicts.
15469
15470 * src/LR0.c (save_reductions): Don't make the final state too
15471 different: save its reduction (accept) instead of having a state
15472 without any action (no shift or goto, no reduce).
15473 Note: the final state is now a ``regular'' state, i.e., the
15474 parsers now contain `reduce 0' as default reduction.
15475 Nevertheless, since they decide to `accept' when yystate =
15476 final_state, they still will not reduce rule 0.
15477 * src/print.c (print_actions, print_reduction): Adjust.
15478 * src/output.c (action_row): Track reduced rules.
15479 (token_actions): Report rules never reduced.
15480 * tests/conflicts.at, tests/regression.at: Adjust.
15481
15482 2002-07-30 Akim Demaille <akim@epita.fr>
15483
15484 `stage' was accidently included in a previous patch.
15485 Initiate its autoconfiscation.
15486
15487 * configure.in: Look for malloc.h and sys/times.h.
15488 * src/main.c (stage): Adjust.
15489 Report only when trace_flag.
15490
15491 2002-07-29 Akim Demaille <akim@epita.fr>
15492
15493 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
15494 state_number_t.
15495 (errs_t): symbol_t*, not symbol_number_t.
15496 (reductions_t): rule_t*, not rule_number_t.
15497 (FOR_EACH_SHIFT): New.
15498 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
15499 * src/print.c, src/print_graph.c: Adjust.
15500
15501 2002-07-29 Akim Demaille <akim@epita.fr>
15502
15503 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
15504
15505 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
15506 (endtoken, accept): these.
15507 * src/reader.c (reader): Set endtoken's default tag to "$end".
15508 Set undeftoken's tag to "$undefined" instead of "$undefined.".
15509 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
15510 Adjust.
15511
15512 2002-07-29 Akim Demaille <akim@epita.fr>
15513
15514 * src/reduce.c (reduce_grammar): When the language is empty,
15515 complain about the start symbol, not the axiom.
15516 Use its location.
15517 * tests/reduce.at (Empty Language): New.
15518
15519 2002-07-26 Akim Demaille <akim@epita.fr>
15520
15521 * src/reader.h, src/reader.c (gram_error): ... can't get
15522 yycontrol without making too strong assumptions on the parser
15523 itself.
15524 * src/output.c (prepare_tokens): Use the real 0th value of
15525 token_translations instead of `0'.
15526 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
15527 visible here.
15528 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
15529 for the time being: %locations ought to provide it to yyerror.
15530
15531 2002-07-25 Akim Demaille <akim@epita.fr>
15532
15533 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
15534 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
15535 * tests/regression.at (Web2c Actions): Adjust.
15536
15537 2002-07-25 Akim Demaille <akim@epita.fr>
15538
15539 Stop storing rules from 1 to nrules + 1.
15540
15541 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
15542 * src/nullable.c, src/output.c, src/print.c, src/reader.c
15543 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
15544 Iterate from 0 to nrules.
15545 Use rule_number_as_item_number and item_number_as_rule_number.
15546 Adjust to `derive' now containing possibly 0.
15547 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
15548 Handle the `- 1' part in rule numbers from/to item numbers.
15549 * src/conflicts.c (log_resolution): Fix the message which reversed
15550 shift and reduce.
15551 * src/output.c (action_row): Initialize default_rule to -1.
15552 (token_actions): Adjust.
15553 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
15554 expected output.
15555 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
15556
15557 2002-07-25 Akim Demaille <akim@epita.fr>
15558
15559 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
15560 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
15561 (b4_c_knr_arg_decl): New.
15562 * data/yacc.c: Use it to define yysymprint, yydestruct, and
15563 yyreport_parse_error.
15564
15565 2002-07-25 Akim Demaille <akim@epita.fr>
15566
15567 * data/yacc.c (yyreport_parse_error): New, extracted from...
15568 (yyparse): here.
15569 (yydestruct, yysymprint): Move above yyparse.
15570 Be K&R compliant.
15571
15572 2002-07-25 Akim Demaille <akim@epita.fr>
15573
15574 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
15575 replace...
15576 (b4_sint_type, b4_uint_type): these.
15577 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
15578 * tests/regression.at (Web2c Actions): Adjust.
15579
15580 2002-07-25 Akim Demaille <akim@epita.fr>
15581
15582 * src/gram.h (TIEM_NUMBER_MAX): New.
15583 (item_number_of_rule_number, rule_number_of_item_number): Rename
15584 as...
15585 (rule_number_as_item_number, item_number_as_rule_number): these.
15586 Adjust dependencies.
15587 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
15588 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
15589 (symbol_number_to_vector_number): New.
15590 (order): Of vector_number_t* type.
15591 (base_t, BASE_MAX, BASE_MIN): New.
15592 (froms, tos, width, pos, check): Of base_t type.
15593 (action_number_t, ACTION_MIN, ACTION_MAX): New.
15594 (actrow): Of action_number_t type.
15595 (conflrow): Of unsigned int type.
15596 (table_ninf, base_ninf): New.
15597 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
15598 (muscle_insert_int_table, muscle_insert_base_table)
15599 (muscle_insert_rule_number_table): New.
15600 (prepare_tokens): Output `toknum' as int_table.
15601 (action_row): Returns a rule_number_t.
15602 Use ACTION_MIN, not SHRT_MIN.
15603 (token_actions): yydefact is rule_number_t*.
15604 (table_ninf_remap): New.
15605 (pack_table): Use it for `base' and `table'.
15606 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
15607 replaced with...
15608 (YYPACT_NINF, YYTABLE_NINF): these.
15609 (yypact, yytable): Compute their types instead of hard-coded
15610 `short'.
15611 * tests/regression.at (Web2c Actions): Adjust.
15612
15613 2002-07-19 Akim Demaille <akim@epita.fr>
15614
15615 * src/scan-gram.l (id): Can start with an underscore.
15616
15617 2002-07-16 Akim Demaille <akim@epita.fr>
15618
15619 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
15620 Adjust all former `associativity' dependencies.
15621 * src/symtab.c (symbol_new): Default associativity is `undef', not
15622 `right'.
15623 (symbol_check_alias_consistence): Adjust.
15624
15625 2002-07-09 Akim Demaille <akim@epita.fr>
15626
15627 * doc/bison.texinfo: Properly set the ``header'' part.
15628 Use @dircategory ``GNU programming tools'' as per Texinfo's
15629 documentation.
15630 Use @copying.
15631
15632 2002-07-09 Akim Demaille <akim@epita.fr>
15633
15634 * lib/quotearg.h: Protect against multiple inclusions.
15635 * src/location.h (location_t): Add a `file' member.
15636 (LOCATION_RESET, LOCATION_PRINT): Adjust.
15637 * src/complain.c (warn_at, complain_at, fatal_at): Drop
15638 `error_one_per_line' support.
15639
15640 2002-07-09 Akim Demaille <akim@epita.fr>
15641
15642 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
15643 * src/reader.c (lineno): Remove.
15644 Adjust all dependencies.
15645 (get_merge_function): Take a location and use complain_at.
15646 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
15647 * tests/regression.at (Invalid inputs, Mixing %token styles):
15648 Adjust.
15649
15650 2002-07-09 Akim Demaille <akim@epita.fr>
15651
15652 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
15653 recovery rule, and forbid extensions when --yacc.
15654 (gram_error): Use complain_at.
15655 * src/reader.c (reader): Exit if there were parse errors.
15656
15657 2002-07-09 Akim Demaille <akim@epita.fr>
15658
15659 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
15660 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
15661 Reported by R Blake <blakers@mac.com>.
15662
15663 2002-07-09 Akim Demaille <akim@epita.fr>
15664
15665 * data/yacc.c: Output the copyright notive in the header.
15666
15667 2002-07-03 Akim Demaille <akim@epita.fr>
15668
15669 * src/output.c (froms, tos): Are state_number_t.
15670 (save_column): sp, sp1, and sp2 are state_number_t.
15671 (prepare): Rename `final' as `final_state_number', `nnts' as
15672 `nterms_number', `nrules' as `rules_number', `nstates' as
15673 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
15674 unused.
15675 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
15676 * data/lalr1.cc (nsym_): Remove, unused.
15677
15678 2002-07-03 Akim Demaille <akim@epita.fr>
15679
15680 * src/lalr.h, src/lalr.c (goto_number_t): New.
15681 * src/lalr.c (goto_list_t): New.
15682 Propagate them.
15683 * src/nullable.c (rule_list_t): New.
15684 Propagate.
15685 * src/types.h: Remove.
15686
15687 2002-07-03 Akim Demaille <akim@epita.fr>
15688
15689 * src/closure.c (print_fderives): Use rule_rhs_print.
15690 * src/derives.c (print_derives): Use rule_rhs_print.
15691 (rule_list_t): New, replaces `shorts'.
15692 (set_derives): Add comments.
15693 * tests/sets.at (Nullable, Firsts): Adjust.
15694
15695 2002-07-03 Akim Demaille <akim@epita.fr>
15696
15697 * src/output.c (prepare_actions): Free `tally' and `width'.
15698 (prepare_actions): Allocate and free `order'.
15699 * src/symtab.c (symbols_free): Free `symbols'.
15700 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
15701 * src/output.c (m4_invoke): Move to...
15702 * src/scan-skel.l: here.
15703 (<<EOF>>): Close yyout, and free its name.
15704
15705 2002-07-03 Akim Demaille <akim@epita.fr>
15706
15707 Fix some memory leaks, and fix a bug: state 0 was examined twice.
15708
15709 * src/LR0.c (new_state): Merge into...
15710 (state_list_append): this.
15711 (new_states): Merge into...
15712 (generate_states): here.
15713 (set_states): Don't ensure a proper `errs' state member here, do it...
15714 * src/conflicts.c (conflicts_solve): here.
15715 * src/state.h, src/state.c: Comment changes.
15716 (state_t): Rename member `shifts' as `transitions'.
15717 Adjust all dependencies.
15718 (errs_new): For consistency, also take the values as argument.
15719 (errs_dup): Remove.
15720 (state_errs_set): New.
15721 (state_reductions_set, state_transitions_set): Assert that no
15722 previous value was assigned.
15723 (state_free): New.
15724 (states_free): Use it.
15725 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
15726 temporary storage: use `errs' and `nerrs' as elsewhere.
15727 (set_conflicts): Allocate and free this `errs'.
15728
15729 2002-07-02 Akim Demaille <akim@epita.fr>
15730
15731 * lib/libiberty.h: New.
15732 * lib: Update the bitset implementation from upstream.
15733 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
15734 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
15735 * src/main.c: Adjust bitset stats calls.
15736
15737 2002-07-01 Paul Eggert <eggert@twinsun.com>
15738
15739 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
15740 char, so that negative chars don't collide with $.
15741
15742 2002-06-30 Akim Demaille <akim@epita.fr>
15743
15744 Have the GLR tests be `warning' checked, and fix the warnings.
15745
15746 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
15747 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
15748 (yyremoveDeletes): `yyi' and `yyj' are size_t.
15749 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
15750 (yyaddDeferredAction): static.
15751 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
15752 (yyreportParseError): yyprefix is const.
15753 yytokenp is used only when verbose.
15754 (yy__GNUC__): Replace with __GNUC__.
15755 (yypdumpstack): yyi is size_t.
15756 (yypreference): Un-yy local variables and arguments, to avoid
15757 clashes with `yyr1'. Anyway, we are not in the user name space.
15758 (yytname_size): be an int, as is compared with ints.
15759 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
15760 Use them.
15761 * tests/cxx-gram.at: Use quotation to protect $1.
15762 Use AT_COMPILE to enable warnings hunts.
15763 Prototype yylex and yyerror.
15764 `Use' argc.
15765 Include `string.h', not `strings.h'.
15766 Produce and prototype stmtMerge only when used.
15767 yylex takes a location.
15768
15769 2002-06-30 Akim Demaille <akim@epita.fr>
15770
15771 We spend a lot of time in quotearg, in particular when --verbose.
15772
15773 * src/symtab.c (symbol_get): Store a quoted version of the key.
15774 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
15775 Adjust all callers.
15776
15777 2002-06-30 Akim Demaille <akim@epita.fr>
15778
15779 * src/state.h (reductions_t): Rename member `nreds' as num.
15780 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
15781 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
15782
15783 2002-06-30 Akim Demaille <akim@epita.fr>
15784
15785 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
15786 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
15787 (shifts_to): Rename as...
15788 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
15789 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
15790 (TRANSITION_IS_DISABLED, transitions_to): these.
15791
15792 2002-06-30 Akim Demaille <akim@epita.fr>
15793
15794 * src/print.c (print_shifts, print_gotos): Merge into...
15795 (print_transitions): this.
15796 (print_transitions, print_errs, print_reductions): Align the
15797 lookaheads columns.
15798 (print_core, print_transitions, print_errs, print_state,
15799 print_grammar): Output empty lines separator before, not after.
15800 (state_default_rule_compute): Rename as...
15801 (state_default_rule): this.
15802 * tests/conflicts.at (Defaulted Conflicted Reduction),
15803 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
15804 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
15805
15806 2002-06-30 Akim Demaille <akim@epita.fr>
15807
15808 Display items as we display rules.
15809
15810 * src/gram.h, src/gram.c (rule_lhs_print): New.
15811 * src/gram.c (grammar_rules_partial_print): Use it.
15812 * src/print.c (print_core): Likewise.
15813 * tests/conflicts.at (Defaulted Conflicted Reduction),
15814 (Unresolved SR Conflicts): Adjust.
15815 (Unresolved SR Conflicts): Adjust and rename as...
15816 (Resolved SR Conflicts): this, as was meant.
15817 * tests/regression.at (Web2c Report): Adjust.
15818
15819 2002-06-30 Akim Demaille <akim@epita.fr>
15820
15821 * src/print.c (state_default_rule_compute): New, extracted from...
15822 (print_reductions): here.
15823 Pessimize, but clarify the code.
15824 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
15825
15826 2002-06-30 Akim Demaille <akim@epita.fr>
15827
15828 * src/output.c (action_row): Let default_rule be always a rule
15829 number.
15830
15831 2002-06-30 Akim Demaille <akim@epita.fr>
15832
15833 * src/closure.c (print_firsts, print_fderives, closure):
15834 Use BITSET_EXECUTE.
15835 * src/lalr.c (lookaheads_print): Likewise.
15836 * src/state.c (state_rule_lookaheads_print): Likewise.
15837 * src/print_graph.c (print_core): Likewise.
15838 * src/print.c (print_reductions): Likewise.
15839 * src/output.c (action_row): Likewise.
15840 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
15841
15842 2002-06-30 Akim Demaille <akim@epita.fr>
15843
15844 * src/print_graph.c: Use report_flag.
15845
15846 2002-06-30 Akim Demaille <akim@epita.fr>
15847
15848 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
15849 to...
15850 * src/relation.h, src/relation.c (traverse, relation_digraph)
15851 (relation_print, relation_transpose): New.
15852
15853 2002-06-30 Akim Demaille <akim@epita.fr>
15854
15855 * src/state.h, src/state.c (shifts_to): New.
15856 * src/lalr.c (build_relations): Use it.
15857
15858 2002-06-30 Akim Demaille <akim@epita.fr>
15859
15860 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
15861 (item_number_of_rule_number, rule_number_of_item_number): New.
15862 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
15863 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
15864 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
15865 Propagate their use.
15866 Much remains to be done, in particular wrt `shorts' from types.h.
15867
15868 2002-06-30 Akim Demaille <akim@epita.fr>
15869
15870 * src/symtab.c (symbol_new): Initialize the `printer' member.
15871
15872 2002-06-30 Akim Demaille <akim@epita.fr>
15873
15874 * src/LR0.c (save_reductions): Remove, replaced by...
15875 * src/state.h, src/state.c (state_reductions_set): New.
15876 (reductions, errs): Rename as...
15877 (reductions_t, errs_t): these.
15878 Adjust all dependencies.
15879
15880 2002-06-30 Akim Demaille <akim@epita.fr>
15881
15882 * src/LR0.c (state_list_t, state_list_append): New.
15883 (first_state, last_state): Now symbol_list_t.
15884 (this_state): Remove.
15885 (new_itemsets, append_states, save_reductions): Take a state_t as
15886 argument.
15887 (set_states, generate_states): Adjust.
15888 (save_shifts): Remove, replaced by...
15889 * src/state.h, src/state.c (state_shifts_set): New.
15890 (shifts): Rename as...
15891 (shifts_t): this.
15892 Adjust all dependencies.
15893 * src/state.h (state_t): Remove the `next' member.
15894
15895 2002-06-30 Akim Demaille <akim@epita.fr>
15896
15897 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
15898 escaped in slot 0.
15899
15900 2002-06-30 Akim Demaille <akim@epita.fr>
15901
15902 Use hash.h for the state hash table.
15903
15904 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
15905 (allocate_storage): Use state_hash_new.
15906 (free_storage): Use state_hash_free.
15907 (new_state, get_state): Adjust.
15908 * src/lalr.h, src/lalr.c (states): Move to...
15909 * src/states.h (state_t): Remove the `link' member, no longer
15910 used.
15911 * src/states.h, src/states.c: here.
15912 (state_hash_new, state_hash_free, state_hash_lookup)
15913 (state_hash_insert, states_free): New.
15914 * src/states.c (state_table, state_compare, state_hash): New.
15915 * src/output.c (output_actions): Do not free states now, since we
15916 still need to know the final_state number in `prepare', called
15917 afterwards. Do it...
15918 * src/main.c (main): here: call states_free after `output'.
15919
15920 2002-06-30 Akim Demaille <akim@epita.fr>
15921
15922 * src/state.h, src/state.c (state_new): New, extracted from...
15923 * src/LR0.c (new_state): here.
15924 * src/state.h (STATE_ALLOC): Move to...
15925 * src/state.c: here.
15926 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
15927 * src/state.h, src/state.c: here.
15928
15929 2002-06-30 Akim Demaille <akim@epita.fr>
15930
15931 * src/reader.c (gensym): Rename as...
15932 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
15933 (getsym): Rename as...
15934 (symbol_get): this.
15935
15936 2002-06-30 Akim Demaille <akim@epita.fr>
15937
15938 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
15939 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
15940 * src/output.c, src/print.c, src/print_graph.c: Propagate.
15941 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
15942
15943 2002-06-30 Akim Demaille <akim@epita.fr>
15944
15945 Make the test suite pass with warnings checked.
15946
15947 * tests/actions.at (Printers and Destructors): Improve.
15948 Avoid unsigned vs. signed issues.
15949 * tests/calc.at: Don't exercise the scanner here, do it...
15950 * tests/input.at (Torturing the Scanner): here.
15951
15952 2002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15953
15954 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
15955 reorganize first lines parallel to yacc.c.
15956
15957 2002-06-28 Akim Demaille <akim@epita.fr>
15958
15959 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
15960 (b4_token_enum, b4_token_defines): New, factored from...
15961 * data/lalr1.cc, data/yacc.c, glr.c: here.
15962
15963 2002-06-28 Akim Demaille <akim@epita.fr>
15964
15965 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
15966 unused variables.
15967 * src/output.c (merger_output): static.
15968
15969 2002-06-28 Akim Demaille <akim@epita.fr>
15970
15971 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
15972 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
15973 pacify GCC.
15974 * src/output.c (save_row): Initialize all the variables to pacify GCC.
15975
15976 2002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15977
15978 Accumulated changelog for new GLR parsing features.
15979
15980 * src/conflicts.c (count_total_conflicts): Change name to
15981 conflicts_total_count.
15982 * src/conflicts.h: Ditto.
15983 * src/output.c (token_actions): Use the new name.
15984 (output_conflicts): Change conflp => conflict_list_heads, and
15985 confl => conflict_list for better readability.
15986 * data/glr.c: Use the new names.
15987 * NEWS: Add self to GLR announcement.
15988
15989 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
15990
15991 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
15992 Akim Demaille.
15993
15994 * data/bison.glr: Change name to glr.c
15995 * data/glr.c: Renamed from bison.glr.
15996 * data/Makefile.am: Add glr.c
15997
15998 * src/getargs.c:
15999
16000 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
16001 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
16002
16003 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16004
16005 * data/bison.glr: Be sure to restore the
16006 current #line when returning to the skeleton contents after having
16007 exposed the input file's #line.
16008
16009 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16010
16011 * data/bison.glr: Bring up to date with changes to bison.simple.
16012
16013 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16014
16015 * data/bison.glr: Correct definitions that use b4_prefix.
16016 Various reformatting.
16017 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
16018 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
16019 yytokenp argument; now part of stack.
16020 (yychar): Define to behave as documented.
16021 (yyclearin): Ditto.
16022
16023 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16024
16025 * src/reader.h: Add declaration for free_merger_functions.
16026
16027 * src/reader.c (merge_functions): New variable.
16028 (get_merge_function): New function.
16029 (free_merger_functions): New function.
16030 (readgram): Check for %prec that is not followed by a symbol.
16031 Handle %dprec and %merge declarations.
16032 (packgram): Initialize dprec and merger fields in rules array.
16033
16034 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
16035 conflict_list_cnt, conflict_list_free): New variables.
16036 (table_grow): Also grow conflict_table.
16037 (prepare_rules): Output dprec and merger tables.
16038 (conflict_row): New function.
16039 (action_row): Output conflict lists for GLR parser. Don't use
16040 default reduction in conflicted states for GLR parser so that there
16041 are spaces for the conflict lists.
16042 (save_row): Also save conflict information.
16043 (token_actions): Allocate conflict list.
16044 (merger_output): New function.
16045 (pack_vector): Pack conflict table, too.
16046 (output_conflicts): New function to output yyconflp and yyconfl.
16047 (output_check): Allocate conflict_tos.
16048 (output_actions): Output conflict tables, also.
16049 (output_skeleton): Output b4_mergers definition.
16050 (prepare): Output b4_max_rhs_length definition.
16051 Use 'bison.glr' as default skeleton for GLR parsers.
16052
16053 * src/gram.c (glr_parser): New flag.
16054 (grammar_free): Call free_merger_functions.
16055
16056 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
16057 all pairs of conflicting reductions, rather than just all tokens
16058 causing conflicts. Needed to size conflict tables.
16059 (conflicts_output): Modify call to count_rr_conflicts for new
16060 interface.
16061 (conflicts_print): Ditto.
16062 (count_total_conflicts): New function.
16063
16064 * src/reader.h (merger_list): New type.
16065 (merge_functions): New variable.
16066
16067 * src/lex.h (tok_dprec, tok_merge): New token types.
16068
16069 * src/gram.h (rule_s): Add dprec and merger fields.
16070 (glr_parser): New flag.
16071
16072 * src/conflicts.h (count_total_conflicts): New function.
16073
16074 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
16075
16076 * doc/bison.texinfo (Generalized LR Parsing): New section.
16077 (GLR Parsers): New section.
16078 (Language and Grammar): Mention GLR parsing.
16079 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
16080 Correct typo ("tge" -> "the").
16081
16082 * data/bison.glr: New skeleton for GLR parsing.
16083
16084 * tests/cxx-gram.at: New tests for GLR parsing.
16085
16086 * tests/testsuite.at: Include cxx-gram.at.
16087
16088 * tests/Makefile.am: Add cxx-gram.at.
16089
16090 * src/parse-gram.y:
16091
16092 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
16093
16094 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
16095
16096 2002-06-27 Akim Demaille <akim@epita.fr>
16097
16098 * src/options.h, src/options.c: Remove.
16099 * src/getargs.c (short_options, long_options): New.
16100
16101 2002-06-27 Akim Demaille <akim@epita.fr>
16102
16103 * data/bison.simple, data/bison.c++: Rename as...
16104 * data/yacc.c, data/lalr1.cc: these.
16105 * doc/bison.texinfo (Environment Variables): Remove.
16106
16107 2002-06-25 Raja R Harinath <harinath@cs.umn.edu>
16108
16109 * src/getargs.c (report_argmatch): Initialize strtok().
16110
16111 2002-06-20 Akim Demaille <akim@epita.fr>
16112
16113 * data/bison.simple (b4_symbol_actions): New, replaces...
16114 (b4_symbol_destructor, b4_symbol_printer): these.
16115 (yysymprint): Be sure to call YYPRINT only for tokens, and using
16116 user token numbers.
16117
16118 2002-06-20 Akim Demaille <akim@epita.fr>
16119
16120 * data/bison.simple (yydestructor): Rename as...
16121 (yydestruct): this.
16122
16123 2002-06-20 Akim Demaille <akim@epita.fr>
16124
16125 * src/symtab.h, src/symtab.c (symbol_type_set)
16126 (symbol_destructor_set, symbol_precedence_set): The location is
16127 the last argument.
16128 Adjust all callers.
16129
16130 2002-06-20 Akim Demaille <akim@epita.fr>
16131
16132 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
16133 internals.
16134 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
16135 Takes a location.
16136 * src/symtab.h, src/symtab.c (symbol_class_set)
16137 (symbol_user_token_number_set): Likewise.
16138 Adjust all callers.
16139 Promote complain_at.
16140 * tests/input.at (Type Clashes): Adjust.
16141
16142 2002-06-20 Akim Demaille <akim@epita.fr>
16143
16144 * data/bison.simple (YYLEX): Fix the declaration when
16145 %pure-parser.
16146
16147 2002-06-20 Akim Demaille <akim@epita.fr>
16148
16149 * data/bison.simple (yysymprint): Don't print the token number,
16150 just its name.
16151 * tests/actions.at (Destructors): Rename as...
16152 (Printers and Destructors): this.
16153 Also exercise %printer.
16154
16155 2002-06-20 Akim Demaille <akim@epita.fr>
16156
16157 * data/bison.simple (YYDSYMPRINT): New.
16158 Use it to remove many of the #if YYDEBUG/if (yydebug).
16159
16160 2002-06-20 Akim Demaille <akim@epita.fr>
16161
16162 * src/symtab.h, src/symtab.c (symbol_t): printer and
16163 printer_location are new members.
16164 (symbol_printer_set): New.
16165 * src/parse-gram.y (PERCENT_PRINTER): New token.
16166 Handle its associated rule.
16167 * src/scan-gram.l: Adjust.
16168 (handle_destructor_at, handle_destructor_dollar): Rename as...
16169 (handle_symbol_code_at, handle_symbol_code_dollar): these.
16170 * src/output.c (symbol_printers_output): New.
16171 (output_skeleton): Call it.
16172 * data/bison.simple (yysymprint): New. Cannot be named yyprint
16173 since there are already many grammar files with a user `yyprint'.
16174 Replace the calls to YYPRINT to calls to yysymprint.
16175 * tests/calc.at: Adjust.
16176 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
16177 taking advantage of parser very internal details (stack size!).
16178
16179 2002-06-20 Akim Demaille <akim@epita.fr>
16180
16181 * src/scan-gram.l: Complete the scanner with the missing patterns
16182 to pacify Flex.
16183 Use `quote' and `symbol_tag_get' where appropriate.
16184
16185 2002-06-19 Akim Demaille <akim@epita.fr>
16186
16187 * tests/actions.at (Destructors): Augment to test locations.
16188 * data/bison.simple (yydestructor): Pass it the current location
16189 if locations are enabled.
16190 Prototype only when __STDC__ or C++.
16191 Change the argument names to move into the yy name space: there is
16192 user code here.
16193
16194 2002-06-19 Akim Demaille <akim@epita.fr>
16195
16196 * data/bison.simple (b4_pure_if): New.
16197 Use it instead of #ifdef YYPURE.
16198
16199 2002-06-19 Akim Demaille <akim@epita.fr>
16200
16201 * data/bison.simple (b4_location_if): New.
16202 Use it instead of #ifdef YYLSP_NEEDED.
16203
16204 2002-06-19 Akim Demaille <akim@epita.fr>
16205
16206 Prepare @$ in %destructor, but currently don't bind it in the
16207 skeleton, as %location use is not cleaned up yet.
16208
16209 * src/scan-gram.l (handle_dollar, handle_destructor_at)
16210 (handle_action_at): New.
16211 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
16212 a braced_code_t and a location as additional arguments.
16213 (handle_destructor_dollar): Instead of requiring `b4_eval', just
16214 unquote one when outputting `b4_dollar_dollar'.
16215 Adjust callers.
16216 * data/bison.simple (b4_eval): Remove.
16217 (b4_symbol_destructor): Adjust.
16218 * tests/input.at (Invalid @n): Adjust.
16219
16220 2002-06-19 Zack Weinberg <zack@codesourcery.com>
16221
16222 * doc/bison.texinfo: Document ability to have multiple
16223 prologue sections.
16224
16225 2002-06-18 Akim Demaille <akim@epita.fr>
16226
16227 * src/files.c (compute_base_names): When computing the output file
16228 names from the input file name, strip the directory part.
16229
16230 2002-06-18 Akim Demaille <akim@epita.fr>
16231
16232 * data/bison.simple.new: Comment changes.
16233 Reported by Andreas Schwab.
16234
16235 2002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
16236
16237 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
16238 there are no `label `yyoverflowlab' defined but not used' warnings
16239 when yyoverflow is defined.
16240
16241 2002-06-18 Akim Demaille <akim@epita.fr>
16242
16243 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
16244 new member.
16245 (symbol_destructor_set): Adjust.
16246 * src/output.c (symbol_destructors_output): Output the destructor
16247 locations.
16248 Output the symbol name.
16249 * data/bison.simple (b4_symbol_destructor): Adjust.
16250
16251 2002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
16252 and Akim Demaille <akim@epita.fr>
16253
16254 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
16255 what's left on the stack when the error recovery hits EOF.
16256 * tests/actions.at (Destructors): Complete to exercise this case.
16257
16258 2002-06-17 Akim Demaille <akim@epita.fr>
16259
16260 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
16261 arguments is really empty, not only equal to `[]'.
16262 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
16263 member.
16264 (symbol_destructor_set): New.
16265 * src/output.c (symbol_destructors_output): New.
16266 * src/reader.h (brace_code_t, current_braced_code): New.
16267 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
16268 (handle_dollar): Rename as...
16269 (handle_action_dollar): this.
16270 (handle_destructor_dollar): New.
16271 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
16272 (grammar_declaration): Use it.
16273 * data/bison.simple (yystos): Is always defined.
16274 (yydestructor): New.
16275 * tests/actions.at (Destructors): New.
16276 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
16277
16278 2002-06-17 Akim Demaille <akim@epita.fr>
16279
16280 * src/symlist.h, src/symlist.c (symbol_list_length): New.
16281 * src/scan-gram.l (handle_dollar, handle_at): Compute the
16282 rule_length only when needed.
16283 * src/output.c (actions_output, token_definitions_output): Output
16284 the full M4 block.
16285 * src/symtab.c: Don't access directly to the symbol tag, use
16286 symbol_tag_get.
16287 * src/parse-gram.y: Use symbol_list_free.
16288
16289 2002-06-17 Akim Demaille <akim@epita.fr>
16290
16291 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
16292 (symbol_list_prepend, get_type_name): Move to...
16293 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
16294 (symbol_list_prepend, symbol_list_n_type_name_get): here.
16295 Adjust all callers.
16296 (symbol_list_free): New.
16297 * src/scan-gram.l (handle_dollar): Takes a location.
16298 * tests/input.at (Invalid $n): Adjust.
16299
16300 2002-06-17 Akim Demaille <akim@epita.fr>
16301
16302 * src/reader.h, src/reader.c (symbol_list_new): Export it.
16303 (symbol_list_prepend): New.
16304 * src/parse-gram.y (%union): `list' is a new member.
16305 (symbols.1): New, replaces...
16306 (terms_to_prec.1, nterms_to_type.1): these.
16307 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
16308 Take a location as additional argument.
16309 Adjust all callers.
16310
16311 2002-06-15 Akim Demaille <akim@epita.fr>
16312
16313 * src/parse-gram.y: Move %token in the declaration section so that
16314 we don't depend upon CVS Bison.
16315
16316 2002-06-15 Akim Demaille <akim@epita.fr>
16317
16318 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
16319 * src/print.c (print_core): Use it.
16320
16321 2002-06-15 Akim Demaille <akim@epita.fr>
16322
16323 * src/conflicts.c (log_resolution): Accept the rule involved in
16324 the sr conflicts instead of the lookahead number that points to
16325 that rule.
16326 (flush_reduce): Accept the current lookahead vector as argument,
16327 instead of the index in LA.
16328 (resolve_sr_conflict): Accept the current number of lookahead
16329 bitset to consider for the STATE, instead of the index in LA.
16330 (set_conflicts): Adjust.
16331 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
16332
16333 2002-06-15 Akim Demaille <akim@epita.fr>
16334
16335 * src/state.h (state_t): Replace the `lookaheadsp' member, a
16336 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
16337 Adjust all dependencies.
16338 * src/lalr.c (initialize_lookaheads): Split into...
16339 (states_lookaheads_count, states_lookaheads_initialize): these.
16340 (lalr): Adjust.
16341
16342 2002-06-15 Akim Demaille <akim@epita.fr>
16343
16344 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
16345 out of...
16346 (grammar_rules_print): here.
16347 * src/reduce.c (reduce_output): Use it.
16348 * tests/reduce.at (Useless Rules, Reduced Automaton)
16349 (Underivable Rules): Adjust.
16350
16351 2002-06-15 Akim Demaille <akim@epita.fr>
16352
16353 Copy BYacc's nice way to report the grammar.
16354
16355 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
16356 New.
16357 Don't print the rules' location, it is confusing and useless.
16358 (rule_print): Use grammar_rhs_print.
16359 * src/print.c (print_grammar): Use grammar_rules_print.
16360
16361 2002-06-15 Akim Demaille <akim@epita.fr>
16362
16363 Complete and rationalize `useless thing' warnings.
16364
16365 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
16366 (symbol_tag_print): New.
16367 Use them everywhere in place of accessing directly the tag member.
16368 * src/gram.h, src/gram.c (rule_print): New.
16369 Use it where a rule used to be printed `by hand'.
16370 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
16371 (reduce_grammar_tables): Report the useless rules.
16372 (reduce_print): Useless things are a warning, not an error.
16373 Report it as such.
16374 * tests/reduce.at (Useless Nonterminals, Useless Rules):
16375 (Reduced Automaton, Underivable Rules): Adjust.
16376 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
16377 * tests/conflicts.at (Unresolved SR Conflicts)
16378 (Solved SR Conflicts): Adjust.
16379
16380 2002-06-15 Akim Demaille <akim@epita.fr>
16381
16382 Let symbols have a location.
16383
16384 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
16385 (getsym): Adjust.
16386 Adjust all callers.
16387 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
16388 Use location_t, not int.
16389 * src/symtab.c (symbol_check_defined): Take advantage of the
16390 location.
16391 * tests/regression.at (Invalid inputs): Adjust.
16392
16393 2002-06-15 Akim Demaille <akim@epita.fr>
16394
16395 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
16396 (input): Don't try to initialize yylloc here, do it in the
16397 scanner.
16398 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
16399 * src/gram.h (rule_t): Change line and action_line into location
16400 and action_location, of location_t type.
16401 Adjust all dependencies.
16402 * src/location.h, src/location.c (empty_location): New.
16403 * src/reader.h, src/reader.c (grammar_start_symbol_set)
16404 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
16405 (grammar_current_rule_symbol_append)
16406 (grammar_current_rule_action_append): Expect a location as argument.
16407 * src/reader.c (grammar_midrule_action): Adjust to attach an
16408 action's location as dummy symbol location.
16409 * src/symtab.h, src/symtab.c (startsymbol_location): New.
16410 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
16411 the line numbers.
16412
16413 2002-06-14 Akim Demaille <akim@epita.fr>
16414
16415 Grammar declarations may be found in the grammar section.
16416
16417 * src/parse-gram.y (rules_or_grammar_declaration): New.
16418 (declarations): Each declaration may end with a semicolon, not
16419 just...
16420 (grammar_declaration): `"%union"'.
16421 (grammar): Branch to rules_or_grammar_declaration.
16422
16423 2002-06-14 Akim Demaille <akim@epita.fr>
16424
16425 * src/main.c (main): Invoke scanner_free.
16426
16427 2002-06-14 Akim Demaille <akim@epita.fr>
16428
16429 * src/output.c (m4_invoke): Extracted from...
16430 (output_skeleton): here.
16431 Free tempfile.
16432
16433 2002-06-14 Akim Demaille <akim@epita.fr>
16434
16435 * src/parse-gram.y (directives, directive, gram)
16436 (grammar_directives, precedence_directives, precedence_directive):
16437 Rename as...
16438 (declarations, declaration, grammar, grammar_declaration)
16439 (precedence_declaration, precedence_declarator): these.
16440 (symbol_declaration): New.
16441
16442 2002-06-14 Akim Demaille <akim@epita.fr>
16443
16444 * src/files.c (action_obstack): Remove, unused.
16445 (output_obstack): Remove it, and all its dependencies, as it is no
16446 longer needed.
16447 * src/reader.c (epilogue_set): Build the epilogue in the
16448 muscle_obstack.
16449 * src/output.h, src/output.c (muscle_obstack): Move to...
16450 * src/muscle_tab.h, src/muscle_tab.h: here.
16451 (muscle_init): Initialize muscle_obstack.
16452 (muscle_free): New.
16453 * src/main.c (main): Call it.
16454
16455 2002-06-14 Akim Demaille <akim@epita.fr>
16456
16457 * src/location.h: New, extracted from...
16458 * src/reader.h: here.
16459 * src/Makefile.am (noinst_HEADERS): Merge into
16460 (bison_SOURCES): this.
16461 Add location.h.
16462 * src/parse-gram.y: Use location_t instead of Bison's.
16463 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
16464 Use location_t instead of ints.
16465
16466 2002-06-14 Akim Demaille <akim@epita.fr>
16467
16468 * data/bison.simple, data/bison.c++: Be sure to restore the
16469 current #line when returning to the skeleton contents after having
16470 exposed the input file's #line.
16471
16472 2002-06-12 Akim Demaille <akim@epita.fr>
16473
16474 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
16475 eager.
16476 * tests/actions.at (Exotic Dollars): New.
16477
16478 2002-06-12 Akim Demaille <akim@epita.fr>
16479
16480 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
16481 ['"/] too eagerly.
16482 * tests/input.at (Torturing the Scanner): New.
16483
16484 2002-06-11 Akim Demaille <akim@epita.fr>
16485
16486 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
16487 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
16488 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
16489 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
16490 * src/reader.c (reader): Use it.
16491
16492 2002-06-11 Akim Demaille <akim@epita.fr>
16493
16494 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
16495 Adjust all callers.
16496 (scanner_last_string_free): New.
16497
16498 2002-06-11 Akim Demaille <akim@epita.fr>
16499
16500 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
16501 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
16502 (last_string, YY_OBS_FREE): New.
16503 Use them when returning an ID.
16504
16505 2002-06-11 Akim Demaille <akim@epita.fr>
16506
16507 Have Bison grammars parsed by a Bison grammar.
16508
16509 * src/reader.c, src/reader.h (prologue_augment): New.
16510 * src/reader.c (copy_definition): Remove.
16511
16512 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
16513 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
16514 (grammar_current_rule_prec_set, grammar_current_rule_check)
16515 (grammar_current_rule_symbol_append)
16516 (grammar_current_rule_action_append): Export.
16517 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
16518 (symbol_list_action_append): Remove.
16519 Hook the routines from reader.
16520 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
16521 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
16522
16523 * src/reader.c (read_declarations): Remove, unused.
16524
16525 * src/parse-gram.y: Handle the epilogue.
16526 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
16527 (grammar_start_symbol_set): this.
16528 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
16529 * src/reader.c (readgram): Remove, unused.
16530 (reader): Adjust to insert eoftoken and axiom where appropriate.
16531
16532 * src/reader.c (copy_dollar): Replace with...
16533 * src/scan-gram.h (handle_dollar): this.
16534 * src/parse-gram.y: Remove `%thong'.
16535
16536 * src/reader.c (copy_at): Replace with...
16537 * src/scan-gram.h (handle_at): this.
16538
16539 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
16540 New.
16541
16542 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
16543 time being.
16544
16545 * src/reader.h, src/reader.c (grammar_rule_end): New.
16546
16547 * src/parse.y (current_type, current_class): New.
16548 Implement `%nterm', `%token' support.
16549 Merge `%term' into `%token'.
16550 (string_as_id): New.
16551 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
16552 type name.
16553
16554 * src/parse-gram.y: Be sure to handle properly the beginning of
16555 rules.
16556
16557 * src/parse-gram.y: Handle %type.
16558 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
16559
16560 * src/parse-gram.y: More directives support.
16561 * src/options.c: No longer handle source directives.
16562
16563 * src/parse-gram.y: Fix %output.
16564
16565 * src/parse-gram.y: Handle %union.
16566 Use the prologue locations.
16567 * src/reader.c (parse_union_decl): Remove.
16568
16569 * src/reader.h, src/reader.c (epilogue_set): New.
16570 * src/parse-gram.y: Use it.
16571
16572 * data/bison.simple, data/bison.c++: b4_stype is now either not
16573 defined, then default to int, or to the contents of %union,
16574 without `union' itself.
16575 Adjust.
16576 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
16577
16578 * src/output.c (actions_output): Don't output braces, as they are
16579 already handled by the scanner.
16580
16581 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
16582 characters to themselves.
16583
16584 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
16585 that the epilogue has a proper #line.
16586
16587 * src/parse-gram.y: Handle precedence/associativity.
16588
16589 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
16590 a terminal.
16591 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
16592 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
16593 at all to define terminals that cannot be emitted.
16594
16595 * src/scan-gram.l: Escape M4 characters.
16596
16597 * src/scan-gram.l: Working properly with escapes in user
16598 strings/characters.
16599
16600 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
16601 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
16602 grammar.
16603 Use more modest sizes, as for the time being the parser does not
16604 release memory, and therefore the process swallows a huge amount
16605 of memory.
16606
16607 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
16608 stricter %token grammar.
16609
16610 * src/symtab.h (associativity): Add `undef_assoc'.
16611 (symbol_precedence_set): Do nothing when passed an undef_assoc.
16612 * src/symtab.c (symbol_check_alias_consistence): Adjust.
16613
16614 * tests/regression.at (Invalid %directive): Remove, as it is now
16615 meaningless.
16616 (Invalid inputs): Adjust to the new error messages.
16617 (Token definitions): The new grammar doesn't allow too many
16618 eccentricities.
16619
16620 * src/lex.h, src/lex.c: Remove.
16621 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
16622 (copy_character, copy_string2, copy_string, copy_identifier)
16623 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
16624 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
16625 (parse_action): Remove.
16626 * po/POTFILES.in: Adjust.
16627
16628 2002-06-11 Akim Demaille <akim@epita.fr>
16629
16630 * src/reader.c (parse_action): Don't store directly into the
16631 rule's action member: return the action as a string.
16632 Don't require `rule_length' as an argument: compute it.
16633 (grammar_current_rule_symbol_append)
16634 (grammar_current_rule_action_append): New, eved out from
16635 (readgram): here.
16636 Remove `action_flag', `rulelength', unused now.
16637
16638 2002-06-11 Akim Demaille <akim@epita.fr>
16639
16640 * src/reader.c (grammar_current_rule_prec_set).
16641 (grammar_current_rule_check): New, eved out from...
16642 (readgram): here.
16643 Remove `xaction', `first_rhs': useless.
16644 * tests/input.at (Type clashes): New.
16645 * tests/existing.at (GNU Cim Grammar): Adjust.
16646
16647 2002-06-11 Akim Demaille <akim@epita.fr>
16648
16649 * src/reader.c (grammar_midrule_action): New, Eved out from
16650 (readgram): here.
16651
16652 2002-06-11 Akim Demaille <akim@epita.fr>
16653
16654 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
16655 New.
16656 (readgram): Use them as replacement of inlined code, crule and
16657 crule1.
16658
16659 2002-06-11 Akim Demaille <akim@epita.fr>
16660
16661 * src/reader.c (grammar_end, grammar_symbol_append): New.
16662 (readgram): Use them.
16663 Make the use of `p' as local as possible.
16664
16665 2002-06-10 Akim Demaille <akim@epita.fr>
16666
16667 GCJ's parser requires the tokens to be defined before the prologue.
16668
16669 * data/bison.simple: Output the token definition before the user's
16670 prologue.
16671 * tests/regression.at (Braces parsing, Duplicate string)
16672 (Mixing %token styles): Check the output from bison.
16673 (Early token definitions): New.
16674
16675 2002-06-10 Akim Demaille <akim@epita.fr>
16676
16677 * src/symtab.c (symbol_user_token_number_set): Don't complain when
16678 assigning twice the same user number to a token, so that we can
16679 use it in...
16680 * src/lex.c (lex): here.
16681 Also use `symbol_class_set' instead of hand written code.
16682 * src/reader.c (parse_assoc_decl): Likewise.
16683
16684 2002-06-10 Akim Demaille <akim@epita.fr>
16685
16686 * src/symtab.c, src/symtab.c (symbol_class_set)
16687 (symbol_user_token_number_set): New.
16688 * src/reader.c (parse_token_decl): Use them.
16689 Use a switch instead of ifs.
16690 Use a single argument.
16691
16692 2002-06-10 Akim Demaille <akim@epita.fr>
16693
16694 Remove `%thong' support as it is undocumented, unused, duplicates
16695 `%token's job, and creates useless e-mail traffic with people who
16696 want to know what it is, why it is undocumented, unused, and
16697 duplicates `%token's job.
16698
16699 * src/reader.c (parse_thong_decl): Remove.
16700 * src/options.c (option_table): Remove "thong".
16701 * src/lex.h (tok_thong): Remove.
16702
16703 2002-06-10 Akim Demaille <akim@epita.fr>
16704
16705 * src/symtab.c, src/symtab.c (symbol_type_set)
16706 (symbol_precedence_set): New.
16707 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
16708 (value_components_used): Remove, unused.
16709
16710 2002-06-09 Akim Demaille <akim@epita.fr>
16711
16712 Move symbols handling code out of the reader.
16713
16714 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
16715 (axiom): Move to...
16716 * src/symtab.h, src/symtab.c: here.
16717
16718 * src/gram.c (start_symbol): Remove: use startsymbol->number.
16719 * src/reader.c (startval): Rename as...
16720 * src/symtab.h, src/symtab.c (startsymbol): this.
16721 * src/reader.c: Adjust.
16722
16723 * src/reader.c (symbol_check_defined, symbol_make_alias)
16724 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
16725 (token_translations_init)
16726 Move to...
16727 * src/symtab.c: here.
16728 * src/reader.c (packsymbols): Move to...
16729 * src/symtab.h, src/symtab.c (symbols_pack): here.
16730 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
16731 argument.
16732
16733 2002-06-03 Akim Demaille <akim@epita.fr>
16734
16735 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
16736 then statements.
16737
16738 2002-06-03 Akim Demaille <akim@epita.fr>
16739
16740 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
16741 structs with non literals.
16742 * src/scan-skel.l: never-interactive.
16743 * src/conflicts.c (enum conflict_resolution_e): No trailing
16744 comma.
16745 * src/getargs.c (usage): Split long literal strings.
16746 Reported by Hans Aberg.
16747
16748 2002-05-28 Akim Demaille <akim@epita.fr>
16749
16750 * data/bison.c++: Use C++ ostreams.
16751 (cdebug_): New member.
16752
16753 2002-05-28 Akim Demaille <akim@epita.fr>
16754
16755 * src/output.c (output_skeleton): Be sure to allocate enough room
16756 for `/' _and_ for `\0' in full_skeleton.
16757
16758 2002-05-28 Akim Demaille <akim@epita.fr>
16759
16760 * data/bison.c++: Catch up with bison.simple:
16761 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16762 and Paul Eggert <eggert@twinsun.com>: `error' handing.
16763 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
16764 and popping traces.
16765
16766 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16767
16768 * src/output.c (output_skeleton): Put an explicit path in front of
16769 the skeleton file name, rather than relying on the -I directory,
16770 to partially alleviate effects of having a skeleton file lying around
16771 in the current directory.
16772
16773 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16774
16775 * src/conflicts.c (log_resolution): Correct typo:
16776 obstack_printf should be obstack_fgrow1.
16777
16778 2002-05-26 Akim Demaille <akim@epita.fr>
16779
16780 * src/state.h (state_t): `solved_conflicts' is a new member.
16781 * src/LR0.c (new_state): Set it to 0.
16782 * src/conflicts.h, src/conflicts.c (print_conflicts)
16783 (free_conflicts, solve_conflicts): Rename as...
16784 (conflicts_print, conflicts_free, conflicts_solve): these.
16785 Adjust callers.
16786 * src/conflicts.c (enum conflict_resolution_e)
16787 (solved_conflicts_obstack): New, used by...
16788 (log_resolution): this.
16789 Adjust to attach the conflict resolution to each state.
16790 Complete the description with the precedence/associativity
16791 information.
16792 (resolve_sr_conflict): Adjust.
16793 * src/print.c (print_state): Output its solved_conflicts.
16794 * tests/conflicts.at (Unresolved SR Conflicts)
16795 (Solved SR Conflicts): Exercise --report=all.
16796
16797 2002-05-26 Akim Demaille <akim@epita.fr>
16798
16799 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
16800 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
16801 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
16802 (token_number_t, item_number_as_token_number)
16803 (token_number_as_item_number, muscle_insert_token_number_table):
16804 Rename as...
16805 (symbol_number_t, item_number_as_symbol_number)
16806 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
16807 these, since it is more appropriate.
16808
16809 2002-05-26 Akim Demaille <akim@epita.fr>
16810
16811 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
16812 `Error:' lines.
16813 * data/bison.simple (yystos) [YYDEBUG]: New.
16814 (yyparse) [YYDEBUG]: Display the symbols which are popped during
16815 error recovery.
16816 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
16817
16818 2002-05-25 Akim Demaille <akim@epita.fr>
16819
16820 * doc/bison.texinfo (Debugging): Split into...
16821 (Tracing): this new section, its former contents, and...
16822 (Understanding): this new section.
16823 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
16824 by...
16825 (report_flag): this.
16826 Adjust all dependencies.
16827 (report_args, report_types, report_argmatch): New.
16828 (usage, getargs): Report/support -r, --report.
16829 * src/options.h
16830 (struct option_table_struct): Rename as..,
16831 (struct option_table_s): this.
16832 Rename the `set_flag' member to `flag' to match with getopt_long's
16833 struct.
16834 * src/options.c (option_table): Split verbose into an entry for
16835 %verbose, and another for --verbose.
16836 Support --report/-r, so remove -r from the obsolete --raw.
16837 * src/print.c: Attach full item sets and lookaheads reports to
16838 report_flag instead of trace_flag.
16839 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
16840
16841 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16842 and Paul Eggert <eggert@twinsun.com>
16843
16844 * data/bison.simple (yyparse): Correct error handling to conform to
16845 POSIX and yacc. Specifically, after syntax error is discovered,
16846 do not reduce further before shifting the error token.
16847 Clean up the code a bit by removing the labels yyerrdefault,
16848 yyerrhandle, yyerrpop.
16849 * NEWS: Document the above.
16850
16851 2002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16852
16853 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
16854 type; it isn't always big enough, since it doesn't necessarily
16855 include non-terminals.
16856 (yytranslate): Expand definition of yy_token_number_type, so that
16857 the latter can be removed.
16858 (yy_token_number_type): Remove, only one use.
16859 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
16860 don't use TokenNumberType as element type.
16861
16862 * tests/regression.at: Modify expected output to agree with change
16863 to yyr1 and yytranslate.
16864
16865 2002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
16866
16867 * src/reader.c (parse_action): Use copy_character instead of
16868 obstack_1grow.
16869
16870 2002-05-13 Akim Demaille <akim@epita.fr>
16871
16872 * tests/regression.at (Token definitions): Prototype yylex and
16873 yyerror.
16874
16875 2002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16876
16877 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
16878 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
16879 32-bit arithmetic.
16880 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
16881
16882 2002-05-07 Akim Demaille <akim@epita.fr>
16883
16884 * tests/synclines.at: Be sure to prototype yylex and yyerror to
16885 avoid GCC warnings.
16886
16887 2002-05-07 Akim Demaille <akim@epita.fr>
16888
16889 Kill GCC warnings.
16890
16891 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
16892 over the RHS of each rule.
16893 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
16894 * src/state.h (state_t): Member `nitems' is unsigned short.
16895 * src/LR0.c (get_state): Adjust.
16896 * src/reader.c (packgram): Likewise.
16897 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
16898 `Type'.
16899 (muscle_insert_int_table): Remove, unused.
16900 (prepare_rules): Remove `max'.
16901
16902 2002-05-06 Akim Demaille <akim@epita.fr>
16903
16904 * src/closure.c (print_firsts): Display of the symbol tags.
16905 (bitmatrix_print): Move to...
16906 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
16907 here.
16908 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
16909
16910 2002-05-06 Akim Demaille <akim@epita.fr>
16911
16912 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
16913 hash_do_for_each.
16914
16915 2002-05-06 Akim Demaille <akim@epita.fr>
16916
16917 * src/LR0.c (new_state, get_state): Instead of using the global
16918 `kernel_size' and `kernel_base', have two new arguments:
16919 `core_size' and `core'.
16920 Adjust callers.
16921
16922 2002-05-06 Akim Demaille <akim@epita.fr>
16923
16924 * src/reader.c (packgram): No longer end `ritem' with a 0
16925 sentinel: it is not used.
16926
16927 2002-05-05 Akim Demaille <akim@epita.fr>
16928
16929 New experimental feature: display the lookaheads in the report and
16930 graph.
16931
16932 * src/print (print_core): When --trace-flag, display the rules
16933 lookaheads.
16934 * src/print_graph.c (print_core): Likewise.
16935 Swap the arguments.
16936 Adjust caller.
16937
16938 2002-05-05 Akim Demaille <akim@epita.fr>
16939
16940 * tests/torture.at (Many lookaheads): New test.
16941
16942 2002-05-05 Akim Demaille <akim@epita.fr>
16943
16944 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
16945 (GENERATE_MUSCLE_INSERT_TABLE): this.
16946 (output_int_table, output_unsigned_int_table, output_short_table)
16947 (output_token_number_table, output_item_number_table): Replace with...
16948 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
16949 (muscle_insert_short_table, muscle_insert_token_number_table)
16950 (muscle_insert_item_number_table): these.
16951 Adjust all callers.
16952 (prepare_tokens): Don't free `translations', since...
16953 * src/reader.h, src/reader.c (grammar_free): do it.
16954 Move to...
16955 * src/gram.h, src/gram.c (grammar_free): here.
16956 * data/bison.simple, data/bison.c++: b4_token_number_max is now
16957 b4_translate_max.
16958
16959 2002-05-05 Akim Demaille <akim@epita.fr>
16960
16961 * src/output.c (output_unsigned_int_table): New.
16962 (prepare_rules): `i' is unsigned.
16963 `prhs', `rline', `r2' are unsigned int.
16964 Rename muscle `rhs_number_max' as `rhs_max'.
16965 Output muscles `prhs_max', `rline_max', and `r2_max'.
16966 Free rline and r1.
16967 * data/bison.simple, data/bison.c++: Adjust to use these muscles
16968 to compute types instead of constant types.
16969 * tests/regression.at (Web2c Actions): Adjust.
16970
16971 2002-05-04 Akim Demaille <akim@epita.fr>
16972
16973 * src/symtab.h (SALIAS, SUNDEF): Rename as...
16974 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
16975 Adjust dependencies.
16976 * src/output.c (token_definitions_output): Be sure not to output a
16977 `#define 'a'' when fed with `%token 'a' "a"'.
16978 * tests/regression.at (Token definitions): New.
16979
16980 2002-05-03 Paul Eggert <eggert@twinsun.com>
16981
16982 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
16983 for K&R C.
16984
16985 2002-05-03 gettextize <bug-gnu-gettext@gnu.org>
16986
16987 * Makefile.am (SUBDIRS): Remove intl.
16988 (EXTRA_DIST): Add config/config.rpath.
16989
16990 2002-05-03 Akim Demaille <akim@epita.fr>
16991
16992 * data/bison.simple (m4_if): Don't output empty enums.
16993 And actually, output valid enum definitions :(.
16994
16995 2002-05-03 Akim Demaille <akim@epita.fr>
16996
16997 * configure.bat: Remove, completely obsolete.
16998 * Makefile.am (EXTRA_DIST): Adjust.
16999 Don't distribute config.rpath...
17000 * config/Makefile.am (EXTRA_DIST): Do it.
17001
17002 2002-05-03 Akim Demaille <akim@epita.fr>
17003
17004 * configure.in (GETTEXT_VERSION): New.
17005 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
17006
17007 2002-05-03 Akim Demaille <akim@epita.fr>
17008
17009 * data/bison.simple (b4_token_enum): New.
17010 (b4_token_defines): Use it to output tokens both as #define and
17011 enums.
17012 Suggested by Paul Eggert.
17013 * src/output.c (token_definitions_output): Don't output spurious
17014 white spaces.
17015
17016 2002-05-03 Akim Demaille <akim@epita.fr>
17017
17018 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
17019
17020 2002-05-02 Robert Anisko <robert@lrde.epita.fr>
17021
17022 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
17023 Update the stack class, give a try to deque as the default container.
17024
17025 2002-05-02 Akim Demaille <akim@epita.fr>
17026
17027 * data/bison.simple (yyparse): Do not implement @$ = @1.
17028 (YYLLOC_DEFAULT): Adjust to do it.
17029 * doc/bison.texinfo (Location Default Action): Fix.
17030
17031 2002-05-02 Akim Demaille <akim@epita.fr>
17032
17033 * src/reader.c (parse_braces): Merge into...
17034 (parse_action): this.
17035
17036 2002-05-02 Akim Demaille <akim@epita.fr>
17037
17038 * configure.in (ALL_LINGUAS): Remove.
17039 * po/LINGUAS, hr.po: New.
17040
17041 2002-05-02 Akim Demaille <akim@epita.fr>
17042
17043 Remove the so called hairy (semantic) parsers.
17044
17045 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
17046 * src/gram.h, src/gram.c (semantic_parser): Remove.
17047 (rule_t): Remove the guard and guard_line members.
17048 * src/lex.h (token_t): remove tok_guard.
17049 * src/options.c (option_table): Remove %guard and %semantic_parser
17050 support.
17051 * src/output.c, src/output.h (guards_output): Remove.
17052 (prepare): Adjust.
17053 (token_definitions_output): Don't output the `T'
17054 tokens (???).
17055 (output_skeleton): Don't output the guards.
17056 * src/files.c, src/files.c (attrsfile): Remove.
17057 * src/reader.c (symbol_list): Remove the guard and guard_line
17058 members.
17059 Adjust dependencies.
17060 (parse_guard): Remove.
17061 * data/bison.hairy: Remove.
17062 * doc/bison.texinfo (Environment Variables): Remove occurrences of
17063 BISON_HAIRY.
17064
17065 2002-05-02 Akim Demaille <akim@epita.fr>
17066
17067 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
17068 (parse_guard): Rename the formal argument `stack_offset' as
17069 `rule_length', which is more readable.
17070 Adjust callers.
17071 (copy_at, copy_dollar): Instead of outputting the hard coded
17072 values of $$, $n and so forth, output invocation to b4_lhs_value,
17073 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
17074 Note: this patch partially drops `semantic-parser' support: it
17075 always does `rule_length - n', where semantic parsers ought to
17076 always use `-n'.
17077 * data/bison.simple, data/bison.c++ (b4_lhs_value)
17078 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
17079
17080 2002-05-02 Akim Demaille <akim@epita.fr>
17081
17082 * configure.in (AC_INIT): Bump to 1.49b.
17083 (AM_INIT_AUTOMAKE): Short invocation.
17084
17085 2002-05-02 Akim Demaille <akim@epita.fr>
17086
17087 Version 1.49a.
17088
17089 2002-05-01 Akim Demaille <akim@epita.fr>
17090
17091 * src/skeleton.h: Remove.
17092
17093 2002-05-01 Akim Demaille <akim@epita.fr>
17094
17095 * src/skeleton.h: Fix the #endif.
17096 Reported by Magnus Fromreide.
17097
17098 2002-04-26 Paul Eggert <eggert@twinsun.com>
17099
17100 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
17101 Define if we define YYSTYPE and YYLTYPE, respectively.
17102 (YYCOPY): Fix [] quoting problem in the non-GCC case.
17103
17104 2002-04-25 Robert Anisko <robert@lrde.epita.fr>
17105
17106 * src/scan-skel.l: Postprocess quadrigraphs.
17107
17108 * src/reader.c (copy_character): New function, used to output
17109 single characters while replacing `[' and `]' with quadrigraphs, to
17110 avoid troubles with M4 quotes.
17111 (copy_comment): Output characters with copy_character.
17112 (read_additionnal_code): Likewise.
17113 (copy_string2): Likewise.
17114 (copy_definition): Likewise.
17115
17116 * tests/calc.at: Exercise M4 quoting.
17117
17118 2002-04-25 Akim Demaille <akim@epita.fr>
17119
17120 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
17121 between `!' and the command.
17122 Reported by Paul Eggert.
17123
17124 2002-04-24 Robert Anisko <robert@lrde.epita.fr>
17125
17126 * tests/calc.at: Exercise prologue splitting.
17127
17128 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
17129 `b4_post_prologue' instead of `b4_prologue'.
17130
17131 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
17132 muscles.
17133 (output): Free pre_prologue_obstack and post_prologue_obstack.
17134 * src/files.h, src/files.c (attrs_obstack): Remove.
17135 (pre_prologue_obstack, post_prologue_obstack): New.
17136 * src/reader.c (copy_definition): Add a parameter to specify the
17137 obstack to fill, instead of using attrs_obstack unconditionally.
17138 (read_declarations): Pass pre_prologue_obstack to copy_definition if
17139 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
17140
17141 2002-04-23 Paul Eggert <eggert@twinsun.com>
17142
17143 * data/bison.simple: Remove unnecessary commentary and white
17144 space differences from 1_29-branch.
17145 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
17146
17147 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
17148 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
17149 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
17150 constructors or destructors.
17151
17152 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
17153
17154 2002-04-23 Akim Demaille <akim@epita.fr>
17155
17156 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
17157 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
17158 location with columns.
17159 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
17160 All reported by Paul Eggert.
17161
17162 2002-04-22 Akim Demaille <akim@epita.fr>
17163
17164 * src/reduce.c (dump_grammar): Move to...
17165 * src/gram.h, src/gram.c (grammar_dump): here.
17166 Be sure to separate long item numbers.
17167 Don't read the members of a rule's prec if its nil.
17168
17169 2002-04-22 Akim Demaille <akim@epita.fr>
17170
17171 * src/output.c (table_size, table_grow): New.
17172 (MAXTABLE): Remove, replace uses with table_size.
17173 (pack_vector): Instead of dying when the table is too big, grow it.
17174
17175 2002-04-22 Akim Demaille <akim@epita.fr>
17176
17177 * data/bison.simple (yyr1): Its type is that of a token number.
17178 * data/bison.c++ (r1_): Likewise.
17179 * tests/regression.at (Web2c Actions): Adjust.
17180
17181 2002-04-22 Akim Demaille <akim@epita.fr>
17182
17183 * src/reader.c (token_translations_init): 256 is now the default
17184 value for the error token, i.e., it will be assigned another
17185 number if the user assigned 256 to one of her tokens.
17186 (reader): Don't force 256 to error.
17187 * doc/bison.texinfo (Symbols): Adjust.
17188 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
17189 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
17190 etc. instead of 10, 20, 30 (which was used to `jump' over error
17191 (256) and undefined (2)).
17192
17193 2002-04-22 Akim Demaille <akim@epita.fr>
17194
17195 Propagate more token_number_t.
17196
17197 * src/gram.h (token_number_as_item_number)
17198 (item_number_as_token_number): New.
17199 * src/output.c (GENERATE_OUTPUT_TABLE): New.
17200 Use it to create output_item_number_table and
17201 output_token_number_table.
17202 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
17203 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
17204 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
17205 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
17206
17207 2002-04-22 Akim Demaille <akim@epita.fr>
17208
17209 * src/output.h, src/output.c (get_lines_number): Remove.
17210
17211 2002-04-19 Akim Demaille <akim@epita.fr>
17212
17213 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
17214 as Lex/Flex'.
17215 (Debugging): More details about enabling the debugging features.
17216 (Table of Symbols): Describe $$, $n, @$, and @n.
17217 Suggested by Tim Josling.
17218
17219 2002-04-19 Akim Demaille <akim@epita.fr>
17220
17221 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
17222
17223 2002-04-10 Akim Demaille <akim@epita.fr>
17224
17225 * src/system.h: Rely on HAVE_LIMITS_H.
17226 Suggested by Paul Eggert.
17227
17228 2002-04-09 Akim Demaille <akim@epita.fr>
17229
17230 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
17231 full stderr, and strip it according to the bison options, instead
17232 of composing the error message from different bits.
17233 This makes it easier to check for several error messages.
17234 Adjust all the invocations.
17235 Add an invocation exercising the error token.
17236 Add an invocation demonstrating a stupid error message.
17237 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
17238 Adjust the tests.
17239 Error message are for stderr, not stdout.
17240
17241 2002-04-09 Akim Demaille <akim@epita.fr>
17242
17243 * src/gram.h, src/gram.c (error_token_number): Remove, use
17244 errtoken->number.
17245 * src/reader.c (reader): Don't specify the user token number (2)
17246 for $undefined, as it uselessly prevents using it.
17247 * src/gram.h (token_number_t): Move to...
17248 * src/symtab.h: here.
17249 (state_t.number): Is a token_number_t.
17250 * src/print.c, src/reader.c: Use undeftoken->number instead of
17251 hard coded 2.
17252 (Even though this 2 is not the same as above: the number of the
17253 undeftoken remains being 2, it is its user token number which
17254 might not be 2).
17255 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
17256 `user_token_number_max'.
17257 Output `undef_token_number'.
17258 * data/bison.simple, data/bison.c++: Use them.
17259 Be sure to map invalid yylex return values to
17260 `undef_token_number'. This saves us from gratuitous SEGV.
17261
17262 * tests/conflicts.at (Solved SR Conflicts)
17263 (Unresolved SR Conflicts): Adjust.
17264 * tests/regression.at (Web2c Actions): Adjust.
17265
17266 2002-04-08 Akim Demaille <akim@epita.fr>
17267
17268 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
17269 Adding #line.
17270 Remove the duplicate `typedefs'.
17271 (RhsNumberType): Fix the declaration and various other typos.
17272 Use __ofile__.
17273 * data/bison.simple: Use __ofile__.
17274 * src/scan-skel.l: Handle __ofile__.
17275
17276 2002-04-08 Akim Demaille <akim@epita.fr>
17277
17278 * src/gram.h (item_number_t): New, the type of item numbers in
17279 RITEM. Note that it must be able to code symbol numbers as
17280 positive number, and the negation of rule numbers as negative
17281 numbers.
17282 Adjust all dependencies (pretty many).
17283 * src/reduce.c (rule): Remove this `short *' pointer: use
17284 item_number_t.
17285 * src/system.h (MINSHORT, MAXSHORT): Remove.
17286 Include `limits.h'.
17287 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
17288 (shortcpy): Remove.
17289 (MAXTABLE): Move to...
17290 * src/output.c (MAXTABLE): here.
17291 (prepare_rules): Use output_int_table to output rhs.
17292 * data/bison.simple, data/bison.c++: Adjust.
17293 * tests/torture.at (Big triangle): Move the limit from 254 to
17294 500.
17295 * tests/regression.at (Web2c Actions): Ajust.
17296
17297 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
17298 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
17299 passes, but produces negative #line number, once fixed, GCC is
17300 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
17301 C), it passes.
17302 * src/state.h (state_h): Code input lines on ints, not shorts.
17303
17304 2002-04-08 Akim Demaille <akim@epita.fr>
17305
17306 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
17307 and then the grammar.
17308
17309 2002-04-08 Akim Demaille <akim@epita.fr>
17310
17311 * src/system.h: No longer using strndup.
17312
17313 2002-04-07 Akim Demaille <akim@epita.fr>
17314
17315 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
17316 * src/output.c (output_table_data): Return the longest number.
17317 (prepare_tokens): Output `token_number_max').
17318 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
17319 New.
17320 Use them to define yy_token_number_type/TokenNumberType.
17321 Use this type for yytranslate.
17322 * tests/torture.at (Big triangle): Push the limit from 124 to
17323 253.
17324 * tests/regression.at (Web2c Actions): Adjust.
17325
17326 2002-04-07 Akim Demaille <akim@epita.fr>
17327
17328 * tests/torture.at (Big triangle): New.
17329 (GNU AWK Grammar, GNU Cim Grammar): Move to...
17330 * tests/existing.at: here.
17331
17332 2002-04-07 Akim Demaille <akim@epita.fr>
17333
17334 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
17335 nritems.
17336 Adjust dependencies.
17337
17338 2002-04-07 Akim Demaille <akim@epita.fr>
17339
17340 * src/reader.c: Normalize increments to prefix form.
17341
17342 2002-04-07 Akim Demaille <akim@epita.fr>
17343
17344 * src/reader.c, symtab.c: Remove debugging code.
17345
17346 2002-04-07 Akim Demaille <akim@epita.fr>
17347
17348 Rename all the `bucket's as `symbol_t'.
17349
17350 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
17351 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
17352 * src/symtab.c, src/symtab.h (bucket): Rename as...
17353 (symbol_t): this.
17354 (symbol_list_new, bucket_check_defined, bucket_make_alias)
17355 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
17356 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
17357 (buckets_new, buckets_free, buckets_do): Rename as...
17358 (symbol_list_new, symbol_check_defined, symbol_make_alias)
17359 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
17360 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
17361 (symbols_new, symbols_free, symbols_do): these.
17362
17363 2002-04-07 Akim Demaille <akim@epita.fr>
17364
17365 Use lib/hash for the symbol table.
17366
17367 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
17368 EOF.
17369 * src/lex.c (lex): Set the `number' member of new terminals.
17370 * src/reader.c (bucket_check_defined, bucket_make_alias)
17371 (bucket_check_alias_consistence, bucket_translation): New.
17372 (reader, grammar_free, readgram, token_translations_init)
17373 (packsymbols): Adjust.
17374 (reader): Number the predefined tokens.
17375 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
17376 for predefined tokens.
17377 * src/symtab.h (bucket): Remove all the hash table related
17378 members.
17379 * src/symtab.c (symtab): Replace by...
17380 (bucket_table): this.
17381 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
17382 (buckets_new, buckets_do): New.
17383
17384 2002-04-07 Akim Demaille <akim@epita.fr>
17385
17386 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
17387 (start_symbol, max_user_token_number, semantic_parser)
17388 (error_token_number): Initialize.
17389 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
17390 Initialize.
17391 (reader): Don't.
17392 (errtoken, eoftoken, undeftoken, axiom): Extern.
17393
17394 2002-04-07 Akim Demaille <akim@epita.fr>
17395
17396 * src/gram.h (rule_s): prec and precsym are now pointers
17397 to the bucket giving the priority/associativity.
17398 Member `associativity' removed: useless.
17399 * src/reduce.c, src/conflicts.c: Adjust.
17400
17401 2002-04-07 Akim Demaille <akim@epita.fr>
17402
17403 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
17404 Properly escape the symbols' TAG when outputting them.
17405
17406 2002-04-07 Akim Demaille <akim@epita.fr>
17407
17408 * src/lalr.h (LA): Is a bitsetv, not bitset*.
17409
17410 2002-04-07 Akim Demaille <akim@epita.fr>
17411
17412 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
17413 (LArule): this, which is an array to rule_t*.
17414 * src/print.c, src/conflicts.c: Adjust.
17415
17416 2002-04-07 Akim Demaille <akim@epita.fr>
17417
17418 * src/gram.h (rule_t): Rename `number' as `user_number'.
17419 `number' is a new member.
17420 Adjust dependencies.
17421 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
17422
17423 2002-04-07 Akim Demaille <akim@epita.fr>
17424
17425 As a result of the previous patch, it is no longer needed
17426 to reorder ritem itself.
17427
17428 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
17429
17430 2002-04-07 Akim Demaille <akim@epita.fr>
17431
17432 Be sure never to walk through RITEMS, but use only data related to
17433 the rules themselves. RITEMS should be banished.
17434
17435 * src/output.c (output_token_translations): Rename as...
17436 (prepare_tokens): this.
17437 In addition to `translate', prepare the muscles `tname' and
17438 `toknum', which were handled by...
17439 (output_rule_data): this.
17440 Remove, and move the remainder of its outputs into...
17441 (prepare_rules): this new routines, which also merges content from
17442 (output_gram): this.
17443 (prepare_rules): Be sure never to walk through RITEMS.
17444 (output_stos): Rename as...
17445 (prepare_stos): this.
17446 (output): Always invoke prepare_states, after all, just don't use it
17447 in the output if you don't need it.
17448
17449 2002-04-07 Akim Demaille <akim@epita.fr>
17450
17451 * src/LR0.c (new_state): Display `nstates' as the name of the
17452 newly created state.
17453 Adjust to initialize first_state and last_state if needed.
17454 Be sure to distinguish the initial from the final state.
17455 (new_states): Create the itemset of the initial state, and use
17456 new_state.
17457 * src/closure.c (closure): Now that the initial state has its
17458 items properly set, there is no need for a special case when
17459 creating `ruleset'.
17460
17461 As a result, now the rule 0, reducing to $axiom, is visible in the
17462 outputs. Adjust the test suite.
17463
17464 * tests/conflicts.at (Solved SR Conflicts)
17465 (Unresolved SR Conflicts): Adjust.
17466 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
17467 * tests/conflicts.at (S/R in initial): New.
17468
17469 2002-04-07 Akim Demaille <akim@epita.fr>
17470
17471 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
17472 the RHS of the rules.
17473 * src/output.c (output_gram): Likewise.
17474
17475 2002-04-07 Akim Demaille <akim@epita.fr>
17476
17477 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
17478 bucket.
17479 Adjust all dependencies.
17480 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
17481 `number' of the buckets too.
17482 * src/gram.h: Include `symtab.h'.
17483 (associativity): Move to...
17484 * src/symtab.h: here.
17485 No longer include `gram.h'.
17486
17487 2002-04-07 Akim Demaille <akim@epita.fr>
17488
17489 * src/gram.h, src/gram.c (rules_rhs_length): New.
17490 (ritem_longest_rhs): Use it.
17491 * src/gram.h (rule_t): `number' is a new member.
17492 * src/reader.c (packgram): Set it.
17493 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
17494 the end of `rules', and count them out of `nrules'.
17495 (reduce_output, dump_grammar): Adjust.
17496 * src/print.c (print_grammar): It is no longer needed to check for
17497 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
17498 * tests/reduce.at (Reduced Automaton): New test.
17499
17500 2002-04-07 Akim Demaille <akim@epita.fr>
17501
17502 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
17503 lacking `+ 1' to nrules, Bison reported as useless a token if it
17504 was used solely to set the precedence of the last rule...
17505
17506 2002-04-07 Akim Demaille <akim@epita.fr>
17507
17508 * data/bison.c++, data/bison.simple: Don't output the current file
17509 name in #line, to avoid useless diffs between two identical
17510 outputs under different names.
17511
17512 2002-04-07 Akim Demaille <akim@epita.fr>
17513
17514 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
17515 Normalize loops to using `< nrules + 1', not `<= nrules'.
17516
17517 2002-04-07 Akim Demaille <akim@epita.fr>
17518
17519 * TODO: Update.
17520
17521 2002-04-07 Akim Demaille <akim@epita.fr>
17522
17523 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
17524 bucket.value as bucket.number.
17525
17526 2002-04-07 Akim Demaille <akim@epita.fr>
17527
17528 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
17529 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
17530 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
17531 RHS, instead of being an index in RITEMS.
17532
17533 2002-04-04 Paul Eggert <eggert@twinsun.com>
17534
17535 * doc/bison.texinfo: Update copyright date.
17536 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
17537 (Symbols): Warn about running Bison in one character set,
17538 but compiling and/or running in an incompatible one.
17539 Warn about character code 256, too.
17540
17541 2002-04-03 Paul Eggert <eggert@twinsun.com>
17542
17543 * src/bison.data (YYSTACK_ALLOC): Depend on whether
17544 YYERROR_VERBOSE is nonzero, not whether it is defined.
17545
17546 Merge changes from bison-1_29-branch.
17547
17548 2002-03-20 Paul Eggert <eggert@twinsun.com>
17549
17550 Merge fixes from Debian bison_1.34-1.diff.
17551
17552 * configure.in (AC_PREREQ): 2.53.
17553
17554 2002-03-20 Akim Demaille <akim@epita.fr>
17555
17556 * src/conflicts.c (log_resolution): Argument `resolution' is const.
17557
17558 2002-03-19 Paul Eggert <eggert@twinsun.com>
17559
17560 * src/bison.simple (YYCOPY): New macro.
17561 (YYSTACK_RELOCATE): Use it.
17562 Remove Type arg; no longer needed. All callers changed.
17563 (yymemcpy): Remove; no longer needed.
17564
17565 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
17566 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
17567
17568 2002-03-19 Akim Demaille <akim@epita.fr>
17569
17570 Test and fix the #line outputs.
17571
17572 * tests/atlocal.at (GCC): New.
17573 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
17574 (Prologue synch line, %union synch line, Postprologue synch line)
17575 (Action synch line, Epilogue synch line): New tests.
17576 * src/reader.c (parse_union_decl): Define the muscle stype_line.
17577 * data/bison.simple, data/bison.c++: Use it.
17578
17579 2002-03-19 Akim Demaille <akim@epita.fr>
17580
17581 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
17582 (Solved SR Conflicts, %expect not enough, %expect right)
17583 (%expect too much): Move to...
17584 * tests/conflicts.at: this new file.
17585
17586 2002-03-19 Akim Demaille <akim@epita.fr>
17587
17588 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
17589 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
17590 that we can move to enums for instance.
17591 * src/output.c (token_definitions_output): Output a list of
17592 `token-name, token-number' instead of the #define.
17593 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
17594
17595 2002-03-14 Akim Demaille <akim@epita.fr>
17596
17597 Use Gettext 0.11.1.
17598
17599 2002-03-09 Robert Anisko <robert@lrde.epita.fr>
17600
17601 * data/bison.c++: Make the user able to add members to the generated
17602 parser by subclassing.
17603
17604 2002-03-05 Robert Anisko <robert@lrde.epita.fr>
17605
17606 * src/reader.c (read_additionnal_code): `c' should be an integer, not
17607 a character.
17608 Reported by Nicolas Tisserand and Nicolas Burrus.
17609
17610 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
17611
17612 * src/reader.c: Warn about lacking semi-colons, do not complain.
17613
17614 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
17615
17616 * data/bison.c++: Remove a debug line.
17617
17618 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
17619
17620 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
17621 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
17622 provide a default implementation.
17623
17624 2002-03-04 Akim Demaille <akim@epita.fr>
17625
17626 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
17627 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
17628 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
17629 * tests/semantic.at (Parsing Guards): Similarly.
17630 * src/reader.at (readgram): Complain if the last rule is not ended
17631 with a semi-colon.
17632
17633 2002-03-04 Akim Demaille <akim@epita.fr>
17634
17635 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
17636 * src/closure.c: here.
17637 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
17638 RTC.
17639 * src/warshall.h, src/warshall.c: Remove.
17640 * tests/sets.at (Broken Closure): Adjust.
17641
17642 2002-03-04 Akim Demaille <akim@epita.fr>
17643
17644 * src/output.c (output_skeleton): tempdir is const.
17645 bytes_read is unused.
17646
17647 2002-03-04 Akim Demaille <akim@epita.fr>
17648
17649 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
17650 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
17651 Update.
17652 From Michael Hayes.
17653
17654 2002-03-04 Akim Demaille <akim@epita.fr>
17655
17656 * src/closure.c (closure): `r' is unused.
17657
17658 2002-03-04 Akim Demaille <akim@epita.fr>
17659
17660 * tests/sets.at (Broken Closure): Add the ending `;'.
17661 * src/reader.at (readgram): Complain if a rule is not ended with a
17662 semi-colon.
17663
17664 2002-03-04 Akim Demaille <akim@epita.fr>
17665
17666 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
17667 (count_sr_conflicts): Use bitset_count.
17668 * src/reduce.c (inaccessable_symbols): Ditto.
17669 (bits_size): Remove.
17670 * src/warshall.h, src/warshall.c: Convert to bitsetv.
17671
17672 2002-03-04 Akim Demaille <akim@epita.fr>
17673
17674 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
17675 * src/reduce.c: Remove the `bitset_zero's following the
17676 `bitset_create's, as now it is performed by the latter.
17677
17678 2002-03-04 Akim Demaille <akim@epita.fr>
17679
17680 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
17681 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
17682 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
17683 latest sources from Michael.
17684
17685 2002-03-04 Akim Demaille <akim@epita.fr>
17686
17687 * src/output.c (output): Don't free the grammar.
17688 * src/reader.c (grammar_free): New.
17689 * src/main.c (main): Call it and don't free symtab here.
17690
17691 2002-03-04 Akim Demaille <akim@epita.fr>
17692
17693 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
17694 before returning.
17695 Reported by Benoit Perrot.
17696
17697 2002-03-04 Akim Demaille <akim@epita.fr>
17698
17699 Use bitset operations when possible, not loops over bits.
17700
17701 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
17702 bitset_or.
17703 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
17704 * src/reduce.c (useless_nonterminals): Formatting changes.
17705 * src/warshall.c (TC): Use bitset_or.
17706
17707 2002-03-04 Akim Demaille <akim@epita.fr>
17708
17709 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
17710 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
17711 Ditto.
17712
17713 2002-03-04 Akim Demaille <akim@epita.fr>
17714
17715 * src/lalr.c (F): Now a bitset*.
17716 Adjust all dependencies.
17717
17718 2002-03-04 Akim Demaille <akim@epita.fr>
17719
17720 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
17721 Adjust all dependencies.
17722
17723 2002-03-04 Akim Demaille <akim@epita.fr>
17724
17725 * src/L0.c, src/LR0.h (nstates): Be size_t.
17726 Adjust comparisons (signed vs unsigned).
17727 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
17728 bitset*.
17729 Adjust all dependencies.
17730
17731 2002-03-04 Akim Demaille <akim@epita.fr>
17732
17733 * src/closure.c (firsts): Now, also a bitset.
17734 Adjust all dependencies.
17735 (varsetsize): Remove, now unused.
17736 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
17737
17738 2002-03-04 Akim Demaille <akim@epita.fr>
17739
17740 * src/print.c: Convert to use bitset.h, not hand coded iterations
17741 over ints.
17742
17743 2002-03-04 Akim Demaille <akim@epita.fr>
17744
17745 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
17746
17747 2002-03-04 Akim Demaille <akim@epita.fr>
17748
17749 * src/closure.c (ruleset): Be a bitset.
17750 (rulesetsize): Remove.
17751
17752 2002-03-04 Akim Demaille <akim@epita.fr>
17753
17754 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
17755 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
17756 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
17757 * src/closure.c (fderives): Be an array of bitsets.
17758
17759 2002-02-28 Robert Anisko <robert@lrde.epita.fr>
17760
17761 * data/bison.c++: Merge the two generated headers. Insert a copyright
17762 notice in each output file.
17763
17764 2002-02-28 Akim Demaille <akim@epita.fr>
17765
17766 * data/bison.c++: Copy the prologue of bison.simple to fetch
17767 useful M4 definitions, such as b4_header_guard.
17768
17769 2002-02-25 Akim Demaille <akim@epita.fr>
17770
17771 * src/getargs.c (version): Give the name of the authors, and use a
17772 translator friendly scheme for the bgr
17773 copyright notice.
17774
17775 2002-02-25 Akim Demaille <akim@epita.fr>
17776
17777 * src/output.c (header_output): Remove, now handled completely via
17778 M4.
17779
17780 2002-02-25 Akim Demaille <akim@epita.fr>
17781
17782 * m4/m4.m4: New, from CVS Autoconf.
17783 * configure.in: Invoke it.
17784 * src/output.c (output_skeleton): Use its result instead of the
17785 hard coded name.
17786
17787 2002-02-25 Akim Demaille <akim@epita.fr>
17788
17789 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
17790 Fileutils 4.1.5.
17791 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
17792 * src/output.c (output_skeleton): Use mkstemp to create a real
17793 temporary file.
17794 Move the filling of `skeleton' and its muscle to...
17795 (prepare): here.
17796 (output): Move the definition of the prologue muscle to...
17797 (prepare): here.
17798 * src/system.h (DEFAULT_TMPDIR): New.
17799
17800 2002-02-14 Paul Eggert <eggert@twinsun.com>
17801
17802 Remove the support for C++ namespace cleanliness; it was
17803 causing more problems than it was curing, since it didn't work
17804 properly on some nonstandard C++ compilers. This can wait
17805 for a proper C++ parser.
17806
17807 * NEWS: Document this.
17808 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
17809 of C++, as it's treated like C now.
17810 * src/bison.simple (YYSTD): Remove.
17811 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
17812 Treat C++ just like Standard C instead of trying to support
17813 namespace cleanliness.
17814
17815 2002-02-14 Akim Demaille <akim@epita.fr>
17816
17817 * tests/regression.at (else): Adjust to Andreas' change.
17818
17819 2002-02-14 Akim Demaille <akim@epita.fr>
17820
17821 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
17822
17823 2002-02-13 Andreas Schwab <schwab@suse.de>
17824
17825 * src/output.c (output_rule_data): Don't output NULL, it might
17826 not be defined yet.
17827
17828 2002-02-11 Robert Anisko <robert@lrde.epita.fr>
17829
17830 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
17831 (Copyright notice): Update.
17832
17833 2002-02-11 Akim Demaille <akim@epita.fr>
17834
17835 * tests/regression.at (%nonassoc and eof): Don't include
17836 nonportable headers.
17837
17838 2002-02-08 Robert Anisko <robert@lrde.epita.fr>
17839
17840 * data/bison.c++: Correct error recovery. Make the user able to
17841 initialize the starting location.
17842
17843 2002-02-07 Akim Demaille <akim@epita.fr>
17844
17845 * tests/input.at: New.
17846
17847 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
17848
17849 * data/bison.c++: Replace some direct m4 expansions by constants. Be
17850 more consistent when naming methods and variables. Put preprocessor
17851 directives around tables only needed for debugging.
17852
17853 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
17854
17855 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
17856 C++ parsers.
17857 (yy::b4_name::parse): Use print_.
17858
17859 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
17860
17861 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
17862
17863 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
17864
17865 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
17866 C++ parsers.
17867 (yy::b4_name::parse): Build verbose error messages, and use error_.
17868
17869 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
17870
17871 * data/bison.c++: Fix m4 quoting in comments.
17872
17873 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
17874
17875 * data/bison.c++: Adjust the parser code. Fix some muscles that were
17876 not expanded by m4.
17877
17878 2002-02-05 Akim Demaille <akim@epita.fr>
17879
17880 * data/bison.c++: Adjust to the M4 back end.
17881 More is certainly needed.
17882
17883 2002-02-05 Akim Demaille <akim@epita.fr>
17884
17885 Give a try to M4 as a back end.
17886
17887 * lib/readpipe.c: New, from wdiff.
17888 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
17889 BISON_HAIRY.
17890 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
17891 specific values. Now it is m4 that performs the lookup.
17892 * src/parse-skel.y: Remove.
17893 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
17894 * src/output.c (actions_output, guards_output)
17895 (token_definitions_output): No longer keeps track of the output
17896 line number, hence remove the second argument.
17897 (guards_output): Check against the guard member of a rule, not the
17898 action member.
17899 Adjust callers.
17900 (output_skeleton): Don't look for the skeleton location, let m4 do
17901 that.
17902 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
17903 file will be used.
17904 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
17905 (prepare): Given that for the time being changesyntax is not
17906 usable in M4, rename the muscles using `-' to `_'.
17907 Define `defines_flag', `output_parser_name' and `output_header_name'.
17908 * src/output.h (actions_output, guards_output)
17909 (token_definitions_output): Adjust prototypes.
17910 * src/scan-skel.l: Instead of scanning the skeletons, it now
17911 processes the output of m4: `__oline__' and `#output'.
17912 * data/bison.simple: Adjust to be used by M4(sugar).
17913 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
17914 to date.
17915 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
17916 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
17917 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
17918 shamelessly stolen from CVS Autoconf.
17919
17920 2002-02-05 Akim Demaille <akim@epita.fr>
17921
17922 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
17923 * configure.in: Check for the declarations of free and malloc.
17924 * src/muscle_tab.c: Adjust.
17925
17926 2002-02-05 Akim Demaille <akim@epita.fr>
17927
17928 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
17929 which have no values.
17930
17931 2002-02-05 Akim Demaille <akim@epita.fr>
17932
17933 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
17934 * data/: here.
17935
17936 2002-01-29 Paul Eggert <eggert@twinsun.com>
17937
17938 * src/bison.simple (YYSIZE_T): Do not define merely because
17939 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
17940 On some platforms, <alloca.h> does not declare YYSTD (size_t).
17941
17942 2002-01-27 Akim Demaille <akim@epita.fr>
17943
17944 Fix `%nonassoc and eof'.
17945
17946 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
17947 which were not properly copied! Replace
17948 memcpy (res->errs, src->errs, src->nerrs);
17949 with
17950 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
17951 !!!
17952 * tests/regression.at (%nonassoc and eof): Adjust to newest
17953 Autotest: `.' is not in the PATH.
17954
17955 2002-01-27 Akim Demaille <akim@epita.fr>
17956
17957 * tests/sets.at (AT_EXTRACT_SETS): New.
17958 (Nullable): Use it.
17959 (Firsts): New.
17960
17961 2002-01-26 Akim Demaille <akim@epita.fr>
17962
17963 * tests/actions.at, tests/calc.at, tests/headers.at,
17964 * tests/torture.at: Adjust to the newest Autotest which no longer
17965 forces `.' in the PATH.
17966
17967 2002-01-25 Akim Demaille <akim@epita.fr>
17968
17969 * tests/regression.at (%nonassoc and eof): New.
17970 Suggested by Robert Anisko.
17971
17972 2002-01-24 Akim Demaille <akim@epita.fr>
17973
17974 Bison dumps core when trying to complain about broken input files.
17975 Reported by Cris van Pelt.
17976
17977 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
17978 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
17979 into...
17980 (Invalid inputs): Strengthen: exercise parse_percent_token.
17981
17982 2002-01-24 Robert Anisko <robert.anisko@epita.fr>
17983
17984 * src/Makefile.am: Add bison.c++.
17985 * src/bison.c++: New skeleton.
17986
17987 2002-01-21 Paolo Bonzini <bonzini@gnu.org>
17988
17989 * po/it.po: New.
17990
17991 2002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
17992
17993 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
17994
17995 2002-01-20 Marc Autret <marc@gnu.org>
17996
17997 * src/files.c (compute_output_file_names): Fix
17998
17999 2002-01-20 Marc Autret <marc@gnu.org>
18000
18001 * tests/output.at: New test.
18002 * src/files.c (compute_base_names): Don't map extensions when
18003 the YACC flag is set, use defaults.
18004 Reported by Evgeny Stambulchik.
18005
18006 2002-01-20 Marc Autret <marc@gnu.org>
18007
18008 * src/system.h: Need to define __attribute__ away for non-GCC
18009 compilers as well (i.e., the vendor C compiler).
18010 Suggested by Albert Chin-A-Young.
18011
18012 2002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
18013
18014 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
18015 canonical definition.
18016 * src/system.h: Use the canonical definition for PARAMS (avoids
18017 a conflict with the macro from lib/hash.h).
18018
18019 2002-01-11 Akim Demaille <akim@epita.fr>
18020
18021 * configure.in: Use AC_FUNC_STRNLEN.
18022 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
18023
18024 2002-01-09 Akim Demaille <akim@epita.fr>
18025
18026 * src/files.c, src/files.h (output_infix): New.
18027 (tab_extension): Remove.
18028 (compute_base_names): Compute the former, drop the latter.
18029 * src/output.c (prepare): Insert the muscles `output-infix', and
18030 `output-suffix'.
18031 * src/parse-skel.y (string, string.1): New.
18032 (section.header): Use it.
18033 (section.yacc): Remove.
18034 (prefix): Remove too.
18035 * src/scan-skel.l: Adjust.
18036 * src/bison.simple, src/bison.hairy: Adjust.
18037
18038 2002-01-09 Akim Demaille <akim@epita.fr>
18039
18040 * configure.in (WERROR_CFLAGS): Compute it.
18041 * src/Makefile.am (CFLAGS): Pass it.
18042 * tests/atlocal.in (CFLAGS): Idem.
18043 * src/files.c: Fix a few warnings.
18044 (get_extension_index): Remove, unused.
18045
18046 2002-01-08 Akim Demaille <akim@epita.fr>
18047
18048 * src/getargs.c (AS_FILE_NAME): New.
18049 (getargs): Use it to convert DOSish file names.
18050 * src/files.c (base_name): Rename as full_base_name to avoid
18051 clashes with `base_name ()'.
18052 (filename_split): New.
18053 (compute_base_names): N-th rewrite, using filename_split.
18054
18055 2002-01-08 Akim Demaille <akim@epita.fr>
18056
18057 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
18058 New, stolen from the Fileutils 4.1.
18059 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
18060 * configure.in: Check for the presence of memrchr, and of its
18061 prototype.
18062
18063 2002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
18064
18065 * lib/hash.h (__P): Added definition for this macro.
18066 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
18067 BUILT_SOURCES, to ensure they are generated first.
18068 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
18069 %error-verbose to allow bootstrapping with bison 1.30x.
18070
18071 2002-01-06 Akim Demaille <akim@epita.fr>
18072
18073 * src/reader.c (parse_braces): Don't fetch the next char, the
18074 convention is to fetch on entry.
18075 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
18076 'switch' without a following semicolon.
18077 * tests/regression.at (braces parsing): New.
18078
18079 2002-01-06 Akim Demaille <akim@epita.fr>
18080
18081 Bison is dead wrong in its RR conflict reports.
18082
18083 * tests/torture.at (GNU Cim Grammar): New.
18084 * src/conflicts.c (count_rr_conflicts): Fix.
18085
18086 2002-01-06 Akim Demaille <akim@epita.fr>
18087
18088 Creating package.m4 from configure.ac causes too many problems.
18089
18090 * tests/Makefile.am (package.m4): Create it by hand,
18091 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
18092
18093 2002-01-06 Akim Demaille <akim@epita.fr>
18094
18095 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
18096 skeleton.h.
18097
18098 2002-01-04 Paul Eggert <eggert@twinsun.com>
18099
18100 * doc/bison.texinfo (Debugging):
18101 Remove YYSTDERR; it's no longer defined or used.
18102 Also, s/cstdio.h/cstdio/.
18103
18104 2002-01-03 Akim Demaille <akim@epita.fr>
18105
18106 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
18107
18108 2002-01-03 Akim Demaille <akim@epita.fr>
18109
18110 * src/parse-skel.y (process_skeleton): Don't bind the parser's
18111 tracing code to --trace, wait for a better --trace option, with
18112 args.
18113
18114 2002-01-03 Akim Demaille <akim@epita.fr>
18115
18116 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
18117 The ISO C++ standard is extremely clear about it: stderr is
18118 considered a macro, not a regular symbol (see table 94 `Header
18119 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
18120 Therefore std:: does not apply to it. It still does with fprintf.
18121 Also, s/cstdio.h/cstdio/.
18122
18123 2002-01-03 Akim Demaille <akim@epita.fr>
18124
18125 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
18126 for non system headers.
18127
18128 2002-01-02 Akim Demaille <akim@epita.fr>
18129
18130 Equip the skeleton chain with location tracking, runtime trace,
18131 pure parser and scanner.
18132
18133 * src/parse-skel.y: Request a pure parser, locations, and prefix
18134 renaming.
18135 (%union): Having several members with the same type does not help
18136 type mismatches, simplify.
18137 (YYPRINT, yyprint): New.
18138 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
18139 (skel_error): this.
18140 Handle locations.
18141 * src/scan-skel.l: Adjust to these changes.
18142 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
18143 (LOCATION_PRINT, skel_control_t): New.
18144
18145 2001-12-30 Akim Demaille <akim@epita.fr>
18146
18147 * src/parse-skel.y: Get rid of the shift/reduce conflict:
18148 replace `gb' with BLANKS.
18149 * src/scan-skel.l: Adjust.
18150
18151 2001-12-30 Akim Demaille <akim@epita.fr>
18152
18153 * src/system.h: We don't need nor want bcopy.
18154 Throw away MS-DOS crap: we don't need getpid.
18155 * configure.in: We don't need strndup. It was even causing
18156 problems: because Flex includes the headers *before* us,
18157 _GNU_SOURCE is not defined by config.h, and therefore strndup was
18158 not visible.
18159 * lib/xstrndup.c: New.
18160 * src/scan-skel.l: Use it.
18161 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
18162 * src/parse-skel.y: Use %directives instead of #defines.
18163
18164 2001-12-30 Akim Demaille <akim@epita.fr>
18165
18166 * src/skeleton.h: New.
18167 * src/output.c (output_parser, output_master_parser): Remove, dead
18168 code.
18169 * src/output.h (get_lines_number, actions_output, guards_output)
18170 (token_definitions_output): Prototype them.
18171 * src/parse-skel.y: Add the license notice.
18172 Include output.h and skeleton.h.
18173 (process_skeleton): Returns void, and takes a single parameter.
18174 * src/scan-skel.l: Add the license notice.
18175 Include skeleton.h.
18176 Don't use %option yylineno: it seems that then Flex imagines
18177 REJECT has been used, and therefore it won't reallocate its
18178 buffers (which makes no other sense to me than a bug). It results
18179 in warnings for `unused: yy_flex_realloc'.
18180
18181 2001-12-30 Robert Anisko <robert.anisko@epita.fr>
18182
18183 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
18184 (MUSCLE_INSERT_PREFIX): ...to there.
18185 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
18186 (MUSCLE_INSERT_PREFIX): Move from here...
18187
18188 * src/bison.hairy: Add a section directive. Put braces around muscle
18189 names. This parser skeleton is still broken, but Bison should not
18190 choke on a bad muscle 'syntax'.
18191 * src/bison.simple: Add a section directive. Put braces around muscle
18192 names.
18193
18194 * src/files.h (strsuffix, stringappend): Add declarations.
18195 (tab_extension): Add declaration.
18196 (short_base_name): Add declaration.
18197
18198 * src/files.c (strsuffix, stringappend): No longer static. These
18199 functions are used in the skeleton parser.
18200 (tab_extension): New.
18201 (compute_base_names): Use the computations done in this function
18202 to guess if the generated parsers should have '.tab' in their
18203 names.
18204 (short_base_name): No longer static.
18205
18206 * src/output.c (output_skeleton): New.
18207 (output): Disable call to output_master_parser, and give a try to
18208 a new skeleton handling system.
18209 (guards_output, actions_output): No longer static.
18210 (token_definitions_output, get_lines_number): No longer static.
18211
18212 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
18213
18214 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
18215 parse-skel.y.
18216
18217 * src/parse-skel.y: New file.
18218 * src/scan-skel.l: New file.
18219
18220 2001-12-29 Akim Demaille <akim@epita.fr>
18221
18222 %name-prefix is broken.
18223
18224 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
18225 Adjust all dependencies.
18226 * tests/headers.at (export YYLTYPE): Strengthen this test: use
18227 %name-prefix.
18228
18229 Renaming yylval but not yylloc is not consistent. Now we do.
18230
18231 * src/bison.simple: Prefix yylloc if used.
18232 * doc/bison.texinfo (Decl Summary): Document that.
18233
18234 2001-12-29 Akim Demaille <akim@epita.fr>
18235
18236 * doc/bison.texinfo: Promote `%long-directive' over
18237 `%long_directive'.
18238 Remove all references to fixed-output-files, yacc is enough.
18239
18240 2001-12-29 Akim Demaille <akim@epita.fr>
18241
18242 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
18243 user prologue. These are defaults.
18244 * tests/actions.at (Mid-rule actions): Make sure the user can
18245 define YYDEBUG and YYERROR_VERBOSE.
18246
18247 2001-12-29 Akim Demaille <akim@epita.fr>
18248
18249 * src/output.c (header_output): Don't forget to export YYLTYPE and
18250 yylloc.
18251 * tests/headers.at (export YYLTYPE): New, make sure it does.
18252 * tests/regression.at (%union and --defines, Invalid CPP headers):
18253 Move to...
18254 * tests/headers.at: here.
18255
18256 2001-12-29 Akim Demaille <akim@epita.fr>
18257
18258 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
18259
18260 2001-12-29 Akim Demaille <akim@epita.fr>
18261
18262 * tests/actions.at (Mid-rule actions): Output on a single line
18263 instead of several.
18264
18265 2001-12-29 Akim Demaille <akim@epita.fr>
18266
18267 * doc/bison.texinfo: Formatting changes.
18268
18269 2001-12-29 Akim Demaille <akim@epita.fr>
18270
18271 Don't store the token defs in a muscle, just be ready to output it
18272 on command. Now possible via `symbols'. Fixes a memory leak.
18273
18274 * src/output.c (token_definitions_output): New.
18275 (output_parser, header_output): Use it.
18276 * src/reader.c (symbols_save): Remove.
18277
18278 2001-12-29 Akim Demaille <akim@epita.fr>
18279
18280 * src/bison.simple: Do not provide a default for YYSTYPE and
18281 YYLTYPE before the user's prologue. Otherwise it's hardly... a
18282 default.
18283
18284 2001-12-29 Akim Demaille <akim@epita.fr>
18285
18286 Mid-rule actions are simply... ignored!
18287
18288 * src/reader.c (readgram): Be sure to attach mid-rule actions to
18289 the empty-rule associated to the dummy symbol, not to the host
18290 rule.
18291 * tests/actions.at (Mid-rule actions): New.
18292
18293 2001-12-29 Akim Demaille <akim@epita.fr>
18294
18295 Memory leak.
18296
18297 * src/reader.c (reader): Free grammar.
18298
18299 2001-12-29 Akim Demaille <akim@epita.fr>
18300
18301 Memory leak.
18302
18303 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
18304 since it allocates it for each state, although only one is needed.
18305 (allocate_storage): Do it here.
18306
18307 2001-12-29 Akim Demaille <akim@epita.fr>
18308
18309 * src/options.h, src/options.c (create_long_option_table): Rename
18310 as...
18311 (long_option_table_new): this, with a clearer prototype.
18312 (percent_table): Remove, unused,
18313 * src/getargs.c (getargs): Adjust.
18314
18315 2001-12-29 Akim Demaille <akim@epita.fr>
18316
18317 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
18318 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
18319 as states.
18320
18321 2001-12-29 Akim Demaille <akim@epita.fr>
18322
18323 * src/lalr.c (build_relations): Rename `states' as `states1'.
18324 Sorry, I don't understand exactly what it is, no better name...
18325
18326 2001-12-29 Akim Demaille <akim@epita.fr>
18327
18328 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
18329 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
18330 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
18331 as rules.
18332
18333 2001-12-29 Akim Demaille <akim@epita.fr>
18334
18335 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
18336 ago.
18337
18338 2001-12-29 Akim Demaille <akim@epita.fr>
18339
18340 * src/reader.c, src/reader.h (user_toknums): Remove.
18341 Adjust all users to use symbols[i]->user_token_number.
18342
18343 2001-12-29 Akim Demaille <akim@epita.fr>
18344
18345 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
18346 Adjust all users to use symbols[i]->prec or ->assoc.
18347
18348 2001-12-29 Akim Demaille <akim@epita.fr>
18349
18350 * src/reader.c, src/reader.h (tags): Remove.
18351 Adjust all users to use symbols[i]->tag.
18352
18353 2001-12-29 Akim Demaille <akim@epita.fr>
18354
18355 * src/gram.h, src/gram.c (symbols): New, similar to state_table
18356 and rule_table.
18357 * src/reader.c (packsymbols): Fill this table.
18358 Drop sprec.
18359 * src/conflicts.c (resolve_sr_conflict): Adjust.
18360 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
18361 single table.
18362 Use symbols[i]->tag instead of tags[i].
18363
18364 2001-12-29 Akim Demaille <akim@epita.fr>
18365
18366 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
18367 In addition, put a comment in there, to replace...
18368 * tests/regression.at (%union and C comments): Remove.
18369
18370 2001-12-29 Akim Demaille <akim@epita.fr>
18371
18372 * tests/regression.at (Web2c Actions): Blindly move the actual
18373 output as expected output. The contents *seem* right to me, but I
18374 can't pretend reading perfectly parser tables... Nonetheless, all
18375 the other tests pass correctly, the table look OK, even though the
18376 presence of `$axiom' is to be noted: AFAICS it is useless (but
18377 harmless).
18378
18379 2001-12-29 Akim Demaille <akim@epita.fr>
18380
18381 * src/reader.c (readgram): Don't add the rule 0 if there were no
18382 rules read. In other words, add it _after_ having performed
18383 grammar sanity checks.
18384 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
18385
18386 2001-12-29 Akim Demaille <akim@epita.fr>
18387
18388 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
18389 visible, and some states have now a different number.
18390
18391 2001-12-29 Akim Demaille <akim@epita.fr>
18392
18393 * src/reader.c (readgram): Bind the initial rule's lineno to that
18394 of the first rule.
18395 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
18396 (Solved SR Conflicts): Adjust rule 0's line number.
18397
18398 2001-12-29 Akim Demaille <akim@epita.fr>
18399
18400 Fix the `GAWK Grammar' failure.
18401
18402 * src/LR0.c (final_state): Initialize to -1 so that we do compute
18403 the reductions of the first state which was mistakenly confused
18404 with the final state because precisely final_state was initialized
18405 to 0.
18406 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
18407 now noticed by Bison.
18408 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
18409 have a reduction on $default.
18410
18411 2001-12-29 Akim Demaille <akim@epita.fr>
18412
18413 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
18414 rule line numbers.
18415 * src/closure.c (print_closure): Likewise.
18416 * src/derives.c (print_derives): Likewise.
18417 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
18418 now.
18419
18420 2001-12-29 Akim Demaille <akim@epita.fr>
18421
18422 * src/lalr.c (lookaheads_print): New.
18423 (lalr): Call it when --trace-flag.
18424 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
18425 are dumped.
18426
18427 2001-12-29 Akim Demaille <akim@epita.fr>
18428
18429 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
18430 when walking through ritem, even via rule->rhs.
18431 * src/reduce.c (dump_grammar, useful_production, reduce_output)
18432 (useful_production, useless_nonterminals): Likewise.
18433 (reduce_grammar_tables): Likewise, plus update nritems.
18434 * src/nullable.c (set_nullable): Likewise.
18435 * src/lalr.c (build_relations): Likewise.
18436 * tests/sets.at (Nullable): Adjust.
18437 Fortunately, now, the $axiom is no longer nullable.
18438
18439 2001-12-29 Akim Demaille <akim@epita.fr>
18440
18441 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
18442 the 0-sentinel.
18443 * src/gram.c (ritem_longest_rhs): Likewise.
18444 * src/reduce.c (nonterminals_reduce): Likewise.
18445 * src/print_graph.c (print_graph): Likewise.
18446 * src/output.c (output_rule_data): Likewise.
18447 * src/nullable.c (set_nullable): Likewise.
18448
18449 2001-12-29 Akim Demaille <akim@epita.fr>
18450
18451 * src/output.c: Comment changes.
18452
18453 2001-12-27 Paul Eggert <eggert@twinsun.com>
18454
18455 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
18456 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
18457 Sparc, as they were causing more porting problems than the
18458 (minor) performance improvement was worth.
18459
18460 Also, catch up with 1.31's YYSTD.
18461
18462 2001-12-27 Akim Demaille <akim@epita.fr>
18463
18464 * src/output.c (output_gram): Rely on nritems, not the
18465 0-sentinel. See below.
18466 Use -1 as separator, not 0.
18467 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
18468 Rely on -1 as separator in yyrhs, instead of 0.
18469 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
18470 twice `Now at end of input', therefore there are two lines less to
18471 expect.
18472
18473 2001-12-27 Akim Demaille <akim@epita.fr>
18474
18475 * tests/regression.at (Unresolved SR Conflicts):
18476 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
18477 below.
18478
18479 2001-12-27 Akim Demaille <akim@epita.fr>
18480
18481 * src/LR0.c (new_state): Recognize the final state by the fact it
18482 is reached by eoftoken.
18483 (insert_start_shifting_state, insert_eof_shifting_state)
18484 (insert_accepting_state, augment_automaton): Remove, since now
18485 these states are automatically computed from the initial state.
18486 (generate_states): Adjust.
18487 * src/print.c: When reporting a rule number to the user, substract
18488 1, so that the axiom rule is rule 0, and the first user rule is 1.
18489 * src/reduce.c: Likewise.
18490 * src/print_graph.c (print_core): For the time being, just as for
18491 the report, depend upon --trace-flags to dump the full set of
18492 items.
18493 * src/reader.c (readgram): Once the grammar read, insert the rule
18494 0: `$axiom: START-SYMBOL $'.
18495 * tests/set.at: Adjust: rule 0 is now displayed, and since the
18496 number of the states has changed (the final state is no longer
18497 necessarily the last), catch up.
18498
18499 2001-12-27 Akim Demaille <akim@epita.fr>
18500
18501 Try to make the use of the eoftoken valid. Given that its value
18502 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
18503 is used instead of > 0 where appropriate, (ii), depend upon nritems
18504 instead of the 0-sentinel.
18505
18506 * src/gram.h, src/gram.c (nritems): New.
18507 Expected to be duplication of nitems, but for the time being...
18508 * src/reader.c (packgram): Assert nritems and nitems are equal.
18509 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
18510 * src/closure.c (print_closure, print_fderives): Likewise.
18511 * src/gram.c (ritem_print): Likewise.
18512 * src/print.c (print_core, print_grammar): Likewise.
18513 * src/print_graph.c: Likewise.
18514
18515 2001-12-27 Akim Demaille <akim@epita.fr>
18516
18517 * src/main.c (main): If there are complains after grammar
18518 reductions, then output the report anyway if requested, then die.
18519 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
18520 * src/reader.c (eoftoken): New.
18521 (parse_token_decl): If the token being defined has value `0', it
18522 is the eoftoken.
18523 (packsymbols): No longer hack `tags' to insert `$' by hand.
18524 Be sure to preserve the value of the eoftoken.
18525 (reader): Make sure eoftoken is defined.
18526 Initialize nsyms to 0: now eoftoken is created just like the others.
18527 * src/print.c (print_grammar): Don't special case the eof token.
18528 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
18529 lie anyway, albeit pleasant.
18530 * tests/calc.at: Exercise error messages with eoftoken.
18531 Change the grammar so that empty input is invalid.
18532 Adjust expectations.
18533 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
18534
18535 2001-12-27 Akim Demaille <akim@epita.fr>
18536
18537 * configure.in: Check the protos of strchr ans strspn.
18538 Replace strchr if needed.
18539 * src/system.h: Provide the protos of strchr, strspn and memchr if
18540 missing.
18541 * lib/strchr.c: New.
18542 * src/reader.c (symbols_save): Use strchr.
18543
18544 2001-12-27 Akim Demaille <akim@epita.fr>
18545
18546 * src/print.c, src/print_graph.c (escape): New.
18547 Use it to quote the TAGS outputs.
18548 * src/print_graph.c (print_state): Now errors are in red, and
18549 reductions in green.
18550 Prefer high to wide: output the state number on a line of its own.
18551
18552 2001-12-27 Akim Demaille <akim@epita.fr>
18553
18554 * src/state.h, src/state.c (reductions_new): New.
18555 * src/LR0.c (set_state_table): Let all the states have a
18556 `reductions', even if reduced to 0.
18557 (save_reductions): Adjust.
18558 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
18559 * src/print.c (print_reductions, print_actions): Adjust.
18560 * src/output.c (action_row): Adjust.
18561
18562 2001-12-27 Akim Demaille <akim@epita.fr>
18563
18564 * src/state.h, src/state.c (errs_new, errs_dup): New.
18565 * src/LR0.c (set_state_table): Let all the states have an errs,
18566 even if reduced to 0.
18567 * src/print.c (print_errs, print_reductions): Adjust.
18568 * src/output.c (output_actions, action_row): Adjust.
18569 * src/conflicts.c (resolve_sr_conflict): Adjust.
18570
18571 2001-12-27 Akim Demaille <akim@epita.fr>
18572
18573 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
18574
18575 2001-12-27 Akim Demaille <akim@epita.fr>
18576
18577 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
18578 * src/print.c: here.
18579 (lookaheadset, shiftset): New, used as additional storage by
18580 print_reductions.
18581 (print_results): Adjust.
18582 (print_shifts, print_gotos, print_errs): New, extracted from...
18583 (print_actions): here.
18584 * src/print_graph.c (print_actions): Remove dead code.
18585
18586 2001-12-27 Akim Demaille <akim@epita.fr>
18587
18588 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
18589 `$n' and `@n'.
18590
18591 2001-12-27 Akim Demaille <akim@epita.fr>
18592
18593 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
18594 (build_relations): Adjust.
18595
18596 2001-12-27 Akim Demaille <akim@epita.fr>
18597
18598 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
18599 duplication.
18600
18601 2001-12-27 Akim Demaille <akim@epita.fr>
18602
18603 * src/reader.c (packgram): Catch nitems overflows.
18604
18605 2001-12-27 Akim Demaille <akim@epita.fr>
18606
18607 * src/files.c, src/files.h (guard_obstack): Remove.
18608 * src/output.c (output): Adjust.
18609 * src/reader.c (parse_braces): New, factoring...
18610 (copy_action, copy_guard): these two which are renamed as...
18611 (parse_action, parse_guard): these.
18612 As a voluntary consequence, using braces around guards is now
18613 mandatory.
18614
18615 2001-12-27 Akim Demaille <akim@epita.fr>
18616
18617 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
18618 * src/reader.c (symbol_list): `guard' and `guard_line' are new
18619 members.
18620 (symbol_list_new): Adjust.
18621 (copy_action): action_line is the first line, not the last.
18622 (copy_guard): Just as for actions, store the `action' only, not
18623 the switch/case/break flesh.
18624 Don't parse the user action that might follow the guard, let...
18625 (readgram): do it, i.e., now, there can be an action after a
18626 guard.
18627 In other words the guard is just explicitly optional.
18628 (packgram): Adjust.
18629 * src/output.c (guards_output): New.
18630 (output_parser): Call it when needed.
18631 (output): Also free the guard and attrs obstacks.
18632 * src/files.c, src/files.h (obstack_save): Remove.
18633 (output_files): Remove.
18634 As a result, if one needs the former `.act' file, using an
18635 appropriate skeleton which requires actions and guards is now
18636 required.
18637 * src/main.c (main): Adjust.
18638 * tests/semantic.at: New.
18639 * tests/regression.at: Use `input.y' as input file name.
18640 Avoid 8+3 problems by requiring input.c when the test needs the
18641 parser.
18642
18643 2001-12-27 Akim Demaille <akim@epita.fr>
18644
18645 * src/reader.c (symbol_list_new): Be sure to initialize all the
18646 fields.
18647
18648 2001-12-27 Akim Demaille <akim@epita.fr>
18649
18650 All the hacks using a final pseudo state are now useless.
18651
18652 * src/LR0.c (set_state_table): state_table holds exactly nstates.
18653 * src/lalr.c (nLA): New.
18654 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
18655 instead of lookaheadsp from the pseudo state (nstate + 1).
18656
18657 2001-12-27 Akim Demaille <akim@epita.fr>
18658
18659 * src/output.c (action_row, token_actions): Use a state_t instead
18660 of a integer, and nlookaheads instead of the following state's
18661 lookaheadsp.
18662
18663 2001-12-27 Akim Demaille <akim@epita.fr>
18664
18665 * src/conflicts.c (log_resolution, flush_shift)
18666 (resolve_sr_conflict, set_conflicts, solve_conflicts)
18667 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
18668 (conflicts_print, print_reductions): Use a state_t instead of an
18669 integer when referring to a state.
18670 As much as possible, depend upon nlookaheads, instead of the
18671 `lookaheadsp' member of the following state (since lookaheads of
18672 successive states are successive, the difference between state n + 1
18673 and n served as the number of lookaheads for state n).
18674 * src/lalr.c (add_lookback_edge): Likewise.
18675 * src/print.c (print_core, print_actions, print_state)
18676 (print_results): Likewise.
18677 * src/print_graph.c (print_core, print_actions, print_state)
18678 (print_graph): Likewise.
18679 * src/conflicts.h: Adjust.
18680
18681 2001-12-27 Akim Demaille <akim@epita.fr>
18682
18683 * src/bison.hairy: Formatting/comment changes.
18684 ANSIfy.
18685 Remove `register' indications.
18686 Add plenty of `static'.
18687
18688 2001-12-27 Akim Demaille <akim@epita.fr>
18689
18690 * src/output.c (prepare): Drop the muscle `ntbase' which
18691 duplicates ntokens.
18692 * src/bison.simple: Formatting/comment changes.
18693 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
18694 is an undocumented synonym.
18695
18696 2001-12-22 Akim Demaille <akim@epita.fr>
18697
18698 * src/output.c (output_table_data): Change the prototype to use
18699 `int' for array ranges: some invocations do pass an int, not a
18700 short.
18701 Reported by Wayne Green.
18702
18703 2001-12-22 Akim Demaille <akim@epita.fr>
18704
18705 Some actions of web2c.y are improperly triggered.
18706 Reported by Mike Castle.
18707
18708 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
18709 * tests/regression.at (Web2c): Rename as...
18710 (Web2c Report): this.
18711 (Web2c Actions): New.
18712
18713 2001-12-22 Akim Demaille <akim@epita.fr>
18714
18715 Reductions in web2c.y are improperly reported.
18716 Reported by Mike Castle.
18717
18718 * src/conflicts.c (print_reductions): Fix.
18719 * tests/regression.at (Web2c): New.
18720
18721 2001-12-18 Akim Demaille <akim@epita.fr>
18722
18723 Some host fail on `assert (!"foo")', which expands to
18724 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
18725 Reported by Nelson Beebee.
18726
18727 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
18728 `#define it_succeeded 0' and `assert (it_succeeded)'.
18729
18730 2001-12-17 Marc Autret <autret_m@epita.fr>
18731
18732 * src/bison.simple: Don't hard code the skeleton line and filename.
18733 * src/output.c (output_parser): Rename 'line' as 'output_line'.
18734 New line counter 'skeleton_line' (skeleton-line muscle).
18735
18736 2001-12-17 Paul Eggert <eggert@twinsun.com>
18737
18738 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
18739 YYDEBUG must be defined to a nonzero value.
18740
18741 * src/bison.simple (yytname): Do not assume that the user defines
18742 YYDEBUG to a properly parenthesized expression.
18743
18744 2001-12-17 Akim Demaille <akim@epita.fr>
18745
18746 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
18747 nlookaheads is a new member.
18748 Adjust all users.
18749 * src/lalr.h (nlookaheads): Remove this orphan declaration.
18750 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
18751 state.
18752
18753 2001-12-17 Akim Demaille <akim@epita.fr>
18754
18755 * src/files.h, src/files.c (open_files, close_files): Remove.
18756 * src/main.c (main): Don't open/close files, nor invoke lex_free,
18757 let...
18758 * src/reader.c (reader): Do it.
18759
18760 2001-12-17 Akim Demaille <akim@epita.fr>
18761
18762 * src/conflicts.c (print_reductions): Formatting changes.
18763
18764 2001-12-17 Akim Demaille <akim@epita.fr>
18765
18766 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
18767 (flush_reduce): New.
18768 (resolve_sr_conflict): Adjust.
18769
18770 2001-12-17 Akim Demaille <akim@epita.fr>
18771
18772 * src/output.c (output_obstack): Be static and rename as...
18773 (format_obstack): this, to avoid any confusion with files.c's
18774 output_obstack.
18775 * src/reader.h (muscle_obstack): Move to...
18776 * src/output.h: here, since it's defined in output.c.
18777
18778 2001-12-17 Akim Demaille <akim@epita.fr>
18779
18780 * src/output.c (action_row, save_column, default_goto)
18781 (sort_actions, matching_state, pack_vector): Better variable
18782 locality.
18783
18784 2001-12-17 Akim Demaille <akim@epita.fr>
18785
18786 * src/output.c: Various formatting changes.
18787
18788 2001-12-17 Akim Demaille <akim@epita.fr>
18789
18790 * src/files.c (output_files): Free the output_obstack.
18791 * src/main.c (main): Call print and print_graph conditionally.
18792 * src/print.c (print): Work unconditionally.
18793 * src/print_graph.c (print_graph): Work unconditionally.
18794 * src/conflicts.c (log_resolution): Output only if verbose_flag.
18795
18796 2001-12-16 Marc Autret <autret_m@epita.fr>
18797
18798 * src/output.c (actions_output): Fix. When we use %no-lines,
18799 there is one less line per action.
18800
18801 2001-12-16 Marc Autret <autret_m@epita.fr>
18802
18803 * src/bison.simple: Remove a useless #line directive.
18804 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
18805 * src/output.c (get_lines_number): New.
18806 (output_parser): Adjust, now takes care about the lines of a
18807 output muscles.
18808 Fix line numbering.
18809 (actions_output): Computes the number of lines taken by actions.
18810 (output_master_parser): Insert new skeleton which is the name of
18811 the output parser file name.
18812
18813 2001-12-15 Marc Autret <autret_m@epita.fr>
18814
18815 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
18816
18817 2001-12-15 Marc Autret <autret_m@epita.fr>
18818
18819 * src/output.c (output_gram): Keep track of the hairy one.
18820
18821 2001-12-15 Akim Demaille <akim@epita.fr>
18822
18823 Make `make distcheck' work.
18824
18825 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
18826 system.h which uses libgettext.h.
18827
18828 2001-12-15 Akim Demaille <akim@epita.fr>
18829
18830 * src/nullable.c (set_nullable): Useless rules must be skipped,
18831 otherwise, since we range over their symbols, we might look at a
18832 nonterminal which no longer ``exists'', i.e., it is not counted in
18833 `nvars', hence we overflow our arrays.
18834
18835 2001-12-15 Akim Demaille <akim@epita.fr>
18836
18837 The header can also be produced directly, without any obstack!
18838 Yahoo!
18839
18840 * src/files.c, src/files.h (defines_obstack): Remove.
18841 (compute_header_macro): Global.
18842 (defines_obstack_save): Remove.
18843 * src/reader.c (parse_union_decl): No longer output to
18844 defines_obstack: its content can be found in the `stype' muscle
18845 anyway.
18846 (output_token_translations): Merge into...
18847 (symbols_output): this.
18848 Rename as...
18849 (symbols_save): this.
18850 (reader): Adjust.
18851 * src/output.c (header_output): New.
18852 (output): Call it.
18853
18854 2001-12-15 Akim Demaille <akim@epita.fr>
18855
18856 * src/reader.c (parse_union_decl): Instead of handling two obstack
18857 simultaneously, use one to define the `stype' muscle, and use the
18858 value of the latter to fill defines_obstack.
18859 (copy_comment): Remove.
18860 (copy_comment2): Work for a single obstack.
18861 Rename as...
18862 (copy_comment): this.
18863
18864 2001-12-15 Akim Demaille <akim@epita.fr>
18865
18866 * src/lex.c, src/lex.h (xgetc): No longer static.
18867 * src/reader.c (parse_union_decl): Revamp.
18868
18869 2001-12-15 Akim Demaille <akim@epita.fr>
18870
18871 Still making progress in separating Bison into (i) input, (ii)
18872 process, (iii) output: now we can directly output the parser file
18873 without using table_obstack at all.
18874
18875 * src/files.c, src/files.h (table_obstack): Bye bye.
18876 (parser_file_name): New.
18877 * src/files.c (compute_output_file_names): Compute it.
18878 * src/output.c (actions_output, output_parser)
18879 (output_master_parser): To a file instead of an obstack.
18880
18881 2001-12-15 Akim Demaille <akim@epita.fr>
18882
18883 Attach actions to rules, instead of pre-outputting them to
18884 actions_obstack.
18885
18886 * src/gram.h (rule_t): action and action_line are new members.
18887 * src/reader.c (symbol_list): Likewise.
18888 (copy_action): Save the actions within the rule.
18889 (packgram): Save them in rule_table.
18890 * src/output.c (actions_output): New.
18891 (output_parser): Use it on `%%actions'.
18892 (output_rule_data): Don't free rule_table.
18893 (output): Do it.
18894 (prepare): Don't save the `action' muscle.
18895 * src/bison.simple: s/%%action/%%actions/.
18896
18897 2001-12-15 Akim Demaille <akim@epita.fr>
18898
18899 * src/reader.c (copy_action): When --yacc, don't append a `;'
18900 to the user action: let it fail if lacking.
18901 Suggested by Arnold Robbins and Tom Tromey.
18902
18903 2001-12-14 Akim Demaille <akim@epita.fr>
18904
18905 * src/lex.c (literalchar): Simply return the char you decoded, non
18906 longer mess around with obstacks and int pointers.
18907 Adjust all callers.
18908
18909 2001-12-14 Akim Demaille <akim@epita.fr>
18910
18911 * src/lex.c (literalchar): Don't escape the special characters,
18912 just decode them, and keep them as char (before, eol was output as
18913 the 2 char string `\n' etc.).
18914 * src/output.c (output_rule_data): Use quotearg to output the
18915 token strings.
18916
18917 2001-12-13 Paul Eggert <eggert@twinsun.com>
18918
18919 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
18920 Do not infringe on the global user namespace when using C++.
18921 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
18922 All uses of `fprintf' and `stderr' changed.
18923
18924 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
18925
18926 2001-12-13 Akim Demaille <akim@epita.fr>
18927
18928 The computation of nullable is broken: it doesn't handle empty
18929 RHS's properly.
18930
18931 * tests/torture.at (GNU AWK Grammar): New.
18932 * tests/sets.at (Nullable): New.
18933 * src/nullable.c (set_nullable): Instead of blindly looping over
18934 `ritems', loop over the rules, and then over their rhs's.
18935
18936 Work around Autotest bugs.
18937
18938 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
18939 frame, because Autotest understand lines starting with a `+' as
18940 traces from the shell. Then, they are not processed properly.
18941 Admittedly an Autotest bug, but we don't have time to wait for
18942 Autotest to catch up.
18943 * tests/regression.at (Broken Closure): Adjust to the new table
18944 frames.
18945 Move to...
18946 * tests/sets.at: here.
18947
18948 2001-12-13 Akim Demaille <akim@epita.fr>
18949
18950 * src/closure.c (closure): Use nrules instead of playing tricks
18951 with BITS_PER_WORD.
18952
18953 2001-12-13 Akim Demaille <akim@epita.fr>
18954
18955 * src/print.c (print_actions): Output the handling of `$' as the
18956 traces do: shifting the token EOF. Before EOF was treated as a
18957 nonterminal.
18958 * tests/regression.at: Adjust some tests.
18959 * src/print_graph.c (print_core): Complete the set of items via
18960 closure. The next-to-final and final states are still unsatisfying,
18961 but that's to be addressed elsewhere.
18962 No longer output the rule numbers, but do output the state number.
18963 A single loop for the shifts + gotos is enough, but picked a
18964 distinct color for each.
18965 (print_graph): Initialize and finalize closure.
18966
18967 2001-12-13 Akim Demaille <akim@epita.fr>
18968
18969 * src/reader.c (readgram): Remove dead code, an strip useless
18970 braces.
18971 (get_type): Remove, unused.
18972
18973 2001-12-12 Akim Demaille <akim@epita.fr>
18974
18975 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
18976 on that of lib/error.c.
18977
18978 2001-12-12 Akim Demaille <akim@epita.fr>
18979
18980 Some hosts don't like `/' in includes.
18981
18982 * src/system.h: Include libgettext.h without qualifying the path.
18983 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
18984 $(top_srcdir).
18985
18986 2001-12-11 Marc Autret <autret_m@epita.fr>
18987
18988 * src/output.c (output_parser): Remove useless muscle.
18989
18990 2001-12-11 Marc Autret <autret_m@epita.fr>
18991
18992 * src/bison.simple: Remove #line just before %%epilogue. It
18993 is now handled in ...
18994 * src/reader.c (read_additionnal_code): Add the output of a
18995 #line for the epilogue.
18996
18997 2001-12-10 Marc Autret <autret_m@epita.fr>
18998
18999 * src/reader.c (copy_definition): Re-use CPP-outed code which
19000 replace precedent remove.
19001 * src/bison.simple: Remove #line before %%prologue because
19002 %%input-line is wrong at this time.
19003
19004 2001-12-10 Marc Autret <autret_m@epita.fr>
19005
19006 * src/reader.c (symbols_output): Clean up.
19007 * src/output.c (output_gram, output): Clean up.
19008
19009 2001-12-10 Akim Demaille <akim@epita.fr>
19010
19011 * src/lalr.c (initialize_lookaheads): New. Extracted from...
19012 * src/LR0.c (set_state_table): here.
19013 * src/lalr.c (lalr): Call it.
19014
19015 2001-12-10 Akim Demaille <akim@epita.fr>
19016
19017 * src/state.h (shifts): Remove the `number' member: shifts are
19018 attached to state, hence no longer need to be labelled with a
19019 state number.
19020
19021 2001-12-10 Akim Demaille <akim@epita.fr>
19022
19023 Now that states have a complete set of members, the linked list of
19024 shifts is useless: just fill directly the state's shifts member.
19025
19026 * src/state.h (shifts): Remove the `next' member.
19027 * src/LR0.c (first_state, last_state): Remove.
19028 Adjust the callers.
19029 (augment_automaton): Don't look for the shifts that must be added
19030 a shift on EOF: it is those of the state we looked for! But now,
19031 since shifts are attached, it is no longer needed to looking
19032 merely by its id: its number.
19033
19034 2001-12-10 Akim Demaille <akim@epita.fr>
19035
19036 * src/LR0.c (augment_automaton): Better variable locality.
19037 Remove an impossible branch: if there is a state corresponding to
19038 the start symbol being shifted, then there is shift for the start
19039 symbol from the initial state.
19040
19041 2001-12-10 Akim Demaille <akim@epita.fr>
19042
19043 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
19044 only when appropriate: when insert_start_shifting_state' is not
19045 invoked.
19046 * tests/regression.at (Rule Line Numbers): Adjust.
19047
19048 2001-12-10 Akim Demaille <akim@epita.fr>
19049
19050 * src/LR0.c (augment_automaton): Now that all states have shifts,
19051 merge the two cases addition shifts to the initial state.
19052
19053 2001-12-10 Akim Demaille <akim@epita.fr>
19054
19055 * src/lalr.c (set_state_table): Move to...
19056 * src/LR0.c: here.
19057 * src/lalr.c (lalr): Don't call it...
19058 * src/LR0.c (generate_states): do it.
19059 * src/LR0.h (first_state): Remove, only the table is used.
19060
19061 2001-12-10 Akim Demaille <akim@epita.fr>
19062
19063 * src/LR0.h (first_shift, first_reduction): Remove.
19064 * src/lalr.c: Don't use first_shift: find shifts through the
19065 states.
19066
19067 2001-12-10 Akim Demaille <akim@epita.fr>
19068
19069 * src/LR0.c: Attach shifts to states as soon as they are
19070 computed.
19071 * src/lalr.c (set_state_table): Instead of assigning shifts to
19072 state, just assert that the mapping was properly done.
19073
19074 2001-12-10 Akim Demaille <akim@epita.fr>
19075
19076 * src/LR0.c (insert_start_shift): Rename as...
19077 (insert_start_shifting_state): this.
19078 (insert_eof_shifting_state, insert_accepting_state): New.
19079 (augment_automaton): Adjust.
19080 Better locality of the variables.
19081 When looking if the start_symbol is shifted from the initial
19082 state, using `while (... symbol != start_symbol ...)' sounds
19083 better than `while (... symbol < start_symbol ...)': If fail
19084 to see how the order between symbols could be relevant!
19085
19086 2001-12-10 Akim Demaille <akim@epita.fr>
19087
19088 * src/getargs.h: Don't declare `spec_name_prefix' and
19089 `spec_file_prefix', declared by src/files.h.
19090 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
19091 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
19092 * src/output.c (prepare): Adjust.
19093 * src/reader.c (symbols_output): Likewise.
19094 * src/vmsgetargs.c: Vaguely adjust, but who cares?
19095
19096 2001-12-10 Akim Demaille <akim@epita.fr>
19097
19098 * src/muscle_tab.c (muscle_init): NULL is a better default than
19099 `"0"'.
19100
19101 2001-12-10 Akim Demaille <akim@epita.fr>
19102
19103 * src/reader.c (reader): Calling symbols_output once is enough.
19104
19105 2001-12-10 Akim Demaille <akim@epita.fr>
19106
19107 Now that states have a complete set of members, the linked list of
19108 reductions is useless: just fill directly the state's reductions
19109 member.
19110
19111 * src/state.h (struct reductions): Remove member `number' and
19112 `next'.
19113 * src/LR0.c (first_reduction, last_reduction): Remove.
19114 (save_reductions): Don't link the new reductions, store them in
19115 this_state.
19116 * src/lalr.c (set_state_table): No need to attach reductions to
19117 states, it's already done.
19118 * src/output.c (output_actions): No longer free the shifts, then
19119 the reductions, then the states: free all the states and their
19120 members.
19121
19122 2001-12-10 Akim Demaille <akim@epita.fr>
19123
19124 * src/options.c (OPTN, DRTV, BOTH): New.
19125 (option_table): Use them.
19126
19127 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
19128 the job of system.h.
19129 * src/options.c: Don't include stdio.h and xalloc.h for the same
19130 reasons.
19131
19132 2001-12-10 Akim Demaille <akim@epita.fr>
19133
19134 * src/output.c (output, prepare): Make sure the values of the
19135 muscles `action' and `prologue' are 0-terminated.
19136
19137 2001-12-10 Akim Demaille <akim@epita.fr>
19138
19139 Clean up GCC warnings.
19140
19141 * src/reader.c (copy_action): `buf' is not used.
19142 (parse_skel_decl): Be static.
19143 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
19144 * src/options.h (create_long_option_table): Have a real prototype.
19145 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
19146 (hash_delete_at): Return const void *.
19147 Adjust casts to preserve the const.
19148
19149 2001-12-10 Akim Demaille <akim@epita.fr>
19150
19151 * configure.in: Require 2.52g.
19152 M4 is not needed, but AUTOM4TE is.
19153 * m4/m4.m4: Remove.
19154 * tests/Makefile.am: Adjust.
19155
19156 2001-12-10 Akim Demaille <akim@epita.fr>
19157
19158 One structure for states is enough, even though theoretically
19159 there are LR(0) states and LALR(1) states.
19160
19161 * src/lalr.h (state_t): Remove.
19162 (state_table): Be state_t **, not state_t *.
19163 * src/state.h (core, CORE_ALLOC): Rename as...
19164 (state_t, STATE_ALLOC): this.
19165 Add the LALR(1) members: shifts, reductions, errs.
19166 * src/LR0.c (state_table): Rename as...
19167 (state_hash): this, to avoid name clashes with the global
19168 `state_table'.
19169 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
19170 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
19171
19172 2001-12-10 Akim Demaille <akim@epita.fr>
19173
19174 Bison dumps core on bash.y.
19175 Reported by Pascal Bart.
19176
19177 * src/warshall.c (bitmatrix_print): New.
19178 (TC): Use it.
19179 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
19180 j must be the outer loop.
19181 * tests/regression.at (Broken Closure): New.
19182
19183 2001-12-05 Akim Demaille <akim@epita.fr>
19184
19185 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
19186 its argument.
19187 Reported by Peter Hamorsky.
19188
19189 2001-12-05 Akim Demaille <akim@epita.fr>
19190
19191 * src/conflicts.c (err_table): Remove.
19192 (resolve_sr_conflict): Adjust.
19193 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
19194 Rename as...
19195 (state_t.reductions, state_t.shifts): this.
19196
19197 2001-12-05 Akim Demaille <akim@epita.fr>
19198
19199 * src/reduce.c (reduce_grammar_tables): No longer disable the
19200 removal of useless rules via CPP but via `if (0)', so that the
19201 compiler still check the code is valid.
19202 For instance, it should have noticed `rline' no longer exists: use
19203 the `line' member of rule_t.
19204 * src/gram.c (dummy, rline): Remove, unused.
19205
19206 2001-12-05 Akim Demaille <akim@epita.fr>
19207
19208 * src/output.c (pack_vector): Use assert, not berror.
19209 * src/main.c (berror): Remove, unused.
19210
19211 2001-12-05 Akim Demaille <akim@epita.fr>
19212
19213 New experimental feature: if --verbose --trace output all the
19214 items of a state, not only its kernel.
19215
19216 * src/print.c (print_core): If `trace_flag', then invoke closure
19217 before outputting the items of the state (print_core is no longer
19218 a correct name them).
19219 (print_results): Invoke new_closure/free_closure if needed.
19220
19221 2001-12-05 Akim Demaille <akim@epita.fr>
19222
19223 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
19224 * src/closure.c, src/closure.h (itemsetsize): Rename as...
19225 (nitemset): for consistency with the rest of the project.
19226
19227 2001-12-05 Akim Demaille <akim@epita.fr>
19228
19229 * src/closure.c (print_closure): Improve.
19230 (closure): Use it for printing input and output.
19231
19232 2001-12-05 Akim Demaille <akim@epita.fr>
19233
19234 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
19235 indexed by nonterminals.
19236
19237 2001-12-05 Akim Demaille <akim@epita.fr>
19238
19239 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
19240 what it was!).
19241 * src/warshall.h: Remove accidental duplication of the content.
19242
19243 2001-12-05 Akim Demaille <akim@epita.fr>
19244
19245 * src/closure.c (set_fderives): De-obfuscate.
19246
19247 2001-12-05 Akim Demaille <akim@epita.fr>
19248
19249 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
19250
19251 2001-12-05 Akim Demaille <akim@epita.fr>
19252
19253 * src/closure.c (set_firsts): De-obfuscate.
19254
19255 2001-12-05 Akim Demaille <akim@epita.fr>
19256
19257 * src/output.c (action_row): De-obfuscate
19258 using the good o' techniques: arrays not pointers, variable
19259 locality, BITISSET, RESETBIT etc.
19260
19261 2001-12-05 Akim Demaille <akim@epita.fr>
19262
19263 Pessimize the code to simplify it: from now on, all the states
19264 have a valid SHIFTS, which NSHIFTS is possibly 0.
19265
19266 * src/LR0.c (shifts_new): Be global and move to..
19267 * src/state.c, src/state.h: here.
19268 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
19269 * src/print_graph: Adjust.
19270
19271 2001-12-05 Akim Demaille <akim@epita.fr>
19272
19273 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
19274 * src/conflicts.c: Use it.
19275 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
19276 incorrectly ``simplified''.
19277
19278 2001-12-05 Akim Demaille <akim@epita.fr>
19279
19280 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
19281 using the good o' techniques: arrays not pointers, variable
19282 locality, BITISSET, RESETBIT etc.
19283
19284 2001-12-05 Akim Demaille <akim@epita.fr>
19285
19286 * src/state.h (SHIFT_SYMBOL): New.
19287 * src/conflicts.c: Use it to deobfuscate.
19288
19289 2001-12-05 Akim Demaille <akim@epita.fr>
19290
19291 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
19292 (print_reductions): De-obfuscate using the good o' techniques:
19293 arrays not pointers, variable locality, BITISSET.
19294
19295 2001-12-05 Akim Demaille <akim@epita.fr>
19296
19297 * src/conflicts.c (print_reductions): Arrays, not pointers.
19298 Use BITISSET.
19299
19300 2001-12-05 Akim Demaille <akim@epita.fr>
19301
19302 * src/conflicts.c (print_reductions): Pessimize, but clarify.
19303
19304 2001-12-05 Akim Demaille <akim@epita.fr>
19305
19306 * src/conflicts.c (print_reductions): Improve variable locality.
19307
19308 2001-12-05 Akim Demaille <akim@epita.fr>
19309
19310 * src/conflicts.c (print_reductions): Pessimize, but clarify.
19311
19312 2001-12-05 Akim Demaille <akim@epita.fr>
19313
19314 * src/conflicts.c (print_reductions): Improve variable locality.
19315
19316 2001-12-05 Akim Demaille <akim@epita.fr>
19317
19318 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
19319 * src/lalr.c: Use them.
19320
19321 2001-12-05 Akim Demaille <akim@epita.fr>
19322
19323 * src/LR0.c (augment_automaton): Formatting changes.
19324 Better variable locality.
19325
19326 2001-12-05 Akim Demaille <akim@epita.fr>
19327
19328 * src/lalr.c (matrix_print): New.
19329 (transpose): Use it.
19330 Use arrays instead of pointers.
19331
19332 2001-12-05 Akim Demaille <akim@epita.fr>
19333
19334 * src/lalr.c (maxrhs): Move to...
19335 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
19336 * src/lalr.c (build_relations): Adjust.
19337
19338 2001-12-05 Akim Demaille <akim@epita.fr>
19339
19340 * src/lalr.c (transpose): Free the memory allocated to the
19341 argument, as it is replaced by the results by the unique caller.
19342 (build_relations): Merely invoke transpose: it handles the memory
19343 deallocation.
19344 Improve variable locality.
19345 Avoid variables used as mere abbreviations.
19346 (compute_lookaheads): Use arrays instead of pointers.
19347
19348 2001-12-05 Akim Demaille <akim@epita.fr>
19349
19350 * src/lalr.c (initialize_F): Improve variable locality.
19351 Avoid variables used as mere abbreviations.
19352
19353 2001-12-05 Akim Demaille <akim@epita.fr>
19354
19355 * src/derives.c (print_derives): Display the ruleno.
19356 * src/lalr.c (initialize_F, transpose): Better variable locality
19357 to improve readability.
19358 Avoid variables used as mere abbreviations.
19359
19360 2001-12-05 Akim Demaille <akim@epita.fr>
19361
19362 * src/lalr.c (traverse): Use arrays instead of pointers.
19363
19364 2001-12-05 Akim Demaille <akim@epita.fr>
19365
19366 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
19367 the handling of squeue.
19368 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
19369
19370 2001-12-05 Akim Demaille <akim@epita.fr>
19371
19372 Because useless nonterminals are now kept alive (instead of being
19373 `destroyed'), we now sometimes examine them, and store information
19374 related to them. Hence we need to know their number, and adjust
19375 memory allocations.
19376
19377 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
19378 static.
19379 * src/LR0.c (allocate_itemsets): The memory allocated to
19380 `symbol_count' was used for two different purpose: once to count
19381 the number of occurrences of each symbol, and later reassigned to
19382 `shift_symbol', containing the symbol that can be shifted from a
19383 given state.
19384 Deobfuscate, i.e., allocate, use and free `symbol_count' here
19385 only, and...
19386 (new_itemsets): Allocate `shift_symbol' here.
19387 (allocate_itemsets): symbol_count includes useless nonterminals.
19388 Make room for them.
19389 (free_storage): Use `free', not `XFREE', for pointers that cannot
19390 be null.
19391
19392 2001-12-05 Akim Demaille <akim@epita.fr>
19393
19394 * src/nullable.c (set_nullable): Deobfuscate the handling of
19395 ritem.
19396 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
19397
19398 2001-12-05 Akim Demaille <akim@epita.fr>
19399
19400 * src/gram.c, src/gram.h (ritem_print): New.
19401 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
19402 (This useless function was defined only to work around VMS linkers
19403 that can't handle compilation units with variables only).
19404 * src/reduce.c (dump_grammar): Use it to trace the construction of
19405 ritem.
19406
19407 2001-12-04 Paul Eggert <eggert@twinsun.com>
19408
19409 * src/bison.simple (union yyalloc): Change member names
19410 to be the same as the stack names.
19411 (yyparse): yyptr is now union yyalloc *, not char *.
19412 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
19413 and may generate better code on some machines.
19414 (yystpcpy): Use prototype if __STDC__ is defined, not just
19415 if __cplusplus is defined.
19416
19417 2001-11-30 Akim Demaille <akim@epita.fr>
19418
19419 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
19420 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
19421 Gettext doesn't compile cleanly, and dies with -Werror.
19422 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
19423 Include WARNING_CFLAGS here.
19424 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
19425 before being defined.
19426
19427 2001-11-27 Paul Eggert <eggert@twinsun.com>
19428
19429 * lib/quotearg.h (quotearg_n, quotearg_n_style):
19430 First arg is int, not unsigned.
19431 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
19432 (SIZE_MAX, UINT_MAX): New macros.
19433 (quotearg_n_options): Abort if N is negative.
19434 Avoid overflow check on hosts where size_t is 64 bits and int
19435 is 32 bits, as overflow is impossible there.
19436 Fix off-by-one typo that caused unnecessary reallocation.
19437
19438 2001-11-29 Paul Eggert <eggert@twinsun.com>
19439
19440 Name space cleanup in generated parser.
19441
19442 * doc/bison.texinfo (Bison Parser): Discuss system headers
19443 and their effect on the user name space.
19444
19445 * src/bison.simple:
19446 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
19447 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
19448 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
19449
19450 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
19451 on user names when possible.
19452
19453 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
19454 Simplify test for whather <alloca.h> exists.
19455
19456 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
19457
19458 (<stdio.h>): Include if YYDEBUG.
19459
19460 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
19461 ! defined (yyoverflow) && ! defined (yymemcpy).
19462
19463 (yymemcpy, yyparse): Rename local variables as needed so that
19464 they all begin with 'yy'.
19465
19466 (yystrlen, yystpcpy): New functions.
19467
19468 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
19469 All uses changed.
19470
19471 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
19472 instead of relying on string.h functions. Use YYSTACK_ALLOC
19473 and YYSTACK_FREE instead of malloc and free.
19474
19475 2001-11-30 Akim Demaille <akim@epita.fr>
19476
19477 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
19478 before their first uses.
19479 (YYBISON, YYPURE): Move to the top of the output.
19480
19481 2001-11-30 Akim Demaille <akim@epita.fr>
19482
19483 * tests/reduce.at (Useless Nonterminals): Fix.
19484
19485 2001-11-30 Akim Demaille <akim@epita.fr>
19486
19487 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
19488 if body instead of `;' to pacify GCC's warnings.
19489
19490 2001-11-30 Akim Demaille <akim@epita.fr>
19491
19492 Instead of mapping the LHS of unused rules to -1, keep the LHS
19493 valid, but flag the rules as invalid.
19494
19495 * src/gram.h (rule_t): `useful' is a new member.
19496 * src/print.c (print_grammar): Adjust.
19497 * src/derives.c (set_derives): Likewise.
19498 * src/reader.c (packgram, reduce_output): Likewise.
19499 * src/reduce.c (reduce_grammar_tables): Likewise.
19500 * tests/reduce.at (Underivable Rules, Useless Rules): New.
19501
19502 2001-11-30 Akim Demaille <akim@epita.fr>
19503
19504 * src/reduce.c (reduce_output): Formatting changes.
19505 * src/print.c (print_results, print_grammar): Likewise.
19506 * tests/regression.at (Rule Line Numbers)
19507 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
19508
19509 2001-11-30 Akim Demaille <akim@epita.fr>
19510
19511 * src/reduce.c (nonterminals_reduce): Instead of throwing away
19512 useless nonterminals, move them at the end of the symbol arrays.
19513 (reduce_output): Adjust.
19514 * tests/reduce.at (Useless Nonterminals): Adjust.
19515
19516 2001-11-30 Akim Demaille <akim@epita.fr>
19517
19518 * src/reduce.c: Various comment/formatting changes.
19519 (nonterminals_reduce): New, extracted from...
19520 (reduce_grammar_tables): here.
19521 (reduce_grammar): Call nonterminals_reduce.
19522
19523 2001-11-29 Paul Eggert <eggert@twinsun.com>
19524
19525 * src/bison.simple (YYSTACK_REALLOC): Remove.
19526 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
19527 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
19528 New macros.
19529 (union yyalloc): New type.
19530 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
19531 an arbitrary restriction on hosts where size_t is wider than int.
19532
19533 (yyparse): Don't dump core if alloca or malloc fails; instead, report
19534 a parser stack overflow. Allocate just one block of memory for all
19535 three stacks, instead of allocating three blocks; this typically is
19536 faster and reduces fragmentation.
19537
19538 Do not limit the number of items in the stack to a value that fits
19539 in 'int', as this is an arbitrary limit on hosts with 64-bit
19540 size_t and 32-bit int.
19541
19542 2001-11-29 Marc Autret <autret_m@epita.fr>
19543
19544 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
19545 of defining YYERROR_VERBOSE.
19546 [AT_DATA]: $4 is now out of C declarations in the prologue.
19547
19548 2001-11-28 Marc Autret <autret_m@epita.fr>
19549
19550 * src/reader.c (parse_dquoted_param): New.
19551 (parse_skel_decl): Use it.
19552 * src/lex.h: Add its prototype.
19553 * src/lex.c (literalchar): Become not static.
19554
19555 2001-11-28 Marc Autret <autret_m@epita.fr>
19556
19557 * src/output.h: And put its extern declaration here.
19558 * src/output.c (error_verbose): Define here.
19559 (prepare): Echo name modification.
19560 * src/getargs.h: Clean its extern declaration.
19561 * src/getargs.c (error_verbose_flag): Remove.
19562 (getargs): Remove case 'e'.
19563 * src/options.c (option_table): 'error-verbose' is now seen as simple
19564 percent option.
19565 Include output.h.
19566
19567 * src/reader.c (read_declarations): Remove case tok_include.
19568 (parse_include_decl): Remove.
19569 * src/lex.h (token_t): Remove tok_include.
19570 * src/options.c (option_table): 'include' is now a simple command line
19571 option.
19572
19573 2001-11-28 Marc Autret <autret_m@epita.fr>
19574
19575 * src/bison.simple: Adjust muscle names.
19576 * src/muscle_tab.c (muscle_init): Also rename the muscles.
19577 * src/output.c (prepare): s/_/-/ for the muscles names.
19578 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
19579
19580 2001-11-28 Marc Autret <autret_m@epita.fr>
19581
19582 * src/bison.simple: Fix debug.
19583 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
19584
19585 2001-11-28 Akim Demaille <akim@epita.fr>
19586
19587 * src/LR0.c (shifts_new): New.
19588 (save_shifts, insert_start_shift, augment_automaton): Use it.
19589
19590 2001-11-28 Akim Demaille <akim@epita.fr>
19591
19592 * src/closure.c (closure): `b' and `ruleno' denote the same value:
19593 keep ruleno only.
19594
19595 2001-11-28 Akim Demaille <akim@epita.fr>
19596
19597 * src/closure.c (closure): Instead of looping over word in array
19598 then bits in words, loop over bits in array.
19599
19600 2001-11-28 Akim Demaille <akim@epita.fr>
19601
19602 * src/closure.c (closure): No longer optimize the special case
19603 where all the bits of `ruleset[r]' are set to 0, to make the code
19604 clearer.
19605
19606 2001-11-28 Akim Demaille <akim@epita.fr>
19607
19608 * src/closure.c (closure): `r' and `c' are new variables, used to
19609 de-obfuscate accesses to RULESET and CORE.
19610
19611 2001-11-28 Akim Demaille <akim@epita.fr>
19612
19613 * src/reduce.c (reduce_print): Use ngettext.
19614 (dump_grammar): Improve the trace accuracy.
19615
19616 2001-11-28 Akim Demaille <akim@epita.fr>
19617
19618 * src/reduce.c (dump_grammar): Don't translate trace messages.
19619
19620 2001-11-28 Akim Demaille <akim@epita.fr>
19621
19622 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
19623 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
19624 as all tags are free'ed afterwards.
19625 From Enrico Scholz.
19626
19627 2001-11-27 Paul Eggert <eggert@twinsun.com>
19628
19629 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
19630 use alloca when we didn't want to, and vice versa.
19631
19632 2001-11-27 Marc Autret <autret_m@epita.fr>
19633
19634 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
19635 initialization.
19636 * src/output.c (prepare): Remove its update.
19637
19638 2001-11-27 Marc Autret <autret_m@epita.fr>
19639
19640 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
19641 Use %error-verbose.
19642
19643 2001-11-27 Marc Autret <autret_m@epita.fr>
19644
19645 * src/bison.simple: Remove YYERROR_VERBOSE using.
19646 Use %%error_verbose.
19647 (yyparse): Likewise.
19648 * src/output.c (prepare): Give its final value.
19649 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
19650 * src/getargs.h: Add its extern declaration.
19651 * src/getargs.c (error_verbose_flag): New int.
19652 (getargs): Update to catch new case.
19653 * src/options.c (option_table): 'error-verbose' is a new option.
19654 (shortopts): Update.
19655
19656 2001-11-27 Akim Demaille <akim@epita.fr>
19657
19658 * src/system.h: Use intl/libgettext.h.
19659 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
19660
19661 2001-11-27 Akim Demaille <akim@epita.fr>
19662
19663 * tests/torture.at (Exploding the Stack Size with Malloc):
19664 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
19665
19666 2001-11-27 Akim Demaille <akim@epita.fr>
19667
19668 * src/files.c: Include error.h.
19669 Reported by Hans Aberg.
19670
19671 2001-11-26 Marc Autret <autret_m@epita.fr>
19672
19673 * src/reader.c (parse_include_decl): New, not yet implemented.
19674 (read_declarations): Add case tok_include.
19675 * src/getargs.h (include): Add its extern definition.
19676 * src/getargs.c (include): New const char *.
19677 (getargs): Add case '-I'.
19678 * src/options.c (option_table): Add include as command line and
19679 percent option.
19680 * src/lex.h (token_t): Add tok_include.
19681
19682 2001-11-26 Akim Demaille <akim@epita.fr>
19683
19684 * src/reader.c (readgram): Make sure rules for mid-rule actions
19685 have a lineno equal to that of their host rule.
19686 Reported by Hans Aberg.
19687 * tests/regression.at (Rule Line Numbers): New.
19688
19689 2001-11-26 Akim Demaille <akim@epita.fr>
19690
19691 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
19692 size_ts.
19693
19694 2001-11-26 Akim Demaille <akim@epita.fr>
19695
19696 * src/complain.c, src/complain.h (error): Remove, provided by
19697 lib/error.[ch].
19698
19699 2001-11-26 Akim Demaille <akim@epita.fr>
19700
19701 * src/reader.c (read_declarations): Don't abort on tok_illegal,
19702 issue an error message.
19703 * tests/regression.at (Invalid %directive): New.
19704 Reported by Hans Aberg.
19705
19706 2001-11-26 Akim Demaille <akim@epita.fr>
19707
19708 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
19709 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
19710
19711 2001-11-26 Akim Demaille <akim@epita.fr>
19712
19713 * src/conflicts.c (conflicts_print): Don't complain at all when
19714 there are no reduce/reduce conflicts, and as many shift/reduce
19715 conflicts as expected.
19716 * tests/regression.at (%expect right): Adjust.
19717
19718 2001-11-23 Akim Demaille <akim@epita.fr>
19719
19720 * lib/alloca.c: Update, from fileutils.
19721
19722 2001-11-23 Akim Demaille <akim@epita.fr>
19723
19724 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
19725
19726 2001-11-23 Akim Demaille <akim@epita.fr>
19727
19728 * src/system.h: Include alloca.h.
19729 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
19730
19731 2001-11-23 Akim Demaille <akim@epita.fr>
19732
19733 * src/print_graph.c (print_actions): Remove `rule', unused.
19734 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
19735 pacify GCC's signed < unsigned warnings.
19736 * src/closure.c (itemsetsize): Likewise.
19737 * src/reader.c (symbol_list_new): Static.
19738
19739 2001-11-23 Akim Demaille <akim@epita.fr>
19740
19741 Attaching lineno to buckets is stupid, since only one copy of each
19742 symbol is kept, only the line of the first occurrence is kept too.
19743
19744 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
19745 * src/reader.c (rline_allocated): Remove, unused.
19746 (symbol_list): Have a `line' member.
19747 (symbol_list_new): New.
19748 (readgram): Use it.
19749 * src/print.c (print_grammar): Output the rule line numbers.
19750 * tests/regression.at (Solved SR Conflicts)
19751 (Unresolved SR Conflicts): Adjust.
19752 Reported by Hans Aberg.
19753
19754 2001-11-22 Marc Autret <autret_m@epita.fr>
19755
19756 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
19757
19758 2001-11-22 Marc Autret <autret_m@epita.fr>
19759
19760 * src/muscle_tab.c (muscle_init): Remove initialization of
19761 skeleton muscle.
19762 * src/output.c (output_master_parser): Do it here.
19763
19764 2001-11-20 Akim Demaille <akim@epita.fr>
19765
19766 * po/sv.po: New.
19767 * configure.in (ALL_LINGUAS): Adjust.
19768 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
19769 longer contains strings to translate.
19770
19771 2001-11-19 Akim Demaille <akim@epita.fr>
19772
19773 * src/conflicts.c (conflicts_print): Add a missing \n.
19774
19775 2001-11-19 Akim Demaille <akim@epita.fr>
19776
19777 * src/nullable.c (nullable_print): New.
19778 (set_nullable): Call it when tracing.
19779 Better locality of variables.
19780
19781 2001-11-19 Akim Demaille <akim@epita.fr>
19782
19783 * src/print.c (print_actions): Better locality of variables.
19784
19785 2001-11-19 Akim Demaille <akim@epita.fr>
19786
19787 * src/derives.c (print_derives): Fix and enrich.
19788 * src/closure.c (print_fderives): Likewise.
19789
19790 2001-11-19 Akim Demaille <akim@epita.fr>
19791
19792 * src/closure.c (itemsetend): Remove, replaced with...
19793 (itemsetsize): new.
19794
19795 2001-11-19 Akim Demaille <akim@epita.fr>
19796
19797 * src/LR0.c (kernel_end): Remove, replaced with...
19798 (kernel_size): new.
19799
19800 2001-11-19 Akim Demaille <akim@epita.fr>
19801
19802 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
19803 to clarify.
19804
19805 2001-11-19 Akim Demaille <akim@epita.fr>
19806
19807 * src/closure.c (closure): Use arrays instead of pointers to clarify.
19808
19809 2001-11-19 Akim Demaille <akim@epita.fr>
19810
19811 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
19812 trace messages.
19813 * src/LR0.c: Likewise.
19814 (allocate_itemsets): Use arrays instead of pointers to clarify.
19815
19816 2001-11-19 Akim Demaille <akim@epita.fr>
19817
19818 * src/getargs.c (statistics_flag): Replace with...
19819 (trace_flag): New.
19820 (longopts): Accept --trace instead of --statistics.
19821 * src/getargs.h, src/options.c: Adjust.
19822 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
19823 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
19824
19825 2001-11-19 Akim Demaille <akim@epita.fr>
19826
19827 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
19828 pointers to clarify the code.
19829 (save_reductions, save_shifts): Factor common parts of alternatives.
19830
19831 2001-11-19 Akim Demaille <akim@epita.fr>
19832
19833 * src/LR0.c (new_state, get_state): Complete TRACE code.
19834 * src/closure.c: Include `reader.h' to get `tags', needed by the
19835 trace code.
19836 Rename the conditional DEBUG as TRACE.
19837 Output consistently TRACEs to stderr, not stdout.
19838 * src/derives.c: Likewise.
19839 * src/reduce.c: (inaccessable_symbols): Using if is better style
19840 than goto.
19841 Use `#if TRACE' instead of `#if 0' for tracing code.
19842
19843 2001-11-19 Akim Demaille <akim@epita.fr>
19844
19845 * src/system.h (LIST_FREE, shortcpy): New.
19846 * src/LR0.c: Use them.
19847 * src/output.c (free_itemsets, free_reductions, free_shifts):
19848 Remove, replaced by LIST_FREE.
19849
19850 2001-11-19 Akim Demaille <akim@epita.fr>
19851
19852 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
19853 (REDUCTIONS_ALLOC): New.
19854 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
19855 allocation.
19856
19857 2001-11-19 Akim Demaille <akim@epita.fr>
19858
19859 * src/LR0.c (new_state): Complete trace code.
19860 * src/nullable.c (set_nullable): Don't translate traces.
19861
19862 2001-11-19 Akim Demaille <akim@epita.fr>
19863
19864 * src/print_graph.c (print_core): Better locality of variables.
19865 * src/print.c (print_core): Likewise.
19866
19867 2001-11-19 Akim Demaille <akim@epita.fr>
19868
19869 * src/vcg.c: You do the output, so you are responsible of the
19870 handling of VCG syntax, in particular: use quotearg.
19871 * src/print_graph.c: Don't.
19872 (print_actions): Don't output the actions as part of the nodes,
19873 since that's the job of the edges.
19874 (print_state): Don't output by hand: fill the node description,
19875 and ask for its output.
19876
19877 2001-11-19 Akim Demaille <akim@epita.fr>
19878
19879 * src/bison.simple (yyparse): When verbosely reporting an error,
19880 no longer put additional quotes around token names.
19881 * tests/calc.at: Adjust.
19882
19883 2001-11-19 Akim Demaille <akim@epita.fr>
19884
19885 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
19886 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
19887 * src/output.c: Adjust.
19888
19889 2001-11-19 Akim Demaille <akim@epita.fr>
19890
19891 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
19892 (rule_t): this.
19893 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
19894
19895 2001-11-19 Akim Demaille <akim@epita.fr>
19896
19897 * src/gram.h (rule_t): New.
19898 (rule_table): New.
19899 (rrhs, rlhs): Remove, part of state_t.
19900 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
19901 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
19902 * src/reader.c, src/reduce.c: Adjust.
19903
19904 2001-11-19 Akim Demaille <akim@epita.fr>
19905
19906 * src/reader.c (symbols_output): New, extracted from...
19907 (packsymbols): Here.
19908 (reader): Call it.
19909
19910 2001-11-19 Akim Demaille <akim@epita.fr>
19911
19912 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
19913 (maxrhs): this new function.
19914
19915 2001-11-19 Akim Demaille <akim@epita.fr>
19916
19917 * src/lalr.c (F): New macro to access the variable F.
19918 Adjust.
19919
19920 2001-11-19 Akim Demaille <akim@epita.fr>
19921
19922 * src/lalr.h (LA): New macro to access the variable LA.
19923 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
19924 * src/lalr.c: Adjust.
19925
19926 2001-11-19 Akim Demaille <akim@epita.fr>
19927
19928 * src/lalr.c (initialize_LA): Only initialize LA. Let...
19929 (set_state_table): handle the `lookaheads' members.
19930
19931 2001-11-19 Akim Demaille <akim@epita.fr>
19932
19933 * src/lalr.h (lookaheads): Removed array, whose contents is now
19934 a member of...
19935 (state_t): this structure.
19936 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
19937 Adjust.
19938
19939 2001-11-19 Akim Demaille <akim@epita.fr>
19940
19941 * src/lalr.h (consistent): Removed array, whose contents is now
19942 a member of...
19943 (state_t): this structure.
19944 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
19945 Adjust.
19946
19947 2001-11-19 Akim Demaille <akim@epita.fr>
19948
19949 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
19950 contents are now members of...
19951 (state_t): this structure.
19952 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
19953 Adjust.
19954
19955 2001-11-19 Akim Demaille <akim@epita.fr>
19956
19957 * src/lalr.h (state_t): New.
19958 (state_table): Be a state_t * instead of a core **.
19959 (accessing_symbol): Remove, part of state_t.
19960 * src/lalr.c: Adjust.
19961 (set_accessing_symbol): Merge into...
19962 (set_state_table): this.
19963 * src/print_graph.c, src/conflicts.c: Adjust.
19964
19965 2001-11-14 Akim Demaille <akim@epita.fr>
19966
19967 * tests/calc.at, tests/output.at, tests/regression.at,
19968 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
19969 now the tests are run in private dirs, therefore AC_CLEANUP and
19970 family can be simplified to 0-ary.
19971 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
19972 use abs. path to find config.h.
19973 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
19974 stderr, there can be way too much random noise.
19975 Instead pass -Werror to GCC and rely on the exit status.
19976 Reported by Wolfram Wagner.
19977
19978 2001-11-14 Akim Demaille <akim@epita.fr>
19979
19980 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
19981 defined only if yyoverflow is defined, to avoid `warning: unused
19982 variable `yyvs1''.
19983 Reported by The Test Suite.
19984
19985 2001-11-14 Akim Demaille <akim@epita.fr>
19986
19987 * src/print.c: Include reduce.h.
19988 Reported by Hans Aberg.
19989
19990 2001-11-14 Akim Demaille <akim@epita.fr>
19991
19992 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
19993 Revert a previous patch: these are really const.
19994 * src/conflicts.c (conflict_report): Additional useless pair of
19995 braces to pacify GCC's warnings for `if () if () {} else {}'.
19996 * src/lex.c (parse_percent_token): Replace equal_offset with
19997 arg_offset.
19998 arg is const.
19999 Be sure to strdup `arg' when used, since there is no reason for
20000 token_buffer not to change.
20001
20002 2001-11-14 Akim Demaille <akim@epita.fr>
20003
20004 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
20005 definition.
20006 * src/main.c (main): Use them.
20007 Suggested by Hans Aberg.
20008
20009 2001-11-12 Akim Demaille <akim@epita.fr>
20010
20011 * src/system.h (ngettext): Now that we use ngettext, be sure to
20012 provide a default definition when NLS are not used.
20013
20014 2001-11-12 Akim Demaille <akim@epita.fr>
20015
20016 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
20017 Use @kbd to denote user input.
20018 (Language and Grammar): ANSIfy the example.
20019 Adjust its layout for info/notinfo.
20020 (Location Tracking Calc): Output error messages to stderr.
20021 Output locations in a more GNUtically correct way.
20022 Fix a couple of Englishos.
20023 Adjust @group/@end group pairs.
20024
20025 2001-11-12 Akim Demaille <akim@epita.fr>
20026
20027 %expect was not functioning at all.
20028
20029 * src/conflicts.c (expected_conflicts): Set to -1.
20030 (conflict_report): Use ngettext.
20031 (conflicts_print): Check %expect and make its violation an error.
20032 * doc/bison.texinfo (Expect Decl): Adjust.
20033 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
20034 * tests/regression.at (%expect not enough, %expect right)
20035 (%expect too much): New.
20036
20037 2001-11-12 Akim Demaille <akim@epita.fr>
20038
20039 * tests/regression.at (Conflicts): Rename as...
20040 (Unresolved SR Conflicts): this.
20041 (Solved SR Conflicts): New.
20042
20043 2001-11-12 Akim Demaille <akim@epita.fr>
20044
20045 * src/reduce.c (print_results): Rename as...
20046 (reduce_output): This.
20047 Output to OUT, passed as argument, instead of output_obstack.
20048 (dump_grammar): Likewise.
20049 (reduce_free): New.
20050 Also free V1.
20051 (reduce_grammar): No longer call reduce_output, since...
20052 * src/print.c (print_results): do it.
20053 * src/main.c (main): Call reduce_free;
20054
20055 2001-11-12 Akim Demaille <akim@epita.fr>
20056
20057 * src/conflicts.c (print_reductions): Accept OUT as argument.
20058 Output to it, not to output_obstack.
20059 * src/print.c (print_actions): Adjust.
20060
20061 2001-11-12 Akim Demaille <akim@epita.fr>
20062
20063 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
20064 the result instead of using...
20065 (src_total, rrc_total, src_count, rrc_count): Remove.
20066 (any_conflicts): Remove.
20067 (print_conflicts): Split into...
20068 (conflicts_print, conflicts_output): New.
20069 * src/conflicts.h: Adjust.
20070 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
20071 * src/print.c (print_grammar): Issue `\n' between two rules.
20072 * tests/regression.at (Conflicts): New.
20073 Reported by Tom Lane.
20074
20075 2001-11-12 Akim Demaille <akim@epita.fr>
20076
20077 * tests/regression.at (Invalid input): Remove, duplicate with
20078 ``Invalid input: 1''.
20079
20080 2001-11-12 Akim Demaille <akim@epita.fr>
20081
20082 * tests/torture.at (AT_DATA_STACK_TORTURE)
20083 (Exploding the Stack Size with Alloca)
20084 (Exploding the Stack Size with Malloc): New.
20085
20086 2001-11-12 Akim Demaille <akim@epita.fr>
20087
20088 * src/bison.simple (YYSTACK_REALLOC): New.
20089 (yyparse) [!yyoverflow]: Use it and free the old stack.
20090 Reported by Per Allansson.
20091
20092 2001-11-12 Pascal Bart <pascal.bart@epita.fr>
20093
20094 * src/bison.simple: Define type yystype instead of YYSTYPE, and
20095 define CPP macro, which substitute YYSTYPE by yystype.
20096 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
20097 with yyltype/YYLTYPE. This allows inclusion of the generated
20098 header within the parser if the compiler, such as GGC, accepts
20099 multiple equivalent #defines.
20100 From Akim.
20101
20102 2001-11-05 Akim Demaille <akim@epita.fr>
20103
20104 * src/reader.c (symbols_output): New, extracted from...
20105 (packsymbols): here.
20106 (reader): Adjust.
20107
20108 2001-11-05 Akim Demaille <akim@epita.fr>
20109
20110 * src/lex.c (parse_percent_token): s/quotearg/quote/.
20111
20112 2001-11-05 Akim Demaille <akim@epita.fr>
20113
20114 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
20115 pattern.
20116
20117 2001-11-05 Akim Demaille <akim@epita.fr>
20118
20119 * src/options.h (struct option_table_struct): set_flags is void*.
20120 * src/options.c (longopts): Support `--output' and `%output'.
20121 (usage): Adjust.
20122 * src/lex.h (tok_setopt): Remove, replaced with...
20123 (tok_intopt, tok_stropt): these new guys.
20124 * src/lex.c (getopt.h): Not needed.
20125 (token_buffer, unlexed_token_buffer): Not const.
20126 (percent_table): Promote `-' over `_' in directive names.
20127 Active `%name-prefix', `file-prefix', and `output'.
20128 (parse_percent_token): Accept possible arguments to directives.
20129 Promote `-' over `_' in directive names.
20130
20131 2001-11-04 Akim Demaille <akim@epita.fr>
20132
20133 * doc/bison.texinfo (Decl Summary): Split the list into
20134 `directives for grammars' and `directives for bison'.
20135 Sort'em.
20136 Add description of `%name-prefix', `file-prefix', and `output'.
20137 Promote `-' over `_' in directive names.
20138 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
20139 Simplify the description of `--name-prefix'.
20140 Promote `-' over `_' in directive names.
20141 Promote `--output' over `--output-file'.
20142 Fix the description of `--defines'.
20143 * tests/output.at: Exercise %file-prefix and %output.
20144
20145 2001-11-02 Akim Demaille <akim@epita.fr>
20146
20147 * doc/refcard.tex: Update.
20148
20149 2001-11-02 Akim Demaille <akim@epita.fr>
20150
20151 * src/symtab.h (SUNDEF): New.
20152 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
20153 stand for `uninitialized', instead of 0.
20154 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
20155 * src/lex.c (lex): Adjust.
20156
20157 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
20158 Number it 0.
20159 Let yylex return it instead of a plain 0.
20160 Reported by Dick Streefland.
20161
20162 2001-11-02 Akim Demaille <akim@epita.fr>
20163
20164 * tests/regression.at (Mixing %token styles): New test.
20165
20166 2001-11-02 Akim Demaille <akim@epita.fr>
20167
20168 * src/reader.c (parse_thong_decl): Formatting changes.
20169 (token_translations_init): New, extracted from...
20170 (packsymbols): Here.
20171 Adjust.
20172
20173 2001-11-01 Akim Demaille <akim@epita.fr>
20174
20175 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
20176 Check that `9foo.y' produces correct cpp guards.
20177 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
20178 guards.
20179 Reported by Wwp.
20180
20181 2001-11-01 Akim Demaille <akim@epita.fr>
20182
20183 * tests/regression.at (Invalid input: 2): New.
20184 * src/lex.c (unlexed_token_buffer): New.
20185 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
20186 too.
20187 Reported by Wwp.
20188
20189 2001-11-01 Akim Demaille <akim@epita.fr>
20190
20191 * tests/calc.at: Catch up with 1.30.
20192 * configure.in: Bump to 1.49a.
20193 Adjust to newer Autotest.
20194
20195 2001-10-19 Pascal Bart <pascal.bart@epita.fr>
20196
20197 * src/conflicts.c: Move global variables rrc_total and src_total ...
20198 (print_conflicts): here.
20199 * src/output.c (output): Free global variable user_toknums.
20200 * src/lex.c (token_obstack): Become static.
20201
20202 2001-10-18 Akim Demaille <akim@epita.fr>
20203
20204 * tests/atlocal.in (GCC): Add.
20205 * tests/calc.at: s/m4_match/m4_bmatch/.
20206 s/m4_patsubst/m4_bpatsubst/.
20207 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
20208 * configure.in: AC_SUBST(GCC).
20209
20210 2001-10-14 Marc Autret <autret_m@epita.fr>
20211
20212 * src/options.c (create_long_option_table): Fix.
20213
20214 2001-10-10 Akim Demaille <akim@epita.fr>
20215
20216 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
20217
20218 2001-10-04 Akim Demaille <akim@epita.fr>
20219
20220 * src/reader.c (parse_union_decl): Push the caracters in
20221 union_obstack, not attrs_obstack.
20222
20223 2001-10-04 Akim Demaille <akim@epita.fr>
20224
20225 Merge in the branch 1.29.
20226
20227 * src/reader.c (packsymbols): Use a temporary obstack for
20228 `%%tokendef', since output_stack is already used elsewhere.
20229
20230 2001-10-02 Akim Demaille <akim@epita.fr>
20231
20232 Bump 1.29d.
20233
20234 2001-10-02 Akim Demaille <akim@epita.fr>
20235
20236 Version 1.29c.
20237
20238 2001-10-02 Akim Demaille <akim@epita.fr>
20239
20240 * tests/regression.at (Invalid CPP headers): New.
20241 From Alexander Belopolsky.
20242 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
20243
20244 2001-10-02 Akim Demaille <akim@epita.fr>
20245
20246 * tests/regression.at (Invalid input): New.
20247 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
20248 Reported by Shura.
20249
20250 2001-10-02 Akim Demaille <akim@epita.fr>
20251
20252 * tests/calc.at: Now that --debug works, the tests must be adjusted.
20253
20254 2001-10-02 Akim Demaille <akim@epita.fr>
20255
20256 * src/output.c (output_parser): Assert `skeleton'.
20257 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
20258 systems.
20259 From Shura.
20260
20261 2001-10-01 Marc Autret <autret_m@epita.fr>
20262
20263 * src/lex.h: Echo modifications.
20264 * src/lex.c (unlex): Parameter is now token_t.
20265 From Hans Aberg.
20266
20267 2001-10-01 Marc Autret <autret_m@epita.fr>
20268
20269 * src/main.c: Include lex.h.
20270 From Hans Aberg.
20271
20272 2001-09-29 Akim Demaille <akim@epita.fr>
20273
20274 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
20275
20276 2001-09-28 Akim Demaille <akim@epita.fr>
20277
20278 * tests/testsuite.at: Update to newer Autotest.
20279 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
20280
20281 2001-09-27 Akim Demaille <akim@epita.fr>
20282
20283 Position independent wrapper.
20284
20285 * tests/bison: Remove.
20286 * tests/bison.in: New.
20287 * configure.in: Adjust.
20288
20289 2001-09-27 Paul Eggert <eggert@twinsun.com>
20290
20291 Port quotearg fixes from tar 1.13.24.
20292
20293 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
20294 tm to be declared.
20295 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
20296 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
20297
20298 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
20299 * m4/mbrtowc.m4: New file.
20300 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
20301 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
20302
20303 2001-09-27 Akim Demaille <akim@epita.fr>
20304
20305 Bump to 1.29c.
20306
20307 2001-09-27 Akim Demaille <akim@epita.fr>
20308
20309 Version 1.29b.
20310
20311 2001-09-25 Akim Demaille <akim@epita.fr>
20312
20313 * src/system.h: Include `xalloc.h'.
20314 Remove it from the C files.
20315 * src/files.c (output_files): Free the obstacks.
20316 * src/lex.c (init_lex): Rename as...
20317 (lex_init): this.
20318 (lex_free): New.
20319 * src/main.c (main): Use it.
20320
20321 2001-09-24 Marc Autret <autret_m@epita.fr>
20322
20323 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
20324 to output informations in fout (FILE*).
20325 (open_graph, close_graph): Likewise.
20326 (output_graph, output_edge, output_node): Likewise.
20327 * src/vcg.h: Update function prototypes.
20328 * src/print_graph.c (print_graph): Open output graph file.
20329 (print_actions): Adjust.
20330 * src/files.h: Remove extern declaration.
20331 * src/files.c: Remove graph_obstack declaration.
20332 (open_files): Remove graph_obstack initialization.
20333 (output_files): Remove graph_obstack saving.
20334
20335 2001-09-24 Marc Autret <autret_m@epita.fr>
20336
20337 * src/files.c (compute_output_file_names): Fix.
20338
20339 2001-09-24 Marc Autret <autret_m@epita.fr>,
20340 Akim Demaille <akim@epita.fr>
20341
20342 * src/reader.c (reader): Remove call to free_symtab ().
20343 * src/main.c (main): Call it here.
20344 Include symtab.h.
20345 * src/conflicts.c (initialize_conflicts): Rename as...
20346 (solve_conflicts): this.
20347 * src/print.c (print_core, print_actions, print_state)
20348 (print_grammar): Dump to a file instead a `output_obstack'.
20349 (print_results): Dump `output_obstack', and then proceed with the
20350 FILE *.
20351 * src/files.c (compute_output_file_names, close_files): New.
20352 (output_files): Adjust.
20353 * src/main.c (main): Adjust.
20354
20355 2001-09-23 Marc Autret <autret_m@epita.fr>
20356
20357 * src/files.c (compute_header_macro): Computes header macro name
20358 from spec_defines_file when given.
20359
20360 2001-09-23 Marc Autret <autret_m@epita.fr>
20361
20362 * src/files.c (output_files): Add default extensions.
20363
20364 2001-09-22 Akim Demaille <akim@epita.fr>
20365
20366 * src/conflicts.c (finalize_conflicts): Rename as...
20367 (free_conflicts): this.
20368
20369 2001-09-22 Akim Demaille <akim@epita.fr>
20370
20371 * src/gram.c (gram_free): Rename back as...
20372 (dummy): this.
20373 (output_token_translations): Free `token_translations'.
20374 * src/symtab.c (free_symtab): Free the tag field.
20375
20376 2001-09-22 Akim Demaille <akim@epita.fr>
20377
20378 Remove `translations' as it is always set to true.
20379
20380 * src/gram.h: Adjust.
20381 * src/reader.c (packsymbols, parse_token_decl): Adjust
20382 * src/print.c (print_grammar): Adjust.
20383 * src/output.c (output_token_translations): Adjust.
20384 * src/lex.c (lex): Adjust.
20385 * src/gram.c: Be sure the set pointers to NULL.
20386 (dummy): Rename as...
20387 (gram_free): this.
20388
20389 2001-09-22 Akim Demaille <akim@epita.fr>
20390
20391 * configure.in: Invoke AM_LIB_DMALLOC.
20392 * src/system.h: Use dmalloc.
20393 * src/LR0.c: Be sure to have pointers initialized to NULL.
20394 (allocate_itemsets): Allocate kernel_items only if needed.
20395
20396 2001-09-22 Akim Demaille <akim@epita.fr>
20397
20398 * configure.in: Bump to 1.29b.
20399 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
20400 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
20401 need xmalloc.c in calc.y.
20402 From Pascal Bart.
20403
20404 2001-09-21 Akim Demaille <akim@epita.fr>
20405
20406 Version 1.29a.
20407 * Makefile.maint, config/config.guess, config/config.sub,
20408 * config/missing: Update from masters.
20409 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
20410 upon package.m4.
20411 * configure.in (ALL_LINGUAS): Add `tr'.
20412
20413 2001-09-21 Akim Demaille <akim@epita.fr>
20414
20415 * tests/Makefile.am (package.m4): Move to...
20416 ($(srcdir)/$(TESTSUITE)): here.
20417
20418 2001-09-20 Akim Demaille <akim@epita.fr>
20419
20420 * src/complain.c: No longer try to be standalone: use system.h.
20421 Don't assume __STDC__ is defined to 1. Just test if it is defined.
20422 * src/complain.h: Likewise.
20423 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
20424 Remove the unused variable `n'.
20425 From Albert Chin-A-Young.
20426
20427 2001-09-18 Marc Autret <autret_m@epita.fr>
20428
20429 * doc/bison.1: Update.
20430 * doc/bison.texinfo (Bison Options): Update --defines and --graph
20431 descriptions.
20432 (Option Cross Key): Update.
20433 Add --graph.
20434
20435 2001-09-18 Marc Autret <autret_m@epita.fr>
20436
20437 * tests/regression.at: New test (comment in %union).
20438
20439 2001-09-18 Marc Autret <autret_m@epita.fr>
20440
20441 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
20442 do that.
20443 Reported by Keith Browne.
20444
20445 2001-09-18 Marc Autret <autret_m@epita.fr>
20446
20447 * tests/output.at: Add tests for --defines and --graph.
20448
20449 2001-09-18 Marc Autret <autret_m@epita.fr>
20450
20451 * tests/output.at: Removes tests of %{header,src}_extension features.
20452
20453 2001-09-18 Akim Demaille <akim@epita.fr>
20454
20455 * tests/Makefile.am (package.m4): New.
20456 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
20457 (_AT_CHECK_CALC_ERROR): Likewise.
20458 Factor the `, ' part of verbose error messages.
20459
20460 2001-09-18 Marc Autret <autret_m@epita.fr>
20461
20462 * src/getargs.c (longopts): Declare --defines and --graph as options
20463 with optional arguments.
20464 * src/files.h: Add extern declarations.
20465 * src/files.c (spec_graph_file, spec_defines_file): New.
20466 (output_files): Update.
20467 Remove CPP-outed code.
20468
20469 2001-09-18 Marc Autret <autret_m@epita.fr>
20470
20471 Turn off %{source,header}_extension feature.
20472
20473 * src/files.c (compute_exts_from_gf): Update.
20474 (compute_exts_from_src): Update.
20475 (output_files): CPP-out useless code.
20476 * src/files.h: Remove {header,source}_extension extern declarations.
20477 * src/reader.c (parse_dquoted_param): CPP-out.
20478 (parse_header_extension_decl): Remove.
20479 (parse_source_extension_decl): Remove.
20480 (read_declarations): Remove cases tok_{hdrext,srcext}.
20481 * src/lex.c (percent_table): Remove {header,source}_extension entries.
20482 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
20483
20484 2001-09-10 Akim Demaille <akim@epita.fr>
20485
20486 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
20487 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
20488 (AT_CHECK_OUTPUT): this.
20489 Merely check ls' exit status, its output is useless.
20490
20491 2001-09-10 Akim Demaille <akim@epita.fr>
20492
20493 * tests/calc.at: Use m4_match.
20494 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
20495
20496 2001-09-10 Marc Autret <autret_m@epita.fr>,
20497 Akim Demaille <akim@epita.fr>
20498
20499 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
20500 enum color_e.
20501 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
20502 to `normal'.
20503 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
20504 * src/lex.h: Adjust prototype.
20505 (token_t): Add `tok_undef'.
20506 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
20507 (parse_percent_token): Now returns token_t.
20508 Add default statement in switch.
20509 (lex): Separate `c' as an input variable, from the token_t result
20510 part.
20511 (unlexed): Is a token_t.
20512
20513 2001-09-10 Akim Demaille <akim@epita.fr>
20514
20515 * configure.in: Bump to 1.29a.
20516
20517 2001-09-07 Akim Demaille <akim@epita.fr>
20518
20519 Version 1.29.
20520
20521 2001-08-30 Akim Demaille <akim@epita.fr>
20522
20523 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
20524 * m4/atconfig.m4: Remove.
20525 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
20526 * tests/bison: New.
20527 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
20528 m4_if, m4_patsubst, and m4_regexp.
20529 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
20530 `input' file instead of echo.
20531
20532 2001-08-29 Akim Demaille <akim@epita.fr>
20533
20534 Bump to 1.28e.
20535
20536 2001-08-29 Akim Demaille <akim@epita.fr>
20537
20538 Version 1.28d.
20539
20540 2001-08-29 Paul Eggert <eggert@twinsun.com>
20541
20542 * src/bison.simple (yyparse): Don't take the address of an
20543 item before the start of an array, as that doesn't conform to
20544 the C Standard.
20545
20546 2001-08-29 Robert Anisko <anisko_r@epita.fr>
20547
20548 * doc/bison.texinfo (Location Tracking Calc): New node.
20549
20550 2001-08-29 Paul Eggert <eggert@twinsun.com>
20551
20552 * src/output.c (output): Do not define const, as this now
20553 causes more problems than it cures.
20554
20555 2001-08-29 Akim Demaille <akim@epita.fr>
20556
20557 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
20558 the nodes.
20559 Be sure to tag the `detailmenu'.
20560
20561 2001-08-29 Akim Demaille <akim@epita.fr>
20562
20563 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
20564 download in a tmp dir.
20565
20566 2001-08-28 Marc Autret <autret_m@epita.fr>
20567
20568 * config/depcomp: New file.
20569
20570 2001-08-28 Marc Autret <autret_m@epita.fr>
20571
20572 * doc/bison.1 (mandoc): Adjust.
20573 From Juan Manuel Guerrero.
20574
20575 2001-08-28 Marc Autret <autret_m@epita.fr>
20576
20577 * src/print_graph.c (print_state): Fix.
20578
20579 2001-08-27 Marc Autret <autret_m@epita.fr>
20580
20581 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
20582 char * members.
20583 Echo modifications to the functions prototypes.
20584 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
20585
20586 2001-08-27 Marc Autret <autret_m@epita.fr>
20587
20588 * src/vcg.c: Include `xalloc.h'.
20589 (add_colorentry): New.
20590 (add_classname): New.
20591 (add_infoname): New.
20592 * src/vcg.h: Add new prototypes.
20593
20594 2001-08-27 Akim Demaille <akim@epita.fr>
20595
20596 * Makefile.maint: Sync. again with CVS Autoconf.
20597
20598 2001-08-27 Akim Demaille <akim@epita.fr>
20599
20600 * Makefile.maint: Formatting changes.
20601 (po-update, cvs-update, update): New targets.
20602 (AMTAR): Remove.
20603
20604 2001-08-27 Akim Demaille <akim@epita.fr>
20605
20606 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
20607 * Makefile.maint: Sync. with CVS Autoconf.
20608
20609 2001-08-27 Marc Autret <autret_m@epita.fr>
20610
20611 * src/vcg.h (struct infoname_s): New.
20612 (struct colorentry_s): New.
20613 (graph_s): New fields {vertical,horizontal}_order in structure.
20614 Add `infoname' field.
20615 Add `colorentry' field;
20616 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
20617 (G_HORIZONTAL_ORDER): New.
20618 (G_INFONAME): New.
20619 (G_COLORENTRY): New.
20620 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
20621 Add output of `infoname'.
20622 Add output of `colorentry'.
20623
20624 2001-08-27 Marc Autret <autret_m@epita.fr>
20625
20626 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
20627 This one shadowed a global parameter.
20628
20629 2001-08-24 Marc Autret <autret_m@epita.fr>
20630
20631 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
20632 instead of `unsigned'.
20633 (print_state): Do not call obstack_object_size () in obstack_grow ()
20634 to avoid macro variables shadowing.
20635
20636 2001-08-23 Marc Autret <autret_m@epita.fr>
20637
20638 * src/lex.c (percent_table): Typo: s/naem/name/.
20639 Add graph option.
20640 Normalize new options declarations.
20641
20642 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
20643
20644 * tests/suite.at: Exercise %header_extension and %source_extension.
20645
20646 2001-08-16 Marc Autret <autret_m@epita.fr>
20647
20648 * src/reader.c (parse_dquoted_param): New.
20649 (parse_header_extension_decl): Use it.
20650 (parse_source_extension_decl): Likewise.
20651
20652 2001-08-16 Marc Autret <autret_m@epita.fr>
20653
20654 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
20655 (get_xxxx_str): Use assert () instead of complain ().
20656 Remove return invokations in default cases.
20657 (get_decision_str): Modify default behaviour. Remove second argument.
20658 Echo modifications on calls.
20659 (output_graph): Fix.
20660
20661 2001-08-16 Marc Autret <autret_m@epita.fr>
20662
20663 * src/getargs.c (usage): Update with ``-g, --graph''.
20664
20665 2001-08-16 Marc Autret <autret_m@epita.fr>
20666
20667 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
20668 (Option Cross Key): Likewise.
20669 * doc/bison.1: Update.
20670
20671 2001-09-25 Pascal Bart <pascal.bart@epita.fr>
20672
20673 * src/output.c (output_master_parser): Don't finish action_obstack.
20674 (output_parser): Don't care about the muscle action, here.
20675 (prepare): Copy the action_obstack in the action muscle.
20676 (output): Free action_obstack.
20677
20678 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
20679
20680 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
20681 will contain `%union' declaration.
20682 (parse_union_decl): Delete #line directive output.
20683 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
20684 informations about %union.
20685 (parse_union_decl): Copy the union_obstack in the muscle stype.
20686 * src/bison.simple: Add new #line directive.
20687 Add typdef %%stype YYSTYPE.
20688
20689 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
20690
20691 * src/bison.simple: Add new `#line' directive.
20692
20693 2001-09-22 Pascal Bart <pascal.bart@epita.fr>
20694
20695 * src/bison.simple: New `#line' directive.
20696 * src/output.c (output_parser): Support new dynamic muscle input_line.
20697
20698 2001-09-22 Marc Autret <autret_m@epita.fr>
20699
20700 * src/output.c (output_master_parser): New.
20701 (output_parser): Be more re-entrant.
20702
20703 2001-09-21 Marc Autret <autret_m@epita.fr>
20704
20705 * src/reader.c (copy_definition, parse_union_decl): Update and use
20706 `linef' muscle.
20707 (copy_action): Likewise.
20708 Use obstack_1grow ().
20709 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
20710
20711 2001-09-21 Marc Autret <autret_m@epita.fr>
20712
20713 * src/options.c (option_table): Adjust.
20714 * src/lex.c (parse_percent_token): Fix.
20715
20716 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
20717
20718 * src/options.c (symtab.h): Include it, need by lex.h.
20719
20720 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
20721
20722 * src/lex.c (parse_percent_token): Change type of variable `tx', which
20723 is now an option_table_struct*.
20724 (option_strcmp): New function option_strcmp.
20725 (parse_percent_token): Call option_strcmp.
20726 * src/getargs.c (xalloc.h, options.h): Include it.
20727 (getargs): Call create_long_option_table.
20728 (getargs): Free longopts at the end of the function.
20729 (shortopts): Move in options.c.
20730 * src/options.c (create_long_option_table): New function. Convert
20731 information from option_table to option structure.
20732 * src/reader.c (options.h): Include it.
20733
20734 * src/Makefile.am: Adjust.
20735 * src/options.c (option_table): Create from longopts and percent_table.
20736 * src/getargs.c (longopts): Delete.
20737 * src/lex.c (struct percent_table_struct): Delete.
20738 (percent_table): Delete.
20739 (options.h): Include it.
20740 * src/options.c: Create.
20741 * src/options.h: Create.
20742 Declare enum opt_access_e.
20743 Define struct option_table_struct.
20744
20745 2001-09-20 Marc Autret <autret_m@epita.fr>
20746
20747 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
20748 sections of Bison.
20749
20750 2001-09-19 Pascal Bart <pascal.bart@epita.fr>
20751
20752 * src/bison.simple: s/%%filename/%%skeleton.
20753 * src/muscle_tab.c (getargs.h): Include it.
20754 (muscle_init): Insert new muscle skeleton.
20755
20756 2001-09-18 Pascal Bart <pascal.bart@epita.fr>
20757
20758 * src/output.c (output_parser): Delete unused variable actions_dumped.
20759
20760 2001-09-07 Pascal Bart <pascal.bart@epita.fr>
20761
20762 * src/output.c (output): Delete call to reader_output_yylsp.
20763 * src/reader.c (reader): Likewise.
20764 * src/reader.h: Delete declaration of reader_output_yylsp.
20765
20766 2001-09-02 Marc Autret <autret_m@epita.fr>
20767
20768 * src/reader.c: Include muscle_tab.h.
20769 (parse_union_decl): Update.
20770 (parse_macro_decl): Rename parse_muscle_decl.
20771 Update to use renamed functions and variable.
20772 (read_declarations, copy_action, read_additionnal_code, : Updated
20773 with correct variables and functions names.
20774 (packsymbols, reader): Likewise.
20775
20776 * src/reader.h (muscle_obstack): Extern declaration update.
20777
20778 * src/output.c: Include muscle_tab.h
20779 In all functions using macro_insert, change by using muscle_insert ().
20780 (macro_obstack): Rename muscle_obstack.
20781 Echo modifications in the whole file.
20782 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
20783 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
20784 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
20785
20786 * src/muscle_tab.h: Update double inclusion macros.
20787 (macro_entry_s): Rename muscle_entry_s.
20788 Update prototypes.
20789
20790 * src/muscle_tab.c: Include muscle_tab.h.
20791 Rename macro_tabble to muscle_table.
20792 (mhash1, mhash2, mcmp): Use muscle_entry.
20793 (macro_init): Rename muscle_init. Update.
20794 (macro_insert): Rename muscle_insert. Update.
20795 (macro_find): Rename muscle_find. Update.
20796
20797 * src/main.c: Include muscle_tab.h.
20798 (main): Call muscle_init ().
20799 * src/Makefile.am (bison_SOURCES): Echo modifications.
20800
20801 2001-09-02 Marc Autret <autret_m@epita.fr>
20802
20803 Now the files macro_tab.[ch] are named muscle_tab.[ch].
20804
20805 * src/muscle_tab.c, src/muscle_tab.h: Add files.
20806
20807 2001-09-02 Marc Autret <autret_m@epita.fr>
20808
20809 * src/macrotab.c, src/macrotab.h: Remove.
20810
20811 2001-09-01 Pascal Bart <pascal.bart@epita.fr>
20812
20813 * src/reader.c (copy_guard): Use muscle to specify the `#line'
20814 filename.
20815
20816 2001-09-01 Marc Autret <autret_m@epita.fr>
20817
20818 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
20819 to an explicit value to activate the feature. We do it here.
20820
20821 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
20822
20823 * src/output.c (prepare): Delete the `filename' muscule insertion.
20824 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
20825 (parse_union_decl): Likewise.
20826 * src/macrotab.c (macro_init): Initialize filename by infile.
20827
20828 2001-08-31 Marc Autret <autret_m@epita.fr>
20829
20830 * src/bison.simple (YYLSP_NEEDED): New definition.
20831 * src/output.c (prepare): Add macro insertion of `locations_flag'
20832
20833 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
20834
20835 * src/output.c (prepare): Delete insertion of previous muscles,
20836 and insert the `prefix' muscles.
20837 * src/macrotab.c (macro_init): Likewise.
20838 (macro_init): Initialization prefix directive by `yy'.
20839 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
20840 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
20841 yylval, yydebug, yyerror, yynerrs and yyparse.
20842 New directive `#define' to substitute yydebug, ... with option
20843 name_prefix.
20844
20845 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
20846
20847 * src/main.c (main): Standardize.
20848 * src/output.c (output_table_data, output_parser): Likewise.
20849 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
20850
20851 2001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
20852
20853 * src/reader.c (read_additionnal_code): Rename %%user_code to
20854 %%epilogue.
20855 * src/output.c (output): Rename %%declarations to %%prologue.
20856 * src/bison.simple: Echo modifications.
20857
20858 2001-08-31 Marc Autret <autret_m@epita.fr>
20859
20860 * src/reader.c (readgram): CleanUp.
20861 (output_token_defines): Likewise.
20862 (packsymbols): Likewise.
20863 (reader): Likewise.
20864 * src/output.c (output): CPP-out useless code.
20865
20866 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
20867
20868 * src/reader.c (reader): Delete obsolete call to function
20869 output_trailers and output_headers.
20870 * src/output.h: Remove obsolete functions prototypes of output_headers
20871 and output_trailers.
20872
20873 2001-08-30 Pascal Bart <pascal.bart@epita.fr>
20874
20875 * src/main.c: Include macrotab.h.
20876 * src/macrotab.h (macro_entry_s): Constify fields.
20877 Adjust functions prototypes.
20878 * src/macrotab.c (macro_insert): Constify key and value.
20879 (macro_find): Constify key.
20880 (macro_insert): Include 'xalloc.h'
20881 (macro_insert): Use XMALLOC.
20882 (macro_find): Constify return value.
20883 * src/output.c (output_table_data): Rename table to table_data.
20884 (output_parser): Constify macro_key, macro_value.
20885
20886 2001-08-30 Marc Autret <autret_m@epita.fr>
20887
20888 * src/reader.c (parse_skel_decl): New.
20889 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
20890 * src/lex.h (token_t): New token `tok_skel'.
20891 * src/lex.c (percent_table): Add skeleton option entry.
20892 Standardize.
20893
20894 2001-08-29 Marc Autret <autret_m@epita.fr>
20895
20896 * src/bison.simple: Add %%user_code directive at the end.
20897 * src/reader.c (read_additionnal_code): New.
20898 (reader): Use it.
20899 * src/output.c (output_program): Remove.
20900 (output): Update.
20901
20902 2001-08-28 Marc Autret <autret_m@epita.fr>
20903
20904 * src/output.c (output_actions): Clean up.
20905 (output_gram): CPP-out useless code.
20906 * src/reader.c (reader): Clean up, CPP-out useless code.
20907
20908 2001-08-28 Pascal Bart <pascal.bart@epita.fr>
20909
20910 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
20911 directive.
20912 * src/bison.simple: Add `%%definitions'.
20913
20914 2001-08-28 Marc Autret <autret_m@epita.fr>
20915
20916 * config/depcomp: New file.
20917
20918 2001-08-27 Paul Eggert <eggert@twinsun.com>
20919
20920 * src/bison.simple (yyparse): Don't take the address of an
20921 item before the start of an array, as that doesn't conform to
20922 the C Standard.
20923
20924 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
20925
20926 * src/output.c (output): Remove the initialization of the macro
20927 obstack. It was done too late here.
20928
20929 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
20930 completely wrong.
20931 (reader): Initialize the macro obstack here, since we need it to grow
20932 '%define' directives.
20933
20934 * src/reader.h: Declare the macro obstack as extern.
20935
20936 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
20937
20938 * src/output.c (output_parser): Fix. Store single '%' characters in
20939 the output obstack instead of throwing them away.
20940
20941 2001-08-27 Akim Demaille <akim@epita.fr>
20942
20943 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
20944
20945 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20946
20947 * lib/Makefile.am: Adjust.
20948
20949 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20950
20951 * src/bison.simple: Update and add '%%' directives.
20952
20953 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20954
20955 * src/reader.c (reader): Remove calls to 'output_headers' and
20956 'output_trailers'. Remove some C output.
20957 (readgram): Disable a piece of code that was writing a default
20958 definition for 'YYSTYPE'.
20959 (reader_output_yylsp): Remove.
20960 (packsymbols): Output token defintions to a macro.
20961 (copy_definition): Disable C output.
20962
20963 * src/reader.c (parse_macro_decl): New function used to parse macro
20964 declarations.
20965 (copy_string2): Put the body of copy_string into this new function.
20966 Add a parameter to let the caller choose whether he wants to copy the
20967 string delimiters or not.
20968 (copy_string): Be a simple call to copy_string2 with the last argument
20969 bound to true.
20970 (read_declarations): Add case for macro definition.
20971 (copy_identifier): New.
20972 (parse_macro_decl): Read macro identifiers using copy_identifier
20973 rather than lex.
20974
20975 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20976
20977 * src/output.c (prepare): Add prefixed names.
20978 (output_parser): Output semantic actions.
20979 (output_parser): Fix bug on '%%line' directives.
20980
20981 * src/output.c (output_headers): Remove. The C code printed by this
20982 function should now be in the skeletons.
20983 (output_trailers): Remove.
20984 (output): Disable call to 'reader_output_yylsp'.
20985 (output_rule_data): Do not output tables to the table obstack.
20986
20987 * src/output.c: Remove some C dedicated output.
20988 Improve the use of macro and output obstacks.
20989 (output_defines): Remove.
20990
20991 * src/output.c (output_token_translations): Associate 'translate'
20992 table with a macro. No output to the table obstack.
20993 (output_gram): Same for 'rhs' and 'prhs'.
20994 (output_stos): Same for 'stos'.
20995 (output_rule_data): Same for 'r1' and 'r2'.
20996 (token_actions): Same for 'defact'.
20997 (goto_actions): Same for 'defgoto'.
20998 (output_base): Same for 'pact' and 'pgoto'.
20999 (output_table): Same for 'table'.
21000 (output_check): Same for 'check'.
21001
21002 * src/output.c (output_table_data): New function.
21003 (output_short_table): Remove.
21004 (output_short_or_char_table): Remove.
21005
21006 * src/output.c (output_parser): Replace most of the skeleton copy code
21007 with something new. Skeletons are now processed character by character
21008 rather than line by line, and Bison looks for '%%' macros. This is the
21009 first step in making Bison's output process (a lot) more flexible.
21010 (output_parser): Use the macro table.
21011
21012 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
21013
21014 * src/main.c (main): Initialize the macro table.
21015
21016 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
21017
21018 * src/lex.c (percent_table): Add tok_define.
21019 * src/lex.h: Add tok_define.
21020
21021 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
21022
21023 * src/macrotab.c: New file.
21024 * src/macrotab.h: New file.
21025 * src/Makefile.am: Update.
21026
21027 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
21028
21029 * lib/hash.c: New file.
21030 * lib/hash.h: New file.
21031 * lib/Makefile.am: Update.
21032
21033 2001-08-15 Akim Demaille <akim@epita.fr>
21034
21035 Version 1.28c.
21036
21037 2001-08-15 Marc Autret <autret_m@epita.fr>
21038
21039 * src/reader.c (readgram): Indent output macro YYSTYPE.
21040 (packsymbols): Likewise.
21041 (output_token_defines): Likewise.
21042 * src/files.c: Standardize.
21043 (compute_header_macro): New.
21044 (defines_obstack_save): New. Use compute_header_macro.
21045 (output_files): Update. Use defines_obstack_save.
21046
21047 2001-08-15 Akim Demaille <akim@epita.fr>
21048
21049 * doc/bison.texinfo (Table of Symbols): Document
21050 YYSTACK_USE_ALLOCA.
21051
21052 2001-08-15 Akim Demaille <akim@epita.fr>
21053
21054 * missing: Update from CVS Automake.
21055 * config/config.guess, config/config.sub, config/texinfo.tex:
21056 Update from gnu.org.
21057
21058 2001-08-15 Akim Demaille <akim@epita.fr>
21059
21060 * Makefile.maint: Sync with CVS Autoconf.
21061
21062 2001-08-14 Pascal Bart <pascal.bart@epita.fr>
21063
21064 * doc/bison.texinfo: Include GNU Free Documentation License from
21065 `fdl.texi'.
21066 * doc/fdl.texi: Add to package.
21067
21068 2001-08-14 Marc Autret <autret_m@epita.fr>
21069
21070 Turn on %{source,header}_extension features.
21071
21072 * src/lex.c (percent_table): Un-CPP out header_extension and
21073 source_extension.
21074 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
21075 (compute_exts_from_src): Remove conditions. It restores priorities
21076 between options.
21077
21078 2001-08-14 Marc Autret <autret_m@epita.fr>
21079
21080 * src/files.c (compute_base_names): Add extensions computing when
21081 `--file-prefix' used.
21082 Standardize function calls.
21083
21084 2001-08-13 Marc Autret <autret_m@epita.fr>
21085
21086 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
21087 defining it (defined but null disables alloca).
21088
21089 2001-08-13 Marc Autret <autret_m@epita.fr>
21090
21091 * src/bison.simple (_yy_memcpy): CPP reformat.
21092
21093 2001-08-13 Pascal Bart <pascal.bart@epita.fr>
21094
21095 * tests/atconfig.in (CPPFLAGS): Fix.
21096
21097 2001-08-10 Pascal Bart <pascal.bart@epita.fr>
21098
21099 * doc/bison.texinfo: Include GNU General Public License from
21100 `gpl.texi'.
21101 * doc/gpl.texi: Add to package.
21102
21103 2001-08-10 Marc Autret <autret_m@epita.fr>
21104
21105 * src/print_graph.h: Fix.
21106 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
21107
21108 2001-08-10 Akim Demaille <akim@epita.fr>
21109
21110 * src/system.h: Provide default declarations for stpcpy, strndup,
21111 and strnlen.
21112
21113 2001-08-10 Robert Anisko <anisko_r@epita.fr>
21114
21115 * doc/bison.texinfo (Locations): Update @$ stuff.
21116
21117 2001-08-09 Robert Anisko <anisko_r@epita.fr>
21118
21119 * src/bison.simple (YYLLOC_DEFAULT): Update.
21120 (yyparse): Adjust.
21121
21122 2001-08-08 Marc Autret <autret_m@epita.fr>
21123
21124 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
21125 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
21126 Reported by Fabrice Bauzac.
21127
21128 2001-08-08 Marc Autret <autret_m@epita.fr>
21129
21130 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
21131 * src/vcg.c (output_node): Fix.
21132 * src/vcg.h: Cleanup.
21133 * src/print_graph.c: Add comments.
21134 (node_output_size): New global variable. Simplify the formatting of
21135 the VCG graph output.
21136 (print_actions): Unused code is now used. It notifies the final state
21137 and no action states in the VCG graph. It also give the reduce actions.
21138 The `shift and goto' edges are red and the `go to state' edges are
21139 blue.
21140 Get the current node name and node_obstack by argument.
21141 (node_obstack): New variable.
21142 (print_state): Manage node_obstack.
21143 (print_core): Use node_obstack given by argument.
21144 A node is not only computed here but in print_actions also.
21145 (print_graph): CPP out useless code instead of commenting it.
21146
21147 2001-08-07 Pascal Bart <pascal.bart@epita.fr>
21148
21149 * tests/atconfig.in (CPPFLAGS): Fix.
21150
21151 2001-08-07 Akim Demaille <akim@epita.fr>
21152
21153 * src/print_graph.c (quote): New.
21154 (print_core): Use it.
21155
21156 2001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
21157
21158 * src/vcg.c (complain.h): Include it.
21159 Unepitaize `return' invocations.
21160 [NDEBUG] (main): Remove.
21161 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
21162 * src/files.c (open_files): Initialize graph_obstack.
21163 * src/print_graph.c (print_actions): CPP out useless code.
21164 (print_core): Don't output the last `\n' in labels.
21165 Use `quote'.
21166 * src/files.c (output_files): Output the VCG file.
21167 * src/main.c (main): Invoke print_graph ();
21168
21169 2001-08-06 Marc Autret <autret_m@epita.fr>
21170
21171 Automaton VCG graph output.
21172 Using option ``-g'' or long option ``--graph'', you can generate
21173 a gram_filename.vcg file containing a VCG description of the LALR (1)
21174 automaton of your grammar.
21175
21176 * src/main.c: Call to print_graph() function.
21177 * src/getargs.h: Update.
21178 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
21179 (graph_flag): New flag.
21180 (longopts): Update.
21181 (getargs): Add case `g'.
21182 * src/files.c (graph_obstack): New obstack struct.
21183 (open_files): Initialize new obstack.
21184 (output_files): Saves graph_obstack if required.
21185 * src/files.h (graph_obstack): New extern declaration.
21186 * src/Makefile.am: Add new source files.
21187
21188 2001-08-06 Marc Autret <autret_m@epita.fr>
21189
21190 * src/print_graph.c, src/print_graph.h (graph): New.
21191 * src/vcg.h: New file.
21192 * src/vcg.c: New file, VCG graph handling.
21193
21194 2001-08-06 Marc Autret <autret_m@epita.fr>
21195
21196 Add of %source_extension and %header_extension which specify
21197 the source or/and the header output file extension.
21198
21199 * src/files.c (compute_base_names): Remove initialisation of
21200 src_extension and header_extension.
21201 (compute_exts_from_gf): Update.
21202 (compute_exts_from_src): Update.
21203 (output_files): Update.
21204 * src/reader.c (parse_header_extension_decl): New.
21205 (parse_source_extension_decl): New.
21206 (read_declarations): New case statements for the new tokens.
21207 * src/lex.c (percent_table): Add entries for %source_extension
21208 and %header_extension.
21209 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
21210
21211 2001-08-06 Marc Autret <autret_m@epita.fr>
21212
21213 * configure.in: Bump to 1.28c.
21214 * doc/bison.texinfo: Texinfo thingies.
21215
21216 2001-08-04 Pascal Bart <pascal.bart@epita.fr>
21217
21218 * tests/atconfig.in (CPPFLAGS): Add.
21219 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
21220
21221 2001-08-03 Akim Demaille <akim@epita.fr>
21222
21223 Version 1.28b.
21224
21225 2001-08-03 Akim Demaille <akim@epita.fr>
21226
21227 * tests/Makefile.am (check-local): Ship testsuite.
21228 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
21229 Include `string.h'.
21230
21231 2001-08-03 Akim Demaille <akim@epita.fr>
21232
21233 * configure.in: Try using -Wformat when compiling.
21234
21235 2001-08-03 Akim Demaille <akim@epita.fr>
21236
21237 * configure.in: Bump to 1.28b.
21238
21239 2001-08-03 Akim Demaille <akim@epita.fr>
21240
21241 * src/complain.c: Adjust strerror_r portability issues.
21242
21243 2001-08-03 Akim Demaille <akim@epita.fr>
21244
21245 Version 1.28a.
21246
21247 2001-08-03 Akim Demaille <akim@epita.fr>
21248
21249 * src/getargs.c, src/getarg.h (skeleton)): Constify.
21250 * src/lex.c (literalchar): Avoid name clashes on `buf'.
21251 * src/getargs.c: Include complain.h.
21252 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
21253 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
21254
21255 2001-08-03 Akim Demaille <akim@epita.fr>
21256
21257 * src/reader.c (readgram): Display hidden chars in error messages.
21258
21259 2001-08-03 Akim Demaille <akim@epita.fr>
21260
21261 Update to gettext 0.10.39.
21262
21263 2001-08-03 Akim Demaille <akim@epita.fr>
21264
21265 * lib/strspn.c: New.
21266
21267 2001-08-01 Marc Autret <autret_m@epita.fr>
21268
21269 * doc/bison.texinfo: Update.
21270 * doc/bison.1 (mandoc): Update.
21271 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
21272 * src/files.c: Support output files extensions computing.
21273 (src_extension): New static variable.
21274 (header_extension): New static variable.
21275 (tr): New function.
21276 (get_extension_index): New function, gets the index of an extension
21277 filename in a string.
21278 (compute_exts_from_gf): New function, computes extensions from the
21279 grammar file extension.
21280 (compute_exts_from_src): New functions, computes extensions from the
21281 C source file extension, file given by ``-o'' option.
21282 (compute_base_names): Update.
21283 (output_files): Update.
21284
21285 2001-08-01 Robert Anisko <anisko_r@epita.fr>
21286
21287 * doc/bison.texi: Document @$.
21288 (Locations): New section.
21289
21290 2001-07-18 Akim Demaille <akim@epita.fr>
21291
21292 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
21293 * config/prev-version.txt, config/move-if-change: New.
21294 * Makefile.am: Adjust.
21295
21296 2001-07-08 Pascal Bart <pascal.bart@epita.fr>
21297
21298 * src/bison.simple (yyparse): Suppress warning `comparaison
21299 between signed and unsigned'.
21300
21301 2001-07-05 Pascal Bart <pascal.bart@epita.fr>
21302
21303 * src/getargs.h (raw_flag): Remove.
21304 * src/getargs.c: Die on `-r'/`--raw'.
21305 * src/lex.c (parse_percent_token): Die on `%raw'.
21306 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
21307 * tests/calc.at: Suppress test with option `--raw'.
21308
21309 2001-07-14 Akim Demaille <akim@epita.fr>
21310
21311 * config/: New.
21312 * configure.in: Require Autoconf 2.50.
21313 Update to gettext 0.10.38.
21314
21315 2001-03-16 Akim Demaille <akim@epita.fr>
21316
21317 * doc/bison.texinfo: ANSIfy the examples.
21318
21319 2001-03-16 Akim Demaille <akim@epita.fr>
21320
21321 * getargs.c (skeleton): New variable.
21322 (longopts): --skeleton is a new option.
21323 (shortopts, getargs): -S is a new option.
21324 * getargs.h: Declare skeleton.
21325 * output.c (output_parser): Use it.
21326
21327 2001-03-16 Akim Demaille <akim@epita.fr>
21328
21329 * m4/strerror_r.m4: New.
21330 * m4/error.m4: Run AC_FUNC_STRERROR_R.
21331 * lib/error.h, lib/error.c: Update.
21332
21333 2001-03-16 Akim Demaille <akim@epita.fr>
21334
21335 * src/getargs.c (longopts): Clean up.
21336
21337 2001-02-21 Akim Demaille <akim@epita.fr>
21338
21339 * src/reader.c (gensym): `gensym_count' is your own.
21340 Use a static buf to create the symbol name, as token_buffer is no
21341 longer a buffer.
21342
21343 2001-02-08 Akim Demaille <akim@epita.fr>
21344
21345 * src/conflicts.c (conflict_report): Be sure not to append to res
21346 between two calls, which could happen if both first sprintf were
21347 skipped, but not the first cp += strlen.
21348
21349 2001-02-08 Akim Demaille <akim@epita.fr>
21350
21351 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
21352 New, from fileutils 4.0.37.
21353 * configure.in: Require Autoconf 2.49c. I took some time before
21354 making this decision. This is the only way out for portability
21355 issues in Bison, it would mean way too much duplicate effort to
21356 import in Bison features implemented in 2.49c since 2.13.
21357 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
21358
21359 2001-02-02 Akim Demaille <akim@epita.fr>
21360
21361 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
21362 * lib/xalloc.h, lib/xmalloc.c: Update.
21363
21364 2001-01-19 Akim Demaille <akim@epita.fr>
21365
21366 Get rid of the ad hoc handling of token_buffer in the scanner: use
21367 the obstacks.
21368
21369 * src/lex.c (token_obstack): New.
21370 (init_lex): Initialize it. No longer call...
21371 (grow_token_buffer): this. Remove it.
21372 Adjust all the places which used it to use the obstack.
21373
21374 2001-01-19 Akim Demaille <akim@epita.fr>
21375
21376 * src/lex.h: Rename all the tokens:
21377 s/\bENDFILE\b/tok_eof/g;
21378 s/\bIDENTIFIER\b/tok_identifier/g;
21379 etc.
21380 Let them be enums, not #define, to ease debugging.
21381 Adjust all the code.
21382
21383 2001-01-18 Akim Demaille <akim@epita.fr>
21384
21385 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
21386 * src/lex.c (maxtoken, grow_token_buffer): Static.
21387
21388 2001-01-18 Akim Demaille <akim@epita.fr>
21389
21390 Since we now use obstacks, more % directives can be enabled.
21391
21392 * src/lex.c (percent_table): Also accept `%yacc',
21393 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
21394 `%debug'.
21395 Handle the actions for `%semantic_parser' and `%pure_parser' here,
21396 instead of returning a token.
21397 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
21398 * src/reader.c (read_declarations): Adjust.
21399 * src/files.c (open_files): Don't call `compute_base_names', don't
21400 compute `attrsfile' since they depend upon data which might be
21401 *in* the input file now.
21402 (output_files): Do it here.
21403 * src/output.c (output_headers): Document the fact that this patch
21404 introduces a guaranteed SEGV for semantic parsers.
21405 * doc/bison.texinfo: Document them.
21406 * tests/suite.at: Exercise these %options.
21407
21408 2000-12-20 Akim Demaille <akim@epita.fr>
21409
21410 Also handle the output file (--verbose) with obstacks.
21411
21412 * files.c (foutput): Remove.
21413 (output_obstack): New.
21414 Adjust all dependencies.
21415 * src/conflicts.c: Return a string.
21416 * src/system.h (obstack_grow_string): Rename as...
21417 (obstack_sgrow): this. Be ready to work with non literals.
21418 (obstack_fgrow4): New.
21419
21420 2000-12-20 Akim Demaille <akim@epita.fr>
21421
21422 * src/files.c (open_files): Fix the computation of short_base_name
21423 in the case of `-o foo.tab.c'.
21424
21425 2000-12-20 Akim Demaille <akim@epita.fr>
21426
21427 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
21428 (copy_dollar): Now that everything uses obstacks, get rid of the
21429 FILE * parameters.
21430
21431 2000-12-20 Akim Demaille <akim@epita.fr>
21432
21433 * src/files.c (open_files): Actually the `.output' file is based
21434 on the short_base_name, not base_name.
21435 * tests/suite.at (Checking output file names): Adjust.
21436
21437 2000-12-20 Akim Demaille <akim@epita.fr>
21438
21439 * src/bison.s1: Remove, we now use directly...
21440 * src/bison.simple: this.
21441 * src/Makefile.am: Use pkgdata instead of data.
21442
21443 2000-12-20 Akim Demaille <akim@epita.fr>
21444
21445 * src/files.c (guard_obstack): New.
21446 (open_files): Initialize it.
21447 (output_files): Dump it...
21448 * src/files.h: Export it.
21449 * src/reader.c (copy_guard): Use it.
21450
21451 2000-12-19 Akim Demaille <akim@epita.fr>
21452
21453 * src/files.c (outfile, defsfile, actfile): Removed as global
21454 vars.
21455 (open_files): Don't compute them.
21456 (output_files): Adjust.
21457 (base_name, short_base_name): Be global.
21458 Adjust dependencies.
21459
21460 2000-12-19 Akim Demaille <akim@epita.fr>
21461
21462 * src/files.c (strsuffix): New.
21463 (stringappend): Be just like strcat but allocate.
21464 (base_names): Eve out from open_files.
21465 Try to simplify the rather hairy computation of base_name and
21466 short_base_name.
21467 (open_files): Use it.
21468 * tests/suite.at (Checking output file names): New test.
21469
21470 2000-12-19 Akim Demaille <akim@epita.fr>
21471
21472 * src/system.h (obstack_grow_literal_string): Rename as...
21473 (obstack_grow_string): this.
21474 * src/output.c (output_parser): Recognize `%% actions' instead of
21475 `$'.
21476 * src/bison.s1: s/$/%% actions/.
21477 * src/bison.hairy: Likewise.
21478
21479 2000-12-19 Akim Demaille <akim@epita.fr>
21480
21481 * src/output.c (output_parser): Compute the `#line' lines when
21482 there are.
21483 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
21484 Suggested by Hans Aberg.
21485
21486 2000-12-19 Akim Demaille <akim@epita.fr>
21487
21488 Let the handling of the skeleton files be local to the procedures
21489 that use it.
21490
21491 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
21492 longer static.
21493 (fparser, open_extra_files): Remove.
21494 (open_files, output_files): Don't take care of fparser.
21495 * src/files.h: Adjust.
21496 * src/output.c (output_parser): Open and close the file to the
21497 skeleton.
21498 * src/reader.c (read_declarations): When %semantic_parser, open
21499 fguard.
21500
21501 2000-12-19 Akim Demaille <akim@epita.fr>
21502
21503 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
21504 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
21505
21506 2000-12-19 Akim Demaille <akim@epita.fr>
21507
21508 * src/files.c (open_files): Yipee! We no longer need all the code
21509 looking for `/tmp' since we have no tmp file.
21510
21511 2000-12-19 Akim Demaille <akim@epita.fr>
21512
21513 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
21514 New macros.
21515 * src/files.c (open_files): Less dependency on MSDOS etc.
21516
21517 2000-12-14 Akim Demaille <akim@epita.fr>
21518
21519 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
21520 Provide a default definition.
21521 Use it when executing the default @ action.
21522 * src/reader.c (reader_output_yylsp): No longer include
21523 `timestamp' and `text' in the default YYLTYPE.
21524
21525 2000-12-12 Akim Demaille <akim@epita.fr>
21526
21527 * src/reader.c (copy_definition, parse_union_decl, copy_action)
21528 (copy_guard): Quote the file names.
21529 Reported by Laurent Mascherpa.
21530
21531 2000-12-12 Akim Demaille <akim@epita.fr>
21532
21533 * src/output.c (output_headers, output_program, output): Be sure
21534 to escape special characters when outputting filenames.
21535 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
21536 (output_headers): Don't depend on them, Use ACTSTR.
21537
21538 2000-11-17 Akim Demaille <akim@epita.fr>
21539
21540 * lib/obstack.h: Formatting changes.
21541 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
21542 prevents type checking.
21543 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
21544 cast the value to (void *): assigning a `foo *' to a `void *'
21545 variable is valid.
21546 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
21547 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
21548 append characters.
21549
21550 2000-11-17 Akim Demaille <akim@epita.fr>
21551
21552 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
21553 as...
21554 (suite.m4, regression.m4, calc.m4): these.
21555 * tests/atgeneral.m4: Update from CVS Autoconf.
21556
21557 2000-11-17 Akim Demaille <akim@epita.fr>
21558
21559 * tests/regression.m4 (%union and --defines): New test,
21560 demonstrating a current bug in the obstack implementation.
21561
21562 2000-11-17 Akim Demaille <akim@epita.fr>
21563
21564 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
21565 macros.
21566 Use them to declare the variables which are global or local to
21567 `yyparse'.
21568
21569 2000-11-17 Akim Demaille <akim@epita.fr>
21570
21571 * acconfig.h: Remove, no longer used.
21572
21573 2000-11-07 Akim Demaille <akim@epita.fr>
21574
21575 * src: s/Copyright (C)/Copyright/g.
21576
21577 2000-11-07 Akim Demaille <akim@epita.fr>
21578
21579 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
21580 defining.
21581 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
21582
21583 2000-11-07 Akim Demaille <akim@epita.fr>
21584
21585 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
21586 Merge in a single CPP if/else.
21587
21588 2000-11-07 Akim Demaille <akim@epita.fr>
21589
21590 * src/output.c (output): Remove useless variables.
21591 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
21592 argument `data' for consistency with the prototypes.
21593 Qualify it `const'.
21594 (obstack_copy, obstack_copy0): Rename the second argument as
21595 `address' for consistency. Qualify it `const'.
21596 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
21597 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
21598 `const' their input argument (`data' or `address').
21599 Adjust the corresponding macros to include `const' in casts.
21600
21601 2000-11-03 Akim Demaille <akim@epita.fr>
21602
21603 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
21604 s/PFILE1/BISON_HAIRY/.
21605 Adjust dependencies.
21606
21607 2000-11-03 Akim Demaille <akim@epita.fr>
21608
21609 For some reason, this was not applied.
21610
21611 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
21612 `unlink': it's no longer used.
21613
21614 2000-11-03 Akim Demaille <akim@epita.fr>
21615
21616 * src/files.c (skeleton_find): New function, eved out of...
21617 (open_files, open_extra_files): here.
21618
21619 2000-11-03 Akim Demaille <akim@epita.fr>
21620
21621 Don't use `atexit'.
21622
21623 * src/files.c (obstack_save): New function.
21624 (done): Rename as...
21625 (output_files): this.
21626 Use `obstack_save'.
21627 * src/main.c (main): Don't use `atexit' to register `done', since
21628 it no longer has to remove tmp files, just call `output_files'
21629 when there are no errors.
21630
21631 2000-11-02 Akim Demaille <akim@epita.fr>
21632
21633 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
21634 `unlink': it's no longer used.
21635 * src/files.h: Formatting changes.
21636
21637 2000-11-02 Akim Demaille <akim@epita.fr>
21638
21639 Remove the last uses of mktemp and unlink/delete.
21640
21641 * src/files.c (fdefines, ftable): Removed.
21642 (defines_ostack, table_obstack): New.
21643 Adjust dependencies of the former into uses of the latter.
21644 * src/output.c (output_short_or_char_table, output_short_table):
21645 Convert to using obstacks.
21646 * src/reader.c (copy_comment2): Accept one FILE * and two
21647 obstacks.
21648 (output_token_defines, reader_output_yylsp): Use obstacks.
21649 * src/system.h (obstack_fgrow3): New.
21650 * po/POTFILES.in: Adjust.
21651
21652 2000-11-01 Akim Demaille <akim@epita.fr>
21653
21654 Change each use of `fattrs' into a use of `attrs_obstack'.
21655
21656 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
21657 * src/files.c (fattrs): Remove.
21658 (attrs_obstack): New.
21659 Adjust all dependencies.
21660 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
21661
21662 2000-11-01 Akim Demaille <akim@epita.fr>
21663
21664 Introduce obstacks.
21665 Change each use of `faction' into a use of `action_obstack'.
21666
21667 * lib/obstack.h, lib/obstack.c: New files.
21668 * src/files.c (faction): Remove.
21669 (action_obstack): New.
21670 Adjust all dependencies.
21671
21672 2000-10-20 Akim Demaille <akim@epita.fr>
21673
21674 * lib/quote.h (PARAMS): New macro. Use it.
21675
21676 2000-10-16 Akim Demaille <akim@epita.fr>
21677
21678 * src/output.c (output_short_or_char_table): New function.
21679 (output_short_table, output_token_translations): Use it.
21680 (goto_actions): Use output_short_table.
21681
21682 2000-10-16 Akim Demaille <akim@epita.fr>
21683
21684 * src/symtab.c (bucket_new): New function.
21685 (getsym): Use it.
21686
21687 * src/output.c (output_short_table): New argument to display the
21688 comment associated with the table.
21689 Adjust dependencies.
21690 (output_gram): Use it.
21691 (output_rule_data): Nicer output layout for YYTNAME.
21692
21693 2000-10-16 Akim Demaille <akim@epita.fr>
21694
21695 * src/lex.c (read_typename): New function.
21696 (lex): Use it.
21697 * src/reader.c (copy_dollar): Likewise.
21698
21699 2000-10-16 Akim Demaille <akim@epita.fr>
21700
21701 * src/reader.c (copy_comment2): Expect the input stream to be on
21702 the `/' which is suspected to open a comment, instead of being
21703 called after `//' or `/*' was read.
21704 (copy_comment, copy_definition, parse_union_decl, copy_action)
21705 (copy_guard): Adjust.
21706
21707 2000-10-16 Akim Demaille <akim@epita.fr>
21708
21709 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
21710 `read_signed_integer'.
21711
21712 2000-10-16 Akim Demaille <akim@epita.fr>
21713
21714 * src/reader.c (copy_dollar): New function.
21715 (copy_guard, copy_action): Use it.
21716
21717 2000-10-16 Akim Demaille <akim@epita.fr>
21718
21719 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
21720 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
21721 New files, from Fileutils 4.0.27.
21722 * src/main.c (printable_version): Remove.
21723 * src/lex.c, src/reader.c: Use `quote'.
21724
21725 2000-10-04 Akim Demaille <akim@epita.fr>
21726
21727 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
21728
21729 2000-10-04 Akim Demaille <akim@epita.fr>
21730
21731 * doc/bison.texinfo: Various typos spotted by Neil Booth.
21732
21733 2000-10-04 Akim Demaille <akim@epita.fr>
21734
21735 When a literal string is used to define two different tokens,
21736 `bison -v' segfaults.
21737 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
21738
21739 * tests/regression.m4: New file.
21740 Include the core of the sample provided by Piotr Gackiewicz.
21741 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
21742 properly.
21743
21744 2000-10-04 Akim Demaille <akim@epita.fr>
21745
21746 * src/reader.c (parse_expect_decl): Keep `count' within the size
21747 of `buffer'.
21748 From Neil Booth.
21749
21750 2000-10-02 Paul Eggert <eggert@twinsun.com>
21751
21752 * bison.s1 (yyparse): Assign the default value
21753 unconditionally, to avoid a GCC warning and make the parser a
21754 tad smaller.
21755
21756 2000-10-02 Akim Demaille <akim@epita.fr>
21757
21758 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
21759 options.
21760
21761 2000-10-02 Akim Demaille <akim@epita.fr>
21762
21763 * src/derives.c, src/print.c, src/reduce.c: To ease the
21764 translation, move some `\n' out of the translated strings.
21765
21766 2000-10-02 Akim Demaille <akim@epita.fr>
21767
21768 The location tracking mechanism is precious for parse error
21769 messages. Nevertheless, it is enabled only when `@n' is used in
21770 the grammar, which is a different issue (you can use it in error
21771 message, but not in the grammar per se). Therefore, there should
21772 be another means to enable it.
21773
21774 * src/getargs.c (getargs): Support `--locations'.
21775 (usage): Report it.
21776 * src/getargs.h (locationsflag): Export it.
21777 * src/lex.c (percent_table): Support `%locations'.
21778 * src/reader.c (yylsp_needed): Remove this variable, now replaced
21779 with `locationsflag'.
21780 * doc/bison.texinfo: Document `--locations' and `%locations'.
21781 Sort the options.
21782 * tests/calc.m4: Test it.
21783
21784 For regularity of the names, replace each
21785 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
21786 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
21787 In addition replace each `flag' with `_flag'.
21788
21789 2000-10-02 Akim Demaille <akim@epita.fr>
21790
21791 Also test parse error messages, including with YYERROR_VERBOSE.
21792
21793 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
21794 associative).
21795 Use it to check the computations.
21796 Use it to check `nonassoc' is honored.
21797 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
21798 `--yyerror-verbose'.
21799 (_AT_CHECK_CALC): Adjust to this option.
21800 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
21801
21802 2000-10-02 Akim Demaille <akim@epita.fr>
21803
21804 Test also `--verbose', `--defines' and `--name-prefix'. Testing
21805 the latter demonstrates a flaw in the handling of non debugging
21806 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
21807 was used in order to simplify:
21808
21809 #if YYDEBUG
21810 if (yydebug)
21811 {
21812 ...
21813 }
21814 #endif
21815
21816 into
21817
21818 if (yydebug)
21819 {
21820 ...
21821 }
21822
21823 unfortunately this leads to a CPP conflict when
21824 `--name-prefix=foo' is used since it produces `#define yydebug
21825 foodebug'.
21826
21827 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
21828 (YYDPRINTF): New macro.
21829 Spread its use.
21830 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
21831 the bison options.
21832 Also test `--verbose', `--defines' and `--name-prefix'.
21833
21834 2000-10-02 Akim Demaille <akim@epita.fr>
21835
21836 Improve the readability of the produced parsers.
21837
21838 * src/bison.s1: Formatting changes.
21839 Improve the comment related to the `$' mark.
21840 (yydefault): Don't fall through to `yyresume': `goto' there.
21841 * src/output.c (output_parser): When the `$' is met, skip the end
21842 of its line.
21843 New variable, `number_of_dollar_signs', to check there's exactly
21844 one `$' in the parser skeleton.
21845
21846 2000-10-02 Akim Demaille <akim@epita.fr>
21847
21848 * lib/xstrdup.c: New file, from the fileutils.
21849 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
21850 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
21851 instead of strlen + xmalloc + strcpy.
21852 * src/symtab.c (copys): Remove, use xstrdup instead.
21853
21854 2000-10-02 Akim Demaille <akim@epita.fr>
21855
21856 * src/gram.h (associativity): New enum type which replaces the
21857 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
21858 `right_assoc', `left_assoc' and `non_assoc'.
21859 Adjust all dependencies.
21860 * src/reader.c: Formatting changes.
21861 (LTYPESTR): Don't define it, use it as a literal in
21862 `reader_output_yylsp'.
21863 * src/symtab.h (symbol_class): New enum type which replaces the
21864 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
21865 `sunknown', `stoken and `snterm'.
21866
21867 2000-10-02 Akim Demaille <akim@epita.fr>
21868
21869 * src/getargs.c (fixed_outfiles): Rename as...
21870 (yaccflag): for consistency and accuracy.
21871 Adjust dependencies.
21872
21873 2000-10-02 Akim Demaille <akim@epita.fr>
21874
21875 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
21876 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
21877 difficult and introduced a lot of core dump. It turns out that
21878 Bison used an implementation of `xmalloc' based on `calloc', and
21879 at various places it does depend upon the initialization to 0. I
21880 have not tried to isolate the pertinent places, and all the former
21881 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
21882 someone should address this issue.
21883
21884 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
21885 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
21886 files.
21887 Adjust dependencies.
21888 * src/warshall.h: New file.
21889 Propagate.
21890
21891 2000-10-02 Akim Demaille <akim@epita.fr>
21892
21893 Various anti-`extern in *.c' changes.
21894
21895 * src/system.h: Include `assert.h'.
21896
21897 2000-10-02 Akim Demaille <akim@epita.fr>
21898
21899 * src/state.h (nstates, final_state, first_state, first_shift)
21900 (first_reduction): Move their exportation from here...
21901 * src/LR0.h: to here.
21902 Adjust dependencies.
21903 * src/getargs.c (statisticsflag): New variable.
21904 Add support for `--statistics'.
21905 Adjust dependencies.
21906
21907 Remove a lot of now useless `extern' statements in most files.
21908
21909 2000-10-02 Akim Demaille <akim@epita.fr>
21910
21911 * src/LR0.h: New file.
21912 Propagate its use.
21913
21914 2000-10-02 Akim Demaille <akim@epita.fr>
21915
21916 * src/print.h: New file.
21917 Propagate its use.
21918 * src/print.c: Formatting and ordering changes.
21919 (verbose, terse): Replace with...
21920 (print_results): this new function.
21921 Adjust dependencies.
21922
21923 2000-10-02 Akim Demaille <akim@epita.fr>
21924
21925 * src/conflicts.c (conflict_report): New function.
21926 (conflict_log, verbose_conflict_log): Replace with...
21927 (print_conflicts): this function.
21928 Adjust dependencies.
21929 * src/conflicts.h: New file.
21930 Propagate its inclusion.
21931
21932 2000-10-02 Akim Demaille <akim@epita.fr>
21933
21934 * src/nullable.h: New file.
21935 Propagate its inclusion.
21936 * src/nullable.c: Formatting changes.
21937
21938 2000-10-02 Akim Demaille <akim@epita.fr>
21939
21940 * src/reduce.h: New file.
21941 Propagate its inclusion.
21942 * src/reduce.c: Topological sort and other formatting changes.
21943 (bool, TRUE, FALSE): Move their definition to...
21944 * src/system.h: here.
21945
21946 2000-10-02 Akim Demaille <akim@epita.fr>
21947
21948 * src/files.c: Formatting changes.
21949 (tryopen, tryclose, openfiles): Rename as...
21950 (xfopen, xfclose, open_files): this.
21951 (stringappend): static.
21952 * src/files.h: Complete the list of exported symbols.
21953 Propagate its use.
21954
21955 2000-10-02 Akim Demaille <akim@epita.fr>
21956
21957 * src/reader.h: New file.
21958 Propagate its use instead of tedious list of `extern' and
21959 prototypes.
21960 * src/reader.c: Formatting changes, topological sort,
21961 s/register//.
21962
21963 2000-10-02 Akim Demaille <akim@epita.fr>
21964
21965 * src/lex.h: Prototype `lex.c' exported functions.
21966 * src/reader.c: Adjust.
21967 * src/lex.c: Formatting changes.
21968 (safegetc): Rename as...
21969 (xgetc): this.
21970
21971 2000-10-02 Akim Demaille <akim@epita.fr>
21972
21973 * src/lalr.h: New file.
21974 Propagate its inclusion instead of prototypes and `extern'.
21975 * src/lalr.c: Formatting changes, topological sorting etc.
21976
21977 2000-10-02 Akim Demaille <akim@epita.fr>
21978
21979 * src/output.c (token_actions): Introduce a temporary array,
21980 YYDEFACT, that makes it possible for this function to use
21981 output_short_table.
21982
21983 2000-10-02 Akim Demaille <akim@epita.fr>
21984
21985 `user_toknums' is output as a `short[]' in `output.c', while it is
21986 defined as a `int[]' in `reader.c'. For consistency with the
21987 other output tables, `user_toknums' is now defined as a table of
21988 shorts.
21989
21990 * src/reader.c (user_toknums): Be a short table instead of an int
21991 table.
21992 Adjust dependencies.
21993
21994 Factor the short table outputs.
21995
21996 * src/output.c (output_short_table): New function.
21997 * src/output.c (output_gram, output_stos, output_rule_data)
21998 (output_base, output_table, output_check): Use it.
21999
22000 2000-10-02 Akim Demaille <akim@epita.fr>
22001
22002 * src/output.c (output): Topological sort of the functions, in
22003 order to get rid of the `static' prototypes.
22004 No longer use `register'.
22005 * src/output.h: New file.
22006 Propagate its inclusion in files explicitly prototyping functions
22007 from output.c.
22008
22009 2000-09-21 Akim Demaille <akim@epita.fr>
22010
22011 * src/atgeneral.m4: Update from Autoconf.
22012
22013 2000-09-21 Akim Demaille <akim@epita.fr>
22014
22015 * src/closure.h: New file.
22016 * src/closure.c: Formatting changes, topological sort over the
22017 functions, use of closure.h.
22018 (initialize_closure, finalize_closure): Rename as...
22019 (new_closure, free_closure): these. Adjust dependencies.
22020 * src/LR0.c: Formatting changes, topological sort, use of
22021 cloture.h.
22022 (initialize_states): Rename as...
22023 (new_states): this.
22024 * src/Makefile.am (noinst_HEADERS): Adjust.
22025
22026 2000-09-20 Akim Demaille <akim@epita.fr>
22027
22028 * src/acconfig.h: Don't protect config.h against multiple
22029 inclusion.
22030 Don't define PARAMS.
22031 * src/system.h: Define PARAMS.
22032 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
22033 purpose of config.h. system.h must not try to fix wrong
22034 definitions in config.h.
22035
22036 2000-09-20 Akim Demaille <akim@epita.fr>
22037
22038 * src/derives.h: New file.
22039 * src/main.c, src/derives.h: Use it.
22040 Formatting changes.
22041 * src/Makefile.am (noinst_HEADERS): Adjust.
22042
22043 2000-09-20 Akim Demaille <akim@epita.fr>
22044
22045 * tests/atgeneral.m4: Update from Autoconf.
22046 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
22047 (AT_CHECK_CALC): New macros.
22048 Use these macros to test bison with options `', `--raw',
22049 `--debug', `--yacc', `--yacc --debug'.
22050
22051 2000-09-19 Akim Demaille <akim@epita.fr>
22052
22053 * src/output.c: Formatting changes.
22054 * src/machine.h: Remove, leaving its contents in...
22055 * src/system.h: here.
22056 Include stdio.h.
22057 Adjust all dependencies on stdio.h and machine.h.
22058 * src/getargs.h: New file.
22059 Let all `extern' declarations about getargs.c be replaced with
22060 inclusion of `getargs.h'.
22061 * src/Makefile.am (noinst_HEADERS): Adjust.
22062
22063 * tests/calc.m4 (yyin): Be initialized in main, not on the global
22064 scope.
22065 (yyerror): Returns void, not int.
22066 * doc/bison.texinfo: Formatting changes.
22067
22068 2000-09-19 Akim Demaille <akim@epita.fr>
22069
22070 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
22071 portable.
22072
22073 2000-09-18 Akim Demaille <akim@epita.fr>
22074
22075 * configure.in: Append WARNING_CFLAGS to CFLAGS.
22076 * src/Makefile.am (INCLUDES): Don't.
22077 Be ready to fetch headers in lib/.
22078
22079 2000-09-18 Akim Demaille <akim@epita.fr>
22080
22081 * doc/bison.texinfo: Update the copyright.
22082 ANSIfy and GNUify the examples.
22083 Remove the old menu.
22084
22085 2000-09-18 Akim Demaille <akim@epita.fr>
22086
22087 First set of tests: use the `calc' example from the documentation.
22088
22089 * src/bison.s1 (yyparse): Condition the code using `yytname' which
22090 is defined only when YYDEBUG is.
22091 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
22092 * src/files.c (tryopen, tryclose): Formatting changes.
22093 Move to the top and be static.
22094 * src/reader.c (read_signed_integer): Likewise.
22095 * tests/calc.m4: New file.
22096 * Makefile.am, suite.m4: Adjust.
22097 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
22098
22099 2000-09-18 Akim Demaille <akim@epita.fr>
22100
22101 Add support for an Autotest test suite for Bison.
22102
22103 * m4/m4.m4, m4/atconfig.m4: New files.
22104 * m4/Makefile.am (EXTRA_DIST): Adjust.
22105 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
22106 files.
22107 * src/getargs.c: Display a more standard --version message.
22108 * src/reader.c (reader): Formatting changes.
22109 No longer depend upon VERSION_STRING.
22110 * configure.in: No longer use `dnl'.
22111 Set up the test suite and the new directory `tests/.
22112 (VERSION_STRING): Remove.
22113
22114 2000-04-14 Akim Demaille <akim@epita.fr>
22115
22116 * src/reader.c (copy_comment2): New function, same as former
22117 `copy_comment', but outputs into two FILE *.
22118 (copy_comment): Use it.
22119 (parse_union_decl): Use it.
22120 (get_type, parse_start_decl): Use the same `invalid' message.
22121 (parse_start_decl, parse_union_decl): Use the same `multiple'
22122 message.
22123 (parse_union_decl, copy_guard, copy_action): Use the same
22124 `unmatched' message.
22125 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
22126
22127 2000-03-31 Akim Demaille <akim@epita.fr>
22128
22129 * src/files.c (tryopen, tryclose): Move to the top.
22130 Be static.
22131
22132 2000-03-31 Akim Demaille <akim@epita.fr>
22133
22134 * src/main.c (main): Don't call `done', exit does it.
22135
22136 2000-03-31 Akim Demaille <akim@epita.fr>
22137
22138 * allocate.c: s/return (foo)/return foo/.
22139 * lalr.c: Likewise.
22140 * LR0.c: Likewise.
22141 * output.c: Likewise.
22142 * reader.c: Likewise.
22143 * symtab.c: Likewise.
22144 * vmsgetargs.c: Likewise.
22145
22146 2000-03-31 Akim Demaille <akim@epita.fr>
22147
22148 Clean up the error reporting functions.
22149
22150 * src/report.c: New file.
22151 * src/report.h: Likewise.
22152 * src/Makefile.am: Adjust.
22153 * m4/error.m4: New file.
22154 * m4/Makefile.am: Adjust.
22155 * configure.in (jm_PREREQ_ERROR): Call it.
22156 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
22157 Remove.
22158 (fatal, fatals): Remove. All callers use complain.c::fatal.
22159 (warn, warni, warns, warnss, warnss): Remove. All callers use
22160 complain.c::complain.
22161 (toomany): Remove, use fatal instead.
22162 * src/files.c (done): No argument, use complain_message_count.
22163 * src/main.c (main): Register `done' to `atexit'.
22164
22165 * src/getargs.c (usage): More `fputs', less `fprintf'.
22166
22167 2000-03-28 Akim Demaille <akim@epita.fr>
22168
22169 * lib/: New directory.
22170 * Makefile.am (SUBDIRS): Adjust.
22171 * configure.in: Adjust.
22172 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
22173 useless.
22174 * src/alloca.c: Moved to lib/.
22175 * src/getopt.c: Likewise.
22176 * src/getopt1.c: Likewise.
22177 * src/getopt.h: Likewise.
22178 * src/ansi2knr.c: Likewise.
22179 * src/ansi2knr.1: Likewise.
22180 * src/Makefile.am: Adjust.
22181 * lib/Makefile.am: New file.
22182
22183 2000-03-28 Akim Demaille <akim@epita.fr>
22184
22185 * src/getargs.c (usage): Refresh the help message.
22186
22187 2000-03-17 Akim Demaille <akim@epita.fr>
22188
22189 * src/getopt1.c: Updated from textutils 2.0e
22190 * src/getopt.c: Likewise.
22191 * src/getopt.h: Likewise.
22192
22193 2000-03-17 Akim Demaille <akim@epita.fr>
22194
22195 * src/Makefile.am (bison.simple): Fix the awk program: quote only
22196 the file name, not the whole `#line LINE FILE'.
22197
22198 2000-03-17 Akim Demaille <akim@epita.fr>
22199
22200 On syntax errors, report the token on which we choked.
22201
22202 * src/bison.s1 (yyparse): In the label yyerrlab, when
22203 YYERROR_VERBOSE, add yychar in msg.
22204
22205 2000-03-17 Akim Demaille <akim@epita.fr>
22206
22207 * src/reader.c (copy_at): New function.
22208 (copy_guard): Use it.
22209 (copy_action): Use it.
22210
22211 2000-03-17 Akim Demaille <akim@epita.fr>
22212
22213 Be kind to translators, save some useless translations.
22214
22215 * src/main.c (banner): New function.
22216 (fatal_banner): Use it.
22217 (warn_banner): Use it.
22218
22219 2000-03-17 Akim Demaille <akim@epita.fr>
22220
22221 * src/reader.c (copy_definition): Use copy_string and
22222 copy_comment. Removed now unused `match', `ended',
22223 `cplus_comment'.
22224 (copy_comment, copy_string): Moved, to be visible from
22225 copy_definition.
22226
22227 2000-03-17 Akim Demaille <akim@epita.fr>
22228
22229 * src/reader.c (copy_string): Declare `static inline'. No
22230 problems with inline, since it is checked by configure.
22231 (copy_comment): Likewise.
22232
22233 2000-03-17 Akim Demaille <akim@epita.fr>
22234
22235 * src/reader.c (packsymbols): Formatting changes.
22236
22237 2000-03-17 Akim Demaille <akim@epita.fr>
22238
22239 * src/reader.c (copy_comment): New function, factored out from:
22240 (copy_action): Use it. Removed now unused `match', `ended',
22241 `cplus_comment'.
22242 (copy_guard): Likewise.
22243
22244 2000-03-17 Akim Demaille <akim@epita.fr>
22245
22246 * src/reader.c (copy_string): New function, factored out from:
22247 (copy_action): Use it.
22248 (copy_guard): Likewise.
22249
22250 2000-03-17 Akim Demaille <akim@epita.fr>
22251
22252 Change the handling of @s so that they behave exactly like $s.
22253 There is now a pseudo variable @$ (readble and writable), location
22254 of the lhs of the rule (by default ranging from the location of
22255 the first symbol of the rhs, to the location of the last symbol,
22256 or, if the rhs is empty, YYLLOC).
22257
22258 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
22259 yyval.
22260 (yyparse): When providing a default semantic action, provide a
22261 default location action.
22262 (after the $): No longer change `*YYLSP', just stack YYLOC the
22263 same way you stack YYVAL.
22264 * src/reader.c (read_declarations): Use warns.
22265 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
22266 (copy_action, case '@'): Likewise.
22267 Use a standard error message, to save useless work from
22268 translators.
22269
22270 2000-03-17 Akim Demaille <akim@epita.fr>
22271
22272 * src/bison.s1: Formatting and cosmetics changes.
22273 * src/reader.c: Likewise.
22274 Update the Copyright notice.
22275
22276 2000-03-17 Akim Demaille <akim@epita.fr>
22277
22278 * src/bison.s1 (#line): All set to `#line' only, since the
22279 Makefile now handles them.
22280
22281 2000-03-16 Akim Demaille <akim@epita.fr>
22282
22283 * src/output.c (output_rule_data): Output the documentation of
22284 some of the tables.
22285 (Copyright notice): Update.
22286 Formatting changes.
22287
22288 2000-03-16 Akim Demaille <akim@epita.fr>
22289
22290 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
22291 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
22292 One `#if YYDEBUG' remains, since it uses variables which are
22293 defined only if `YYDEBUG != 0'.
22294
22295 2000-03-16 Akim Demaille <akim@epita.fr>
22296
22297 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
22298 and related variables so that the similarities are highlighted.
22299
22300 2000-03-16 Akim Demaille <akim@epita.fr>
22301
22302 * src/bison.s1: Properly indent CPP directives.
22303
22304 2000-03-16 Akim Demaille <akim@epita.fr>
22305
22306 * src/bison.s1: Properly indent the `alloca' CPP section.
22307
22308 2000-03-16 Akim Demaille <akim@epita.fr>
22309
22310 Do not hard code values of directories in `configure.in'.
22311 Update the `configure' tool chain.
22312
22313 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
22314 src/makefile.am.
22315 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
22316 (AC_OUTPUT): Add m4/Makefile.
22317 Bump to bison 1.28a, 1.29 has never been released.
22318 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
22319 handled via src/Makefile.am.
22320 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
22321 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
22322 autoheader.
22323 * Makefile.am (SUBDIRS): Add m4.
22324 (ACLOCAL_AM_FLAGS): New variable.
22325 (AUTOMAKE_OPTIONS): Add check-news.
22326 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
22327 the proper line number and file name.
22328 (DEFS): Propagate the location of bison library files and of the
22329 locale files.
22330 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
22331 builddir.
22332 * acinclude.m4: Remove, replaced by the directory m4.
22333 * m4/Makefile.am (EXTRA_DIST): New variable.
22334 * m4/gettext.m4: New file, from the fileutils.
22335 * m4/lcmessage.m4: Likewise
22336 * m4/progtest.m4: Likewise.
22337 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
22338
22339 2000-03-10 Akim Demaille <akim@epita.fr>
22340
22341 * src/closure.c:
22342 Formatting changes of various comments.
22343 Respect the GNU coding standards at various places.
22344 Don't use `_()' when no translation is needed.
22345
22346 1999-12-13 Jesse Thilo <jthilo@gnu.org>
22347
22348 * src/files.c:
22349 OS/2 honors TMPDIR environment variable.
22350
22351 1999-12-13 Jesse Thilo <jthilo@gnu.org>
22352
22353 * doc/bison.texinfo: Tweaked spelling and grammar.
22354 Updated ISBN.
22355 Removed reference to price of printed copy.
22356 Mention BISON_SIMPLE and BISON_HAIRY.
22357
22358 1999-12-13 Jesse Thilo <jthilo@gnu.org>
22359
22360 * configure.in, NEWS:
22361 Bison 1.29 released.
22362
22363 1999-10-27 Jesse Thilo <jthilo@gnu.org>
22364
22365 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
22366 Added reference card.
22367
22368 1999-07-26 Jesse Thilo <jthilo@gnu.org>
22369
22370 * po/ru.po: Added Russian translation.
22371
22372 1999-07-26 Jesse Thilo <jthilo@gnu.org>
22373
22374 * configure.in: Added Russian translation.
22375
22376 1999-07-06 Jesse Thilo <jthilo@gnu.org>
22377
22378 * configure.in, NEWS, README:
22379 Released version 1.28.
22380
22381 1999-06-14 Jesse Thilo <jthilo@gnu.org>
22382
22383 * src/system.h:
22384 Squashed redefinition warning on some systems.
22385
22386 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
22387 Have configure build version string instead of relying on ANSI string
22388 concatentation.
22389
22390 1999-06-14 Jesse Thilo <jthilo@gnu.org>
22391
22392 * po/POTFILES.in: Got rid of version.c.
22393
22394 1999-06-14 Jesse Thilo <jthilo@gnu.org>
22395
22396 * acconfig.h, configure.in:
22397 Have configure build version string instead of relying on ANSI string
22398 concatentation.
22399
22400 1999-06-08 Jesse Thilo <jthilo@gnu.org>
22401
22402 * doc/bison.1:
22403 Dropped mention of `+' for long-named options.
22404
22405 1999-05-30 Jesse Thilo <jthilo@gnu.org>
22406
22407 * src/files.c: Added <unistd.h> for unlink().
22408
22409 * src/Makefile.am, src/system.h:
22410 I18n fixes.
22411
22412 1999-05-30 Jesse Thilo <jthilo@gnu.org>
22413
22414 * README: Added a FAQ list.
22415
22416 * configure.in, acconfig.h:
22417 I18n fixes.
22418
22419 1999-05-30 Jesse Thilo <jthilo@gnu.org>
22420
22421 * doc/FAQ, doc/Makefile.am:
22422 Added a FAQ list.
22423
22424 1999-05-19 Jesse Thilo <jthilo@gnu.org>
22425
22426 * src/alloc.h, src/symtab.h, src/version.c:
22427 Protected inclusion of "config.h" with HAVE_CONFIG_H.
22428
22429 1999-04-18 Jesse Thilo <jthilo@gnu.org>
22430
22431 * src/.cvsignore, src/Makefile.am:
22432 Reorganized: sources in `src', documentation in `doc'.
22433
22434 * src/lex.c (literalchar):
22435 fixed the code for escaping double quotes (thanks
22436 Jonathan Czisny.)
22437
22438 1999-04-18 Jesse Thilo <jthilo@gnu.org>
22439
22440 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
22441 Adjusted paths to reflect directory reorganization.
22442
22443 1999-04-18 Jesse Thilo <jthilo@gnu.org>
22444
22445 * doc/.cvsignore, doc/Makefile.am:
22446 Reorganized: sources in `src', documentation in `doc'.
22447
22448 1999-04-18 Jesse Thilo <jthilo@gnu.org>
22449
22450 * configure.in:
22451 Updated AC_INIT file to reflect directory reorganization.
22452
22453 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
22454 Reorganized: sources in `src', documentation in `doc'.
22455
22456 1999-04-13 Jesse Thilo <jthilo@gnu.org>
22457
22458 * src/allocate.c:
22459 Don't declare calloc() and realloc() if not necessary.
22460
22461 1999-04-13 Jesse Thilo <jthilo@gnu.org>
22462
22463 * configure.in, acconfig.h, acinclude.m4:
22464 Don't declare calloc() and realloc() if not necessary.
22465
22466 1999-03-23 Jesse Thilo <jthilo@gnu.org>
22467
22468 * po/.cvsignore: Added i18n support.
22469
22470 1999-03-23 Jesse Thilo <jthilo@gnu.org>
22471
22472 * acconfig.h, configure.in, Makefile.am:
22473 Added i18n support.
22474
22475 1999-03-22 Jesse Thilo <jthilo@gnu.org>
22476
22477 * src/bison.s1: Fixed #line numbers.
22478
22479 1999-03-15 Jesse Thilo <jthilo@gnu.org>
22480
22481 * po/es.po, po/fr.po, po/nl.po, po/de.po:
22482 Added PO files from Translation Project.
22483
22484 1999-03-03 Jesse Thilo <jthilo@gnu.org>
22485
22486 * Makefile.am:
22487 Added support for non-ANSI compilers (ansi2knr).
22488
22489 1999-02-16 Jesse Thilo <jthilo@gnu.org>
22490
22491 * configure.in: Bumped version number to 1.27.
22492
22493 * Makefile.am:
22494 Added `bison.simple' to list of files removed by `make distclean'.
22495
22496 1999-02-12 Jesse Thilo <jthilo@gnu.org>
22497
22498 * src/files.c, src/files.h:
22499 Defined locations of parser files in config.h instead of Makefile.
22500
22501 1999-02-12 Jesse Thilo <jthilo@gnu.org>
22502
22503 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
22504 Defined locations of parser files in config.h instead of Makefile.
22505
22506 1999-02-09 Jesse Thilo <jthilo@gnu.org>
22507
22508 * Makefile.am:
22509 Removed inappropriate use of $< macro.
22510
22511 1999-02-05 Jesse Thilo <jthilo@gnu.org>
22512
22513 * po/Makefile.in.in, po/POTFILES.in:
22514 Add `po' directory skeleton.
22515
22516 1999-01-27 Jesse Thilo <jthilo@gnu.org>
22517
22518 * README: Document help-bison list.
22519
22520 * configure.in: Add check for mkstemp().
22521
22522 1999-01-20 Jesse Thilo <jthilo@gnu.org>
22523
22524 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
22525 Hush a few compiler warnings.
22526
22527 * src/files.c:
22528 Add tryclose(), which verifies that fclose was successful.
22529 Hush a couple of compiler warnings.
22530
22531 1999-01-20 Jesse Thilo <jthilo@gnu.org>
22532
22533 * Makefile.am, OChangeLog:
22534 ChangeLog is now automatically generated. Include the old version as
22535 OChangeLog.
22536
22537 1999-01-14 Jesse Thilo <jthilo@gnu.org>
22538
22539 * 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:
22540 Update FSF address.
22541
22542 1999-01-14 Jesse Thilo <jthilo@gnu.org>
22543
22544 * doc/bison.texinfo: Fix formatting glitch.
22545
22546 * doc/bison.texinfo: Update FSF address.
22547
22548 1999-01-14 Jesse Thilo <jthilo@gnu.org>
22549
22550 * acconfig.h: Update FSF address.
22551
22552 1999-01-08 Jesse Thilo <jthilo@gnu.org>
22553
22554 * src/system.h:
22555 Don't define PACKAGE here, since config.h defines it.
22556
22557 1998-12-30 Jesse Thilo <jthilo@gnu.org>
22558
22559 * src/reader.c: Update copyright date.
22560
22561 * src/main.c:
22562 Ditch sprintf to statically-sized buffers in fatal/warn functions in
22563 favor of output directly to stderr (avoids buffer overruns).
22564
22565 * src/reader.c: Some checks for premature EOF.
22566
22567 * 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:
22568 Use prototypes if the compiler understands them.
22569
22570 * src/files.c: Honor TMPDIR on Unix hosts.
22571 Use prototypes if the compiler understands them.
22572
22573 * src/reader.c:
22574 Fix a couple of buffer overrun bugs.
22575 Use prototypes if the compiler understands them.
22576
22577 * src/system.h: Include unistd.h and ctype.h.
22578 Use #ifdef instead of #if for NLS symbols.
22579
22580 1998-12-30 Jesse Thilo <jthilo@gnu.org>
22581
22582 * doc/bison.texinfo:
22583 Delete comment "consider using @set for edition number, etc..." since
22584 we now are doing so.
22585
22586 1998-12-30 Jesse Thilo <jthilo@gnu.org>
22587
22588 * configure.in:
22589 Use prototypes if the compiler understands them.
22590
22591 * NEWS: Document 1.26 highlights.
22592
22593 * Makefile.am: Require Automake 1.3 or later.
22594
22595 * acconfig.h:
22596 Use prototypes if the compiler understands them.
22597
22598 1998-12-29 Jesse Thilo <jthilo@gnu.org>
22599
22600 * src/version.c:
22601 Use VERSION symbol from automake for version number.
22602
22603 1998-12-29 Jesse Thilo <jthilo@gnu.org>
22604
22605 * acconfig.h, configure.in, version.cin:
22606 Use VERSION symbol from automake for version number.
22607
22608 1998-11-28 Jesse Thilo <jthilo@gnu.org>
22609
22610 * Makefile.am:
22611 Distribute original version of simple parser (bison.s1), not built
22612 version (bison.simple).
22613
22614 1998-11-28 Jesse Thilo <jthilo@gnu.org>
22615
22616 * doc/bison.texinfo: Add info dir entry.
22617
22618 * doc/bison.texinfo:
22619 Let automake put version number into documentation.
22620
22621 1998-11-26 Jesse Thilo <jthilo@gnu.org>
22622
22623 * src/bison.cld, src/build.com, src/vmshlp.mar:
22624 Add non-RCS files from /gd/gnu/bison.
22625
22626 1998-11-26 Jesse Thilo <jthilo@gnu.org>
22627
22628 * doc/bison.1:
22629 Document the BISON_HAIRY and BISON_SIMPLE variables.
22630
22631 1998-11-25 Jesse Thilo <jthilo@gnu.org>
22632
22633 * src/version.c: Build version.c automatically.
22634
22635 * src/reader.c:
22636 Fix token numbering (used to start at 258, not 257).
22637
22638 * src/system.h: Include config.h.
22639
22640 * src/getargs.c: Update bug report address.
22641
22642 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
22643 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
22644
22645 1998-11-25 Jesse Thilo <jthilo@gnu.org>
22646
22647 * Makefile.am:
22648 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
22649
22650 * configure.in, version.cin:
22651 Build version.c automatically.
22652
22653 * AUTHORS: Add AUTHORS file.
22654
22655 * README: Update bug report address.
22656
22657 * bison.simple:
22658 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
22659
22660 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
22661 Add automake stuff.
22662
22663 1998-11-25 Jesse Thilo <jthilo@gnu.org>
22664
22665 * doc/bison.texinfo: Clean up some formatting.
22666
22667 1998-05-05 Richard Stallman <rms@gnu.org>
22668
22669 * doc/bison.texinfo:
22670 Explain better why to make a pure parser.
22671
22672 1998-01-05 Richard Stallman <rms@gnu.org>
22673
22674 * src/files.c (openfiles):
22675 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
22676 find a temporary directory, if possible. Do not unlink files while
22677 they are open.
22678
22679 1997-08-25 Richard Stallman <rms@gnu.org>
22680
22681 * src/reader.c (stack_offset;):
22682 Change some warni to warns.
22683
22684 * src/lex.c (literalchar): Use warns, not warni.
22685
22686 1997-06-28 Richard Stallman <rms@gnu.org>
22687
22688 * src/bison.s1: Add a Bison version comment.
22689
22690 * src/main.c (fatal, warn, berror):
22691 Use program_name.
22692
22693 1997-06-28 Richard Stallman <rms@gnu.org>
22694
22695 * Makefile.in (bison_version): New variable.
22696 (dist): Use that variable.
22697 (bison.s1): Substitute the Bison version into bison.simple.
22698
22699 * bison.simple: Add a Bison version comment.
22700
22701 1997-06-18 Richard Stallman <rms@gnu.org>
22702
22703 * src/main.c (fatal, warn, berror):
22704 Make error messages standard.
22705 (toomany): Improve error message text.
22706
22707 * 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:
22708 new.h renamed to alloc.h.
22709
22710 1997-06-18 Richard Stallman <rms@gnu.org>
22711
22712 * Makefile.in: new.h renamed to alloc.h.
22713
22714 1997-05-24 Richard Stallman <rms@gnu.org>
22715
22716 * src/lex.c (literalchar):
22717 Fix the code for escaping \, " and '.
22718
22719 (lex): Avoid trouble when there are many chars
22720 to discard in a char literal with just several chars in it.
22721
22722 1997-05-17 Richard Stallman <rms@gnu.org>
22723
22724 * src/bison.s1:
22725 Use malloc, if using alloca is troublesome.
22726 (YYSTACK_USE_ALLOCA): New flag macro.
22727 Define it for some systems and compilers.
22728 (YYSTACK_ALLOC): New macro.
22729 (yyparse): Use YYSTACK_ALLOC to allocate stack.
22730 If it was malloc'd, free it.
22731
22732 1997-05-17 Richard Stallman <rms@gnu.org>
22733
22734 * bison.simple:
22735 Use malloc, if using alloca is troublesome.
22736 (YYSTACK_USE_ALLOCA): New flag macro.
22737 Define it for some systems and compilers.
22738 (YYSTACK_ALLOC): New macro.
22739 (yyparse): Use YYSTACK_ALLOC to allocate stack.
22740 If it was malloc'd, free it.
22741
22742 1997-04-23 Richard Stallman <rms@gnu.org>
22743
22744 * src/bison.s1:
22745 (alloca) [__hpux]: Always define as __builtin_alloca.
22746
22747 1997-04-23 Richard Stallman <rms@gnu.org>
22748
22749 * bison.simple:
22750 (alloca) [__hpux]: Always define as __builtin_alloca.
22751
22752 1997-04-22 Richard Stallman <rms@gnu.org>
22753
22754 * src/bison.s1:
22755 [__hpux]: Include alloca.h (right for HPUX 10)
22756 instead of declaring alloca (right for HPUX 9).
22757
22758 * src/bison.s1 (__yy_memcpy):
22759 Declare arg `count' as unsigned int.
22760 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
22761
22762 1997-04-22 Richard Stallman <rms@gnu.org>
22763
22764 * bison.simple:
22765 [__hpux]: Include alloca.h (right for HPUX 10)
22766 instead of declaring alloca (right for HPUX 9).
22767
22768 * bison.simple (__yy_memcpy):
22769 Declare arg `count' as unsigned int.
22770 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
22771
22772 1997-01-03 Richard Stallman <rms@gnu.org>
22773
22774 * src/allocate.c: [__STDC__ or _MSC_VER]:
22775 Declare calloc and realloc to return void *.
22776
22777 1997-01-02 Richard Stallman <rms@gnu.org>
22778
22779 * src/system.h:
22780 [_MSC_VER]: Include stdlib.h and process.h.
22781 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
22782
22783 * src/main.c (main): Return FAILURE as a value.
22784 (printable_version): Declare arg as int, not char.
22785
22786 1997-01-02 Richard Stallman <rms@gnu.org>
22787
22788 * Makefile.in (dist):
22789 Explicitly check for symlinks, and copy them.
22790
22791 1996-12-19 Richard Stallman <rms@gnu.org>
22792
22793 * src/files.c:
22794 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
22795
22796 1996-12-18 Paul Eggert <eggert@gnu.org>
22797
22798 * src/bison.s1 (yyparse):
22799 If __GNUC__ and YYPARSE_PARAM are both defined,
22800 declare yyparse to have a void * argument.
22801
22802 1996-12-18 Paul Eggert <eggert@gnu.org>
22803
22804 * bison.simple (yyparse):
22805 If __GNUC__ and YYPARSE_PARAM are both defined,
22806 declare yyparse to have a void * argument.
22807
22808 1996-12-17 Richard Stallman <rms@gnu.org>
22809
22810 * src/reduce.c (nbits): Add some casts.
22811
22812 1996-08-12 Richard Stallman <rms@gnu.org>
22813
22814 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
22815
22816 1996-08-12 Richard Stallman <rms@gnu.org>
22817
22818 * bison.simple: Test _MSDOS as well as _MSDOS_.
22819
22820 1996-07-31 Richard Stallman <rms@gnu.org>
22821
22822 * src/bison.s1:
22823 [__sun && __i386]: Include alloca.h.
22824
22825 1996-07-31 Richard Stallman <rms@gnu.org>
22826
22827 * bison.simple:
22828 [__sun && __i386]: Include alloca.h.
22829
22830 1996-07-30 Richard Stallman <rms@gnu.org>
22831
22832 * src/bison.s1: Comment change.
22833
22834 * src/bison.s1: Test _MSDOS_, not MSDOS.
22835
22836 1996-07-30 Richard Stallman <rms@gnu.org>
22837
22838 * bison.simple: Comment change.
22839
22840 * bison.simple: Test _MSDOS_, not MSDOS.
22841
22842 1996-06-01 Richard Stallman <rms@gnu.org>
22843
22844 * 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:
22845 Insert `_' macro around many string constants.
22846
22847 * src/main.c:
22848 Insert `_' macro around many string constants.
22849
22850 (main): Call setlocale, bindtextdomain and textdomain.
22851
22852 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
22853 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
22854 [ENABLE_NLS]: Include libintl.h.
22855 [ENABLE_NLS] (gettext): Define.
22856 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
22857 (N_, PACKAGE, LOCALEDIR): New macros.
22858
22859 1996-06-01 Richard Stallman <rms@gnu.org>
22860
22861 * POTFILES.in: New file.
22862
22863 * Makefile.in (allocate.o):
22864 Define target explicitly.
22865
22866 * Makefile.in (CFLAGS): Set to @CFLAGS@.
22867 (LDFLAGS): Set to @LDFLAGS@.
22868 (configure): Run autoconf only if preceding `cd' succeeds.
22869 (bison.s1): Redirect output to temporary file then move the
22870 temporary to the target, rather than redirecting directly to bison.s1.
22871 (clean): Remove config.status and config.log.
22872 (distclean): Don't remove config.status here.
22873
22874 1996-05-12 Richard Stallman <rms@gnu.org>
22875
22876 * src/bison.s1:
22877 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
22878
22879 1996-05-12 Richard Stallman <rms@gnu.org>
22880
22881 * bison.simple:
22882 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
22883
22884 1996-05-11 Richard Stallman <rms@gnu.org>
22885
22886 * src/bison.s1 (__yy_memcpy):
22887 Really reorder the args, as was supposedly done on Feb 14 1995.
22888 (yyparse): Calls changed accordingly.
22889
22890 1996-05-11 Richard Stallman <rms@gnu.org>
22891
22892 * Makefile.in (dist): Don't use $(srcdir).
22893
22894 * bison.simple (__yy_memcpy):
22895 Really reorder the args, as was supposedly done on Feb 14 1995.
22896 (yyparse): Calls changed accordingly.
22897
22898 1996-01-27 Richard Stallman <rms@gnu.org>
22899
22900 * src/output.c (output_rule_data):
22901 Test YYERROR_VERBOSE in the conditional
22902 around the definition of ttyname.
22903
22904 1995-12-29 Richard Stallman <rms@gnu.org>
22905
22906 * src/bison.s1:
22907 Fix line numbers in #line commands.
22908
22909 1995-12-29 Richard Stallman <rms@gnu.org>
22910
22911 * bison.simple:
22912 Fix line numbers in #line commands.
22913
22914 1995-12-27 Richard Stallman <rms@gnu.org>
22915
22916 * src/bison.s1 (YYPARSE_PARAM_DECL):
22917 In C++, make it always null.
22918 (YYPARSE_PARAM_ARG): New macro.
22919 (yyparse): Use YYPARSE_PARAM_ARG.
22920
22921 1995-12-27 Richard Stallman <rms@gnu.org>
22922
22923 * bison.simple (YYPARSE_PARAM_DECL):
22924 In C++, make it always null.
22925 (YYPARSE_PARAM_ARG): New macro.
22926 (yyparse): Use YYPARSE_PARAM_ARG.
22927
22928 1995-11-29 Richard Stallman <rms@gnu.org>
22929
22930 * doc/bison.texinfo:
22931 Describe literal string tokens, %raw, %no_lines, %token_table.
22932
22933 1995-11-29 Daniel Hagerty <hag@gnu.org>
22934
22935 * doc/bison.texinfo: Fixed update date
22936
22937 1995-10-16 Richard Stallman <rms@gnu.org>
22938
22939 * src/version.c: Version 1.25.
22940
22941 1995-10-16 Richard Stallman <rms@gnu.org>
22942
22943 * NEWS: *** empty log message ***
22944
22945 1995-10-16 Richard Stallman <rms@gnu.org>
22946
22947 * doc/bison.1, doc/bison.rnh:
22948 Add new options.
22949
22950 1995-10-15 Richard Stallman <rms@gnu.org>
22951
22952 * src/vmsgetargs.c, src/getargs.c:
22953 Added -n, -k, and -raw switches.
22954 (noparserflag, toknumflag, rawtoknumflag): New variables.
22955
22956 * src/symtab.h (SALIAS):
22957 New #define for adding aliases to %token.
22958 (struct bucket): Added `alias' field.
22959
22960 * src/reduce.c (reduce_grammar):
22961 Revise error message.
22962 (print_notices): Remove final `.' from error message.
22963
22964 * src/reader.c (reader_output_yylsp):
22965 New function.
22966 (readgram): Use `#if 0' around code that accepted %command
22967 inside grammar rules: The documentation doesn't allow it,
22968 and it will fail since the %command processors scan for the next %.
22969 (parse_token_decl): Extended the %token
22970 declaration to allow a multi-character symbol as an alias.
22971 (parse_thong_decl): New function.
22972 (read_declarations): Added %thong declarations.
22973 (read_declarations): Handle NOOP to deal with allowing
22974 % declarations as another means to specify the flags.
22975 (readgram): Allow %prec prior to semantics embedded in a rule.
22976 (skip_to_char, read_declarations, copy_definition)
22977 (parse_token_decl, parse_start_decl, parse_type_decl)
22978 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
22979 (get_type_name, copy_guard, copy_action, readgram)
22980 (get_type, packsymbols): Revised most error messages.
22981 Changed `fatal' to `warnxxx' to avoid aborting for error.
22982 Revised and use multiple warnxxx functions to avoid using VARARGS1.
22983 (read_declarations): Improve the error message for
22984 an invalid character. Do not abort.
22985 (read_declarations, copy_guard, copy_action): Use
22986 printable_version to avoid unprintable characters in printed output.
22987 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
22988 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
22989 Allow the type of a non-terminal can be given
22990 more than once, as long as all specifications give the same type.
22991
22992 * src/output.c:
22993 (output_headers, output_trailers, output, output_gram)
22994 (output_rule_data): Implement noparserflag variable.
22995 Implement toknumflag variable.
22996 (output): Call reader_output_yylsp to output LTYPESTR.
22997
22998 * src/main.c (main):
22999 If reader sees an error, don't process the grammar.
23000 (fatals): Updated to not use VARARGS1.
23001 (printable_version, int_to_string, warn, warni, warns, warnss)
23002 (warnsss): New error reporting functions. Avoid abort for error.
23003
23004 * src/lex.h:
23005 Added THONG and NOOP for alias processing.
23006 Added SETOPT for the new code that allows setting options with %flags.
23007
23008 * src/lex.c:
23009 Include getopt.h. Add some extern decls.
23010 (safegetc): New function to deal with EOF gracefully.
23011 (literalchar); new function to deal with reading \ escapes.
23012 (lex): Use literalchar.
23013 (lex): Implemented "..." tokens.
23014 (literalchar, lex, parse_percent_token): Made tokenbuffer
23015 always contain the token. This includes growing the token
23016 buffer while reading an integer.
23017 (parse_percent_token): Replaced if-else statement with percent_table.
23018 (parse_percent_token): Added % declarations as another
23019 way to specify the flags -n, -l, and -r. Also added hooks for
23020 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
23021 major changes to files.c.
23022 (lex) Retain in the incoming stream a character following
23023 an incorrect '/'.
23024 (skip_white_space, lex): Revised most error messages
23025 and changed fatal to warn to avoid aborting.
23026 (percent_table): Added %thong declarations.
23027
23028 * src/gram.h: Comment changes.
23029
23030 * src/files.c (openfiles, open_extra_files, done):
23031 Add faction flag
23032 and actfile file. Handle noparserflag. Both for -n switch.
23033
23034 * src/conflicts.c (resolve_sr_conflict):
23035 Remove use of alloca.
23036
23037 1995-06-01 Jim Meyering <meyering@gnu.org>
23038
23039 * doc/bison.texinfo: *** empty log message ***
23040
23041 1995-05-06 Richard Stallman <rms@gnu.org>
23042
23043 * src/bison.s1: Comment change.
23044
23045 1995-05-06 Richard Stallman <rms@gnu.org>
23046
23047 * bison.simple: Comment change.
23048
23049 1995-05-03 Richard Stallman <rms@gnu.org>
23050
23051 * src/version.c: Version now 1.24.
23052
23053 * src/bison.s1: Change distribution terms.
23054
23055 * src/version.c: Version now 1.23.
23056
23057 1995-05-03 Richard Stallman <rms@gnu.org>
23058
23059 * doc/bison.texinfo:
23060 Rewrite "Conditions for Using Bison".
23061 Update version to 1.24.
23062
23063 1995-05-03 Richard Stallman <rms@gnu.org>
23064
23065 * bison.simple: Change distribution terms.
23066
23067 1995-02-23 Richard Stallman <rms@gnu.org>
23068
23069 * src/files.c: Test __VMS_POSIX as well as VMS.
23070
23071 1995-02-14 Jim Meyering <meyering@gnu.org>
23072
23073 * src/bison.s1 (__yy_memcpy):
23074 Renamed from __yy_bcopy to avoid
23075 confusion. Reverse FROM and TO arguments to be consistent with
23076 those of memcpy.
23077
23078 1995-02-14 Jim Meyering <meyering@gnu.org>
23079
23080 * bison.simple (__yy_memcpy):
23081 Renamed from __yy_bcopy to avoid
23082 confusion. Reverse FROM and TO arguments to be consistent with
23083 those of memcpy.
23084
23085 1994-11-10 David J. MacKenzie <djm@gnu.org>
23086
23087 * NEWS: reformat
23088
23089 * NEWS: New file.
23090
23091 * Makefile.in (DISTFILES): Include NEWS.
23092
23093 * Makefile.in (DISTFILES):
23094 Include install-sh, not install.sh.
23095
23096 * configure.in: Update to Autoconf v2 macro names.
23097
23098 1994-10-05 David J. MacKenzie <djm@gnu.org>
23099
23100 * Makefile.in: fix typo
23101
23102 * Makefile.in (prefix, exec_prefix):
23103 Let configure set them.
23104
23105 1994-09-28 David J. MacKenzie <djm@gnu.org>
23106
23107 * Makefile.in: Set datadir to $(prefix)/share.
23108
23109 1994-09-15 Richard Stallman <rms@gnu.org>
23110
23111 * src/bison.s1:
23112 Update copyright notice and GPL version.
23113
23114 1994-09-15 Richard Stallman <rms@gnu.org>
23115
23116 * bison.simple:
23117 Update copyright notice and GPL version.
23118
23119 1994-07-12 Richard Stallman <rms@gnu.org>
23120
23121 * src/reduce.c, src/reader.c:
23122 entered into RCS
23123
23124 1994-05-05 David J. MacKenzie <djm@gnu.org>
23125
23126 * Makefile.in: entered into RCS
23127
23128 1994-03-26 Richard Stallman <rms@gnu.org>
23129
23130 * src/bison.s1: entered into RCS
23131
23132 1994-03-26 Richard Stallman <rms@gnu.org>
23133
23134 * bison.simple: entered into RCS
23135
23136 1994-03-25 Richard Stallman <rms@gnu.org>
23137
23138 * src/main.c: entered into RCS
23139
23140 1994-03-24 Richard Stallman <rms@gnu.org>
23141
23142 * src/conflicts.c: entered into RCS
23143
23144 1994-01-02 Richard Stallman <rms@gnu.org>
23145
23146 * Makefile.in: *** empty log message ***
23147
23148 1993-11-21 Richard Stallman <rms@gnu.org>
23149
23150 * src/bison.s1: *** empty log message ***
23151
23152 1993-11-21 Richard Stallman <rms@gnu.org>
23153
23154 * doc/bison.texinfo: entered into RCS
23155
23156 * doc/bison.texinfo: *** empty log message ***
23157
23158 1993-11-21 Richard Stallman <rms@gnu.org>
23159
23160 * bison.simple: *** empty log message ***
23161
23162 1993-10-25 David J. MacKenzie <djm@gnu.org>
23163
23164 * doc/bison.texinfo: *** empty log message ***
23165
23166 1993-10-19 Richard Stallman <rms@gnu.org>
23167
23168 * src/bison.s1: *** empty log message ***
23169
23170 1993-10-19 Richard Stallman <rms@gnu.org>
23171
23172 * bison.simple: *** empty log message ***
23173
23174 1993-10-14 Richard Stallman <rms@gnu.org>
23175
23176 * src/bison.s1: *** empty log message ***
23177
23178 1993-10-14 Richard Stallman <rms@gnu.org>
23179
23180 * bison.simple: *** empty log message ***
23181
23182 1993-09-14 David J. MacKenzie <djm@gnu.org>
23183
23184 * doc/bison.texinfo: *** empty log message ***
23185
23186 1993-09-13 Noah Friedman <friedman@gnu.org>
23187
23188 * Makefile.in: *** empty log message ***
23189
23190 1993-09-10 Richard Stallman <rms@gnu.org>
23191
23192 * src/conflicts.c: *** empty log message ***
23193
23194 * src/system.h: entered into RCS
23195
23196 1993-09-10 Richard Stallman <rms@gnu.org>
23197
23198 * doc/bison.1: entered into RCS
23199
23200 1993-09-06 Noah Friedman <friedman@gnu.org>
23201
23202 * src/version.c: entered into RCS
23203
23204 1993-09-06 Noah Friedman <friedman@gnu.org>
23205
23206 * Makefile.in: *** empty log message ***
23207
23208 1993-07-30 David J. MacKenzie <djm@gnu.org>
23209
23210 * Makefile.in: *** empty log message ***
23211
23212 1993-07-24 Richard Stallman <rms@gnu.org>
23213
23214 * src/bison.s1: *** empty log message ***
23215
23216 1993-07-24 Richard Stallman <rms@gnu.org>
23217
23218 * bison.simple: *** empty log message ***
23219
23220 1993-07-08 David J. MacKenzie <djm@gnu.org>
23221
23222 * Makefile.in: *** empty log message ***
23223
23224 1993-07-04 Richard Stallman <rms@gnu.org>
23225
23226 * src/bison.s1: *** empty log message ***
23227
23228 1993-07-04 Richard Stallman <rms@gnu.org>
23229
23230 * bison.simple: *** empty log message ***
23231
23232 1993-06-26 David J. MacKenzie <djm@gnu.org>
23233
23234 * src/getargs.c: entered into RCS
23235
23236 1993-06-26 David J. MacKenzie <djm@gnu.org>
23237
23238 * doc/bison.texinfo: *** empty log message ***
23239
23240 * doc/bison.1: New file.
23241
23242 1993-06-25 Richard Stallman <rms@gnu.org>
23243
23244 * src/getargs.c: New file.
23245
23246 1993-06-16 Richard Stallman <rms@gnu.org>
23247
23248 * src/bison.s1: *** empty log message ***
23249
23250 1993-06-16 Richard Stallman <rms@gnu.org>
23251
23252 * bison.simple: *** empty log message ***
23253
23254 1993-06-03 Richard Stallman <rms@gnu.org>
23255
23256 * src/bison.s1: New file.
23257
23258 1993-06-03 Richard Stallman <rms@gnu.org>
23259
23260 * doc/bison.texinfo: *** empty log message ***
23261
23262 1993-06-03 Richard Stallman <rms@gnu.org>
23263
23264 * bison.simple: New file.
23265
23266 1993-05-19 Richard Stallman <rms@gnu.org>
23267
23268 * doc/bison.texinfo: New file.
23269
23270 1993-05-07 Noah Friedman <friedman@gnu.org>
23271
23272 * Makefile.in: *** empty log message ***
23273
23274 1993-04-28 Noah Friedman <friedman@gnu.org>
23275
23276 * src/reader.c: *** empty log message ***
23277
23278 1993-04-23 Noah Friedman <friedman@gnu.org>
23279
23280 * src/alloc.h: entered into RCS
23281
23282 1993-04-20 David J. MacKenzie <djm@gnu.org>
23283
23284 * src/version.c: *** empty log message ***
23285
23286 * src/files.c, src/allocate.c:
23287 entered into RCS
23288
23289 * src/reader.c: *** empty log message ***
23290
23291 * src/lex.c: entered into RCS
23292
23293 * src/conflicts.c: New file.
23294
23295 * src/symtab.c: entered into RCS
23296
23297 * src/alloc.h: New file.
23298
23299 * src/LR0.c: entered into RCS
23300
23301 1993-04-18 Noah Friedman <friedman@gnu.org>
23302
23303 * src/reader.c: New file.
23304
23305 * src/version.c: *** empty log message ***
23306
23307 1993-04-18 Noah Friedman <friedman@gnu.org>
23308
23309 * Makefile.in: *** empty log message ***
23310
23311 1993-04-17 Noah Friedman <friedman@gnu.org>
23312
23313 * Makefile.in: *** empty log message ***
23314
23315 1993-04-15 Richard Stallman <rms@gnu.org>
23316
23317 * src/main.c, src/files.c:
23318 New file.
23319
23320 1993-04-15 Noah Friedman <friedman@gnu.org>
23321
23322 * configure.in: entered into RCS
23323
23324 * configure.in: *** empty log message ***
23325
23326 * configure.in: New file.
23327
23328 1993-04-14 Richard Stallman <rms@gnu.org>
23329
23330 * Makefile.in: New file.
23331
23332 1993-04-13 Richard Stallman <rms@gnu.org>
23333
23334 * src/version.c: New file.
23335
23336 1993-03-25 Richard Stallman <rms@gnu.org>
23337
23338 * src/output.c: entered into RCS
23339
23340 1992-09-25 Richard Stallman <rms@gnu.org>
23341
23342 * configure.bat: entered into RCS
23343
23344 1992-06-22 Richard Stallman <rms@gnu.org>
23345
23346 * src/vmsgetargs.c: entered into RCS
23347
23348 1992-06-22 Richard Stallman <rms@gnu.org>
23349
23350 * doc/bison.rnh: entered into RCS
23351
23352 1992-04-20 David J. MacKenzie <djm@gnu.org>
23353
23354 * README: entered into RCS
23355
23356 1992-01-22 Richard Stallman <rms@gnu.org>
23357
23358 * src/machine.h: entered into RCS
23359
23360 1991-12-21 Richard Stallman <rms@gnu.org>
23361
23362 * src/lalr.c, src/closure.c:
23363 entered into RCS
23364
23365 1991-12-20 Richard Stallman <rms@gnu.org>
23366
23367 * src/state.h: entered into RCS
23368
23369 1991-12-18 Richard Stallman <rms@gnu.org>
23370
23371 * src/print.c, src/nullable.c, src/derives.c:
23372 entered into RCS
23373
23374 1991-11-03 David J. MacKenzie <djm@gnu.org>
23375
23376 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
23377 entered into RCS
23378
23379 1988-09-09 Richard Stallman <rms@gnu.org>
23380
23381 * src/bison.hairy: entered into RCS
23382
23383 1987-12-16 Richard Stallman <rms@gnu.org>
23384
23385 * REFERENCES: entered into RCS
23386
23387
23388 -----
23389
23390 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
23391 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
23392 2008, 2009 Free Software Foundation, Inc.
23393
23394 Copying and distribution of this file, with or without
23395 modification, are permitted provided the copyright notice and this
23396 notice are preserved.