]> git.saurik.com Git - bison.git/blob - ChangeLog
Coding style changes.
[bison.git] / ChangeLog
1 2009-03-02 Akim Demaille <demaille@gostai.com>
2
3 Coding style changes.
4 * data/lalr1.cc (b4_symbol_constructor_declaration_)
5 (b4_symbol_constructor_declarations)
6 (b4_symbol_constructor_definition_)
7 (b4_symbol_constructor_definitions)
8 (b4_yytranslate_definition): Rename as...
9 (b4_symbol_constructor_declare_)
10 (b4_symbol_constructor_declare)
11 (b4_symbol_constructor_define_)
12 (b4_symbol_constructor_define)
13 (b4_yytranslate_define): these.
14 * data/variant.hh (b4_variant_definition): Rename as...
15 (b4_variant_define): this.
16
17 2009-03-02 Akim Demaille <demaille@gostai.com>
18
19 Factor b4_assert_if, b4_lex_symbol_if, and b4_variant_if.
20 * data/bison.m4 (b4_percent_define_if_define): New.
21 * data/c++.m4 (b4_variant_if): Move to...
22 * data/bison.m4: Here, using b4_percent_define_if_define.
23 * data/lalr1.cc (b4_assert_if, b4_lex_symbol_if): Move to...
24 * data/bison.m4: Here, using b4_percent_define_if_define.
25
26 2009-03-02 Akim Demaille <demaille@gostai.com>
27
28 Dub symbol_type_base as a public type.
29 * data/c++.m4 (b4_public_types_declare): Now define
30 symbol_type_base and symbol_type.
31 (b4_public_types_define): New.
32 In both cases, the definitions are taken verbatim from lalr1.cc.
33 * data/lalr1.cc: Adjust.
34
35 2009-03-02 Akim Demaille <demaille@gostai.com>
36
37 b4_public_types_declare.
38 * data/c++.m4 (b4_public_types_declare): New.
39 * data/glr.cc, data/lalr1.cc: Use it.
40
41 2009-03-02 Akim Demaille <demaille@gostai.com>
42
43 b4_semantic_type_declare.
44 * data/c++.m4 (b4_semantic_type_declare): New.
45 Factors and generalizes what was in glr.cc and lalr1.cc.
46 * data/variant.hh (b4_semantic_type_declare): Redefine it for
47 variants.
48 * data/lalr1.cc, data/glr.cc: Use it.
49
50 2009-02-26 Akim Demaille <demaille@gostai.com>
51
52 Upgrade gnulib.
53 * gnulib: Upgrade from master.
54 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore, m4/.gitignore:
55 Regen.
56
57 2009-02-25 Akim Demaille <demaille@gostai.com>
58
59 Remove useless arguments.
60 * data/glr.c (yy_reduce_print): $$ and @$ are not used and not
61 relevant.
62
63 2009-02-25 Akim Demaille <demaille@gostai.com>
64
65 Comment changes.
66 * data/lalr1.cc: here.
67
68 2009-02-25 Akim Demaille <demaille@gostai.com>
69
70 Fix glr.cc's debug level handling.
71 * data/glr.cc (yydebug_): Remove, as it is actually yydebug from
72 glr.c which is used.
73 (debug_level, set_debug_level): Adjust.
74
75 2009-02-25 Akim Demaille <demaille@gostai.com>
76
77 Copyright years.
78 * data/glr.c: Add 2007 and 2008 here, consistenly with the comments.
79
80 2009-02-25 Akim Demaille <demaille@gostai.com>
81
82 Style changes.
83 * etc/bench.pl.in (generate_grammar_list): Consitently use
84 location_type, not yy::location.
85
86 2009-02-25 Akim Demaille <demaille@gostai.com>
87
88 Comment change.
89 * data/lalr1.cc: here.
90
91 2009-02-19 Akim Demaille <demaille@gostai.com>
92
93 Make yyparser::error public.
94 * data/lalr1.cc: here.
95 There is no good reason to keep it private (and it is convenient
96 to use it from the scanner for instance). It is already public in
97 glr.cc.
98
99 2009-02-19 Akim Demaille <demaille@gostai.com>
100
101 Comment changes.
102 * data/glr.cc: here.
103
104 2009-02-19 Akim Demaille <demaille@gostai.com>
105
106 Remove trailing blanks.
107 The epilogue has its own ending \n, no need to add another.
108
109 * data/glr.c, data/lalr1.java, data/yacc.c: dnl when outputing the
110 epilogue.
111 * data/glr.cc: dnl when extending the epilogue.
112 Remove stray "private:".
113
114 2009-02-19 Akim Demaille <demaille@gostai.com>
115
116 Use b4_c_modern.
117 * data/c.m4 (b4_c_function_decl): Here.
118
119 2009-02-19 Akim Demaille <demaille@gostai.com>
120
121 Comment changes.
122 * data/lalr1.cc: here.
123
124 2009-02-19 Akim Demaille <demaille@gostai.com>
125
126 Extract variant.hh
127 * data/variant.hh: New, extracted from...
128 * data/lalr1.cc: here.
129 Adjust.
130 * data/local.mk: Adjust.
131
132 2009-02-19 Akim Demaille <demaille@gostai.com>
133
134 Extract stack.hh from lalr1.cc.
135 * data/stack.hh: New.
136 * data/lalr1.cc: Extract from here.
137 * data/local.mk: Adjust.
138
139 2009-02-03 Joel E. Denny <jdenny@ces.clemson.edu>
140
141 Add reminder about uploading public key to keys.gnupg.net.
142 * HACKING (Release Procedure): Here.
143
144 2009-01-28 Akim Demaille <demaille@gostai.com>
145
146 * NEWS: Update information about 2.4.1 and 2.4.2.
147
148 2008-11-04 Akim Demaille <demaille@gostai.com>
149
150 Reformat NEWS.
151 * NEWS: Use more outline-mode markup.
152 Suggested by Jim Meyering.
153
154 2009-01-08 Akim Demaille <demaille@gostai.com>
155
156 Fix grep portability issues.
157 Grep on Solaris does not support -q.
158 Reported by Summum Bonum.
159
160 * NEWS: Add a stub for 2.4.2.
161 * THANKS: Add Summum Bonum.
162 * tests/atlocal.in (EGREP): New.
163 (CC, CXX, XSLTPROC): Make it possible to override them via
164 envvars.
165 * tests/java.at: Use $EGREP instead of egrep.
166 Use AT_CHECK's ignore instead of grep's -q.
167
168 2008-12-11 Akim Demaille <demaille@gostai.com>
169
170 Pass the token type to yysyntax_error.
171 * data/yacc.c (yysyntax_error): Take the transated token instead
172 of the raw number.
173 Adjust callers.
174 * TODO: Update.
175
176 2008-12-11 Akim Demaille <demaille@gostai.com>
177
178 Formatting changes.
179 * data/glr.c: Formatting changes.
180
181 2008-12-11 Akim Demaille <demaille@gostai.com>
182
183 Propagate i18n changes into glr.c.
184 * TODO: Update.
185 * data/glr.c (yyreportSyntaxError): Use "switch" instead of
186 building the error message format dynamically.
187 * data/lalr1.java: Formatting changes.
188
189 2008-12-11 Akim Demaille <demaille@gostai.com>
190
191 Use testsuite -C.
192 * tests/local.mk: Replace "cd && testsuite" by "testsuite -C".
193 Solves problems when top_srcdir is an absolute path.
194 Suggested by Eric Blake.
195 * configure.ac: Require Autoconf 2.62.
196
197 2008-12-11 Akim Demaille <demaille@gostai.com>
198
199 Simplify the i18n of the error messages.
200 * data/lalr1.cc: Comment changes.
201 * data/yacc.c (yysyntax_error): Rewrite, using a switch as in
202 lalr1.cc instead of building dynamically the format string.
203
204 2008-12-08 Akim Demaille <demaille@gostai.com>
205
206 Fix portability issue in the test suite.
207 * tests/local.at (AT_MATCHES_CHECK): New.
208 Based on Perl instead of Sed. Sed has too many portability
209 pitfalls, not ever Sed is GNU Sed.
210 * tests/actions.at (Fix user actions without a trailing semicolon):
211 Use it.
212
213 2008-12-08 Akim Demaille <demaille@gostai.com>
214
215 Update data/README.
216 * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
217
218 2008-12-08 Akim Demaille <demaille@gostai.com>
219
220 Install autoconf as a submodule to get m4sugar.
221 * .gitmodules: Add submodules/autoconf.
222 * data/m4sugar/foreach.m4, data/m4sugar/m4sugar.m4: Now links into
223 submodules/autoconf.
224
225 2008-12-08 Akim Demaille <demaille@gostai.com>
226
227 Test token.prefix in all the skeletons.
228 * data/java.m4 (b4_token_enum): Use the token.prefix.
229 * tests/local.at (AT_BISON_OPTION_PUSHDEFS): Define AT_TOKEN_PREFIX.
230 * tests/calc.at (_AT_DATA_CALC_Y): Use it.
231 Add checks for yacc.c, glr.c, lalr1.cc and glr.cc.
232 * tests/java.at: Comment changes.
233 (AT_CHECK_JAVA_MINIMAL): Define the END token.
234 (Java parser class and package names): Add token.prefix check.
235
236 2008-12-08 Akim Demaille <demaille@gostai.com>
237
238 Fix regeneration of atconfig.
239 * tests/local.mk (tests/atconfig): The rule was incorrect, but
240 remove it: now that there is no tests/Makefile.am, the top-level
241 Makefile properly updates atconfig when needed.
242
243 2008-12-07 Di-an Jan <dianj@freeshell.org>
244
245 Implement the FIXME that ends an user action with a semicolon
246 if it seems necessary.
247 * src/scan-code.l (flex rules section): Flag cpp directive from
248 any `#' to the first unescaped end-of-line. Semicolon is not
249 needed after `;', `{', '}', or cpp directives and is needed after
250 any other token (whitespaces and comments have no effect).
251 * tests/actions.at (Fix user actions without a trailing semicolon):
252 New test.
253 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to
254 to make user actions complete statements.
255 Adjust column numbers in error messages.
256 * tests/regression.at (Fix user actions without a trailing semicolon):
257 Remove. Covered by new test.
258
259 2008-12-07 Akim Demaille <demaille@gostai.com>
260
261 Update gnulib.
262 * gnulib: Update from master.
263
264 2008-12-05 Eric Blake <ebb9@byu.net>
265
266 Avoid compiler warning.
267 * src/output.c (muscle_insert_item_number_table): Delete unused
268 function.
269
270 2008-12-02 Eric Blake <ebb9@byu.net>
271
272 Build testsuite with newer autoconf.
273 * tests/output.at (m4_expand): Don't override in newer autoconf,
274 where the underlying implementation changed.
275 * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
276 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
277 (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
278 (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
279 since some of them contain unbalanced ')'.
280
281 2008-12-01 Akim Demaille <demaille@gostai.com>
282
283 Use b4_symbol for printers and destructors everywhere.
284 * data/bison.m4 (b4_symbol_action_location): New.
285 * data/c.m4 (b4_symbol_actions): Remove.
286 Adjust all callers to use by b4_symbol_foreach and the corresponding
287 b4_symbol_printer/destructor macro.
288 * data/glr.cc: Adjust.
289 * data/lalr1.java: Adjust the %destructor sanity check.
290 * src/output.c (symbol_code_props_output): Remove, we no longer
291 need the b4_symbol_printers/destructors tables.
292
293 2008-12-01 Akim Demaille <demaille@gostai.com>
294
295 Use b4_symbol_case_.
296 * data/lalr1.cc, data/bison.m4 (b4_symbol_action): Use
297 b4_symbol_case_.
298
299 2008-12-01 Akim Demaille <demaille@gostai.com>
300
301 Move b4_symbol based macro to bison.m4.
302 * data/lalr1.cc (b4_symbol_, b4_symbol, b4_symbol_if)
303 (b4_symbol_action, b4_symbol_destructor, b4_symbol_printer)
304 (b4_symbol_case_, b4_symbol_foreach, b4_type_action_)
305 (b4_type_foreach): Move to...
306 * data/bison.m4: Here.
307 * data/lalr1.cc (b4_symbol_action): Specialize for C++: use
308 b4_symbol_value_template instead of b4_symbol_value.
309
310 2008-12-01 Akim Demaille <demaille@gostai.com>
311
312 b4_symbol/type_foreach.
313 * data/lalr1.cc (b4_symbol_foreach, b4_type_foreach): New.
314 Use them.
315
316 2008-12-01 Akim Demaille <demaille@gostai.com>
317
318 Use the symbol properties to output the printer/destructor for lalr1.cc.
319 Instead of defining complex list of tuples to define various
320 properties of the symbols, we now prefer to define symbols as
321 "structs" in m4: using the symbol key (its number), and the
322 property name, b4_symbol gives it value. Use this to handle
323 destructors and printers.
324
325 * src/output.c (CODE_PROP): New.
326 (prepare_symbol_definitions): Use it to define the printer and
327 destructor related attributes of the symbols.
328 * data/lalr1.cc (b4_symbol_actions): Rename as...
329 (b4_symbol_action): this.
330 Use b4_symbol instead of 6 arguments.
331 (b4_symbol_printer, b4_symbol_destructor): New.
332 Use them instead of b4_symbol_actions.
333
334 2008-12-01 Akim Demaille <demaille@gostai.com>
335
336 Avoid capturing variables too easily.
337 * src/muscle_tab.h (MUSCLE_INSERT_BOOL, MUSCLE_OBSTACK_SGROW): Use
338 v__ and p__ instead of v and p.
339
340 2008-12-01 Akim Demaille <demaille@gostai.com>
341
342 Remove spurious empty line before syncline.
343 * data/bison.m4 (b4_syncline): Don't output an empty line before
344 the output.
345
346 2008-11-26 Akim Demaille <demaille@gostai.com>
347
348 Convert lib/Makefile.am into lib/local.mk.
349 The real problem is rather gnulib.mk, which itself is extracted
350 from a Makefile.am that gnulib expects to the "recursive". The
351 tool prefix-gnulib-mk converts such a gnulib.mk to be
352 non-recursive. Also, some AC_SUBST variables need to be adjusted.
353
354 * etc/prefix-gnulib-mk: New.
355 * bootstrap (slurp): Use it to convert further gnulib.mk.
356 No longer try to avoid re-creation of lib/gnulib.mk as the changes
357 are deeper.
358 * lib/Makefile.am: Rename as...
359 * lib/local.mk: this.
360 Adjust to be prefixed.
361 * Makefile.am, configure.ac: Adjust.
362 * src/local.mk (AM_CPPFLAGS): Extend it, don't define it.
363
364 2008-11-26 Akim Demaille <demaille@gostai.com>
365
366 s/_FLAGS/FLAGS/.
367 * tests/local.mk (TESTSUITE_FLAGS, AUTOTEST_FLAGS): Rename as...
368 (TESTSUITEFLAGS, AUTOTESTFLAGS): these to compy with the GCS.
369 Reported by Eric Blake.
370
371 2008-11-26 Akim Demaille <demaille@gostai.com>
372
373 Use b4_parser_tables_define in glr.cc.
374 * data/glr.c: Use b4_parser_tables_define instead of defining the
375 (deterministic integral) tables by hand.
376
377 2008-11-26 Akim Demaille <demaille@gostai.com>
378
379 Use b4_parser_tables_define in Java.
380 * data/java.m4 (b4_typed_parser_table): Rename as...
381 (b4_typed_parser_table_define): this, for consistency.
382 Accept a comment as $4.
383 Move $2 into yy*_.
384 (b4_integral_parser_table): Rename as...
385 (b4_integral_parser_table_define): this.
386 * data/lalr1.java: Adjust all uses.
387 Use b4_parser_tables_define instead of generation by hand.
388
389 2008-11-26 Akim Demaille <demaille@gostai.com>
390
391 Prepare the convergence bw C style and Java table generation.
392 * data/bison.m4 (b4_tables_map, b4_tables_declare)
393 (b4_tables_define): Rename as...
394 (b4_integral_parser_tables_map, b4_parser_tables_declare)
395 (b4_parser_tables_define): these.
396 * data/c.m4 (b4_table_define): Rename as...
397 (b4_integral_parser_table_define): this.
398 * data/lalr1.cc: Adjust.
399 (b4_table_define, b4_table_declare): Rename as...
400 (b4_integral_parser_table_define)
401 (b4_integral_parser_table_declare): these.
402 (yyrline_): Move the comment where it is actually used.
403 * data/yacc.c: Adjust.
404 (yyrline): Use b4_integral_parser_table_define.
405
406 2008-11-26 Akim Demaille <demaille@gostai.com>
407
408 Regen.
409 * src/parse-gram.h, src/parse-gram.c: Regen.
410
411 2008-11-26 Akim Demaille <demaille@gostai.com>
412
413 Factor the generation of the (integral) tables bw yacc.c and lalr1.cc.
414 * data/lalr1.cc (b4_tables_map): Move to...
415 * data/bison.m4: here.
416 Update the comment for yytable during the flight.
417 (b4_tables_declare, b4_tables_define): New.
418 * data/lalr1.cc: Use them.
419 * data/c.m4 (b4_table_define): New.
420 * data/yacc.c: Use b4_tables_define instead of output the tables
421 by hand.
422 * tests/regression.at (Web2c Actions): Adjust the expected output,
423 the order of the tables changed.
424
425 2008-11-26 Akim Demaille <demaille@gostai.com>
426
427 Get rid of (yy)rhs and (yy)prhs.
428 These tables are no longer needed in the parsers, and they don't seem to
429 be useful. They are not documented either.
430
431 * src/output.c (prepare_rules): Get rid of rhs and prhs.
432 Adjust the computation of (yy)r2.
433
434 2008-11-26 Akim Demaille <demaille@gostai.com>
435
436 Rule length is unsigned.
437 * src/gram.h, src/gram.c (rule_rhs_length): Return a size_t.
438
439 2008-11-26 Akim Demaille <demaille@gostai.com>
440
441 Get rid of lalr1-split.cc.
442 It was no longer maintainer.
443
444 * data/lalr1-split.cc: Remove.
445 * etc/bench.pl.in (bench_fusion_parser): Remove.
446 Adjust.
447
448 2008-11-26 Akim Demaille <demaille@gostai.com>
449
450 Use yy* consistently.
451 * data/glr.c: Now that yyrhs no longer exists as a global
452 variable, rename local "rhs" variables into "yyrhs" for
453 consistency.
454
455 2008-11-25 Akim Demaille <demaille@gostai.com>
456
457 Get rid of yyrhs and yyprhs in glr.c.
458 * data/glr.c (yyrhs, yyprhs): Remove.
459 Instead, use the state stack and yystos.
460
461 2008-11-25 Akim Demaille <demaille@gostai.com>
462
463 Flag glr tests.
464 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): If glr, declare it
465 as an Autotest keyword.
466
467 2008-11-25 Akim Demaille <demaille@gostai.com>
468
469 Prefer TESTSUITE_FLAGS.
470 TESTSUITEFLAGS is barely readable.
471
472 * tests/local.mk (TESTSUITE_FLAGS): Default to $(TESTSUITEFLAGS)
473 for backward compatibility.
474 Use the former instead of the latter.
475
476 2008-11-25 Akim Demaille <demaille@gostai.com>
477
478 Get rid of yyrhs and yyprhs in larl1.java.
479 * data/lalr1.java (yyrhs_, yyprhs_): Remove.
480 (yy_reduce_print): Rather, use yystos_ and the state stack.
481
482 2008-11-25 Akim Demaille <demaille@gostai.com>
483
484 Formatting changes.
485
486 2008-11-25 Akim Demaille <demaille@gostai.com>
487
488 Get rid of yyrhs and yyprhs in yacc.c.
489 They were used to get the symbol types, given a rule number, when
490 displaying the top of the stack before a reduction. But the
491 symbol type is available from the state stack. This has two be
492 benefits: two tables less in the parser (making it smaller), and a
493 more consistent use of the three stacks which will help to fuse
494 them.
495
496 * data/yacc.c (yyprhs, yyrhs): Remove.
497 (YY_REDUCE_PRINT): Pass yyssp to yy_reduce_print.
498 (yy_reduce_print): Take yyssp as argument.
499 Use it, together with yystos, to get the symbol type.
500 * tests/regression.at (Web2c Report): Remove these tables from the
501 expected output.
502
503 2008-11-25 Akim Demaille <demaille@gostai.com>
504
505 b4_tables_map.
506 The point is to factor the generation of the tables across skeletons.
507 This is language dependant.
508
509 * data/c.m4 (b4_comment_): New.
510 Should be usable to define how to generate tables independently of
511 the language.
512 (b4_c_comment): New.
513 (b4_comment): Bounce to b4_c_comment.
514 Now support $2 = [PREFIX] for indentation.
515 * data/lalr1.cc (b4_table_declare): Don't output a comment if
516 there is no comment.
517 Indent it properly when there is one.
518 Output the ending semicolon.
519 (b4_table_define): Space changes.
520 Output the ending semicolon.
521 (b4_tables_map): New.
522 Use it twice instead of declaring and defining the (integral)
523 tables by hand.
524
525 2008-11-25 Akim Demaille <demaille@gostai.com>
526
527 b4_table_declare.
528 * data/lalr1.cc (b4_table_declare): New.
529 Use it to declare the tables defined with b4_table_define.
530 (b4_table_define): Declare a third arg to match b4_table_declare
531 signature.
532 Move all the comments around invocations of b4_table_define into
533 the invocations itselves.
534 Move things around to have the order for declarations and
535 definitions.
536
537 2008-11-25 Akim Demaille <demaille@gostai.com>
538
539 Formatting changes.
540 * data/lalr1.java: here.
541
542 2008-11-25 Akim Demaille <demaille@gostai.com>
543
544 b4_args is more general than only C++.
545 * data/lalr1.cc (b4_args, _b4_args): Move to...
546 * data/bison.m4: here.
547
548 2008-11-21 Di-an Jan <dianj@freeshell.org>
549
550 Implement no-XXX arguments for --warnings, --report, --trace.
551 * src/getargs.c (flags_argmatch): Handles no-XXX.
552 Fix typo in doxygen comment.
553
554 2008-11-21 Akim Demaille <demaille@gostai.com>
555
556 Display the changes in cross-options.texi.
557 * build-aux/cross-options.pl ($sep): New, to separate items.
558 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Use diff to display the
559 changes.
560
561 2008-11-20 Di-an Jan <dianj@freeshell.org>
562
563 Improves options in the manual.
564 * doc/bison.texinfo (-g, -x): Add space before argument.
565 (Option Cross Key): Implement FIXME: listing directives also.
566 * build-aux/cross-options.pl: Read from <STDIN> rather than <>.
567 (Short Option): Special case -d. Put arguments inside @option.
568 (Bison Directive): Add column, automatically extracted from
569 src/scan-gram.l (actual name passed as the first argument)
570 with special case for %define.
571 * doc/local.mk (doc/cross-options.texi): Pass src/scan-gram.l
572 to build-aux/cross-options.pl.
573 * src/getargs.c (usage): Document limitations of cross-options.pl.
574 * src/scan-gram.l: Likewise.
575
576 2008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
577
578 Fix unexpanded macros in GLR defines file.
579 Reported by Csaba Raduly at
580 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
581 * THANKS (Csaba Raduly): Add.
582 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
583 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
584 lexer in a separate module that includes the defines file.
585 (AT_CHECK_CALC): From AT_FULL_COMPILE, request compilation of lexer
586 source.
587 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
588 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
589 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
590 (AT_DATA_SOURCE_PROLOGUE): New.
591 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
592 (AT_DATA_SOURCE): New.
593 (AT_FULL_COMPILE): Extend to support an additional source file.
594
595 2008-11-18 Akim Demaille <demaille@gostai.com>
596
597 More TODO.
598 * TODO: More short term issues.
599
600 2008-11-18 Akim Demaille <demaille@gostai.com>
601
602 Regen.
603 * src/parse-gram.h, src/parse-gram.c: Regen.
604
605 2008-11-18 Akim Demaille <demaille@gostai.com>
606
607 Use b4_subtract where possible.
608 * data/lalr1.cc (b4_subtract): Move to...
609 * data/bison.m4: here.
610 * data/glr.c (b4_rhs_data): Use it.
611 * data/yacc.c (b4_rhs_value, b4_rhs_location): Use it.
612
613 2008-11-18 Akim Demaille <demaille@gostai.com>
614
615 Remove incorrect mode specification.
616 * data/glr.cc: Don't pretend it's C code.
617
618 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
619
620 Simplify last patch slightly.
621 * src/getargs.c (getargs): Here.
622
623 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
624
625 Fix last warning from --enable-gcc-warnings.
626 * src/getargs.c (getargs): Don't assign const address to non-const
627 pointer.
628
629 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
630
631 Don't let maintainer-*-check targets force a version update.
632 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
633 handled.
634
635 2008-11-17 Di-an Jan <dianj@freeshell.org>
636
637 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
638 Align menus. Adjust word wrapping. Use node names for menu names.
639 (Examples): Don't abbreviate node names.
640 (LocalWords): Remove abbreviations.
641 (Copying): Make description a sentence.
642 (Java Action Features): Remove period to match the rest of menu.
643
644 2008-11-17 Di-an Jan <dianj@freeshell.org>
645
646 Handles several --enable-gcc-warnings.
647 * src/getargs.c (command_line_location): Set parameters to void.
648 * src/output.c (symbol_type_name_cmp): Make static.
649 (symbols_by_type_name): Set parameters to void.
650 (symbol_definitions_output): Remove unused parameter. Rename as...
651 (prepare_symbol_definitions): this.
652 (muscles_output): Move symbol_definitions_output to...
653 (output): here as prepare_symbol_definitions.
654 * tests/c++.at (AT_CHECK_VARIANTS): Remove unused parameters of main.
655 (AT_CHECK_NAMESPACE): Make unused parameter lloc unnamed.
656
657 2008-11-17 Di-an Jan <dianj@freeshell.org>
658
659 * tests/c++.at (AT_CHECK_VARIANTS): Fixes tests 198-202.
660 Use AT_DATA_GRAMMAR instead of AT_DATA for compiled tests.
661
662 2008-11-16 Akim Demaille <demaille@gostai.com>
663
664 Add missing $(EXEEXT).
665 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): The target is
666 "src/bison$(EXEEXT)".
667 Reported by Di-an Jan.
668
669 2008-11-15 Akim Demaille <demaille@gostai.com>
670
671 * TODO: Update.
672
673 2008-11-15 Akim Demaille <demaille@gostai.com>
674
675 Formatting changes.
676 * tests/input.at: here.
677
678 2008-11-15 Akim Demaille <demaille@gostai.com>
679
680 Remove duplicate header inclusion.
681 * src/LR0.c: here.
682
683 2008-11-15 Akim Demaille <demaille@gostai.com>
684
685 * src/parse-gram.h, src/parse-gram.c: Regen.
686
687 2008-11-15 Akim Demaille <demaille@gostai.com>
688
689 Support parametric types.
690
691 There are two issues to handle: first scanning nested angle
692 bracket pairs to support types such as std::pair< std::string,
693 std::list<std::string> > >.
694
695 Another issue is to address idiosyncracies of C++: do not glue two
696 closing angle brackets together (otherwise it's operator>>), and
697 avoid sticking blindly a TYPE to the opening <, as it can result
698 in '<:' which is a digraph for '['.
699
700 * src/scan-gram.l (brace_level): Rename as...
701 (nesting): this.
702 (SC_TAG): New.
703 Implement support for complex tags.
704 (tag): Accept
705 , but not <.
706 * data/lalr1.cc (b4_symbol_value, b4_symbol_value_template)
707 (b4_symbol_variant): Leave space around types as parameters.
708 * examples/variant.yy: Use nested template types and leading ::.
709 * src/parse-gram.y (TYPE, TYPE_TAG_ANY, TYPE_TAG_NONE, type.opt):
710 Rename as...
711 (TAG, TAG_ANY, TAG_NONE, tag.opt): these.
712 * tests/c++.at: Test parametric types.
713
714 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
715
716 Test token.prefix.
717 This is not sufficient, but we test at least that the make_SYMBOL
718 interface is not affected by token.prefix. A more general test
719 will be implemented when the support of token.prefix is generalized
720 to more skeletons.
721
722 * tests/c++.at: One more variant test, using token.prefix.
723
724 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
725
726 Test the make_TOKEN interface.
727 * tests/c++.at (AT_CHECK_VARIANTS): Require and use locations.
728 Factor the common code in yylex.
729 Use it to test "%define lex_symbol".
730
731 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
732
733 Formatting change.
734
735 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
736
737 Simplify code for variants bench marks.
738 * etc/bench.pl.in (&generate_grammar_list): Define and use
739 location_type.
740 Factor the common code in yylex.
741
742 2008-11-15 Akim Demaille <demaille@gostai.com>
743
744 Better error message.
745 * bootstrap (find_tool): Fix the error message.
746
747 2008-11-15 Akim Demaille <demaille@gostai.com>
748
749 Update variant.yy to newest interface.
750 * examples/variant.yy: Define lex_symbol.
751 Adjust.
752
753 2008-11-15 Akim Demaille <demaille@gostai.com>
754
755 Don't use locations in variant.yy.
756 * examples/variant.yy: Adjust to not using locations.
757
758 2008-11-15 Akim Demaille <demaille@gostai.com>
759
760 Comment changes.
761 * data/local.mk, etc/local.mk, examples/local.mk: Use Automake
762 comments for the license.
763
764 2008-11-15 Akim Demaille <demaille@gostai.com>
765
766 Remove tests/Makefile.am.
767 * tests/Makefile.am: Rename as...
768 * tests/local.mk: this.
769 * Makefile.am, configure.ac: Adjust.
770 * Makefile.am (DISTCLEANFILES): Define.
771 (maintainer-check, maintainer-xml-check, maintainer-push-check):
772 Remove, we no longer need to bounce to the real targets.
773
774 2008-11-15 Akim Demaille <demaille@gostai.com>
775
776 Comment changes.
777
778 2008-11-15 Akim Demaille <demaille@gostai.com>
779
780 djgpp/local.mk.
781 * Makefile.am (EXTRA_DIST): Move djgpp related part to...
782 * djgpp/local.mk: this new file.
783
784 2008-11-15 Akim Demaille <demaille@gostai.com>
785
786 Remove doc/Makefile.am.
787 * doc/Makefile.am: Rename as...
788 * doc/local.mk: this.
789 Adjust paths
790 * Makefile.am, configure.ac: Adjust.
791 * Makefile.am (MOSTLYCLEANFILES): New.
792 * src/local.mk: Adjust.
793
794 2008-11-15 Akim Demaille <demaille@gostai.com>
795
796 Move sc_tight_scope into maint.mk.
797 It does not work, and I don't know how it was supposed to work: it
798 seems to be looking for sources in the build tree. I just moved
799 it at a better place, fixing it is still required.
800
801 * src/local.mk (echo): Remove.
802 (sc_tight_scope): Move to...
803 * maint.mk: here.
804
805 2008-11-15 Akim Demaille <demaille@gostai.com>
806
807 Regen.
808 * src/parse-gram.h, src/parse-gram.h: Regen.
809
810 2008-11-15 Akim Demaille <demaille@gostai.com>
811
812 Remove src/Makefile.am.
813 * src/Makefile.am: Rename as...
814 * src/local.mk: this.
815 Prefix all the paths with src/.
816 (AUTOMAKE_OPTIONS): Build object files in the sub dirs.
817 (AM_CPPFLAGS): Find find in builddir/src.
818 (YACC): Move the flags into...
819 (AM_YFLAGS): here.
820 * maint.mk (sc_tight_scope): Disable.
821 It used to bounce to the version in src/Makefile.am which is now
822 part of this very Makefile.
823 * Makefile.am, configure.ac: Adjust.
824 * src/scan-code-c.c, src/scan-code.l: We can no longer rely on
825 include "..." to find files "here": we are no longer in src/, so
826 qualify the includes with src/.
827 * doc/Makefile.am (PREPATH): No longer include the top_builddir
828 prefix.
829 (.x.1): Adjust to be able to create src/foo from the top level
830 Makefile, instead of going bounce to src/Makefile the creation of
831 foo.
832
833 2008-11-15 Akim Demaille <demaille@gostai.com>
834
835 Remove useless variable.
836 * doc/Makefile.am (srcsrcdir): Remove.
837
838 2008-11-15 Akim Demaille <demaille@gostai.com>
839
840 Remove data/Makefile.am.
841 * data/Makefile.am: Rename as...
842 * data/local.mk: this.
843 Adjust paths.
844 * Makefile.am, configure.ac: Adjust.
845
846 2008-11-15 Akim Demaille <demaille@gostai.com>
847
848 Remove etc/Makefile.am.
849 * etc/Makefile.am: Rename as...
850 * etc/local.mk: this.
851 Adjust.
852 * Makefile.am, configure.ac: Adjust.
853
854 2008-11-15 Akim Demaille <demaille@gostai.com>
855
856 Remove examples/local.mk.
857 examples/calc++/Makefile.am might be interesting to keep as is, since
858 it is an example in itself.
859
860 * examples/Makefile.am: Rename as...
861 * examples/local.mk: this.
862 Adjust.
863 * Makefile.am, configure.ac: Adjust.
864
865 2008-11-15 Akim Demaille <demaille@gostai.com>
866
867 Remove build-aux/Makefile.am.
868 Recursive Makefiles are really way too slow, let's get rid of some of
869 them.
870
871 * build-aux/Makefile.am: Rename as...
872 * build-aux/local.mk: this.
873 Adjust paths.
874 * Makefile.am, configure.ac: Adjust.
875
876 2008-11-15 Akim Demaille <demaille@gostai.com>
877
878 Provide convenience constructors for locations and positions.
879 * data/location.cc (position::position): Accept file, line and
880 column as arguments with default values.
881 Always qualify initial line and column literals as unsigned.
882 (location::location): Provide convenience constructors.
883
884 2008-11-15 Akim Demaille <demaille@gostai.com>
885
886 Instead of using make_symbol<TOK_FOO>, generate make_FOO for each
887 token type.
888 Using template buys us nothing, and makes it uselessly complex to
889 construct a symbol. Besides, it could not be generalized to other
890 languages, while make_FOO would work in C/Java etc.
891
892 * data/lalr1.cc (b4_symbol_): New.
893 (b4_symbol): Use it.
894 (b4_symbol_constructor_declaration_)
895 (b4_symbol_constructor_definition_): Instead of generating
896 specializations of an overloaded template function, just generate
897 several functions whose names are forged from the token names
898 without the token.prefix.
899 (b4_symbol_constructor_declarations): Generate them for all the
900 symbols, not just by class of symbol type, now that instead of
901 specializing a function template by the token, we generate a
902 function named after the token.
903 (b4_symbol_constructor_specialization_)
904 (b4_symbol_constructor_specializations): Remove.
905 * etc/bench.pl.in: Adjust to this new API.
906
907 2008-11-13 Akim Demaille <demaille@gostai.com>
908
909 %define token.prefix.
910 Provide a means to add a prefix to the name of the tokens as
911 output in the generated files. Because of name clashes, it is
912 good to have such a prefix such as TOK_ that protects from names
913 such as EOF, FILE etc. But it clutters the grammar itself.
914
915 * data/bison.m4 (token.prefix): Empty by default.
916 * data/c.m4 (b4_token_enum, b4_token_define): Use it.
917 * data/lalr1.cc (b4_symbol): Ditto.
918
919 2008-11-13 Akim Demaille <demaille@gostai.com>
920
921 Compute at M4 time some of the subtractions.
922 * data/lalr1.cc (b4_subtract): New.
923 (b4_rhs_data): Use it.
924
925 2008-11-13 Akim Demaille <demaille@gostai.com>
926
927 symbol::token.
928 This allows the user to get the type of a token returned by yylex.
929
930 * data/lalr1.cc (symbol::token): New.
931 (yytoknum_): Define when %define lex_symbol, independently of
932 %debug.
933 (yytoken_number_): Move into...
934 (symbol::token): here, since that's the only use.
935 The other one is YYPRINT which was not officially supported
936 by lalr1.cc, and anyway it did not work since YYPRINT uses this
937 array under a different name (yytoknum).
938
939 2008-11-13 Akim Demaille <demaille@gostai.com>
940
941 YYERRCODE.
942 * TODO (YYERRCODE): Mention the case of $undef.
943
944 2008-11-13 Akim Demaille <demaille@gostai.com>
945
946 TODO: YYPRINT.
947 * TODO (YYPRINT): New.
948
949 2008-11-13 Akim Demaille <demaille@gostai.com>
950
951 Comment changes.
952 * data/lalr1.cc, data/yacc.c: Fix the description of the
953 yytranslate and yytoknum tables.
954
955 2008-11-13 Akim Demaille <demaille@gostai.com>
956
957 Define make_symbol in the header.
958 To reach good performances these functions should be inlined (yet
959 this is to measure precisely). To this end they must be available
960 to the caller.
961
962 * data/lalr1.cc (b4_symbol_constructor_definition_): Qualify
963 location_type with the class name.
964 Since will now be output in the header, declare "inline".
965 No longer use b4_symbol_constructor_specializations, but
966 b4_symbol_constructor_definitions in the header.
967 Don't call it in the *.cc file.
968
969 2008-11-13 Akim Demaille <demaille@gostai.com>
970
971 Define yytranslate in the header for lex_symbol.
972 * data/lalr1.cc: Move the invocation of b4_yytranslate_definition
973 into the header file when using %define lex_symbol.
974 (yytranslate_): Declare inline.
975
976 2008-11-13 Akim Demaille <demaille@gostai.com>
977
978 Define the constructors of symbol_type in
979 b4_symbol_constructor_definitions.
980 The constructors are called by the make_symbol functions, which a
981 forthcoming patch will move elsewhere. Hence the interest of
982 putting them together.
983
984 The stack_symbol_type does not need to be moved, it is used only
985 by the parser.
986
987 * data/lalr1.cc: Move symbol_type and symbol_base_type
988 constructors into...
989 (b4_symbol_constructor_definitions): here.
990 Adjust.
991
992 2008-11-13 Akim Demaille <demaille@gostai.com>
993
994 Make it easier to move the definition of yytranslate_.
995 Forthcoming changes will make it possible to use yytranslate_
996 from outside the parser implementation file.
997
998 * data/lalr1.cc (b4_yytranslate_definition): New.
999 Use it.
1000
1001 2008-11-13 Akim Demaille <demaille@gostai.com>
1002
1003 Remove useless class specification.
1004 * data/lalr1.cc (b4_symbol_constructor_specialization_): No need
1005 to refer to the class name to use a type defined by the class for
1006 arguments of member functions.
1007
1008 2008-11-13 Akim Demaille <demaille@gostai.com>
1009
1010 Finer input type for yytranslate.
1011 This patch is debatable: the tradition expects yylex to return an int
1012 which happens to correspond to token_number (which is an enum). This
1013 allows for instance to return characters (such as '*' etc.). But this
1014 goes against the stronger typing I am trying to have with the new
1015 lex interface which return a symbol_type. So in this case, feed
1016 yytranslate_ with a token_type.
1017
1018 * data/lalr1.cc (yytranslate_): When in %define lex-symbol,
1019 expect a token_type.
1020
1021 2008-11-13 Akim Demaille <demaille@gostai.com>
1022
1023 Honor lex-params in %define lex_symbol mode.
1024 * data/lalr1.cc: Use b4_lex_param.
1025
1026 2008-11-13 Akim Demaille <demaille@gostai.com>
1027
1028 Simplify names.
1029 * src/output.c (symbol_definitions_output): Rename symbol
1030 attributes type_name and has_type_name as type and has_type.
1031 * data/lalr1.cc: Adjust uses.
1032
1033 2008-11-13 Akim Demaille <demaille@gostai.com>
1034
1035 Use b4_type_names for the union type.
1036 The union used to compute the size of the variant used to iterate
1037 over the type of all the symbols, with a lot of redundancy. Now
1038 iterate over the lists of symbols having the same type-name.
1039
1040 * data/lalr1.cc (b4_char_sizeof_): New.
1041 (b4_char_sizeof): Use it.
1042 Adjust to be called with a list of numbers instead of a single
1043 number.
1044 Adjust its caller for new-line issues.
1045
1046 2008-11-13 Akim Demaille <demaille@gostai.com>
1047
1048 Define the "identifier" of a symbol.
1049 Symbols may have several string representations, for instance if
1050 they have an alias. What I call its "id" is a string that can be
1051 used as an identifier. May not exist.
1052
1053 Currently the symbols which have the "tag_is_id" flag set are
1054 those that don't have an alias. Look harder for the id.
1055
1056 * src/output.c (is_identifier): Move to...
1057 * src/symtab.c (is_identifier): here.
1058 * src/symtab.h, src/symtab.c (symbol_id_get): New.
1059 * src/output.c (symbol_definitions_output): Use it to define "id"
1060 and "has_id".
1061 Remove the definition of "tag_is_id".
1062 * data/lalr1.cc: Use the "id" and "has_id" whereever "tag" and
1063 "tag_is_id" were used to produce code.
1064 We still use "tag" for documentation.
1065
1066 2008-11-11 Akim Demaille <demaille@gostai.com>
1067
1068 Locations are no longer required by lalr1.cc.
1069 * data/lalr1.cc (_b4_args, b4_args): New.
1070 Adjust all uses of locations to make them optional.
1071 * tests/c++.at (AT_CHECK_VARIANTS): No longer use the locations.
1072 (AT_CHECK_NAMESPACE): Check the use of locations.
1073 * tests/calc.at (_AT_DATA_CALC_Y): Adjust to be usable with or
1074 without locations with lalr1.cc.
1075 Test these cases.
1076 * tests/output.at: Check lalr1.cc with and without location
1077 support.
1078 * tests/regression.at (_AT_DATA_EXPECT2_Y, _AT_DATA_DANCER_Y):
1079 Don't use locations.
1080
1081 2008-11-11 Akim Demaille <demaille@gostai.com>
1082
1083 AT_FULL_COMPILE.
1084 * tests/local.at (AT_FULL_COMPILE): New.
1085 * tests/actions.at, tests/calc.at, tests/regression.at: Use it.
1086
1087 2008-11-11 Akim Demaille <demaille@gostai.com>
1088
1089 Support parens in calc++.
1090 * doc/bison.texinfo (Calc++ Scanner, Calc++ Parser): Support parens.
1091 * examples/calc++/test (run): Check the expected output.
1092 Adjust callers.
1093 Check parens too.
1094
1095 2008-11-11 Akim Demaille <demaille@gostai.com>
1096
1097 Simplify lalr1.cc since %defines is mandatory.
1098 * data/lalr1.cc: Remove useless calls to b4_defines_if.
1099
1100 2008-11-11 Akim Demaille <demaille@gostai.com>
1101
1102 TODO: yyfmt.
1103 * TODO (yysyntax_error): New item.
1104
1105 2008-11-11 Akim Demaille <demaille@gostai.com>
1106
1107 Prefer M4 to CPP.
1108 * data/lalr1.cc: Use b4_error_verbose_if instead of #if
1109 YYERROR_VERBOSE.
1110
1111 2008-11-11 Akim Demaille <demaille@gostai.com>
1112
1113 Support i18n of the parse error messages.
1114 * TODO (lalr1.cc/I18n): Remove.
1115 * data/lalr1.cc (yysyntax_error_): Support the translation of the
1116 error messages, as done in yacc.c.
1117 Stay within the yy* pseudo namespace.
1118
1119 2008-11-11 Akim Demaille <demaille@gostai.com>
1120
1121 More TODO.
1122 * TODO (single stack, yysyntax_error): New.
1123
1124 2008-11-11 Akim Demaille <demaille@gostai.com>
1125
1126 Make it possible to return a symbol_type from yylex.
1127 * data/lalr1.cc (b4_lex_symbol_if): New.
1128 (parse): When lex_symbol is defined, expected yylex to return the
1129 complete lookahead.
1130 * etc/bench.pl.in (generate_grammar_list): Extend to support this
1131 yylex interface.
1132 (bench_variant_parser): Exercise it.
1133
1134 2008-11-11 Akim Demaille <demaille@gostai.com>
1135
1136 Remove useless bench case.
1137 * etc/bench.pl.in (bench_variant_parser): VARIANT_DESTROY is
1138 no longer used.
1139
1140 2008-11-11 Akim Demaille <demaille@gostai.com>
1141
1142 Improve display of directives.
1143 * etc/bench.pl.in (parse_term): Don't add useless eol.
1144
1145 2008-11-11 Akim Demaille <demaille@gostai.com>
1146
1147 Use string_cast in the bench.
1148 * etc/bench.pl.in (generate_grammar_list): Define and use
1149 string_cast.
1150
1151 2008-11-11 Akim Demaille <demaille@gostai.com>
1152
1153 Replace yychar with a Boolean.
1154 * data/lalr1.cc (parse::yychar): Replace by...
1155 (parse::yyempty): this.
1156
1157 2008-11-11 Akim Demaille <demaille@gostai.com>
1158
1159 Factor the tables.
1160 * TODO: New item.
1161
1162 2008-11-11 Akim Demaille <demaille@gostai.com>
1163
1164 Let yytranslate handle the eof case.
1165 * data/lalr1.cc (yytranslate_): Handle the EOF case.
1166 Adjust callers.
1167 No longer expect yychar to be equal to yyeof_, rather, test the
1168 lookahead's (translated) kind.
1169
1170 2008-11-11 Akim Demaille <demaille@gostai.com>
1171
1172 yychar cannot be empty in yyerrlab.
1173 * TODO (yychar == yyempty_): New.
1174 * data/lalr1.cc: Remove the handling of this case.
1175 This eases forthcoming changes related to yychar and yytranslate.
1176
1177 2008-11-11 Akim Demaille <demaille@gostai.com>
1178
1179 Bench: syntactic sugar for %define/#define.
1180 * etc/bench.pl.in (parse_dirs): Support %d and #d with arguments.
1181 (&bench_push_parser, bench_variant_parser): Use this feature.
1182 (&eat): New.
1183 Use it.
1184
1185 2008-11-11 Akim Demaille <demaille@gostai.com>
1186
1187 Less memory pressure on the "list" bench.
1188 * etc/bench.pl.in (generate_grammar_list): Do not accumulate all
1189 the values, to limit memory pressure.
1190
1191 2008-11-11 Akim Demaille <demaille@gostai.com>
1192
1193 Introduce make_symbol.
1194 make_symbol provides a means to construct a full symbol (kind,
1195 value, location) in a single shot. It is meant to be a Symbol
1196 constructor, parameterized by the symbol kind so that overloading
1197 would prevent incorrect kind/value pairs. Unfortunately
1198 parameterized constructors do not work well in C++ (unless the
1199 parameter also appears as an argument, which is not acceptable),
1200 hence the use of a function instead of a constructor.
1201
1202 * data/lalr1.cc (b4_symbol_constructor_declaration_)
1203 (b4_symbol_constructor_declarations)
1204 (b4_symbol_constructor_specialization_)
1205 (b4_symbol_constructor_specializations)
1206 (b4_symbol_constructor_definition_)
1207 (b4_symbol_constructor_definitions): New.
1208 Use them where appropriate to generate declaration, declaration of
1209 the specializations, and implementations of the templated
1210 overloaded function "make_symbol".
1211 (variant::variant): Always define a default ctor.
1212 Also provide a copy ctor.
1213 (symbol_base_type, symbol_type): New ctor overloads for value-less
1214 symbols.
1215 (symbol_type): Now public, so that functions such as yylex can use
1216 it.
1217
1218 2008-11-11 Akim Demaille <demaille@gostai.com>
1219
1220 Inform m4 whether a tag is a valid id.
1221 * src/output.c (is_identifier): New.
1222 (symbol_definitions_output): Use it to define tag_is_id.
1223 But maybe this should be done at m4 level?
1224
1225 2008-11-11 Akim Demaille <demaille@gostai.com>
1226
1227 Test 214 was failing: it greps with a pattern containing [ ]*
1228 which obviously meant to catch spaces and tabs, but contained only
1229 spaces. Tabulations in sources are a nuisance, so to simplify the
1230 matter, get rid of all the tabulations in the Java sources. The
1231 other skeletons will be treated equally later.
1232
1233 * data/java.m4, data/lalr1.java: Untabify.
1234 * tests/java.at: Simplify AT_CHECK_JAVA_GREP invocations:
1235 tabulations are no longer generated.
1236
1237 2008-11-11 Paolo Bonzini <bonzini@gnu.org>
1238
1239 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
1240 * configure.ac: Adjust usage.
1241 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
1242 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
1243 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
1244
1245 2008-11-10 Di-an Jan <dianj@freeshell.org>
1246
1247 Workaround Java's ``code too large'' problem for parser tables
1248 in most cases, by using one function per initialization.
1249 * data/java.m4 (b4_typed_parser_table, b4_integral_parser_table): New.
1250 * data/lalr1.java (yypact_, yydefact_, yypgoto_, yydefgoto_,
1251 yytable_, yycheck_, yystos_, yytoken_number_, yyr1_, yyr2_, yyrhs_
1252 yyprhs_, yyrline_, yytranslate_table_): Use b4_integral_parser_table.
1253 (yytname_): Use b4_typed_parser_table.
1254 * doc/bison.texinfo (Java Bison Interface): Add note on Java's
1255 ``code too large'' error.
1256
1257 2008-11-10 Di-an Jan <dianj@freeshell.org>
1258
1259 * NEWS: Document them.
1260
1261 General Java skeleton improvements.
1262 * configure.ac (gt_JAVACOMP): Request target of 1.4, which allows
1263 using gcj < 4.3 in the testsuite, according to comments in
1264 gnulib/m4/javacomp.m4.
1265 * data/java.m4 (stype, parser_class_name, lex_throws, throws,
1266 location_type, position_type): Remove extraneous brackets from
1267 b4_percent_define_default.
1268 (b4_lex_param, b4_parse_param): Remove extraneous brackets from
1269 m4_define and m4_define_default.
1270 * data/lalr1.java (b4_pre_prologue): Change to b4_user_post_prologue,
1271 which marks the end of user code with appropriate syncline, like all
1272 the other skeletons.
1273 (b4_user_post_prologue): Add. Don't silently drop.
1274 (yylex): Remove.
1275 (parse): Inline yylex.
1276 * doc/bison.texinfo (bisonVersion, bisonSkeleton): Document.
1277 (%{...%}): Fix typo of %code imports.
1278 * tests/java.at (AT_JAVA_COMPILE): Add "java" keyword.
1279
1280 Support annotations on parser class with %define annotations.
1281 * data/lalr1.java (annotations): Add to parser class modifier.
1282 * doc/bison.texinfo (Java Parser Interface): Document
1283 %define annotations.
1284 (Java Declarations Summary): Document %define annotations.
1285 * tests/java.at (Java parser class modifiers): Test annotations.
1286
1287 Do not generate code for %error-verbose unless requested.
1288 * data/lalr1.java (errorVerbose): Rename to yyErrorVerbose.
1289 Make private. Make conditional on %error-verbose.
1290 (getErrorVerbose, setErrorVerbose): New.
1291 (yytnamerr_): Make conditional on %error-verbose.
1292 (yysyntax_error): Make some code conditional on %error-verbose.
1293 * doc/bison.texinfo (Java Bison Interface): Remove the parts
1294 about %error-verbose having no effect.
1295 (getErrorVerbose, setErrorVerbose): Document.
1296
1297 Move constants for token names to Lexer interface.
1298 * data/lalr1.java (Lexer): Move EOF, b4_token_enums(b4_tokens) here.
1299 * data/java.m4 (b4_token_enum): Indent for move to Lexer interface.
1300 (parse): Qualify EOF to Lexer.EOF.
1301 * doc/bison.texinfo (Java Parser Interface): Move documentation of
1302 EOF and token names to Java Lexer Interface.
1303 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove Calc qualifier.
1304
1305 Make yyerror public.
1306 * data/lalr1.java (Lexer.yyerror): Use longer parameter name.
1307 (yyerror): Change to public. Add Javadoc comments. Use longer
1308 parameter names. Make the body rather than the declarator
1309 conditional on %locations.
1310 * doc/bison.texinfo (yyerror): Document. Don't mark as protected.
1311
1312 Allow user to add code to the constructor with %code init.
1313 * data/java.m4 (b4_init_throws): New, for %define init_throws.
1314 * data/lalr1.java (YYParser.YYParser): Add b4_init_throws.
1315 Add %code init to the front of the constructor body.
1316 * doc/bison.texinfo (YYParser.YYParser): Document %code init
1317 and %define init_throws.
1318 (Java Declarations Summary): Document %code init and
1319 %define init_throws.
1320 * tests/java.at (Java %parse-param and %lex-param): Adjust grep.
1321 (Java constructor init and init_throws): Add tests.
1322
1323 2008-11-10 Akim Demaille <demaille@gostai.com>
1324
1325 Update TODO.
1326 * TODO (-D): is implemented.
1327 (associativity): Same precedence must have the same associativity.
1328 For instance, how can a * b / c be parsed if * is %left and / is
1329 %right?
1330 (YYERRORCODE, YYFAIL, YYBACKUP): New.
1331
1332 2008-11-10 Akim Demaille <demaille@gostai.com>
1333
1334 Formatting changes.
1335
1336 2008-11-10 Akim Demaille <demaille@gostai.com>
1337
1338 More information about the symbols.
1339 * src/output.c (type_names_output): Document all the symbols,
1340 including those that don't have a type-name.
1341 (symbol_definitions_output): Define "is_token" and
1342 "has_type_name".
1343 * data/lalr1.cc (b4_type_action_): Skip symbols that have an empty
1344 type-name, now that they are defined too in b4_type_names.
1345
1346 2008-11-10 Akim Demaille <demaille@gostai.com>
1347
1348 Regen.
1349
1350 2008-11-10 Akim Demaille <demaille@gostai.com>
1351
1352 Make parser::yytranslate static.
1353 Small speedup (1%) on the list grammar. And makes yytranslate_
1354 available in non member functions.
1355
1356 * data/lalr1.cc (yytranslate_): Does not need to be a instance
1357 function.
1358
1359 2008-11-10 Akim Demaille <demaille@gostai.com>
1360
1361 Avoid trailing spaces.
1362 * data/c.m4: b4_comment(TEXT): Don't indent empty lines.
1363 * data/lalr1.cc: Don't indent before rule and symbol actions, as
1364 they can be empty, and anyway this incorrectly indents the first
1365 action.
1366
1367 2008-11-10 Akim Demaille <demaille@gostai.com>
1368
1369 Comment changes.
1370
1371 2008-11-10 Akim Demaille <demaille@gostai.com>
1372
1373 Use "enum" for integral constants.
1374 This is just nicer to read, I observed no speedup.
1375
1376 * data/lalr1.cc (yyeof_, yylast_, yynnts_, yyempty_, yyfinal_)
1377 (yterror_, yyerrcode_, yyntokens_): Define as members of an enum.
1378 (yyuser_token_number_max_, yyundef_token_): Move into...
1379 (yytranslate_): here.
1380
1381 2008-11-10 Akim Demaille <demaille@gostai.com>
1382
1383 Shortcuts in bench directives.
1384 * etc/bench.pl.in (parse_dirs): New.
1385 Use it.
1386 (bench_variant_parser, bench_fusion_parser): Use %s and %d.
1387 Create the benches in "benches/".
1388
1389 2008-11-10 Akim Demaille <demaille@gostai.com>
1390
1391 Formatting changes.
1392 * data/lalr1.cc: here.
1393
1394 2008-11-10 Akim Demaille <demaille@gostai.com>
1395
1396 Adjust verbose message to using emacs.
1397 * etc/bench.pl.in: Inform compilation-mode when we change the
1398 directory.
1399 (generate_grammar_list): Recognize %define "variant" in addition
1400 to %define variant.
1401
1402 2008-11-10 Akim Demaille <demaille@gostai.com>
1403
1404 Classify symbols by type-name.
1405 * src/uniqstr.h (UNIQSTR_CMP): New.
1406 * src/output.c (symbol_type_name_cmp, symbols_by_type_name)
1407 (type_names_output): New.
1408 (muscles_output): Use it.
1409 * data/lalr1.cc (b4_symbol_action_): Remove.
1410 (b4_symbol_case_, b4_type_action_): New.
1411 Adjust uses of b4_symbol_action_ to use b4_type_action_.
1412
1413 2008-11-10 Akim Demaille <demaille@gostai.com>
1414
1415 Change the handling of the symbols in the skeletons.
1416 Before we were using tables which lines were the symbols and which
1417 columns were things like number, tag, type-name etc. It is was
1418 difficult to extend: each time a column was added, all the numbers had
1419 to be updated (you asked for colon $2, not for "tag"). Also, it was
1420 hard to filter these tables when only a subset of the symbols (say the
1421 tokens, or the nterms, or the tokens that have and external number
1422 *and* a type-name) was of interest.
1423
1424 Now instead of monolithic tables, we define one macro per cell. For
1425 instance "b4_symbol(0, tag)" is a macro name which contents is
1426 self-decriptive. The macro "b4_symbol" provides easier access to
1427 these cells.
1428
1429 * src/output.c (type_names_output): Remove.
1430 (symbol_numbers_output, symbol_definitions_output): New.
1431 (muscles_output): Call them.
1432 (prepare_symbols): Define b4_symbols_number.
1433
1434 2008-11-10 Akim Demaille <demaille@gostai.com>
1435
1436 --trace=muscles
1437 * src/getargs.h, src/getargs.c (trace_muscle): New.
1438 (trace_types, trace_args): Support it.
1439 * src/output.c (output_skeleton): Use it.
1440
1441 2008-11-10 Akim Demaille <demaille@gostai.com>
1442
1443 muscles_output.
1444 * src/output.c (muscles_output): New, extracted from...
1445 (output_skeleton): here.
1446 Adjust.
1447
1448 2008-11-10 Akim Demaille <demaille@gostai.com>
1449
1450 Formatting changes.
1451
1452 2008-11-10 Akim Demaille <demaille@gostai.com>
1453
1454 Update the variant example.
1455 * examples/variant.yy: Formatting changes.
1456 One stage build.
1457
1458 2008-11-10 Akim Demaille <demaille@gostai.com>
1459
1460 Support constructor with an argument.
1461 This improves the "list" bench by 2%.
1462
1463 * data/lalr1.cc (variant::build): Add an overloaded version with
1464 an argument.
1465 * tests/c++.at (AT_CHECK_VARIANT): Check it.
1466
1467 2008-11-10 Akim Demaille <demaille@gostai.com>
1468
1469 Test variants.
1470 * tests/c++.at (AT_CHECK_VARIANTS): New.
1471 Use it with and without %define assert.
1472
1473 2008-11-10 Akim Demaille <demaille@gostai.com>
1474
1475 Add %precedence support.
1476 Unfortunately it is not possible to reuse the %prec directive. This
1477 is because to please POSIX, we do not require to end the rules with a
1478 semicolon. As a result,
1479
1480 foo: bar %prec baz
1481
1482 is ambiguous: either a rule which precedence is that of baz, or a rule,
1483 and then a declaration of the precedence of the token baz.
1484
1485 * doc/bison.texinfo: Document %precedence.
1486 (Precedence Only): New.
1487 * src/assoc.h, src/assoc.c (precedence_assoc): New.
1488 * src/conflicts.c (resolve_sr_conflict): Support it.
1489 * src/scan-gram.l, src/parse-gram.y (%precedence): New token.
1490 Parse it.
1491 * tests/calc.at: Use %precedence for NEG.
1492 * tests/conflicts.at (%precedence does not suffice)
1493 (%precedence suffices): New tests.
1494
1495 2008-11-09 Akim Demaille <demaille@gostai.com>
1496
1497 Make benches in a sub dirs.
1498 * etc/bench.pl.in ($dir): New.
1499 Use it.
1500 Check the use of constructors with an argument.
1501 (bench_variant_parser): Fix.
1502
1503 2008-11-09 Akim Demaille <demaille@gostai.com>
1504
1505 fix eof condition
1506
1507 2008-11-09 Akim Demaille <demaille@gostai.com>
1508
1509 Fix --help.
1510
1511 2008-11-09 Akim Demaille <demaille@gostai.com>
1512
1513 Require the generation of parse-gram.output.
1514 * src/Makefile.am (YACC): Pass --report=all.
1515
1516 2008-11-09 Akim Demaille <demaille@gostai.com>
1517
1518 Formatting changes.
1519
1520 2008-11-09 Akim Demaille <demaille@gostai.com>
1521
1522 Update TODO.
1523 * TODO: Remove obsolete items.
1524 Update others.
1525
1526 2008-11-09 Akim Demaille <demaille@gostai.com>
1527
1528 Enhance bench.pl.
1529 * etc/bench.pl.in (parse, parse_expr, parse_term, parse_fact)
1530 (@token, $grammar, $bench): New.
1531 (generate_grammar_variant): Rename as...
1532 (generate_grammar_list): this.
1533 (generate_grammar): Adjust.
1534 (bench_grammar): Rename as...
1535 (bench): this.
1536 Use it in the various bench-marking routines.
1537 (-b, -g): New options.
1538
1539 2008-11-09 Akim Demaille <demaille@gostai.com>
1540
1541 Use a static hierarchy for symbols in the C++ parser.
1542 * data/lalr1.cc (symbol_base_type, symbol_type)
1543 (stack_symbol_type): Make it a static hierarchy.
1544 Adjust dependencies.
1545
1546 2008-11-09 Akim Demaille <demaille@gostai.com>
1547
1548 bench.pl -d, --directive.
1549 * etc/bench.pl.in (@directive): New.
1550 (&bench_grammar): Use it.
1551 (&bench_list_grammar): New, to provide access to the "variant"
1552 grammar.
1553 Use it.
1554 (getopts): Support -d, --directive.
1555
1556 2008-11-09 Akim Demaille <demaille@gostai.com>
1557
1558 Use inline for small operations.
1559 * data/lalr1.cc (symbol_base_type, symbol_type)
1560 (stack_symbol_type): Declare constructor and other operations as
1561 inline.
1562 (yy_destroy_): Inline.
1563
1564 2008-11-09 Akim Demaille <demaille@gostai.com>
1565
1566 Introduce a hierarchy for symbols.
1567 * data/lalr1.cc (symbol_base_type, symbol_type): New.
1568 (data_type): Rename as...
1569 (stack_symbol_type): this.
1570 Derive from symbol_base_type.
1571 (yy_symbol_value_print_): Merge into...
1572 (yy_symbol_print_): this.
1573 Rename as...
1574 (yy_print_): this.
1575 (yydestruct_): Rename as...
1576 (yy_destroy_): this.
1577 (b4_symbols_actions, YY_SYMBOL_PRINT): Adjust.
1578 (parser::parse): yyla is now of symbol_type.
1579 Use its type member instead of yytoken.
1580
1581 2008-11-09 Akim Demaille <demaille@gostai.com>
1582
1583 Rename data_type and stack_symbol_type.
1584 * data/lalr1.cc (data_type): Rename as...
1585 (stack_symbol_type): this.
1586
1587 2008-11-09 Akim Demaille <demaille@gostai.com>
1588
1589 Handle semantic value and location together.
1590 * data/lalr1.cc (b4_symbol_actions): Bounce $$ and @$ to
1591 yydata.value and yydata.location.
1592 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_)
1593 (YY_SYMBOL_PRINT): Now take semantic value and location as a
1594 single arg.
1595 Adjust all callers.
1596 (yydestruct_): New overload for a stack symbol.
1597
1598 2008-11-09 Akim Demaille <demaille@gostai.com>
1599
1600 Push a complete symbol, not connected parts.
1601 * data/lalr1.cc (yypush_): Take a data_type&, not disconnected
1602 state, value and location.
1603 Adjust callers.
1604
1605 2008-11-09 Akim Demaille <demaille@gostai.com>
1606
1607 Agregate yylval and yylloc.
1608 * data/lalr1.cc (parser::yylval, parser::yylloc): Replace by...
1609 (parser::yyla): this.
1610
1611 2008-11-09 Akim Demaille <demaille@gostai.com>
1612
1613 Rely on the state stack to display reduction traces.
1614 To display rhs symbols before a reduction, we used information
1615 about the rule reduced, which required the tables yyrhs and
1616 yyprhs. Now use rely only on the state stack to get the same
1617 information.
1618
1619 * data/lalr1.cc (b4_rhs_data, b4_rhs_state): New.
1620 Use them.
1621 (parser::yyrhs_, parser::yyprhs_): Remove.
1622 (parser::yy_reduce_print_): Use the state stack.
1623
1624 2008-11-09 Akim Demaille <demaille@gostai.com>
1625
1626 Fuse yyval and yyloc into yylhs.
1627 * data/lalr1.cc (b4_lhs_value, b4_lhs_location): Adjust to using
1628 yylhs.
1629 (parse): Replace yyval and yyloc with yylhs.value and
1630 yylhs.location.
1631 After a user action, compute yylhs.state earlier.
1632 (yyerrlab1): Do not play tricks with yylhs.location, rather, use a
1633 fresh error_token.
1634
1635 2008-11-09 Di-an Jan <dianj@freeshell.org>
1636
1637 Remove unused variable.
1638 * src/output.c (type_names_output): Remove unused variable sep.
1639
1640 2008-11-09 Paolo Bonzini <bonzini@gnu.org>
1641
1642 Change tests/output.at quoting.
1643 * tests/output.at (AT_CHECK_OUTPUT): Use conventional m4 quoting when
1644 expanding arguments.
1645
1646 2008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
1647
1648 Don't add a semicolon to actions for %skeleton or %language.
1649 It breaks Java test cases as reported by Akim Demaille.
1650 * src/scan-code.l: Implement.
1651
1652 2008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
1653
1654 Clean up %skeleton and %language priority implementation.
1655 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
1656 remove static qualifier because others will soon need to see it.
1657 (language_prio): Likewise.
1658 (getargs): Use command_line_prio rather than 0.
1659 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
1660 enum fields.
1661 (skeleton_prio): Extern it.
1662 (language_prio): Extern it.
1663 * src/parse-gram.y: Use grammar_prio rather than 1.
1664
1665 2008-11-07 Akim Demaille <demaille@gostai.com>
1666
1667 Moving push traces into yypush_.
1668 * data/lalr1.cc (yypush_): Now takes a optional trace message.
1669 Adjust all uses.
1670
1671 2008-11-07 Akim Demaille <demaille@gostai.com>
1672
1673 The single-stack C++ parser is now the standard one.
1674 * data/lalr1.cc: Rename as...
1675 * data/lalr1-split.cc: this.
1676 * data/lalr1-fusion.cc: Rename as...
1677 * data/lalr1.cc: this.
1678 * etc/bench.pl.in: Adjust.
1679
1680 2008-11-07 Akim Demaille <demaille@gostai.com>
1681
1682 Avoid empty-if warnings.
1683 Reported by Quentin Hocquet.
1684
1685 * data/lalr1-fusion.cc (YY_SYMBOL_PRINT, YY_REDUCE_PRINT)
1686 (YY_STACK_PRINT): Provide some contents even when !YYDEBUG.
1687
1688 2008-11-07 Akim Demaille <demaille@gostai.com>
1689
1690 Pass command line location to skeleton_arg and language_argmatch.
1691 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
1692 The location argument is now mandatory.
1693 Adjust all dependencies.
1694 (getargs): Use command_line_location.
1695
1696 2008-11-07 Akim Demaille <demaille@gostai.com>
1697
1698 -D, --define.
1699 * src/getargs.c (usage): Document -D.
1700 Fix help string for --locations.
1701 (command_line_location): New.
1702 (short_options, long_options, getargs): Support -D, --define.
1703 (getargs): Move -d support at the right place.
1704 * doc/bison.texinfo (Bison Options): Update.
1705 * tests/input.at (%define, --define): New.
1706
1707 2008-11-07 Akim Demaille <demaille@gostai.com>
1708
1709 Initialize the muscle table before parsing the command line.
1710 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
1711 (getargs): Define file_name.
1712 * src/main.c (main): Initialize muscle_tab before calling
1713 getargs.
1714 * src/muscle_tab.c (muscle_init): No longer define file_name, as
1715 its value is not available yet.
1716
1717 2008-11-07 Akim Demaille <demaille@gostai.com>
1718
1719 Locations without columns for command line arguments.
1720 * src/location.c (location_print): Don't display negative columns.
1721 * src/location.h: Document this.
1722
1723 2008-11-07 Akim Demaille <demaille@gostai.com>
1724
1725 Fix --help.
1726 * src/getargs.c (usage): Fix help string for -W.
1727
1728 2008-11-07 Akim Demaille <demaille@gostai.com>
1729
1730 Handle more general types of option arguments.
1731 * build-aux/cross-options.pl: The argument ends at the first
1732 space, not the first non-symbol character.
1733 Use @var for each word appearing the argument description.
1734
1735 2008-11-07 Akim Demaille <demaille@gostai.com>
1736
1737 Destroy the variants that remain on the stack in case of error.
1738 * data/lalr1-fusion.cc (yydestruct_): Invoke the variant's
1739 destructor.
1740 Display the value only if yymsg is nonnull.
1741 (yyreduce): Invoke yydestruct_ when popping lhs symbols.
1742
1743 2008-11-07 Akim Demaille <demaille@gostai.com>
1744
1745 Add "%define assert" to variants.
1746 This is used to help the user catch cases where some value gets
1747 ovewritten by a new one. This should not happen, as this will
1748 probably leak.
1749
1750 Unfortunately this uncovered a bug in the C++ parser itself: the
1751 lookahead value was not destroyed between two calls to yylex. For
1752 instance if the previous lookahead was a std::string, and then an int,
1753 then the value of the std::string was correctly taken (i.e., the
1754 lookahead was now an empty string), but std::string structure itself
1755 was not reclaimed.
1756
1757 This is now done in variant::build(other&) (which is used to take the
1758 value of the lookahead): other is not only stolen from its value, it
1759 is also destroyed. This incurs a new performance penalty of a few
1760 percent, and union becomes faster again.
1761
1762 * data/lalr1-fusion.cc (variant::build(other&)): Destroy other.
1763 (b4_variant_if): New.
1764 (variant::built): New.
1765 Use it whereever the status of the variant changes.
1766 * etc/bench.pl.in: Check the penalty of %define assert.
1767
1768 2008-11-07 Akim Demaille <demaille@gostai.com>
1769
1770 Use "%define variant" in bench.pl.
1771 * etc/bench.pl.in: No longer use the pseudo directive %variants,
1772 just use %define variants.
1773
1774 2008-11-07 Akim Demaille <demaille@gostai.com>
1775
1776 Regen.
1777 * src/parse-gram.h, src/parse-gram.c: Regen.
1778
1779 2008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
1780
1781 Fix user actions without a trailing semicolon.
1782 Reported by Sergei Steshenko at
1783 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
1784 * THANKS (Sergei Steshenko): Add.
1785 * src/scan-code.l (SC_RULE_ACTION): Fix it.
1786 * tests/regression.at (Fix user actions without a trailing semicolon):
1787 New test case.
1788
1789 2008-11-04 Akim Demaille <demaille@gostai.com>
1790
1791 Use b4_copyright_years.
1792 * data/yacc.c (b4_copyright_years): New.
1793 Fix its value according to the comments in the file.
1794 Use it and undefine it.
1795
1796 2008-11-04 Akim Demaille <demaille@gostai.com>
1797
1798 Formatting changes.
1799 * data/lalr1-fusion.cc, src/parse-gram.y: here.
1800
1801 2008-11-04 Akim Demaille <demaille@gostai.com>
1802
1803 Formatting changes.
1804 * data/lalr1-fusion.cc: here.
1805
1806 2008-11-04 Akim Demaille <demaille@gostai.com>
1807
1808 Use strict on bench.pl.
1809 * etc/bench.pl.in (&run, &generate_grammar): New.
1810 Rename the grammar generating functions for consistency.
1811 Change the interface so that the list of benches to run is passed
1812 as (optionless) arguments.
1813 (&compile): Use &run.
1814
1815 2008-11-04 Akim Demaille <demaille@gostai.com>
1816
1817 Remove spurious initial empty lines.
1818 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
1819 * data/yacc.c: End the @output lines with an @.
1820
1821 2008-11-04 Akim Demaille <demaille@gostai.com>
1822
1823 Improve the display of sizes.
1824 * etc/bench.p.in: Higher precision.
1825 Sort by decreasing size.
1826
1827 2008-11-04 Akim Demaille <demaille@gostai.com>
1828
1829 Don't memcpy C++ structures.
1830 * data/lalr1-fusion.cc (b4_symbol_variant): Adjust additional
1831 arguments.
1832 (variant::build): New overload for
1833 copy-construction-that-destroys.
1834 (variant::swap): New.
1835 (parser::yypush_): Use it in variant mode.
1836
1837 2008-11-04 Akim Demaille <demaille@gostai.com>
1838
1839 Better defaults for bench.pl.
1840 * etc/bench.pl.in ($verbose, $cflags, $iterations): Change the
1841 default values.
1842 Adjust &verbose uses.
1843 (-q, --quiet): New.
1844
1845 2008-11-04 Akim Demaille <demaille@gostai.com>
1846
1847 Make variant.yy more complex.
1848 std::list cannot be copied via memcpy, they are more demanding than
1849 std::string. Use one std::list to strengthen the test.
1850
1851 * examples/variant.yy: Use lalr1-fusion.cc, not lalr1.cc.
1852 Adjust.
1853 Create a list of strings, instead of a single large string.
1854
1855 2008-11-04 Akim Demaille <demaille@gostai.com>
1856
1857 bench.pl --bench.
1858 * etc/bench.pl.in (--bench, $bench): New.
1859
1860 2008-11-04 Akim Demaille <demaille@gostai.com>
1861
1862 Sort methods.
1863 * data/lalr1-fusion.cc (destroy): Use as() in its definition.
1864 Define it after as().
1865
1866 2008-11-04 Akim Demaille <demaille@gostai.com>
1867
1868 Useless parens.
1869 * data/lalr1-fusion.cc (b4_rhs_location): Remove useless parens.
1870
1871 2008-11-04 Akim Demaille <demaille@gostai.com>
1872
1873 Issue missing synclines after user actions.
1874 * data/c.m4 (b4_case): Issue synclines on the output file.
1875
1876 2008-11-04 Akim Demaille <demaille@gostai.com>
1877
1878 Remove trailing empty line.
1879 * data/lalr1-fusion.cc: Don't add an empty line after the user's
1880 epilogue.
1881
1882 2008-11-04 Akim Demaille <demaille@gostai.com>
1883
1884 Fix output of copyright years.
1885 * data/bison.m4 (b4_copyright): Fix the indentation of the
1886 copyright year paragraph.
1887 Use b4_copyright_years when no years are given.
1888 * data/lalr1.cc, data/lalr1-fusion.cc, data/location.cc
1889 (b4_copyright_years): New.
1890 Use it.
1891
1892 2008-11-04 Akim Demaille <demaille@gostai.com>
1893
1894 Avoid the spurious initial empty line.
1895 * data/lalr1-fusion.cc, data/location.cc: Put a trailing "@" at
1896 the end of @output request to suppress the empty line that
1897 results.
1898
1899 2008-11-04 Akim Demaille <demaille@gostai.com>
1900
1901 Remove parser::rhs_number_type.
1902 * data/lalr1-fusion.cc (rhs_number_type): No longer define it.
1903 (yyrhs_): Use b4_table_define.
1904
1905 2008-11-04 Akim Demaille <demaille@gostai.com>
1906
1907 Fix iteration type.
1908 * data/lalr1-fusion.cc: Use an int to iterate up to an int.
1909
1910 2008-11-04 Akim Demaille <demaille@gostai.com>
1911
1912 Factor the declaration of the integer tables.
1913 * data/lalr1-fusion.cc (b4_table_define): New.
1914 Use it.
1915
1916 2008-11-03 Akim Demaille <demaille@gostai.com>
1917
1918 Fix indentation of tables in lalr1.cc
1919 * data/lalr1-fusion.cc: Fix the indentation.
1920
1921 2008-11-03 Akim Demaille <demaille@gostai.com>
1922
1923 Destroy the lhs symbols after reduction.
1924 * data/lalr1-fusion.cc (parse): After the user action, when in
1925 variant mode, destroy the lhs symbols.
1926
1927 2008-11-03 Akim Demaille <demaille@gostai.com>
1928
1929 Simplify yysyntax_error_ use.
1930 * data/lalr1-fusion.cc (yysyntax_error_): Always pass it the token
1931 type, but make it unnamed in the declaration when it is not used.
1932
1933 2008-11-03 Akim Demaille <demaille@gostai.com>
1934
1935 Let yy::variant::build return an lvalue.
1936 * data/lalr1-fusion.cc (variant::build): Return a reference to the
1937 object.
1938
1939 2008-11-03 Akim Demaille <demaille@gostai.com>
1940
1941 Define yy::variant only when needed.
1942 * data/lalr1-fusion.cc (yy::variant): Define only if variants are
1943 used.
1944
1945 2008-11-03 Akim Demaille <demaille@gostai.com>
1946
1947 Bench the three-stack lalr1.cc.
1948 * etc/bench.pl.in: Bench the three-stack lalr1.cc vs. the
1949 one-stack one.
1950
1951 2008-11-03 Akim Demaille <demaille@gostai.com>
1952
1953 Fail on parse error in calc++.
1954 * doc/bison.texinfo (calc++.cc): Propagate failures to the exit
1955 status.
1956 * examples/calc++/test ($me, $number, $exit, run): New.
1957 Use them to propagate errors to the exit status.
1958
1959 2008-11-03 Akim Demaille <demaille@gostai.com>
1960
1961 Don't specify the skeleton twice in the example.
1962 * examples/calc++/Makefile.am: Don't pass -S to Bison, the grammar
1963 file does what is needed.
1964
1965 2008-11-03 Akim Demaille <demaille@gostai.com>
1966
1967 bench: Improve output.
1968 * etc/bench.pl.in (bench_grammar): Tune the printf format.
1969
1970 2008-11-03 Akim Demaille <demaille@gostai.com>
1971
1972 bench: check impact of %debug on variants.
1973 * etc/bench.pl.in (variant_grammar): Fix the computation of
1974 $variant.
1975 Generate a grammar file that can work with or without %debug.
1976 Do use the @directive.
1977 (bench_variant_parser): Check impact of %debug.
1978 (@directives): Rename all the occurrences to...
1979 (@directive): this, for consistency.
1980
1981 2008-11-03 Akim Demaille <demaille@gostai.com>
1982
1983 bench: report the size too.
1984 * etc/bench.pl.in ($iterations): Defaults to -3.
1985 (&bench_grammar): Require hireswallclock.
1986 Compute and display the size of the result.
1987 More comments.
1988
1989 2008-11-03 Akim Demaille <demaille@gostai.com>
1990
1991 bench: More use of the verbosity level.
1992 * etc/bench.pl.in ($verbose, &verbose): New.
1993 Use them.
1994 More POD documentation.
1995
1996 2008-11-03 Akim Demaille <demaille@gostai.com>
1997
1998 bench.pl: a command line interface
1999 * etc/bench.pl.in: More doc.
2000 Some fixes in the documentation.
2001 ($cflags, $iterations, &help, &getopt): New.
2002 Use them.
2003 (&variant_grammar): Let the number of stages be 10 times what is
2004 specified.
2005
2006 2008-11-03 Akim Demaille <demaille@gostai.com>
2007
2008 Bench the use of Boost.Variants.
2009 * etc/bench.pl.in ($cxx, &variant_grammar, &bench_variant_parser):
2010 New.
2011 (&compile): Be ready to compile C++ parsers.
2012 (&bench_push_parser): Move debug information to the outermost
2013 level.
2014 * THANKS: Add Michiel De Wilde.
2015
2016 2008-11-03 Akim Demaille <demaille@gostai.com>
2017
2018 bench.pl: Pass directives as a list instead of as a string.
2019 * etc/bench.pl.in (&directives): New.
2020 (&triangular_grammar, &calc_grammar): Use it to format the Bison
2021 directives.
2022 (&triangular_grammar): Do use the directives (were ignored).
2023 (&bench_grammar, &bench_push_parser): Adjust to pass lists of
2024 directives.
2025
2026 2008-11-03 Akim Demaille <demaille@gostai.com>
2027
2028 Improve genericity of bench.pl.
2029 * etc/bench.pl.in (&bench_grammar): Take the set of benches as
2030 argument.
2031 (&bench_push_parser): New.
2032 Call it.
2033
2034 2008-11-03 Akim Demaille <demaille@gostai.com>
2035
2036 Add documentation to bench.pl.
2037 * etc/bench.pl.in: Comment changes.
2038
2039 2008-11-03 Akim Demaille <demaille@gostai.com>
2040
2041 Fuse the three stacks into a single one.
2042
2043 In order to make it easy to perform benchmarks to ensure that
2044 there are no performance loss, lalr1.cc is forked into
2045 lalr1-fusion.cc. Eventually, lalr1-fusion.cc will replace
2046 lalr1.cc.
2047
2048 Meanwhile, to make sure that lalr1-fusion.cc is correctly
2049 exercized by the test suite, the user must install a symbolic link
2050 from lalr1.cc to it.
2051
2052 Instead of having three stacks (state, value, location), use a
2053 stack of triples. This considerably simplifies the code (and it
2054 will be easier not to require locations as currently does the C++
2055 parser), and also gives a 10% speedup according to
2056 etc/bench (probably mainly since memory allocation is done once
2057 instead of three times).
2058
2059 Another motivation is to make it easier to destruct properly
2060 semantic values: now that they are bound to their state (hence
2061 symbol type) it will be easier to call the appropriate destructor.
2062
2063 These changes should probably benefit the C parser too.
2064
2065 * data/lalr1.cc: Copy as...
2066 * data/lalr1-fusion.cc: this new file.
2067 (b4_rhs_value, b4_rhs_location): New definitions overriding those
2068 from c++.m4.
2069 (state_stack_type, semantic_stack_type, location_stack_type)
2070 (yystate_stack_, yysemantic_stack_, yylocation_stack_): Remove.
2071 (data_type, stack_type, yystack_): New.
2072 (YYLLOC_DEFAULT, yypush_): Adjust.
2073 (yyerror_range): Now based on data_type, not location_type.
2074
2075 2008-11-03 Akim Demaille <demaille@gostai.com>
2076
2077 Push the state, value, and location at the same time.
2078 This is needed to prepare a forthcoming patch that fuses the three
2079 stacks into one.
2080
2081 * data/lalr1.cc (parser::yypush_): New.
2082 (parser::yynewstate): Change the semantics: instead of arriving to
2083 this label when value and location have been pushed, but yystate
2084 is to be pushed on the state stack, now the three of them must
2085 have been pushed before. yystate still must be the new state.
2086 This allows to use yypush_ everywhere instead of individual
2087 handling of the stacks.
2088
2089 2008-11-03 Akim Demaille <demaille@gostai.com>
2090
2091 Prefer references to pointers.
2092 * data/lalr1.cc (b4_symbol_actions): New, overrides the default C
2093 definition to use references instead of pointers.
2094 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_):
2095 Take the value and location as references.
2096 Adjust callers.
2097
2098 2008-11-03 Akim Demaille <demaille@gostai.com>
2099
2100 stack::size instead of stack::height.
2101 * data/lalr1.cc (stack::height): Rename as...
2102 (stack::size): this.
2103 Fix the output type.
2104 Comment changes.
2105
2106 2008-11-03 Akim Demaille <demaille@gostai.com>
2107
2108 Use variants to support objects as semantic values.
2109 This patch was inspired by work by Michiel De Wilde. But he used
2110 Boost variants which (i) requires Boost on the user side, (ii) is
2111 slow, and (iii) has useless overhead (the parser knows the type of
2112 the semantic value there is no reason to duplicate this
2113 information as Boost.Variants do).
2114
2115 This implementation reserves a buffer large enough to store the
2116 largest objects. yy::variant implements this buffer. It was
2117 implemented with Quentin Hocquet.
2118
2119 * src/output.c (type_names_output): New.
2120 (output_skeleton): Invoke it.
2121 * data/c++.m4 (b4_variant_if): New.
2122 (b4_symbol_value): If needed, provide a definition for variants.
2123 * data/lalr1.cc (b4_symbol_value, b4_symbol_action_)
2124 (b4_symbol_variant, _b4_char_sizeof_counter, _b4_char_sizeof_dummy)
2125 (b4_char_sizeof, yy::variant): New.
2126 (parser::parse): If variants are requested, define
2127 parser::union_type, parser::variant, change the definition of
2128 semantic_type, construct $$ before running the user action instead
2129 of performing a default $$ = $1.
2130 * examples/variant.yy: New.
2131 Based on an example by Michiel De Wilde.
2132
2133 2008-11-03 Akim Demaille <demaille@gostai.com>
2134
2135 Parameterize the extraction of semantic values.
2136 To make future changes easier, no longer rely on ".TYPE" being the
2137 way to get a semantic value.
2138
2139 * data/c.m4 (b4_symbol_value): New.
2140 Use it.
2141 * data/c++.m4, data/yacc.c: Use it.
2142 * data/glr.c: Use b4_symbol_value.
2143 (b4_rhs_data): New.
2144 Use it.
2145
2146 2008-11-03 Akim Demaille <demaille@gostai.com>
2147
2148 Prepare easier M4 changes.
2149 * data/lalr1.cc: Use escaped [] instead of literals to prepare
2150 future changes.
2151
2152 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
2153
2154 Initiate further development.
2155 * NEWS: Create an empty section for new entries.
2156 * gnulib: Update submodule to HEAD.
2157
2158 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
2159
2160 * NEWS: Version 2.4.
2161
2162 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
2163
2164 Prepare for next release.
2165 * NEWS: Briefly mention changes since 2.3b.
2166 * README: Say GNU m4 1.4.6, which we've been requiring in release
2167 announcements already, not 1.4.3, which breaks the build.
2168
2169 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
2170
2171 Say %language is experimental.
2172 We're thinking of extending it's effect on output file naming. See the
2173 thread at
2174 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
2175 * NEWS: Say it's experimental.
2176 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
2177 recommend it over %skeleton for now.
2178 (Bison Options): Likewise.
2179 (C++ Bison Interface): Use %skeleton not %language.
2180 (Calc++ Parser): Use %skeleton not %language.
2181 * src/getargs.c (usage): Say it's experimental.
2182
2183 2008-11-01 Di-an Jan <dianj@freeshell.org>
2184 Paolo Bonzini <bonzini@gnu.org>
2185
2186 Support all Java parser class modifiers.
2187 * data/java.m4 (b4_percent_define_get3): New.
2188 (b4_final_if, b4_strictfp_if): New.
2189 * data/lalr1.java (final, strictfp, extends, implements): Support.
2190 * doc/bison.texinfo (final, strictfp, extends, implements): Add
2191 documentation.
2192 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
2193 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
2194 (AT_CHECK_JAVA_GREP): New.
2195 (Java parser class modifiers): New test.
2196 (Java parser class extends and implements): New test.
2197
2198 Model exception propagation better with throws and lex_throws.
2199 * data/java.m4 (b4_list2): New.
2200 (throws): Change default.
2201 * data/lalr1.java (yyaction): Add throws.
2202 (parse): Add lex_throws in addition to throws.
2203 * doc/bison.texinfo (throws, lex_throws): Add documentation.
2204 * tests/java.at (Java throws specifications): New test.
2205
2206 Improve documentation for Java parsers.
2207 * doc/bison.texinfo (Java Parsers): Add subsections.
2208 Don't quote first argument of %define.
2209 (Java Bison Interface): Document output files. Move documentation
2210 of parser class and merge into Java Parser Interface. Document
2211 features that error out. Document directives with no effect.
2212 Move note about Javadoc higher.
2213 (Java Semantic Values): Explicitly mention stype.
2214 Document that generic types cannot be used.
2215 (Java Location Values): Use @deftypeivar. Document constructors.
2216 Correct return value for toString.
2217 (Java Parser Interface): List undocumented constants/fields.
2218 Move documentation of fields added by %parse-param closer to list
2219 of members. Document that token names are added as fields.
2220 Document constructors accurately. Remove error method.
2221 (Java Scanner Interface): Move note on %pure-parser to Java Bison
2222 Interface. Describe %code lexer and yylex accutately.
2223 Remove documentation that does not match the code.
2224 (Java Action Features): New.
2225 (Java Differences): Add reference. Add item on semantic values.
2226 Add note about @{ ... @}. Clarify %% epilogue placement.
2227 (Java Declarations Summary): New.
2228
2229 Fix Java skeleton.
2230 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
2231 (b4_remove_comma): Quote test argument.
2232 (b4_identification): Remove "bison" field.
2233 * tests/java.at (Java parser class and package names): New test.
2234 (Java %parse-param and %lex-param): New test.
2235 (Java stype, position_class and location_class): New test.
2236
2237 2008-10-31 Di-an Jan <dianj@freeshell.org>
2238
2239 * data/lalr1.jave: Update copyright years.
2240 (YYParser): Correct name of "generated from" file in Javadoc:
2241 use b4_file_name instead of @ofile@.
2242 (Location constructor): Correct Javadoc parameter name.
2243 (yylloc): Add missing opening m4 quote after b4_location_if.
2244 This removes a stray [ in the Javadoc of Lexer.getStartPos.
2245 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
2246 (YYParser constructor): Correct Javadoc parameter name.
2247
2248 2008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
2249
2250 Always put auxiliary code files in the same dir as other output files.
2251 * src/files.c (compute_file_name_parts): When the user specifies
2252 --output but not --file-prefix, extract the directory prefix from the
2253 file prefix not from the grammar file name. This affects the location
2254 of files like location.hh generated by the C++ skeleton. The includes
2255 in the other output files require this fix.
2256 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
2257 for expected output files.
2258 (Output files): Add a test for the above.
2259
2260 2008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
2261
2262 * gnulib: Update submodule to HEAD.
2263
2264 2008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
2265
2266 Update copyright year.
2267 * src/files.c: Here.
2268
2269 2008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
2270
2271 Don't overwrite the input file.
2272 * src/files.c (output_file_name_check): Fatal error if using input file
2273 for output.
2274 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
2275 argument.
2276 (Conflicting output files): Add test.
2277
2278 2008-10-28 Akim Demaille <demaille@gostai.com>
2279
2280 Space changes.
2281 * data/lalr1.cc: Formatting changes.
2282
2283 2008-10-28 Akim Demaille <demaille@gostai.com>
2284
2285 Don't define debugging functions when !YYDEBUG.
2286 * data/lalr1.cc (debug_stream, set_debug_stream)
2287 (debug_level_type, debug_level, set_debug_level): Don't
2288 declare them when YYDEBUG is not defined.
2289 The implementation are already YYDEBUG-aware.
2290
2291 2008-10-28 Akim Demaille <demaille@gostai.com>
2292
2293 Prefer "continue" for empty loop bodies.
2294 * etc/bench.pl.in: Use "continue" instead of {}.
2295
2296 2008-10-28 Akim Demaille <demaille@gostai.com>
2297
2298 Space and comments changes.
2299 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
2300 * data/c.m4, data/lalr1.cc: Space changes.
2301
2302 2008-10-28 Akim Demaille <demaille@gostai.com>
2303
2304 Make gnulib a submodule.
2305 * gnulib: New.
2306 * .gitmodules (gnulib): New.
2307
2308 2008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
2309
2310 Fix yyerror_range for user-defined location type in C++. Reported by
2311 Georg Sauthoff at
2312 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
2313 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
2314 * THANKS (Georg Sauthoff): Add.
2315
2316 2008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
2317
2318 Update several administrative files mainly to facilitate releasing.
2319 * HACKING (Administrivia): Make the git-merge-changelog notes more
2320 helpful.
2321 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
2322 (Release Procedure): Update for git and add numerous details that were
2323 previously missing.
2324 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
2325 * maint.mk (announcement): Don't list bison as a bootstrap tool so
2326 that announcements don't claim we bootstrapped with whatever bison
2327 happened to be in PATH. Add flex as a bootstrap tool.
2328 * Makefile.maint: Remove, previously replaced by maint.mk.
2329 * Makefile.cfg: Remove, and migrate settings to...
2330 * cfg.mk: ... here for the sake of `make announcement'.
2331 * bootstrap.conf (gnulib_modules): Add announce-gen.
2332 * README: Say GNU Bison instead of just Bison. Suggested by Karl
2333 Berry.
2334
2335 2008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
2336
2337 Small but important bugfixes for the Java skeleton.
2338 * data/lalr1.java (yyerror): Change Location to b4_location_type.
2339 (yy_symbol_print): Call toString on yyvaluep.
2340
2341 2008-08-29 Akim Demaille <demaille@gostai.com>
2342
2343 Clarify UPDATED use.
2344 * doc/bison.texinfo: It refers to the last edition of this file,
2345 not to the release date of Bison.
2346 Reported by Joel E. Denny.
2347
2348 2008-08-29 Akim Demaille <demaille@gostai.com>
2349
2350 * README: Update FAQ pointer.
2351 Reported by Joel E. Denny.
2352
2353 2008-08-27 Eric Blake <ebb9@byu.net>
2354
2355 Resync m4sugar from autoconf.
2356 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
2357 (m4_init): Adjust to latest m4.git changes.
2358 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
2359 effects.
2360 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
2361 (_m4_list_cmp): Reduce side effects.
2362
2363 2008-08-27 Akim Demaille <demaille@gostai.com>
2364
2365 Check yyerrok in calc.at.
2366 * tests/calc.at (calc.y): Use yyerrok on "( error )".
2367 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
2368 expected.
2369
2370 2008-08-27 Akim Demaille <demaille@gostai.com>
2371
2372 Support yyerrok in lalr1.cc.
2373 YYBACKUP is still to import back into lalr1.cc.
2374 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
2375
2376 2008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
2377
2378 For maintainer-check*, don't recompile for a $(VERSION) update.
2379 * cfg.mk: New file.
2380 (_is-dist-target): Override the one in GNUmakefile.
2381 * Makefile.am (EXTRA_DIST): Add cfg.mk.
2382
2383 2008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
2384
2385 Update for recent change to gnulib.
2386 * src/parse-gram.y: Don't include strverscmp.h. It comes from
2387 string.h now.
2388
2389 2008-08-15 Eric Blake <ebb9@byu.net>
2390
2391 Remaining m4sugar merge from autoconf.
2392 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
2393 * data/m4sugar/foreach.m4: New file, copied from autoconf.
2394 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
2395 * src/output.c (output_skeleton): Tell m4 how to find it.
2396
2397 Partial m4sugar merge from autoconf: m4_map.
2398 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
2399 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
2400 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
2401 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
2402 for empty list.
2403 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
2404 Likewise.
2405 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
2406 declares it.
2407
2408 2008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
2409
2410 Keep .version and PACKAGE_VERSION in sync.
2411 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
2412 dependency, and add comments justifying this in more detail. Discussed
2413 starting at
2414 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
2415
2416 2008-08-06 Eric Blake <ebb9@byu.net>
2417
2418 Partial m4sugar merge from autoconf: m4_shiftn.
2419 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
2420 (m4_shift2, m4_shift3): New macros.
2421 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
2422 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
2423 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
2424 * data/java.m4 (b4_remove_comma): Likewise.
2425
2426 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
2427 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
2428 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
2429 (m4_init): Consolidate wrapped text into single m4_wrap.
2430 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
2431 in wrapped text.
2432
2433 2008-08-05 Eric Blake <ebb9@byu.net>
2434
2435 Partial m4sugar merge from autoconf: builtins, version.m4.
2436 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
2437 (m4_prepend): Remove, as it is unused and inherently quadratic,
2438 whereas m4_append is linear in newer m4.
2439 (m4_mkstemp): New builtin.
2440 (m4_symbols): Make rename conditional.
2441 (m4_version_prereq): Ensure fatal error if used in bison, which
2442 intentionally lacks version.m4.
2443
2444 Fix comments in m4sugar.
2445 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
2446
2447 2008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
2448
2449 Update for recent .gitignore fix in Gnulib.
2450 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
2451 anchored .gitignore entries.
2452
2453 2008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
2454
2455 Set gnu or gnits strictness.
2456 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
2457 development and gnits strictness for releases. Based on Eric Blake's
2458 suggestion at
2459 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
2460
2461 2008-07-31 Paolo Bonzini <bonzini@gnu.org>
2462
2463 * NEWS: Clarify documentation of %language.
2464
2465 2008-07-31 Paolo Bonzini <bonzini@gnu.org>
2466
2467 Support usage of git-merge-changelog.
2468 * .gitattributes: New.
2469 * HACKING: Document usage of git-merge-changelog.
2470 * bootstrap: Install git-merge-changelog entries in .git/config
2471 if appropriate.
2472
2473 2008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
2474
2475 Remove remaining dependence on CVS Id keyword.
2476 * ChangeLog: For the sake of people still using CVS, don't use dollars
2477 when mentioning Id.
2478 * data/xslt/bison.xsl: Remove Id from header comments, where it was
2479 unusual anyway.
2480 * data/xslt/xml2dot.xsl: Likewise.
2481 * data/xslt/xml2text.xsl: Likewise.
2482 * data/xslt/xml2xhtml.xsl: Likewise.
2483 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
2484 * doc/Makefile.am (neutralize): Remove, no longer needed.
2485 (.x.1): Don't use neutralize.
2486 (edit): Don't substitute for ID.
2487 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
2488
2489 2008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
2490
2491 Fix dependence on computed configure variables.
2492 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
2493 $(top_srcdir)/configure.ac so that changes to computed variables, such
2494 as PACKAGE_VERSION, are seen.
2495 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
2496
2497 2008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
2498
2499 Update copyright dates for recent changes.
2500 * Makefile.am: Here.
2501 * src/Makefile.am: Here.
2502 * src/reduce.c: Here.
2503 * tests/reduce.at: Here.
2504
2505 2008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
2506
2507 Use git-version-gen for version names between releases.
2508 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
2509 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
2510 * .prev-version: New.
2511 * .version.in: Remove.
2512 * ChangeLog: Remove the Id previously used for capturing the CVS
2513 revision.
2514 * GNUmakefile: Remove, now copied from Gnulib.
2515 * Makefile.am: Add code suggested by comments in
2516 build-aux/git-version-gen.
2517 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
2518 .prev-version, and .version.
2519 * NEWS (2.3b+): Rename to...
2520 (?.?): ... this because we're dropping the "+" version naming scheme,
2521 but, in general, we still can't be sure of our next release name.
2522 * bootstrap: Add a quick hack to remove from .gitignore the
2523 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
2524 entry. This should really be fixed in gnulib instead.
2525 * bootstrap.conf (gnulib_modules): Add gnumakefile.
2526 * configure.ac (AC_INIT): Set version name by invoking
2527 build-aux/git-version-gen.
2528 (AC_CONFIG_FILES): Remove .version, now generated by
2529 build-aux/git-version-gen.
2530 * maint.mk: New, copied from coreutils.
2531 * doc/.cvsignore (bison.1): Add.
2532 * doc/.gitignore (/bison.1): Add.
2533 * doc/bison.1: Remove, generated.
2534 * src/.cvsignore (revision.c): Remove.
2535 * src/.gitignore (/revision.c): Remove.
2536 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
2537 (BUILT_SOURCES): Remove revision.c.
2538 (revision.c): Remove.
2539 * src/getargs.c (version): Don't print revision after the VERSION.
2540 * src/revision.h: Remove.
2541
2542 2008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
2543
2544 Fix untranslatable composition of sentences. Reported by Goran
2545 Uddeborg at
2546 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
2547 * THANKS (Goran Uddeborg): Add.
2548 * src/reduce.c (reduce_print): Report the number of nonterminals and
2549 rules useless in the grammar in separate sentences.
2550 * tests/reduce.at (Useless Rules): Update output.
2551 (Reduced Automaton): Likewise.
2552 (Underivable Rules): Likewise.
2553 (Empty Language): Likewise.
2554
2555 2008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
2556
2557 Fix some .gitignore and .cvsignore problems.
2558 * bootstrap (insert_sorted_if_absent): Replace all uses with...
2559 (insert_vc_ignore): ... this new function, which prepends `/' to all
2560 .gitignore entries before passing them to insert_sorted_if_absent.
2561 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
2562 .cvsignore files are maintained even though Bison developers run
2563 bootstrap while using Git.
2564 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
2565 unneeded by Bison.
2566 (gnulib): Add.
2567 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
2568 unneeded. Reported by Eric Blake.
2569 * lib/.gitignore (/*~): Add.
2570 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
2571 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
2572 Blake.
2573 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
2574
2575 2008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
2576
2577 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
2578 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
2579 * bootstrap.conf (gnulib_modules): Add unsetenv.
2580 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
2581 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
2582 (/setenv.m4): Add.
2583 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
2584 the first argument because it may become position-dependent, and unset
2585 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
2586 Add comments explaining these issues in more detail.
2587
2588 2008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
2589
2590 Add .gitignore everywhere based on .cvsignore.
2591 * .gitignore: New.
2592 * build-aux/.gitignore: New.
2593 * data/.gitignore: New.
2594 * doc/.gitignore: New.
2595 * etc/.gitignore: New.
2596 * examples/.gitignore: New.
2597 * examples/calc++/.gitignore: New.
2598 * lib/.gitignore: New.
2599 * m4/.gitignore: New.
2600 * po/.gitignore: New.
2601 * runtime-po/.gitignore: New.
2602 * src/.gitignore: New.
2603 * tests/.gitignore: New.
2604
2605 2008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
2606
2607 * NEWS (2.3b+): New section, empty for now.
2608 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
2609
2610 2008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
2611
2612 * NEWS (2.3b): Update release date since there has been a delay in
2613 getting the announcements and tarballs out.
2614
2615 2008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
2616
2617 * NEWS: Version 2.3b.
2618 * configure.ac (AC_INIT): Likewise.
2619 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
2620
2621 2008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
2622
2623 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
2624 been doing it for years.
2625 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
2626 (Release Procedure): Add FIXME about make alpha being unmaintained.
2627
2628 2008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
2629
2630 * data/yacc.c: Reformat m4 a little for readability.
2631 * src/lalr.c (build_relations): Correct comment.
2632
2633 2008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2634
2635 DJGPP specific issue.
2636 * djgpp/config.sed: Fixes required to run configure scripts generated
2637 by autoconf 2.62.
2638
2639 2008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
2640
2641 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
2642 coordinator@translationproject.org.
2643
2644 2008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
2645
2646 * THANKS: Add Eric Blake.
2647
2648 2008-04-23 Eric Blake <ebb9@byu.net>
2649
2650 Revert prior patch, by working around autoconf regression.
2651 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
2652 ("Output file name: ("): Uncomment test.
2653 ("Output file name: )"): Likewise.
2654 Based on an idea from Noah Misch.
2655
2656 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2657
2658 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
2659 2.61. Reported by Juan Manuel Guerrero at
2660 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
2661 * tests/output.at ("Output file name: ("): Comment out test case for
2662 now.
2663 ("Output file name: )"): Likewise.
2664
2665 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2666
2667 * GNUmakefile: Update git-version-gen invocation so make dist
2668 succeeds.
2669
2670 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2671
2672 Update to the current gnulib CVS repository, and fix trigraph handling
2673 in Bison.
2674 * bootstrap: Update gnulib CVS repository URL.
2675 (symlink_to_dir): Encapsulate the code that guarantees the destination
2676 directory exists into...
2677 (check_dst_dir): ... this new function, and...
2678 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
2679 fail when copying files into lib/uniwidth/.
2680 * src/output.c (prepare_symbols): When writing yytname muscles, where
2681 symbol names will be encoded in C-string literals, tell quotearg to
2682 escape trigraphs. This used to be the default in gnulib.
2683 * tests/regression.at (Token definitions): Because of the change in
2684 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
2685 escapes trigraphs in symbol names. Thus, yytname no longer has
2686 trigraphs unnecessarily doubly escaped. Update test case output.
2687 Extend test case to be sure Bison's own error messages will no longer
2688 have trigraphs in symbol names unnecessarily escaped once.
2689
2690 2008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
2691
2692 Fix make dist infinite loop reported by Juan Manuel Guerrero at
2693 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
2694 * .cvsignore: Add .version.
2695 * .version.in: New.
2696 * bootstrap.conf (gnulib_modules): Add git-version-gen.
2697 * configure.ac (AC_CONFIG_FILES): Add .version.
2698 * build-aux/.cvsignore: Add git-version-gen.
2699
2700 2008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
2701
2702 * NEWS (2.3a+): Mention that -g now takes an argument.
2703 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
2704 consistency. Update the -g and -x entries now that they take
2705 arguments. Use brackets to indicate optional arguments.
2706 * src/getargs.c (usage): Explain the relationship between arguments of
2707 long and short options more completely. Document --defines and -d
2708 separately since the former takes an argument but, for POSIX Yacc, the
2709 latter does not.
2710 (short_options): Let -W take an optional argument like --warnings.
2711 (getargs): Sort cases.
2712
2713 2008-02-28 Akim Demaille <demaille@gostai.com>
2714
2715 * doc/bison.texinfo: Fix a few typos.
2716
2717 2008-02-28 Akim Demaille <akim@epita.fr>
2718
2719 * doc/bison.texinfo (Bison Options): Document -W.
2720 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
2721
2722 2008-02-28 Akim Demaille <akim@epita.fr>
2723
2724 * src/getargs.c (short_options): Split and sort for readability.
2725 -g and -x take optional arguments, just like their long options.
2726 * build-aux/cross-options.pl: Use /x to make the regexp easier to
2727 understand.
2728 Fix the handling of $opt which resulted in all the argument to be
2729 considered as optional.
2730
2731 2008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
2732
2733 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
2734 say its interface is experimental.
2735 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
2736 Java.
2737 (Bison Options): In the -L and --language entry, mention Java.
2738 (Java Bison Interface): Say the interface is experimental.
2739 * src/getargs.c (usage): Mention -L and --language.
2740
2741 * NEWS (2.3a+): Say the push parsing interface is experimental.
2742 * doc/bison.texinfo (Push Decl): Likewise.
2743 (Decl Summary): Likewise in the "%define api.push_pull" entry.
2744 (Push Parser Function): Likewise.
2745 (Pull Parser Function): Likewise.
2746 (Parser Create Function): Likewise.
2747 (Parser Delete Function): Likewise.
2748 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
2749 yypull_parse, and yypush_parse entries.
2750
2751 * NEWS (2.3a+): Mention XML support, and say the schema is
2752 experimental.
2753 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
2754 * src/getargs.c (usage): Say the XML schema is experimental.
2755
2756 * NEWS (2.3a+): Say option instead of flag.
2757
2758 2008-02-21 Wojciech Polak <polak@gnu.org>
2759
2760 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
2761 text.
2762
2763 2008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
2764
2765 Fix impure push parser compile error reported by Bob Rossi at
2766 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
2767 * data/yacc.c: Clean up whitespace in the output a little.
2768 (yypstate_allocated): Define for impure push parsers regardless of
2769 whether the pull interface is also requested.
2770 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
2771 check impure push parsers without the pull interface.
2772
2773 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
2774 yyerror takes arguments specified by %parse-param while yypstate_new
2775 does not.
2776 * doc/bison.texinfo (Parser Create Function): Document that
2777 yypstate_new returns 0 for multiple impure parser instances.
2778 * tests/push.at (Push Parsing: Multiple impure instances): Update
2779 expected stderr output.
2780
2781 2008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
2782
2783 * runtime-po/POTFILES.in (push.c): Remove.
2784
2785 2008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
2786
2787 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
2788 * data/push.c: Rename to...
2789 * data/yacc.c: ... this, overwriting it.
2790 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
2791 `%push-pull-parser' -> `%define api.push_pull "both"'.
2792 Remove old yacc.c tests, and update push.c tests to yacc.c.
2793
2794 2008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
2795
2796 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
2797 `"%code top" blocks' instead of `%code "top" blocks'.
2798 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
2799 Clean up whitespace in the output a little.
2800
2801 2008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
2802
2803 Fix documentation problems reported by Tim Josling at
2804 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
2805 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
2806 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
2807 integers. Explain the effect of literal string aliases on error
2808 messages. Copy token 0 documentation from the C++ skeleton
2809 documentation.
2810
2811 2008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
2812
2813 Accept a token number in a %left, %right, or %nonassoc for POSIX
2814 conformance. Reported by Tim Josling at
2815 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
2816 * NEWS (2.3a+): Mention.
2817 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
2818 and code numbers are treated by precedence declarations.
2819 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
2820 of symbols.1.
2821 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
2822 of symbol.
2823 (symbol.prec): New, just like symbol but allows INT.
2824 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
2825 longer holds.
2826 * tests/regression.at (Token number in precedence declaration): New
2827 test case.
2828
2829 2008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2830
2831 DJGPP specific issues.
2832 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
2833 be changed. Copyright timestamp adjusted.
2834 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
2835 be changed. Copyright timestamp adjusted.
2836 * djgpp/config.site: Copyright timestamp adjusted.
2837 * djgpp/config_h.sed: Copyright timestamp adjusted.
2838 * djgpp/djunpack.bat: Copyright timestamp adjusted.
2839 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
2840 filename translation list.
2841 * djgpp/subpipe.c (init_subpipe): Check the environment variables
2842 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
2843 files shall be created. Before trying to use the temp dir where the
2844 environment variable points to check that the dir really exists. If
2845 not default to the cwd as temp dir. Copyright timestamp adjusted.
2846 * djgpp/subpipe.h: Copyright timestamp adjusted.
2847 * djgpp/testsuite.sed: Copyright timestamp adjusted.
2848
2849 2008-01-30 Paul Eggert <eggert@cs.ucla.edu>
2850
2851 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
2852
2853 2008-01-09 Paul Eggert <eggert@cs.ucla.edu>
2854
2855 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
2856 Problem reported by Claudio Saavedra in
2857 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
2858
2859 2008-01-05 Wojciech Polak <polak@gnu.org>
2860
2861 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
2862 document's title with the input grammar file name.
2863
2864 2007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
2865
2866 Automate regression testing of the XML/XSLT implementation. Discussed
2867 starting at
2868 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
2869 * configure.ac (XSLTPROC): New substitution.
2870 * Makefile.am (maintainer-xml-check): New phony target invoking...
2871 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
2872 invoking make maintainer-check with BISON_TEST_XML=1.
2873 * tests/atlocal.in (XSLTPROC): New.
2874 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
2875 not to report reachable memory when Bison is expected to have a
2876 non-zero exit status and (2) to compare XML/XSLT output with --graph
2877 and --report=all output for every working grammar when
2878 BISON_TEST_XML=1.
2879 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
2880 (AT_BISON_CHECK_XML): New.
2881 (AT_QUELL_VALGRIND): New.
2882 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
2883 (AT_CHECK): ... don't redefine this since this was the old way to
2884 quell Valgrind.
2885 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
2886 AT_BISON_CHECK invocations.
2887 * tests/c++.at: Likewise.
2888 * tests/calc.at: Likewise.
2889 * tests/conflicts.at: Likewise.
2890 * tests/cxx-type.at: Likewise.
2891 * tests/existing.at: Likewise.
2892 * tests/glr-regression.at: Likewise.
2893 * tests/headers.at: Likewise.
2894 * tests/input.at: Likewise.
2895 * tests/java.at: Likewise.
2896 * tests/output.at: Likewise.
2897 * tests/push.at: Likewise.
2898 * tests/reduce.at: Likewise.
2899 * tests/regression.at: Likewise.
2900 * tests/sets.at: Likewise.
2901 * tests/skeletons.at: Likewise.
2902 * tests/synclines.at: Likewise.
2903 * tests/torture.at: Likewise.
2904 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
2905 tends to hang xsltproc.
2906 (Big horizontal): Likewise.
2907
2908 2007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
2909
2910 In XML output, remove redundant class attribute on symbol element.
2911 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
2912 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
2913 look up a symbol to determine whether it's a nonterminal or terminal.
2914 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
2915 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
2916
2917 Add prec/assoc information to XML output.
2918 * src/gram.c (grammar_rules_print_xml): For each rule that has a
2919 %prec, add a percent_prec attribute.
2920 * src/print-xml.c (print_grammar): For each terminal that has a
2921 precedence or associativity, add a prec or assoc attribute.
2922 (xml_indent): New.
2923 (xml_puts): Use xml_indent.
2924 (xml_printf): Use xml_indent.
2925 * src/print-xml.h (xml_indent): Prototype.
2926
2927 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
2928 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
2929
2930 2007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
2931
2932 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
2933 (bison:ruleByNumber): ... this for clarity.
2934 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
2935 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
2936 (xsl:template match="reduction"): Update.
2937 (xsl:template match="item"): Update.
2938 (xsl:template match="reduction"): Update.
2939
2940 In the XML output, don't print the list of rules where symbols appear.
2941 Compute it in XSLT instead. Discussed at
2942 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
2943 * data/xslt/bison.xsl (bison:ruleByLhs): New.
2944 (bison:ruleByRhs): New.
2945 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
2946 bison:ruleByRhs.
2947 (xsl:template match="terminal/rule"): Remove.
2948 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
2949 bison:ruleByRhs.
2950 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
2951 Remove.
2952 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
2953 bison:ruleByRhs and mode="number-link" for rule template.
2954 (xsl:template match="terminal/rule"): Remove.
2955 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
2956 bison:ruleByRhs and mode="number-link" for rule template.
2957 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
2958 Rewrite as...
2959 (xsl:template match="rule" mode="number-link"): ... this.
2960 * src/print-xml.c (print_grammar): Don't print the list of rules.
2961
2962 2007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
2963
2964 Don't let --report affect XML output; always print all information.
2965 Discussed at
2966 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
2967 * src/conflicts.c (log_resolution): Implement.
2968 * src/print-xml.c (print_core): Implement.
2969 (print_state): Implement.
2970 (print_xml): Implement.
2971
2972 * NEWS (2.3a+): Fix quotes.
2973 * src/parse-gram.y (prologue_declaration): For consistency with -v,
2974 don't let %verbose clear the list specified by --report.
2975
2976 2007-11-26 Akim Demaille <akim@epita.fr>
2977
2978 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
2979
2980 2007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
2981
2982 In the XML output, list useless and unused symbols and rules with the
2983 useful ones and add a "usefulness" attribute. Discussed starting at
2984 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
2985 * src/gram.c (grammar_rules_partial_print_xml): Remove.
2986 (grammar_rules_print_xml): Print all rules instead of just those
2987 useful in the grammar, and add a "usefulness" attribute.
2988 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
2989 * src/print-xml.c (print_rules_useless_in_parser): Remove.
2990 (print_grammar): Print all nonterminals instead of just useful ones,
2991 and add a "usefulness" attribute to nonterminals and terminals.
2992 (print_xml): Don't print a separate "reductions" or
2993 "rules-useless-in-parser" element.
2994 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
2995 (reduce_xml): Remove.
2996 (reduce_token_unused_in_grammar): New.
2997 (reduce_nonterminal_useless_in_grammar): New.
2998 * src/reduce.h (reduce_xml): Remove prototype.
2999 (reduce_token_unused_in_grammar): Add prototype.
3000 (reduce_nonterminal_useless_in_grammar): Add prototype.
3001 * data/xslt/xml2text.xsl: Update for XML changes.
3002 * data/xslt/xml2xhtml.xsl: Update for XML changes.
3003 * tests/reduce.at (Useless Terminals): Update output.
3004 (Useless Rules): Update output.
3005 (Reduced Automaton): Update output.
3006
3007 Say "Terminals unused in grammar" instead of "Unused terminals".
3008 * NEWS (2.3a+): Update.
3009 * doc/bison.texinfo (Understanding): Update example output.
3010 * src/reduce.c (reduce_output): Implement.
3011 * data/xslt/xml2text.xsl: Implement.
3012 * data/xslt/xml2xhtml.xsl: Implement.
3013
3014 2007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
3015
3016 Accept --report-file=FILE to override the default `.output' filename.
3017 * NEWS (2.3a+): Mention.
3018 * doc/bison.texinfo (Bison Options): Add an entry.
3019 * src/files.c (compute_output_file_names): Don't override
3020 spec_verbose_file if already set.
3021 * src/getargs.c (usage): Document --report-file.
3022 (REPORT_FILE_OPTION): New anonymous enum member.
3023 (long_options): Add entry for it.
3024 (getargs): Add case for it setting spec_verbose_file.
3025
3026 * build-aux/cross-options.pl: Don't record a short option just because
3027 there's an arg.
3028 * doc/.cvsignore: Add yacc.1.
3029
3030 2007-11-14 Akim Demaille <akim@epita.fr>
3031
3032 * doc/yacc.1.in: New.
3033 * configure.ac, doc/Makefile.am: Adjust.
3034 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
3035 config.h symbol.
3036 Use AC_SUBST for assignments too.
3037 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
3038
3039 2007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
3040
3041 * src/gram.c: Remove comments that duplicate comments in gram.h.
3042
3043 When reporting useless rules and nonterminals, say "useless in grammar"
3044 instead of "useless", and say "useless in parser" instead of "never
3045 reduced". Discussed starting at
3046 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
3047 * NEWS (2.3a+): Mention this change.
3048 * data/xslt/xml2text.xsl: Update output text and expected input XML
3049 element names to match changes below.
3050 * data/xslt/xml2xhtml.xsl: Likewise.
3051 (xsl:template match="bison-xml-report"): Add missing entry in Table of
3052 Contents: "Rules useless in parser due to conflicts".
3053 * doc/bison.texinfo (Decl Summary): Reword a little.
3054 (Understanding): Update example output for changes below.
3055 * src/gram.c: (rule_useful_p): Rename to...
3056 (rule_useful_in_grammar_p): ... this.
3057 (rule_useless_p): Rename to...
3058 (rule_useless_in_grammar_p): ... this.
3059 (rule_never_reduced_p): Rename to...
3060 (rule_useless_in_parser_p): ... this.
3061 (grammar_rules_print): Update for renames.
3062 (grammar_rules_print_xml): Update for renames.
3063 (grammar_rules_never_reduced_report): Rename to...
3064 (grammar_rules_useless_report): ... this since it is used for either
3065 kind of useless rule.
3066 * src/gram.h: Reword comments and update function names in prototypes.
3067 * src/main.c (main): Say "rule useless in parser due to conflicts".
3068 * src/print-xml.c (print_rules_never_reduced): Rename to...
3069 (print_rules_useless_in_parser): ... this, and rename output XML
3070 element "rules-never-reduced" to "rules-useless-in-parser".
3071 (print_xml): Update for rename.
3072 * src/print.c (print_results): Say "Rules useless in parser due to
3073 conflicts".
3074 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
3075 (nonterminals_reduce): Say "nonterminal useless in grammar".
3076 (reduce_output): Say "Nonterminals useless in grammar".
3077 Say "Rules useless in grammar".
3078 (reduce_xml): Rename output XML element "useless" to
3079 "useless-in-grammar".
3080 (reduce_print): Don't report the count of grammatically useless rules
3081 as "rules never reduced" just because %yacc is specified.
3082 In the correct report of this count, say nonterminal(s) and rule(s)
3083 "useless in grammar".
3084 * tests/conflicts.at (S/R in initial): Update expected output.
3085 (Defaulted Conflicted Reduction): Likewise.
3086 (Unreachable States After Conflict Resolution): Likewise.
3087 * tests/existing.at (GNU pic Grammar): Likewise.
3088 * tests/reduce.at (Useless Nonterminals): Likewise.
3089 (Useless Rules): Likewise.
3090 (Reduced Automaton): Likewise.
3091 (Underivable Rules): Likewise.
3092 (Empty Language): Likewise.
3093
3094 2007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
3095
3096 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
3097 here document and before the EOF so that BSD's implementation of Bourne
3098 shell doesn't parse the delimiter as part of the here document.
3099 * doc/.cvsignore: Add cross-options.texi.
3100 * src/getargs.c (usage): Add a blank line after the warning categories.
3101
3102 2007-11-08 Paolo Bonzini <bonzini@gnu.org>
3103
3104 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
3105
3106 2007-11-05 Akim Demaille <akim@epita.fr>
3107
3108 Remove Id: from bison.1.
3109 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
3110 (perl -0777 -pi -e 's/\.PP\nId): New.
3111 (.x.1): Use it to ignore the version control revision.
3112
3113 2007-11-05 Akim Demaille <demaille@gostai.com>
3114
3115 * build-aux/Makefile.am: Ship cross-options.pl.
3116 * doc/Makefile.am: Always refer to cross-options.texi with
3117 $(srcdir).
3118 (MAINTAINERCLEANFILES): Add it.
3119
3120 2007-11-04 Akim Demaille <demaille@gostai.com>
3121
3122 Generate the long/short option cross-table.
3123 * build-aux/cross-options.pl: New.
3124 * doc/Makefile.am (cross-options.texi): New.
3125 * doc/bison.texinfo: Use it.
3126
3127 2007-11-04 Akim Demaille <demaille@gostai.com>
3128
3129 Generate bison.1 using help2man.
3130 * doc/common.x, doc/bison.x: New.
3131 * doc/Makefile.am (bison.1, .x.1): New.
3132 The code is taken from autoconf-2.61/man/Makefile.am.
3133 * configure.ac: Look for help2man.
3134
3135 2007-11-04 Akim Demaille <demaille@gostai.com>
3136
3137 Complete --help.
3138 * src/getargs.c (usage): Document -W, make it clear that -d,
3139 -g and -x have optional arguments.
3140
3141 2007-11-04 Akim Demaille <demaille@gostai.com>
3142
3143 Find sha1sum when named gsha1sum.
3144 * bootstrap (find_tool): New.
3145 ($SHA1SUM): New.
3146
3147 2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
3148
3149 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
3150 at
3151 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
3152 * NEWS (2.3a+): Mention.
3153 * data/bison.m4 (b4_pure_if): Don't define it here.
3154 * data/c.m4 (b4_identification): Depend on individual skeletons to
3155 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
3156 values of the %define variables api.pure or api.push_pull. Define
3157 YYPURE, YYPUSH, and YYPULL accordingly.
3158 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
3159 glr.cc has already defined b4_pure_flag.
3160 * data/push.c: Define b4_pure_if based on `%define api.pure'.
3161 Remove YYPUSH and YYPULL since they're back in b4_identification again.
3162 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
3163 * doc/bison.texinfo (Pure Decl): Update.
3164 (Push Decl): Update.
3165 (Decl Summary): Add api.pure to %define entry.
3166 In %pure-parser entry, say it's deprecated and reference %define.
3167 (Pure Calling): Update.
3168 (Error Reporting): Update.
3169 (C++ Scanner Interface): Update.
3170 (How Can I Reset the Parser): Update.
3171 (Table of Symbols): In %pure-parser entry, say it's deprecated and
3172 reference %define.
3173 * src/getargs.c (pure_parser): Remove global variable.
3174 * src/getargs.h (pure_parser): Remove extern.
3175 * src/output.c (prepare): Don't define pure_flag muscle.
3176 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
3177 wrapper around `%define api.pure'.
3178 * tests/calc.at (Simple LALR Calculator): Update.
3179 (Simple GLR Calculator): Update.
3180 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
3181 Update.
3182 (GLR: Resolve ambiguity, pure, locations): Update.
3183 (GLR: Merge conflicting parses, pure, no locations): Update.
3184 (GLR: Merge conflicting parses, pure, locations): Update.
3185 * tests/glr-regression.at (Uninitialized location when reporting
3186 ambiguity): Update
3187 * tests/input.at (Unused %define api.pure): New test case.
3188 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
3189 AT_PURE_IF and AT_PURE_AND_LOC_IF.
3190 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
3191
3192 2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
3193
3194 %define push_pull -> %define api.push_pull. Discussed starting at
3195 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
3196 * data/push.c: Expect the new name.
3197 * data/yacc.c: Likewise.
3198 * doc/bison.texinfo (Push Decl): Update.
3199 (Decl Summary): Update %define entry.
3200 (Push Parser Function): Update.
3201 (Pull Parser Function): Update.
3202 (Parser Create Function): Update.
3203 (Parser Delete Function): Update.
3204 * tests/calc.at (Simple LALR Calculator): Update.
3205 * tests/input.at (%define enum variables): Update.
3206 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
3207 (Push Parsing: Multiple impure instances): Update.
3208 (Push Parsing: Unsupported Skeletons): Update.
3209 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
3210 (Exploding the Stack Size with Malloc): Update.
3211
3212 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
3213 other entries some.
3214
3215 2007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
3216
3217 For the XML output's terminal element, rename @number to @token-number,
3218 and add @symbol-number. In the nonterminal element, rename @number to
3219 @symbol-number. Discussed starting at
3220 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
3221 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
3222 renames.
3223 (xsl:template match="nonterminal"): Likewise.
3224 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
3225 (xsl:template match="nonterminal"): Likewise.
3226 * src/print-xml.c (print_grammar): Implement.
3227
3228 2007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
3229
3230 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
3231 2007-10-11 change, the child elements here are items not rules.
3232 (xsl:template match="item"): New.
3233 (xsl:template match="rule"): Update for new reduced itemset.
3234 (xsl:template match="point"): Remove.
3235 (xsl:template match="empty"): For consistency with --graph, don't
3236 output "/* empty */".
3237 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
3238 line-wrap, don't pass a negative value as first-line-length since this
3239 won't work with the following changes.
3240 (xsl:template name="line-wrap"): Simplify slightly.
3241 (xsl:template name="ws-search"): Eliminate recursion.
3242 * src/print_graph.c (print_core): Don't print a reduction's lookahead
3243 set next to an item whose dot is not at the end of the RHS even if it
3244 happens to be associated with the same rule.
3245
3246 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
3247
3248 Add %define lr.keep_unreachable_states.
3249 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
3250 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
3251 * src/main.c (main): Implement it.
3252 * tests/conflicts.at (Unreachable States After Conflict Resolution):
3253 Extend to test it, and fix a typo.
3254
3255 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
3256
3257 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
3258 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
3259 the example .output text.
3260 * tests/regression.at (Extra lookahead sets in report): Improve wording
3261 of comments.
3262
3263 2007-10-17 Wojciech Polak <polak@gnu.org>
3264
3265 * src/print-xml.c (print_grammar): Renamed
3266 <terminal> and <nonterminal> attributes:
3267 "type" to "number" and "symbol" to "name".
3268 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
3269 Use new attribute names.
3270 (xsl:template match="nonterminal"): Likewise.
3271 * data/xslt/xml2xhtml.xsl: Likewise.
3272
3273 2007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
3274
3275 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
3276 (Option Cross Key): Likewise.
3277
3278 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
3279 next to an item whose dot is not at the end of the RHS even if it
3280 happens to be associated with the same rule.
3281 * src/print.c (print_core): Likewise.
3282 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
3283 (Resolved SR Conflicts): Update output.
3284 * tests/regression.at (Extra lookahead sets in report): New test case.
3285
3286 2007-10-11 Wojciech Polak <polak@gnu.org>
3287
3288 * src/print-xml.c (print_core): Remove item set
3289 redundancy.
3290 * data/xslt/bison.xsl (bison:ruleNumber): New key.
3291 Improve processing time. Suggested by Joel E. Denny.
3292 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
3293 Write xsl:param "required" attribute as comment.
3294 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
3295 (xsl:template match="rule"): Support new reduced itemset.
3296 (xsl:template match="point"): Remove.
3297 * data/xslt/xml2xhtml.xsl: Likewise.
3298
3299 2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
3300
3301 * src/getargs.c (version): Update copyright year.
3302
3303 2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
3304
3305 Make xml2dot.xsl and --graph produce the same output.
3306 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
3307 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
3308 escaped later.
3309 (xsl:template name="output-node"): Use the new escape template instead
3310 of the string-replace template directly.
3311 (xsl:template name="output-edge"): Likewise.
3312 (xsl:template name="escape"): New, escapes backslashes and newlines in
3313 addition to quotation marks.
3314 * src/graphviz.c (start_graph, output_node, output_edge): Add
3315 whitespace to output for legibility.
3316
3317 Make xml2text.xsl and --report produce the same output, and remove the
3318 XML "conflicts" element since a conflict summary is easily extracted
3319 from the automaton.
3320 * data/xslt/bison.xsl: New.
3321 (xsl:template match="state" mode="bison:count-conflicts): New.
3322 * data/xslt/xml2text.xsl: Import bison.xsl.
3323 (xsl:template match="bison-xml-report"): Instead of styling the
3324 "conflicts" element, style the "automaton" element with mode
3325 "conflicts". Unlike the former, the latter lists S/R and R/R
3326 conflicts for a state on the same line.
3327 (xsl:template match="conflicts"): Remove.
3328 (xsl:template match="conflict"): Remove.
3329 (xsl:template match="terminal"): Line-wrap the list of rules in which
3330 the terminal is used.
3331 (xsl:template match="nonterminal"): Likewise for nonterminals.
3332 (xsl:template match="automaton" mode="conflicts"): New.
3333 (xsl:template match="state" mode="conflicts"): New.
3334 (xsl:template name="line-wrap"): New.
3335 (xsl:template name="ws-search"): New.
3336 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
3337 (xsl:template match="bison-xml-report"): Instead of styling the
3338 "conflicts" element, style the "automaton" element with mode
3339 "conflicts."
3340 (xsl:template match="conflicts"): Remove.
3341 (xsl:template match="conflict"): Remove.
3342 (xsl:template match="automaton" mode="conflicts"): New.
3343 (xsl:template match="state" mode="conflicts): New.
3344 * src/conflicts.c (conflicts_output_xml): Remove.
3345 * src/conflicts.h (conflicts_output_xml): Remove prototype.
3346 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
3347 * src/print.c (print_grammar): Consistently wrap at the 66th column so
3348 the corresponding XSLT is easier. Also, never wrap between a word and
3349 the comma that follows it.
3350
3351 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
3352
3353 Improve C++ namespace support. Discussed starting at
3354 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
3355 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
3356 b4_namespace_close): New macros that interpret the %define variable
3357 "namespace" so its value can contain "::" to indicate nested
3358 namespaces.
3359 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
3360 the above macros.
3361 * data/lalr1.cc (b4_namespace): Likewise.
3362 * data/location.cc (b4_namespace): Likewise.
3363 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
3364 inside a new table in the general %define entry. Document `%define
3365 namespace' there as well. Point the %name-prefix entry to it since it
3366 explains it more completely in the case of C++.
3367 (C++ Bison Interface): Mention `%define namespace' instead of
3368 %name-prefix.
3369 (Table of Symbols): Remove the `%define push_pull' entry. The %define
3370 entry suffices.
3371 * tests/c++.at (Relative namespace references): New test case.
3372 (Absolute namespace references): New test case.
3373 (Syntactically invalid namespace references): New test case.
3374 * tests/input.at (C++ namespace reference errors): New test case.
3375
3376 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
3377
3378 Add syncline support and location accessor to internal %define
3379 interfaces.
3380 * data/bison.m4 (b4_percent_define_get_loc): New.
3381 (b4_percent_define_get_syncline): New.
3382 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
3383 (b4_percent_define_default): Record defining location as line 1 rather
3384 than 0 for the sake of synchronizing #line's, and define
3385 b4_percent_define_syncline(VARIABLE).
3386 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
3387 * src/muscle_tab.c (muscle_syncline_grow): New.
3388 (muscle_code_grow): Use muscle_syncline_grow.
3389 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
3390 define b4_percent_define_syncline(VARIABLE).
3391 (muscle_percent_define_get_loc): New.
3392 (muscle_percent_define_get_syncline): New.
3393 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
3394 remove some unused variables.
3395 (muscle_percent_define_default): Record defining location as line 1
3396 rather than 0 for the sake of synchronizing #line's, and define
3397 b4_percent_define_syncline(VARIABLE).
3398 (muscle_percent_define_check_values): Use
3399 muscle_percent_define_get_loc.
3400 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
3401 (muscle_percent_define_get_syncline): Prototype.
3402 * tests/skeletons.at (%define Boolean variables: invalid skeleton
3403 defaults): Update output for location change.
3404 (Complaining during macro argument expansion): Extend to test
3405 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
3406
3407 2007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
3408
3409 Fix some error-reporting macro bugs.
3410 * data/bison.m4 (b4_cat): New.
3411 (b4_error, b4_error_at): Use b4_cat to send error directives directly
3412 to stdout so they don't become arguments to other macros. Update
3413 comments and add examples.
3414 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
3415 add examples.
3416 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
3417 after printing the error directive so that M4 doesn't report subsequent
3418 problems that are induced by this problem.
3419 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
3420 instead of just in them. Recognize @\n in both places. Both expand to
3421 the empty string. Needed by b4_cat.
3422 * tests/skeletons.at (Complaining during macro argument expansion):
3423 New test case.
3424 (Fatal errors make M4 exit immediately): New test case.
3425
3426 2007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
3427
3428 Implement --print-datadir.
3429 * src/getargs.c (usage): Mention.
3430 (PRINT_DATADIR_OPTION): New anonymous enum member.
3431 (long_options): Add entry for it.
3432 (getargs): Add case for it calling compute_pkgdatadir.
3433 * src/output.c (output_skeleton): Encapsulate data directory
3434 computation from here...
3435 (prepare): ... and from here...
3436 (compute_pkgdatadir): ... into this new function.
3437 * src/output.h (compute_pkgdatadir): Prototype.
3438
3439 2007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
3440
3441 * src/print-xml.c (escape_bufs): New static global variable
3442 replacing...
3443 (xml_escape_n): ... the static local variable buf here.
3444 (print_xml): Free memory for escape_bufs.
3445 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
3446
3447 2007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
3448
3449 Replace `%push-parser' and `%push-pull-parser' with
3450 `%define push_pull "push"' and `%define push_pull "both"'.
3451 `%define push_pull "pull"' is the default.
3452 * doc/bison.texinfo (Push Decl, Push Parser Function,
3453 Pull Parser Function, Parser Create Function, Parser Delete Function):
3454 Update declarations.
3455 (Decl Summary, Table of Symbols): Replace %push-parser and
3456 %push-pull-parser entries with a %define push_pull entry.
3457 * data/bison.m4 (b4_percent_define_check_values): New macro.
3458 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
3459 definitions...
3460 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
3461 definitions...
3462 * data/push.c: ... to here and compute them from the value of the
3463 %define variable push_pull.
3464 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
3465 parsing requests here...
3466 * data/yacc.c: ... hack this to switch to push.c any time
3467 b4_use_push_pull_flag or the %define variable push_pull is set. This
3468 will go away when we mv push.c yacc.c.
3469 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
3470 push parsing is not supported since unused %define variables are
3471 reported anyway.
3472 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
3473 * src/muscle_tab.h (muscle_percent_define_check_values): Update
3474 comments for consistency with b4_percent_define_check_values.
3475 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
3476 muscles.
3477 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
3478 Remove.
3479 (prologue_declaration): Remove %push-parser and %push-pull-parser
3480 rules.
3481 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
3482 * tests/calc.at: Update declarations.
3483 * tests/input.at (%define enum variables): New test case.
3484 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
3485 declaration.
3486 (Push Parsing: Multiple impure instances): Update declaration.
3487 (Push Parsing: Unsupported Skeletons): New test case.
3488 * tests/torture.at (Exploding the Stack Size with Alloca): Update
3489 declaration.
3490 (Exploding the Stack Size with Malloc): Update declaration.
3491
3492 2007-09-24 Wojciech Polak <polak@gnu.org>
3493
3494 Add XSLT transformations.
3495
3496 * data/xslt/xml2dot.xsl: Transform XML into DOT.
3497 * data/xslt/xml2text.xsl: Transform XML into plain text.
3498 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
3499 * data/Makefile.am (xsltdir): New variable.
3500 (dist_xslt_DATA): Add xslt/*.xsl files.
3501
3502 2007-09-23 Paul Eggert <eggert@cs.ucla.edu>
3503
3504 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
3505 Problem reported by Wojciech Polak.
3506 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
3507 (xml_printf): Undo change I made on 21 September; that is,
3508 indent 2 spaces, not 1.
3509
3510 2007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
3511
3512 Pacify ./configure --enable-gcc-warnings.
3513 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
3514 `char const *' instead of `char *'.
3515 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
3516 local variable `sep'.
3517
3518 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
3519
3520 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
3521 elsewhere.
3522 * src/print-xml.c: Prefer "const" after types; that's more consistent.
3523 (xml_printf): Indent just 1 space for level.
3524 (e_char, xlate_char): Remove.
3525 (xml_escape_string): Rewrite to avoid undefined behavior (used
3526 storage that was freed from the stack).
3527 (xml_escape_n): Don't bother checking for subscript error.
3528
3529 2007-09-21 Wojciech Polak <polak@gnu.org>
3530
3531 Add Bison XML Automaton Report.
3532
3533 Add support for an -x option to generate an XML report.
3534 It is not documented yet.
3535 * src/print-xml.c: New file.
3536 * src/print-xml.h: Likewise.
3537 * lib/timevar.def (TV_XML): New var.
3538 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
3539 * src/conflicts.c: Include print-xml.h.
3540 (solved_conflicts_xml_obstack): New var.
3541 (log_resolution, conflicts_solve, conflicts_free):
3542 Add support for XML report.
3543 (conflicts_output_val): New function.
3544 * src/conflicts.h (conflicts_output_val): New decl.
3545 * src/files.c (spec_xml_file): New var.
3546 (compute_output_file_names, output_file_names_free): Add XML support.
3547 * src/files.h (spec_xml_file): New decl.
3548 * src/getargs.c (xml_flag): New var.
3549 (usage, short_options, long_options, getargs): Add XML support.
3550 * src/getargs.h (xml_flag): New decl.
3551 * src/gram.c: Include print-xml.h.
3552 (rule_lhs_print_xml, rule_rhs_print_xml):
3553 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
3554 New functions.
3555 * src/gram.h: Declare external ones.
3556 * src/main.c: Include print-xml.h.
3557 (main): Add XML support.
3558 * src/reduce.c: Include print-xml.h.
3559 (reduce_xml): New function.
3560 * src/reduce.h: Declare it.
3561 * src/state.c: Include print-xml.h.
3562 (state_new): Add XML support.
3563 (state_rule_lookahead_tokens_print_xml): New function.
3564 * src/state.h: Declare it.
3565 (struct state): New member solved_conflicts_xml.
3566 * src/symtab.c (symbol_class_get_string): New function.
3567 * src/symtab.h: Declare it.
3568
3569 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
3570
3571 * GNUmakefile: Switch to coreutils's version.
3572 * bootstrap: Likewise.
3573 * Makefile.cfg: Adjust to new GNUmakefile.
3574 * README-hacking: Likewise.
3575
3576 Import from gnulib:
3577
3578 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
3579 Bruno Haible <bruno@clisp.org>
3580
3581 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
3582 and is a script that invokes bison. Tighten the code. Add comments.
3583
3584 2007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
3585
3586 Spell "boolean" as "Boolean". Reported by Akim Demaille.
3587 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
3588 * doc/bison.texinfo (Decl Summary): Fix.
3589 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
3590 * tests/input.at (Boolean %define variables): Update output.
3591 * tests/skeletons.at (%define boolean variables: invalid skeleton
3592 defaults): Rename to...
3593 (%define Boolean variables: invalid skeleton defaults): ... this and
3594 update output.
3595
3596 2007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
3597
3598 In impure push mode, don't allow more than one yypstate to be allocated
3599 since multiple impure parsers would corrupt yynerrs.
3600 * data/push.c (yypstate_allocated): New static global variable
3601 initialized to 0.
3602 (yypull_parse): If yypstate_new returns 0, don't report it as memory
3603 exhaustion if yypstate_allocated is 1, but still return 2.
3604 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
3605 already 1. Otherwise, set it to 1.
3606 (yypstate_delete): Set it to 0.
3607 * tests/push.at (Push Parsing: Multiple impure instances): New test
3608 case.
3609
3610 2007-08-17 Bob Rossi <bob@brasko.net>
3611
3612 * doc/bison.texinfo (Push Decl): Document the push parser.
3613 (Table of Symbols): Ditto.
3614 (Pure Decl): Ditto.
3615 (Decl Summary): Ditto.
3616 (Multiple Parsers, Push Parser Function, Pull Parser Function,
3617 Parser Create Function, Parser Delete Function):
3618 Add new push parser symbols.
3619 (Table of Symbols): Document push-parser, push-pull-parser,
3620 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
3621
3622 2007-08-15 Paul Eggert <eggert@cs.ucla.edu>
3623
3624 Update to GPLv3.
3625 * doc/gpl-3.0.texi: New file.
3626 * doc/gpl.texi: Remove.
3627 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
3628 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
3629 * README-hacking, TODO, bootstrap, bootstrap.conf:
3630 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
3631 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
3632 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
3633 * data/lalr1.cc, data/lalr1.java, data/location.cc:
3634 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
3635 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
3636 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
3637 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
3638 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
3639 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
3640 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
3641 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
3642 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
3643 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
3644 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
3645 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
3646 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
3647 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
3648 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
3649 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
3650 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
3651 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
3652 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
3653 * src/complain.c, src/complain.h, src/conflicts.c:
3654 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
3655 * src/files.h, src/flex-scanner.h, src/getargs.c:
3656 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
3657 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
3658 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
3659 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
3660 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
3661 * src/print.c, src/print.h, src/print_graph.c:
3662 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
3663 * src/reduce.h, src/relation.c, src/relation.h:
3664 * src/revision.h, src/scan-code.h, src/scan-code.l:
3665 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
3666 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
3667 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
3668 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
3669 * tests/Makefile.am, tests/actions.at, tests/c++.at:
3670 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
3671 * tests/existing.at, tests/glr-regression.at:
3672 * tests/headers.at, tests/input.at, tests/java.at:
3673 * tests/local.at, tests/output.at, tests/push.at:
3674 * tests/reduce.at, tests/regression.at, tests/sets.at:
3675 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
3676 * tests/torture.at:
3677 Update to GPLv3.
3678
3679 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
3680
3681 Get rid of broken %no-parser, -n, and --no-parser implementation and
3682 documentation.
3683 * TODO: Don't mention them.
3684 * doc/bison.1: Likewise.
3685 * doc/bison.texinfo (Decl Summary): Likewise.
3686 (Bison Options): Likewise.
3687 (Option Cross Key): Likewise.
3688 * src/getargs.c (no_parser_flag): Remove global variable.
3689 (usage): Don't print description of -n and --no-parser.
3690 (long_options): Remove --no-parser entry here.
3691 (getargs): Remove -n case in the switch here.
3692 * src/getargs.h (no_parser_flag): Remove extern.
3693 * tests/regression.at (Web2c Actions): Remove comment that mentions
3694 --no-parser.
3695
3696 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
3697
3698 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
3699 name user variables starting with `yy'. Just pass NULL instead of a
3700 dummy local &yylval to yypush_parse.
3701 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
3702 starting with `yy'.
3703
3704 2007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
3705
3706 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
3707 true since it's then always used regardless of whether yyoverflow is
3708 defined. Reported by Christian Burger at
3709 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
3710 * THANKS: Add Christian Burger.
3711
3712 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
3713 node names: say "Decl Summary" not "Bison Declaration Summary".
3714
3715 2007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
3716
3717 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
3718 determine whether this function has already complained about an invalid
3719 value for a %define boolean variable, don't check whether Bison has
3720 ever examined the value. As written, the check was a tautology.
3721 Instead, record and check for this complaint using a separate muscle.
3722
3723 2007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
3724
3725 Fix push parsing memory leak reported by Brandon Lucia at
3726 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
3727 * THANKS: Add Brandon Lucia.
3728 * data/push.c (yypstate_delete): Free the stack if it was reallocated
3729 but the parse never completed and thus freed it.
3730 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
3731 * tests/testsuite.at: Include push.at.
3732 * test/push.at: New.
3733 (Push Parsing: Memory Leak for Early Deletion): New test case.
3734
3735 2007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
3736
3737 Improve handling of multiple S/R conflicts in the same state and of S/R
3738 conflicts involving multiple reductions.
3739 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
3740 set for a state here or Bison will abort if it is reassigned on a
3741 later conflicted reduction in the same state.
3742 Similarly, don't finalize and assign the solved conflicts report here
3743 or it will be lost if it is reassigned on a later conflicted reduction
3744 in the same state.
3745 (set_conflicts): Instead, assign them both here after all S/R conflicts
3746 in the state have been fully examined.
3747 * src/print.c (shift_set): Rename to...
3748 (no_reduce_set): ... this.
3749 (print_reductions): Update for rename, and add %nonassoc error action
3750 tokens to no_reduce_set so that, when printing the first remaining
3751 reduction on an error action token, the reduction is enclosed in
3752 brackets.
3753 (print_results): Update for rename.
3754 * tests/conflicts.at (Solved conflicts report for multiple reductions
3755 in a state): New test case.
3756 (%nonassoc error actions for multiple reductions in a state): New test
3757 case.
3758
3759 * src/main.c (main): Don't depend on C99 features.
3760
3761 2007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
3762
3763 * build-aux/.cvsignore: Add compile.
3764 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
3765 uniwidth.
3766
3767 2007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
3768
3769 * bootstrap (slurp): Create target directories that don't exist.
3770 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
3771
3772 2007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
3773
3774 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
3775 than item number.
3776 * closure.c (closure): Likewise.
3777 * state.h (reductions): Comment sorting of rules.
3778 (state): Comment sorting of items.
3779
3780 2007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
3781
3782 Fix C++ test cases after recent Gnulib changes. Discussed starting at
3783 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
3784 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
3785 definition in order to avoid Gnulib headers since we don't use config.h
3786 here.
3787 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
3788 rather than AT_DATA so that config.h is included.
3789
3790 2007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
3791
3792 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
3793 instead of fprintf. Guard these functions with #if YYDEBUG instead of
3794 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
3795 and so that YYFPRINTF is guaranteed to be defined here.
3796
3797 2007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
3798
3799 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
3800 with...
3801 (muscle_percent_define_check_values): ... this more helpful function.
3802 Again, it's not used yet, but it will be.
3803 * src/muscle_tab.h: Likewise.
3804
3805 Improve some comments in parser table construction.
3806 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
3807 (generate_states): Don't mention ruleset, which is internal to closure.
3808 * src/closure.c (closure): Explain sorting of core and itemset, which
3809 is required for this function to behave correctly.
3810 * src/closure.h (closure): Mention sorting.
3811
3812 2007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
3813
3814 * src/lalr.c (state_lookahead_tokens_count): For code readability,
3815 move the check for disabled transitions to an aver since conflict
3816 resolution hasn't happened yet.
3817
3818 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
3819 labels a state as inconsistent just because it has error transitions.
3820 The original form of this check appeared in revision 1.1 of lalr.c,
3821 which was committed on 1991-12-21. Now (at least), changing the
3822 consistency label on such a state appears to have no useful effect in
3823 any of the places it is examined, which I enumerate below. The key
3824 point to understanding each item in this enumeration is that a state
3825 with an error transition is labelled consistent in the first place only
3826 if it has no rules, so the check cannot matter for states that have
3827 rules. (1) Labelling a state as inconsistent will cause set_conflicts
3828 to try to identify its conflicts, and a state must have *rules* to have
3829 conflicts. (2) Labelling a state as inconsistent will affect how
3830 action_row sets the default *rule* for the state. (3) Labelling a
3831 state as inconsistent will cause build_relations to add lookback edges
3832 to *rules* in that state.
3833 * src/state.h (struct state): Word the comment for member consistent
3834 more carefully.
3835
3836 2007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
3837
3838 Don't depend on C99 features.
3839 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
3840 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
3841 * src/reader.c (check_and_convert_grammar): Fix for-loop.
3842 * src/state.c (state_mark_reachable_states): Fix for-loop.
3843 (state_remove_unreachable_states): Fix for-loop.
3844
3845 Don't widen struct state with member reachable just to temporarily
3846 record reachability. Instead, use a local bitset.
3847 * src/state.h (struct state): Remove member.
3848 * src/state.c (state_new): Don't initialize it.
3849 (state_mark_reachable_states): Rename to...
3850 (state_record_reachable_states): ... this, and use bitset.
3851 (state_remove_unreachable_states): Use bitset.
3852
3853 2007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
3854
3855 * src/Makefile.am (yacc): Quote target action commands properly so
3856 that the yacc script isn't corrupt. Reported by Hans Aberg at
3857 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
3858
3859 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
3860 the case of pure parsers. Reported by Frans Englich at
3861 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
3862 * THANKS: Add Frans Englich.
3863
3864 * NEWS (2.3a+): In the %code entry, reference section `Bison
3865 Declaration Summary' from the manual now since the %code summary has
3866 moved there.
3867 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
3868 in the rules section must be terminated by semicolons.
3869
3870 2007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
3871
3872 Extend the front-end API for %define variables to more completely
3873 mirror the back-end. This will be useful in the future.
3874 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
3875 Update comments to mention the new front-end counterparts of these
3876 macros.
3877 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
3878 for muscle_string_decode and muscle_location_decode.
3879 (muscle_string_decode): New static function.
3880 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
3881 (muscle_percent_define_get, muscle_percent_define_ifdef): New
3882 functions.
3883 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
3884 muscle_percent_define_get to mimic the b4_percent_define_flag_if
3885 implementation more closely.
3886 (muscle_percent_define_invalid_value): New function.
3887 * src/muscle_tab.h (muscle_percent_define_get,
3888 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
3889 Prototype.
3890
3891 2007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
3892
3893 * NEWS (2.3a+): Mention yesterday's state-removal change.
3894 (2.3a): Remove the %language entry, which was added after 2.3a.
3895 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
3896 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
3897 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
3898 tests/existing.at: Update copyright date.
3899
3900 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
3901
3902 If conflict resolution makes states unreachable, remove those states,
3903 report rules that are then unused, and don't report conflicts in those
3904 states.
3905 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
3906 New global function.
3907 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
3908 function.
3909 * src/main.c (main): After conflict resolution, remove the unreachable
3910 states and update all data structures that reference states by number.
3911 * src/state.c (state_new): Initialize each state's reachable member to
3912 false.
3913 (state_mark_reachable_states): New static function.
3914 (state_remove_unreachable_states): New global function.
3915 * src/state.h (struct state): Add member bool reachable.
3916 (state_remove_unreachable_states): Prototype.
3917 * tests/conflicts.at (Unreachable States After Conflict Resolution):
3918 New test case.
3919 * tests/existing.at (GNU pic Grammar): Update test case output now that
3920 an unused rule is discovered.
3921
3922 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
3923
3924 Minor code cleanup in parser table construction.
3925 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
3926 (new_itemsets, save_reductions): Update for rename to nitemset.
3927 * src/closure.c (nritemset): Rename to...
3928 (nitemset): ... this since the "r" appears to meaningless and isn't
3929 used in the comments.
3930 (closure): Update for rename.
3931 * src/closure.h (nritemset): Update extern to...
3932 (nitemset): ... this.
3933 * src/lalr.c (LA): Fix a typo in comments.
3934 * src/print.c (print_core): Update for rename to nitemset.
3935 * src/print_graph.c (print_graph): Likewise.
3936 * src/state.h: Fix some typos in header comments.
3937
3938 2007-04-04 Paul Eggert <eggert@cs.ucla.edu>
3939
3940 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
3941 still sticks to ASCII. Sorry!
3942
3943 * README-hacking: New file, taken mostly from coreutils, with changes
3944 for Bison. Contains much of the contents of:
3945 * README-cvs: Remove.
3946 * bootstrap: Sync from gnulib.
3947 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
3948 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
3949
3950 2007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
3951
3952 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
3953 Setzer.
3954 (Java Differences): Fix some typos.
3955 * THANKS: Add Sebastian Setzer.
3956
3957 2007-03-07 Paolo Bonzini <bonzini@gnu.org>
3958
3959 * data/java.m4 (b4_single_class_if): Remove.
3960 (b4_abstract_if): Look at "%define abstract".
3961 (b4_lexer_if): New.
3962 (b4_union_name): Rename...
3963 (b4_yystype): ... to this. Map to "%define stype".
3964 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
3965 b4_maybe_throws): Fix quoting.
3966 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
3967 * data/lalr1.java (Lexer interface): Always define.
3968 (Lexer interface within parser class): Remove.
3969 (YYLexer class): New, used when "%code lexer" is present.
3970 (constructor): When "%code lexer" is used, pass %lex-param
3971 to the lexer constructor.
3972 (yylex, yyparse): Remove %lex-param from method invocations
3973 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
3974
3975 * doc/bison.texinfo (Java Bison Interface): Mention "%define
3976 abstract". Rename "%define union_name" to "%define stype".
3977 Rename method names according to previous patch.
3978 (Java Scanner Interface): Describe "%code lexer" instead of
3979 "%pure-parser" and "%define single_class".
3980 (Java Differences): Mention "%code lexer".
3981
3982 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
3983 Include scanner here, using macros from tests/local.at.
3984 (AT_DATA_CALC_Y): Remove final argument.
3985 (_AT_CHECK_JAVA_CALC): Likewise.
3986 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
3987 of %locations and %error-verbose.
3988 (main): Test with and without %lex-param.
3989 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
3990 (AT_BISON_OPTION_POPDEFS): Pop it.
3991
3992 2007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3993
3994 DJGPP spefic issue. Inhibit the use of disallowed characters for
3995 file name genertion on Win98, WinXP, etc. These are |<>":?*\
3996 and concern testsuite case 46.
3997 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
3998 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
3999 * djgpp/config.bat: Inhibit the use of disallowed characters.
4000
4001 2007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
4002
4003 Miscellaneous %define and %code cleanup.
4004 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
4005 values are interpreted.
4006 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
4007 documentation a little more.
4008 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
4009 muscle_percent_define_insert, muscle_percent_code_grow): New
4010 functions/macros.
4011 * src/muscle_tab.h (muscle_percent_define_insert,
4012 muscle_percent_code_grow): Prototype.
4013 * src/parse-gram.y (prologue_declaration): Use
4014 muscle_percent_define_insert and muscle_percent_code_grow when parsing
4015 %define and %code directives.
4016
4017 Make it easy to share %define boolean variables between the front-end
4018 and back-end. Though not used yet, this will be useful in the future.
4019 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
4020 Bison uses of names rather than just skeleton uses of names.
4021 (b4_percent_define_get, b4_percent_define_ifdef): Rename
4022 b4_percent_define_skeleton_variables(VARIABLE) to
4023 b4_percent_define_bison_variables(VARIABLE).
4024 (b4_percent_code_get, b4_percent_code_ifdef): Rename
4025 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
4026 b4_percent_code_bison_qualifiers(QUALIFIER).
4027 (b4_check_user_names_wrap): Update for renames.
4028 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
4029 muscle_percent_define_default): New functions mimicking
4030 b4_percent_define_flag_if and b4_percent_define_default.
4031
4032 For %define variables, report locations for invalid values and
4033 redefinitions.
4034 * data/bison.m4 (b4_percent_define_flag_if): Read
4035 b4_percent_define_loc(VARIABLE) to report the location of an invalid
4036 value for VARIABLE.
4037 (b4_percent_define_default): Save a special location in
4038 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
4039 must later be reported as invalid.
4040 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
4041 functions.
4042 (muscle_percent_define_insert): Record the location of VARIABLE in
4043 muscle percent_define_loc(VARIABLE), and use it to report the previous
4044 location for a redefinition.
4045 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
4046 (muscle_percent_define_default): Update like b4_percent_define_default.
4047 (muscle_grow_user_name_list): Rename to...
4048 (muscle_user_name_list_grow): ... this for consistency and use
4049 muscle_location_grow.
4050 * src/muscle_tab.h (muscle_location_grow): Prototype.
4051 * tests/input.at (%define errors): Update expected output.
4052 * tests/skeletons.at (%define boolean variables: invalid skeleton
4053 defaults): New test case.
4054
4055 2007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
4056
4057 * src/print.c (lookahead_set, state_default_rule): Remove.
4058 (print_reductions): Replace state_default_rule invocation with
4059 equivalent use of yydefact, which was computed in token_actions in
4060 tables.c.
4061 (print_results): Don't allocate lookahead_set.
4062
4063 2007-02-27 Paolo Bonzini <bonzini@gnu.org>
4064
4065 * data/lalr1.java: Prefix all private members with yy.
4066
4067 2007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
4068
4069 Use YYFPRINTF instead of fprintf where appropriate. Reported by
4070 Sebastien Fricker at
4071 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
4072 * THANKS: Add Sebastien Fricker.
4073 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
4074 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
4075 accept a variable number of arguments.
4076
4077 2007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
4078
4079 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
4080
4081 2007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4082
4083 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
4084 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
4085 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
4086
4087 2007-02-11 Paul Eggert <eggert@cs.ucla.edu>
4088
4089 Undo my 2007-02-07 change, switching back to the c-strcase module
4090 introduced in the 2007-02-03 change. Bruno Haible reported that
4091 the 2007-02-07 change would be dangerous in Turkish if we add a
4092 language whose name contains "i", since "i" is not lowercase "I"
4093 in Turkish.
4094 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
4095 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
4096 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
4097 * m4/.cvsignore: Remove strcase.m4.
4098 * src/getargs.c: Revert 2007-02-07 change, as follows.
4099 Include c-strcase.h.
4100 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
4101
4102 2007-02-11 Bruno Haible <bruno@clisp.org>
4103
4104 Enable the Java related testsuite tests when the only Java compiler
4105 found is a gcj < 4.3. Discussed at
4106 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
4107 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
4108
4109 2007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
4110
4111 * data/Makefile.am: Update copyright date.
4112 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
4113 yypstate_new returns NULL.
4114 (yypstate_new): Return NULL if malloc does.
4115 * src/reader.c (packgram): Move translation of rule actions from the
4116 beginning of packgram to...
4117 (check_and_convert_grammar): ... here right before packgram is invoked
4118 so it's easier to write more complete comments, and remove redundant
4119 code.
4120
4121 2007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
4122
4123 As in semantic actions, make @$ in %initial-action, %destructor, and
4124 %printer imply %locations.
4125 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
4126 scanning @$.
4127 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
4128 (@$ in %initial-action implies %locations,
4129 @$ in %destructor implies %locations,
4130 @$ in %printer implies %locations): ... these new test cases.
4131
4132 2007-02-07 Paul Eggert <eggert@cs.ucla.edu>
4133
4134 Undo most of the 2007-02-03 change, switching to the strcase module
4135 now that gnulib strcase has been fixed.
4136 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
4137 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
4138 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
4139 * m4/.cvsignore: Add strcase.m4.
4140 * src/getargs.c: Revert 2007-02-03 change, as follows.
4141 Don't include c-strcase.h.
4142 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
4143 strcasecmp has "unspecified behavior" outside the POSIX locale,
4144 but it works fine in practice if at least one argument is ASCII,
4145 as is the case in Bison.
4146
4147 2007-02-07 Paolo Bonzini <bonzini@gnu.org>
4148
4149 * tests/java.at: Skip tests if only one of javac/java is present.
4150 Reported by Joel E. Denny.
4151 * tests/atlocal.in: Adjust copyright years.
4152
4153 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
4154
4155 * data/lalr1.java (Stack): Work around old verifiers that disallow
4156 access to the private fields of an inner class, from the outer class.
4157 We can make Stack's fields public because user code doesn't have access
4158 to the instance of Stack used by parse(). Reported by Paul Eggert.
4159
4160 2007-02-03 Paul Eggert <eggert@cs.ucla.edu>
4161
4162 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
4163 the right spot for these files?
4164 * bootstrap.conf (gnulib_modules): Add c-strcase.
4165 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
4166 c-strncasecmp.c.
4167 * src/getargs.c: Include c-strcase.h.
4168 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
4169 to avoid unspecified behavior.
4170
4171 2007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
4172
4173 * doc/bison.texinfo (Decl Summary): Correct typo.
4174
4175 2007-01-30 Paolo Bonzini <bonzini@gnu.org>
4176
4177 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
4178 Complain if the value does not match empty, "true" or "false".
4179 * data/c++.m4: Adjust default definitions of %define variables.
4180 * data/java.m4: Adjust default definitions of %define variables.
4181 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
4182 to above behavior.
4183 * tests/input.at (Boolean %define variables): Test new behavior.
4184
4185 2007-01-29 Paolo Bonzini <bonzini@gnu.org>
4186
4187 * NEWS: Mention java.
4188 * TODO: Remove things that are done.
4189 * bootstrap.conf: Add javacomp-script and javaexec-script.
4190 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
4191
4192 * data/Makefile.am: Add new files.
4193 * data/java-skel.m4: New.
4194 * data/java.m4: New.
4195 * data/lalr1.java: New.
4196
4197 * doc/bison.texinfo: Put "A Complete C++ Example" under
4198 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
4199 under Other Languages.
4200
4201 * src/getargs.c (valid_languages): Add Java.
4202 * src/getargs.h (struct bison_language): Update size of string fields.
4203
4204 * tests/Makefile.am: Add java.at.
4205 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
4206 * tests/java.at: New.
4207 * tests/testsuite.at: Include it.
4208
4209 2007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
4210
4211 Clean up.
4212 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
4213 at_directive_argv arguments so these no longer have to be global
4214 variables. Also, update the implementation for the following changes.
4215 (fail_for_at_directive_too_many_args,
4216 fail_for_at_directive_too_few_args): Add at_directive_name argument.
4217 (at_directive_name): Remove as at_directive_argv[0] will be used for
4218 this now.
4219 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
4220 for the directive name.
4221 (at_directive_argc, at_directive_argv): Make these local within
4222 skel_lex instead of global.
4223 (INITIAL): Update directive start action for above changes.
4224 (SC_AT_DIRECTIVE_ARG): Rename to...
4225 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
4226 (SC_AT_DIRECTIVE_SKIP_WS): Update.
4227 (scan_skel): Move yylex_destroy to...
4228 (skel_scanner_free): ... here.
4229 * tests/skeletons.at (installed skeleton file name): Rename to...
4230 (installed skeleton file names): ... this.
4231
4232 2007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
4233
4234 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
4235 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
4236 Summary" not "Directives".
4237 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
4238 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
4239 since the former is now the more complete one.
4240 (Prologue Alternatives): Likewise and do the same for %defines.
4241 (Table of Symbols): Add summary of %code, add summary of %define, and
4242 move full %code documentation to...
4243 (Decl Summary): ... here for consistency with other entries in these
4244 sections.
4245 Move %define entry in order to keep this list alphabetized.
4246 Reword %define entry a little to put less emphasis on the skeleton
4247 concept, which most users shouldn't have to think about.
4248
4249 2007-01-26 Paul Eggert <eggert@cs.ucla.edu>
4250
4251 Adjust to recent gnulib changes.
4252 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
4253 Add string.h, string_.h, unistd_.h, wchar_.h.
4254 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
4255 * src/system.h: Don't include <stpcpy.h>; this is now done by
4256 <string.h>.
4257
4258 2007-01-23 Paolo Bonzini <bonzini@gnu.org>
4259
4260 Simplify implementation of unqualified %code, implement macros for
4261 uniform treatment of boolean %define flags. Document %define.
4262 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
4263 b4_percent_code_ifdef): New.
4264 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
4265 * data/c++.m4: Define default value for global_tokens_and_yystype.
4266 * data/glr.cc: Likewise.
4267 * data/location.cc: Use b4_percent_define_flag_if.
4268
4269 * doc/bison.texinfo (Decl Summary): Document %define.
4270
4271 * src/parse-gram.y (Unqualified %code): Change muscle name to
4272 b4_percent_code().
4273 (content.opt): Default to empty.
4274
4275 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
4276
4277 Implement support for relative and absolute skeleton file names.
4278 Discussed starting at
4279 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
4280 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
4281 (Bison Options): Document in --skeleton entry.
4282 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
4283 full_skeleton can't necessarily hold all of pkgdatadir.
4284 If the specified skeleton file name contains a `/', don't prepend
4285 pkgdatadir.
4286 * src/parse-gram.y (prologue_declaration): If the specified skeleton
4287 file name contains a `/', prepend the grammar file directory.
4288 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
4289 * skeletons.at: New file.
4290 (relative skeleton file names): New test case.
4291 (installed skeleton file names): New test case.
4292 * tests/testsuite.at: Include skeletons.at.
4293
4294 * bootstrap: Update copyright to 2007.
4295
4296 2007-01-17 Paolo Bonzini <bonzini@gnu.org>
4297
4298 * bootstrap: Remove occurrences of .#bootmp from the files.
4299
4300 2007-01-17 Akim Demaille <akim@epita.fr>
4301
4302 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
4303 nonterminals.
4304 Use per-type %printer.
4305
4306 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
4307
4308 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
4309 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
4310 djgpp/config.site, src/files.c, src/files.h, src/main.c,
4311 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
4312 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
4313 tests/glr-regression.at, tests/input.at, tests/local.at,
4314 tests/output.at, tests/torture.at: Update copyright to 2007.
4315
4316 2007-01-16 Akim Demaille <akim@epita.fr>
4317
4318 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
4319 error code.
4320 (Calc++ Scanner): Exit with failure if we can't open the input
4321 file.
4322 Accept "-" standing for stdin.
4323 (Calc++ Top Level): Print the result only if the parsing was
4324 successful.
4325
4326 2007-01-16 Akim Demaille <akim@epita.fr>
4327
4328 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
4329
4330 2007-01-15 Paolo Bonzini <bonzini@gnu.org>
4331 and Joel E. Denny <jdenny@ces.clemson.edu>
4332
4333 Clean up %define and %code implementation in M4 some. Most
4334 importantly, rename all related macros to be in the b4_percent_define
4335 and b4_percent_code namespaces. Also, complete support for `.' in
4336 %define variable names and %code qualifiers.
4337 * data/bison.m4 (b4_check_user_names): Check for special
4338 "SKELETON-NAMESPACE(name)" macros instead of using two nested
4339 m4_foreach loops.
4340 (b4_get_percent_define, b4_get_percent_code): Rename to...
4341 (b4_percent_define_get, b4_percent_code_get): ... these.
4342 Extend documentation with examples.
4343 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
4344 b4_percent_define_skeleton_variables and
4345 b4_percent_code_skeleton_qualifiers.
4346 Expect any value for the %define variable `foo' to be stored in the
4347 macro named `b4_percent_define(foo)'; expect any %code blocks for the
4348 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
4349 expect any unqualified %code blocks to be stored in a macro named
4350 `b4_percent_code_unqualified'.
4351 Use m4_indir so that %define variable names and %code qualifiers can
4352 contain `.', which is allowed by the grammar parser.
4353 (b4_percent_define_default): New macro to set a default value for a
4354 %define variable.
4355 (m4_wrap): Update wrapped code, and fix some underquoting.
4356 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
4357 Expect grammar uses of %define variables and %code qualifiers to be
4358 defined in b4_percent_define_user_variables and
4359 b4_percent_code_user_qualifiers.
4360 * data/c++.m4: Use b4_percent_define_default rather than
4361 m4_define_default. Fix some underquoting. Skeleton usage of %define
4362 variable define_location_comparison now implies skeleton usage of
4363 %define variable filename_type.
4364 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
4365 data/push.c, data/yacc.c: Update macro names.
4366 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
4367 muscle names.
4368
4369 2007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4370
4371 DJGPP specific issues.
4372
4373 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
4374 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
4375
4376 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
4377
4378 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
4379 run parsers in all tests so that Valgrind is invoked during
4380 maintainer-check-valgrind.
4381 (Duplicate representation of merged trees): Free all semantic values.
4382 (Duplicated user destructor for lookahead): Likewise.
4383
4384 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
4385
4386 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
4387 command-line prefix.
4388 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
4389 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
4390 miss Valgrind messages.
4391 (Exploding the Stack Size with Malloc): Likewise.
4392
4393 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
4394
4395 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
4396 locals. Reported by Juan Manuel Guerrero at
4397 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
4398 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
4399 Fix some indentation also.
4400 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
4401 explaining this issue.
4402
4403 2007-01-09 Paolo Bonzini <bonzini@gnu.org>
4404 and Joel E. Denny <jdenny@ces.clemson.edu>
4405
4406 Simplify union and prologue handling, and escape union and lex/parse
4407 params with digraphs.
4408 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
4409 values to the empty string since these are no longer guaranteed
4410 initialized by the front-end.
4411 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
4412 braces around b4_user_stype since this is no longer done by the
4413 front-end.
4414 * src/files.c, src/files.h (pre_prologue_obstack,
4415 post_prologue_obstack): Remove.
4416 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
4417 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
4418 with digraphs. This fixes lex params and parse params.
4419 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
4420 * src/output.c (prepare): Remove muscle insertion of the prologues.
4421 (output): Remove freeing of pre_prologue_obstack and
4422 post_prologue_obstack.
4423 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
4424 than prologue_augment for prologue parsing so you don't need prologue
4425 obstacks.
4426 (grammar_declaration): For %union RHS, use `braceless' instead of
4427 "{...}" so that braces are already stripped and code is escaped with
4428 digraphs.
4429 * src/reader.c (prologue_augment): Remove.
4430 (reader): Remove initialization of pre_prologue_obstack and
4431 post_prologue_obstack.
4432 * src/reader.h (prologue_augment): Remove.
4433
4434 * data/c.m4: Remove stray parenthesis.
4435
4436 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
4437
4438 Remove quotes from variables names in %define directives and from
4439 qualifiers in %code directives, and restrict the characters that are
4440 allowed in them to M4-friendly ones. For %define, continue to support
4441 the quoted form as a deprecated feature. Discussed starting at
4442 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
4443 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
4444 %code.
4445 * doc/bison.texinfo (Prologue Alternatives): Update.
4446 (Decl Summary): In %defines entry, update mention of `%code requires'
4447 and `%code provides'.
4448 (C++ Location Values): Update %define uses.
4449 (Calc++ Parser Interface): Likewise.
4450 (Calc++ Parser): Likewise, and update `%code requires' uses.
4451 (Table of Symbols): Update %code documentation.
4452 * src/parse-gram.y (prologue_declaration): For %define variables, use
4453 `variable' instead of `STRING'.
4454 (grammar_declaration): For %code qualifiers, use `ID' instead of
4455 `STRING'.
4456 (variable): New nonterminal that takes an `ID' or a `STRING'.
4457 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
4458 and %define uses.
4459 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
4460 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
4461 (%define errors): Update %define uses.
4462
4463 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
4464
4465 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
4466 instead of muscle_insert for %define values so that M4-special
4467 characters are replaced with digraphs.
4468 * tests/input.at (%define errors): Extend to check weird values.
4469
4470 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
4471
4472 Instead of having skeletons declare all valid %define variables and
4473 %code qualifiers, provide macros that retrieve the associated values
4474 and build these lists automatically. Thus Bison will now warn when a
4475 variable or qualifier is not used by the skeleton in the current
4476 invocation regardless of whether it might sometimes be used by that
4477 skeleton in other invocations. Also, move all %define value macros to
4478 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
4479 form, which is replaced by %code.
4480 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
4481 (b4_check_user_names): ... this, and change the series of valid name
4482 arguments to a single list argument for names used in the skeleton
4483 similar to the existing list argument for names used in the grammar.
4484 Warn instead of complaining.
4485 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
4486 values and %code code, to format %code code properly, and to build
4487 lists of all %define variables and %code qualifiers used in the
4488 skeleton: b4_skeleton_percent_define_variables and
4489 b4_skeleton_percent_code_qualifiers.
4490 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
4491 Remove, and...
4492 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
4493 the skeleton names lists can finish building first. In place of
4494 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
4495 expect the lists b4_user_percent_define_variables and
4496 b4_user_percent_code_qualifiers.
4497 * data/c++.m4: Where setting default values for b4_parser_class_name,
4498 b4_location_type, b4_filename_type, b4_namespace, and
4499 b4_define_location_comparison, update their names to the
4500 b4_percent_define_ namespace.
4501 * data/glr.c: Don't use b4_check_percent_define_variables and
4502 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
4503 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
4504 (b4_parser_class_name, b4_namespace): Define these using
4505 b4_get_percent_define for parser_class_name and namespace.
4506 * data/location.cc: Use b4_get_percent_define.
4507 * data/push.c: Don't use b4_check_percent_define_variables and
4508 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
4509 * data/yacc.c: Likewise, and don't call m4_exit in
4510 b4_use_push_for_pull_if or m4_wrap code will never execute.
4511 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
4512 Rename to...
4513 (muscle_grow_user_name_list): ... this for consistency with the
4514 terminology used in bison.m4.
4515 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
4516 %define variable names, and rename muscle used_percent_define_variables
4517 to user_percent_define_variables.
4518 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
4519 user_percent_code_qualifiers.
4520 (content): Remove.
4521 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
4522 {CODE} form is no longer accepted.
4523 * tests/input.at (Reject bad %code qualifiers): Rename to...
4524 (Reject unused %code qualifiers): ... this, and update test output.
4525 (%define error): Update test output.
4526
4527 2007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
4528
4529 Check for unrecognized %define variables similar to checking for
4530 unrecognized %code qualifiers. Check for redefined %define variables.
4531 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
4532 generalizes...
4533 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
4534 (b4_check_percent_define_variables): New, also wraps it.
4535 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
4536 variables using b4_check_percent_define_variables.
4537 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
4538 all those exercised in the test suite and all those listed in the
4539 `Default values' section of c++.m4. Are there others?
4540 * data/push.c, data/yacc.c: Declare no valid %define variables.
4541 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
4542 similar to muscle_find, but it works even when the muscle stores a
4543 const value.
4544 (muscle_grow_used_name_list): New function for constructing the used
4545 name list muscles that b4_check_for_unrecognized_names requires.
4546 * src/parse-gram.y (prologue_declaration): Warn if a variable is
4547 %define'd more than once. Define the b4_used_percent_define_variables
4548 muscle with muscle_grow_used_name_list.
4549 (grammar_declaration): Abbreviate %code code with
4550 muscle_grow_used_name_list.
4551 * tests/input.at (%define errors): New.
4552
4553 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
4554
4555 Provide warn_at, complain_at, and fatal_at function callbacks to the
4556 skeletons, and use this for %code qualifier complaints.
4557 * data/bison.m4 (b4_error_at): New, invoked by...
4558 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
4559 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
4560 @fatal_at(...@) directives.
4561 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
4562 qualifiers in b4_used_percent_code_qualifiers and to use
4563 b4_complain_at.
4564 * src/location.c, src/location.h (boundary_set_from_string): New global
4565 function.
4566 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
4567 function.
4568 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
4569 to b4_used_percent_code_qualifiers.
4570 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
4571 function.
4572 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
4573 (lineno): Rename to...
4574 (out_lineno): ... this so I don't misunderstand it again.
4575 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
4576 here; these newlines are in the input but not the output file.
4577 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
4578 (at_directive_perform): ... this new static function, and add handling
4579 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
4580 directives.
4581 * tests/input.at (Reject bad %code qualifiers): Update test output with
4582 locations and extend.
4583
4584 * tests/output.at (Output file name: [, Output file name: ]): Remove
4585 bogus comment about these tests failing.
4586
4587 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
4588
4589 Clean up b4_check_percent_code_qualifiers a little.
4590 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
4591 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
4592 documentation and add examples.
4593 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
4594 qualifiers here.
4595
4596 2007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
4597
4598 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
4599 unreliable -- especially when they're hidden inside another macro.
4600 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
4601 data/c.m4: Remove m4_divert(-1).
4602 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
4603 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
4604 m4_divert_push(0) and m4_divert_pop(0).
4605 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
4606 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
4607 pushed and popped by m4sugar, should be first on the stack.
4608
4609 Provide warn, complain, and fatal function callbacks to the skeletons.
4610 This provides more flexibility than m4_fatal, improves the error
4611 message format, and captures messages for translation. Discussed
4612 starting at
4613 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
4614 * data/bison.m4 (b4_error): New, invoked by...
4615 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
4616 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
4617 directives. Because these M4 macros might be called when the current
4618 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
4619 the previous removal of uses of m4_divert, which caused trouble.
4620 (b4_check_percent_code_qualifiers): Use b4_complain instead of
4621 m4_fatal to report unrecognized %code qualifiers.
4622 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
4623 push parser requests.
4624 * data/glr.c: Use b4_complain instead of m4_fatal to report
4625 non-deterministic push parser requests.
4626 Update @output usage to @output(...@) form.
4627 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
4628 report missing %defines. Update @output usage to @output(...@) form.
4629 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
4630 @output(...@) form.
4631 * src/main.c (main): Invoke skel_scanner_free.
4632 * src/scan-skel.h (skel_scanner_free): Prototype new function.
4633 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
4634 obstack_for_string from flex-scanner.h.
4635 (YY_DECL): Use to declare skel_lex static.
4636 (decode_at_digraphs): Remove; now handled in the new
4637 SC_AT_DIRECTIVE_ARG start condition.
4638 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
4639 functions.
4640 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
4641 at_directive_argv): New static globals.
4642 (INITIAL): Use fail_for_invalid_at.
4643 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
4644 recognize the start of a generalized `@directive(...@)' form and
4645 start...
4646 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
4647 directive args (using the new obstack_for_string), to decode the
4648 contained @ diagraphs, and to perform the directive. It recognizes
4649 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
4650 @output(...@).
4651 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
4652 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
4653 `@,'.
4654 (scan_skel): Initialize obstack_for_string on the first call.
4655 (skel_scanner_free): New function to free obstack_for_string.
4656 * tests/input.at (Reject bad %code qualifiers): Update test output.
4657
4658 2007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
4659
4660 Consolidate the 4 prologue alternative directives (%code, %requires,
4661 %provides, and %code-top) into a single %code directive with an
4662 optional qualifier field. Discussed at
4663 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
4664 * NEWS (2.3a+): Rewrite the existing entry for the prologue
4665 alternatives.
4666 * doc/bison.texinfo (Prologue Alternatives): Update.
4667 (Decl Summary): Update to %code "requires" and %code "provides".
4668 (Calc++ Parser): Update to %code "requires".
4669 (Table of Symbols): Remove entries for %requires, %provides, and
4670 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
4671 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
4672 are replaced by b4_percent_code_provides and b4_percent_code_requires,
4673 which are skeleton-specific.
4674 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
4675 declare what %code qualifiers it supports and to complain if any other
4676 qualifiers were used in the grammar.
4677 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
4678 and b4_user_code([b4_percent_code_provides]) in place of
4679 b4_user_requires and b4_user_provides.
4680 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
4681 Add b4_user_code([b4_percent_code_top]) and
4682 b4_user_code([b4_percent_code]).
4683 Invoke b4_check_percent_code_qualifiers.
4684 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
4685 PERCENT_REQUIRES): Remove.
4686 (grammar_declaration): Remove RHS's for %code-top, %provides, and
4687 %requires. Rewrite the %code RHS as the unqualified form defining the
4688 muscle b4_percent_code. Add another RHS for the qualified %code form,
4689 which defines muscles of the form b4_percent_code_QUALIFIER and the
4690 b4_used_percent_code_qualifiers muscle.
4691 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
4692 PERCENT_REQUIRES): Remove.
4693 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
4694 %code "requires" and %code "provides".
4695 * tests/input.at (Reject bad %code qualifiers): New.
4696
4697 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
4698
4699 Use the new code_props interface for destructors and printers.
4700 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
4701 printer_location members, and change the type of the destructor and
4702 printer members to code_props.
4703 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
4704 symbol_printer_get, semantic_type_destructor_set,
4705 semantic_type_printer_set, default_tagged_destructor_set,
4706 default_tagless_destructor_set, default_tagged_printer_set,
4707 default_tagless_printer_set): Use code_props in arguments and return
4708 types in place of char const * and location.
4709 (symbol_destructor_location_get, symbol_printer_location_get): Remove
4710 since the locations are now contained in the return of
4711 symbol_destructor_get and symbol_printer_get.
4712 * src/output.c (symbol_destructors_output, symbol_printers_output):
4713 Replace with...
4714 (symbol_code_props_output): ... this to eliminate duplicate code.
4715 (output_skeleton): Update to use symbol_code_props_output.
4716 * src/reader.c (symbol_should_be_used): Update use of
4717 symbol_destructor_get.
4718 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
4719 Update uses of the various _destructor_set and _printer_set functions.
4720 * src/symtab.c: (default_tagged_destructor_location,
4721 default_tagless_destructor_location, default_tagged_printer_location,
4722 default_tagless_printer_location): Remove since we...
4723 (default_tagged_destructor, default_tagless_destructor,
4724 default_tagged_printer, default_tagless_printer): ... change the type
4725 of these to code_props.
4726 (symbol_new, semantic_type_new, symbol_destructor_set,
4727 semantic_type_destructor_set, symbol_destructor_get,
4728 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
4729 symbol_check_alias_consistency, default_tagged_destructor_set,
4730 default_tagless_destructor_set, default_tagged_printer_set,
4731 default_tagless_printer_set): Update.
4732 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
4733 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
4734 code_props members.
4735 (symbol_print): Use SYMBOL_CODE_PRINT.
4736
4737 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
4738
4739 Use the new code_props interface for rule actions.
4740 * src/symlist.h (symbol_list): Replace action, action_location, and
4741 used members with a code_props action_props member.
4742 * src/reader.c (symbol_should_be_used, grammar_rule_check,
4743 grammar_midrule_action, grammar_current_rule_merge_set,
4744 grammar_current_rule_symbol_append, packgram): Update.
4745 * src/scan-code.h (translate_rule_action): Remove, no longer used.
4746 * src/scan-code.l (handle_action_dollar): Update.
4747 (translate_rule_action): Remove, no longer used.
4748 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
4749
4750 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
4751
4752 Use the new code_props interface in parse-gram.y.
4753 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
4754 Update all uses of translate_* functions to use the new code_props
4755 interface and to use gram_scanner_last_string_free and
4756 code_scanner_last_string_free where possible.
4757 (grammar_declaration): symbol_list_destructor_set and
4758 symbol_list_printer_set now perform the translation, so don't do it
4759 here. Use gram_scanner_last_string_free where possible.
4760 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
4761 translate_code): Remove, no longer used.
4762 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
4763 symbol_list_printer_set): Perform code translation here rather than
4764 depending on the caller to do so.
4765
4766 * src/symlist.h (struct symbol_list): Correct some documentation typos.
4767 * src/scan-gram.h (gram_last_string): Remove declaration.
4768 * src/scan-gram.l (last_string): Declare it static.
4769
4770 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
4771
4772 Encapsulate code properties and related functionality for the various
4773 destructors, printers, and actions into a code_props structure and
4774 interface. This patch merely implements code_props in scan-code.h and
4775 scan-code.l. Future patches will rewrite other modules to use it.
4776 Discussed starting at
4777 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
4778 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
4779 consistently initialize const structs that have an empty location
4780 field.
4781 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
4782 to ensure consistency.
4783 * src/scan-code.h (code_props): New structure.
4784 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
4785 function, macro, and const global variable for initializing a
4786 code_props with no code.
4787 (code_props_plain_init, code_props_symbol_action_init,
4788 code_props_rule_action_init, code_props_translate_code): The rest of
4789 the new code_props functional interface. Among other things, the init
4790 functions set the code_props kind field so that
4791 code_props_translate_code will know whether to behave like
4792 translate_symbol_action, translate_rule_action, or translate_code.
4793 These old translate functions must remain until all other modules are
4794 updated to use the new code_props interface.
4795 (code_scanner_last_string_free): New function similar to
4796 gram_scanner_last_string_free.
4797 (code_scanner_free): Add documentation.
4798 * src/scan-code.l: Implement the new interface.
4799 (code_lex): Make it static, add a code_props* argument, and remove the
4800 rule argument.
4801 (last_string): New static global similar to the one in scan-gram.l.
4802 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
4803 instead of rule.
4804 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
4805 code_props since Bison may one day use this information for destructors
4806 and printers.
4807 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
4808 (handle_action_dollar): Use symbol_list_n_get and set used flag
4809 directly since symbol_list_n_used_set is removed.
4810 (translate_action): Add a code_props* argument and remove the rule,
4811 action, and location arguments. Pass the code_props* on to code_lex.
4812 (translate_rule_action, translate_symbol_action, translate_code):
4813 Rewrite as wrappers around the new code_props interface.
4814 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
4815 it would eventually need to break the encapsulation of code_props.
4816
4817 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
4818
4819 * etc/.cvsignore: New.
4820
4821 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
4822
4823 Add maintainer-push-check to run maintainer-check using push parsing in
4824 place of pull parsing where available.
4825 * Makefile.am (maintainer-push-check): New.
4826 * data/bison.m4 (b4_use_push_for_pull_if): New.
4827 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
4828 appropriately based on their existing values.
4829 (yypush_parse): Don't print push-parser-specific diagnostics if push
4830 parsing is being used in place of pull parsing.
4831 * data/yacc.c: If push parsing should replace pull parsing, redirect to
4832 push.c.
4833 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
4834 variable, and insert b4_use_push_for_pull_flag into muscles.
4835 * tests/Makefile.am (maintainer-push-check): New.
4836
4837 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
4838
4839 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
4840 (whether successful or failed) so that yypush_parse can be invoked
4841 again to start a new parse using the same yypstate.
4842 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
4843 check multiple yypull_parse invocations on the same yypstate. For pull
4844 mode, extend to check multiple yyparse invocations.
4845 (Exploding the Stack Size with Alloca): Extend to try with
4846 %push-pull-parser.
4847 (Exploding the Stack Size with Malloc): Likewise.
4848
4849 * tests/calc.at (Simple LALR Calculator): Don't specify
4850 %skeleton "push.c" since %push-pull-parser implies that now.
4851 * tests/headers.at (export YYLTYPE): Don't check for the push
4852 declarations. Otherwise, this test case can't be used to see if push
4853 mode can truly emulate pull mode.
4854 * tests/input.at (Torturing the Scanner): Likewise.
4855 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
4856 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
4857 AT_YACC_IF, which now includes the case of push mode since %skeleton
4858 need not be used for push mode. This will be more intuitive once
4859 push.c is renamed to yacc.c.
4860
4861 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
4862
4863 For push mode, convert yyparse from a macro to a function, invoke yylex
4864 instead of passing a yylexp argument to yypull_parse, and don't
4865 generate yypull_parse or yyparse unless %push-pull-parser is declared.
4866 Discussed starting at
4867 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
4868 * data/bison.m4 (b4_pull_if): New.
4869 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
4870 * data/push.c: Improve M4 quoting a little.
4871 (b4_generate_macro_args, b4_parenthesize): Remove.
4872 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
4873 any time a pull parser is requested.
4874 Don't #define this as a wrapper around yypull_parse. Instead, when
4875 both push and pull are requested, make it a function that does that
4876 same thing.
4877 (yypull_parse): If there's a b4_prefix, #define this to
4878 b4_prefix[pull_parse] when both push and pull are requested.
4879 Don't define this as a function unless both push and pull are
4880 requested.
4881 Remove the yylexp argument and hard-code yylex invocation instead.
4882 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
4883 %push-parser.
4884 * src/getargs.c (pull_parser): New global initialized to true.
4885 * getargs.h (pull_parser): extern it.
4886 * src/output.c (prepare): Insert pull_flag muscle.
4887 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
4888 (prologue_declaration): Set both push_parser and pull_parser = true for
4889 %push-pull-parser. Set push_parser = true and pull_parser = false for
4890 %push-parser.
4891 * src/scan-gram.l: Don't accept %push_parser as an alternative to
4892 %push-parser since there's no backward-compatibility concern here.
4893 Scan %push-pull-parser.
4894 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
4895 instead of %push-parser.
4896 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
4897 prototype it in the module that calls yyparse.
4898 * tests/input.at (Torturing the Scanner): Likewise.
4899 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
4900
4901 2006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
4902
4903 Update etc/bench.pl. Optimize push mode a little (the yyn change
4904 deserves most of the credit).
4905 * Makefile.am (SUBDIRS): Add etc subdirectory.
4906 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
4907 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
4908 yytoken, yyval, and yyloc declarations to...
4909 (yyparse or yypush_parse): ... here to improve performance. For
4910 yypush_parse invocations after the first, be sure to assign yyn its old
4911 value again.
4912 (yypstate_new): Don't bother initializing the yyresult field since the
4913 initial value isn't used.
4914 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
4915 remove the #define that, in push mode, set it to yyps->NAME.
4916 * etc/Makefile.am: New.
4917 * etc/bench.pl: Remove and build it instead from...
4918 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
4919 "tests/bison" from the build directory by default rather than just
4920 invoking "bison" from $PATH.
4921 (calc_grammar): Update push parser code: don't declare yylval globally,
4922 don't define yyparse_wrapper, and don't #define yyparse.
4923 (bench_grammar): Update to check all working combinations of yacc.c,
4924 push.c, impure, pure, pull, and push.
4925
4926 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
4927
4928 For push mode, add pull wrappers around yypush_parse.
4929 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
4930 (yypull_parse): New function wrapping yypush_parse.
4931 (yyparse): New #define wrapping yypull_parse.
4932 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
4933 is declared.
4934 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
4935 prototype yylex in the module that calls yyparse, and don't prototype
4936 yyparse there. Otherwise, the yyparse expansion won't compile.
4937 * tests/input.at (Torturing the Scanner): Likewise.
4938
4939 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
4940
4941 Enable push parsers to operate in impure mode. Thus, %push-parser no
4942 longer implies %pure-parser. The point of this change is to move
4943 towards being able to test the push parser code by running the entire
4944 test suite as if %push-parser had been declared.
4945 * data/push.c (yypush_parse): For impure mode, remove the
4946 yypushed_char, yypushed_val, and yypushed_loc arguments.
4947 Instead, declare these as local variables initialized to the global
4948 yychar, yylval, and yylloc.
4949 For the first yypush_parse invocation only, restore the initial values
4950 of these global variables when it's time to read a token since they
4951 have been overwritten.
4952 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
4953 %push-parser.
4954 * tests/calc.at (Simple LALR(1) Calculator): Always declare
4955 %pure-parser along with %push-parser since this test case was designed
4956 for pure push parsers.
4957 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
4958 (AT_YACC_OR_PUSH_IF): New.
4959 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
4960 add a note that it's still wrong for some cases (as it has been for a
4961 while).
4962 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
4963 %push-parser no longer implies %pure-parser.
4964
4965 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4966
4967 Remove some unnecessary differences between the pull parser code and
4968 the push parser code. This patch enables yynerrs in push mode.
4969 * data/push.c: Reformat M4 a little.
4970 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
4971 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
4972 because push mode is on. Instead, if pure mode is on, move yynerrs
4973 to...
4974 (b4_declare_parser_state_variables): ... here.
4975 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
4976 to yyps->NAME so it can be used in yypush_parse.
4977 (yypush_parse): Don't omit uses of yynerrs in push mode.
4978
4979 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4980
4981 Fix bug such that the first pushed token's value and location are
4982 sometimes overwritten (sometimes by %initial-action) before being used.
4983 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
4984 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
4985 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
4986 more closely mimic the pull parser logic.
4987 Don't copy the pushed token to yychar, yylval, and yylloc until it's
4988 time to read a token, which is after any initialization of yylval and
4989 yylloc.
4990 (gottoken): Rename label to...
4991 (yyread_pushed_token): ... for clarity and to avoid infringing on the
4992 user namespace.
4993
4994 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4995
4996 Rearrange initialization of the parser state variables so that the
4997 skeleton doesn't have to have a copy for pull mode and another for push
4998 mode. This patch also fixes at least a bug such that yylloc was not
4999 initialized (with b4_location_initial_line and
5000 b4_location_initial_column) upon calling yypush_parse. However, that
5001 initialization now overwrites the first token's location;
5002 %initial-action assigning @$ already did the same thing, and both bugs
5003 will be fixed in a later patch.
5004 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
5005 (b4_declare_parser_state_variables): Remove initialization of yytoken,
5006 yyss, yyvs, yyls, and yystacksize.
5007 (yypstate_new): Remove initialization of some yypstate fields: yystate,
5008 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
5009 yylsp.
5010 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
5011 yyps->NAME so it can be used in yypush_parse.
5012 (yyparse or yypush_parse): For yypush_parse, don't print the
5013 "Starting parse" diagnostic for invocations after the first.
5014 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
5015 yypush_parse, only do it for the first invocation.
5016 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
5017 initialization to occur in yypush_parse but only on the first
5018 invocation.
5019
5020 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
5021
5022 * data/push.c: Add CPP guards around push parser declarations in both
5023 the header and the code file.
5024 In the code file, move the push parser declarations to the same place
5025 they appear in the header file.
5026 Clean up the M4 some, especially the inconsistent underquoting in
5027 some b4_c_function_def and b4_c_function_decl uses.
5028
5029 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
5030
5031 Encapsulate the push parser state variables into an M4 macro so the
5032 push skeleton doesn't have to list them again for pull mode's yyparse.
5033 For push mode, remove yypush_parse's local equivalents of these
5034 variables to eliminate unnecessary copying between the two sets at
5035 run-time. This patch also fixes at least a bug related to multiple
5036 %initial-action invocations in push mode.
5037 * data/push.c (b4_declare_parser_variables): Rename to...
5038 (b4_declare_scanner_communication_variables): ... this for clarity and
5039 update both uses.
5040 (b4_declare_yyparse_variables): Remove and move its contents to the one
5041 spot where it was invoked.
5042 (b4_declare_parser_state_variables): New macro containing the parser
5043 state variables required by push mode.
5044 (struct yypstate): Replace all fields but yynew with
5045 b4_declare_parser_state_variables.
5046 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
5047 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
5048 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
5049 (yyparse or yypush_parse): For yyparse in pull mode, replace local
5050 parser state variable declarations with
5051 b4_declare_parser_state_variables.
5052 Don't initialize parser state variables when calling yypush_parse since
5053 yypstate_new already does that.
5054 Invoke the user's initial action only upon the first yypush_parse
5055 invocation.
5056 Remove all code that copies between the local parser state variables
5057 and the yypstate.
5058
5059 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
5060
5061 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
5062 prevent a name collision in a future patch where these names will
5063 sometimes be #define'd.
5064 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
5065 since it no longer has the same name as the existing argument.
5066 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
5067
5068 2006-12-19 Paolo Bonzini <bonzini@gnu.org>
5069 and Joel E. Denny <jdenny@ces.clemson.edu>
5070
5071 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
5072 that the argument is case-insensitive, and there's no `=' here.
5073 For the %skeleton entry, mention that %language is better.
5074 (Bison Options): Likewise for --language and --skeleton. Move the
5075 --skeleton entry so that the `Tuning the parser' section is sorted
5076 alphabetically on long options.
5077 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
5078 %language directive in detail here; cross-reference the %language
5079 documentation instead.
5080 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
5081 `%require "2.3b"' so that the example is always up-to-date.
5082 (Table of Symbols): Add entries for %language and %skeleton.
5083 * examples/extexi (normalize): Instead of replacing every %require
5084 argument with the current Bison version, just substitute for
5085 `@value{VERSION}'. This guarantees that we're testing what actually
5086 appears in the documentation.
5087 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
5088 rather than `@VERSION@'.
5089
5090 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
5091
5092 * NEWS: Reword the %language news a bit, and put it earlier.
5093
5094 * src/getargs.c (skeleton_arg): Last arg is now location const *.
5095 Rewrite to simplify the logic.
5096 (language_argmatch): Likewise.
5097 (program_name): We now own this var.
5098 * src/getargs.h (struct bison_language): Use char[] rather than
5099 const char *.
5100
5101 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
5102 Java is supported.
5103 * src/complain.c (program_name): Remove decl; no longer needed.
5104 * src/main.c (program_name): Remove; now belongs to getargs.
5105
5106 2006-12-18 Paolo Bonzini <bonzini@gnu.org>
5107
5108 * NEWS: Document %language.
5109
5110 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
5111
5112 * data/c-skel.m4, data/c++-skel.m4: New files.
5113 * data/glr.c: Complain on push parsers.
5114
5115 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
5116 over %skeleton.
5117 (Decl Summary): Document %language and %skeleton.
5118 (Command line): Document -L.
5119
5120 * examples/extexi: Rewrite %require directive.
5121 * examples/calc++/Makefile.am: Pass VERSION to extexi.
5122
5123 * src/files.c (compute_exts_from_gc): Look in language structure
5124 for .y extension.
5125 (compute_file_name_parts): Check whether .tab should be added.
5126 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
5127 (language, skeleton_arg, language_argmatch): New.
5128 (long_options): Add --language.
5129 (getargs): Use skeleton_arg, add -L/--language.
5130 * src/getargs.h: Include location.h.
5131 (struct bison_language, language, skeleton_arg, language_argmatch): New.
5132 * src/output.c (prepare): Pick default skeleton from struct language.
5133 Don't dispatch C skeletons here.
5134 * src/parse-gram.y (PERCENT_LANGUAGE): New.
5135 (prologue_declaration): Add "%language" rule, use skeleton_arg.
5136 * src/scan-gram.l ("%language"): New rule.
5137
5138 * tests/calc.at: Test %skeleton and %language.
5139 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
5140 (AT_GLR_IF): Look for %skeleton "glr.cc".
5141 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
5142 (AT_YACC_IF): Reject %language.
5143
5144 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
5145
5146 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
5147 since it wasn't used; only the typedef name 'semantic_type' is needed.
5148 Also, omit trailing white space.
5149
5150 * bootstrap: Sync from coreutils.
5151 (gnulib_extra_files): Add build-aux/announce.gen.
5152 (slurp): Adjust .gitignore files like .cvsignore files.
5153 * build-aux/announce-gen: Remove from CVS, since bootstrap
5154 now creates this.
5155
5156 2006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
5157
5158 Make %push-parser imply %pure-parser. This fixes several bugs; see
5159 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
5160 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
5161 pure_parser = true.
5162 * data/push.c: Don't bother testing b4_push_if when deciding whether
5163 to expand b4_declare_parser_variables globally.
5164 (yypush_parse): Likewise in here.
5165
5166 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
5167 (yy_reduce_print): Reformat M4 for readability.
5168
5169 2006-12-15 Bob Rossi <bob@brasko.net>
5170 and Joel Denny <jdenny@ces.clemson.edu>
5171
5172 * data/push.c (yypstate): Add typedef, and update all uses of
5173 struct yypstate to just yypstate.
5174 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
5175
5176 2006-12-14 Bob Rossi <bob@brasko.net>
5177
5178 * data/push.c (yypush_parse): Declare prototype regardless of
5179 %locations option.
5180
5181 2006-12-14 Bob Rossi <bob@brasko.net>
5182
5183 * data/push.c (yyparse): Remove the prototype and the #define when in
5184 push-parser mode.
5185
5186 2006-12-13 Bob Rossi <bob@brasko.net>
5187
5188 * data/push.c (yypstate_init): Rename to...
5189 (yypstate_new): ... this and use b4_c_function_def.
5190 (yypstate_delete): New.
5191 (yypush_parse): Change parameters yynval and yynlloc to be const.
5192 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
5193 yypstate_delete functions.
5194
5195 2006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
5196
5197 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
5198 strange test case titles. Reported by Bob Rossi.
5199
5200 2006-12-13 Paul Eggert <eggert@cs.ucla.edu>
5201
5202 * TODO: Add pointer to Sylvain Schmitz's work on static detection
5203 of potential ambiguities in GLR grammers.
5204
5205 2006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
5206
5207 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
5208 `bison ', use m4_index instead of m4_substr since chopping up a string
5209 containing M4-special characters causes problems here.
5210
5211 Fix a couple of bugs related to special characters in user-specified
5212 file names, and make it easier for skeletons to compute output file
5213 names with the same file name prefix as Bison-computed output file
5214 names.
5215 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
5216 b4_parser_file_name and b4_spec_defines_file instead of
5217 @output_parser_name@ and @output_header_name@, which are now redundant.
5218 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
5219 b4_parser_file_name, b4_spec_defines_file, and the new
5220 @basename(FILENAME@) instead of @output_parser_name@ and
5221 @output_header_name@, which inappropriately escaped the file names as
5222 C string literals.
5223 * src/files.c (all_but_ext): Remove static qualifier.
5224 (compute_output_file_names): Move `free (all_but_ext)' to...
5225 (output_file_names_free): ... here since all_but_ext is needed later.
5226 * src/files.h (all_but_ext): Extern.
5227 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
5228 exactly what MUSCLE_INSERT_STRING used to do.
5229 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
5230 characters are escaped properly.
5231 * src/output.c (prepare): Define muscle file_name_all_but_ext as
5232 all_but_ext.
5233 For pkgdatadir muscle, maintain previous functionality by using
5234 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
5235 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
5236 digraphs would never be expanded. Hopefully no one has M4-special
5237 characters in his Bison installation path.
5238 * src/scan-skel.l: Don't parse @output_header_name@ and
5239 @output_parser_name@ anymore since they're now redundant.
5240 In @output, use decode_at_digraphs.
5241 Parse a new @basename command that invokes last_component.
5242 (decode_at_digraphs): New.
5243 (BASE_QPUTS): Remove unused.
5244 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
5245 (Output file name): New tests.
5246
5247 2006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
5248
5249 Warn about output files that are generated by the skeletons and that
5250 conflict with other output files.
5251 * data/glr.c: Don't generate the header file here when glr.cc does.
5252 * src/files.c (file_names, file_names_count): New static globals.
5253 (compute_output_file_names): Invoke output_file_name_check for files
5254 not generated by the skeletons and remove existing checks.
5255 (output_file_name_check): New function that warns about conflicting
5256 output file names.
5257 (output_file_names_free): Free file_names.
5258 * src/files.h (output_file_name_check): Declare.
5259 * src/scan-skel.l: Invoke output_file_name_check for files generated by
5260 the skeletons.
5261 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
5262 (Conflicting output files): New tests.
5263
5264 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5265
5266 * doc/bison.texinfo: Fix a couple of typos.
5267
5268 2006-12-08 Bob Rossi <bob@brasko.net>
5269
5270 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
5271 Rename to...
5272 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
5273 update all uses.
5274 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
5275 (yypush_parse): Rename yypvars argument to yyps and remove redundant
5276 local pv.
5277 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
5278 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
5279
5280 2006-12-07 Bob Rossi <bob@brasko.net>
5281 and Joel Denny <jdenny@ces.clemson.edu>
5282
5283 * data/push.c (yypvarsinit): Change return type from void* to struct
5284 yypvars*. No longer cast to void* on return.
5285 (struct yypvars): Remove yylen since it need not be remembered between
5286 yypushparse invocations.
5287 (yypushparse): Don't copy between yylen and pv->yylen.
5288
5289 2006-12-05 Bob Rossi <bob@brasko.net>
5290
5291 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
5292 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
5293 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
5294 (struct yypvars): Remove b4_declare_parser_variables.
5295 (yypvarsinit): Remove init code for removed variables.
5296 (global scope): Do not declare b4_declare_parser_variables if
5297 push or pure mode.
5298 (yypushparse): Add b4_declare_parser_variables.
5299 Init new local variables, and remove init code for removed
5300 yypvars variables.
5301 (yyparse): Delete.
5302 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
5303 and yyparse for other modes.
5304 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
5305 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
5306 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
5307 (AT_PURE_LEX_IF): True if pure or push parser.
5308
5309 2006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
5310
5311 Document Yacc prologue alternatives and default %destructor's and
5312 %printer's as experimental. Don't mention Java yet. Discussed at
5313 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
5314 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
5315 (2.3a): Annotate this entry to say the old forms of these features were
5316 also experimental.
5317 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
5318 Table of Symbols): Say they're experimental. Comment out any mention
5319 of Java (we'll want this back eventually).
5320
5321 2006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
5322
5323 Support a file name argument to %defines. Deprecate `=' in
5324 %file-prefix, %name-prefix, and %output. Discussed at
5325 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
5326 * NEWS (2.3a+): Mention.
5327 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
5328 form of %defines, and remove `=' from entries for %file-prefix,
5329 %name-prefix, and %output.
5330 * src/parse-gram.y (prologue_declaration): Implement.
5331 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
5332 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
5333 all but one occurrence of %name-prefix.
5334 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
5335 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
5336 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
5337 occurrence of each of %file-prefix and %output. Add check for %defines
5338 with argument.
5339 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
5340 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
5341 Remove the `=' from %output.
5342
5343 2006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
5344
5345 Don't escape $ in test case titles since Autoconf 2.61 now does that
5346 correctly.
5347 * tests/actions.at (Default %printer and %destructor are not for error
5348 or $undefined): Here.
5349 (Default %printer and %destructor are not for $accept): Here.
5350 * tests/input.at (Invalid $n and @n): Here.
5351
5352 2006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
5353
5354 Rename <!> to <>. Discussed starting at
5355 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
5356 * NEWS (2.3a+): Update.
5357 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
5358 Update.
5359 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
5360 * src/scan-gram.l (INITIAL): Implement.
5361 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
5362 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
5363 comment.
5364 * tests/actions.at (Default tagless %printer and %destructor,
5365 Default tagged and per-type %printer and %destructor,
5366 Default %printer and %destructor are not for error or $undefined,
5367 Default %printer and %destructor are not for $accept,
5368 Default %printer and %destructor for mid-rule values): Update.
5369 * tests/input.at (Default %printer and %destructor redeclared,
5370 Unused values with default %destructor): Update.
5371
5372 2006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
5373
5374 Don't let %prec take a nonterminal.
5375 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
5376 token.
5377 * tests/input.at (%prec takes a token): New test checking that %prec
5378 won't take a nonterminal.
5379
5380 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
5381
5382 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
5383 it was double-quoted.
5384 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
5385 grammar is maintained with Bison's highest standards.
5386 * src/getargs.c: Fix some typos in Doxygen comments.
5387
5388 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
5389
5390 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
5391 later. Reported by Paul Eggert in
5392 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
5393 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
5394 * src/scan-code.l (translate_action): Don't bother invoking
5395 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
5396 (code_scanner_free): Instead of invoking
5397 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
5398 which frees more.
5399 * src/scan-gram.l (gram_scanner_free): Likewise.
5400 * src/scan-skel.l (scan_skel): Likewise.
5401
5402 2006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
5403
5404 * src/files.c (tr): Change return type to void.
5405 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
5406 has been called previously for the same key.
5407 (muscle_find): Return storage instead of value so that
5408 --enable-gcc-warnings doesn't produce warnings that the return discards
5409 const. aver that the value and storage are the same since storage
5410 could potentially be NULL when value is not.
5411 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
5412 same as 0.
5413
5414 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
5415
5416 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
5417 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
5418 us a slightly cleaner distribution, and also works.
5419 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
5420 gnulib changes.
5421
5422 2006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
5423 and Paul Eggert <eggert@cs.ucla.edu>
5424
5425 Don't let Bison leak memory except when it complains.
5426 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
5427 (spec_defines_file, dir_prefix): Now char *, not const char *,
5428 since they are freed.
5429 * src/files.c: Likewise.
5430 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
5431 Likewise.
5432 (tr): Now operates in-place. All uses changed.
5433 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
5434 values.
5435 (compute_file_name_parts, compute_output_file_names): Don't store
5436 read-only data in variables that will be freed.
5437 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
5438 src_extension, and header_extension.
5439 (output_file_names_free): New public function to free
5440 spec_verbose_file, spec_graph_file, spec_defines_file,
5441 parser_file_name, and dir_prefix.
5442 * src/getargs.c (getargs): Don't store read-only data in variables that
5443 will be freed.
5444 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
5445 (which previously existed but was unused), and quotearg_free.
5446 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
5447 * src/muscle_tab.c: Likewise.
5448 (muscle_entry): Make the value char const *,
5449 and add a new storage member that is char * and can be freed.
5450 (muscle_entry_free): New private function.
5451 (muscle_init): Use it instead of free.
5452 (muscle_insert, muscle_grow): Update and use new storage member.
5453 (muscle_code_grow): Free the string passed to muscle_grow
5454 since it's not needed anymore.
5455 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
5456 add a new `char *code' member.
5457 ("{...}"): Declare semantic type as code.
5458 * src/scan-code.h (translate_rule_action):
5459 (translate_symbol_action, translate_code, translate_action): Return
5460 `char const *' rather than `char *' since external code should not free
5461 these strings.
5462 * src/scan-code.l: Likewise.
5463 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
5464 which is "{...}" in the parser.
5465 * tests/Makefile.am (maintainer-check-valgrind): Set
5466 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
5467 Valgrind.
5468 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
5469 complain.
5470 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
5471 expecting a non-zero exit status sets --leak-check=summary and
5472 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
5473 this case, and we don't want to hear about it.
5474
5475 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
5476
5477 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
5478 instead of from the template, to simplify configuration a bit.
5479 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
5480 and m4/wint_t.m4, as they are needed with the latest gnulib.
5481
5482 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
5483
5484 Disable unset/unused mid-rule value warnings by default, and recognize
5485 --warnings=midrule-values to enable them. Discussed starting at
5486 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
5487 * NEWS (2.3a+): Mention.
5488 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
5489 warnings): Add entry for midrule-values subargument.
5490 * src/reader.c (symbol_should_be_used): Don't return true just because
5491 the value is a set/used mid-rule value unless
5492 --warnings=midrule-values was specified.
5493 * tests/input.at (Unused values, Unused values before symbol
5494 declarations): Run tests with and without --warnings=midrule-values.
5495
5496 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
5497 than LIST_FREE directly.
5498
5499 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
5500
5501 Finish implementing --warnings=error, which should not be implied by
5502 --warnings=all (or by its synonyms -W and --warnings without
5503 subarguments).
5504 * src/complain.c (set_warning_issued): New function to report that
5505 warnings are being treated as errors and to record an error if so.
5506 Invoke...
5507 (warn_at, warn): ... here.
5508 * src/getargs.c (warnings_args, warnings_types): Reorder so that
5509 "error - warnings are errors" does not appear above "all - all of the
5510 above".
5511 (getargs): For -W and --warnings without subarguments, don't let
5512 FLAGS_ARGMATCH set warnings_error in warnings_flag.
5513 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
5514
5515 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
5516
5517 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
5518 empty subargument list. For example: `bison --warnings= parser.y'.
5519
5520 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
5521
5522 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
5523 the parser header file so that gcc doesn't warn.
5524
5525 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
5526
5527 Split the default %destructor/%printer into two kinds: <*> and <!>.
5528 Discussed starting at
5529 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
5530 * NEWS (2.3a+): Mention.
5531 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
5532 previous change today related to mid-rules.
5533 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
5534 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
5535 (TYPE_TAG_ANY): Add as <*>.
5536 (TYPE_TAG_NONE): Add as <!>.
5537 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
5538 for <*> and <!>.
5539 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
5540 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
5541 * src/symlist.c (symbol_list_default_new): Split into tagged and
5542 tagless versions.
5543 (symbol_list_destructor_set, symbol_list_printer_set): Split
5544 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
5545 SYMLIST_DEFAULT_TAGLESS.
5546 * src/symlist.h: Update symbol_list_default*_new prototypes.
5547 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
5548 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
5549 * src/symtab.c (default_destructor, default_destructor_location,
5550 default_printer, default_printer_location): Split each into tagged and
5551 tagless versions.
5552 (symbol_destructor_get, symbol_destructor_location_get,
5553 symbol_printer_get, symbol_printer_location_get): Implement tagged
5554 default and tagless default cases.
5555 (default_destructor_set, default_printer_set): Split each into tagged
5556 and tagless versions.
5557 * src/symtab.h: Update prototypes.
5558 * tests/actions.at (Default %printer and %destructor): Rename to...
5559 (Default tagless %printer and %destructor): ... this, and extend.
5560 (Per-type %printer and %destructor): Rename to...
5561 (Default tagged and per-type %printer and %destructor): ... this, and
5562 extend.
5563 (Default %printer and %destructor for user-defined end token): Extend.
5564 (Default %printer and %destructor are not for error or $undefined):
5565 Update.
5566 (Default %printer and %destructor are not for $accept): Update.
5567 (Default %printer and %destructor for mid-rule values): Extend.
5568 * tests/input.at (Default %printer and %destructor redeclared): Extend.
5569 (Unused values with default %destructor): Extend.
5570
5571 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
5572
5573 Don't apply the default %destructor/%printer to an unreferenced midrule
5574 value. Mentioned at
5575 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
5576 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
5577 like $@n instead of just @n so that the default %destructor/%printer
5578 logic doesn't see them as user-defined symbols.
5579 (symbol_is_dummy): Check for both forms of the name.
5580 * src/reader.c (packgram): Remove the `$' from each midrule symbol
5581 name for which the midrule value is referenced in any action.
5582 * tests/actions.at (Default %printer and %destructor for mid-rule
5583 values): New test.
5584 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
5585 for change to dummy symbol names.
5586
5587 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
5588
5589 Warn about unset midrule $$ if the corresponding $n is used.
5590 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
5591 $n usage.
5592 (packgram): Before invoking grammar_rule_check on any rule, make sure
5593 all actions have already been scanned in order to set `used' flags.
5594 Otherwise, checking that a midrule's $$ is set will not always work
5595 properly because the midrule check must forward-reference the midrule's
5596 parent rule.
5597 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
5598 warning.
5599
5600 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
5601
5602 More improvements to the documentation of the prologue alternatives:
5603 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
5604 Bison manual.
5605 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
5606 some text to clarify the relative importance of the new directives and
5607 to show how these directives may be viewed as code labels.
5608
5609 2006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
5610
5611 Similar to the recently removed %before-header, add %code-top as the
5612 alternative to the pre-prologue. Mentioned at
5613 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
5614 Also, let the prologue alternatives appear in the grammar section.
5615 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
5616 (prologue_declaration): Move the existing prologue alternatives to...
5617 (grammar_declaration): ... here and add %code-top.
5618 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
5619
5620 Clean up and extend documentation for the prologue alternatives.
5621 * NEWS (2.3a+): Describe prologue alternatives.
5622 * doc/bison.texinfo (Prologue): Move discussion of prologue
5623 alternatives to...
5624 (Prologue Alternatives): ... this new section, and extend it to discuss
5625 all 4 directives in detail.
5626 (Table of Symbols): Clean up discussion of prologue alternatives and
5627 add %code-top.
5628
5629 2006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5630
5631 DJGPP specific issues.
5632
5633 * djgpp/config.bat: config.hin has been moved to lib. Adjust
5634 config.bat accordingly.
5635 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
5636 * djgpp/config.site: Likewise.
5637
5638 2006-10-16 Paolo Bonzini <bonzini@gnu.org>
5639
5640 Replace %*-header with %provides, %requires, %code. See discussion at
5641 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
5642
5643 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
5644 (b4_user_start_header): Remove.
5645 * data/glr.c: Use new macros instead of b4_*start_header
5646 and b4_*end_header.
5647 * data/glr.cc: Likewise.
5648 * data/lalr1.cc: Likewise.
5649 * data/push.c: Likewise.
5650 * data/yacc.c: Likewise.
5651
5652 * doc/bison.texinfo: Remove %before-header, rename
5653 %{start,end,after}-header to %requires, %provides, %code.
5654
5655 * src/parse-gram.y: Likewise (also rename token names accordingly).
5656 * src/scan-gram.l: Likewise.
5657 * tests/actions.at: Likewise.
5658
5659 2006-10-14 Paul Eggert <eggert@cs.ucla.edu>
5660
5661 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
5662 Problem reported by Joel E. Denny.
5663
5664 2006-10-14 Jim Meyering <jim@meyering.net>
5665
5666 (Sync from coreutils.)
5667 Work also when the working directory (with e.g. coreutils sources)
5668 is version controlled with git, rather than CVS.
5669 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
5670 rather than CVS.
5671 In messages and comments, say e.g., "checked-out sources",
5672 rather than "CVS sources".
5673 (version_controlled_file): New function. Work for git as well as
5674 for CVS. Don't use grep's -q option.
5675 (slurp): Call it here, in place of CVS-specific code.
5676
5677 2006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
5678
5679 Fix testsuite for ./configure --enable-gcc-warnings:
5680 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
5681 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
5682 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
5683 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
5684 * test/regression.at (Diagnostic that expects two alternatives):
5685 Likewise.
5686
5687 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
5688
5689 * bootstrap.conf (gnulib_modules): Add config-h.
5690 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
5691 worry about HAVE_CONFIG_H.
5692 * lib/abitset.c: Likewise.
5693 * lib/bitset.c: Likewise.
5694 * lib/bitset_stats.c: Likewise.
5695 * lib/bitsetv-print.c: Likewise.
5696 * lib/bitsetv.c: Likewise.
5697 * lib/ebitset.c: Likewise.
5698 * lib/get-errno.c: Likewise.
5699 * lib/lbitset.c: Likewise.
5700 * lib/subpipe.c: Likewise.
5701 * lib/timevar.c: Likewise.
5702 * lib/vbitset.c: Likewise.
5703 * lib/bitset.c: Include "bitset.h" first, to test interface.
5704 * lib/bitset_stats.c: Include "bitset_stats.h" first.
5705 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
5706 * lib/bitsetv.c: Include "bitsetv.h" first.
5707 * lib/get-errno.c: Include "get-errno.h" first.
5708 * m4/.cvsignore: Add config-h.m4.
5709 * tests/actions.at (Default %printer and %destructor for ...):
5710 Adjust expected line numbers in output to reflect removal of #if
5711 HAVE_CONFIG_H lines.
5712 * tests/glr-regression.at (Missed %merge type warnings when ...):
5713 Likewise.
5714 * tests/regression.at (Braced code in declaration in rules section):
5715 Likewise.
5716 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
5717 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
5718 Include <config.h> unconditionally.
5719
5720 * bootstrap: Sync from coreutils, as follows:
5721
5722 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
5723
5724 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
5725 variable was sometimes used without being initialized. This
5726 messed up the installation of the INSTALL file in some cases.
5727
5728 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
5729
5730 * bootstrap (usage, main program, symlink_to_gnulib): Add option
5731 --copy. Inspired by a suggestion from Bruno Haible.
5732
5733 2006-10-03 Jim Meyering <jim@meyering.net>
5734
5735 * bootstrap: Undo last change to this file, since now gnulib-tool
5736 sticks with the automake default in generating dependencies.
5737
5738 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
5739
5740 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
5741 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
5742
5743 * doc/bison.1: Add copyright notice.
5744
5745 * data/glr.c: Don't include <stdarg.h>; not used.
5746
5747 * NEWS: The -g and --graph options now output graphs in Graphviz
5748 DOT format, not VCG format.
5749 * doc/bison.1: Likewise.
5750 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
5751 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
5752 of this change in
5753 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
5754 * TODO: Remove Graphviz entry.
5755 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
5756 remove vcg.c, vcg.h, vcg_defaults.h.
5757 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
5758 * src/graphviz.c, src/graphviz.h: New files.
5759 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
5760 * src/files.h: Make comment more generic.
5761 * src/main.c (main): Likewise.
5762 * src/print_graph.h: Likewise.
5763 * src/getargs.c (usage): Make usage description more generic.
5764 * src/print_graph.c: Include graphviz.h rather than vcg.h.
5765 (static_graph, fgraph): Remove. All uses changed to pass
5766 arguments instead of sharing a static var.
5767 (print_core, print_actions, print_state, print_graph):
5768 Output graphviz format rather than VCG format.
5769 * tests/.cvsignore: Remove *.vcg; add *.dot.
5770 * tests/output.at: Expect *.dot files, not *.vcg files.
5771
5772 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
5773 accommodates the 2006-10-08 change.
5774
5775 2006-10-11 Bob Rossi <bob@brasko.net>
5776
5777 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
5778 (b4_yyssa, b4_yyerror_range): New macros.
5779 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
5780 (yypvarsinit): Remove init of removed fields.
5781 (yypushparse): Remove use of removed fields; use new macros instead.
5782
5783 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
5784
5785 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
5786 in a push parser. Reindent slightly to match yacc.c better.
5787
5788 2006-10-11 Bob Rossi <bob@brasko.net>
5789
5790 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
5791 yymsg_alloc fields.
5792 (yypvarsinit, yypushparse): Remove init of removed fields.
5793 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
5794
5795 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
5796
5797 * THANKS: Add Paolo Bonzini and Bob Rossi.
5798
5799 2006-10-08 Paolo Bonzini <bonzini@gnu.org>
5800
5801 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
5802 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
5803 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
5804 b4_define_user_cde and uses): Remove.
5805 (b4_comment, b4_prefix, b4_sync_start): New.
5806 * data/bison.m4: New file, with most of the content removed from c.m4.
5807 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
5808 * src/output.c (output_skeleton): Pass bison.m4.
5809 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
5810 only if specified.
5811
5812 2006-10-05 Paul Eggert <eggert@cs.ucla.edu>
5813
5814 Fix test failure reported by Tom Lane in
5815 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
5816 and try to make such failures easier to catch in the future.
5817 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
5818 that's now the caller's responsibility.
5819 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
5820 Set yychar = YYEOF if it's negative.
5821 * tests/actions.at (yylex): Abort if asked to read past EOF.
5822 * tests/conflicts.at (yylex): Likewise.
5823 * tests/cxx-type.at (yylex): Likewise.
5824 * tests/glr-regression.at (yylex): Likewise.
5825 * tests/input.at (yylex): Likewise.
5826 * tests/regression.at (yylex): Likewise.
5827 * tests/torture.at (yylex): Likewise.
5828
5829 2006-10-01 Paul Eggert <eggert@cs.ucla.edu>
5830
5831 Fix problems with translating English-language diagnostics.
5832 * bootstrap: Fix bug introduced in recent bootstrap changes, with
5833 respect to bison-runtime pot generation. The YY_ stuff
5834 wasn't being captured.
5835 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
5836 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
5837 * runtime-po/POTFILES.in: Add data/push.c.
5838
5839 2006-09-29 Paul Eggert <eggert@cs.ucla.edu>
5840
5841 Merge bootstrap changes from coreutils.
5842
5843 2006-09-28 Jim Meyering <jim@meyering.net>
5844
5845 Automatically generated dependencies are important even
5846 when all of the sources in a directory come from gnulib.
5847 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
5848 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
5849
5850 2006-09-23 Jim Meyering <jim@meyering.net>
5851
5852 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
5853
5854 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
5855
5856 * bootstrap: Add support for --force.
5857 (usage): New function. Describe usage less tersely.
5858 (CVS_only_file): New var.
5859
5860 2006-09-21 Paul Eggert <eggert@cs.ucla.edu>
5861
5862 * data/push.c (YYPUSH_MORE): Make it an enum instead.
5863 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
5864 Adjust white space and comments to match GNU style better.
5865
5866 2006-09-20 Bob Rossi <bob@brasko.net>
5867
5868 * data/push.c (yyresult_get): Remove function.
5869 (YYPUSH_MORE): Add #define.
5870 (yypushparse): Modify return value.
5871
5872 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
5873
5874 * stamp-h.in: Remove; no longer needed.
5875 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
5876 Remove config.h, config.hin, intl (no longer created).
5877 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
5878 stamp-h1.
5879
5880 Sync bootstrap from coreutils, as follows:
5881
5882 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
5883
5884 * bootstrap (symlink_to_gnulib): New function.
5885 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
5886 to copies-of-gnulib.
5887 (cp_mark_as_generated, slurp, gnulib_files):
5888 Avoid making a copy if it's the same as the old version.
5889 (gnulib_files): Add support for this variable (used by Bison).
5890
5891 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
5892
5893 * src/getargs.c (usage): Rework to use conventions similar to
5894 coreutils, to make translation a bit easier and the code a bit
5895 smaller. Problem reported by Tim Van Holder.
5896
5897 2006-09-15 Paul Eggert <eggert@cs.ucla.edu>
5898
5899 Use some of gnulib's new modules, taken from coreutils.
5900
5901 * bootstrap: Sync from coreutils, except add support for gnulib_files.
5902 * bootstrap.conf: New file.
5903 (gnulib_modules): Add configmake, inttypes, unistd.
5904 (XGETTEXT_OPTIONS): Add complain, complain_at,
5905 fatal, fatal_at, warn, warn_at, unexpected_end.
5906 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
5907 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
5908 (gl_EARLY): Add.
5909 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
5910 (gl_INIT): Add
5911 (GNULIB_AUTOCONF_SNIPPET): Remove.
5912 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
5913 the pickiest.
5914 * lib/.cvsignore: Add inttypes_.h.
5915 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
5916 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
5917 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
5918 no-longer-necessary initializations.
5919 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
5920 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
5921 use the unistd module.
5922 * src/system.h: Likewise.
5923 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
5924 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
5925 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
5926 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
5927 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
5928 * src/system.h: Include inttypes.h unconditionally, now that we
5929 use the inttypes module. Don't bother to include stdint.h, since
5930 inttypes.h now does that for us.
5931 (LOCALEDIR): Remove, now that we use the configmake module.
5932 * src/getargs.c: Include configmake.h.
5933 * src/main.c: Likewise.
5934 * src/output.c: Likewise.
5935 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
5936 not from $abs_top_builddir, since config.h moved.
5937
5938
5939 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
5940 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
5941
5942 * src/parse-gram.y (symbol_declaration): Don't put statements
5943 before declarations; it's not portable to C89.
5944 * src/scan-code.l (handle_action_at): Likewise.
5945
5946 * src/scan-code.l: Always initialize braces_level; the old code
5947 left it uninitialized and therefore had undefined behavior.
5948
5949 Don't attempt to redefine 'assert', since it runs afoul of
5950 systems where standard headers (mistakenly) include <assert.h>.
5951 Instead, define and use our own alternative, called 'aver'.
5952 * src/reader.c: Don't include assert.h, since we no longer
5953 use assert.
5954 * src/scan-code.l: Likewise.
5955 * src/system.h (assert): Remove, replacing with....
5956 (aver): New function, taking a bool arg. All uses changed.
5957 * src/tables.c (pack_vector): Ensure that aver arg is bool,
5958 not merely an integer.
5959
5960 2006-09-15 Bob Rossi <bob@brasko.net>
5961
5962 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
5963 * data/c.m4 (YYPUSH): New.
5964 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
5965 * src/getargs.c (push_parser): New var.
5966 * src/getargs.h (push_parser): New declaration.
5967 * src/output.c (prepare): Add macro insertion of `push_flag'.
5968 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
5969 (prologue_declaration): Parse %push-parser.
5970 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
5971 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
5972 list of removed lines from the traces observed.
5973 (AT_CHECK_CALC_LALR): Added push parser tests.
5974
5975 2006-09-13 Paul Eggert <eggert@cs.ucla.edu>
5976
5977 * NEWS: Version 2.3a.
5978 * configure.ac (AC_INIT): Likewise.
5979
5980 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
5981 "#define YYSTYPE int" that caused "make maintainer-check" to fail
5982 due to header ordering dependencies. I don't know why the #define
5983 was there.
5984
5985 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
5986 runtime cost when YYDEBUG is not defined, and so that some tests
5987 that used to fail now work. Problem and initial suggestion by
5988 Paolo Bonzini.
5989 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
5990 * data/glr.cc (b4_parser_class_name):
5991 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
5992 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
5993 (yydebug_) [YYDEBUG]: New member.
5994 (yycdebug_): Now defined only if YYDEBUG.
5995 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
5996 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
5997 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
5998 if YYYDEBUG.
5999 (debug_stream, set_debug_stream, debug_level, set_debug_level):
6000 Define only if YYDEBUG.
6001 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
6002 set_debug_level.
6003 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
6004 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
6005 AT_CHECK_CALC_GLR_CC that are working now.
6006
6007 2006-09-12 Paul Eggert <eggert@cs.ucla.edu>
6008
6009 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
6010 We don't need them in glr.cc, and glr.c defines them.
6011 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
6012 assumes that defining it to anything is the same as defining
6013 it to 1. Problem reported by Paolo Bonzini.
6014
6015 2006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
6016
6017 * data/c.m4 (b4_null, b4_case): Define.
6018 * src/output.c (prepare_symbols): Use b4_null.
6019 (user_actions_output): Use b4_case.
6020
6021 2006-09-11 Paul Eggert <eggert@cs.ucla.edu>
6022
6023 * data/glr.c (b4_shared_declarations): Put start-header first,
6024 before any #includes that we generate, so that feature-test
6025 macros work. Problem reported by Michael Deutschmann in
6026 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
6027 * data/lalr1.cc: Likewise.
6028 * doc/bison.texinfo (Prologue): Document that feature-test macros
6029 should be defined before any Bison declarations.
6030 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
6031 that depend on location.hh after, not before, Bison decls, since
6032 we now include location.hh after the first user prologue.
6033
6034 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
6035 Sander Brandenburg in
6036 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
6037 Also, fix minor white space and comment issues.
6038 (Prologue): Mention that it's better to define feature-test macros
6039 before Bison declarations. Problem reported by Michael Deutschmann.
6040
6041 * README-cvs: Fix typo: "&" should be "&&". Problem reported
6042 by Jim Meyering.
6043 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
6044 This adjusts to recent gnulib changes.
6045
6046 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
6047
6048 Finish implementation of per-type %destructor/%printer. Discussed
6049 starting at
6050 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
6051 and
6052 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
6053 * NEWS (2.3+): Add a description of this feature to the default
6054 %destructor/%printer description.
6055 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
6056 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
6057 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
6058 list node contains a semantic type.
6059 * src/symtab.c, src/symtab.h: Extend with a table that associates
6060 semantic types with their %destructor's and %printer's.
6061 (semantic_type_from_uniqstr, semantic_type_get,
6062 semantic_type_destructor_set, semantic_type_printer_set): New functions
6063 composing the public interface of that table.
6064 (symbol_destructor_get, symbol_destructor_location_get,
6065 symbol_printer_get, symbol_printer_location_get): If there's no
6066 per-symbol %destructor/%printer, look up the per-type before trying
6067 the default.
6068 * tests/actions.at (Per-type %printer and %destructor): New test case.
6069 * tests/input.at (Default %printer and %destructor redeclared):
6070 Extend to check that multiple occurrences of %symbol-default in a
6071 single %destructor/%printer declaration is an error.
6072 (Per-type %printer and %destructor redeclared, Unused values with
6073 per-type %destructor): New test cases.
6074
6075 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
6076
6077 Require default %destructor/%printer to be declared using
6078 %symbol-default instead of an empty symbol list, and start working on
6079 new per-type %destructor/%printer. Discussed at
6080 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
6081 * NEWS (2.3+): Add %symbol-default to example.
6082 * bison.texinfo (Freeing Discarded Symbols): Likewise.
6083 (Table of Symbols): Add entry for %symbol-default.
6084 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
6085 (generic_symlist, generic_symlist_item): New nonterminals for creating
6086 a list in which each item is a symbol, semantic type, or
6087 %symbol-default.
6088 (grammar_declaration): Use generic_symlist in %destructor and %printer
6089 declarations instead of symbols.1 or an empty list.
6090 (symbol_declaration, precedence_declaration, symbols.1): Update actions
6091 for changes to symbol_list.
6092 * src/reader.c: Update for changes to symbol_list.
6093 * src/scan-code.l: Likewise.
6094 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
6095 * src/symlist.c, src/symlist.h: Extend such that a list node may
6096 represent a semantic type or a %symbol-default in addition to just an
6097 ordinary symbol. Add switched functions for setting %destructor's and
6098 %printer's.
6099 * tests/actions.at, tests/input.at: Add %symbol-default to all default
6100 %destructor/%printer declarations.
6101
6102 2006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
6103
6104 Whether the default %destructor/%printer applies to a particular symbol
6105 isn't a question of whether the user *declares* that symbol (in %token,
6106 for example). It's a question of whether the user by any means
6107 *defines* the symbol at all (by simply using a char token, for
6108 example). $end is defined by Bison whereas any other token with token
6109 number 0 is defined by the user. The error token is always defined by
6110 Bison regardless of whether the user declares it with %token, but we
6111 may one day let the user define error as a nonterminal instead.
6112 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
6113 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
6114 the meaning of "user-defined".
6115 * tests/actions.at (Default %printer and %destructor for user-declared
6116 end token): Rename to...
6117 (Default %printer and %destructor for user-defined end token): ...
6118 this.
6119
6120 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
6121 computation of whether to apply the default, don't maintain a list of
6122 every Bison-defined symbol. Instead, just check for a first character
6123 of '$', which a user symbol cannot have, and check for the error token.
6124
6125 2006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
6126
6127 Don't apply the default %destructor or %printer to the error token,
6128 $undefined, or $accept. This change fits the general rule that the
6129 default %destructor and %printer are only for user-declared symbols,
6130 and it solves several difficulties that are described in the new test
6131 cases listed below.
6132 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
6133 * tests/actions.at (Default %printer and %destructor are not for error
6134 or $undefined, Default %printer and %destructor are not for $accept):
6135 New test cases.
6136
6137 2006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
6138
6139 Allow %start after the first rule.
6140 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
6141 when parsing the first rule.
6142 (check_and_convert_grammar): Search for it here after all grammar
6143 declarations have been parsed. Skip midrules, which have dummy LHS
6144 nonterminals.
6145 * src/symtab.c (symbol_is_dummy): New function.
6146 * src/symtab.h (symbol_is_dummy): Declare it.
6147 * tests/input.at (%start after first rule): New test.
6148
6149 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
6150
6151 Redo some of the previous commit: add back the ability to use
6152 non-aliased/undeclared string literals since it might be useful to
6153 those declaring %token-table.
6154 * src/reader.c (check_and_convert_grammar): Undo changes in previous
6155 commit: don't worry about complaints from symbols_pack.
6156 * src/symtab.c (symbol_new, symbol_class_set,
6157 symbol_check_alias_consistency): Undo changes in previous commit: count
6158 each string literal as a new symbol and token, assign it a symbol
6159 number, and don't complain about non-aliased string literals.
6160 (symbols_pack): Since symbol_make_alias still does not decrement symbol
6161 and token counts but does still set aliased tokens to the same number,
6162 symbol_pack_processor now leaves empty slots in the symbols array.
6163 Remove those slots.
6164 * tests/regression.at (Undeclared string literal): Remove test case
6165 added in previous commit since non-aliased string literals are allowed
6166 again.
6167 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
6168 remove unnecessary string literal declarations.
6169 * tests/sets.at (Firsts): Likewise.
6170
6171 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
6172
6173 Don't allow an undeclared string literal, but allow a string literal to
6174 be used before its declaration.
6175 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
6176 symbols_pack complained.
6177 * src/symtab.c (symbol_new): Don't count a string literal as a new
6178 symbol.
6179 (symbol_class_set): Don't count a string literal as a new token, and
6180 don't assign it a symbol number since symbol_make_alias does that.
6181 (symbol_make_alias): It's not necessary to decrement the symbol and
6182 token counts anymore. Don't assume that an alias declaration occurs
6183 before any uses of the identifier or string, and thus don't assert that
6184 one of them has the highest symbol number so far.
6185 (symbol_check_alias_consistency): Complain if there's a string literal
6186 that wasn't declared as an alias.
6187 (symbols_pack): Bail if symbol_check_alias_consistency failed since
6188 symbol_pack asserts that every token has been assigned a symbol number
6189 although undeclared string literals have not.
6190 * tests/regression.at (String alias declared after use, Undeclared
6191 string literal): New test cases.
6192 (Characters Escapes, Web2c Actions): Declare string literals as
6193 aliases.
6194 * tests/sets.at (Firsts): Likewise.
6195
6196 2006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
6197
6198 In the grammar scanner, STRING_FINISH unclosed constructs and return
6199 them to the parser in order to improve error messages.
6200 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
6201 SC_BRACED_CODE, SC_PROLOGUE): Implement.
6202 * tests/input.at (Unclosed constructs): New test case.
6203 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
6204 seen.
6205
6206 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
6207 unused global.
6208
6209 2006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
6210
6211 Handle string aliases for character tokens correctly.
6212 * src/symtab.c (symbol_user_token_number_set): If the token has an
6213 alias, check and set its alias's user token number instead of its own,
6214 which is set to indicate the alias. Previously, every occurrence of
6215 the character token in the grammar overwrote that alias indicator with
6216 the character code.
6217 * tests/input.at (String aliases for character tokens): New test.
6218
6219 2006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
6220
6221 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
6222
6223 2006-08-11 Paul Eggert <eggert@cs.ucla.edu>
6224
6225 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
6226 to prevent failures when building on older platforms.
6227 Check for autopoint failure.
6228 Set XGETTEXT_OPTIONS to values that check for C format strings,
6229 so that translators are warned about them (this also helps
6230 prevent core dumps).
6231
6232 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
6233 function, since it simplifies our code a bit.
6234
6235 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
6236 rather than -W, so we don't get bogus warnings about sign comparisons.
6237 Add -Wpointer-arith, since that warning is useful (it reports code
6238 that does not conform to C89 and that some compilers reject).
6239 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
6240 since it's no longer needed.
6241
6242 2006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
6243
6244 Clean up scanners a bit.
6245 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
6246 definitions so gcc won't warn when obstack_for_string is unused.
6247 * src/scan-code.l: config.h and system.h are already #include'd by
6248 scan-code-c.c, so get rid of them here.
6249 * src/scan-gram.l: Likewise.
6250 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
6251 definitions rather than duplicating the rest of it.
6252 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
6253
6254 2006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
6255
6256 Suppress signed/unsigned comparison warnings for yycheck.
6257 * data/c.m4 (b4_safest_int_type): New macro.
6258 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
6259 a signed int type, cast it to b4_safest_int_type first.
6260 * data/yacc.c: Likewise.
6261 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
6262 also overwritten.
6263
6264 2006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
6265
6266 * doc/bison.texinfo: Fix some typos.
6267
6268 2006-08-02 Paul Eggert <eggert@cs.ucla.edu>
6269
6270 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
6271 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
6272
6273 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
6274 the latest gnulib does this a different way.
6275 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
6276 translation was patched, so stop omitting it.
6277
6278 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
6279
6280 Enable declaration of default %printer/%destructor. Make the parser
6281 use these for all user-declared grammar symbols for which the user does
6282 not declare a specific %printer/%destructor. Thus, the parser uses it
6283 for token 0 if the user declares it but not if Bison generates it as
6284 $end. Discussed starting at
6285 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
6286 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
6287 and
6288 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
6289 * NEWS (2.3+): Mention.
6290 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
6291 declare a %destructor for a mid-rule's semantic value. It's just
6292 impossible to declare one specific to it.
6293 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
6294 code. Describe default %destructor form.
6295 * src/parse-gram.y (grammar_declaration): Parse default
6296 %printer/%destructor declarations.
6297 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
6298 and symbol_destructor_location_get rather than accessing the destructor
6299 and destructor_location members of struct symbol.
6300 (symbol_printers_output): Likewise but for %printer's.
6301 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
6302 again.
6303 * src/symtab.c (default_destructor, default_destructor_location,
6304 default_printer, default_printer_location): New static global
6305 variables to record the default %destructor and %printer.
6306 (symbol_destructor_get, symbol_destructor_location_get,
6307 symbol_printer_get, symbol_printer_location_get): New functions to
6308 compute the appropriate %destructor and %printer for a symbol.
6309 (default_destructor_set, default_printer_set): New functions to set the
6310 default %destructor and %printer.
6311 * src/symtab.h: Prototype all those new functions.
6312 * tests/actions.at (Default %printer and %destructor): New test to
6313 check that the right %printer and %destructor are called, that they're
6314 not called for $end, and that $$ and @$ work correctly.
6315 (Default %printer and %destructor for user-declared end token): New
6316 test to check that the default %printer and %destructor are called for
6317 a user-declared end token.
6318 * tests/input.at (Default %printer and %destructor redeclared, Unused
6319 values with default %destructor): New tests to check related grammar
6320 warnings and errors.
6321
6322 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
6323
6324 Clean up handling of %destructor for the end token (token 0).
6325 Discussed starting at
6326 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
6327 and
6328 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
6329
6330 Make the skeletons consistent in how they pop the end token and invoke
6331 its %destructor.
6332 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
6333 state, which has token number 0, since this would invoke the
6334 %destructor for the end token.
6335 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
6336 until after shifting the end token, or else it won't be popped.
6337 * data/yacc.c (yyparse): Likewise.
6338
6339 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
6340 it's the end token. Upon termination, destroy an unshifted lookahead
6341 even when it's the end token.
6342 * data/lalr1.cc (yy::parser::parse): Likewise.
6343 * data/yacc.c (yyparse): Likewise.
6344
6345 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
6346 value warnings for the end token when the user gives the end token a
6347 %destructor.
6348
6349 * tests/actions.at (Printers and Destructors): Test all the above.
6350
6351 2006-07-24 Paul Eggert <eggert@cs.ucla.edu>
6352
6353 Update to latest gnulib and gettext versions.
6354 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
6355 Add fopen-safer.
6356 (gnulib_files): Add m4/warning.m4. Don't worry about files
6357 overwritten by autopoint.
6358 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
6359 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
6360 rejects them.
6361 Don't use autoreconf; instead, invoke autopoint etc. by hand,
6362 so that we can remove the intl files at a better time.
6363 (intl_files_to_remove): Remove aclocal.m4, since it gets
6364 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
6365 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
6366 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
6367 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
6368 Remove datarootdir hack; no longer needed.
6369 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
6370 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
6371 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
6372 strdup.h.
6373 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
6374 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
6375
6376 2006-07-20 Paul Eggert <eggert@cs.ucla.edu>
6377
6378 * bootstrap: Adjust to today's change to gnulib-tool by invoking
6379 it with --assume-autoconf='latest-stable'.
6380
6381 2006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
6382
6383 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
6384 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
6385 YYSTYPE' and `{'.
6386 * src/muscle_tab.h (muscle_grow): Replace the header comments with
6387 those from muscle_tab.c since the old ones are misleading.
6388
6389 2006-07-13 Akim Demaille <akim@epita.fr>
6390
6391 Support %define "KEY" {VALUE}.
6392 * src/scan-code.h, src/scan-code.l (translate_action)
6393 (translate_rule_action, translate_symbol_action, translate_code):
6394 Return char *, not const char *.
6395 * src/parse-gram.y (declaration): Rename as...
6396 (prologue_declaration): this.
6397 (string_content): Remove this nonterminal, use STRING.
6398 (braceless, content, content.opt): New nonterminal.
6399 Use them.
6400 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
6401 as value.
6402 * src/scan-gram.l (getargs.h): Don't include it.
6403
6404 2006-07-12 Paul Eggert <eggert@cs.ucla.edu>
6405
6406 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
6407 rather than a for-loop that declares a local bool variable. This
6408 should work around a compatibility problem with a Cray x1e C++
6409 compiler reported by Hung Nguyen in
6410 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
6411 The for-loop was introduced in the 2004-11-17 change but I don't
6412 know why it was needed.
6413
6414 2006-07-12 Akim Demaille <akim@epita.fr>
6415
6416 * data/c.m4: Comment changes.
6417
6418 2006-07-10 Akim Demaille <akim@lrde.epita.fr>
6419
6420 * src/complain.c (error_message, ERROR_MESSAGE): New.
6421 To factor...
6422 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
6423 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
6424
6425 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
6426
6427 * NEWS: Instead of %union, you can define and use your own union type
6428 YYSTYPE if your grammar contains at least one <type> tag.
6429 Your YYSTYPE need not be a macro; it can be a typedef.
6430 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
6431 (Union Decl, Decl Summary): Document this.
6432 * data/glr.c (YYSTYPE): Implement this.
6433 * data/glr.cc (YYSTYPE): Likewise.
6434 * data/lalr1.cc (YYSTYPE): Likewise.
6435 * data/yacc.c (YYSTYPE): Likewise.
6436 * src/output.c (prepare): Output tag_seen_flag.
6437 * src/parse-gram.y (declaration, grammar_declaration):
6438 Use 'union_seen' rather than 'typed' to determine whether
6439 %union has been seen, since grammars can now be typed without
6440 %union.
6441 (symbol_declaration, type.opt, symbol_def):
6442 Keep track of whether a tag has been seen.
6443 * src/reader.c (union_seen, tag_seen): New vars.
6444 (typed): remove.
6445 * src/reader.h (union_seen, tag_seen, typed): Likewise.
6446 * src/scan-code.l (untyped_var_seen): New variable.
6447 (handle_action_dollar): Adjust to above changes.
6448 (handle_action_dollar, handle_action_at):
6449 Improve overflow checking for outlandish numbers.
6450 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
6451 avoid new diagnostics generated by above changes.
6452 * tests/regression.at (YYSTYPE typedef): Add test to check
6453 for type tags without %union.
6454
6455 * src/symlist.c (symbol_list_length): Return int, not unsigned
6456 int, since callers expect int. This may need to get revisited
6457 once we have proper integer overflow checking.
6458
6459 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
6460 object is now static.
6461
6462 * src/getargs.c (flags_argmatch): Return void, not int,
6463 to pacify ./configure --enable-gcc-warnings.
6464
6465 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
6466 since last_string is already defined to FLEX_PREFIX (last_string).
6467
6468 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
6469
6470 Implement --warnings/-W.
6471 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
6472 replaced by...
6473 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
6474 Adjust callers.
6475 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
6476 (warnings_args, warnings_types): New.
6477 (getargs, short_options, long_options): Accept -W/--warnings.
6478 Sort the options by alphabetical order, upper case letter right
6479 before its lower case.
6480
6481 2006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
6482
6483 Change %merge result type clash warnings to errors. Discussed at
6484 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
6485 * src/reader.c (record_merge_function_type): Use complain_at.
6486 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
6487 declared later): Update test case results.
6488
6489 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
6490
6491 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
6492 to be in alphabetical order.
6493 (trace_args): Spelling fixes.
6494
6495 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
6496
6497 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
6498 so they don't collide with user-defined macros.
6499 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
6500 this was never guaranteed, and now that we're using gnulib stdint,
6501 which defines int_fast16_t to long int, the problem is exposed.
6502
6503 2006-07-08 Paul Eggert <eggert@cs.ucla.edu>
6504
6505 * data/c.m4 (b4_basename): Simplify a bit, since we don't
6506 need the full POSIX semantics (and weren't implementing them
6507 anyway).
6508
6509 Adjust to Autoconf 2.60 and today's gnulib.
6510 * bootstrap (gnulib_modules): Add stdint.
6511 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
6512 no longer copies it.
6513 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
6514 since stdint needs the former and wcwidth (which is now required
6515 by mbswidth) needs the latter.
6516 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
6517 work around a compatibility glitch between gettext 0.14.6 and
6518 Autoconf 2.60.
6519 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
6520 Do not check for uintptr_t, since new stdint module does the right
6521 thing.
6522 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
6523 Add stdint.h, stdint_.h, wcwidth.h.
6524 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
6525 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
6526 stdint.m4, wchar_t.m4, wcwidth.m4.
6527 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
6528 usual order for ../lib/*.h files.
6529 (file_name_split): Use last_component, not base_name, to adjust
6530 to gnulib changes.
6531 * src/parse-gram.h: Include <strverscmp.h> in the usual order
6532 for ../lib/*.h files.
6533 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
6534 Define unconditionally, since we now assume the stdint module.
6535 * src/scan-skel.l: Include <dirname.h>.
6536 (BASE_QPUTS): Use last_component, not base_name.
6537 * src/system.h: Include <unlocked-io.h> in the usual order
6538 for ../lib/*.h files. Include <stdint.h> unconditionally,
6539 since we now use the stdint module.
6540 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
6541 HAVE_UINTPTR_T, since we now use the stdint module.
6542 (base_name): Remove decl, since files now include <dirname.h>
6543 to get the decl.
6544
6545 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
6546
6547 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
6548 New, default to 1.
6549 * data/yacc.c, data/glr.c, data/location.cc: Use them.
6550 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
6551 default.
6552 * tests/calc.at: Adjust.
6553
6554 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
6555
6556 * data/c.m4 (b4_basename): New.
6557 (b4_syncline): Also output the location of its invocation (from
6558 the skeleton).
6559 (b4_user_action, b4_define_user_action, b4_user_actions)
6560 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
6561 (b4_user_stype): New.
6562 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
6563
6564 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
6565
6566 In the grammar file, the first column is 1 not 0 on the first line as
6567 on every other line.
6568 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
6569 * tests/input.at (Torturing the Scanner): Update output.
6570
6571 * src/scan-gram.l (scanner_cursor): Declare it static.
6572
6573 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
6574
6575 In warnings, say "previous declaration" rather than "first
6576 declaration".
6577 * src/symtab.c (redeclaration): Do that here.
6578 * src/reader.c (record_merge_function_type): In the case of a result
6579 type clash, report the previous declaration rather than the very first
6580 one in the grammar file.
6581 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
6582 declared later): Add a third declaration to check this behavior.
6583 * tests/input.at (Incompatible Aliases): Update output.
6584
6585 2006-06-27 Akim Demaille <akim@epita.fr>
6586
6587 * doc/Doxyfile.in: New.
6588 * doc/Makefile.am: Use it.
6589 * src/lalr.h, src/symtab.h: Initial doxygenation.
6590
6591 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
6592
6593 Don't miss %merge result type warnings just because the LHS types are
6594 declared after the %merge. This continues the effort of the previous
6595 patch.
6596 * src/reader.c (get_merge_function): Don't set the merger type yet.
6597 (record_merge_function_type): New function for setting the merger type
6598 and checking for clashes.
6599 (grammar_current_rule_merge_set): Set the location of the %merge for
6600 the current rule.
6601 (packgram): Invoke record_merge_function_type for each rule now that
6602 all symbol type declarations have been parsed.
6603 * src/reader.h (merger_list.type_declaration_location): New member
6604 storing the location of the first %merge from which the type for this
6605 merging function was derived.
6606 * src/symlist.h (symbol_list.merger_declaration_location): New member
6607 storing the location of a rule's %merge, if any.
6608 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
6609 declared later): New test to catch the error fixed by the above patch.
6610
6611 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
6612
6613 Get action warnings (grammar_rule_check) right even when symbol
6614 declarations appear after the rules. Discussed at
6615 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
6616 and
6617 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
6618 Don't mistake the type of $$ in a midrule to be that of its parent
6619 rule's $$.
6620 * src/reader.c (grammar_current_rule_end): Don't invoke
6621 grammar_rule_check yet since not all symbol declarations may have been
6622 parsed yet.
6623 (grammar_midrule_action): Likewise.
6624 Don't record whether the midrule's $$ has been used yet since actions
6625 haven't been translated yet.
6626 Record the midrule's parent rule and its RHS index within the parent
6627 rule.
6628 (grammar_current_rule_action_append): Don't translate the action yet
6629 since not all symbol declarations may have been parsed yet and, thus,
6630 warnings about types for $$, $n, @$, and @n can't be reported yet.
6631 (packgram): Translate the action and invoke grammar_rule_check now that
6632 all symbol declarations have been parsed.
6633 * src/scan-code.l (handle_action_dollar): Now that this is invoked
6634 after parsing the entire grammar file, the symbol list here in the case
6635 of a midrule is actually the midrule's empty RHS, so reference its
6636 parent rule's RHS where necessary.
6637 On the other hand, now that you can already know it's a midrule, you
6638 aren't forced to think $$ has the same type as its parent rule's $$.
6639 (handle_action_at): In the case of a midrule, reference the parent rule
6640 where necessary.
6641 * src/symlist.c (symbol_list_new): Initialize new midrule-related
6642 members.
6643 (symbol_list_length): Now that this is invoked after all rules have
6644 been parsed, a NULL symbol (rather than a NULL symbol list node)
6645 terminates a rule. symbol_list_print already does this correctly.
6646 * src/symlist.h (symbol_list.midrule_parent_rule,
6647 symbol_list.midrule_parent_rhs_index): New members so that midrules can
6648 remember their relationships with their parents.
6649 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
6650 fixed by the above patch.
6651 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
6652 implementing...
6653 (Unused values): ... this old test case and...
6654 (Unused values before symbol declarations): ... this new test case.
6655 This one is the same as `Unused values' except that all symbol
6656 declarations appear after the rules in order to catch the rest of the
6657 errors fixed by the above patch.
6658
6659 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
6660
6661 More cleanup.
6662 * src/reader.c (current_rule): Declare it static since it's no longer
6663 used outside this file.
6664 (grammar_current_rule_action_append): Remove redundant arguments from
6665 translate_rule_action invocation.
6666 * src/reader.h (current_rule): Remove this unused extern.
6667 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
6668 * src/scan-code.l (translate_rule_action): Likewise.
6669
6670 2006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
6671
6672 Clean up yesterday's patch.
6673 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
6674 to...
6675 * src/reader.c (grammar_current_rule_action_append): ... here for
6676 consistency with grammar_current_rule_symbol_append.
6677 * tests/regression.at (Braced code in declaration in rules section):
6678 Make yyerror and yylex static as usual.
6679
6680 2006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
6681
6682 Fix bug that mistakes braced code in a declaration in the rules section
6683 to be a rule action. Mentioned at
6684 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
6685 * src/scan-gram.l: Move midrule action detection from the start of the
6686 scanning of any braced code to...
6687 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
6688 action. For readability, use $2 and @2 rather than the equivalent
6689 global variables.
6690 * tests/regression.at (Braced code in declaration in rules section):
6691 New test to catch the error fixed by the above patch.
6692
6693 Work on code readability some.
6694 * src/scan-code.l (current_rule): Get rid of this misleading and
6695 redundant declaration: it's actually extern'ed in reader.h.
6696 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
6697 translate_action): Add a rule argument and use it instead of the global
6698 current_rule.
6699 (translate_rule_action): This already receives current_rule through an
6700 argument, so pass it on to translate_action instead of assigning
6701 current_rule to current_rule.
6702 (translate_symbol_action, translate_code): Pass rule = NULL to
6703 translate_action.
6704
6705 2006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
6706
6707 Rename %before-definitions to %start-header and %after-definitions to
6708 %end-header. Don't use these declarations to separate pre-prologue
6709 blocks from post-prologue blocks. Add new order-independent
6710 declarations %before-header and %after-header as alternatives to the
6711 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
6712 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
6713 * NEWS (2.3+): Update for these changes.
6714 * data/glr.c (b4_before_definitions): Update to...
6715 (b4_start_header): ... this.
6716 (b4_after_definitions): Update to...
6717 (b4_end_header): ... this.
6718 * data/glr.cc: Likewise.
6719 * data/lalr1.cc: Likewise.
6720 * data/yacc.c: Likewise.
6721 * doc/bison.texinfo (The prologue): Update names, and replace remaining
6722 prologue blocks with %*-header declarations.
6723 (Calc++ Parser): Likewise.
6724 (Decl Summary): Update names.
6725 (Table of Symbols): Update description.
6726 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
6727 (PERCENT_END_HEADER): ... this.
6728 (PERCENT_BEFORE_DEFINITIONS): Update to...
6729 (PERCENT_START_HEADER): ... this.
6730 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
6731 (declaration): Update token names and m4 macro names.
6732 When parsing %end-header and %start-header, invoke translate_code
6733 before muscle_code_grow, and no longer set global booleans to remember
6734 whether these declarations have been seen.
6735 Parse new %after-header and %before-header.
6736 * src/reader.c (before_definitions, after_definitions): Remove.
6737 (prologue_augment): Accept a new bool argument to specify whether to
6738 augment the pre-prologue or post-prologue.
6739 * src/reader.h (before_definitions, after_definitions): Remove these
6740 extern's.
6741 (prologue_augment): Add new bool argument.
6742 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
6743 (PERCENT_END_HEADER): ... this.
6744 (PERCENT_BEFORE_DEFINITIONS): Update to...
6745 (PERCENT_START_HEADER): ... this.
6746 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
6747 * tests/actions.at (Printers and Destructors): Update names.
6748
6749 2006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
6750
6751 Add comparison operators for C++ location classes. Discussed at
6752 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
6753 * data/c++.m4 (b4_define_location_comparison): New boolean %define
6754 declaration indicating whether filename_type has an operator==. If
6755 filename_type is `std::string', it defaults to `1', `0' otherwise.
6756 * data/location.cc: Iff b4_define_location_comparison is `1', add
6757 operator== and operator!= for class position and for class location.
6758
6759 Some minor fixes.
6760 * src/scan-action.l: Remove unused file.
6761 * src/symtab.c (symbol_printer_set): Use printer_location not
6762 destructor_location.
6763 * src/symtab.h (struct symbol): Replace incorrect source comment for
6764 printer members.
6765 * tests/input.at (Incompatible Aliases): Update output with correct
6766 printer location.
6767
6768 2006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
6769
6770 Don't put the pre-prologue in the header file. For the yacc.c code
6771 file and the glr.c header and code files, move the pre-prologue before
6772 the token definitions. Add new %before-definitions and
6773 %after-definitions to declare code that will go in both the header file
6774 and code file. Discussed at
6775 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
6776 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
6777 and
6778 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
6779 * NEWS (2.3+): Describe these changes.
6780 * data/glr.c (b4_pre_prologue): Move from within to before...
6781 (b4_shared_declarations): ... this.
6782 Add new b4_before_definitions before b4_token_enums.
6783 Add new b4_after_definitions at the end.
6784 * data/glr.cc (b4_pre_prologue): Replace with...
6785 (b4_before_definitions): ... this in the header file.
6786 (b4_after_definitions): New near the end of the header file.
6787 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
6788 code file right before including the header file.
6789 (b4_before_definitions): New in the previous position of
6790 b4_pre_prologue in the header file.
6791 (b4_after_definitions): New near the end of the header file.
6792 * data/yacc.c: Clean up some m4 quoting especially in the header file.
6793 (b4_token_enums_defines): In the code file, move to right before
6794 YYSTYPE for consistency with the header file.
6795 (b4_before_definitions): New right before b4_token_enums_defines in
6796 both the header and code file.
6797 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
6798 header and code file.
6799 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
6800 of prologues for %union dependencies.
6801 (Decl Summary): In %defines description, mention the effect of
6802 %before-definitions and %after-definitions on the header file.
6803 (Calc++ Parser): Forward declare driver in a %before-definitions rather
6804 than in the pre-prologue so that make check succeeds.
6805 (Table of Symbols): Add entries for %before-definitions and
6806 %after-definitions.
6807 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
6808 %before-definitions.
6809 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
6810 (declaration): Parse those declarations and append to
6811 b4_before_definitions and b4_after_definitions, respectively.
6812 * src/reader.c (before_definitions, after_definitions): New bools to
6813 track whether those declarations have been seen.
6814 (prologue_augment): Add to the post-prologue if %union,
6815 %before-definitions, or %after-definitions has been seen.
6816 * src/reader.h (before_definitions, after_definitions): New extern's.
6817 * src/scan-gram.l: Scan the new declarations.
6818 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
6819 prologue block in a %before-definitions or a %after-definitions based
6820 on whether the %union is declared.
6821 * tests/regression.at (Early token definitions with --yacc, Early token
6822 definitions without --yacc): Move tests for token definitions into the
6823 post-prologue since token names are no longer defined in the
6824 pre-prologue.
6825
6826 2006-06-20 Akim Demaille <akim@epita.fr>
6827
6828 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
6829 (symbol_get): Use it.
6830 * src/parse-gram.y: Use it.
6831
6832 2006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
6833
6834 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
6835 build succeeds when configured with --enable-gcc-warnings.
6836
6837 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
6838
6839 * src/parse-gram.y (char_name): New function.
6840 (CHAR, STRING, string_content): For %printer, properly escape.
6841 (ID): Prefer fputs to fprintf.
6842 (id): Reindent to be consistent with other rules.
6843 Properly quote char.
6844
6845 The Translation Project changed its way of publishing translations
6846 to maintainers. I haven't received any responses to my request
6847 for supporting the old way, or for documenting the new way. I
6848 have modified 'bootstrap' to use screen scraping
6849 (in this case, HTML scraping). This is unreliable and inelegant,
6850 but I don't see any better way. Yuck.
6851 * bootstrap (TP_URL, WGET_COMMAND): New vars.
6852 (get_translations): New function, which uses HTML scraping to
6853 deduce locations of latest translations.
6854 Use this function to grab both bison and bison-runtime .po files.
6855 Don't bother priming the pump for the runtime-po domain any more,
6856 as it's now translated better than bison is.
6857
6858 2006-06-19 Akim Demaille <akim@epita.fr>
6859
6860 * src/scan-gram.l: No longer "parse" things after `%union' until
6861 `{'. Rather, return a single "%union" token.
6862 No longer make symbols: return strings, and leave the conversion
6863 to symbols to the parser.
6864 (SC_PRE_CODE, token_type): Remove.
6865 * src/parse-gram.y (%union): New field `character'.
6866 Sort tokens.
6867 (CHAR): New token.
6868 (ID, ID_COLON): Now that the scanner no longer makes them
6869 identifiers, adjust all uses to invoke symbol_get.
6870 (id_colon): New, wraps the conversion from string to symbol.
6871 (%union): Accept a possible union_name.
6872 (symbol): Now can be a char.
6873 * data/c.m4 (b4_union_name): Leave a default value.
6874 * data/glr.c, data/yacc.c: Use it.
6875
6876 2006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
6877
6878 For associating token numbers with token names for "yacc.c", don't use
6879 #define statements unless `--yacc' is specified; always use enum
6880 yytokentype. Most important discussions start at:
6881 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
6882 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
6883 and
6884 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
6885 * NEWS (2.3+): Mention.
6886 * data/c.m4 (b4_yacc_if): New.
6887 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
6888 token #define's.
6889 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
6890 on token name definitions.
6891 * src/getargs.c (usage): Capitalize `Yacc' in English.
6892 * src/output.c (prepare): Define b4_yacc_flag.
6893 * tests/regression.at (Early token definitions): Test that tokens names
6894 are defined before the pre-prologue not just before the post-prologue.
6895 Remove this test case and copy to...
6896 (Early token definitions with --yacc): ... this to test #define's.
6897 (Early token definitions without --yacc): ... and this to test enums.
6898
6899 2006-06-11 Paul Eggert <eggert@cs.ucla.edu>
6900
6901 * NEWS: Reword the post-2.3 change to not be so optimistic about
6902 removing the old "look-ahead" spelling.
6903 Update previous look-ahead/lookahead change reports.
6904 * REFERENCES: look-ahead -> lookahead (since that's
6905 what he actually wrote).
6906 * doc/refcard.tex: look ahead -> lookahead,
6907 look-ahead -> lookahead
6908
6909 2006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
6910
6911 For consistency, use `lookahead' instead of `look-ahead' or
6912 `look_ahead'. Discussed starting at
6913 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
6914 and then at
6915 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
6916 * NEWS: For the next release, note the change to `--report'.
6917 * TODO, doc/bison.1: Update English.
6918 * doc/bison.texinfo: Update English.
6919 (Understanding Your Parser, Bison Options): Document as
6920 `--report=lookahead' rather than `--report=look-ahead'.
6921 * src/conflicts.c: Update English in comments.
6922 (lookahead_set): Rename from look_ahead_set.
6923 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
6924 (resolve_sr_conflict): Rename local look_ahead_tokens to
6925 lookahead_tokens, and update other uses.
6926 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
6927 count_rr_conflicts, conflicts_free): Update uses.
6928 * src/getargs.c (report_args): Move "lookahead" before alternate
6929 spellings.
6930 (report_types): Update uses.
6931 (usage): For `--report' usage description, state `lookahead' spelling
6932 rather than `look-ahead'.
6933 * src/getargs.h (report.report_lookahead_tokens): Rename from
6934 report_look_ahead_tokens.
6935 * src/lalr.c: Update English in comments.
6936 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
6937 (state_lookahead_tokens_count): Rename from
6938 state_look_ahead_tokens_count.
6939 Rename local n_look_ahead_tokens to n_lookahead_tokens.
6940 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
6941 Rename local n_look_ahead_tokens to n_lookahead_tokens.
6942 Update other uses.
6943 Update English in output.
6944 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
6945 * src/print.c: Update English in comments.
6946 (lookahead_set): Rename from look_ahead_set.
6947 (print_reduction): Rename argument lookahead_token from
6948 look_ahead_token.
6949 (print_core, state_default_rule, print_reductions, print_results):
6950 Update uses.
6951 * src/print_graph.c: Update English in comments.
6952 (print_core): Update uses.
6953 * src/state.c: Update English in comments.
6954 (reductions_new): Update uses.
6955 (state_rule_lookahead_tokens_print): Rename from
6956 state_rule_look_ahead_tokens_print, and update other uses.
6957 * src/state.h: Update English in comments.
6958 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
6959 (state_rule_lookahead_tokens_print): Rename from
6960 state_rule_look_ahead_tokens_print.
6961 * src/tables.c: Update English in comments.
6962 (conflict_row, action_row): Update uses.
6963 * tests/glr-regression.at
6964 (Incorrect lookahead during deterministic GLR,
6965 Incorrect lookahead during nondeterministic GLR): Rename
6966 print_look_ahead to print_lookahead.
6967 * tests/torture.at: Update English in comments.
6968 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
6969 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
6970 (Many lookahead tokens): Update uses.
6971 * data/glr.c: Update English in comments.
6972 * lalr1.cc: Likewise.
6973 * yacc.c: Likewise.
6974 * src/conflicts.h: Likewise.
6975 * src/lalr.h: Likewise.
6976 * src/main.c: Likewise.
6977 * src/output.c: Likewise.
6978 * src/parse-gram.c: Likewise.
6979 * src/tables.h: Likewise.
6980 * tests/calc.at: Likewise.
6981
6982 2006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
6983
6984 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
6985
6986 2006-06-07 Paul Eggert <eggert@cs.ucla.edu>
6987
6988 * TODO: Add request from Nelson H. F. Beebe to be able to install
6989 Bison without installing the yacc script.
6990
6991 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
6992
6993 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
6994 and yytext if they're already #define'd.
6995 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
6996 * src/scan-code-c.c: ... here.
6997 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
6998 <config.h>.
6999
7000 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
7001
7002 Get Bison to build again when configured with --enable-gcc-warnings.
7003 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
7004 missing #include's.
7005 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
7006 loc argument as it shadows a global.
7007 * src/scan-gram.l: Remove stray comma that prevents boundary_set
7008 invocation.
7009
7010 * src/.cvsignore: Add scan-code.c.
7011
7012 2006-06-07 Akim Demaille <akim@epita.fr>
7013
7014 * src/scan-gram.l: Move the "add a trailing ; to actions" code
7015 to...
7016 * src/scan-code.l: here.
7017 * tests/input.at (Torturing the Scanner): Fix another location
7018 error.
7019
7020 2006-06-07 Akim Demaille <akim@epita.fr>
7021
7022 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
7023
7024 2006-06-06 Akim Demaille <akim@epita.fr>
7025
7026 Extract the parsing of user actions from the grammar scanner.
7027 As a consequence, the relation between the grammar scanner and
7028 parser is much simpler. We can also split "composite tokens" back
7029 into simple tokens.
7030 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
7031 * src/scan-gram.l (add_column_width, adjust_location): Move to and
7032 rename as...
7033 * src/location.h, src/location.c (add_column_width)
7034 (location_compute): these.
7035 Fix the column count: the initial column is 0.
7036 (location_print): Be robust to ending column being 0.
7037 * src/location.h (boundary_set): New.
7038 * src/main.c: Adjust to scanner_free being renamed as
7039 gram_scanner_free.
7040 * src/output.c: Include scan-code.h.
7041 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
7042 Use boundary_set.
7043 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
7044 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
7045 which is now, again, a separate token.
7046 Adjust all dependencies.
7047 Whereever actions with $ and @ are used, use translate_code.
7048 (action): Remove this nonterminal which is now useless.
7049 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
7050 (grammar_current_rule_action_append): Use translate_code.
7051 (packgram): Bound check ruleno, itemno, and rule_length.
7052 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
7053 (last_string, last_braced_code_loc, max_left_semantic_context)
7054 (scanner_initialize, scanner_free, scanner_last_string_free)
7055 (gram_out, gram_lineno, YY_DECL_): Move to...
7056 * src/scan-gram.h: this new file.
7057 (YY_DECL): Rename as...
7058 (GRAM_DECL): this.
7059 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
7060 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
7061 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
7062 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
7063 Move these declarations, and...
7064 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
7065 these to...
7066 * src/flex-scanner.h: this new file.
7067 * src/scan-gram.l (rule_length, rule_length_overflow)
7068 (increment_rule_length): Remove.
7069 (last_braced_code_loc): Rename as...
7070 (gram_last_braced_code_loc): this.
7071 Adjust to the changes of the parser.
7072 Move all the handling of $ and @ into...
7073 * src/scan-code.l: here.
7074 * src/scan-gram.l (handle_dollar, handle_at): Remove.
7075 (handle_action_dollar, handle_action_at): Move to...
7076 * src/scan-code.l: here.
7077 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
7078 scan-code.h, scan-code-c.c, scan-gram.h.
7079 (EXTRA_bison_SOURCES): Add scan-code.l.
7080 (BUILT_SOURCES): Add scan-code.c.
7081 (yacc): Be robust to white spaces.
7082
7083 * tests/conflicts.at, tests/input.at, tests/reduce.at,
7084 * tests/regression.at: Adjust the column numbers.
7085 * tests/regression.at: Adjust the error message.
7086
7087 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
7088
7089 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
7090 Use Akim's wording from
7091 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
7092
7093 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
7094
7095 Between Bison releases, manually append `+' to the previous Bison
7096 release number, and use that as a signal to automatically print the
7097 ChangeLog's CVS Id keyword from --version. Discussed starting at
7098 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
7099 * ChangeLog: Add Id header.
7100 * configure.ac (AC_INIT): Append `+' to `2.3'.
7101 * src/.cvsignore: Add revision.c.
7102 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
7103 (BUILT_SOURCES): Add revision.c.
7104 (revision.c): New target rule. This file defines a new global variable
7105 named revision. It initializes it with either the Id from ChangeLog
7106 or, if VERSION doesn't contain `+', with the empty string.
7107 * src/getargs.c (version): Print the value of revision.
7108 * src/revision.h: Extern revision.
7109
7110 2006-06-05 Paul Eggert <eggert@cs.ucla.edu>
7111
7112 * NEWS: Version 2.3.
7113 * configure.ac (AC_INIT): Likewise.
7114
7115 2006-05-30 Paul Eggert <eggert@cs.ucla.edu>
7116
7117 * data/glr.c (YYRECOVERING): Define to be a function-like macro
7118 with no arguments, not as an object-like macro. This is for
7119 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
7120 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
7121 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
7122 Document this.
7123
7124 2006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
7125
7126 * src/getargs.c (usage): Back out yesterday's modification of the
7127 --help output so that we don't have to wait for translation before
7128 releasing 2.3.
7129
7130 2006-05-29 Paul Eggert <eggert@cs.ucla.edu>
7131
7132 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
7133 Problem reported by Akim Demaille.
7134
7135 2006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
7136
7137 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
7138
7139 2006-05-26 Paul Eggert <eggert@cs.ucla.edu>
7140
7141 * data/yacc.c (yy_reduce_print): Omit trailing white space in
7142 generated source code. Problem reported by Frans Englich in
7143 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
7144
7145 2006-05-22 Paul Eggert <eggert@cs.ucla.edu>
7146
7147 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
7148 shell, not within 'make', so that 'make' by an ordinary builder
7149 (using GNU make) does not worry about configuring gzip. This also
7150 works around a bug reported independently by Keith Thompson and by
7151 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
7152 stderr rather than stdout, messing up the build logs.
7153
7154 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
7155
7156 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
7157 to make sure that YYID will never be unused. This fixes a 'make
7158 maintainer-check' failure caused by the recent changes to the 'Trivial
7159 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
7160 not used.
7161 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
7162
7163 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
7164
7165 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
7166 state before an empty RHS is always resolved here. Only the location
7167 of that state is guaranteed to be resolved, and that's enough. This
7168 fixes the remaining bug reported by Derek M. Jones in
7169 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
7170 * tests/glr-regression.at (Uninitialized location when reporting
7171 ambiguity): Test the above case.
7172 Also, the embedded comments in this test case claim it checks the case
7173 of an empty RHS that has inherited the initial location. However, the
7174 corresponding LHS was already resolved, so yyresolveLocations didn't
7175 actually have reason to modify it. Fix this by forcing
7176 nondeterministic operation at the beginning of the parse.
7177
7178 2006-05-20 Paul Eggert <eggert@cs.ucla.edu>
7179
7180 * data/c.m4 (b4_yy_symbol_print_generate):
7181 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
7182 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
7183 of the bugs reported today by Derek M Jones in
7184 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
7185 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
7186 defined to be a type name without parens or brackets.
7187 (Location Type): Similarly for YYLTYPE.
7188 * tests/regression.at (Trivial grammars): Put in a test for this
7189 bug that will be caught by 'make maintainer-check' (though not,
7190 alas, by 'make check' unless your compiler is picky).
7191
7192 2006-05-19 Paul Eggert <eggert@cs.ucla.edu>
7193
7194 * NEWS: Version 2.2.
7195 * configure.ac (AC_INIT): Likewise.
7196
7197 2006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
7198
7199 * data/glr.c (yyreportTree): Make room in yystates for the state
7200 preceding the RHS. This fixes the segmentation fault reported by Derek
7201 M. Jones in
7202 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
7203 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
7204 to the user. Reported for yyreportTree by Derek M. Jones later in the
7205 same thread.
7206 * THANKS: Add Derek M. Jones.
7207 Update my email address.
7208 Fix typo in Steve Murphy's name.
7209
7210 2006-05-14 Paul Eggert <eggert@cs.ucla.edu>
7211
7212 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
7213 checking against YYLAST that caused the parser to miss a potential
7214 alternative in its diagnostic.
7215 Problem reported by Maria Jose Moron Fernandez in
7216 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
7217 * data/lalr1.cc (yysyntax_error_): Likewise.
7218 * data/yacc.c (yysyntax_error): Likewise.
7219 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
7220 tokens, in case we run into an older C compiler.
7221 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
7222 Use them to check for the off-by-one error fixed above.
7223
7224 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
7225 YYSIZE_T, not size_t.
7226 * tests/regression.at (Trivial grammars): New test, to catch
7227 the error fixed by the above patch.
7228
7229 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
7230
7231 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
7232 scheme.
7233 Reported by Steve Murphy.
7234
7235 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
7236
7237 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
7238 * data/glr.cc: b4_location_flag is now b4_locations_flag.
7239
7240 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
7241
7242 Implement --trace=m4.
7243 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
7244 * src/output.c (output_skeleton): When set, pass -dV to m4.
7245
7246 Factor the handling of flags in m4.
7247 * src/output.c (prepare): Rename the muscle names debug, defines,
7248 error_verbose to debug_flag, defines_flag, error_verbose_flag.
7249 * data/c.m4: Adjust.
7250 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
7251 Use b4_define_flag_if to define other b4_FLAG_if macros.
7252 (b4_location_if): As a consequence, rename as...
7253 (b4_locations_if): this, for consistency.
7254 Adjust all the skeletons.
7255
7256 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
7257
7258 * etc/bench.pm: Shorten bench names.
7259
7260 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
7261
7262 * src/output.h, src/output.c (error_verbose): Move to...
7263 * src/getargs.h, src/getargs.c: here.
7264 Sort the flags.
7265 Adjust dependencies.
7266
7267 2006-05-13 Paul Eggert <eggert@cs.ucla.edu>
7268
7269 * data/c.m4 (b4_copyright): Put the special exception for Bison
7270 skeletons here, so we don't have to put it in each skeleton. All
7271 uses changed. Suggested by Akim Demaille. Also, wrap the
7272 copyright notice, in case it is longer than 80 columns. Replace
7273 comma by newline after title.
7274
7275 2006-05-11 Paul Eggert <eggert@cs.ucla.edu>
7276
7277 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
7278 incompatibility, not a bug. Mention that it wasn't fixed as of
7279 flex 2.5.33.
7280
7281 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
7282
7283 * examples/extexi: Enforce the precedence of concatenation over
7284 >>.
7285 Reported by Tommy Nordgren.
7286
7287 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
7288
7289 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
7290 with the member "token".
7291 Reported by Martin Nylin.
7292
7293 2006-05-08 Paul Eggert <eggert@cs.ucla.edu>
7294
7295 * data/glr.c: Switch to Bison 2.2 special-exception language in
7296 the copyright notice. Use more-regular format for titles and
7297 copyright notices.
7298 * data/glr.cc: Likewise.
7299 * data/location.cc: Likewise.
7300 * data/yacc.cc: Likewise.
7301 * doc/bison.texinfo (Conditions): Document this.
7302 * NEWS: likewise. Upgrade version to 2.2.
7303
7304 2006-04-27 Akim Demaille <akim@lrde.epita.fr>
7305
7306 * data/glr.cc: Remove dead code.
7307
7308 2006-04-25 Paul Eggert <eggert@cs.ucla.edu>
7309
7310 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
7311 that variable and the line breaks the bootstrap. Problem reported
7312 by Juan M. Guerrero.
7313
7314 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
7315
7316 * doc/bison.texinfo (Multiple start-symbols): New.
7317
7318 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
7319
7320 * etc/README, etc/bench.pl: New.
7321
7322 2006-04-03 Akim Demaille <akim@lrde.epita.fr>
7323
7324 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
7325 rule.
7326 Reported by Mickael Labau.
7327 * tests/input.at (Torturing the Scanner): Test it.
7328
7329 2006-03-16 Paul Eggert <eggert@cs.ucla.edu>
7330
7331 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
7332 Problem reported by Bob Rossi.
7333
7334 2006-03-13 Paul Eggert <eggert@cs.ucla.edu>
7335
7336 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
7337 and didn't really work.
7338 For the index, use @ifnotinfo, not @iftex.
7339 Minor cleanups of spacing and terminology.
7340
7341 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
7342
7343 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
7344 of AT_NAME_PREFIX when %name-prefix is not used.
7345
7346 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
7347
7348 Apply --prefix to C++ skeletons too: they change the namespace.
7349 The test suite already exercize these cases.
7350 * data/c++.m4 (b4_namespace): New.
7351 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
7352 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
7353 * data/yacc.c, data/glr.c: Remove a useless `[]'.
7354 * doc/bison.texinfo: Document it.
7355 (Option Cross Key): Use @multitable in all formats. It looks
7356 nicer, even in TeX outputs.
7357 (Rules): Use the same code whatever the output type is.
7358 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
7359 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
7360 * tests/calc.at: Use it, instead of hard coding `yy'.
7361
7362 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
7363
7364 * TODO: Remove dead items.
7365
7366 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
7367
7368 * doc/FAQ: Remove, merged into...
7369 * doc/bison.texinfo (FAQ): this.
7370 * doc/Makefile.am (EXTRA_DIST): Adjust.
7371
7372 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
7373
7374 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
7375 even if empty.
7376 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
7377 * doc/bison.texinfo (Calc++ Scanner): Use it.
7378
7379 2006-03-09 Paul Eggert <eggert@cs.ucla.edu>
7380
7381 Fix two nits reported by twlevo, plus one more that I discovered.
7382
7383 * src/assoc.h (assoc_to_string): Give a name to the arg, as
7384 this is the usual Bison style.
7385 * src/location.h (location_print): Likewise.
7386
7387 * src/reader.h (token_name): Likewise.
7388
7389 2006-03-08 Paul Eggert <eggert@cs.ucla.edu>
7390
7391 Fix some nits reported by twlevo.
7392 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
7393 and "POSIX". Use more-modern syntax for URLs. Mention C++
7394 and ask for Java. Don't hardwire OS version numbers. Add
7395 copyright notice.
7396 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
7397 * src/conflicts.c (solved_conflicts_obstack): Now static.
7398
7399 2006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
7400
7401 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
7402 page. Say "you can use it" not "you may use it" as on the web page;
7403 we're describing capabilities not granting permission.
7404
7405 2006-03-06 Paul Eggert <eggert@cs.ucla.edu>
7406
7407 * data/glr.c (yyresolveLocations): Rename local variables to avoid
7408 shadowing warnings. Use usual patter for iterating through RHS.
7409 * tests/glr-regression.at
7410 (Uninitialized location when reporting ambiguity):
7411 Modify yylex so that it uses its argument, rather than trying
7412 to rely on ARGSUSED (which doesn't work for gcc with warnings).
7413 const char -> char const.
7414
7415 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
7416 Don't use tabs inside commands; it messes up 'ps'.
7417 Problem reported by twlevo.
7418
7419 2006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
7420
7421 * tests/glr-regression.at (Uninitialized location when reporting
7422 ambiguity): New test case.
7423 * data/glr.c (yyresolveLocations): New function, which uses
7424 YYLLOC_DEFAULT.
7425 (yyresolveValue): Invoke yyresolveLocations before reporting an
7426 ambiguity.
7427 * doc/bison.texinfo (Default Action for Locations): Note
7428 YYLLOC_DEFAULT's usage for ambiguity locations.
7429 (GLR Semantic Actions): Cross-reference those notes.
7430
7431 2006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
7432
7433 * tests/glr-regression.at (Leaked semantic values when reporting
7434 ambiguity): Remove unnecessary union and type declarations.
7435 (Leaked lookahead after nondeterministic parse syntax error): New test
7436 case.
7437 * data/glr.c (yyparse): Check for zero stacks remaining before
7438 attempting to shift the lookahead so that you don't lose it.
7439
7440 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
7441
7442 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
7443 * tests/glr-regression.at (Leaked semantic values when reporting
7444 ambiguity): New test case.
7445 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
7446 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
7447 now unnecessary yystackp parameter.
7448 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
7449 destructors can be called.
7450
7451 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
7452 in existing testcases.
7453
7454 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
7455
7456 Don't leak semantic values for parent RHS when a user action cuts the
7457 parser, and clean up related code a bit.
7458 * tests/glr-regression.at (Leaked merged semantic value if user action
7459 cuts parse): Rename to...
7460 (Leaked semantic values if user action cuts parse): ... this. Add check
7461 for leaked parent RHS values.
7462 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
7463 between an unresolved state (non-empty chain of semantic options) and
7464 an incomplete one (signaled by an empty chain).
7465 (yyresolveStates): Document the interface. Move all manipulation of a
7466 successfully or unsuccessfully resolved yyGLRState to...
7467 (yyresolveValue): ... here so that yyresolveValue always leaves a
7468 yyGLRState with consistent data and thus is easier to understand.
7469 Remove the yyvalp and yylocp parameters since they are always just
7470 taken from the yys parameter. When reporting a discarded merged value
7471 in debugging output, note that it is incompletely merged. Document the
7472 interface.
7473 (yyresolveAction): If resolving any of the RHS states fails, destroy
7474 them all rather than leaking them. Thus, as long as user actions are
7475 written to clean up the RHS correctly, yyresolveAction always cleans up
7476 the RHS of a semantic option. Document the interface.
7477
7478 2006-02-27 Paul Eggert <eggert@cs.ucla.edu>
7479
7480 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
7481 led to a segmentation fault in GNU Pascal. Problem reported
7482 by Waldek Hebisch.
7483
7484 2006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
7485
7486 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
7487 mid-rule action inside a nonterminal symbol in order to declare a
7488 destructor for its semantic value.
7489
7490 2006-02-16 Paul Eggert <eggert@cs.ucla.edu>
7491
7492 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
7493 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
7494 __cplusplus && ! defined _STDLIB_H && !
7495 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
7496 defined free))]: Include <stdlib.h> rather than rolling our own
7497 declarations of malloc and free, to avoid problems with
7498 incompatible declarations (using 'throw') C++'s stdlib.h. This
7499 should fix Debian bug 340012
7500 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
7501 reported by Guillaume Melquiond.
7502
7503 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
7504
7505 * NEWS: Clarify symbols versus types in unused-value warnings.
7506
7507 * configure.ac (AC_INIT): Bump version number.
7508
7509 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
7510
7511 * NEWS: Version 2.1a.
7512 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
7513 since C99 requires this.
7514
7515 2006-02-11 Paul Eggert <eggert@cs.ucla.edu>
7516
7517 * m4/c-working.m4: New file.
7518 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
7519
7520 2006-02-10 Paul Eggert <eggert@cs.ucla.edu>
7521
7522 * Makefile.maint: Merge from coreutils.
7523
7524 2006-02-09 Paul Eggert <eggert@cs.ucla.edu>
7525
7526 More portability fixes for problems summarized by Nelson H. F. Beebe.
7527
7528 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
7529 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
7530 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
7531 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
7532 messes up because C++ code is compiled in 32-bit mode but linked
7533 in 64-bit mode.
7534
7535 2006-02-08 Paul Eggert <eggert@cs.ucla.edu>
7536
7537 More portability fixes for problems summarized by Nelson H. F. Beebe.
7538
7539 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
7540 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
7541
7542 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
7543 nodist_PROGRAMS, since we don't need to actually compile the
7544 example if we're just doing a plain 'make'. This avoids bothering
7545 the installer unnecessarily about problems due to weird C++
7546 compilers.
7547
7548 2006-02-06 Paul Eggert <eggert@cs.ucla.edu>
7549
7550 More portability fixes for problems summarized by Nelson H. F. Beebe.
7551
7552 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
7553 than #include "...", and compile with -I'.'. The old method was
7554 not portable, according to Posix and the C standard, and it does
7555 not work with Sun C 5.7, where previous #line directives affect
7556 the working directory used in later #include "..." directives.
7557
7558 2006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7559
7560 Various DJGGP specific issues in /djgpp
7561
7562 2006-02-02 Paul Eggert <eggert@cs.ucla.edu>
7563
7564 More portability fixes for problems summarized by Nelson H. F. Beebe.
7565
7566 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
7567 '#include <map>' works and that you can apply ++ to iterators.
7568
7569 2006-02-01 Paul Eggert <eggert@cs.ucla.edu>
7570
7571 Work around portability problems summarized by Nelson H. F. Beebe in
7572 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
7573
7574 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
7575 that '#include <string>' works.
7576
7577 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
7578 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
7579 "warning: sorry: semantics of inline function static data `const
7580 unsigned char translate_table[262]' are wrong (you'll wind up with
7581 multiple copies)".
7582
7583 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
7584 or, xor to not_, and_, or_, and xor_, respectively. This works
7585 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
7586 random system header somewhere that includes the equivalent of
7587 <iso646.h>.
7588
7589 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
7590 -E" works; it apparently doesn't work with PathScale EKO Compiler
7591 Suite Version 2.0.
7592
7593 2006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
7594
7595 During deterministic GLR operation, user actions should be able to
7596 influence the parse by changing yychar. To make this easier to fix and
7597 to make glr.c easier to evolve in general, don't maintain yytoken in
7598 parallel with yychar; just compute yytoken when needed.
7599 * tests/glr-regression.at (Incorrect lookahead during deterministic
7600 GLR): Check that setting yychar in a user action has the intended
7601 effect.
7602 * data/glr.c (yyGLRStack): Remove yytokenp member.
7603 (yyclearin): Don't set *yytokenp.
7604 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
7605 yychar rather than *yytokenp to determine the current lookahead.
7606 Compute yytoken locally when needed.
7607 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
7608 point to.
7609
7610 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
7611 after `--report' documentation.
7612
7613 2006-01-30 Paul Eggert <eggert@cs.ucla.edu>
7614
7615 * src/parse-gram.y (grammar_declaration): Location of printer
7616 symbol is @1, not list->location. Bug reported by twlevo.
7617 * tests/input.at (Incompatible Aliases): Adjust to above change.
7618
7619 2006-01-29 Paul Eggert <eggert@cs.ucla.edu>
7620
7621 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
7622 all the test at once. This makes the output easier to read in the
7623 normal case.
7624
7625 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
7626 got from <http://bro-ids.org/download.html>. The bug is that
7627 when two actions appeared in succession, the second one was
7628 scanned before the first one was added to the grammar rule
7629 as a midrule action. Bison then output the incorrect warning
7630 "parse.y:905.17-906.36: warning: unused value: $3".
7631 * src/parse-gram.y (BRACED_CODE, action): These are no longer
7632 associated with a value.
7633 (rhs): Don't invoke grammar_current_rule_action_append.
7634 (action): Invoke it here instead.
7635 * src/reader.c (grammar_midrule_action): Now extern.
7636 (grammar_current_rule_action_append): Don't invoke
7637 grammar_midrule_action; that is now the scanner's job.
7638 * src/reader.h (last_string, last_braced_code_loc):
7639 (grammar_midrule_action): New decls.
7640 * src/scan-gram.l (last_string): Now extern, sigh.
7641 (last_braced_code_loc): New extern variable.
7642 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
7643 rule already has an action.
7644 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
7645 * tests/input.at (AT_CHECK_UNUSED_VALUES):
7646 Add some tests to check that the above changes fixed the bug.
7647
7648 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
7649
7650 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
7651 All used changed. Check whether the symbol has a destructor,
7652 not whether it is typed.
7653 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
7654 that the values are still reported as unused. All line numbers
7655 adjusted.
7656
7657 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
7658
7659 Work around a bug in bro 0.8, which underparenthesizes its
7660 definition of YYLLOC_DEFAULT.
7661 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
7662 their arguments.
7663 * data/lalr1.cc: Likewise.
7664 * data/yacc.cc: Likewise.
7665
7666 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
7667
7668 Work around a bug in Pike 7.0, and give the Pike folks a
7669 better way to override the usual int widths.
7670 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
7671 user can override the types.
7672 (short): #undef, to work around a bug in Pike 7.0.
7673 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
7674 (union yyalloc.yyss): Use yytype_int16 rather than short.
7675 All uses changed.
7676 (yysigned_char): Remove.
7677 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
7678 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
7679 * tests/regression.at (Web2c Actions): Adjust to above changes.
7680
7681 * src/reader.c (check_and_convert_grammar): New function.
7682 (reader): Close the input file even if something went wrong during
7683 parsing. Minor file descriptor leak reported by twlevo.
7684
7685 * src/assoc.c (assoc_to_string): Use a default: abort (); case
7686 to pacify gcc -Wswitch-default.
7687 * src/scan-gram.l (adjust_location): Use a default: break; case
7688 to pacify gcc -Wswitch-default.
7689 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
7690 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
7691 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
7692 Move these decls to scan-skel.l, since they don't need to be
7693 visible elsewhere.
7694 * src/scan-skel.l: Accept the above decls.
7695 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
7696 is used.
7697
7698 2006-01-21 Paul Eggert <eggert@cs.ucla.edu>
7699
7700 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
7701 since we don't want to insist on a version number at the start
7702 of the changelog every time.
7703 * Makefile.maint: Sync from coreutils a bit better.
7704 (sc_trailing_blank): Renamed from sc_trailing_space.
7705 All uses changed.
7706 (sc_no_if_have_config_h, sc_require_config_h):
7707 (sc_prohibit_assert_without_use): New rules.
7708 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
7709 (sc_dd_max_sym_length): Fix leading spaces in rule.
7710 (sc_system_h_headers): Prefix with @.
7711 (sc_useless_cpp_parens, m4-check): Output line numbers.
7712 (changelog-check): Allow version only in head.
7713 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
7714 satisfy new Makefile.maint rule.
7715 * data/glr.c: Likewise.
7716 * data/glr.cc: Likewise.
7717 * data/lalr1.cc: Likewise.
7718 * data/yacc.c: Likewise.
7719 * lib/ebitsetv.c: Likewise.
7720 * lib/lbitset.c: Likewise.
7721 * lib/subpipe.c: Likewise.
7722 * lib/timevar.c: Likewise.
7723 * src/system.h: Likewise.
7724 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
7725 * djgpp/Makefile.maint: Add copyright notice.
7726 * djgpp/README.in: Likewise.
7727 * djgpp/config.bat: Likewise.
7728 * djgpp/config.site: Likewise.
7729 * djgpp/config_h.sed: Likewise.
7730 * djgpp/djunpack.bat: Likewise.
7731 * djgpp/config.sed: Fix copyright notice to match standard format.
7732 * djgpp/subpipe.h: Likewise.
7733 * lib/bitsetv-print.c: Likewise.
7734 * lib/bitsetv.c: Likewise.
7735 * lib/subpipe.h: Likewise.
7736 * lib/timevar.c: Likewise.
7737 * lib/timevar.h: Likewise.
7738 * djgpp/subpipe.c: Use standard recipe for config.h.
7739 * lib/abitset.c: Likewise.
7740 * lib/bitset.c: Likewise.
7741 * lib/bitset_stats.c: Likewise.
7742 * lib/bitsetv-print.c: Likewise.
7743 * lib/bitsetv.c: Likewise.
7744 * lib/ebitsetv.c: Likewise.
7745 * lib/get-errno.c: Likewise.
7746 * lib/lbitset.c: Likewise.
7747 * lib/subpipe.c: Likewise.
7748 * lib/timevar.c: Likewise.
7749 * lib/vbitset.c: Likewise.
7750 * tests/local.at: Likewise.
7751 * src/scan-gram.l: Don't include verify.h, since system.h does
7752 that for us.
7753 * .x-sc_require_config_h: New file.
7754 * .x-sc_unmarked_diagnostics: New file.
7755
7756 2006-01-20 Paul Eggert <eggert@cs.ucla.edu>
7757
7758 Be a bit more systematic about using 'abort'.
7759 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
7760 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
7761 Put 'default: abort ();' before some other case, to satisfy older
7762 pedantic compilers.
7763 * lib/bitset_stats.c (bitset_stats_init): Likewise.
7764 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
7765 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
7766 * src/conflicts.c (resolve_sr_conflict): Likewise.
7767 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
7768 (get_decision_str, get_orientation_str, get_node_alignment_str):
7769 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
7770 (get_linestyle_str, get_arrowstyle_str): Likewise.
7771 * src/conflicts.c (resolve_sr_conflict):
7772 Use a default case rather than one for the one remaining enum
7773 value, to catch invalid enum values as well.
7774 * src/lalr.c (set_goto_map, map_goto):
7775 Prefer "assert (FOO);" to "if (!FOO) abort ();".
7776 * src/nullable.c (nullable_compute, token_definitions_output):
7777 Likewise.
7778 * src/reader.c (packgram, reader): Likewise.
7779 * src/state.c (transitions_to, state_new, state_reduction_find):
7780 Likewise.
7781 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
7782 (symbol_pack): Likewise.
7783 * src/tables.c (conflict_row, pack_vector): Likewise.
7784 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
7785 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
7786 * src/system.h: Don't include <assert.h>.
7787 (assert): New macro.
7788
7789 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
7790 (Destructor Decl, Parser Function, Pure Calling):
7791 Describe rules for braces inside C code more carefully.
7792
7793 2006-01-19 Paul Eggert <eggert@cs.ucla.edu>
7794
7795 Fix some porting glitches found by Nelson H. F. Beebe.
7796 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
7797 compilers that don't understand that abort () does not return.
7798 * src/state.c (transitions_to): Likewise.
7799 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
7800 that '#include <cstdlib>' works.
7801 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
7802 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
7803 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
7804 for the benefit of some pre-C99 compilers.
7805
7806 * bootstrap: Undo changes to gnulib files that autoreconf made.
7807
7808 Minor fixups to get 'make maintainer-check' to work.
7809 * configure.ac: Don't use -Wnested-externs, as it's incompatible
7810 with the new verify.h implementation.
7811 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
7812 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
7813 * data/yacc.c (YYUSE): Likewise.
7814 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
7815 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
7816 * src/parse-gram.y (declaration): Don't pass a string constant
7817 to a function that expects char *, since GCC might complain
7818 about the constant value.
7819 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
7820 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
7821 before #defining them.
7822 * tests/glr-regression.at
7823 (Incorrectly initialized location for empty right-hand side in GLR):
7824 In yyerror, use the msg arg.
7825 (Corrupted semantic options if user action cuts parse):
7826 (Incorrect lookahead during deterministic GLR):
7827 (Incorrect lookahead during nondeterministic GLR):
7828 Don't name a local var 'index'; it shadows string.h's 'index'.
7829
7830 2006-01-19 Akim Demaille <akim@epita.fr>
7831
7832 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
7833 location, not just parts of it.
7834
7835 2006-01-18 Paul Eggert <eggert@cs.ucla.edu>
7836
7837 * NEWS: Document the fact that multiple %unions are now allowed.
7838 * doc/bison.texinfo (Union Decl): Likewise.
7839 * TODO: This feature is now implemented, so remove it from
7840 the wishlist.
7841
7842 * Makefile.maint: Merge with coreutils Makefile.maint.
7843 (CVS_LIST): Use build-aux version if available.
7844 (VERSION_REGEXP): New macro.
7845 (syntax-check-rules): Add sc_no_if_have_config_h,
7846 sc_prohibit_assert_without_use, sc_require_config_h,
7847 sc_useless_cpp_parens.
7848 (sc_obsolete_symbols): Check for O_NDELAY.
7849 (sc_dd_max_sym_length): Track coreutils.
7850 (sc_unmarked_diagnostics): Look in all files, not just *.c.
7851 (sc_useless_cpp_parens): New rule.
7852 (news-date-check): Look for version or today's date.
7853 (changelog-check): Don't require version number near head.
7854 (copyright-check): Use current year instead of hardwiring 2005.
7855 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
7856 (announcement): Add --gpg-key-ID.
7857
7858 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
7859 with "file system".
7860
7861 Avoid undefined behavior that addressed just before the start of an
7862 array. Problem reported by twlevo.
7863 * src/reader.c (packgram): Prepend a new sentinel before ritem.
7864 * src/lalr.c (build_relations): Rely on new sentinel.
7865 * src/gram.c (gram_free): Adjust to new sentinel.
7866
7867 2006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
7868
7869 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
7870 yylookaheadNeeds. All uses updated.
7871 (yysplitStack): Rename local yynewLookaheadStatuses to
7872 yynewLookaheadNeeds.
7873 * data/glr-regression.at (Incorrect lookahead during nondeterministic
7874 GLR): In comments, change `lookahead status' to `lookahead need'.
7875
7876 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7877
7878 * data/glr.c (yysplitStack): A little stylistic rewrite.
7879
7880 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7881
7882 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
7883
7884 2006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
7885
7886 * doc/bison.texinfo: Fix some typos.
7887 (GLR Semantic Actions): New subsection discussing special
7888 considerations because GLR semantic actions might be deferred.
7889 (Actions): Mention look-ahead usage of yylval.
7890 (Actions and Locations): Mention look-ahead usage of yylloc.
7891 (Special Features for Use in Actions): Add YYEOF entry and mention it
7892 in the yychar entry.
7893 In the yychar entry, remove mention of the local yychar case (pure
7894 parser) since this is irrelevant information when writing semantic
7895 actions and since it's already discussed in `Table of Symbols' where
7896 yychar is otherwise described as an external variable.
7897 In the yychar entry, don't call it the `current' look-ahead since it
7898 isn't when semantic actions are deferred.
7899 In the yychar and yyclearin entries, add note about deferred semantic
7900 actions.
7901 Add yylloc and yylval entries discussing look-ahead usage.
7902 (Look-Ahead Tokens): When discussing yychar, don't call it the
7903 `current' look-ahead, and do mention yylval and yylloc.
7904 (Error Recovery): Cross-reference `Action Features' when mentioning
7905 yyclearin.
7906 (Table of Symbols): In the yychar entry, don't call it the `current'
7907 look-ahead.
7908 In the yylloc and yylval entries, mention look-ahead usage.
7909
7910 2006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
7911
7912 * tests/glr-regression.at: Update copyright year to 2006.
7913
7914 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
7915
7916 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
7917 use during nondeterministic operation to track which stacks have
7918 actually needed the current lookahead.
7919 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
7920 Allocate, deallocate, resize, and otherwise shuffle space for
7921 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
7922 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
7923 appropriately during nondeterministic operation.
7924 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
7925 members to store the current lookahead to be used by the deferred
7926 user action.
7927 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
7928 from which the RHS is taken. Set the lookahead members of the new
7929 yySemanticOption according to the lookahead status for stack yyk.
7930 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
7931 yyaddDeferredAction.
7932 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
7933 members of yySemanticOption before invoking yyuserAction, and then set
7934 them back to their current values afterward.
7935 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
7936 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
7937 * tests/glr-regression.at: Remove `.' from the ends of recent test case
7938 titles for consistency.
7939 (Leaked merged semantic value if user action cuts parse): In order to
7940 suppress lint warnings, use arguments in merge function, and assign
7941 char value < 128 in main.
7942 (Incorrect lookahead during deterministic GLR): New test case.
7943 (Incorrect lookahead during nondeterministic GLR): New test case.
7944
7945 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
7946
7947 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
7948 !yyvaluep as signal that no semantic value is available to print.
7949 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
7950 to print a semantic value.
7951
7952 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
7953
7954 * tests/glr-regression.at: For consistency with my newer test cases,
7955 don't thank myself.
7956
7957 2006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
7958
7959 * data/glr.c (yyresolveValue): When merging semantic options, if at
7960 least one user action succeeds but a later one cuts the parse, then
7961 destroy the semantic value before returning rather than leaking it.
7962 (yyresolveStates): If a user action cuts the parse and thus
7963 yyresolveValue fails, ignore the (unset) semantic value rather than
7964 corrupting the yyGLRState, and empty the semantic options list since
7965 the user actions should have called all necessary destructors.
7966 Simplify code with YYCHK.
7967 * tests/glr-regression.at (Corrupted semantic options if user action
7968 cuts parse): New test case.
7969 (Undesirable destructors if user action cuts parse): New test case.
7970 Before applying any of this patch, this test case never actually failed
7971 for me... but only because the corrupted semantic options usually
7972 masked this bug.
7973 (Leaked merged semantic value if user action cuts parse): New test
7974 case.
7975
7976 2006-01-05 Akim Demaille <akim@epita.fr>
7977
7978 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
7979
7980 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
7981
7982 * data/c.m4 (b4_c_modern): New macro, with a new provision for
7983 _MSC_VER. Problem reported by Cenzato Marco.
7984 (b4_c_function_def): Use it.
7985 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
7986 b4_c_modern.
7987 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
7988 than rolling our own.
7989
7990 2006-01-04 Akim Demaille <akim@epita.fr>
7991
7992 Also warn about non-used mid-rule values.
7993 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
7994 member.
7995 (symbol_list_new): Adjust.
7996 * src/reader.c (symbol_typed_p): New.
7997 (grammar_rule_check): Use it.
7998 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
7999 Check its rule.
8000 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
8001 Use it.
8002 * tests/actions.at (Exotic Dollars): Adjust.
8003
8004 2006-01-04 Akim Demaille <akim@epita.fr>
8005
8006 * src/reader.c (grammar_midrule_action): If $$ is set in a
8007 mid-rule, move the `used' bit to its lhs.
8008 * tests/input.at (Unused values): New.
8009 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
8010
8011 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
8012
8013 * doc/bison.texinfo (Bison Options): Say more accurately what
8014 --yacc does.
8015 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
8016 about declarations in the grammar when in Yacc mode, as POSIX does
8017 not require a diagnostic when the grammar uses extensions.
8018
8019 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
8020
8021 Warn about dubious constructions like "%token T T".
8022 Reported by twlevo.
8023 * src/symtab.h (struct symbol.declared): New member.
8024 * src/symtab.c (symbol_new): Initialize it to false.
8025 (symbol_class_set): New arg DECLARING, specifying whether
8026 this is a declaration that we want to warn about, if there
8027 is more than one of them. All uses changed.
8028
8029 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
8030 Allow multiple %union directives, whose contents concatenate.
8031 * src/parse-gram.y (grammar_declaration): Likewise.
8032 Use muscle_code_grow, so that we don't need stype_line any more.
8033 All uses changed.
8034
8035 * src/muscle_tab.c (muscle_grow): Fix comment.
8036
8037 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
8038 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
8039 Update copyright year to 2006.
8040
8041 2006-01-03 Akim Demaille <akim@epita.fr>
8042
8043 Have glr.cc pass (some of) the calc.at tests.
8044 * data/glr.cc (b4_parse_param_orig): New.
8045 (b4_parse_param): Improve its definition, and bound it more
8046 clearly in the skeleton.
8047 (b4_epilogue): Append, instead of prepending, in order to keep
8048 #line consistency.
8049 Simplify the generation of auxiliary functions: locations and
8050 purity are mandated.
8051 (b4_global_tokens_and_yystype): Honor it.
8052 * data/location.cc (c++.m4): Don't include it.
8053 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
8054 and AT_SKEL_CC_IF.
8055 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
8056 AT_LALR1_CC_IF.
8057 Be sure to initialize the first position's filename.
8058 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
8059 mandated anyway.
8060 (AT_CHECK_CALC_GLR_CC): New.
8061 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
8062
8063 2006-01-02 Akim Demaille <akim@epita.fr>
8064
8065 * src/output.c (output_skeleton): Don't hard wire the inclusion of
8066 c.m4.
8067 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
8068 * data/glr.cc: Do not include stack.hh.
8069
8070 2006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
8071
8072 * data/glr.c: Reformat whitespace with tabs.
8073 (b4_lpure_formals): Remove this unused m4 macro.
8074 * tests/cxx-type.at: Reformat whitespace with tabs.
8075 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
8076 since it's a member. Rename type to isNterm for clarity.
8077
8078 2005-12-29 Akim <akim@sulaco.local>
8079
8080 Let glr.cc catch up with symbol_value_print.
8081 * data/glr.cc (b4_yysymprint_generate): Replace by...
8082 (b4_yy_symbol_print_generate): this.
8083 (yy_symbol_print, yy_symbol_value_print): Declare them.
8084
8085 2005-12-28 Paul Eggert <eggert@cs.ucla.edu>
8086
8087 * src/location.h (boundary): Note that a line or column equal
8088 to INT_MAX indicates an overflow.
8089 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
8090 (rule_length_overflow, increment_rule_length, add_column_width):
8091 New functions.
8092 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
8093 (<SC_BRACED_CODE>"}"):
8094 Use increment_rule_length rather than incrementing it by hand.
8095 (adjust_location, handle_syncline): Diagnose overflow.
8096 (handle_action_dollar, handle_action_at):
8097 Fix bug with monstrosities like $-2147483648.
8098 Remove now-unnecessary checks.
8099 (scan_integer): Verify assumptions and remove now-unnecessary checks.
8100 (convert_ucn_to_byte): Verify assumptions.
8101 (handle_syncline): New arg LOC. All callers changed.
8102 Don't store through a value derived from char const * pointer.
8103
8104 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
8105 GCC warnings.
8106
8107 2005-12-27 Paul Eggert <eggert@cs.ucla.edu>
8108
8109 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
8110 Remove unnecessary forward static decls.
8111
8112 2005-12-27 Akim Demaille <akim@epita.fr>
8113
8114 * src/reader.c (grammar_current_rule_check): Also check that $$
8115 is used.
8116 Take the rule to check as argument, hence rename as...
8117 (grammar_rule_check): this.
8118 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
8119 Rename as...
8120 (grammar_rule_begin, grammar_rule_end): these, for consistency.
8121 (grammar_midrule_action, grammar_symbol_append): Now static.
8122 * tests/torture.at (input): Don't rely on the default action
8123 being always performed.
8124 * tests/calc.at: "Set" $$ even when the action is "cut" with
8125 YYERROR or other.
8126 * tests/actions.at (Exotic Dollars): Instead of using unused
8127 values, check that the warning is issued.
8128
8129 2005-12-22 Paul Eggert <eggert@cs.ucla.edu>
8130
8131 * NEWS: Improve wording for unused-value warnings.
8132
8133 2005-12-22 Akim Demaille <akim@epita.fr>
8134
8135 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
8136 (b4_yysymprint_generate): Rename as...
8137 (b4_yy_symbol_print_generate): this.
8138 Generate yy_symbol_print instead of yysymprint.
8139 Generate also yy_symbol_value_print, and use it.
8140
8141 2005-12-22 Akim Demaille <akim@epita.fr>
8142
8143 * NEWS: Warn about unused values.
8144 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
8145 a `used' member.
8146 (symbol_list_n_get, symbol_list_n_used_set): New.
8147 (symbol_list_n_type_name_get): Use symbol_list_n_get.
8148 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
8149 * src/reader.c (grammar_current_rule_check): Check that values are
8150 used.
8151 * src/symtab.c (symbol_print): Accept 0.
8152 * tests/existing.at: Remove the type information.
8153 Empty the actions.
8154 Remove useless actions (beware of mid-rule actions: perl -000
8155 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
8156 * tests/actions.at (Exotic Dollars): Use unused values.
8157 * tests/calc.at: Likewise.
8158 * tests/glr-regression.at (No users destructors if stack 0 deleted):
8159 Likewise.
8160
8161 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
8162 rule_useful_p.
8163
8164 2005-12-21 Paul Eggert <eggert@cs.ucla.edu>
8165
8166 Undo 2005-12-01 tentative license wording change. The wording is
8167 still being reviewed by the lawyers, and we don't want to wait for
8168 them before publishing a test release. For now, revert to the
8169 previous wording.
8170 * NEWS: Undo 2005-12-01 change.
8171 * data/glr.c: Revert to previous license wording.
8172 * data/glr.cc: Likewise.
8173 * data/lalr1.cc: Likewise.
8174 * data/location.cc: Likewise.
8175 * data/yacc.c: Likewise.
8176
8177 * NEWS: Reword %destructor vs YYABORT etc.
8178 * data/glr.c: Use American spacing, for consistency.
8179 * data/glr.cc: Likewise.
8180 * data/lalr1.cc: Likewise.
8181 * data/yacc.c: Likewise.
8182 * data/yacc.c: Reformat comments slightly.
8183 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
8184 for consistency. Fix some spelling errors and reword recently-included
8185 text slightly.
8186 * tests/cxx-type.at: Cast results of malloc, for C++.
8187
8188 2005-12-21 Joel E. Denny <address@hidden>
8189
8190 * tests/cxx-type.at: Construct a tree, count the parents of shared
8191 nodes, and free each node once and only once. Previously, the memory
8192 for semantic values was leaked instead.
8193
8194 2005-12-21 Joel E. Denny <address@hidden>
8195
8196 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
8197 (yylval, yylloc): If pure, #define to yystackp->yyval and
8198 yystackp->yyloc similar to yychar and yynerrs.
8199 (yyparse): If pure, remove local yylval and yylloc. Add local
8200 yystackp to accommodate pure definitions of yylval and yylloc.
8201 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
8202 yylvalp and yyllocp to &yylval and &yylloc.
8203 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
8204 namespace. Previously, nerrs and char were missing, but lval and lloc
8205 weren't necessary.
8206 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
8207 yylvalp and yyllocp parameters since, if pure, these are now always
8208 accessible through yystackp. If not pure, they are still accessible
8209 globally.
8210 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
8211 `if (YYID (N))' to pacify lint.
8212
8213 2005-12-21 Akim Demaille <akim@epita.fr>
8214
8215 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
8216 destroy the RHS symbols of a rule.
8217 * data/yacc.c (yylen): Initialize to 0.
8218 Keep its value to the number of items to possibly shift.
8219 In particular, a regular successful parse that ends on YYFINAL by
8220 a (internal) YYACCEPT must not have yylen != 0.
8221 (yyerrorlab, yyreturn): Pop the RHS.
8222 Reorder a bit to emphasize the `shifting' bits of code.
8223 (YYPOPSTACK): Now accept a number of items to pop.
8224 * data/lalr1.cc: Likewise.
8225 * data/glr.c: Formatting changes.
8226 Use goto instead of fall through.
8227 * doc/bison.texinfo (Destructor Decl): Complete.
8228
8229 2005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8230
8231 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
8232 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
8233 * djgpp/config.bat: Replace every occurence of the file name
8234 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
8235 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
8236 * djgpp/config.sed: Replace every occurence of the file name
8237 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
8238 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
8239 * djgpp/djunpack.bat: DJGPP specific file.
8240 * djgpp/fnchange.lst: DJGPP specific file.
8241 * djgpp/README.in: Add new information about how to unpack the bison
8242 source on MSDOS and other systems which have 8.3 file name restrictions
8243 using djunpack.bat and fnchange.lst.
8244
8245 2005-12-12 Paul Eggert <eggert@cs.ucla.edu>
8246
8247 * bootstrap (build_cvs_prefix): Remove; unused.
8248 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
8249 when getting gnulib.
8250
8251 2005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
8252
8253 * data/glr.c: Reorder typedef declarations for structs to match order
8254 of struct declarations.
8255 Rename yystack everywhere to yystackp except in yyparse where it's not
8256 a pointer.
8257 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
8258 consistency.
8259 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
8260 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
8261 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
8262 lint.
8263
8264 2005-12-09 Paul Eggert <eggert@cs.ucla.edu>
8265
8266 * tests/sets.at (Accept): Fix typos in regular expression used to
8267 sed out the final state number.
8268
8269 Work around portability problem on Solaris 10: flex-generated
8270 files include <stdio.h> before <config.h>, which messes up
8271 because the latter defines __EXTENSIONS__. Address the problem
8272 by creating two new little files that include <config.h> first,
8273 then include the flex-generated files. Rewrite everyone else
8274 to include <config.h> first, as well.
8275 * lib/timevar.c: Always include "config.h".
8276 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
8277 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
8278 (EXTRA_bison_SOURCES): New macro.
8279 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
8280 * src/system.h: Don't include config.h.
8281 * src/LR0.c: Include <config.h> first.
8282 * src/assoc.c: Likewise.
8283 * src/closure.c: Likewise.
8284 * src/complain.c: Likewise.
8285 * src/conflicts.c: Likewise.
8286 * src/derives.c: Likewise.
8287 * src/files.c: Likewise.
8288 * src/getargs.c: Likewise.
8289 * src/gram.c: Likewise.
8290 * src/lalr.c: Likewise.
8291 * src/location.c: Likewise.
8292 * src/main.c: Likewise.
8293 * src/muscle_tab.c: Likewise.
8294 * src/nullable.c: Likewise.
8295 * src/output.c: Likewise.
8296 * src/parse-gram.y: Likewise.
8297 * src/print.c: Likewise.
8298 * src/print_graph.c: Likewise.
8299 * src/reader.c: Likewise.
8300 * src/reduce.c: Likewise.
8301 * src/relation.c: Likewise.
8302 * src/state.c: Likewise.
8303 * src/symlist.c: Likewise.
8304 * src/symtab.c: Likewise.
8305 * src/tables.c: Likewise.
8306 * src/uniqstr.c: Likewise.
8307 * src/vcg.c: Likewise.
8308
8309 * src/parse-gram.y: Fix minor problems uncovered by lint.
8310 (current_lhs, current_lhs_location): Now static.
8311 (current_assoc): Remove unused variable.
8312
8313 Cleanups so that Bison-generated parsers have less lint.
8314 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
8315 Prepend /*ARGSUSED*/, for lint's sake.
8316 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
8317 definition if 'lint' is defined.
8318 (YYID): New macro (or function, if lint).
8319 All uses of /*CONSTCOND*/0 replaced by YYID(0).
8320 * data/yacc.c: Likewise.
8321 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
8322 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
8323 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
8324 is C++ only.
8325 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
8326 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
8327 Use YYID(0) rather than 0, for lint.
8328 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
8329 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
8330
8331 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
8332
8333 * tests/glr-regression.at
8334 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
8335 Close memory leak reported by twlevo.
8336
8337 2005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
8338
8339 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
8340 all stacks.
8341 (yyparse): Iterate another stack in order to call user destructors.
8342 * tests/glr-regression.at (No users destructors if stack 0 deleted):
8343 New test case.
8344 (Duplicated user destructor for lookahead): This test now is expected
8345 to succeed.
8346
8347 2005-12-01 Paul Eggert <eggert@cs.ucla.edu>
8348
8349 * NEWS: Document the following change.
8350 * data/yacc.c: Say "parser skeleton" rather than "file", since
8351 it's no longer just a file.
8352 * data/glr.c: Grant a special exception for C GLR parsers, that
8353 reads like the already-existing exception for C LALR(1) parsers.
8354 * data/glr.cc: Likewise.
8355 * data/lalr1.cc: Likewise.
8356 * data/location.cc: Likewise.
8357 * data/yacc.c: Reword the "written by" statement to clarify that
8358 it was the parser skeleton, not the entire output file.
8359 * data/glr.c: Written by Paul Hilfinger.
8360 * data/glr.cc: Written by Akim Demaille.
8361 * data/lalr1.cc: Likewise.
8362
8363 2005-11-18 Paul Eggert <eggert@cs.ucla.edu>
8364
8365 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
8366 Fix typos in previous change that broke 'make check'.
8367 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
8368 supported in C.
8369 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
8370 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
8371 We can revert this once things settle down.
8372
8373 * src/conflicts.c (conflicts_print): Don't print file name twice
8374 when %expect fails because there were no conflicts.
8375 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
8376 change.
8377 * tests/conflicts.at (%expect not enough, %expect too much):
8378 (%expect with reduce conflicts): Adjust to new behavior.
8379
8380 2005-11-18 Akim Demaille <akim@epita.fr>
8381
8382 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
8383 errors.
8384 * NEWS: Document this.
8385 * doc/bison.texinfo (Expect Decl): Likewise.
8386
8387 2005-11-16 Akim Demaille <akim@epita.fr>
8388
8389 Generalize the display of semantic values and locations in traces.
8390 * data/glr.c (yy_reduce_print): Fix indices (again).
8391 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
8392 literal integers.
8393 * data/lalr1.cc (yyreduce_print): Rename as...
8394 (yy_reduce_print): this.
8395 Display values and locations.
8396 * data/yacc.c (yy_reduce_print): Likewise.
8397 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
8398 (yysymprint): Move higher to be visible from yy_reduce_print).
8399 (yyparse): Adjust.
8400 * tests/calc.at: Adjust the expected length of the traces.
8401
8402 2005-11-14 Akim Demaille <akim@epita.fr>
8403
8404 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
8405 from 1 to N, while values and location start at 0.
8406 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
8407
8408 2005-11-14 Akim Demaille <akim@epita.fr>
8409
8410 * data/glr.c (yy_reduce_print): Fix the $ number.
8411
8412 2005-11-14 Akim Demaille <akim@epita.fr>
8413
8414 "Use" parse parameters.
8415 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
8416 * data/glr.c, data/glr.cc: Use them.
8417 * data/glr.c (YYUSE): Have a C++ definition that supports
8418 non-pointer types.
8419
8420 2005-11-14 Akim Demaille <akim@epita.fr>
8421
8422 * data/glr.c (yyexpandGLRStack): Declare only if defined.
8423
8424 2005-11-14 Akim Demaille <akim@epita.fr>
8425
8426 * data/glr.cc: New.
8427 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
8428
8429 2005-11-12 Akim Demaille <akim@epita.fr>
8430
8431 Let position and location be PODs.
8432 * data/location.cc (position::initialize, location::initialize): New.
8433 (position::position, location::location): Define only if
8434 b4_location_constructors is defined.
8435 * data/lalr1.cc (b4_location_constructors): Define it for backward
8436 compatibility.
8437 * doc/bison.texinfo (Initial Action Decl): Use initialize.
8438
8439 2005-11-12 Akim Demaille <akim@epita.fr>
8440
8441 * data/lalr1.cc: Move the body of the ctor and dtor into the
8442 parser file (instead of the header).
8443 Wrap the implementations in a "namespace yy".
8444
8445 2005-11-12 Akim Demaille <akim@epita.fr>
8446
8447 Have glr.c include its header file when created.
8448 * data/glr.c (b4_shared_declarations): New.
8449 Output them verbatim in the parser if !%defines, otherwise
8450 output then in the header file, and include it instead.
8451
8452 2005-11-11 Akim Demaille <akim@epita.fr>
8453
8454 * data/glr.c: Comment changes.
8455
8456 2005-11-11 Akim Demaille <akim@epita.fr>
8457
8458 When yydebug, report semantic and location values for reductions.
8459 * data/glr.c (yy_reduce_print): Report the semantic values and the
8460 locations.
8461 (YY_REDUCE_PRINT): Adjust.
8462 (yyglrReduce): Use them.
8463 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
8464 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
8465 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
8466 traces.
8467
8468 2005-11-10 Akim Demaille <akim@epita.fr>
8469
8470 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
8471 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
8472 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
8473
8474 2005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
8475
8476 * m4/cxx.m4, examples/Makefile.am: Don't build
8477 examples/calc++ if no C++ compiler is available. (trivial change)
8478
8479 2005-11-09 Akim Demaille <akim@epita.fr>
8480
8481 * src/scan-skel.l: Use a couple of asserts.
8482
8483 2005-11-03 Akim Demaille <akim@epita.fr>
8484
8485 In some (weird) cases, the final state number is incorrect.
8486 Reported by Alexandre Duret-Lutz.
8487 * src/LR0.c (state_list_append): Remove the computation of
8488 final_state.
8489 (save_reductions): Do it here.
8490 (get_state): Alpha conversion.
8491 (generate_states): Use a for loop.
8492 * src/gram.h (item_number_is_rule_number)
8493 (item_number_is_symbol_number): New.
8494 * src/state.c: Use assert.
8495 * src/system.h: Include assert.h.
8496 * tests/sets.at (Accept): New.
8497
8498 2005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8499
8500 * data/glr.c (yyfill): Adjust comment.
8501 (yyresolveAction): Initialize default location properly
8502 for empty right-hand sides.
8503 (yydoAction): Ditto.
8504 Add comment explaining apparently dead code.
8505 * tests/glr-regression.at
8506 (Incorrectly initialized location for empty right-hand side in GLR):
8507 New test.
8508
8509 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
8510
8511 * bootstrap (cleanup_gnulib): New function. Use it to clean up
8512 gnulib when interrupted. This fixes some race conditions and
8513 works around some portability problems (one noted by Paul
8514 Hilfinger).
8515
8516 2005-10-22 Akim <akim@epita.fr>
8517
8518 * Makefile.cfg: Adjust to config -> build-aux.
8519 Reported by twledo.
8520
8521 2005-10-21 Akim Demaille <akim@epita.fr>
8522
8523 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
8524 the %parse-params.
8525 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
8526 * data/yacc.c (b4_Pure_if): Rename as...
8527 (b4_yacc_pure_if): this.
8528 (YY_SYMBOL_PRINT, yyparse): Adjust.
8529 * doc/bison.texinfo: Formatting changes.
8530
8531 2005-10-21 Akim Demaille <akim@epita.fr>
8532
8533 Finish the transition config -> build-aux.
8534 * configure.ac, Makefile.am: Use build-aux.
8535 * config/prev-version, config/announce-gen, config/Makefile.am:
8536 Move to...
8537 * build-aux/prev-version, build-aux/announce-gen,
8538 * build-aux/Makefile.am: here.
8539
8540 2005-10-14 Akim Demaille <akim@epita.fr>
8541
8542 * examples/calc++/test: Use set -x only when VERBOSE.
8543
8544 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
8545
8546 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
8547 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
8548
8549 2005-10-13 Akim Demaille <akim@epita.fr>
8550
8551 * src/scan-skel.l: Output the base name parts of the parser and
8552 header file names.
8553 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
8554 additional checks.
8555 Use this to exercise C++ outputs in subdirs.
8556 Reported by Oleg Smolsky.
8557
8558 2005-10-12 Paul Eggert <eggert@cs.ucla.edu>
8559
8560 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
8561 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
8562 Problem reported by John P. Hartmann.
8563 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
8564 already defined it.
8565
8566 2005-10-12 Akim Demaille <akim@epita.fr>
8567
8568 * src/parse-gram.y (version_check): Exit 63 to please missing
8569 (stands for "version mismatch).
8570 * tests/input.at, doc/bison.texinfo: Adjust.
8571
8572 2005-10-10 Paul Eggert <eggert@cs.ucla.edu>
8573
8574 Work around portability problems with Visual Age C compiler
8575 (xlc and xlC_r) reported by John P. Hartmann.
8576 * data/location.cc (initial_column, initial_line): Remove.
8577 All uses replaced by 0 and 1.
8578 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
8579 that xlc complains about.
8580 * src/scan-skel.l (skel_wrap): Likewise.
8581 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
8582 as __STDC__.
8583 * data/yacc.c (YYMODERN_C): New macro, which also looks at
8584 __STDC_VERSION__. Use it everywhere instead of looking at
8585 __STDC__ and __cplusplus.
8586
8587 2005-10-10 Akim Demaille <akim@epita.fr>
8588
8589 * examples/calc++/test: Be quiet unless VERBOSE.
8590
8591 2005-10-05 Paul Eggert <eggert@cs.ucla.edu>
8592
8593 * data/c.m4 (yydestruct, yysymprint):
8594 Use YYUSE instead of casting to void.
8595 * data/glr.c (YYUSE): New macro.
8596 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
8597 Use it instead of rolling our own.
8598 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
8599 (YYCHK1):
8600 Use /*CONSTCOND*/ to suppress lint warnings.
8601 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
8602 (YY_STACK_PRINT): Use 'false' not '0'.
8603 (YYUSE): New macro.
8604 (yysymprint_, yydestruct_): Use it instead of rolling our own.
8605 * data/yacc.c (YYUSE): New macro.
8606 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
8607 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
8608 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
8609
8610
8611 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
8612 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
8613
8614 2005-10-04 Paul Eggert <eggert@cs.ucla.edu>
8615
8616 Undo the parts of the unlocked-I/O change that substituted
8617 putc or puts for printf. This might hurt performance a bit,
8618 but some people prefer the printf style.
8619 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
8620 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
8621 All uses replaced by YYFPRINTF and YYDPRINTF.
8622 * data/yacc.c: Likewise.
8623 * lib/bitset.c (bitset_print): Likewise.
8624 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
8625 putc and puts.
8626 * lib/lbitset.c (debug_lbitset): Likewise.
8627 * src/closure.c (print_firsts, print_fderives): Likewise.
8628 * src/gram.c (grammar_dump): Likewise.
8629 * src/lalr.c (look_ahead_tokens_print): Likewise.
8630 * src/output.c (escaped_output): Likewise.
8631 (user_actions_output): Break apart two printfs.
8632 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
8633 * src/reduce.c (reduce_print): Likewise.
8634 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
8635 * src/system.h: Include unlocked-io.h rathe than stdio.h.
8636
8637 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
8638 Use assignments rather than casts-to-void to suppress
8639 unused-variable warnings. This pacifies 'lint'.
8640 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
8641 unused-variable warnings.
8642
8643 2005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8644
8645 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
8646
8647 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
8648
8649 Use unlocked I/O for a minor performance improvement on hosts like
8650 GNU/Linux and Solaris that support unlocked I/O. The basic idea
8651 is to use the gnlib unlocked-io module, and to prefer putc and
8652 puts to printf when either will work (since the latter doesn't
8653 come in an unlocked flavor).
8654 * bootstrap (gnulib_modules): Add unlocked-io.
8655 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
8656 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
8657 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
8658 and similarly for puts and putc and printf.
8659 * data/yacc.c: Likewise.
8660 * lib/bitset.c (bitset_print): Likewise.
8661 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
8662 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
8663 to printf.
8664 * lib/lbitset.c (debug_lbitset): Likewise.
8665 * src/closure.c (print_firsts, print_fderives): Likewise.
8666 * src/gram.c (grammar_dump): Likewise.
8667 * src/lalr.c (look_ahead_tokens_print): Likewise.
8668 * src/output.c (escaped_output): Likewise.
8669 (user_actions_output): Coalesce two printfs.
8670 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
8671 * src/reduce.c (reduce_print): Likewise.
8672 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
8673 * src/system.h: Include unlocked-io.h rather than stdio.h.
8674
8675 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
8676 this confuses xgettext.
8677
8678 2005-10-02 Akim Demaille <akim@epita.fr>
8679
8680 * bootstrap (gnulib_modules): Add strverscmp.
8681 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
8682 * m4/.cvsignore: Add strverscmp.m4.
8683 * src/parse-gram.y (%require): New token, new rule.
8684 (version_check): New.
8685 * src/scan-gram.l (%require): Adjust.
8686 * tests/input.at (AT_REQUIRE): New.
8687 Use it.
8688 * doc/bison.texinfo (Require Decl): New.
8689 (Calc++ Parser): Use %require.
8690
8691 2005-10-02 Akim Demaille <akim@epita.fr>
8692
8693 * data/location.cc: New.
8694
8695 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
8696 Akim Demaille <akim@epita.fr>
8697
8698 Make sure -odir/foo.cc creates dir/location.hh etc.
8699 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
8700 (spec_file_prefix, spec_verbose_file, spec_graph_file)
8701 (spec_defines_file): Now const.
8702 (dir_prefix): New.
8703 (short_base_name): Remove.
8704 * src/files.c: Adjust.
8705 (dirname.h): Include.
8706 (base_name): Don't prototype it.
8707 (finput): Remove, duplicates gram_in.
8708 (full_base_name, short_base_name): Replace by...
8709 (all_but_ext, all_but_tab_ext): these.
8710 (compute_base_names): Rename as...
8711 (compute_file_name_parts): this.
8712 Update to compute the new variables, including dir_prefix.
8713 Adjust dependencies.
8714 * src/output.c (prepare): Output them.
8715 * src/reader.c: Adjust to use gram_in, not finput.
8716 * src/scan-skel.l (@dir_prefix@): New.
8717
8718 2005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8719
8720 * lib/subpipe.c: New function end_of_output_subpipe() added
8721 to allow support for non-posix systems. This is a no-op function
8722 for posix systems.
8723
8724 * lib/subpipe.h: New function end_of_output_subpipe() added
8725 to allow support for non-posix systems. This is a no-op function
8726 for posix systems.
8727
8728 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
8729 handle the lack of pipe/fork functionality on non-posix systems.
8730
8731 * djgpp/Makefile.maint: DJGPP specific file.
8732
8733 * djgpp/README.in: DJGPP specific file.
8734
8735 * djgpp/config.bat: DJGPP specific configuration file.
8736
8737 * djgpp/config.sed: DJGPP specific configuration file.
8738
8739 * djgpp/config.site: DJGPP specific configuration file.
8740
8741 * djgpp/config_h.sed: DJGPP specific configuration file.
8742
8743 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
8744
8745 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
8746
8747 2005-10-02 Akim Demaille <akim@epita.fr>
8748
8749 * data/location.cc: New, extract from...
8750 * data/lalr1.cc: here.
8751 (location.hh): Include it after the user prologue, in case the
8752 filename type is defined by the user.
8753 Forward declation location and position before the pre-prologue.
8754 (yyresult_): Rename as...
8755 (yyresult): this, it's a local variable, not an attribute.
8756 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
8757
8758 2005-10-01 Akim Demaille <akim@epita.fr>
8759
8760 * examples/extexi: Restore the #line generation.
8761
8762 2005-09-30 Akim Demaille <akim@epita.fr>,
8763 Alexandre Duret-Lutz <adl@gnu.org>
8764
8765 Move the token type and YYSTYPE in the parser class.
8766 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
8767 (parser::token): New, from the moved free definition of tokens.
8768 (parser::semantic_value): Now a full definition instead of an
8769 indirection to YYSTYPE.
8770 (b4_post_prologue): No longer included in the header file, but
8771 in the implementation file.
8772 * doc/bison.texi (C+ Language Interface): Update.
8773 * src/parse-gram.y: Support unary %define.
8774 * tests/actions.at: Define global_tokens_and_yystype for backward
8775 compatibility until we update the tests.
8776 * tests/calc.at: Idem.
8777 (first_line, first_column, last_line, last_column): Define for lalr1.cc
8778 to simplify the code.
8779
8780 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
8781
8782 Port to SunOS 4.1.4, which lacks strtoul and strerror.
8783 Ah, the good old days! Problem reported by Peter Klein.
8784 * bootstrap (gnulib_modules): Add strerror, strtoul.
8785 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
8786 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
8787
8788 2005-09-29 Akim Demaille <akim@epita.fr>
8789
8790 * data/c.m4 (b4_error_verbose_if): New.
8791 * data/lalr1.cc: Use it.
8792 (YYERROR_VERBOSE_IF): Remove.
8793 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
8794 parser members, replaced by...
8795 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
8796 local variables.
8797 (yysyntax_error_): Takes the state number as argument.
8798 (yyreduce_print_): Use the argument yyrule, not the former
8799 attribute yyn_.
8800
8801 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
8802
8803 * bootstrap (gnulib_modules): Add verify.
8804 * lib/.cvsignore: Add verify.h.
8805 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
8806 * src/system.h (verify): Remove.
8807 Include verify.h instead.
8808 * src/tables.c (tables_generate): Use new API for 'verify'.
8809
8810 2005-09-21 Paul Eggert <eggert@cs.ucla.edu>
8811
8812 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
8813 local variables whose names begin with 'yy'.
8814 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
8815 Trivial changes from Joel E. Denny.
8816
8817 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
8818 it itself.
8819 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
8820 don't use alloca any more.
8821
8822 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
8823 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
8824 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
8825 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
8826 to match yacc.c, to test more hosts.
8827
8828 2005-09-20 Paul Eggert <eggert@cs.ucla.edu>
8829
8830 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
8831 doesn't affect behavior.
8832 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
8833 Solaris, AIX, MSC.
8834 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
8835 This works a bit better with glibc, if user code has already included
8836 stdlib.h.
8837 * doc/bison.texinfo (Bison Parser): Document that users can't
8838 arbitrarily use malloc and free for other purposes. Document
8839 that <alloca.h> and <malloc.h> might be included.
8840 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
8841 user must declare alloca.
8842
8843 * HACKING (release): Forwarn the Translation Project about
8844 stable releses.
8845
8846 2005-09-20 Akim Demaille <akim@epita.fr>
8847
8848 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
8849
8850 2005-09-19 Paul Eggert <eggert@cs.ucla.edu>
8851
8852 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
8853 (YYSTACK_ALLOC_MAXIMUM): Use it.
8854 (yysyntax_error): New function.
8855 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
8856 multiple syntax errors are reported, and alloca is being used.
8857 Instead, reallocate buffers twice as big each time, so that
8858 we waste at most half the allocated memory. Start with a small
8859 (128-byte) buffer that will suffice in most cases anyway.
8860 Use yysyntax_error to do most of the work.
8861
8862 * doc/bison.texinfo (Error Reporting, Table of Symbols):
8863 yynerrs is the number of errors reported, not the number of
8864 errors encountered.
8865
8866 * tests/glr-regression.at (Duplicated user destructor for lookahead):
8867 Mark it as expected to fail.
8868 Cast result of malloc; problem reported by twlevo@xs4all.nl.
8869 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
8870 Don't start user-code symbols with "yy", to avoid name space problems.
8871
8872 2005-09-19 Akim Demaille <akim@epita.fr>
8873
8874 Remove the traits, failed experiment.
8875 It never proved useful, and anyway because of the current
8876 definition, it was not possible to have several specialization of
8877 this traits, making it useless.
8878 * data/lalr1.cc (yy:traits): Remove.
8879 Inline its definitions in the parser class.
8880
8881 2005-09-19 Akim Demaille <akim@epita.fr>
8882
8883 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
8884 least Mac OSX with a /usr/local install of gettext.
8885
8886 2005-09-19 Akim Demaille <akim@epita.fr>
8887
8888 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
8889 and yytoken for similarity with the other skeletons.
8890
8891 2005-09-19 Akim Demaille <akim@epita.fr>
8892
8893 * NEWS, configure.ac: update version number to 2.1a.
8894
8895 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
8896
8897 * NEWS: Version 2.1.
8898
8899 * NEWS: Remove notice of yytname change, since it was never in an
8900 official release.
8901 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
8902 diagnostic.
8903 * src/output.c (prepare): Likewise.
8904 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
8905 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
8906 is not defined. This is an awful hack, but it's enough for now.
8907 All callers changed.
8908 * tests/glr-regression-at (make_value): Args are const pointers now,
8909 to avoid GCC warning.
8910 (Duplicated user destructor for lookahead): New test. Currently
8911 skipped. It fails on my host but I'm not sure it'll always fail.
8912
8913 2005-09-16 Akim Demaille <akim@epita.fr>
8914
8915 * src/symtab.h (struct symbol): Declare the printer and destructor
8916 as const, to avoid accidental calls to free.
8917 (symbol_destructor_set, symbol_printer_set): Adjust.
8918 * src/symtab.c: Adjust.
8919
8920 2005-09-16 Akim Demaille <akim@epita.fr>
8921
8922 * data/c.m4 (b4_token_enums): New.
8923 (b4_token_defines): Rename as...
8924 (b4_token_enums_defines): this.
8925 (b4_token_defines): New, output only the #defines.
8926 * data/yacc.c, data/glr.c: Adjust.
8927 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
8928 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
8929 as default values.
8930
8931 2005-09-16 Akim Demaille <akim@epita.fr>
8932
8933 * data/lalr1.cc (yylex_): Remove, inline its code.
8934 (yyreport_syntax_error_): Remove, replaced by...
8935 (yysyntax_error_): this which returns a string and leaves to the
8936 caller the call to the users' error function.
8937 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
8938 Move from members of the parser object...
8939 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
8940 to local variables of the parse function.
8941
8942 2005-09-16 Akim Demaille <akim@epita.fr>
8943
8944 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
8945 since it's in Bison's name space.
8946
8947 2005-09-15 Paul Eggert <eggert@cs.ucla.edu>
8948
8949 * data/glr.c (yyresolveValue): Add default case to pacify
8950 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
8951
8952 * NEWS: Document when yyparse started to return 2.
8953 * doc/bison.texinfo (Parser Function): Document when yyparse
8954 returns 2.
8955
8956 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
8957 (b4_filename_type): Renamed back from b4_file_name_type. All uses
8958 changed.
8959 (class position): file_name -> filename (reverting). All uses changed.
8960
8961 2005-09-14 Paul Eggert <eggert@cs.ucla.edu>
8962
8963 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
8964 do anything if $@ exists. This reverts part of the 2005-07-07
8965 patch.
8966
8967 2005-09-11 Paul Eggert <eggert@cs.ucla.edu>
8968
8969 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
8970 contains obsolete information and isn't worth distributing as a
8971 separate file anyway.
8972 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
8973 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
8974 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
8975 (yyparse): Abort if user code uses longjmp to throw an unexpected
8976 value.
8977
8978 2005-09-09 Paul Eggert <eggert@cs.ucla.edu>
8979
8980 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
8981 Suggested by twlevo@xs4all.nl.
8982
8983 * data/glr.c (YYCHK1): Do not assume YYE is in range.
8984 This avoids a diagnostic from gcc -Wswitch-enum.
8985 Problem reported by twlevo@xs4all.nl.
8986
8987 * doc/bison.texinfo: Don't use "filename", as per GNU coding
8988 standards. Use "file name" or "file" or "name", depending on
8989 the context.
8990 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
8991 not to hack/foo.tab.c.
8992 (Calc++ Top Level): 2nd arg of main is not const.
8993 * data/glr.c: b4_filename -> b4_file_name.
8994 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
8995 All uses changed.
8996 (class position): filename -> file_name. All uses changed.
8997 * data/yacc.c: b4_filename -> b4_file_name.
8998 * lib/bitset.h: filename -> file_name in local vars.
8999 * lib/bitset_stats.c: Likewise.
9000 * src/files.c: Likewise.
9001 * src/scan-skel.l ("@output ".*\n): Likewise.
9002 * src/files.c (file_name_split): Renamed from filename_split.
9003 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
9004
9005 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
9006
9007 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
9008 to accommodate latest gnulib.
9009
9010 * tests/glr-regression.at (Duplicate representation of merged trees):
9011 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
9012
9013 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
9014 needed.
9015
9016 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
9017
9018 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
9019 All uses changed. Invoke user destructor after an error during a
9020 split parse (trivial change from Joel E. Denny).
9021
9022 * tests/glr-regression.at
9023 (User destructor after an error during a split parse): New test case.
9024 Problem reported by Joel E. Denny in:
9025 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
9026
9027 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
9028
9029 * README-cvs: Give URLs for recommended tools.
9030 Mention Gzip version problem, and bootstrapping issues.
9031 Remove troubleshooting section, as it's somewhat obsolete.
9032
9033 * bootstrap (no_cache): New var, to accommodate different wget
9034 variants. Use it instead of '-C off'. Problem reported by
9035 twlevo@xs4all.nl.
9036
9037 * data/glr.c (yydestroyStackItem): New function.
9038 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
9039 debugging information. Problem reported by Joel E. Denny.
9040
9041 2005-08-25 Akim Demaille <akim@epita.fr>
9042
9043 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
9044
9045 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
9046
9047 * data/glr.c (yyrecoverSyntaxError, yyreturn):
9048 Don't invoke destructor on unresolved entries.
9049 * tests/glr-regression.at
9050 (User destructor for unresolved GLR semantic value): New test case.
9051 Problem reported by Joel E. Denny in:
9052 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
9053
9054 2005-08-21 Paul Eggert <eggert@cs.ucla.edu>
9055
9056 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
9057 Add strnlen.c.
9058 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
9059 lib-prefix.m4, po.m4.
9060
9061 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
9062 in yydestruct diagnostic, since it might not be an error.
9063 Problem reported by Joel Denny near end of
9064 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
9065 * data/lalr1.cc (yyerturn): Likewise.
9066 * data/yacc.c (yyreturn): Likewise.
9067 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
9068
9069 * src/files.c: Remove obsolete FIXME comment.
9070
9071 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
9072 with the other templates, and to fix bogus run-on messages such
9073 as the one reported at the end of
9074 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
9075 All callers changed to avoid the newline.
9076 (yyprocessOneStack): Output two lines rather than one, to accommodate
9077 the above change. This changes the debug output format slightly.
9078
9079 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
9080 reported by Joel E. Denny in
9081 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
9082 (trivial change).
9083 * tests/glr-regression.at (Duplicate representation of merged trees):
9084 New test, from Joel E. Denny in:
9085 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
9086 * THANKS: Add Joel E. Denny.
9087
9088 * configure.ac (AC_INIT): Bump to 2.0c.
9089
9090 2005-07-24 Paul Eggert <eggert@cs.ucla.edu>
9091
9092 * NEWS: Version 2.0b.
9093
9094 * Makefile.am (SUBDIRS): Put examples before tests, so that
9095 "make check" doesn't finish with "All 1 tests passed".
9096
9097 * tests/regression.at (Token definitions): Don't rely on
9098 AT_PARSER_CHECK for data that contains backslashes. It currently
9099 uses 'echo', and 'echo' isn't portable if its argument contains
9100 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
9101 that the byte '\0xff' is not printable in the C locale; it is,
9102 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
9103 not printable, so use '\0x81' to test.
9104
9105 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
9106 version of GCC, since the macro is used with non-GCC compilers.
9107
9108 Fix core dump reported by Pablo De Napoli in
9109 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
9110 * tests/regression.at (Invalid inputs with {}): New test.
9111 * src/parse-gram.y (token_name): Translate type before using
9112 it as an index.
9113
9114 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
9115 the user's name space. All uses changed to __attribute__
9116 ((__unused__)).
9117 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
9118 Add __attribute__ ((__noreturn__)).
9119
9120 * etc/clcommit: Remove. We weren't using it, and it failed
9121 "make maintainer-distcheck".
9122 * Makefile.maint: Merge from coreutils.
9123 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
9124 (syntax-check-rules): Change list of rules as described below.
9125 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
9126 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
9127 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
9128 (sc_trailing_space): New rules.
9129 (sc_xalloc_h_in_src): Remove.
9130 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
9131 (sc_space_tab, sc_error_exit_success, sc_changelog):
9132 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
9133 (makefile-check, po-check, author_mark_check):
9134 (makefile_path_separator_check, copyright-check):
9135 Use grep -n, to make it easier to find violations.
9136 Use CVS_LIST and CVS_LIST_EXCEPT.
9137 (header_regexp, h_re): Remove.
9138 (dd_c): New macro.
9139 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
9140 (my-distcheck): Use more-modern GCC flags.
9141 (signatures, %.asc): Remove.
9142 (rel-files, announcement): Remove signatures.
9143 Restore old updating code, even though we don't use it, so
9144 that we're the same as coreutils.
9145 (alpha, beta, major): Depend on news-date-check.
9146 Make the upload commands.
9147
9148 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
9149 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
9150 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
9151 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
9152 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
9153 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
9154 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
9155 * tests/sets.at: Likewise.
9156
9157 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
9158 we comment out the Autoconf version number.
9159 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
9160 it's error-prone and "make maintainer-distcheck" rejects it.
9161
9162 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
9163 Indent calls to "error" to pacify "make maintainer-distcheck",
9164 when the calls are not intended to be translated.
9165 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
9166
9167 * src/Makefile.am (DEFS): Use +=, to pacify
9168 "make maintainer-distcheck".
9169 (bison_SOURCES): Add scan-skel.h.
9170 (sc_tight_scope): New rule, from coreutils.
9171
9172 * src/files.c (src_extension, header_extension):
9173 Now static, not extern.
9174 * src/getargs.c (short_options): Likewise.
9175 * src/muscle_tab.c (muscle_table): Likewise.
9176 * src/parse-gram.y (current_class, current_type, current_prec):
9177 Likewise.
9178 * src/reader.c (grammar_end, previous_rule_end): Likewise.
9179 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
9180 * src/main.c (main): Cast bindtextdomain and textdomain calls to
9181 void, to avoid warning when NLS is disabled.
9182 * src/output.c: Include scan-skel.h.
9183 (scan_skel): Remove decl, since scan-skel.h does this.
9184 (output_skeleton):
9185 Indent calls to "error" to pacify "make maintainer-distcheck".
9186 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
9187 * src/reader.h (gram_end, gram_lineno): New decls to pacify
9188 "make maintainer-distcheck".
9189 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
9190 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
9191 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
9192 (skel_lex_destroy, scan_skel): Move these decls to...
9193 * src/scan-skel.h: New file.
9194 * src/uniqstr.c (uniqstr_assert):
9195 Indent calls to "error" to pacify "make maintainer-distcheck".
9196
9197 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
9198 not @VAR@.
9199
9200 * tests/torture.at: Revamp to avoid misuse of atoi that
9201 "make maintainer-distcheck" complained about.
9202
9203 * examples/extexi (message): Don't print a message more than once,
9204 and omit line-number decoration that makes Emacs compile think
9205 that informative messages are worth worrying about.
9206
9207 2005-07-22 Paul Eggert <eggert@cs.ucla.edu>
9208
9209 * configure.ac: Update version number.
9210
9211 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
9212 accidentally.
9213 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
9214 autogenerated by the maintainer.
9215 * examples/calc++/.cvsignore: Add *.yy.
9216
9217 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
9218 * lib/bitset_stats.c (bitset_stats_init): Likewise.
9219 * lib/bitsetv.c (bitsetv_alloc): Likewise.
9220
9221 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
9222
9223 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
9224 from maintainer-distcheck about casting the argument of 'free'.
9225
9226 * NEWS: Mention recent yytname changes.
9227 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
9228
9229 * bootstrap: For translations that have not yet been upgraded to
9230 the new runtime-po domain, prime the pump by extracting the
9231 relevant strings from the obsolete translations. This code can be
9232 removed once the bison-runtime domain has been translated by each
9233 team.
9234
9235 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
9236 now that token names are already quoted.
9237
9238 Fix problem reported by Anthony Heading.
9239 * data/glr.c (YYTOKEN_TABLE): New macro.
9240 (yytname): Define if YYTOKEN_TABLE.
9241 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
9242 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
9243 (YYERROR_VERBOSE): Define the same way the other skeletons do.
9244 * src/output.c (prepare_symbols): Output token_table_flag.
9245
9246 2005-07-21 Paul Eggert <eggert@cs.ucla.edu>
9247
9248 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
9249 again if the first call fails.
9250
9251 * data/glr.c (yytnamerr): New function.
9252 (yyreportSyntaxError): Use it to dequote most string literals.
9253 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
9254 with other skeletons. All uses changed.
9255 (yytnameerr_): New function.
9256 (yyreport_syntax_error): Use it to dequote most string literals.
9257 * data/yacc.c (yytnamerr): New function.
9258 (yyerrlab): Use it to decode most string literals.
9259 * doc/bison.texinfo (Decl Summary, Calling Convention):
9260 Clarify quoting convention of yytname.
9261 * src/output.c (prepare_symbols): Quote all names. This undoes
9262 the 2005-04-17 change, which is now accomplished (mostly) via
9263 changes in the parsers as described above.
9264 * tests/regression.at (Token definitions, Web2c Actions):
9265 Undo most 2005-04-17 change here, too.
9266
9267 2005-07-20 Paul Eggert <eggert@cs.ucla.edu>
9268
9269 Fix more problems reported by twlevo@xs4all.nl.
9270 * tests/cxx-type.at: Don't pipe output of ./types through sed to
9271 remove trailing spaces. This loses the exit status of ./types,
9272 and isn't needed since ./types shouldn't be emitting trailing
9273 spaces.
9274 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
9275 as the stack isn't valid in that case.
9276
9277 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
9278 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
9279 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
9280 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
9281 is used.
9282 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
9283 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
9284 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
9285 Likewise.
9286
9287 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
9288 overly-picky compilers that reject 'char *foo = "bar";'.
9289
9290 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
9291 to FILE * parameter, not to stderr. This fixes a typo introduced
9292 in the 2005-07-12 change.
9293
9294 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
9295 warnings from GCC 4.
9296
9297 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
9298 (yyglrShiftDefer, yysplitStack):
9299 Remove unused parameters b4_pure_formals. All uses changed.
9300 (yyglrShift): Remove unused parameters b4_user_formals.
9301 All uses changed.
9302 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
9303
9304 2005-07-18 Paul Eggert <eggert@cs.ucla.edu>
9305
9306 Destructor cleanups and regularization among the three skeletons.
9307 * NEWS: Document the behavior changes.
9308 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
9309 stack before failing, as the cleanup code will do it for us now.
9310 * data/lalr1.cc (yyerrlab): Likewise.
9311 * data/glr.c (yyparse): Pop everything off the stack before
9312 freeing it, so that destructors get called properly.
9313 * data/lalr1.cc (yyreturn): Likewise.
9314 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
9315 This is more consistent.
9316 * doc/bison.texinfo (Destructor Decl): Mention more reasons
9317 why destructors might be called. 1.875 -> 2.1.
9318 (Destructor Decl, Decl Summary, Table of Symbols):
9319 Some English-language cleanups for %destructor.
9320 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
9321 Add output line for destructor of start symbol.
9322 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
9323 because of that same extra output line.
9324
9325 * NEWS: Document minor wording changes in diagnostics of
9326 Bison-generated parsers.
9327 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
9328 Remove unused formals. All uses changed.
9329 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
9330 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
9331 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
9332 Rename yyoverflowab to yyexhaustedlab.
9333 When memory exhaustion occurs during syntax-error reporting,
9334 report it separately rather than in a single diagnostic; this
9335 eases translation.
9336 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
9337 (Memory Exhausted): Renamed from Parser Stack Overflow.
9338 Revamp wording slightly to prefer "memory exhaustion".
9339 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
9340
9341 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
9342
9343 Add i18n support to the GLR skeleton. Partially fix the C++
9344 skeleton; a C++ expert needs to finish this. Remove debugging
9345 msgids; there's little point to having them translated, since they
9346 can be understood only by someone who can read the
9347 (English-language) source code.
9348
9349 Generate runtime-po/bison-runtime.pot automatically, so that we
9350 don't have to worry about garbage getting in that file. We'll
9351 make sure after the next official release that old msgids don't
9352 get lost. See
9353 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
9354
9355 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
9356 Now auto-generated.
9357 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
9358 Fix typos in explanations of the runtime file.
9359 * bootstrap: Change gettext keyword from YYI18N to YY_.
9360 Use standard Makefile.in.in in runtime-po, since we'll arrange
9361 for backward-compatible bison-runtime.po files in a different way.
9362 * data/glr.c (YY_): New macro, from yacc.c.
9363 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
9364 Translate messages intended for users.
9365 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
9366 the wording in the other skeletons. We don't know that the memory
9367 is virtual.
9368 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
9369 Use same method that yacc.c uses.
9370 Don't translate debugging messages.
9371 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
9372 it doesn't work (yet), and requires C++ expertise to fix.
9373 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
9374 Move defn to a more logical place, to be consistent with other
9375 skeletons.
9376 Don't translate debugging messages.
9377 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
9378 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
9379 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
9380 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
9381
9382 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
9383 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
9384 void, not int.
9385 * tests/glr-regression.at (Badly Collapsed GLR States):
9386 Likewise.
9387 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
9388 yylex should return 0 at EOF rather than aborting.
9389
9390 Improve tests for stack overflow in GLR parser.
9391 Problem reported by twlevo@xs4all.nl.
9392 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
9393 All uses removed.
9394 (yyStackOverflow): Just longjmp, but with value 2 so that caller
9395 can handle the problem.
9396 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
9397 (yyparse): New local variable yyresult to record the result.
9398 Use result of setjmp to set it, rather than storing itinto
9399 struct.
9400 (yyDone): Remove label.
9401 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
9402 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
9403 if YYABORT is used).
9404 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
9405 yyparse status; put status > 1 into diagnostic.
9406 Check that status==2 works.
9407 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
9408 Use exit status 3 for failure to open (which shouldn't happen).
9409
9410 2005-07-17 Paul Eggert <eggert@cs.ucla.edu>
9411
9412 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
9413 1 on syntax error; just let yyparse do its thing.
9414 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
9415 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
9416 (Exploding the Stack Size with Alloca):
9417 (Exploding the Stack Size with Malloc):
9418 Expect exit status 2, not 1, since the parser is supposed to blow
9419 its stack. Problem reported by twlevo@xs4all.nl.
9420
9421 * data/glr.c (yyparse): Don't assume that the initial calls
9422 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
9423 Print a stack-overflow message and fail instead.
9424 Initialize the line-number information before creating the stack,
9425 so that the stack-overflow message can report line zero safely.
9426
9427 2005-07-14 Paul Eggert <eggert@cs.ucla.edu>
9428
9429 Fix problems reported by twlevo@xs4all.nl.
9430 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
9431 (yyuserMerge): Provide a default case if b4_mergers is empty.
9432 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
9433 * tests/glr-regression.at
9434 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
9435 Add casts to pacify C++ compilers.
9436 * tests/glr-regression.at (Improper merging of GLR delayed action
9437 sets): Declare yylex before using it.
9438 * tests/Makefile.am (maintainer-check-g++): Fix a stray
9439 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
9440 test for valgrind; valgrind is independent of g++.
9441 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
9442 for compatibility with POSIX 1003.1-2001 (if running coreutils).
9443 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
9444 Use a destructor, so that we can expand the stack. Change
9445 YYSTYPE to char * so that we can free it. Cast result of malloc.
9446
9447 2005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
9448
9449 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
9450 a valgrind failure. Problem reported by twlevo@xs4all.nl.
9451
9452 2005-07-13 Paul Eggert <eggert@cs.ucla.edu>
9453
9454 * PACKAGING: New file, suggested by Bruno Haible and taken from
9455 similar wording in gettext's PACKAGING file.
9456 * NEWS: Mention PACKAGING.
9457 * Makefile.am (EXTRA_DIST): Add PACKAGING.
9458
9459 2005-07-12 Paul Eggert <eggert@cs.ucla.edu>
9460
9461 * NEWS: Document recent i18n improvements.
9462 * bootstrap: Get runtime translations into runtime-po.
9463 Create runtime-po files automatically, if possible.
9464 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
9465 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
9466 does not infringe on the user's name space.
9467 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
9468 * doc/bison.texinfo (Internationalization): Revamp the English
9469 and Texinfo syntax a bit, to try to make it clearer.
9470 (Bison Options, Option Cross Key): Mention --print-localedir.
9471 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
9472 YYENABLE_NLS. Quote a bit more.
9473 * runtime-po/.cvsignore: New file.
9474 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
9475 * runtime-po/Rules-quot: Remove; now created by bootstrap.
9476 * runtime-po/quot.sed: Likewise.
9477 * runtime-po/boldquot.sed: Likewise.
9478 * runtime-po/en@quot.header: Likewise.
9479 * runtime-po/en@boldquot.header: Likewise.
9480 * runtime-po/insert-header.sin: Likewise.
9481 * runtime-po/remove-potcdate.sin: Likewise.
9482 * runtime-po/Makevars: Likewise.
9483 * runtime-po/LINGUAS: Likewise.
9484 * runtime-po/de.po: Likewise; we will rely on the translation project
9485 to maintain this, so "bootstrap" should get it.
9486 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
9487 its value.
9488 * src/main.c (main): Bind the bison-runtime domain, too.
9489
9490 2005-07-12 Bruno Haible <bruno@clisp.org>
9491
9492 * data/yacc.c: Include <libintl.h> when NLS is enabled.
9493 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
9494 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
9495 * runtime-po: New directory.
9496 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
9497 $(DOMAIN).pot-update rule, so that old messages are never dropped.
9498 * runtime-po/Rules-quot: New file, copied from po/.
9499 * runtime-po/quot.sed: Likewise.
9500 * runtime-po/boldquot.sed: Likewise.
9501 * runtime-po/en@quot.header: Likewise.
9502 * runtime-po/en@boldquot.header: Likewise.
9503 * runtime-po/insert-header.sin: Likewise.
9504 * runtime-po/remove-potcdate.sin: Likewise.
9505 * runtime-po/Makevars: New file.
9506 * runtime-po/POTFILES.in: New file.
9507 * runtime-po/LINGUAS: New file.
9508 * runtime-po/bison-runtime.pot: New file.
9509 * runtime-po/de.po: New file.
9510 * m4/bison.m4: New file.
9511 * Makefile.am (SUBDIRS): Add runtime-po.
9512 (aclocaldir, aclocal_DATA): New variables.
9513 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
9514 Define aclocaldir.
9515 * src/getargs.c (usage): Document --print-localedir option.
9516 (PRINT_LOCALEDIR_OPTION): New enum item.
9517 (long_options): Add --print-localedir option.
9518 (getargs): Handle --print-localedir option.
9519 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
9520 (Internationalization): New section.
9521
9522 2005-07-12 Akim Demaille <akim@epita.fr>
9523
9524 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
9525 for consistency with the rest of the code.
9526 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
9527 Add separators.
9528
9529 2005-07-12 Akim Demaille <akim@epita.fr>
9530
9531 * src/parse-gram.y: Use %printer instead of YYPRINT.
9532
9533 2005-07-12 Akim Demaille <akim@epita.fr>
9534
9535 * src/symtab.h, src/symtab.c (symbol_print): New.
9536 * src/symlist.h, src/symlist.c (symbol_list_print): New.
9537 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
9538
9539 2005-07-12 Akim Demaille <akim@epita.fr>
9540
9541 * data/glr.c (b4_syncline): Fix (swap) the definitions of
9542 b4_at_dollar and b4_dollar_dollar.
9543
9544 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
9545
9546 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
9547 and Pennello's paper.
9548
9549 2005-07-09 Paul Eggert <eggert@cs.ucla.edu>
9550
9551 * data/yacc.c (yyparse): Undo previous patch. Instead,
9552 set yylsp[0] and yyvsp[0] only if the initial action
9553 sets yylloc and yylval, respectively.
9554
9555 * data/yacc.c (yyparse): In the initial action, set
9556 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
9557 This avoids the use of undefined variables if the initial
9558 action does not set yylloc and/or yylval.
9559
9560 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
9561
9562 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
9563 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
9564 Remove from CVS. These files are automatically generated.
9565 * examples/extexi: Clarify that this file is now part of Bison,
9566 not GNU M4, and that it works with any POSIX-compatible Awk.
9567 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
9568 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
9569 so that we also get calc++-parser.yy. Geneate it.
9570 Use $(AWK), not gawk, since any conforming Awk will do.
9571 Put comment before action, since older 'make' can't handle comment
9572 in action.
9573 $(BUILT_SOURCES): List all built sources, not just some of them.
9574 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
9575 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
9576 $($(calc_sources_generated)): Remove unnecessary test for existence
9577 of target. (This had a shell syntax error anyway; a stray "x".)
9578 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
9579 calc++-parser.yy.
9580 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
9581
9582 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
9583 implied by the other modules.
9584
9585 2005-07-06 Akim Demaille <akim@epita.fr>
9586
9587 Bind examples/calc++ to the package.
9588 * examples/calc++/Makefile: Remove, replaced by...
9589 * examples/calc++/Makefile.am: ... this new file.
9590 * examples/calc++/test: Remove input.
9591 * examples/calc++/compile: Remove.
9592 * examples/Makefile.am: New.
9593 * configure.ac, Makefile.am: Adjust.
9594 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
9595
9596 2005-07-05 Paul Eggert <eggert@cs.ucla.edu>
9597
9598 * data/glr.c (yyFail): Drastically simplify; since the format argument
9599 never had any % directives, we can simply pass it to yyerror.
9600 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
9601 be modified later, as that is the usual style in glr.c.
9602 Problems reported by Paul Hilfinger.
9603
9604 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
9605 and size overflow errors.
9606 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
9607 in case the user prolog sets feature-test macros like _GNU_SOURCE.
9608 (YYSIZEMAX): New macro.
9609 (yystpcpy): New function, taken from yacc.c.
9610 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
9611 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
9612 so that we don't have to maintain their signatures.
9613 (yyFail): Check for buffer overflow, by using vsnprintf rather
9614 than vsprintf. Allocate a bigger buffer if possible.
9615 Report an error if buffer allocation fails.
9616 (yyStackOverflow): New function.
9617 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
9618 the initialization was successful. It might fail if storage was
9619 exhausted.
9620 (yyexpandGLRStack): Add more checks for storage allocation failure.
9621 Use yyStackOverflow to report failures.
9622 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
9623 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
9624 Don't assume stack number fits in int.
9625 (yysplitStack): Check for storage allocation failure.
9626 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
9627 can print diagnostics on storage allocation failure. All callers
9628 changed.
9629 (yyresolveValue): Use yybool for boolean.
9630 (yyreportSyntaxError): Check for size-calculation overflow.
9631 This code is taken from yacc.c.
9632 (yyparse): Check for storage allocation errors when allocating
9633 the initial stack.
9634
9635 2005-07-05 Akim Demaille <akim@epita.fr>
9636
9637 Extract calc++ from the documentation.
9638 * doc/bison.texinfo (Calc++): Add the extraction marks.
9639 * examples/extexi: New, from the aborted GNU Programming 2E.
9640 Separate the different paragraph of a file with empty lines.
9641 * examples/Makefile: Use it to extract the whole calc++ example.
9642
9643 2005-06-24 Akim Demaille <akim@epita.fr>
9644
9645 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
9646 class typedefs.
9647
9648 2005-06-22 Akim Demaille <akim@epita.fr>
9649
9650 * doc/bison.texinfo (C++ Language Interface): First stab.
9651 (C++ Parsers): Remove.
9652
9653 2005-06-22 Akim Demaille <akim@epita.fr>
9654
9655 * data/lalr1.cc (yylex_): Honor %lex-param.
9656
9657 2005-06-22 Akim Demaille <akim@epita.fr>
9658
9659 Start a set of simple examples.
9660 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
9661 * examples/calc++/calc++-driver.hh,
9662 * examples/calc++/calc++-parser.yy,
9663 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
9664 * examples/calc++/compile, examples/calc++/test: New.
9665
9666 2005-06-09 Paul Eggert <eggert@cs.ucla.edu>
9667
9668 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
9669 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
9670 which stems from the 2005-05-27 patch.
9671
9672 2005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
9673
9674 * data/glr.c: Modify treatment of unused parameters to permit use
9675 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
9676
9677 2005-05-30 Paul Eggert <eggert@cs.ucla.edu>
9678
9679 Fix infringement on user name space reported by Janos Zoltan Szabo.
9680 * data/yacc.c (yyparse): strlen -> yystrlen.
9681
9682 2005-05-30 Akim Demaille <akim@epita.fr>
9683
9684 * data/lalr1.cc (_): New.
9685 Translate the various messages.
9686
9687 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
9688
9689 Fix infringement on user name space reported by Bruno Haible.
9690 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
9691 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
9692 the user's name space.
9693 (alloca): Include <stdlib.h> to get it, if it's not built in.
9694 (YYMALLOC, YYFREE): Define only if needed.
9695 (malloc, free): Declare, but only if needed, as this infringes on
9696 the user name space.
9697
9698 2005-05-25 Paul Eggert <eggert@cs.ucla.edu>
9699
9700 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
9701 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
9702 with %d format.
9703 * lib/ebitset.c (min, max): Undef before defining.
9704 * lib/vbitset.c (min, max): Likewise.
9705 * lib/subpipe.c (create_subpipe): Save local variables in case
9706 vfork clobbers them.
9707
9708 2005-05-24 Bruno Haible <bruno@clisp.org>
9709
9710 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
9711 error message syntax used by gcc-4.0.
9712
9713 2005-05-23 Paul Eggert <eggert@cs.ucla.edu>
9714
9715 * README: Mention m4 1.4.3. Remove obsolete advice about
9716 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
9717
9718 * bootstrap: Remove workaround for problem I encountered with
9719 gettext 0.14.1; it seems to be fixed now.
9720
9721 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
9722
9723 * NEWS: Version 2.0a.
9724
9725 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
9726 the previous change.
9727
9728 Various maintainer cleanups.
9729 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
9730 conftest*, for benefit of CVS commands run at the same time as
9731 "configure". Add build-aux, since "bootstrap" now creates it and
9732 its subfiles.
9733 * Makefile.cfg (move_if_change): Remove.
9734 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
9735 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
9736 (po_repo, do-po-update, po-update, wget_files, get-targets):
9737 (config.guess-url_prefix, config.sub-url_prefix):
9738 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
9739 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
9740 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
9741 Remove.
9742 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
9743 this is now the recommended name.
9744 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
9745 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
9746 ylwrap. These files now go into build-aux.
9747 * config/move-if-change: Remove.
9748 * config/prev-version.txt: Bump from 1.75 to 2.0.
9749
9750 * bootstrap: Add stdio-safer, unistd-safer modules.
9751 Remove m4/glibc2.m4 (introduced by latest gnulib, but
9752 we don't need it).
9753 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
9754 fopen-safer.c, stdio-safer.h, unistd-safer.h.
9755 * lib/subpipe.c: Include "unistd-safer.h".
9756 (create_subpipe): Make sure all the newly-created
9757 file descriptors are > 2, so that diagnostics don't
9758 get sent down them (which might cause Bison to hang, in theory).
9759 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
9760 * src/files.c (xfopen): Use fopen_safer, not fopen.
9761
9762 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
9763 yesterday's yacc.c fix.
9764
9765 2005-05-21 Paul Eggert <eggert@cs.ucla.edu>
9766
9767 * data/glr.c, data/lalr1.cc: Update copyright date.
9768
9769 Fix a destructor bug reported by Wolfgang Spraul in
9770 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
9771 * data/yacc.c (yyabortlab): Don't call destructor, and
9772 don't set yychar to EMPTY.
9773 (yyoverflowlab): Don't call destructor.
9774 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
9775 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
9776 since we no longer output the message "discarding lookahead token
9777 end of input ()".
9778
9779 2005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
9780
9781 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
9782 fix a small glitch in debugging output.
9783 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
9784 after YY_SYMBOL_PRINT where needed.
9785
9786 (struct yyGLRState): Add some comments.
9787 (struct yySemanticOption): Add some comments.
9788 (union yyGLRStackItem): Add comment.
9789
9790 (yymergeOptionSets): Correct this to properly perform the union,
9791 avoiding infinite reported by Michael Rosien.
9792 Update comment.
9793
9794 * tests/glr-regression.at: Add test for GLR merging error reported
9795 by M. Rosien.
9796
9797 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
9798
9799 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
9800 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
9801 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
9802 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
9803 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
9804 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
9805 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
9806 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
9807 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
9808 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
9809 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
9810 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
9811 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
9812 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
9813 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
9814 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
9815 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
9816 src/derives.h, src/files.c, src/files.h, src/getargs.c,
9817 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
9818 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
9819 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
9820 src/output.h, src/parse-gram.c, src/parse-gram.h,
9821 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
9822 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
9823 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
9824 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
9825 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
9826 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
9827 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
9828 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
9829 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
9830 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
9831 tests/reduce.at, tests/regression.at, tests/sets.at,
9832 tests/synclines.at, tests/testsuite.at, tests/torture.at:
9833 Update FSF postal mail address.
9834
9835 2005-05-11 Paul Eggert <eggert@cs.ucla.edu>
9836
9837 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
9838 Problem reported by Ralf Menzel.
9839
9840 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
9841
9842 * tests/actions.at: Test that stack overflow invokes destructors.
9843 From Marcus Holland-Moritz.
9844 * data/yacc.c (yyerrlab): Move the code that destroys the stack
9845 from here....
9846 (yyreturn): to here. That way, destructors are called properly
9847 even if the stack overflows, or the user calls YYACCEPT or
9848 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
9849 (yyoverflowlab): Destroy the lookahead.
9850
9851 2005-04-24 Paul Eggert <eggert@cs.ucla.edu>
9852
9853 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
9854
9855 2005-04-17 Paul Eggert <eggert@cs.ucla.edu>
9856
9857 * NEWS: Bison-generated C parsers no longer quote literal strings
9858 associated with tokens.
9859 * src/output.c (prepare_symbols): Don't escape strings,
9860 since users don't want to see C escapes.
9861 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
9862 in diagnostics.
9863 * tests/input.at (Torturing the Scanner): Likewise.
9864 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
9865
9866 2005-04-16 Paul Eggert <eggert@cs.ucla.edu>
9867
9868 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
9869 the data size is known to be too small and we can't increase it.
9870 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
9871
9872 2005-04-15 Paul Eggert <eggert@cs.ucla.edu>
9873
9874 * src/parse-gram.y: Include quotearg.h.
9875 (string_as_id): Quote $1 before using it as a key, since the
9876 lexer no longer quotes it for us.
9877 (string_content): Don't strip quotes, since lexer no longer
9878 quotes it for us.
9879 * src/scan-gram.l: Include quotearg.h.
9880 ("\""): Omit quote.
9881 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
9882 a key, since the rest of the lexer doesn't quote it.
9883 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
9884 * tests/regression.at (Token definitions): Check for backslashes
9885 in token strings.
9886
9887 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
9888 (YYSIZE_T): Define to unsigned long int when using an older compiler.
9889 (yyparse): Revamp code to generate long syntax error message, to
9890 make it easier to translate, and to avoid problems with arithmetic
9891 overflow. Change "virtual memory" to "memory" in diagnostic, since
9892 we don't know whether the memory is virtual.
9893
9894 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
9895
9896 * NEWS: Bison-generated C parsers now use the _ macro to
9897 translate strings.
9898 * data/yacc.c (_) [!defined _]: New macro.
9899 All English strings wrapped inside this macro.
9900 * doc/bison.texinfo (Bison Parser): Document _.
9901 * po/POTFILES.in: Include src/parse-gram.c, since it now
9902 includes translateable strings that parse-gram.y doesn't.
9903
9904 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
9905
9906 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
9907 reverting the 2004-10-11 change to this function.
9908 (symbol_check_alias_consistency): Don't call symbol_type_set
9909 if the type name is already correct.
9910 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
9911
9912 2005-03-25 Paul Eggert <eggert@cs.ucla.edu>
9913
9914 * tests/regression.at (Token definitions): Don't use a token named
9915 c, as that generates a "#define c ..." that runs afoul of buggy
9916 stdlib.h that uses the identifier c as a member of struct
9917 drand48_data. Problem reported by Horst Wente.
9918
9919 2005-03-21 Paul Eggert <eggert@cs.ucla.edu>
9920
9921 * bootstrap: Change translation URL from
9922 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
9923 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
9924 redirection glitches. Problem reported by twlevo@xs4all.nl.
9925
9926 2005-03-20 Paul Eggert <eggert@cs.ucla.edu>
9927
9928 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
9929 after operands; POSIX says this isn't portable for the c99 command.
9930
9931 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
9932
9933 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
9934 immediately if a data overrun has occurred; this may help us track
9935 down what may be a spurious failure on MacOS.
9936
9937 2005-03-17 Paul Eggert <eggert@cs.ucla.edu>
9938
9939 Respond to problems reported by twlevo@xs4all.nl.
9940
9941 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
9942
9943 * src/vcg.h: Comment fix.
9944 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
9945 (G_CMAX): Change to -1 instead of INT_MAX.
9946
9947 * data/yacc.c (yyparse): Omit spaces before #line.
9948
9949 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
9950
9951 * src/tables.c (state_number_to_vector_number): Put it inside an
9952 "#if 0", since it's not currently used. Problem reported by
9953 Roland McGrath.
9954
9955 2005-03-06 Paul Eggert <eggert@cs.ucla.edu>
9956
9957 * src/output.c (escaped_output): Renamed from
9958 escaped_file_name_output, since we now use it for symbol tags as
9959 well. All uses changed.
9960 (symbol_destructors_output, symbol_printers_output):
9961 Escape symbol tags too.
9962 Problem reported by Matyas Forstner in
9963 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
9964
9965 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
9966 not needed.
9967 * src/output.c (user_actions_output, token_definitions_output,
9968 symbol_destructors_output, symbol_printers_output): Likewise.
9969 * src/reader.c (prologue_augment): Likewise.
9970 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
9971
9972 * src/vcg.c (output_edge): Don't quote linestyle arg.
9973 Problem reported by twlevo@xs4all.nl.
9974
9975 2005-02-28 Paul Eggert <eggert@cs.ucla.edu>
9976
9977 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
9978 example, reported by Derek M Jones. Also, make the example even
9979 more outrageous, to better illustrate how bad the problem is.
9980
9981 2005-02-24 Paul Eggert <eggert@cs.ucla.edu>
9982
9983 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
9984 putsym. Typo reported by Sebastian Piping.
9985
9986 2005-02-23 Paul Eggert <eggert@cs.ucla.edu>
9987
9988 * doc/bison.texinfo (Language and Grammar): some -> same
9989 (Epilogue): int he -> in the
9990 Typos reported by Sebastian Piping via Justin Pence.
9991
9992 2005-02-07 Paul Eggert <eggert@cs.ucla.edu>
9993
9994 * tests/glr-regression.at (Improper handling of embedded actions
9995 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
9996 embedded actions and $-N in GLR parsers", work around an Autoconf bug
9997 with dollar signs in test names.
9998 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
9999 for a similar reason.
10000
10001 2005-01-28 Paul Eggert <eggert@cs.ucla.edu>
10002
10003 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
10004 wants to redefine G_VIEW.
10005
10006 2005-01-27 Paul Eggert <eggert@cs.ucla.edu>
10007
10008 * src/vcg.c (get_view_str): Remove case for normal_view.
10009 Problem reported by twlevo@xs4all.nl.
10010
10011 2005-01-24 Paul Eggert <eggert@cs.ucla.edu>
10012
10013 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
10014 Problem reported by twlevo@xs4all.nl.
10015
10016 * doc/bison.texinfo: Change @dircategory from "GNU programming
10017 tools" to "Software development". Requested by Richard Stallman
10018 via Karl Berry.
10019
10020 2005-01-23 Paul Eggert <eggert@cs.ucla.edu>
10021
10022 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
10023 Problem reported by twlevo@xs4all.nl.
10024
10025 2005-01-21 Paul Eggert <eggert@cs.ucla.edu>
10026
10027 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
10028 keyword; it's not needed with modern compilers, and it doesn't
10029 affect correctness with older compilers. Suggested by
10030 twlevo@xs4all.nl.
10031
10032 2005-01-17 Paul Eggert <eggert@cs.ucla.edu>
10033
10034 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
10035 gcc -Wswitch-default.
10036 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
10037 * data/yacc.c (yyparse): Likewise.
10038
10039 2005-01-12 Paul Eggert <eggert@cs.ucla.edu>
10040
10041 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
10042 already. Let config.h define any nonstandard values.
10043
10044 2005-01-10 Paul Eggert <eggert@cs.ucla.edu>
10045
10046 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
10047 for the benefit of slower hosts. Problem reported by
10048 Nelson H. F. Beebe.
10049
10050 2005-01-07 Paul Eggert <eggert@cs.ucla.edu>
10051
10052 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
10053 being defined and not used.
10054 * data/lalr1.cc (yyparse): Likewise.
10055 Use "if (false)" rather than "if (0)".
10056
10057 2005-01-05 Paul Eggert <eggert@cs.ucla.edu>
10058
10059 * TODO: Mention that we should allow NUL bytes in tokens.
10060
10061 2005-01-02 Paul Eggert <eggert@cs.ucla.edu>
10062
10063 * src/scan-skel.l (<<EOF>>): Don't close standard output.
10064 Problem reported by Hans Aberg.
10065
10066 2005-01-01 Paul Eggert <eggert@cs.ucla.edu>
10067
10068 * src/getargs.c (version): Happy new year; update overall
10069 program copyright date from 2004 to 2005.
10070
10071 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
10072 Problem reported by Hans Aberg.
10073 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
10074 (Output file names.): Add a test for the case when standard output
10075 is closed.
10076
10077 2004-12-26 Paul Eggert <eggert@cs.ucla.edu>
10078
10079 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
10080 to fix an oversight in the Bison 2.0 manual.
10081
10082 2004-12-25 Paul Eggert <eggert@cs.ucla.edu>
10083
10084 * NEWS: Version 2.0. Reformat the existing news items since
10085 1.875, so that related items are grouped together.
10086 * configure.ac (AC_INIT): Bump version to 2.0.
10087 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
10088
10089 * tests/torture.at (Exploding the Stack Size with Alloca): Set
10090 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
10091 otherwise, we're not testing alloca. Unfortunately there's no
10092 simple way to consult HAVE_ALLOCA here.
10093
10094 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
10095 for yymsg, too.
10096
10097 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
10098 hand. This avoids a warning about comparing int to size_t when
10099 GCC warnings are enabled.
10100
10101 2004-12-22 Paul Eggert <eggert@cs.ucla.edu>
10102
10103 * NEWS: Bison-generated parsers no longer default to using the
10104 alloca function (when available) to extend the parser stack, due
10105 to widespread problems in unchecked stack-overflow detection.
10106 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
10107 responsibility to set it to a positive value. This lets the user
10108 specify a value that is not a preprocessor constant.
10109 * data/yacc.c (YYMAXDEPTH): Likewise.
10110 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
10111 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
10112 to be a compile-time constant. However, explain the constraints on it.
10113 Also, explain the constraints on YYINITDEPTH.
10114 (Table of Symbols): Explain that alloca is no longer the default.
10115 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
10116 to 1.
10117
10118 * doc/bison.texinfo (Location Default Action): Mention that n must
10119 be zero when k is zero. Suggested by Frank Heckenbach.
10120
10121 2004-12-22 Akim Demaille <akim@epita.fr>
10122
10123 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
10124 (parser::state_type, parser::semantic_type, parser::location_type):
10125 Private, not public.
10126 (parser::parse): Return ints, not bool.
10127 Returning a bool introduces a problem: 0 corresponds to false, and
10128 it seems weird to return false on success. Returning true changes
10129 the conventions for yyparse.
10130 Alternatively we could return void and send an exception.
10131 There is no clear consensus (yet?).
10132 (state_stack, semantic_stack, location_stack): Rename as...
10133 (state_stack_type, semantic_stack_type, location_stack_type): these.
10134 Private, not public.
10135 * tests/c++.at: New.
10136 * tests/testsuite.at, tests/Makefile.am: Adjust.
10137
10138 2004-12-21 Akim Demaille <akim@epita.fr>
10139
10140 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
10141
10142 2004-12-21 Akim Demaille <akim@epita.fr>
10143
10144 Don't impose std::string for filenames.
10145
10146 * data/lalr1.cc (b4_filename_type): New.
10147 (position::filename): Use it.
10148 (parser.hh): Move the inclusion of stack.hh and location.hh below
10149 the user code, so that needed headers for the filename type can be
10150 included first.
10151 Forward declare them before the user code.
10152 * tests/Makefile.am (check-local, installcheck-local): Pass
10153 TESTSUITEFLAGS to the TESTSUITE.
10154
10155 2004-12-20 Akim Demaille <akim@epita.fr>
10156
10157 Use more STL like names: my_class instead of MyClass.
10158
10159 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
10160 (SemanticStack, SemanticType, StateStack, StateType)
10161 (TokenNumberType, Stack, Slice, Traits, Parser::location)
10162 (Parser::value): Rename as...
10163 (location_stack, location_type, rhs_number_type, semantic_stack)
10164 (semantic_type, state_stack, state_type, token_number_type, stack)
10165 (slice, traits, parser::yylloc, parser::yylval): these.
10166
10167 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
10168
10169 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
10170
10171 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
10172 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
10173
10174 2004-12-17 Paul Eggert <eggert@cs.ucla.edu>
10175
10176 Remove uses of 'short int' and 'unsigned short int'. This raises
10177 some arbitrary limits. It uses more memory but nowadays that's
10178 not much of an issue.
10179
10180 This change does not affect the generated parsers; that's a different
10181 task, as some users will want to conserve memory there.
10182
10183 Ideally we should use size_t to represent all object counts, and
10184 something like ptrdiff_t to represent signed differences of object
10185 counts; but that will require more code-cleanup than I have the
10186 time to do right now.
10187
10188 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
10189 Use size_t, not int or short int, to count objects.
10190 * src/closure.c (nritemset, closure): Likewise.
10191 * src/closure.h (nritemset, closure): Likewise.
10192 * src/nullable.c (nullable_compute): Likewise.
10193 * src/print.c (print_core): Likewise.
10194 * src/print_graph.c (print_core): Likewise.
10195 * src/state.c (state_compare, state_hash): Likewise.
10196 * src/state.h (struct state): Likewise.
10197 * src/tables.c (default_goto, goto_actions): Likewise.
10198
10199 * src/gram.h (rule_number, rule): Use int, not short int.
10200 * src/output.c (prepare_rules): Likewise.
10201 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
10202 errs, reductions): Likewise.
10203 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
10204 Likewise.
10205 * src/tables.c (vector_number, tally, action_number,
10206 ACTION_NUMBER_MINIMUM): Likewise.
10207 * src/output.c (muscle_insert_short_int_table): Remove.
10208
10209 2004-12-17 Akim Demaille <akim@epita.fr>
10210
10211 * data/lalr1.cc: Extensive Doxygenation.
10212 (error_): Rename as...
10213 (error): this, since it is visible to the user.
10214 Adjust callers.
10215 (Parser::message): Now an automatic variable from...
10216 (Parser::yyreport_syntax_error_): here.
10217 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
10218 Parser::error.
10219 * tests/input.at: Escape $.
10220
10221 2004-12-16 Paul Eggert <eggert@cs.ucla.edu>
10222
10223 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
10224 Parenthesize rhs to avoid obscure problems with mistakes like
10225 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
10226 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
10227 b4_rhs_location): Likewise.
10228 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
10229 b4_rhs_location): Likewise.
10230
10231 2004-12-16 Akim Demaille <akim@epita.fr>
10232
10233 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
10234 yacc.c: be sure to stay within yycheck_.
10235 * tests/actions.at: Re-enable C++ tests.
10236
10237 2004-12-16 Akim Demaille <akim@epita.fr>
10238
10239 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
10240 real.
10241
10242 2004-12-16 Akim Demaille <akim@epita.fr>
10243
10244 Use #define to handle the %name-prefix.
10245
10246 * data/glr.c, data/yacc.c: Comment changes.
10247 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
10248 so that one can refer to yylex in the parser file, and have it
10249 renamed, as is the case with other skeletons.
10250
10251 2004-12-16 Akim Demaille <akim@epita.fr>
10252
10253 Move lalr1.cc internals into yy*.
10254
10255 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
10256 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
10257 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
10258 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
10259 (empty_, final_, terror_, errcode_, ntokens_)
10260 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
10261 (looka_, ilooka_, error_range_, nerrs_):
10262 Rename as...
10263 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
10264 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
10265 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
10266 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
10267 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
10268 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
10269 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
10270 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
10271 these.
10272
10273 2004-12-15 Paul Eggert <eggert@cs.ucla.edu>
10274
10275 Fix some problems reported by twlevo at xs4all.
10276 * src/symtab.c (symbol_new): Report an error if the input grammar
10277 contains too many symbols. This is better than calling abort() later.
10278 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
10279 (struct node, struct graph):
10280 Rename member expand to stretch. All uses changed.
10281 (struct graph): Remove member layoutalgorithm. All uses removed.
10282 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
10283 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
10284 All uses changed.
10285 (N_STRETCH): Rename from N_EXPAND. All uses changed.
10286
10287 2004-12-15 Akim Demaille <akim@epita.fr>
10288
10289 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
10290 Add more Doxygen comments.
10291 (symprint_, stack_print_, reduce_print_, destruct_, pop)
10292 (report_syntax_error_, translate_): Rename as...
10293 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
10294 (yypop_, yyreport_syntax_error_, yytranslate_): this.
10295
10296 2004-12-15 Akim Demaille <akim@epita.fr>
10297
10298 * data/lalr1.cc (lex_): Rename as...
10299 (yylex_): this.
10300 Move the trace here.
10301 Take the %name-prefix into account.
10302 Reported by Alexandre Duret-Lutz.
10303
10304 2004-12-15 Akim Demaille <akim@epita.fr>
10305
10306 Simplify the C++ parser constructor.
10307
10308 * data/lalr1.cc (debug_): Rename as...
10309 (yydebug_): so that the parser's internals are always in the yy*
10310 pseudo namespace.
10311 Adjust uses.
10312 (b4_parse_param_decl): Remove the leading comma as it is now only
10313 called as unique argument list.
10314 (Parser::Parser): Remove the constructor accepting a location and
10315 an initial debugging level.
10316 Remove from the other ctor the argument for the debugging level.
10317 (debug_level_type, debug_level, set_debug_level): New.
10318
10319 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
10320 constructor calls.
10321
10322 2004-12-15 Akim Demaille <akim@epita.fr>
10323
10324 Remove b4_root related material: failure experiment
10325 (which goal was to allow to derive from a class).
10326
10327 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
10328 definitions and uses.
10329
10330 2004-12-14 Paul Eggert <eggert@cs.ucla.edu>
10331
10332 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
10333 not 2, since it's not portable to subtract 1 from the start of an
10334 array. The new item 0 is never set or used. All uses changed.
10335
10336 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
10337 the default definition of YYLLOC_DEFAULT. Problem reported
10338 by Frank Heckenbach.
10339
10340 2004-12-12 Paul Eggert <eggert@cs.ucla.edu>
10341
10342 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
10343 the normal case and one for the error case. Just use the
10344 first one uniformly. Problem reported by Frank Heckenbach.
10345 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
10346 use exactly the same macro in both places.
10347 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
10348 so that the normal-case YYRHSLOC works for the error case too.
10349 All uses changed.
10350 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
10351 (YYLLOC_DEFAULT): Use the same macro as glr.c.
10352 * doc/bison.texinfo (Location Default Action): Don't claim that
10353 we have an array of locations. Use the same macro for both glr
10354 and lalr parsers. Mention YYRHSLOC. Mention what happens when
10355 the index is 0.
10356
10357 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
10358
10359 * HACKING: Update email addresses to send announcements to.
10360
10361 * configure.ac (AC_INIT): Bump version to 1.875f.
10362
10363 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
10364
10365 * NEWS: Version 1.875e.
10366 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
10367
10368 * src/scan-skel.l: Include "complain.h", for "fatal".
10369
10370 * src/relation.h (relation_print, relation_digraph):
10371 Relation sizes are of type relation_node, not size_t (this is
10372 merely a doc fix, since the two types are equivalent).
10373 (relation_transpose): Relation sizes are of type relation_node,
10374 not int.
10375 * src/relation.c: Likewise.
10376 (top, infinity): Now of type relation_node, not int.
10377 (traverse, relation_transpose): Use relation_node, not int.
10378
10379 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
10380 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
10381 (yyparse): Remove unused local introduced in 2004-10-25 patch.
10382
10383 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
10384 specifying whether the test should be skipped. Use it tp
10385 specify that the [%defines %skeleton "lalr1.cc"] tests currently
10386 fail on some hosts, and should be skipped.
10387
10388 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
10389
10390 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
10391 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
10392 unless otherwise specified below.
10393
10394 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
10395 to allocate kernel_base, kernel_items, kernel_size, since
10396 they needn't be initialized to 0.
10397 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
10398 * src/closure.c (new_closure): Likewise, for itemset.
10399 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
10400 * src/lalr.c (set_goto_map): Likewise, for temp_map.
10401 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
10402 (build_relations): Likewise for edge, states1, includes.
10403 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
10404 * src/reader.c (packgram): Likewise, for ritem, rules.
10405 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
10406 * src/relation.c (relation_digraph): Likewise for VERTICES.
10407 (relation_transpose): Likewise for new_R, end_R.
10408 * src/symtab.c (symbols_token_translations_init): Likewise for
10409 token_translations.
10410 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
10411 (token_actions): Likewise for yydefact, actrow, conflrow,
10412 conflict_list.
10413 (save_column): Likewise for froms[symno], tos[symno].
10414 (goto_actions): Likewise for state_count.
10415 (pack_table): Likewise for base, pos, check.
10416 (tables_generate): Likewise for width.
10417
10418 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
10419 for initial core. Just have a separate core, so we needn't worry
10420 about whether kernel_size and kernel_base are initialized.
10421
10422 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
10423 kernel_size, kernel_items): Remove unnecessary initialization.
10424 * src/conflicts.c (conflicts): Likewise.
10425 * src/derives.c (derives): Likewise.
10426 * src/muscle_tablc (muscle_insert): Likewise.
10427 * src/relation.c (relation_digraph): Likewise.
10428 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
10429 conflrow, conflict_table, conflict_list, table, check):
10430 Likewise.
10431
10432 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
10433 This is because all callers pass unsigned int.
10434 * src/closure.h (new_closure): Likewise.
10435
10436 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
10437 (build_relations): Initialize includes[i] in all cases.
10438 * src/reader.c (packgram): Always initialize rules[ruleno].prec
10439 and rules[ruleno].precsym. Initialize members in order.
10440 * src/relation.c (relation_transpose): Always initialize new_R[i]
10441 and end_R[i].
10442 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
10443
10444 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
10445 conflict_list[0] was always 0, but now it isn't initialized.
10446
10447 * src/table.c (table_grow): When conflict_table grew, the grown
10448 area wasn't cleared. Fix this.
10449
10450 * lib/.cvsignore: Add strdup.c, strdup.h.
10451 * m4/.cvsignore: Add strdup.m4.
10452
10453 2004-12-07 Paul Eggert <eggert@cs.ucla.edu>
10454
10455 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
10456 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
10457 GOTO_NUMBER_MAXIMUM, since we occasionally compute
10458 ngotos + 1 without checking for overflow.
10459 (build_relations): Use END_NODE, not -1, to denote end of edges.
10460 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
10461 build_relations): Use goto_number, not int, for goto numbers.
10462 * src/tables.c (save_column, default_goto): Likewise.
10463
10464 2004-11-23 Akim Demaille <akim@epita.fr>
10465
10466 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
10467 of #defining from yystype.
10468 Don't typedef yystype, C++ does not need it.
10469 This lets it possible to forward declare it as union.
10470
10471 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
10472
10473 * bootstrap (gnulib_modules): Add extensions.
10474 Problem reported by Jim Meyering.
10475
10476 2004-11-22 Paul Eggert <eggert@cs.ucla.edu>
10477
10478 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
10479 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
10480 src/system.h, src/tables.c: XFREE -> free, to accommodate
10481 recent change to gnulib xalloc.h.
10482 Problem reported by Jim Meyering.
10483
10484 2004-11-17 Akim Demaille <akim@epita.fr>
10485
10486 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
10487
10488 2004-11-17 Akim Demaille <akim@epita.fr>,
10489 Alexandre Duret-Lutz <adl@gnu.org>
10490
10491 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
10492 changes.
10493 (YYCDEBUG): Adjust.
10494 Use it instead of cdebug_.
10495 (Parser::debug_stream, Parser::set_debug_stream): New.
10496 (Parser::symprint_): Define cdebug_ for temporary backward
10497 compatibility.
10498 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
10499 debug_stream ().
10500
10501 2004-11-17 Akim Demaille <akim@epita.fr>
10502
10503 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
10504 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
10505 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
10506 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
10507
10508 2004-10-27 Paul Eggert <eggert@cs.ucla.edu>
10509
10510 * data/glr.c (yyloc_default): Remove; not used.
10511 Problem reported by Frank Heckenbach.
10512
10513 2004-10-25 Akim Demaille <akim@epita.fr>
10514
10515 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
10516 Introduce another definition to address simple location arrays.
10517 (yyGLRStack): New member: yyerror_range.
10518 (yyrecoverSyntaxError, yyparse): Update it.
10519 (yyrecoverSyntaxError): Use it when shifting the error token to
10520 have an accurate range, equivalent to the one computed by both
10521 yacc.c and lalr1.cc.
10522 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
10523 that column numbers start at column 0, as per GNU Coding
10524 Standards, the others tests, and the doc.
10525 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
10526 Adjust to the above change (first column is 0).
10527 And adjust the location of the "<error>", now covering the whole
10528 line.
10529
10530 2004-10-22 Akim Demaille <akim@epita.fr>
10531 and Paul Eggert <eggert@cs.ucla.edu>
10532
10533 Remove some arbitrary limits on goto numbers and relations.
10534 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
10535 initial values, since they're never used.
10536 (set_goto_map): ngotos is now unsigned, so test for overflow
10537 by seeing whether it wraps around to zero.
10538 * src/lalr.h (goto_number): Now size_t, not short int.
10539 (GOTO_NUMBER_MAXIMUM): Remove.
10540 * src/relation.c (relation_print, traverse, relation_transpose):
10541 Check for END_NODE rather than looking at sign.
10542 * src/relation.h (END_NODE): New macro.
10543 (relation_node): Now size_t, not short int.
10544
10545 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
10546
10547 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
10548 keyword, not an identifier. Problem reported by Baron Schwartz in
10549 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
10550
10551 2004-10-11 Akim Demaille <akim@epita.fr>
10552
10553 * src/symtab.c (symbol_check_alias_consistency): Also check
10554 type names, destructors, and printers.
10555 Reported by Alexandre Duret-Lutz.
10556 Recode the handling of associativity and precedence in terms
10557 of symbol_precedence_set.
10558 Accept no redeclaration at all, not even equal to the previous
10559 value.
10560 (redeclaration): New.
10561 Use it to factor redeclaration complaints.
10562 (symbol_make_alias): Don't set the type of the alias, let
10563 symbol_check_alias_consistency do it as for other features.
10564 * src/symtab.h (symbol): Add new member prec_location, and
10565 type_location.
10566 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
10567 * tests/input.at (Incompatible Aliases): New.
10568
10569 2004-10-09 Paul Eggert <eggert@cs.ucla.edu>
10570
10571 .cvsignore fixes to accommodate gnulib changes,
10572 and the practice of naming build directories "_build".
10573 * .cvsignore: Add "_*". Sort.
10574 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
10575 * m4/.cvsignore: Add "*_gl.m4".
10576
10577 2004-10-06 Akim Demaille <akim@epita.fr>
10578
10579 * src/parse-gram.y (add_param): Fix the truncation of trailing
10580 spaces.
10581
10582 2004-10-05 Akim Demaille <akim@epita.fr>
10583
10584 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
10585 whether the reducion was empty or not. This leaves room to
10586 improve the use of YYLLOC_DEFAULT in such a case.
10587 lalr1.cc is still experimental, so changing this is acceptable.
10588 And finally, there are probably not many users who changed the
10589 handling of locations in GLR, so changing is admissible too.
10590
10591 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
10592 empty reduction, set @$ to an empty location ending the previously
10593 stacked symbol.
10594 Adjust uses to make sure the code is triggered on empty
10595 reductions.
10596 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
10597 expected output: empty reductions have empty locations.
10598
10599 2004-09-29 Akim Demaille <akim@epita.fr>
10600
10601 * data/lalr1.cc: Move towards a more standard C++ coding style
10602 for templates: Class < T > -> Class<T>.
10603
10604 2004-09-29 Akim Demaille <akim@epita.fr>
10605
10606 * data/lalr1.cc: Reinstall the former ctor, for sake of
10607 compatibility, but warn it will be removed.
10608 Move towards a more standard C++ coding style (i.e., type *var ->
10609 type* var).
10610
10611 2004-09-27 Paul Eggert <eggert@cs.ucla.edu>
10612
10613 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
10614 since it's less likely to work if NULs are involved in the future.
10615
10616 2004-09-27 Akim Demaille <akim@epita.fr>
10617
10618 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
10619
10620 2004-09-27 Akim Demaille <akim@epita.fr>
10621
10622 * data/lalr1.cc (b4_parse_param_decl_1): New.
10623 (b4_parse_param_decl): Use it to have different names between attribute
10624 and argument names.
10625 (b4_cc_constructor_call): Likewise.
10626
10627 2004-09-24 Akim Demaille <akim@epita.fr>
10628
10629 * src/parse-gram.y (add_param): Strip the leading and trailing
10630 blanks from a formal argument declaration.
10631 (YY_LOCATION_PRINT): New.
10632
10633 2004-09-24 Akim Demaille <akim@epita.fr>
10634
10635 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
10636 after the location.
10637
10638 2004-09-24 Akim Demaille <akim@epita.fr>
10639
10640 * doc/bison.texinfo (Table of Symbols): Sort.
10641
10642 2004-09-21 Akim Demaille <akim@epita.fr>
10643
10644 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
10645 the useless parentheses.
10646 Suggested by Paul Eggert.
10647
10648 2004-09-20 Akim Demaille <akim@epita.fr>
10649
10650 Let the initial-action act on the look-ahead, and use it for the
10651 "initial push" (corresponding to an hypothetical beginning-of-file).
10652 And let lalr1.cc honor %initial-action.
10653
10654 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
10655 example.
10656 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
10657 (Parser::Parser): Remove the ctor that used to initialize it.
10658 (Parser::parse): Like in the other skeletons, issue the "starting
10659 parse" message before any action.
10660 Honor %initial-action.
10661 Initialize the stacks with the lookahead.
10662 * data/yacc.c: Let $$ and @$ in %initial-action designate the
10663 look-ahead.
10664 Push them in the stacks.
10665 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
10666
10667 2004-09-20 Akim Demaille <akim@epita.fr>
10668
10669 * doc/bison.texinfo (Initial Action Decl): New.
10670
10671 2004-09-20 Akim Demaille <akim@epita.fr>
10672
10673 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
10674 clearer criterion to define it.
10675 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
10676 When reducing on an empty RHS, use the latest stacked location as
10677 location.
10678 yylloc is not always available.
10679 * data/glr.c: Likewise.
10680 Also, honor initial-actions.
10681
10682 2004-09-20 Akim Demaille <akim@epita.fr>
10683
10684 * data/yacc.c (YY_LOCATION_PRINT): New.
10685 Define when we know YYLTYPE's structure, i.e., when the default
10686 YYLLOC_DEFAULT is used.
10687 * data/c.m4 (b4_yysymprint_generate): Use it.
10688 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
10689 value of the result.
10690 (error_start_): Replace with...
10691 (error_range_): this location array.
10692 This allows to replace code relying on the implementation of
10693 locations by portable code.
10694 * data/yacc.c (yylerrsp): Replace with...
10695 (yyerror_range): this.
10696 Every time a token is popped, update yyerror_range[0], to have an
10697 accurate location for the error token.
10698 * data/glr.c (YY_LOCATION_PRINT): New.
10699 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
10700 deference a pointer.
10701 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
10702 report the location in %printers.
10703
10704 * src/scan-skel.l: Instead of abort, report error messages to ease
10705 understanding skeleton scanning failures.
10706
10707 2004-09-16 Akim Demaille <akim@epita.fr>
10708
10709 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
10710 (iterator, const_iterator): these, to be more in the C++ spirit.
10711 Also, return reverse iterators so that when displaying the stack
10712 we display its bottom first.
10713 (Parser::stack_print_, Parser::reduce_print_): Match the messages
10714 from yacc.c.
10715 We should probably use vector here though.
10716
10717 2004-09-16 Akim Demaille <akim@epita.fr>
10718
10719 Have more complete shift traces.
10720
10721 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
10722 to report Shifts instead of ad hoc YYDPRINTF invocations,
10723 including for the error token.
10724 * data/lalr1.cc (symprint_): Output the location.
10725 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
10726 output the location within the %printer.
10727 Activate GLR tests, at least to make sure they compile properly.
10728 They still don't pass though.
10729 * tests/calc.at: Adjust expect verbose output, since now "Entering
10730 state..." is on a different line than the "Shifting" message.
10731
10732 2004-09-08 Akim Demaille <akim@epita.fr>
10733
10734 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
10735 Bison directive from the Bison file to the invocation of this
10736 macro, so that these directives are passed to
10737 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
10738 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
10739 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
10740 the extra Bison directives instead of the whole series.
10741 Change the grammar so that there are recoverable errors, and
10742 unrecoverable errors. Now we can have the parser give up before
10743 consuming the whole input. As a result we now can observe that
10744 the lookahead is freed when needed.
10745 Change the parser source to parse argv[1] instead of a hard coded
10746 string.
10747 Simplify yylex, and give a value and location to EOF.
10748 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
10749 passed directives already coded in the file.
10750 Add some tests to check the location of "error".
10751 For some tests, the C++ parser is correct, and not yacc.c.
10752 For other tests, they provide different, but unsatisfying, values,
10753 so keep the C++ value so that at least one parser is "correct"
10754 according to the test suite.
10755 (Actions after errors): Remove, this is subsumed by the
10756 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
10757
10758 2004-09-06 Akim Demaille <akim@epita.fr>
10759
10760 * data/lalr1.cc: Adjust the indentation of the labels.
10761 (Parser::pop): New.
10762 Use it.
10763
10764 2004-09-06 Akim Demaille <akim@epita.fr>
10765
10766 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
10767 argument, an informative message.
10768 Call YY_SYMBOL_PRINT.
10769 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
10770 * data/lalr1.cc (destruct_): Likewise.
10771 In addition, no longer depend on b4_yysymprint_generate and
10772 b4_yydestruct_generate to generate these functions, do it "by
10773 hand".
10774
10775 2004-09-03 Akim Demaille <akim@epita.fr>
10776
10777 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
10778 invoked, yydestruct the lookahead.
10779 * tests/calc.at (Calculator $1): Update the expected lengths of
10780 traces: there is an added line for the discarded lookahead.
10781 * doc/bison.texinfo (Destructor Decl): Some rewording.
10782 Define "discarded" symbols.
10783
10784 2004-09-02 Akim Demaille <akim@epita.fr>
10785
10786 * data/lalr1.cc (translate_, destruct_): No reason to be static.
10787
10788 2004-09-02 Akim Demaille <akim@epita.fr>
10789
10790 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
10791 (YYDSYMPRINTF): Rename as...
10792 (YY_SYMBOL_PRINT): this.
10793 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
10794 two.
10795 Use it instead of direct symprint_ calls.
10796 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
10797 one.
10798
10799 2004-09-02 Akim Demaille <akim@epita.fr>
10800
10801 * data/lalr1.cc (b4_yysymprint_generate): New.
10802 (symprint_): New member function, defined when YYDEBUG.
10803 Use it consistently instead of token/nterm debugging output by
10804 hand.
10805 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
10806 %printer calls to use cdebug_ when using lalr1.cc.
10807
10808 2004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
10809
10810 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
10811 with #ifdef YYDEBUG.
10812
10813 2004-08-26 Akim Demaille <akim@epita.fr>
10814
10815 * doc/bison.texinfo (Implementing Loops): Rename as...
10816 (Implementing Gotos/Loops): this.
10817
10818 2004-08-13 Paul Eggert <eggert@cs.ucla.edu>
10819
10820 Adjust to latest gnulib.
10821 * bootstrap (gnulib_modules): Add xalloc-die.
10822 Set LC_ALL=C so that file names sort consistently.
10823 Prefer the gnulib copies of gettext.m4, glibc21.m4,
10824 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
10825 uintmax_t.m4, ulonglong.m4.
10826 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
10827 po.m4 since we are now using _gl.m4 instead.
10828
10829 2004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
10830
10831 * src/scan-action.l: Remove. Scanning of semantic actions is
10832 handled in scan-gram.l.
10833
10834 2004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
10835
10836 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
10837
10838 * src/location.h (struct): The file member is a uniqstr.
10839 (equal_boundaries): Use UNIQSTR_EQ for comparison.
10840
10841 2004-07-22 Paul Eggert <eggert@cs.ucla.edu>
10842
10843 Fix bug with non-%union parsers that have printers or destructors,
10844 which led to a Bison core dump. Reported by Peter Fales in
10845 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
10846
10847 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
10848 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
10849 not to our own type.
10850 * src/output.c (symbol_destructors_output, symbol_printers_output):
10851 Don't assume %union.
10852 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
10853 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
10854 UNION-FLAG. All callers changed.
10855 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
10856 Use type char, not unsigned int, when declaring an array of char;
10857 this lets us remove a cast.
10858 (Printers and Destructors): Add non-%union test cases.
10859
10860 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
10861
10862 * doc/bison.texinfo: Minor editorial changes, mostly to the new
10863 GLR writeups. E.g., avoid frenchspacing and the future tense,
10864 change "lookahead" to "look-ahead", and change "wrt" to "with
10865 respect to".
10866
10867 2004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10868
10869 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
10870 New sections, split off from the GLR Parsers section. Put the new
10871 Simple GLR Parser near the start of the GLR section, for clarity.
10872 Rewrite connective text.
10873
10874 2004-06-21 Frank Heckenbach <frank@g-n-u.de>
10875
10876 * doc/bison.texinfo (Simple GLR Parsers): New section.
10877
10878 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
10879
10880 * NEWS, TODO, doc/bison.texinfo:
10881 Use "look-ahead" instead of "lookahead", to be consistent.
10882 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
10883 while we're fixing "look-ahead".
10884 * src/conflicts.c (shift_set): Renamed from shiftset.
10885 (look_ahead_set): Renamed from lookaheadset.
10886 * src/print.c: Likewise.
10887 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
10888 name for "lookahead".
10889 (report_types, usage): Likewise.
10890 * src/getargs.h (report_look_ahead_tokens): Renamed from
10891 report_lookaheads.
10892 * src/lalr.c (compute_look_ahead_tokens): Renamed from
10893 compute_lookaheads.
10894 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
10895 (look_ahead_tokens_print): Renamed from lookaheads_print.
10896 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
10897 state_rule_lookaheads_print.
10898 * src/state.h: Likewise.
10899 (reductions.look_ahead_tokens): Renamed from lookaheads.
10900 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
10901 AT_DATA_LOOKAHEADS_GRAMMAR.
10902
10903 2004-06-03 Paul Eggert <eggert@cs.ucla.edu>
10904
10905 * README: Update location of patched M4 distribution.
10906
10907 2004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
10908
10909 Don't assume the C++ compiler takes the same arguments as the C compiler
10910 (trivial change).
10911 * configure.ac (O0CXXFLAGS): New var.
10912 * tests/atlocal.in (CXXFLAGS): Use it.
10913
10914 2004-05-29 Paul Eggert <eggert@cs.ucla.edu>
10915
10916 Fix some "make check" problems with C++ reported by
10917 Albert Chin-A-Young for Tru64 C++ in this thread:
10918 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
10919
10920 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
10921 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
10922 Output to a .cc file for C++, not to a .c file.
10923 * tests/calc.at (AT_CHECK_CALC): Likewise.
10924 * tests/regression.at (AT_CHECK_DANCER): Likewise.
10925 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
10926
10927 2004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
10928
10929 * tests/calc.at, tests/actions.at: Workaround for SGI
10930 C++ compiler. (trivial change)
10931
10932 2004-05-27 Paul Eggert <eggert@cs.ucla.edu>
10933
10934 Spent a few hours checking out which prerequisite versions the
10935 current sources actually require. I went all the way back to
10936 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
10937 a seemingly endless set of combinations of versions more recent
10938 than that. The bottom line is that the current sources require
10939 fairly recent versions of the build tools, and it'll be some work
10940 to change this.
10941 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
10942 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
10943 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
10944 Add comments explaining why those particular versions are
10945 currently needed.
10946
10947 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
10948 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
10949 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
10950
10951 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
10952 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
10953
10954 2004-05-26 Paul Eggert <eggert@cs.ucla.edu>
10955
10956 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
10957 0.11.5. Suggested by Bruno Haible.
10958 * bootstrap: Remove gettext version checking.
10959
10960 * doc/bison.texinfo (Decl Summary): Also mention that %union
10961 can depend on prerequisite types. Problem reported by Tim
10962 Van Holder.
10963
10964 2004-05-25 Paul Eggert <eggert@cs.ucla.edu>
10965
10966 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
10967 * README-alpha: Don't tell people not to package this.
10968
10969 * bootstrap: Don't assume $(...) works; use `...` instead.
10970 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
10971 gettext better.
10972
10973 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
10974 put into the -d output file, and mention what to do if YYSTYPE is
10975 defined as a macro.
10976
10977 2004-05-24 Paul Eggert <eggert@cs.ucla.edu>
10978
10979 Undo change made earlier today: it caused autopoint to not bring
10980 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
10981 autopoint's.
10982
10983 * bootstrap: Check that gettext version matches what's in
10984 configure.ac. Warn users to ignore robots.txt ERROR 404.
10985 * bootstrap: Undo today's earlier change (logged below).
10986 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
10987
10988 The gettext version checking is causing more trouble than it's
10989 curing; remove it. Problem reported by Paul Hilfinger.
10990
10991 * bootstrap: Issue a warning that one can expect a message
10992 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
10993 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
10994
10995 2004-05-23 Paul Eggert <eggert@cs.ucla.edu>
10996
10997 Ensure that the C++ compiler used for testing actually works on a
10998 simple test program; if not, skip the C++-related tests. Problem
10999 reported by Vin Shelton in:
11000 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
11001
11002 * m4/cxx.m4: New file.
11003 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
11004 * tests/atlocal.in (BISON_CXX_WORKS): Add.
11005 * tests/local.at (AT_COMPILE_CXX): Use it.
11006
11007 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
11008
11009 * data/glr.c (yylloc): Output this macro even if locations are not
11010 being generated, as the GLR parser needs it even in that case.
11011 Problem reported by Troy A. Johnson
11012 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
11013
11014 * configure.ac (AC_INIT): Update to 1.875e.
11015
11016 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
11017
11018 * NEWS: Version 1.875d.
11019 * configure.ac (AC_INIT): Likewise.
11020 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
11021
11022 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
11023 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
11024 lalr1.cc runs afoul of the first, and the last two are no longer
11025 supported by GCC 3.4.0.
11026 * README: Mention GNU m4 1.4 or later; mention m4 patches.
11027 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
11028
11029 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
11030
11031 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
11032 unsigned int, for compatibility with latest gnulib hash module.
11033 * src/state.c (state_hash, state_hasher): Likewise.
11034 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
11035 * src/uniqstr.c (hash_uniqstr): Likewise.
11036
11037 2004-05-03 Paul Eggert <eggert@cs.ucla.edu>
11038
11039 * NEWS: Unescaped newlines are no longer allowed in char & strings.
11040
11041 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
11042 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
11043 character and string literals.
11044 (unexpected_end): New function.
11045 (unexpected_eof): Use it.
11046 (unexpected_newline): New function.
11047 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
11048 actions.
11049
11050 * NEWS: Document %expect-rr.
11051
11052 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
11053 Fix typo by replacing $1 with $option.
11054 Remove more 'intl'-related files.
11055 Don't DEFUN AM_INTL_SUBDIR twice.
11056
11057 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
11058 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
11059 strtoul.c.
11060 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
11061 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
11062 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
11063 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
11064 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
11065 * src/.cvsignore: Add *.output.
11066
11067 * src/parse-gram.y: Put copyright notice inside %{ %} so it
11068 gets copied to the output file.
11069
11070 2004-04-28 Paul Eggert <eggert@twinsun.com>
11071
11072 Get files from the gnulib and po repositories, instead of relying
11073 on them being in our CVS. Upgrade to latest versions of gnulib
11074 and Automake.
11075
11076 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
11077 * bootstrap: Bootstrap from gnulib and po repositories.
11078 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
11079 * README-cvs: Document these changes. Remove version numbers from
11080 mentions of build tools, since they change so often. Mention Flex.
11081
11082 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
11083 (gl_USE_SYSTEM_EXTENSIONS): Add.
11084 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
11085 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
11086 does this for us.
11087 (AC_ISC_POSIX): Remove; we no longer support this
11088 ancient OS, as it gets in the way of latest Autoconf & gnulib.
11089 (AC_HEADER_STDC): Remove: we now assume C89 or better.
11090 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
11091 Do not check for C89 headers, except for locale.h which is used
11092 by the Yacc library and must port to K&R hosts.
11093 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
11094 Do not check for C89 functions, except for setlocale which is
11095 used by the Yacc library.
11096 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
11097 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
11098 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
11099 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
11100 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
11101 AM_GNU_GETTEXT): Remove; now done by:
11102 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
11103 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
11104 for us.
11105
11106 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
11107 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
11108 Define to empty, as gnulib.mk will do the rest for us.
11109 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
11110 for us.
11111 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
11112 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
11113
11114 * src/files.c: Include gnulib's xstrndup.h.
11115
11116 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
11117 (REALLOC): Use xnrealloc, for likewise.
11118 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
11119 (strnlen, memrchr): Remove decls; functions no longer used.
11120 Include <stpcpy.h>.
11121
11122 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
11123 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
11124 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
11125 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
11126 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
11127 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
11128 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
11129 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
11130 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
11131 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
11132 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
11133 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
11134 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
11135 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
11136 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
11137 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
11138 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
11139 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
11140 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
11141 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
11142 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
11143 Remove, as these files are now generated automatically
11144 by bootstrap or automake.
11145
11146 * po/ChangeLog: Remove: all but one entry was a duplicate
11147 of this file, and I moved that 2000-11-02 entry here.
11148
11149 * config/.cvsignore: Add Makefile, depcomp, install-sh.
11150 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
11151 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
11152 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
11153 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
11154 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
11155 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
11156 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
11157 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
11158 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
11159 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
11160 xstrndup.h.
11161 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
11162 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
11163 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
11164 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
11165 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
11166 * src/.cvsignore: Remove *_.c.
11167
11168
11169 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
11170 support it. (The latest stable gzip doesn't.)
11171
11172 2004-04-27 Paul Eggert <eggert@twinsun.com>
11173
11174 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
11175 case, as stos_ is now used by destructors due to the 2004-02-09
11176 change.
11177
11178 Remove more K&R C support.
11179 * lib/libiberty.y (PARAMS): Remove. All uses removed.
11180 * lib/subpipe.c (errno): Remove decl.
11181 Include <stdlib.h> unconditionally.
11182 (EXIT_FAILURE): Remove macro.
11183 * src/complain.c (vfprintf, strerror): Remove.
11184 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
11185 unconditionally.
11186 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
11187 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
11188 (strchr, strspn, memchr): Remove decls.
11189 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
11190 unconditionally. Do not declare perror.
11191 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
11192 unconditionally.
11193
11194 * src/complain.c (_): Remove useless defn, as system.h defines this.
11195
11196 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
11197 with latest obstack.h.
11198 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
11199 to procedure types, as obstack.h now does that for us.
11200 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
11201
11202 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
11203 so that this include file can stand alone.
11204 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
11205 does this now. Include subpipe.h first after config.h, to
11206 test whether it can stand alone.
11207
11208 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
11209 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
11210 unused declaration.
11211
11212 * tests/synclines.at (%union synch line): Put a dummy member in
11213 the union, because empty unions aren't allowed in C. Caught
11214 by GCC 3.4.0.
11215
11216 2004-04-13 Jim Meyering <jim@meyering.net>
11217
11218 * src/conflicts.c (conflicts_print): Correct format string typo:
11219 use `%%' to produce literal `%'. (trivial change)
11220
11221 2004-03-30 Paul Eggert <eggert@twinsun.com>
11222
11223 * src/getargs.c (version): Update copyright year to 2004.
11224
11225 * data/c.m4 (b4_int_type): Use 'short int' rather than
11226 'short', and similarly for 'long', 'unsigned', etc.
11227 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
11228 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
11229 yy_yypstack, yydumpstack): Likewise.
11230 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
11231 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
11232 Likewise.
11233 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
11234 yy_stack_print, yyparse): Likewise.
11235 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
11236 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
11237 * lib/bitset.c (bitset_print): Likewise.
11238 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
11239 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
11240 * lib/bitsetv.c (bitsetv_dump): Likewise.
11241 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
11242 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
11243 Likewise.
11244 * src/LR0.c (allocate_itemsets): Likewise.
11245 * src/gram.h (rule_number, rule): Likewise.
11246 * src/lalr.h (goto_number): Likewise.
11247 * src/nullable.c (nullable_compute): Likewise.
11248 * src/output.c (prepare_rules): Likewise.
11249 * src/relation.c (relation_print, relation_digraph): Likewise.
11250 * src/relation.h (relation_node): Likewise.
11251 * src/state.h (state_number, transitions, errs, reductions,
11252 struct state): Likewise.
11253 * src/symtab.h (symbol_number, struct symbol): Likewise.
11254 * src/tables.c (vector_number, tally, action_number,
11255 default_goto, goto_actions): Likewise.
11256 * tests/existing.at (GNU Cim Grammar): Likewise.
11257 * tests/regression.at (Web2c Actions): Likewise.
11258
11259 * src/output.c (muscle_insert_short_int_table): Renamed from
11260 muscle_insert_short_table. All uses changed.
11261
11262 2004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
11263
11264 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
11265 (declaration): Replace expected_conflicts with expected_sr_conflicts.
11266 Add %expect-rr rule.
11267
11268 * src/scan-gram.l: Recognize %expect-rr.
11269
11270 * src/conflicts.h (expected_sr_conflicts): Rename from
11271 expected_conflicts.
11272 (expected_rr_conflicts): Declare.
11273
11274 * src/conflicts.c (expected_sr_conflicts): Rename from
11275 expected_conflicts.
11276 (expected_rr_conflicts): Define.
11277 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
11278 for GLR parsers.
11279 Use expected_sr_conflicts in place of expected_conflicts.
11280 Warn if expected_rr_conflicts used in non-GLR parser.
11281
11282 * doc/bison.texinfo: Add documentation for %expect-rr.
11283
11284 2004-03-08 Paul Eggert <eggert@gnu.org>
11285
11286 Add support for hex token numbers. Suggested by Odd Arild Olsen in
11287 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
11288
11289 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
11290 in lalr1.cc.
11291 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
11292 * src/scan-gram.l (scan_integer): New function.
11293 ({int}): Use it.
11294 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
11295 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
11296 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
11297 Say "long int", not "long", for uniformity with GNU style.
11298
11299 2004-02-25 Paul Eggert <eggert@twinsun.com>
11300
11301 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
11302 compilers. This fixes a problem with Intel's C++ compiler being
11303 chatty, reported by Guido Trentalancia in
11304 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
11305
11306 2004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
11307
11308 Support %destructor and merge error locations in lalr1.cc.
11309
11310 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
11311 (Parser::stos_): Define unconditionally.
11312 (Parser::destruct_): New method. Generate its body with
11313 b4_yydestruct_generate.
11314 (Parser::error_start_): New attribute.
11315 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
11316 token which are discarded.
11317 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
11318 error_start_ when erroneous token are discarded.
11319 (Parser::parse) <yyerrlab1>: Compute the location of the error
11320 token so that it covers all the discarded tokens.
11321 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
11322 it can be called with `%skeleton "lalr1.cc"', and do that.
11323
11324 2004-02-02 Paul Eggert <eggert@twinsun.com>
11325
11326 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
11327 $(top_srcdir)/lib and ../lib. This fixes a bug reported
11328 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
11329 There's no need to mention top_builddir since Automake does that
11330 for us.
11331 (INCLUDES): Remove, as Automake says it's obsolescent.
11332 Contents migrated into AM_CPPFLAGS as described above.
11333 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
11334
11335 2004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
11336
11337 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
11338 (yyreportSyntaxError): Handle case where lookahead token is
11339 YYEMPTY.
11340
11341 2004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11342
11343 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
11344 resulting parsers are compilable with C++.
11345
11346 2003-12-23 Paul Eggert <eggert@twinsun.com>
11347
11348 * config/depcomp, config/install-sh: Sync with Automake 1.8.
11349 * src/output.c (output_skeleton): Rename local var.
11350 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
11351 Bison tokens, as this runs afoul of the 2003-10-07 change that
11352 disallowed NUL bytes in character constants or string literals.
11353
11354 * tests/local.at: Require Autoconf 2.59's Autotest.
11355 * tests/testsuite.at: Don't include local.at, since we now assume
11356 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
11357 including it.
11358 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
11359 multiple inclusion warnings.
11360
11361 2003-12-02 Akim Demaille <akim@epita.fr>
11362
11363 * doc/bison.texinfo (How Can I Reset the Parser): More about start
11364 conditions.
11365 From Bruno Haible.
11366
11367 2003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
11368
11369 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
11370
11371 2003-10-07 Paul Eggert <eggert@twinsun.com>
11372
11373 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
11374 if testsuite doesn't exist.
11375
11376 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
11377 literals, unfortunately.
11378 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
11379 Complain about NUL bytes in character constants or string literals.
11380
11381 2003-10-05 Paul Eggert <eggert@twinsun.com>
11382
11383 * NEWS: Don't document %no-default-prec, as it's still
11384 too experimental.
11385 * doc/bison.texinfo: Document %no-default-prec only if
11386 the defaultprec flag is set. Normally it's not.
11387
11388 2003-10-04 Paul Eggert <eggert@twinsun.com>
11389
11390 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
11391 non-modifiable lvalue, instead of a modifiable one.
11392 * doc/bison.texinfo (Actions): Document that $$ can
11393 be assigned to. Do not claim that $$ and $N are
11394 array element references: user code should not rely on this.
11395
11396 2003-10-01 Paul Eggert <eggert@twinsun.com>
11397
11398 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
11399 (grammar_declaration): Use it.
11400 * src/scan-gram.l: New token %no-default-prec.
11401 * tests/conflicts.at: Revamp tests to use %no-default-prec.
11402 * NEWS, doc/bison.texinfo: Document the above.
11403
11404 2003-10-01 Akim Demaille <akim@epita.fr>
11405
11406 VCG no longer supports long_straight_phase.
11407
11408 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
11409 * src/print_graph.c (print_graph): Adjust.
11410
11411 2003-09-30 Frank Heckenbach <frank@g-n-u.de>
11412 and Paul Eggert <eggert@twinsun.com>
11413
11414 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
11415 Table of Symbols): Document %default-prec.
11416 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
11417 (grammar_declaration): Set default_prec on %default-prec.
11418 * src/scan-gram.l (%default-prec): New token.
11419 * src/reader.h (default_prec): New flag.
11420 * src/reader.c: Likewise.
11421 (packgram): Handle it.
11422 * tests/conflicts.at (%default-prec without %prec,
11423 %default-prec with %prec, %default-prec 1): New tests.
11424
11425 2003-09-30 Paul Eggert <eggert@twinsun.com>
11426
11427 * tests/testsuite.at: Include local.at, not input.at, fixing
11428 a typo in the 2003-08-25 patch.
11429
11430 2003-08-27 Akim Demaille <akim@epita.fr>
11431
11432 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
11433 GCC warnings.
11434
11435 2003-08-26 Akim Demaille <akim@epita.fr>
11436
11437 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
11438 "<\#" to avoid magic from Gnus when posting parts of this script.
11439
11440 2003-08-26 Akim Demaille <akim@epita.fr>
11441
11442 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
11443 (Parser::parse): here.
11444 Adjust: nerrs and errstatus is now replaced by...
11445 (Parser::nerrs_, Parser::errstatus_): New.
11446
11447 2003-08-25 Akim Demaille <akim@epita.fr>
11448
11449 * config/announce-gen, Makefile.cfg: New.
11450 * Makefile.am: Adjust.
11451 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
11452 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
11453
11454 2003-08-25 Akim Demaille <akim@epita.fr>
11455
11456 When reducing initial empty rules, Bison parser read an initial
11457 location that is not defined. This results in garbage, and that
11458 affects Bison's own parser. Therefore we need (i) to extend Bison
11459 to support a means to initialize this location, and (ii) to use
11460 this CVS Bison to fix CVS Bison's parser.
11461
11462 * src/reader.h, reader.c (epilogue_augment): Remove, replace
11463 with...
11464 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
11465 * src/parse-gram.y: Adjust.
11466 (%initial-action): New.
11467 (%error-verbose): Since we require CVS Bison, there is no reason
11468 not to use it.
11469 * src/scan-gram.l: Adjust.
11470 * src/Makefile.am (YACC): New, to make sure we use our own parser.
11471 * data/yacc.c (yyparse): Use b4_initial_action.
11472
11473 2003-08-25 Akim Demaille <akim@epita.fr>
11474
11475 * doc/bison.texinfo: Don't promote stdout for error messages.
11476
11477 2003-08-25 Akim Demaille <akim@epita.fr>
11478
11479 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
11480 From Alexandre Duret-Lutz.
11481
11482 2003-08-25 Akim Demaille <akim@epita.fr>
11483
11484 Version 1.875c.
11485
11486 2003-08-25 Akim Demaille <akim@epita.fr>
11487
11488 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
11489 Use them.
11490
11491 2003-08-25 Akim Demaille <akim@epita.fr>
11492
11493 * data/lalr1.cc (Parser::reduce_print_): New.
11494 Use it.
11495
11496 2003-08-25 Akim Demaille <akim@epita.fr>
11497
11498 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
11499 error recovery loops. This patch is based on
11500 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
11501 Also, augment the similarity between lalr1.cc and yacc.c.
11502 Note: the locations of error recovery rules are not correct yet.
11503
11504 * data/lalr1.cc: Comment changes to augment the similarity between
11505 lalr1.cc and yacc.c.
11506 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
11507 (yyerrlab1): Remove, but where it used to be (now the bottom part of
11508 yyerrlab), when hitting EOF, pop the whole stack here instead of
11509 merely falling thru the default error handling mechanism.
11510 (yyerrorlab): New label, with the old contents of YYERROR,
11511 plus the following change: pop the stack of rhs corresponding
11512 to the production that invoked YYERROR. That is how Yacc
11513 behaves (required by POSIX).
11514 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
11515 fail.
11516
11517 2003-08-25 Akim Demaille <akim@epita.fr>
11518
11519 Tune local.at so that people can "autom4te -l autotest calc.at -o
11520 calc" for instance, to extract a sub test suite.
11521
11522 * tests/testsuite.at: Move the initialization, Autotest version
11523 requirement, and AT_TESTED invocation into...
11524 * tests/local.at: here.
11525 * tests/testsuite.at: Include it for compatibility with Autoconf
11526 2.57.
11527 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
11528 be ignore.
11529
11530 2003-08-04 Paul Eggert <eggert@twinsun.com>
11531
11532 Rework code slightly to avoid gcc -Wtraditional warnings.
11533 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
11534 The returned value is now stored in *YY0. All callers changed.
11535 * src/output.c (merge_output): Adjust to the above change.
11536
11537 2003-07-26 Paul Eggert <eggert@twinsun.com>
11538
11539 * data/glr.c (YYASSERT): New macro.
11540 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
11541 yyresolveStates, yyprocessOneStack):
11542 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
11543 Derived from a suggestion by Frank Heckenbach.
11544
11545 2003-07-25 Paul Eggert <eggert@twinsun.com>
11546
11547 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
11548 for portability to K&R C (after ansi2knr, presumably). See
11549 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
11550 by Frank Heckenbach, though I have omitted the structure-initialization
11551 part of his glr-knr.diff patch since I recall that the Portable
11552 C Compiler didn't require that change.
11553
11554 Let the user specify how to allocate and free memory.
11555 Derived from a suggestion by Frank Heckenbach in
11556 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
11557 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
11558 All uses of free, malloc, realloc changed to use these macros,
11559 and unnecessary casts removed.
11560 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
11561
11562 2003-07-06 Matthias Mann <MatthiasMann@gmx.de>
11563
11564 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
11565 use s.empty() rather than s == "" to test for empty string; see
11566 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
11567 (trivial change)
11568
11569 2003-06-25 Akim Demaille <akim@epita.fr>
11570
11571 * config/depcomp, config/install-sh: Update from masters.
11572
11573 2003-06-20 Paul Eggert <eggert@twinsun.com>
11574
11575 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
11576 and return properly parenthesized result.
11577 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
11578 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
11579 Remove unnecessary parentheses from uses.
11580 * doc/bison.texinfo (Location Default Action): Describe the
11581 conventions for parentheses.
11582
11583 2003-06-19 Paul Eggert <eggert@twinsun.com>
11584
11585 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
11586 yyreportTree): Do not assume that size_t is the same width as int,
11587 when printing sizes. Print sizes using an unsigned format.
11588 Problem reported by Frank Heckenbach in
11589 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
11590
11591 Port to Forte Developer 7 C compiler.
11592 * data/glr.c (struct YYLTYPE): If locations are not being used,
11593 declare a single dummy member, as empty structs do not conform
11594 to the C standard.
11595 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
11596 the Forte Developer 7 C compiler complains that end-of-loop
11597 code is not reached.
11598
11599 2003-06-17 Paul Eggert <eggert@twinsun.com>
11600
11601 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
11602 avoid warnings from picky compilers about redefinition of PARAMS.
11603
11604 2003-06-17 Paul Eggert <eggert@twinsun.com>
11605
11606 Version 1.875b.
11607
11608 * NEWS: Document 1.875b.
11609
11610 * lib/bbitset.h: Do not include config.h; that's the includer's job.
11611 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
11612 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
11613 Don't use 'index' in comments, as it's a builtin fn on some hosts.
11614 * lib/bitset_stats.c: Include gettext.h unconditionally, as
11615 per recent gettext manual's suggestion.
11616 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
11617 Use prototypes, not old-style definitions.
11618 * lib/lbitset.c (lbitset_unused_clear): Likewise.
11619 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
11620 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
11621 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
11622 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
11623 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
11624 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
11625 vbitset_or_and_cmp, vbitset_copy): Likewise.
11626
11627 * lib/libiberty.h: Do not include config.h; that's the includer's job.
11628 Do not include <stdlib.h>.
11629 (PARAMS): Define unconditionally for C89.
11630 (ATTRIBUTE_NORETURN): Remove.
11631 (ATTRIBUTE_UNUSED): Define unconditionally.
11632
11633 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
11634 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
11635 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
11636 * lib/vbitset.c, lib/vbitset.h: New files.
11637 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
11638 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
11639 from libbitset.
11640
11641 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
11642 `How Can I Reset @code{yyparse}', since texinfo does not allow
11643 arbitrary @ in node names.
11644
11645 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
11646 shouldn't be needed according to the gettext 0.12.1 documentation
11647 but which seem to be needed anyway: codeset.m4 glibc21.m4
11648 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
11649 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
11650 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
11651
11652 * lib/.cvsignore: Add stdbool.h.
11653 * m4/.cvsignore: Add nls.m4, po.m4.
11654
11655 Upgrade to CVS gnulib.
11656 * stdbool_.h: File renamed from stdbool.h.in.
11657 * configure.ac (AM_STDBOOL_H): Invoke this instead of
11658 AC_HEADER_STDBOOL.
11659 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
11660 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
11661 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
11662 (MOSTLYCLEANFILES): New var.
11663 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
11664 (stdbool.h): New rule.
11665 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
11666 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
11667 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
11668 m4/quote.m4: Upgrade to today's gnulib.
11669
11670 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
11671 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
11672 the tests right now.
11673 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
11674 yyerror are declared before use; C99 requires this.
11675
11676 2003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11677
11678 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
11679 first.
11680 (yyrecoverSyntaxError): Correct the logic for setting and testing
11681 yyerrState.
11682 Correct comment on handling EOF.
11683 Allow states with only a default reduction, rather than failing
11684 (I can't quite reconstruct why these were not allowed before).
11685
11686 Fixes to avoid problem that $-N rules in GLR parsers can cause
11687 buffer overruns, corrupting state.
11688
11689 * src/output.c (prepare_rules): Output max_left_semantic_context
11690 definition.
11691 * src/reader.h (max_left_semantic_context): New variable declaration.
11692 * src/scan-gram.l (max_left_semantic_context): Define.
11693 (handle_action_dollar): Update max_left_semantic_context.
11694 * data/glr.c (YYMAXLEFT): New definition.
11695 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
11696 (yyresolveAction): Ditto.
11697
11698 Fixes to problems with location handling in GLR parsers reported by
11699 Frank Heckenbach (2003/06/05).
11700
11701 * data/glr.c (YYLTYPE): Make trivial if locations not used.
11702 (YYRHSLOC): Add parentheses, and define only if locations used.
11703 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
11704 locations not used.
11705 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
11706 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
11707
11708 * tests/cxx-type.at: Exercise location information; update tests
11709 to differentiate output with and without locations.
11710 Remove forward declarations of yylex and yyerror---caused errors
11711 because default YYLTYPE not yet defined.
11712 Change semantic actions to compute strings, rather than printing
11713 them directly (to test proper passing of semantics values). Change
11714 output to prefix notation and update test data and expected results.
11715 (yylex): Track locations.
11716 (stmtMerge): Return value rather than printing, and include arguments
11717 in value.
11718
11719 2003-06-03 Paul Eggert <eggert@twinsun.com>
11720
11721 Avoid warnings generated by GCC 2.95.4 when Bison is
11722 configured with --enable-gcc-warnings.
11723 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
11724 yy::]b4_parser_class_name[::translate_,
11725 yy::Stack::operator[] (unsigned),
11726 yy::Stack::operator[] (unsigned) const,
11727 yy::Slice::operator[] (unsigned),
11728 yy::Slice::operator[] (unsigned) const):
11729 Rename local vars to avoid warnings.
11730 * tests/glr-regression.at (Improper handling of embedded actions
11731 and $-N in GLR parsers): Remove unused local variable from yylex.
11732 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
11733 (void) as arg when not pure, since we now assume C89 when building
11734 Bison. Pacify GCC by using parameter.
11735
11736 2003-06-02 Paul Eggert <eggert@twinsun.com>
11737
11738 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
11739 yy::Location::lines, yy::Location::columns): Rename arguments
11740 to avoid shadowing; this removes a warning generated by GCC 3.3.
11741
11742 2003-06-01 Paul Eggert <eggert@twinsun.com>
11743
11744 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
11745 to g++, as GCC 3.3 complains if you do it.
11746 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
11747 everything that WARNING_CFLAGS has, except omit warnings
11748 not suitable for C++.
11749 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
11750 * tests/atlocal.in (CXXFLAGS): New var.
11751 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
11752
11753 Fix a GLR parser bug I reported in February; see
11754 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
11755 The problem was that GLR parsers did not conform to the C standard,
11756 because actions like { $1 = $2 + $3; } expanded to expressions
11757 that invoked YYFILL in separate subexpressions, and YYFILL assigned
11758 to a local variable. The C standard says that expressions
11759 like (var = f ()) + (var = f ()) have undefined behavior.
11760 Another problem was that GCC sometimes issues warnings that
11761 yyfill and its parameters are unused.
11762
11763 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
11764 as possibly unused.
11765 (yyfill): New function.
11766 (YYFILL): Use it.
11767 (yyuserAction): Change type of yynormal to bool, so that it matches
11768 the new yyfill signature. Mark it as possibly unused.
11769
11770
11771 Follow up on a bug I reported in February, where a Bison-generated
11772 parser can loop. Provide a test case and a fix for yacc.c. I
11773 don't have a fix for lalr1.cc or for glr.c, unfortunately.
11774 The original bug report is in:
11775 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
11776
11777 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
11778 macro's size was becoming unwieldy.
11779 (yyerrlab): Do not discard an empty lookahead symbol, as this
11780 might destroy garbage.
11781 (yyerrorlab): New label, with the old contents of YYERROR,
11782 plus the following change: pop the stack of rhs corresponding
11783 to the production that invoked YYERROR. That is how Yacc
11784 behaves, and POSIX requires this behavior.
11785 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
11786 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
11787 Define 'alarm' to do nothing if unistd.h is not available.
11788 Add a new rule "exp: '-' error;" to test the above change to
11789 data/yacc.c. Use 'alarm' to abort any test taking longer than
11790 10 seconds, as it's probably looping.
11791 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
11792 Also, the new yacc.c generates two fewer diagnostics for an
11793 existing test.
11794
11795 2003-05-24 Paul Eggert <eggert@twinsun.com>
11796
11797 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
11798 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
11799 This fixes a problem reported by John Bowman when the Compaq/HP
11800 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
11801 -ansi -Wall -gall).
11802 * data/yacc.c (union yyalloc): Likewise.
11803 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
11804
11805 Switch from 'int' to 'bool' where that makes sense.
11806
11807 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
11808 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
11809 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
11810 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
11811 Return or accept bool, not int. All callers changed.
11812 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
11813 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
11814 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
11815 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
11816 bitset_or_and_cmp_): Likewise.
11817 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
11818 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
11819 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
11820 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
11821 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
11822 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
11823 bitset_stats_or_and_cmp): Likewise.
11824 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
11825 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
11826 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
11827 ebitset_xor_cmp): Likewise.
11828 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
11829 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
11830 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
11831 lbitset_xor_cmp): Likewise.
11832 * lib/bbitset.h: Include <stdbool.h>.
11833 (struct bitset_vtable): The following members now return bool, not
11834 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
11835 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
11836 or_and_cmp).
11837 * src/conflicts.c (count_rr_conflicts): Likewise.
11838 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
11839 All uses changed.
11840 * lib/ebitset.c (ebitset_obstack_init): Likewise.
11841 * lib/lbitset.c (lbitset_obstack_init): Likewise.
11842 * src/getargs.c (debug_flag, defines_flag, locations_flag,
11843 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
11844 graph_flag): Likewise.
11845 * src/getargs.h (debug_flag, defines_flag, locations_flag,
11846 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
11847 graph_flag): Likewise.
11848 * src/output.c (error_verbose): Likewise.
11849 * src/output.h (error_verbose): Likewise.
11850 * src/reader.c (start_flag, typed): Likewise.
11851 * src/reader.h (typed): Likewise.
11852 * src/getargs.c (LOCATIONS_OPTION): New constant.
11853 (long_options, getargs): Use it.
11854 * src/lalr.c (build_relations): Use bool, not int.
11855 * src/nullable.c (nullable_compute): Likewise.
11856 * src/print.c (print_reductions): Likewise.
11857 * src/tables.c (action_row, pack_vector): Likewise.
11858 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
11859 * src/output.c (prepare): Use it.
11860 * src/output.c (token_definitions_output,
11861 symbol_destructors_output, symbol_destructors_output): Use string,
11862 not boolean integer, to keep track of whether to output separator.
11863 * src/print_graph.c (print_core): Likewise.
11864 * src/state.c (state_rule_lookaheads_print): Likewise.
11865
11866 * config/install-sh: Sync from automake 1.7.5.
11867
11868 2003-05-14 Paul Eggert <eggert@twinsun.com>
11869
11870 * src/parse-gram.y (rules_or_grammar_declaration): Require a
11871 semicolon after a grammar declaration, in the interest of possible
11872 future changes to the Bison input language.
11873 Do not allow a stray semicolon at the start of the grammar.
11874 (rhses.1): Allow one or more semicolons after any rule, including
11875 just before "|" as required by POSIX.
11876 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
11877 grammar.
11878
11879 2003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
11880
11881 %parse-param support for lalr1.cc.
11882
11883 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
11884 b4_cc_constructor_calls, b4_cc_constructor_call,
11885 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
11886 definitions.
11887 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
11888 parse-param arguments.
11889 (yy::b4_parser_class_name): Declare instance variables to
11890 hold parse-param arguments.
11891 * tests/calc.at: s/value/semantic_value/ because value clashes
11892 with a member of yy::b4_parser_class_name. Adjust C++ code
11893 to handle %parse-param. Enable %parse-param test in C++.
11894
11895 2003-05-12 Paul Eggert <eggert@twinsun.com>
11896
11897 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
11898 English a bit. Fix fclose typo. Change "const char" to "char
11899 const", and use ANSI C rather than K&R for "main". Suggest
11900 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
11901 and suggest yy_switch_to_buffer.
11902
11903 2003-05-05 Paul Eggert <eggert@twinsun.com>
11904
11905 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
11906 C89. This avoids a diagnostic on compilers that define __STDC__
11907 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
11908 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
11909
11910 2003-05-03 Paul Eggert <eggert@twinsun.com>
11911
11912 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
11913 Do not overrun array bounds.
11914 This should fix a bug reported today by Olatunji Oluwabukunmi in
11915 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
11916
11917 2003-04-29 Akim Demaille <akim@epita.fr>
11918
11919 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
11920 * src/getargs.c, src/getargs.h: here, as bool, not int.
11921 (nondeterministic_parser): New.
11922 * src/parse-gram.y, src/scan-gram.l: Support
11923 %nondeterministic-parser.
11924 * src/output.c (prepare): Use nondeterministic_parser instead
11925 of glr_parser where appropriate.
11926 * src/tables.c (conflict_row, action_row, save_row)
11927 (token_actions, token_actions, pack_vector): Ditto.
11928
11929 2003-04-29 Akim Demaille <akim@epita.fr>
11930
11931 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
11932
11933 2003-04-29 Akim Demaille <akim@epita.fr>
11934
11935 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
11936 with %pure-parser and %locations to exercise the patch from Yakov
11937 Markovitch below.
11938
11939 2003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
11940
11941 * data/yacc.c: (b4_lex_param): Corrected for the case where
11942 %lex-param is provided and %pure-parser isn't.
11943
11944 2003-04-27 Paul Eggert <eggert@twinsun.com>
11945
11946 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
11947 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
11948 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
11949 if it is not defined.
11950 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
11951
11952 2003-04-26 Paul Eggert <eggert@twinsun.com>
11953
11954 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
11955 Declare to be of type suitable for the ninf value itself, not of
11956 type suitable for the corresponding table, since the latter might
11957 be unsigned but the ninf value might be negative. This fixes a
11958 bug reported by Alexandre Duret-Lutz in
11959 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
11960
11961 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
11962 invokes it. We shouldn't invoke it twice because it will attempt
11963 to put error.o in the archive twice. This fixes a glitch reported
11964 by Martin Mokrejs in
11965 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
11966
11967 2003-04-21 Paul Eggert <eggert@twinsun.com>
11968
11969 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
11970 to gnulib.
11971
11972 2003-04-21 Yakov Markovitch <Markovitch@iso.ru>
11973
11974 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
11975 Fix obvious typo that results in uncompilable GLR parsers
11976 when both %pure-parser and %locations are used. (trivial change)
11977
11978 2003-04-17 Paul Eggert <eggert@twinsun.com>
11979
11980 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
11981 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
11982 Do not insert the expected token via unput, as this runs afoul
11983 of a POSIX-compatibility bug in flex 2.5.31.
11984 All uses changed to BEGIN the parent state,
11985 since we no longer insert the expected token via unput.
11986 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
11987 that is no longer emitted after the above change.
11988
11989 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
11990 the first one. This change is from Paul Hilfinger, and it fixes
11991 regression reported by Werner Lemberg in
11992 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
11993
11994 (resolve_sr_conflict): Don't invoke state_errs_set
11995 unless one or more tokens have been explicitly made errors.
11996 Otherwise, the above change causes Bison to abort.
11997
11998 * tests/existing.at (GNU pic Grammar): New test case, taken from
11999 Lemberg's email.
12000
12001 2003-03-31 Akim Demaille <akim@epita.fr>
12002
12003 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
12004
12005 2003-03-31 Akim Demaille <akim@epita.fr>
12006
12007 * src/output.c (prepare_symbols): Avoid trailing spaces in the
12008 output.
12009
12010 2003-03-31 Akim Demaille <akim@epita.fr>
12011
12012 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
12013 From Paul Hilfinger.
12014
12015 2003-03-29 Akim Demaille <akim@epita.fr>
12016
12017 * m4/error.m4: Do not put under dynamic conditions some code which
12018 expansion is under static control.
12019
12020 2003-03-29 Akim Demaille <akim@epita.fr>
12021
12022 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
12023
12024 2003-03-29 Akim Demaille <akim@epita.fr>
12025
12026 * doc/bison.texinfo (Strings are Destroyed): New.
12027
12028 2003-03-13 Paul Eggert <eggert@twinsun.com>
12029
12030 * .cvsignore: Add configure.lineno.
12031 * src/.cvsignore: Add yacc.
12032 * tests/.cvsignore: Add testsuite.log.
12033 * doc/fdl.texi: Sync with latest FSF version.
12034
12035 2003-03-12 Paul Eggert <eggert@twinsun.com>
12036
12037 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
12038 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
12039 cursor, instead of leaving it undefined. This fixes a bug
12040 reported by Tim Van Holder in
12041 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
12042 * tests/input.at (Torturing the Scanner): Test the scanner on
12043 an empty input file, which was Tim Van Holder's test case.
12044
12045 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
12046 <sys/resource.h> can be included, include sys/time.h and
12047 sys/times.h first, if available. This works around the SunOS
12048 4.1.4 porting bug reported by Bruce Becker in
12049 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
12050
12051 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
12052 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
12053 AC_HEADER_SYS_WAIT.
12054
12055 Merge changes from gnulib. This was prompted because the CVS
12056 snapshot didn't build on Solaris 7 due to strnlen problems.
12057
12058 These changes need to be merged back into gnulib:
12059 * lib/hash.c: Include <stdbool.h> unconditionally.
12060 * m4/onceonly.m4 (m4_quote): New macro.
12061 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
12062 Quote AC_FOREACH variable-expansions properly.
12063 The 2003-01-03 obstack.h change also needs merging.
12064 {end of changes requiring merging}
12065
12066 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
12067 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
12068 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
12069 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
12070 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
12071 New files, imported from gnulib.
12072 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
12073 above.
12074
12075 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
12076 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
12077 gnulib sources.
12078
12079 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
12080 Add.
12081 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
12082 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
12083 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
12084 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
12085 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
12086 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
12087 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
12088 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
12089 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
12090 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
12091 (jm_PREREQ_ARGMATCH): Remove.
12092 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
12093 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
12094
12095 * src/system.h: Include <stdbool.h> unconditionally.
12096
12097 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
12098 assuming at least C89 in the bitset code for some time now.
12099
12100 2003-03-03 Akim Demaille <akim@epita.fr>
12101
12102 * ro.po: New.
12103
12104 2003-03-02 Akim Demaille <akim@epita.fr>
12105
12106 * doc/bison.texinfo (Table of Symbols): Reactivate the
12107 documentation for %lex-param, and %parse-param.
12108
12109 2003-03-02 Akim Demaille <akim@epita.fr>
12110
12111 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
12112 generate verbose error messages.
12113 Use the number of tokens as an upper bound in yytname, as it
12114 cannot be a non terminal.
12115
12116 2003-03-02 Akim Demaille <akim@epita.fr>
12117
12118 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
12119 message.
12120
12121 2003-03-02 Akim Demaille <akim@epita.fr>
12122
12123 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
12124 Use them to exercise yycheck overrun.
12125 Based on Andrew Suffield's grammar.
12126
12127 2003-03-02 Akim Demaille <akim@epita.fr>
12128
12129 Create tests/local.at for Bison generic testing macros.
12130
12131 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
12132 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
12133 This new file.
12134 * tests/calc.at (AT_CHECK_CALC): Adjust.
12135 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
12136 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
12137 * tests/local.at: here.
12138 (AT_COMPILE_CXX): Tags the tests using it as c++.
12139 Ignore the test if CXX is not functional.
12140
12141 2003-03-01 Paul Eggert <eggert@twinsun.com>
12142
12143 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
12144 not loc->end, since loc->end might contain garbage and this leads
12145 to undefined behavior on some platforms.
12146 (id_loc, token_start): Use (IF_LINTed) initial values that do not
12147 depend on *loc, so that the reader doesn't give the the false
12148 impression that *loc is initialized.
12149 (<INITIAL>"%%"): Do not bother setting code_start, since its value
12150 does not survive the return.
12151
12152 2003-03-01 Akim Demaille <akim@epita.fr>
12153
12154 * src/scan-gram.l (code_start): Always initialize it when entering
12155 into yylex, as SC_EPILOGUE is activated *before* the corresponding
12156 yylex invocation. An alternative would be making it static, but
12157 then it starts with the second %%'s beginning, instead of its end.
12158
12159 2003-02-28 Paul Eggert <eggert@twinsun.com>
12160
12161 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
12162 around a UnixWare 7.1.1 porting bug reported by John Hughes in
12163 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
12164
12165 2003-02-26 Paul Eggert <eggert@twinsun.com>
12166
12167 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
12168 Remove Sequent/Pyramid discussion (nobody uses them any more).
12169 Merge VMS and MS-DOS discussion; these ports may well be dead
12170 but let's keep mentioning them for now. Put <> around email
12171 addresses. Add copyright notice.
12172
12173 2003-02-24 Paul Eggert <eggert@twinsun.com>
12174
12175 * data/glr.c (yy_reduce_print): yylineno -> yylno,
12176 to avoid collision with flex use of yylineno.
12177 Problem reported by Bruce Lilly in
12178 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
12179 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
12180 * data/yacc.c (yy_reduce_print): Likewise.
12181
12182 * config/depcomp: Sync with Automake 1.7.3.
12183
12184 2003-02-21 Akim Demaille <akim@epita.fr>
12185
12186 * data/lalr1.cc: Use temporary variables instead of casts to
12187 change integer types.
12188 Suggested by Paul Eggert.
12189
12190 2003-02-21 Akim Demaille <akim@epita.fr>
12191
12192 * doc/bison.texinfo: Use "location" consistently to refer to @n,
12193 to avoid confusions with lalr1.cc's notion of Position.
12194 Suggested by Paul Eggert.
12195
12196 2003-02-20 Akim Demaille <akim@epita.fr>
12197
12198 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
12199 before initial_columns.
12200 (location.hh): Use consistent variable names when defining the
12201 operator<<.
12202 Use "last" so that we subtract from Positions, not from unsigned.
12203
12204 2003-02-20 Akim Demaille <akim@epita.fr>
12205
12206 * data/lalr1.cc (position.hh): New subfile, including the extended
12207 and Doxygen'ed documentation of class Position.
12208 (location.hh): Use it.
12209 Document a` la Doxygen.
12210 With the help of Benoit Perrot.
12211
12212 2003-02-20 Akim Demaille <akim@epita.fr>
12213
12214 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
12215 AT_YACC_IF.
12216 Redefine AT_YYERROR_SEES_LOC_IF using it.
12217 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
12218 not defined.
12219 Don't use the location in yy::Parser::error_ and
12220 yy::Parser::print_ when not %locations.
12221 Activate more lalr1.cc tests.
12222
12223 2003-02-19 Akim Demaille <akim@epita.fr>
12224
12225 * data/lalr1.cc: When displaying a line number, be sure to make it
12226 an int.
12227
12228 2003-02-19 Akim Demaille <akim@epita.fr>
12229
12230 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
12231 Remove, useless.
12232 (YYABORT, YYACCEPT, YYERROR): New.
12233 * tests/calc.at: Renable the lalr1.cc test.
12234
12235 2003-02-19 Akim Demaille <akim@epita.fr>
12236
12237 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
12238 error recovery, mixing with/without pops and discarding of the
12239 lookahead.
12240 Exercise YYERROR.
12241 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
12242
12243 2003-02-17 Paul Eggert <eggert@twinsun.com>
12244
12245 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
12246 * tests/testsuite.at (AT_COMPILE): Use them.
12247 This fixes the testsuite problem reported by Robert Lentz in
12248 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
12249
12250 2003-02-12 Paul Eggert <eggert@twinsun.com>
12251
12252 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
12253 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
12254 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
12255 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
12256 Check for malloc failure, for consistency with yacc.c.
12257 (yytname_size): Remove, for consistency with yacc.c.
12258
12259 The bug still remains in data/lalr1.cc, as I didn't have time
12260 to fix it there.
12261
12262 2003-02-06 Akim Demaille <akim@epita.fr>
12263
12264 * configure.ac (GXX): Rename as...
12265 (CXX): this, to keep the original Autoconf semantics.
12266 Require 2.57.
12267 * data/lalr1.cc: Fix b4_copyright invocations.
12268 If YYDEBUG is not defined, don't depend upon name_ being defined.
12269 (location.hh): Include string and iostream.
12270 (Position::filename): New member.
12271 (Position::Position ()): New.
12272 (operator<< (Position)): New.
12273 (operator- (Position, int)): New.
12274 (Location::first, Location::last): Rename as...
12275 (Location::begin, Location::end): these, to mock the conventional
12276 iterator names.
12277 (operator<< (Location)): New.
12278 * tests/atlocal.in (CXX): New.
12279 * tests/testsuite.at (AT_COMPILE_CXX): New.
12280 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
12281 locations in a more synthetic way.
12282 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
12283 lalr1.cc is used.
12284 Adjust the C locations to match those from Emacs: first column is
12285 column 0.
12286 Change all the expected results.
12287 Conform to the GCS: simplify the locations when applicable.
12288 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
12289 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
12290 these CPP macros with the m4 macros new defined by...
12291 (AT_CHECK_PUSHDEFS): this, i.e.:
12292 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
12293 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
12294 New macros.
12295 (AT_CHECK_POPDEFS): Undefine them.
12296 (AT_CHECK_CALC_LALR1_CC): New.
12297 Use it for the first lalr1.cc test.
12298
12299 2003-02-04 Akim Demaille <akim@epita.fr>
12300
12301 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
12302 Location as is defined.
12303
12304 2003-02-04 Akim Demaille <akim@epita.fr>
12305
12306 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
12307 name_ being defined.
12308
12309 2003-02-03 Paul Eggert <eggert@twinsun.com>
12310
12311 * src/gram.h (start_symbol): Remove unused decl.
12312
12313 Use more-consistent naming conventions for local vars.
12314
12315 * src/derives.c (derives_compute): Change type of local var from
12316 int to rule_number.
12317 * src/gram.c (grammar_rules_partial_print): Likewise.
12318 * src/print.c (print_core): Likewise.
12319 * src/reduce.c (reduce_grammar_tables): Likewise.
12320
12321 * src/gram.c (grammar_dump): Change name of item_number *
12322 local var from r to rp.
12323 * src/nullable.c (nullable_compute): Likewise.
12324
12325 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
12326
12327 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
12328 for symbol or symbol_number var.
12329 * src/reader.c (grammar_start_symbol_set): Likewise.
12330 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
12331 Likewise.
12332 * src/state.c (transitions_to): Likewise.
12333 * src/state.h: Likewise.
12334 * src/tables.c (symbol_number_to_vector_number): Likewise.
12335
12336 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
12337 char * var.
12338
12339 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
12340 var.
12341
12342 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
12343 var.
12344
12345 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
12346 Use str, not s, for char * var. Use ch, not c, for character var.
12347 Use size for size var.
12348
12349 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
12350 char * var.
12351 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
12352 uniqstr var.
12353 * src/uniqstr.h: Likewise.
12354
12355 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
12356 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
12357 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
12358 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
12359 param to have same name as that of enum, so that we don't use
12360 "s" to stand for a non-state.
12361
12362 2003-02-02 Akim Demaille <akim@epita.fr>
12363
12364 * src/scan-skel.l: Scan more than one inert character per yylex
12365 invocation.
12366
12367 2003-02-01 Paul Eggert <eggert@twinsun.com>
12368
12369 Version 1.875a.
12370
12371 * po/LINGUAS: Add ms.
12372
12373 2003-01-30 Akim Demaille <akim@epita.fr>
12374
12375 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
12376
12377 2003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12378
12379 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
12380 of $1.
12381
12382 Changes in response to error report by S. Eken: GLR mode does not
12383 handle negative $ indices or $ indices in embedded rules correctly.
12384 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
12385
12386 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
12387 (b4_rhs_location): Ditto.
12388 (yyfill): New function to copy from stack tree into array
12389 incrementally.
12390 (yyuserAction): Modify to allow incremental move of semantic values
12391 to rhs array when in GLR mode.
12392 Define YYFILL to use in user-defined actions to fill semantic array
12393 as needed.
12394 Remove dummy use of yystack, as there is now a guaranteed use.
12395 (yydoAction): Modify to allow incremental move of semantic values
12396 to rhs array when in GLR mode.
12397 (yyresolveAction): Ditto.
12398 (yyglrShiftDefer): Update comment.
12399 (yyresolveStates): Use X == NULL for pointers, not !X.
12400 (yyglrReduce): Ditto.
12401 (yydoAction): Ditto
12402
12403 * tests/glr-regr1.at: Rename to ...
12404 * tests/glr-regression.at: Add new regression test for the problems
12405 described above (adapted from S. Eken).
12406 Update copyright notice.
12407 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
12408 * tests/Makefile.am: Ditto.
12409
12410 2003-01-28 Paul Eggert <eggert@twinsun.com>
12411
12412 * data/lalr1.cc: Do not use @output_header_name@ unless
12413 b4_defines_flag is set. This fixes two bugs reported by
12414 Tim Van Holder in
12415 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
12416 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
12417
12418 2003-01-21 Paul Eggert <eggert@twinsun.com>
12419
12420 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
12421 we don't need to worry about yyerrlab1 being reported as an
12422 "unused label" by non-GCC C compilers. The downside is that if
12423 locations are used then a couple of statements are duplicated each
12424 time YYERROR is invoked, but the upside is that the warnings
12425 should vanish.
12426 (yyerrlab1): Move code to YERROR.
12427 (yyerrlab2): Remove. Change uses back to yyerrlab1.
12428 This reverts some of the 2002-12-27 change.
12429
12430 2003-01-17 Paul Eggert <eggert@twinsun.com>
12431
12432 * src/output.c (symbol_printers_output): Fix typo that led
12433 to core dump. Problem reported by Antonio Rus in
12434 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
12435
12436 2003-01-13 Akim Demaille <akim@epita.fr>,
12437 Quoc Peyrot <chojin@lrde.epita.fr>,
12438 Robert Anisko <anisko_r@lrde.epita.fr>
12439
12440 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
12441 when the stacks contain one element, as the loop would otherwise
12442 free the last state, and then use the top state (the one we just
12443 popped). This means that the initial elements will not be freed
12444 explicitly, as is the case in yacc.c; it is not a problem, as
12445 these elements have fake values.
12446
12447 2003-01-11 Paul Eggert <eggert@twinsun.com>
12448
12449 * NEWS: %expect-violations are now just warnings, reverting
12450 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
12451 bootstrapping problem reported by Matthias Klose; see
12452 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
12453 * src/conflicts.c (conflicts_print): Likewise.
12454 * tests/conflicts.at (%expect not enough, %expect too much,
12455 %expect with reduce conflicts): Likewise.
12456 * doc/bison.texinfo (Expect Decl): Document this. Also mention
12457 that the warning is enabled if the number of conflicts changes
12458 (not necessarily increases).
12459
12460 * src/getargs.c (version): Update copyright year.
12461
12462 2003-01-09 Akim Demaille <akim@epita.fr>
12463
12464 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
12465
12466 2003-01-08 Paul Eggert <eggert@twinsun.com>
12467
12468 * Makefile.maint (WGETFLAGS):
12469 New macro, containing "-C off" to disable proxy caches.
12470 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
12471 (rel-check): Use $(WGET) instead of wget.
12472
12473 2003-01-06 Paul Eggert <eggert@twinsun.com>
12474
12475 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
12476 the GLR paper of Scott, Johnstone and Hussain.
12477
12478 2003-01-04 Paul Eggert <eggert@twinsun.com>
12479
12480 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
12481 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
12482 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
12483 (EXTRA_LIBRARIES): New var, for liby.a.
12484 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
12485 (EXTRA_SCRIPTS): New var, for yacc.
12486
12487 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
12488 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
12489 Problem reported by Nelson H. F. Beebe.
12490
12491 2003-01-03 Paul Eggert <eggert@twinsun.com>
12492
12493 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
12494 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
12495 when compiling Bison 1.875's `bitset bset = obstack_alloc
12496 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
12497
12498 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
12499 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
12500 grow to a huge size with typical invocation.
12501
12502 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
12503 Use the pattern recommended by Autoconf 2.57, except also protect
12504 against double-definition.
12505 * src/system.h: Likewise.
12506 Portability issues reported by Nelson H. F. Beebe.
12507
12508 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
12509 All uses changed. Provide a definition in both C and C++.
12510 (yytrue, yyfalse): Define even if defined (__cplusplus).
12511
12512 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
12513 Reported by Nelson H. F. Beebe.
12514
12515 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
12516
12517 2003-01-02 Paul Eggert <eggert@twinsun.com>
12518
12519 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
12520 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
12521 Bug reported by Nelson H. F. Beebe.
12522
12523 2003-01-01 Paul Eggert <eggert@twinsun.com>
12524
12525 * Version 1.875.
12526
12527 2002-12-30 Paul Eggert <eggert@twinsun.com>
12528
12529 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
12530 Moved here from...
12531 (<INITIAL>","): Here. This causes stray "," to be treated
12532 more uniformly.
12533
12534 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
12535 last brace in braced code when not in Yacc mode, for compatibility
12536 with Bison 1.35. This resurrects the 2001-12-15 patch to
12537 src/reader.c.
12538
12539 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
12540 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
12541
12542 2002-12-28 Paul Eggert <eggert@twinsun.com>
12543
12544 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
12545 that of SYM's type. This fixes Debian bug 168069, reported by
12546 Thomas Olsson.
12547
12548 2002-12-28 Paul Eggert <eggert@twinsun.com>
12549
12550 Version 1.75f.
12551
12552 Switch back to the Yacc style of conflict reports, undoing some
12553 of the 2002-07-30 change.
12554 * doc/bison.texinfo (Understanding): Use Yacc style for
12555 conflict reports. Also, use new way of locating rules.
12556 * src/conflicts.c (conflict_report):
12557 Renamed from conflict_report_yacc, removing the old
12558 'conflict_report'. Translate the entire conflict report at once,
12559 so that we don't assume that "," has the same interpretation in
12560 all languages.
12561 (conflicts_output): Use Yacc-style conflict report for each state,
12562 instead of our more-complicated style.
12563 (conflicts_print): Use Yacc-style conflict report, except print
12564 the input file name when not emulating Yacc.
12565 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
12566 Conflicted Reduction, %expect not enough, %expect too much,
12567 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
12568 * tests/existing.at (GNU Cim Grammar): Likewise.
12569 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
12570
12571 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
12572 fatal): Don't invoke fflush; it's not needed and it might even be
12573 harmful for stdout, as stdout might not be open.
12574 * src/reduce.c (reduce_print): Likewise.
12575
12576 2002-12-27 Paul Eggert <eggert@twinsun.com>
12577
12578 Fix a bug where error locations were not being recorded correctly.
12579 This problem was originally reported by Paul Hilfinger in
12580 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
12581
12582 * data/yacc.c (yyparse): New local var yylerrsp, to record the
12583 top of the location stack's error locations.
12584 (yyerrlab): Set it. When discarding a token, push its location
12585 onto yylerrsp so that we don't lose track of the error's end.
12586 (yyerrlab1): Now is only the target of YYERROR, so that we can
12587 properly record the location of the action that failed. For GCC
12588 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
12589 GCC warning about yyerrlab1 being unused if YYERROR is unused.
12590 (yyerrlab2): New label, which yyerrlab now falls through to.
12591 Compute the error's location by applying YYLLOC_DEFAULT to
12592 the locations of all the symbols that went into the error.
12593 * doc/bison.texinfo (Location Default Action): Mention that
12594 YYLLOC_DEFAULT is also invoked for syntax errors.
12595 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
12596 Error locations include the locations of all the tokens that were
12597 discarded, not just the last token.
12598
12599 2002-12-26 Paul Eggert <eggert@twinsun.com>
12600
12601 * src/files.c: Include quote.h.
12602 (compute_output_file_names): Warn if we detect conflicting
12603 outputs to the same file. This should catch the misunderstanding
12604 exemplified by Debian Bug 165349, reported by Bruce Stephens..
12605
12606 * src/conflicts.c (conflicts_print): If the user specifies
12607 "%expect N", report an error if there are any reduce/reduce
12608 conflicts. This is what the manual says should happen.
12609 This fixes Debian bug 130890, reported by Anthony DeRobertis.
12610 * tests/conflicts.at (%expect with reduce conflicts): New test.
12611
12612 Don't use m4_include on relative file names, as it doesn't work as
12613 desired if there happens to be a file with that name under ".".
12614
12615 * m4sugar/version.m4: Remove; it was included but it wasn't used.
12616 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
12617 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
12618 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
12619 * src/output.c (output_skeleton): Use full path names when
12620 specifying a file to include; don't rely on include path, as
12621 it's unreliable when the working file contains a file with
12622 that name.
12623
12624 2002-12-25 Paul Eggert <eggert@twinsun.com>
12625
12626 Remove obsolete references to bison.simple and bison.hairy.
12627 Problem mentioned by Aubin Mahe in
12628 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
12629 * data/glr.c: Comment fix.
12630 * doc/bison.1: Remove references. Also, mention "yacc".
12631
12632 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
12633 with -g option.
12634
12635 * src/parse-gram.y (declaration): Use enum "report_states" rather
12636 than its numeric value 1.
12637
12638 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
12639 opening a new one. This fixes Debian bug 165349, reported by
12640 Bruce Stephens.
12641
12642 2002-12-24 Paul Eggert <eggert@twinsun.com>
12643
12644 Version 1.75e.
12645
12646 * Makefile.maint (cvs-update): Don't assume that the shell
12647 supports $(...), as Solaris sh doesn't.
12648
12649 * src/parse-gram.y (lloc_default): Remove test for empty
12650 nonterminals at the end, since it didn't change the result.
12651
12652 2002-12-24 Paul Eggert <eggert@twinsun.com>
12653
12654 If the user does not define YYSTYPE as a macro, Bison now declares it
12655 using typedef instead of defining it as a macro. POSIX requires this.
12656 For consistency, YYLTYPE is also declared instead of defined.
12657
12658 %union directives can now have a tag before the `{', e.g., the
12659 directive `%union foo {...}' now generates the C code
12660 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
12661 The default union tag is `YYSTYPE', for compatibility with Solaris 9
12662 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
12663 instead of `yyltype'.
12664
12665 `yystype' and `yyltype' are now obsolescent macros instead of being
12666 typedefs or tags; they are no longer documented and will be
12667 withdrawn in a future release.
12668
12669 * data/glr.c (b4_location_type): Remove.
12670 (YYSTYPE): Renamed from yystype.
12671 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
12672 (struct YYLTYPE): Renamed from struct yyltype.
12673 (YYLTYPE): Renamed from yyltype.
12674 (yyltype, yystype): New (and obsolescent) macros,
12675 for backward compatibility.
12676 * data/yacc.c: Likewise.
12677
12678 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
12679 does not specify a union tag. This is for compatibility with
12680 Solaris 9 yacc.
12681
12682 * src/parse-gram.y (add_param): 2nd arg is now char * not char
12683 const *, since it is now modified by stripping surrounding { }.
12684 (current_braced_code): Remove.
12685 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
12686 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
12687 trailing " {...}". Now of type <chars>.
12688 (grammar_declaration): Adjust to bundled tokens.
12689 (code_content): Remove; stripping is now done by add_param.
12690 (print_token_value): Print contents of bundled tokens.
12691 (token_name): New function.
12692
12693 * src/reader.h (braced_code, current_braced_code): Remove.
12694 (token_name): New decl.
12695
12696 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
12697 token_type, not braced_code code_kind. All uses changed.
12698 (SC_PRE_CODE): New state, for scanning after a keyword that
12699 has (or usually has) an immediately-following braced code.
12700 (token_type): New local var, to keep track of which token type
12701 to return when scanning braced code.
12702 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
12703 <INITIAL>"%parse-param", <INITIAL>"%printer",
12704 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
12705 instead of returning a token type immediately.
12706 (<INITIAL>"{"): Set token type.
12707 (<SC_BRACED_CODE>"}"): Use it.
12708 (handle_action_dollar, handle_action_at): Now returns bool
12709 indicating success. Fail if ! current_rule; this prevents a core dump.
12710 (handle_symbol_code_dollar, handle_symbol_code_at):
12711 Remove; merge body into caller.
12712 (handle_dollar, handle_at): Complain in invalid contexts.
12713
12714 * NEWS, doc/bison.texinfo: Document the above.
12715 * NEWS: Fix years and program names in copyright notice.
12716
12717 2002-12-17 Paul Eggert <eggert@twinsun.com>
12718
12719 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
12720 Reporting, Table of Symbols): Omit mentions of %lex-param and
12721 %parse-param from the documentation for now.
12722
12723 2002-12-15 Paul Eggert <eggert@twinsun.com>
12724
12725 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
12726 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
12727 lookahead symbol, and which sets yychar in parser actions) and it
12728 disagreed with the Bison documentation. Bug
12729 reported by Andrew Walrond.
12730
12731 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
12732 as the caller now does that.
12733 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
12734 (YYEMPTY): Parenthesize right hand side, since others use it.
12735 (yyparse): Don't assume that our generated code is the only code
12736 that sets yychar.
12737
12738 2002-12-13 Paul Eggert <eggert@twinsun.com>
12739
12740 Version 1.75d.
12741
12742 POSIX requires a "yacc" command.
12743 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
12744 (MOSTLYCLEANFILES): Add yacc.
12745 (yacc): New rule.
12746 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
12747 as an alias for bison y.
12748
12749 * po/LINGUAS: Add da.
12750
12751 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
12752 problem with latest <getopt.h>.
12753 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
12754
12755 * doc/fdl.texi: Upgrade to 1.2.
12756 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
12757 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
12758 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
12759 gnulib.
12760 * config/install-sh: Sync with autotools.
12761
12762 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
12763 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
12764 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
12765 locations are requested.
12766 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
12767 locations are requested.
12768
12769 2002-12-12 Paul Eggert <eggert@twinsun.com>
12770
12771 Remove unportable casts and storage allocation tricks.
12772 While we're at it, remove almost all casts, since they
12773 usually aren't needed and are a sign of trouble.
12774
12775 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
12776
12777 * src/derives.c (derives_compute): Do not subtract NTOKENS from
12778 the pointer DSET returned by malloc; this isn't portable.
12779 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
12780 Similarly for DERIVES.
12781 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
12782 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
12783 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
12784
12785 * src/derives.c (derives_compute): Do not bother invoking
12786 int_of_rule_number, since rule numbers are integers.
12787
12788 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
12789 rather than XMALLOC (char, N).
12790
12791 * src/files.c (filename_split): Rewrite to avoid cast.
12792
12793 * src/gram.h (symbol_number_as_item_number,
12794 item_number_as_symbol_number, rule_number_as_item_number,
12795 item_number_as_rule_number):
12796 Now inline functions rather than macros, to avoid casts.
12797 * src/state.h (state_number_as_int): Likewise.
12798 * src/tables.c (state_number_to_vector_number,
12799 symbol_number_to_vector_number): Likewise.
12800
12801 * src/gram.h (int_of_rule_number): Remove; no longer used.
12802
12803 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
12804 since the resulting storage is always stored into.
12805
12806 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
12807 where it's needed.
12808
12809 * src/muscle_tab.c (muscle_m4_output):
12810 Now inline. Return bool, not int.
12811 * src/state.c (state_compare): Likewise.
12812 * src/symtab.c (symbol_check_defined,
12813 symbol_check_alias_consistency, symbol_pack, symbol_translation,
12814 hash_compare_symbol, hash_symbol):
12815 Likewise.
12816 * src/uniqstr.c (uniqstr_print): Likewise.
12817 * src/muscle_tab.c (muscle_m4_output_processor):
12818 New function, to avoid casts.
12819 * src/state.c (state_comparator, stage_hasher): Likewise.
12820 * src/symtab.c (symbol_check_defined_processor,
12821 symbol_check_alias_consistency_processor, symbol_pack_processor,
12822 symbol_translation_processor, hash_symbol_comparator,
12823 hash_symbol_hasher): Likewise.
12824 * src/uniqstr.c (uniqstr_print_processor): Likewise.
12825 * src/muscle_tab.c (muscles_m4_output):
12826 Use new functions instead of casting old functions unportably.
12827 * src/state.c (state_hash_new): Likewise.
12828 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
12829 symbols_token_translations_init):
12830 Likewise.
12831 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
12832
12833 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
12834 var instead of casting to long, to avoid casts.
12835 (prepare_states): Use MALLOC rather than alloca, so that we don't
12836 have to worry about alloca.
12837 * src/state.c (state_hash_lookup): Likewise.
12838
12839 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
12840 local var instead of casting to unsigned char, to avoid casts.
12841
12842 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
12843 STATE_ALLOC): Remove.
12844 (transitions_new, errs_new, reductions_new, state_new): Use malloc
12845 rather than calloc, and use offsetof to avoid allocating slightly
12846 too much storage.
12847 (state_new): Initialize all members.
12848
12849 * src/state.c (state_hash): Use unsigned accumulator, not signed.
12850
12851 * src/symtab.c (symbol_free): Remove; unused.
12852 (symbol_get): Remove cast in lhs of assignment.
12853 (symbols_do): Now static. Accept generic arguments, not
12854 hashing-related ones.
12855
12856 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
12857 (symbol_processor): Remove.
12858 (symbols_do): Remove decl; now static.
12859
12860 * src/system.h (alloca): Remove; decl no longer needed.
12861 (<stddef.h>): Include, for offsetof.
12862 (<inttypes.>, <stdint.h>): Include if available.
12863 (uintptr_t): New type, if system lacks it.
12864 (CALLOC, MALLOC, REALLOC): New macros.
12865 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
12866 new macros.
12867
12868 * src/tables.c (table_size): Now int, to pacify GCC.
12869 (table_grow, table_ninf_remap): Use signed table size.
12870 (save_row): Don't bother initializing locals when not needed.
12871 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
12872 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
12873
12874 * src/vcg.h: Correct misspellings.
12875
12876 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
12877
12878
12879 * src/getargs.c (getargs): Don't assume EOF == -1.
12880
12881 2002-12-09 Paul Eggert <eggert@twinsun.com>
12882
12883 Change identifier spellings to avoid collisions with names
12884 that are reserved by POSIX.
12885
12886 Don't use names ending in _t, since POSIX reserves them.
12887 For consistency, remove _e and _s endings -- they're weren't
12888 needed to remove ambiguity. All uses changed.
12889 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
12890 turn was just renamed from struniq_t.
12891 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
12892 which in turn was just renamed from struniq_processor_t.
12893 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
12894 in turn was renamed from hash_compare_struniq_t.
12895 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
12896 (state_list): Renamed from state_list_t.
12897 * src/assoc.h (assoc): Renamed from assoc_t.
12898 * src/conflicts.c (enum conflict_resolution): Renamed from
12899 enum conflict_resolution_e.
12900 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
12901 (rule_list): Renamed from rule_list_t.
12902 * src/getargs.h (enum trace): Renamed from enum trace_e.
12903 (enum report): Renamed from enum report_e.
12904 * src/gram.h (item_number): Renamed from item_number_t.
12905 (rule_number): Renamed from rule_number_t.
12906 (struct rule_s): Remove the "rule_s" part; not used.
12907 (rule): Renamed from rule_t.
12908 (rule_filter): Renamed from rule_filter_t.
12909 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
12910 (goto_list): Renamed from goto_list_t.
12911 * src/lalr.h (goto_number): Renamed from goto_number_t.
12912 * src/location.h (location): Renamed from location_t.
12913 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
12914 and moved here from:
12915 * src/muscle_tab.h (muscle_entry_t): here.
12916 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
12917 (rule_list): Renamed from rule_list_t.
12918 * src/print_graph.c (static_graph): Renamed from graph.
12919 * src/reader.h (braced_code): Renamed from braced_code_t.
12920 Remove brace_code_e tag.
12921 * src/relation.h (relation_node): Renamed from relation_node_t.
12922 (relation_nodes): Renamed from relation_nodes_t.
12923 (relation): Renamed from relation_t.
12924 * src/state.h (state_number): Renamed from state_number_t.
12925 (struct state): Renamed from struct state_s.
12926 (state): Renamed from state_t.
12927 (transitions): Renamed from transitions_t. Unused (and
12928 misspelled) transtion_s tag removed.
12929 (errs): Renamed from errs_t. Unused errs_s tag removed.
12930 (reductions): Renamed from reductions_t. Unused tag
12931 reductions_s removed.
12932 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
12933 (struct symbol_list): Renamed from struct symbol_list_s.
12934 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
12935 (struct symbol): Renamed from struct symbol_s.
12936 (symbol): Renamed from symbol_t.
12937 * src/tables.c (vector_number): Renamed from vector_number_t.
12938 (action_number): Renamed from action_t.
12939 * src/tables.h (base_number): Renamed from base_t.
12940 * src/vcg.h (enum color): Renamed from enum color_e.
12941 (enum textmode): Renamed from enum textmode_e.
12942 (enum shape): Renamed from enum shape_e.
12943 (struct colorentry): Renamed from struct colorentry_s.
12944 (struct classname): Renamed from struct classname_s.
12945 (struct infoname): Renamed from struct infoname_s.
12946 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
12947 (enum decision): Renamed from enum decision_e.
12948 (enum orientation): Renamed from enum orientation_e.
12949 (enum alignment): Renamed from enum alignment_e.
12950 (enum arrow_mode): Renamed from enum arrow_mode_e.
12951 (enum crossing_type): Renamed from enum crossing_type_e.
12952 (enum view): Renamed from enum view_e.
12953 (struct node): Renamed from struct node_s.
12954 (node): Renamed from node_t.
12955 (enum linestyle): Renamed from enum linestyle_e.
12956 (enum arrowstyle): Renamed from enum arrowstyle_e.
12957 (struct edge): Renamed from struct edge.
12958 (edge): Renamed from edge_t.
12959 (struct graph): Renamed from struct graph_s.
12960 (graph): Renamed from graph_t.
12961 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
12962 Rename value_t -> value.
12963 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
12964 value_t_as_yystype -> value_as_yystype.
12965
12966 Don't include <errno.h> in the mainstream code, since it
12967 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
12968 * lib/get-errno.c, lib/get-errno.h: New files.
12969 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
12970 get-errno.c.
12971 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
12972 * src/output.c (output_skeleton): Likewise.
12973 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
12974 instead of errno.
12975 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
12976 Likewise.
12977 (handle_action_dollar, handle_action_at): Likewise.
12978 * src/system.h: Do not include <errno.h>.
12979 (TAB_EXT): Renamed from EXT_TAB.
12980 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
12981
12982 Avoid str[a-z]*, since <string.h> reserves that name space.
12983 Change all instances of "struniq" in names to "uniqstr", and
12984 likewise for "STRUNIQ" and "UNIQSTR".
12985 * src/uniqstr.c: Renamed from src/struniq.c.
12986 * src/uniqstr.h: Renamed from src/struniq.h.
12987 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
12988 * src/files.c (strsuffix): Remove; unused.
12989 (concat2): Renamed from stringappend. Now static.
12990 * src/files.h (strsuffix, stringappend): Remove; unused.
12991 * src/parse-gram.y (<chars>): Renamed from <string>.
12992 (<uniqstr>): Renamed from <struniq>.
12993 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
12994 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
12995 (struct graph_s.expand): Renamed from struct graph_s.stretch.
12996 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
12997 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
12998 (N_EXPAND): Renamed from N_STRETCH.
12999
13000 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
13001 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
13002 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
13003 Remove; unused.
13004 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
13005 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
13006 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
13007 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
13008 (BASE_MAXIMUM): Renamed from BASE_MAX.
13009 (BASE_MINIMUM): Renamed from BASE_MIN.
13010 (ACTION_MAX): Remove; unused.
13011 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
13012 Unnecessary casts removed from above defines.
13013
13014
13015 Fix misspelling in names.
13016 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
13017 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
13018 G_NODE_ALIGNEMENT.
13019
13020
13021 * lib/timevar.c (timevar_report): Renamed from time_report,
13022 for consistency with other names.
13023 * lib/timevar.h (timevar_report): New decl.
13024 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
13025
13026
13027 Sort include-file uses.
13028
13029 Reorder all include files under src to be in the order "system.h".
13030 then the ../lib include files in angle brackets (alphabetized),
13031 then the . include files in double-quotes (alphabetized). Fix
13032 dependency breakages encountered in this process, as follows:
13033 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
13034 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
13035 * src/state.h: Include "symtab.h".
13036
13037 2002-12-08 Paul Eggert <eggert@twinsun.com>
13038
13039 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
13040 since this causes problems when __file__ contains character
13041 sequences like "@" that are treated specially by src/scan-skel.l.
13042 Instead, just use the file's basename. This fixes the bug
13043 reported by Martin Mokrejs in
13044 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
13045
13046 2002-12-06 Paul Eggert <eggert@twinsun.com>
13047
13048 Add support for rules that do not have trailing semicolons, as
13049 POSIX requires. Improve the quality of locations in Bison
13050 diagnostics.
13051
13052 * src/location.c: Include <quotearg.h>.
13053 (empty_location): Now const.
13054 (location_print): New function. Follow the recommendation of the
13055 GNU Coding Standards for locations that span file boundaries.
13056 * src/location.h: Do not include <quotearg.h>; no longer needed.
13057 (boundary): New type.
13058 (location_t): Use it. This allows locations to span file boundaries.
13059 All member uses changed: file -> start.file or end.file (as needed),
13060 first_line -> start.line, first_column -> start.column,
13061 last_line -> end.line, last_column -> end.column.
13062 (equal_boundaries): New function.
13063 (LOCATION_RESET, LOCATION_STEP): Remove.
13064 (LOCATION_PRINT): Remove. All callers changed to use location_print.
13065 (empty_location): Now const.
13066 (location_print): New decl.
13067 * src/parse-gram.y (lloc_default): New function, which handles
13068 empty locations more accurately.
13069 (YYLLOC_DEFAULT): Use it.
13070 (%token COLON): Remove.
13071 (%token ID_COLON): New token.
13072 (rules): Use it.
13073 (declarations, rules): Remove trailing semicolon.
13074 (declaration, rules_or_grammar_declaration):
13075 Allow empty (";") declaration.
13076 (symbol_def): Remove empty actions; no longer needed.
13077 (rules_or_grammar_declaration): Remove trailing semicolon.
13078 (semi_colon.opt): Remove.
13079 * src/reader.h: Include location.h.
13080 (scanner_cursor): New decl.
13081 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
13082 rolling our own.
13083 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
13084 of *loc.
13085 (STEP): Remove. No longer needed, now that adjust_location does
13086 the work. All uses removed.
13087 (scanner_cursor): New var.
13088 (adjust_location): Renamed from extend_location. It now sets
13089 *loc and adjusts the scanner cursor. All uses changed.
13090 Don't bother testing for CR.
13091 (handle_syncline): Remove location arg; now updates scanner cursor.
13092 All callers changed.
13093 (unexpected_end_of_file): Now accepts start boundary of token or
13094 comment, not location. All callers changed. Update scanner cursor,
13095 not the location.
13096 (SC_AFTER_IDENTIFIER): New state.
13097 (context_state): Renamed from c_context. All uses changed.
13098 (id_loc, code_start, token_start): New local vars.
13099 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
13100 processing of Yacc white space and equivalents here.
13101 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
13102 instead of returning ID immediately, since we need to search for
13103 a subsequent colon.
13104 (<INITIAL>"'", "\""): Save token_start.
13105 (<INITIAL>"%{", "{", "%%"): Save code_start.
13106 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
13107 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
13108 BEGIN context_state at end, not INITIAL.
13109 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
13110 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
13111 Return correct token start.
13112 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
13113 the start of a character, string or multiline comment is found.
13114 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
13115 Reduction): Adjust reported locations to match the more-precise
13116 results now expected.
13117 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
13118 * tests/reduce.at (Useless Rules, Reduced Automaton,
13119 Underivable Rules): Likewise.
13120 * tests/regression.at (Invalid inputs): No longer `expecting ";"
13121 or "|"' now that so many other tokens are allowed by the new grammar.
13122
13123 * src/complain.h (current_file): Remove duplicate decl;
13124 current_file is now owned by files.h.
13125 * src/complain.c, src/scan-gram.l: Include files.h.
13126
13127 2002-12-06 Paul Eggert <eggert@twinsun.com>
13128
13129 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
13130 promotes to int; it might be unsigned int.
13131 * data/yacc.c (yy_reduce_print): Likewise.
13132
13133 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
13134 be #defined in the prologue, not in the Bison declarations.
13135 This fixes Debian Bug 102878, reported by Shaul Karl.
13136
13137 2002-12-02 Paul Eggert <eggert@twinsun.com>
13138
13139 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
13140 * lib/strtoul.c: New file, from gnulib.
13141 This fixes a porting bug reported by Peter Klein in
13142 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
13143
13144 2002-11-30 Paul Eggert <eggert@twinsun.com>
13145
13146 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
13147 and put only a forward declaration in the prologue. This is for
13148 consistency with the other scanner helper functions.
13149
13150 Type clashes now generate warnings, not errors, since it
13151 appears that POSIX may allow some grammars with type clashes.
13152 * src/reader.c (grammar_current_rule_check): Warn about
13153 type clashes instead of complaining.
13154 * tests/input.at (Type Clashes): Expect warnings, not complaints.
13155
13156 Add Yacc library, since POSIX requires it.
13157 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
13158 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
13159 * lib/main.c, lib/yyerror.c: New files.
13160
13161 gram_error can be static; it need not be extern.
13162 * src/reader.h (gram_error): Remove decl.
13163 * src/parse-gram.y (gram_error): Now static. Add static decl.
13164 (print_token_value): Omit parameter names from forward decl,
13165 for consistency.
13166
13167 2002-11-29 Paul Eggert <eggert@twinsun.com>
13168
13169 * doc/bison.texinfo: Emphasize that yylex and yyerror must
13170 be declared before being used. E.g., one should typically
13171 declare them in the prologue. Use GNU coding style in examples.
13172 Put "const" consistently after the type it modifies. Mention
13173 that C99 supports "inline". Mention that yyerror traditionally
13174 returns "int".
13175
13176 %parse-param and %lex-param now take just one argument, the
13177 declaration; the argument name is deduced from the declaration.
13178
13179 * doc/bison.texinfo (Parser Function, Pure Calling, Error
13180 Reporting, Table of Symbols): Document this.
13181 * src/parse-gram.y (add_param): New function.
13182 (COMMA): Remove.
13183 (declaration): Implement new rule for %parse-param and %lex-param.
13184 * src/scan-gram.l: "," now elicits a warning, rather than being
13185 a token; this is more compatible with byacc.
13186 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
13187
13188 2002-11-27 Paul Eggert <eggert@twinsun.com>
13189
13190 Rename identifiers to avoid real and potential collisions.
13191
13192 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
13193 to avoid collision with lex macro described by Bruce Lilly in
13194 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
13195 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
13196 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
13197 * src/parse-gram.y (print_token_value): Renamed from yyprint.
13198 All uses changed.
13199 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
13200 The name "yycontrol" violates the name space rules, and this stuff
13201 wasn't being used anyway.
13202 (input): Remove action; this stuff wasn't being used.
13203 (gram_error): Rename local variable yylloc -> loc.
13204 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
13205 (YY_DECL): Don't use "yy" at start of local variables.
13206 All uses changed, e.g., yylloc -> loc.
13207 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
13208 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
13209 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
13210 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
13211
13212 * src/parse-gram.y (gram_error): loc is now const *.
13213 * src/reader.h (gram_error): Likewise.
13214
13215 2002-11-24 Paul Eggert <eggert@twinsun.com>
13216
13217 Version 1.75c.
13218
13219 * tests/actions.at (Actions after errors): Use an output format
13220 more similar to that of the Printers and Destructors test.
13221 Test the position of the ';' token too.
13222 (Printers and Destructors): Likewise.
13223 (Printers and Destructors: %glr-parser): Remove for now, to avoid
13224 unnecessarily alarming people when the test fails.
13225
13226 * data/yacc.c (yyerrlab1): Move this label down, so that the
13227 parser does not discard the lookahead token if the user code
13228 invokes YYERROR. This change is required for POSIX conformance.
13229
13230 * lib/error.c: Sync with gnulib.
13231
13232 2002-11-22 Paul Eggert <eggert@twinsun.com>
13233
13234 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
13235 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
13236 * lib/xmalloc.c: Likewise.
13237
13238 2002-11-20 Paul Eggert <eggert@twinsun.com>
13239
13240 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
13241
13242 2002-11-20 Paul Eggert <eggert@twinsun.com>
13243
13244 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
13245 should use `if (! x) abort ();' rather than `assert (x);', and
13246 anyway it's one less thing to worry about configuring.
13247
13248 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
13249 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
13250 and replace all instances of assert with abort.
13251 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
13252 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
13253
13254 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
13255 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
13256 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
13257 hash_find_entry, hash_rehash, hash_insert): Likewise.
13258 * src/conflicts.c (resolve_sr_conflict): Likewise.
13259 * src/lalr.c (set_goto_map, map_goto): Likewise.
13260 * src/nullable.c (nullable_compute): Likewise.
13261 * src/output.c (prepare_rules, token_definitions_output): Likewise.
13262 * src/reader.c (packgram, reader): Likewise.
13263 * src/state.c (state_new, state_free, state_transitions_set,
13264 state_reduction_find): Likewise.
13265 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
13266 symbol_pack): Likewise.
13267 * src/tables.c (conflict_row, pack_vector): Likewise.
13268 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
13269 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
13270 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
13271 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
13272
13273 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
13274 (ARGMATCH_CONSTRAINT): New macro.
13275 (ARGMATCH_ASSERT): Use it.
13276
13277 * src/system.h (verify): New macro.
13278 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
13279 rather than assert.
13280 * src/tables.c (tables_generate): Likewise.
13281
13282 * src/struniq.c (struniq_assert): Now returns void, and aborts
13283 if the assertion is false.
13284 (struniq_assert_p): Remove.
13285 * src/struniq.h: Likewise.
13286
13287 2002-11-18 Paul Eggert <eggert@twinsun.com>
13288
13289 * data/glr.c (yygetLRActions): Replace `yyindex' with
13290 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
13291 This fixes the regression with Sun ONE Studio 7 cc that I reported in
13292 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
13293
13294 2002-11-18 Akim Demaille <akim@epita.fr>
13295
13296 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
13297 space.
13298 From Tim Van Holder.
13299
13300 2002-11-17 Paul Eggert <eggert@twinsun.com>
13301
13302 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
13303 to "SyntaxError" for consistency with my 2002-11-15 change.
13304
13305 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
13306 not define to {}, since this breaks the common use of `YYDPRINTF
13307 ((...));' if a single statement is desired (e.g. before `else').
13308 Work around GCC warnings by surrounding corresponding calls with
13309 {} if needed.
13310 (yyhasResolvedValue): Remove unused function.
13311 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
13312 loop body.
13313 (yyreportSyntaxError): Renamed from yyreportParseError.
13314 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
13315 All uses changed.
13316 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
13317 extern when possible. Remove unused initializations.
13318
13319 2002-11-16 Akim Demaille <akim@epita.fr>
13320
13321 Augment the similarity between GLR and LALR traces.
13322
13323 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
13324 (YY_REDUCE_PRINT): New.
13325 (yyparse): Use them.
13326 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
13327 YYDPRINT here.
13328 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
13329 state reached after the reduction/recovery, since...
13330 (yyparse, yyprocessOneStack): Report the state we are entering in.
13331
13332 2002-11-16 Akim Demaille <akim@epita.fr>
13333
13334 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
13335 Add support for --trace=skeleton.
13336 * src/scan-skel.l: %option debug.
13337 Scan strings of non-@ or \n instead of character by character.
13338 (scan_skel): Handle trace_skeleton.
13339 (QPUTS): New.
13340 (@output_parser_name@, @output_header_name@): ``Restore'' their
13341 support (used to be M4 macros).
13342 * data/yacc.c: Quote larger chunks, a la glr.c.
13343 * data/lalr1.cc: Likewise.
13344 The header guards are no longer available, so use some other
13345 string than `YYLSP_NEEDED'.
13346
13347 2002-11-16 Akim Demaille <akim@epita.fr>
13348
13349 Make the ``Printers and Destructors'' test more verbose, taking
13350 `yacc.c''s behavior as (possibly wrong) reference.
13351
13352 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
13353 instead of fprint on stdout.
13354 Set and report the last_line of the symbols.
13355 Consistently display values and locations.
13356
13357 2002-11-16 Paul Eggert <eggert@twinsun.com>
13358
13359 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
13360
13361 2002-11-15 Paul Eggert <eggert@twinsun.com>
13362
13363 * tests/actions.at (Actions after errors): New test case.
13364
13365 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
13366 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
13367 tests/action.at, tests/calc.at, tests/conflicts.at,
13368 tests/cxx-type.at, tests/regression.at:
13369 "parse error" -> "syntax error" for POSIX compatibility.
13370 "parsing stack overflow..." -> "parser stack overflow" so
13371 that code matches Bison documentation.
13372
13373 2002-11-15 Akim Demaille <akim@epita.fr>
13374
13375 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
13376 take two BRACED_CODE, not two string_content.
13377 Free the scanner's obstack when we are done.
13378 (code_content): New.
13379 * tests/calc.at: Adjust.
13380 * doc/bison.texinfo: Adjust.
13381 Also, make sure to include the `,' for these declarations.
13382
13383 2002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
13384
13385 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
13386 definition; avoids potential autoreconf problems.
13387
13388 2002-11-15 Akim Demaille <akim@epita.fr>
13389
13390 Always check the value returned by yyparse.
13391
13392 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
13393 returned by yyparse.
13394 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
13395 Adjust calls.
13396 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
13397 returned by yyparse.
13398
13399 2002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13400
13401 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
13402 on input.at test.
13403
13404 2002-11-14 Paul Eggert <eggert@twinsun.com>
13405
13406 * src/output.c (output_skeleton): Call xfopen instead of
13407 duplicating xfopen's body.
13408
13409 Fix bugs reported by Nelson H. F. Beebe in
13410 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
13411
13412 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
13413 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
13414 Group compiler. Instead, use "$CC -E bar.c". Include the .h
13415 file twice in the grammar, as an extra check.
13416
13417 * tests/input.at (Torturing the Scanner): Surround the
13418 backslash-newline tests with "#if 0", to make it less likely that
13419 we'll run into compiler bugs. Bring back solitary \ inside
13420 comment, but add a closing comment to work around HP C bug. Don't
13421 test backslash-newline in C character constant.
13422
13423 2002-11-14 Akim Demaille <akim@epita.fr>
13424
13425 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
13426 status of the compiler.
13427 Calling `exit 1' is no longer needed.
13428 Reported by Nelson H. F. Beebe.
13429
13430 2002-11-14 Akim Demaille <akim@epita.fr>
13431
13432 * tests/atlocal.in (CPPFLAGS): We have config.h.
13433 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
13434 New.
13435 * tests/actions.at, tests/calc.at, tests/conflicts.at,
13436 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
13437 * tests/regression.at, tests/torture.at: Use them for all the
13438 grammars that are to be compiled.
13439 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
13440 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
13441 * doc/bison.texinfo (GLR Parsers): Document `inline'.
13442
13443 2002-11-14 Akim Demaille <akim@epita.fr>
13444
13445 * doc/bison.texinfo: Various formatting changes (alignments in
13446 samples, additional @group/@end group, GCS in samples.
13447 Use @deffn instead of simple @table to define the directives,
13448 macros, variables etc.
13449
13450 2002-11-13 Paul Eggert <eggert@twinsun.com>
13451
13452 Fix some bugs reported by Albert Chin-A-Young in
13453 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
13454
13455 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
13456 -o c"; the HP C compiler chatters during compilation.
13457 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
13458 * tests/headers.at (export YYLTYPE): Likewise.
13459
13460 * tests/input.at (Torturing the Scanner): Remove lines containing
13461 solitary backslashes, as they tickle a bug in the HP C compiler.
13462
13463 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
13464 comments, since they're not portable. Use GNU coding style.
13465
13466 2002-11-13 Akim Demaille <akim@epita.fr>
13467
13468 * data/yacc.c: Leave bigger chunks of quoted text.
13469 (YYDSYMPRINTF): New.
13470 Use it to report symbol activities.
13471 * data/glr.c (YYDSYMPRINTF): New.
13472 Use it.
13473
13474 2002-11-12 Paul Eggert <eggert@twinsun.com>
13475
13476 Version 1.75b.
13477
13478 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
13479 (yyglrReduce): Return yyok, not 0.
13480 This should avoid the enumerated-type warnings reported
13481 by Nelson H. F. Beebe in
13482 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
13483
13484 * lib/bbitset.h (BITSET_INLINE): Remove.
13485 * lib/bitset.h [! BITSET_INLINE]: Remove.
13486 (bitset_set, bitset_reset, bitset_test): Rename local vars
13487 to avoid shadowing warnings by GCC.
13488
13489 * data/glr.c (inline): Remove #define. It's the user's
13490 responsibility to #define it away, just like 'const'.
13491 This fixes one of the bugs reported by Nelson H. F. Beebe in
13492 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
13493
13494 * Makefile.maint (po-check): Scan .l and .y files instead of the
13495 .c and the .h files that they generate. This fixes the bug
13496 reported by Tim Van Holder in:
13497 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
13498 Look for N_ as well as for _. Try to avoid matching #define for
13499 N_ and _.
13500 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
13501 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
13502 * src/scan-gram.l: Revamp regular expressions so that " and '
13503 do not confuse xgettext.
13504
13505 * src/struniq.h (struniq_new): Do not declare the return type
13506 to be 'const'; this violates the C standard.
13507 * src/struniq.c (struniq_new): Likewise.
13508
13509 2002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
13510
13511 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
13512 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
13513 linker.
13514
13515 2002-11-12 Akim Demaille <akim@epita.fr>
13516
13517 * Makefile.maint: Sync with Autoconf:
13518 (local_updates): New.
13519
13520 2002-11-12 Akim Demaille <akim@epita.fr>
13521
13522 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
13523
13524 2002-11-12 Akim Demaille <akim@epita.fr>
13525
13526 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
13527 locations.
13528
13529 2002-11-12 Akim Demaille <akim@epita.fr>
13530
13531 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
13532 not yyvalue.
13533
13534 2002-11-12 Akim Demaille <akim@epita.fr>
13535
13536 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
13537 Use it to test the GLR parser.
13538
13539 2002-11-12 Akim Demaille <akim@epita.fr>
13540
13541 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
13542 defines it.
13543 * data/glr.c (yystos): New.
13544 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
13545 (YYDSYMPRINT): New.
13546 (yyval): Don't define it, it is handled via M4.
13547 (yyrecoverParseError): Free verbosely the discarded symbols.
13548 * data/yacc.c (yysymprint): Remove, rather...
13549 (b4_yysymprint_generate): invoke.
13550 * data/c.m4 (b4_yysymprint_generate): New.
13551 Accept pointers as arguments, as opposed to the version from
13552 yacc.c.
13553 (b4_yydestruct_generate): Likewise.
13554 * tests/cations.at (Printers and Destructors): Use Bison directives
13555 instead of CPP macros.
13556 Don't rely on internal details.
13557
13558 2002-11-12 Akim Demaille <akim@epita.fr>
13559
13560 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
13561 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
13562 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
13563 it against YYEMPTY and so forth), work on yytoken (i.e., set
13564 it to YYEMPTY etc.).
13565 (yydestruct): Replace with a b4_yydestruct_generate invocation.
13566 (b4_symbol_actions): Remove.
13567 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
13568 for 0, end-of-input.
13569
13570 2002-11-12 Akim Demaille <akim@epita.fr>
13571
13572 * doc/bison.texinfo (Destructor Decl): New.
13573
13574 2002-11-12 Akim Demaille <akim@epita.fr>
13575
13576 * src/tables.c (tables_generate): Use free for pointers that
13577 cannot be NULL, not XFREE.
13578 (pack_vector): Use assert, not fatal, for bound violations.
13579 * src/state.c (state_new): Likewise.
13580 * src/reader.c (reader): Likewise.
13581 * src/lalr.c (set_goto_map): Likewise.
13582 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
13583 the file name.
13584
13585 2002-11-12 Akim Demaille <akim@epita.fr>
13586
13587 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
13588 Restore.
13589 * src/scan-gram.l (last_string): Is global to the file, not to
13590 yylex.
13591 * src/parse-gram.y (input): Don't append the epilogue here,
13592 (epilogue.opt): do it here, and free the scanner's obstack.
13593 * src/reader.c (epilogue_set): Rename as...
13594 (epilogue_augment): this.
13595 * data/c.m4 (b4_epilogue): Defaults to empty.
13596
13597 2002-11-12 Akim Demaille <akim@epita.fr>
13598
13599 * src/getargs.c (long_options): Remove duplicates.
13600 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
13601 Remove.
13602 * doc/bison.rnh: Remove.
13603 * doc/bison.texinfo (VMS Invocation): Remove.
13604
13605 2002-11-12 Akim Demaille <akim@epita.fr>
13606
13607 * src/struniq.h, src/struniq.c (struniq_t): Is const.
13608 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
13609
13610 Use struniq for symbols.
13611
13612 * src/symtab.h (symbol_t): The tag member is a struniq.
13613 (symbol_type_set): Adjust.
13614 * src/symtab.c (symbol_new): Takes a struniq.
13615 (symbol_free): Don't free the tag member.
13616 (hash_compare_symbol_t, hash_symbol_t): Rename as...
13617 (hash_compare_symbol, hash_symbol): these.
13618 Use the fact that tags as struniqs.
13619 (symbol_get): Use struniq_new.
13620 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
13621 Returns a strniq.
13622 * src/reader.h (merger_list, grammar_currentmerge_set): The name
13623 and type members are struniqs.
13624 * src/reader.c (get_merge_function)
13625 (grammar_current_rule_merge_set): Adjust.
13626 (TYPE, current_type): Are struniq.
13627
13628 Use struniq for file names.
13629
13630 * src/files.h, src/files.c (infile): Split into...
13631 (grammar_file, current_file): these.
13632 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
13633 * src/reduce.c (reduce_print): Likewise.
13634 * src/getargs.c (getargs): Likewise.
13635 * src/complain.h, src/complain.c: Likewise.
13636 * src/main.c (main): Call struniqs_new early enough to use it for
13637 file names.
13638 Don't free the input file name.
13639
13640 2002-11-12 Akim Demaille <akim@epita.fr>
13641
13642 * src/symtab.c (symbol_free): Remove dead deactivated code:
13643 type_name are properly removed.
13644 Don't use XFREE to free items that cannot be NULL.
13645 * src/struniq.h, src/struniq.c: New.
13646 * src/main.c (main): Initialize/free struniqs.
13647 * src/parse-gram.y (%union): Add astruniq member.
13648 (yyprint): Adjust.
13649 * src/scan-gram.l (<{tag}>): Return a struniq.
13650 Free the obstack bit that used to store it.
13651 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
13652
13653 2002-11-11 Paul Eggert <eggert@twinsun.com>
13654
13655 Revamp to fix many (but not all) of the C- and M4-related quoting
13656 problems. Among other things, this fixes the Bison bug reported
13657 by Jan Hubicka when processing the Bash grammar; see:
13658 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
13659
13660 Use new @ escapes consistently. Represent brackets with @{ and @}
13661 rather than @<:@ and @:>@, since this works a bit better with dumb
13662 editors like vi. Represent @ with @@, since @ is now consistently
13663 an escape. Use @oline@ and @ofile@ rather than __oline__ and
13664 __ofile__, to avoid unexpected expansions. Similarly, use @output
13665 rather than #output.
13666
13667 * data/c.m4 (b4_copyright): Omit file name from comment, since
13668 the file name could contain "*/".
13669 (b4_synclines_flag): Don't quote the 2nd argument; it should already
13670 be quoted. All uses changed.
13671
13672 * data/glr.c: Use new @ escapes consistently.
13673 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
13674 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
13675 Remove, since they couldn't handle arbitrary characters in file
13676 names.
13677 * data/lalr1.cc: Likewise.
13678 * data/yacc.c: Likewise.
13679
13680 * src/files.c (output_infix): Remove; all uses removed.
13681 * src/files.h: Likewise.
13682
13683 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
13684 mishandled funny characters in file names, and anyway it isn't
13685 needed any more.
13686 * data/yacc.c: Likewise.
13687 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
13688
13689 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
13690 * data/yacc.c: Likewise.
13691
13692 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
13693 strings now.
13694 (muscle_init): Quote filename as a C string.
13695 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
13696 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
13697 * src/output.c (escaped_file_name_output): New function.
13698 (prepare_symbols): Quote tokens for M4.
13699 (prepare): Don't insert output_infix, output_prefix,
13700 output_parser_name, output_header_name; this is now down by scan-skel.
13701 Insert skeleton as a C string.
13702
13703 * src/output.c (user_actions_output, symbol_destructors_output,
13704 symbol_printers_output): Quote filenames for C and M4.
13705 * src/reader.c (prologue_augment, epilogue_set): Likewise.
13706
13707 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
13708 escapes other than \\ and \'; this simplifies the code.
13709 (<SC_STRING>): Likewise, for \\ and \".
13710 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
13711 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
13712 Use new escapes @{ and @} for [ and ].
13713
13714 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
13715 them with auto vars.
13716 Switch to new escape scheme, where @ is the escape character uniformly.
13717 Abort if a stray escape character is found. Avoid unbounded input
13718 buffer when parsing non-escaped text.
13719
13720 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
13721 __oline__, #output, $@, and @{ do not have unintended meanings.
13722
13723 2002-11-09 Paul Eggert <eggert@twinsun.com>
13724
13725 Fix the test failure due to GCC warnings described in
13726 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
13727 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
13728 evaluate to 0 if it's impossible for NINF to be in the respective
13729 table.
13730 (yygetLRActions, yyrecoverParseError): Use them.
13731
13732 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
13733 counted in the token inserted at end of file. Now takes
13734 location_t *, not location_t, so that the location can be
13735 adjusted. All uses changed.
13736
13737 * tests/regression.at (Invalid inputs): Adjust wording in
13738 diagnostic to match the new behavior.
13739
13740 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
13741 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
13742 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
13743 abort ();'. This reduces the runtime of the "Many lookaheads"
13744 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
13745 GCC 3.2.
13746
13747 2002-11-07 Paul Eggert <eggert@twinsun.com>
13748
13749 * src/parse-gram.y (CHARACTER): Remove unused token.
13750 All uses removed.
13751
13752 * src/scan-gram.l: Remove stack option. We no longer use the
13753 stack, since the stack was never deeper than 1; instead, use the
13754 new auto var c_context to record the stacked value.
13755
13756 Remove nounput option. At an unexpected end of file, we now unput
13757 the minimal input necessary to end cleanly; this simplifies the
13758 code.
13759
13760 Avoid unbounded token sizes where this is easy.
13761
13762 (unexpected_end_of_file): New function.
13763 Use it to systematize the error message on unexpected EOF.
13764 (last-string): Now auto, not static.
13765 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
13766 (scanner_last_string_free): Remove; not used.
13767 (percent_percent_count): Move decl to just before use.
13768 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
13769 not the (never otherwised-used) CHARACTER.
13770
13771 2002-11-07 Akim Demaille <akim@epita.fr>
13772
13773 Let yyerror always receive the msg as last argument, so that
13774 yyerror can be variadic.
13775
13776 * data/yacc.c (b4_yyerror_args): New.
13777 Use it when calling yyerror.
13778 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
13779 Use it when calling yyerror.
13780 * doc/bison.texinfo (Error Reporting): Adjust.
13781 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
13782 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
13783
13784 2002-11-06 Akim Demaille <akim@epita.fr>
13785
13786 #line should have quoted strings.
13787 Ideally, this should be done by m4_quotearg.
13788
13789 * src/scan-skel.l: Include quotearg.h.
13790 Quote __ofile__.
13791 * src/output.c (symbol_printers_output)
13792 (symbol_destructors_output): Quote the file name.
13793
13794 2002-11-06 Akim Demaille <akim@epita.fr>
13795
13796 * tests/regression.at (Invalid inputs): Adjust to the recent
13797 messages.
13798
13799 2002-11-06 Akim Demaille <akim@epita.fr>
13800
13801 Restore --no-lines.
13802 Reported by Jim Kent.
13803
13804 * data/c.m4 (b4_syncline): New.
13805 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
13806 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
13807 * src/output.c (user_actions_output): Likewise.
13808 (prepare): Define 'b4_synclines_flag'.
13809 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
13810
13811 2002-11-06 Akim Demaille <akim@epita.fr>
13812
13813 * src/main.c (main): Free `infile'.
13814 * src/scan-gram.l (handle_syncline): New.
13815 Recognize `#line'.
13816 * src/output.c (user_actions_output, symbol_destructors_output)
13817 (symbol_printers_output): Use the location's file name, not
13818 infile.
13819 * src/reader.c (prologue_augment, epilogue_set): Likewise.
13820
13821 2002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13822
13823 * src/tables.c (matching_state): Don't allow states to match if
13824 either has GLR conflict entries.
13825
13826 2002-11-05 Paul Eggert <eggert@twinsun.com>
13827
13828 * src/scan-gram.l: Use more accurate diagnostics, e.g.
13829 "integer out of range" rather than "invalid value".
13830 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
13831 accordingly.
13832
13833 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
13834 Also, remove one static variable in the scanner.
13835
13836 * src/scan-gram.l (braces_level): Now auto, not static.
13837 Initialize to zero if the compiler is being picky.
13838 (INITIAL): Clear braces_level instead of incrementing it.
13839 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
13840 as POSIX 1003.1-2001 requires.
13841 * src/system.h (IF_LINT): New macro, taken from coreutils.
13842 * configure.ac: Define "lint" if --enable-gcc-warnings.
13843
13844 2002-11-05 Akim Demaille <akim@epita.fr>
13845
13846 * src/scan-gram.l: When it starts with `%', complain about the
13847 whole directive, not just that `invalid character: %'.
13848
13849 2002-11-04 Akim Demaille <akim@epita.fr>
13850
13851 * Makefile.maint: Update from Autoconf.
13852 (update, cvs-update, po-update, do-po-update): New.
13853
13854 2002-11-04 Akim Demaille <akim@epita.fr>
13855
13856 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
13857 and yyerror.
13858 Have yyerror `use' its arguments.
13859 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
13860 returns true when location & yacc & pure & parse-param.
13861 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
13862
13863 2002-11-04 Akim Demaille <akim@epita.fr>
13864
13865 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
13866 clashes.
13867 * src/scan-gram.l: Use [\'] instead of ['] to pacify
13868 font-lock-mode.
13869 Use complain_at.
13870 Use quote, not quote_n since LOCATION_PRINT no longer uses the
13871 slot 0.
13872
13873 2002-11-03 Paul Eggert <eggert@twinsun.com>
13874
13875 * src/reader.c (get_merge_function, grammar_current_rule_check):
13876 Use consistent diagnostics for reporting type name clashes.
13877 Quote the types with <>, for consistency with Yacc.
13878 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
13879
13880 2002-11-03 Akim Demaille <akim@epita.fr>
13881
13882 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
13883 New.
13884 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
13885 (b4_parse_param): Remove.
13886 Use b4_identification.
13887 Propagate b4_pure_args where needed to pass them to yyerror.
13888 * data/glr.m4 (b4_parse_param): Remove.
13889 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
13890 (b4_lpure_formals): New.
13891 Use b4_identification.
13892 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
13893 b4_user_formals and b4_user_args.
13894 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
13895 (yyreportAmbiguity): When using a pure parser, also need
13896 the location, and the parse-params.
13897 Adjust callers.
13898 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
13899 When using a pure parser, also need the parse-params.
13900 Adjust callers.
13901 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
13902 (%pure-parser + %parse-param) LALR and GLR parsers.
13903 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
13904 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
13905 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
13906 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
13907 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
13908 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
13909 * doc/bison.texinfo: Untabify the whole file.
13910 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
13911 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
13912 (Error Reporting): Adjust to these new directives.
13913 Document %error-verbose, deprecate YYERROR_VERBOSE.
13914
13915 2002-11-03 Akim Demaille <akim@epita.fr>
13916
13917 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
13918 AT_CHECK_CALC_GLR invocations to use % directives, instead of
13919 command line options.
13920 * tests/cxx-type.at: Formatting changes.
13921
13922 2002-11-03 Paul Eggert <eggert@twinsun.com>
13923
13924 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
13925 to count columns correctly, and to check for invalid inputs.
13926
13927 Use mbsnwidth to count columns correctly. Account for tabs, too.
13928 Include mbswidth.h.
13929 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
13930 (extend_location): New function.
13931 (YY_LINES): Remove.
13932
13933 Handle CRLF in C code rather than in Lex code.
13934 (YY_INPUT): New macro.
13935 (no_cr_read): New function.
13936
13937 Scan UCNs, even though we don't fully handle them yet.
13938 (convert_ucn_to_byte): New function.
13939
13940 Handle backslash-newline correctly in C code.
13941 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
13942 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
13943 all uses changed.
13944 (tag, splice): New EREs. Do not allow NUL or newline in tags.
13945 Use {splice} wherever C allows backslash-newline.
13946 YY_STEP after space, newline, vertical-tab.
13947 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
13948
13949 (letter, id): Don't assume ASCII; e.g., spell out a-z.
13950
13951 ({int}, handle_action_dollar, handle_action_at): Check for integer
13952 overflow.
13953
13954 (YY_STEP): Omit trailing semicolon, so that it's more like C.
13955
13956 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
13957 as well as \000. Check for UCHAR_MAX, not 255.
13958 Allow \x with an arbitrary positive number of digits, as in C.
13959 Check for overflow here.
13960 Allow \? and UCNs, for compatibility with C.
13961
13962 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
13963 with quote slot used by complain_at.
13964
13965 * tests/input.at: Add tests for backslash-newline, m4 quotes
13966 in symbols, long literals, and funny escapes in strings.
13967
13968 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
13969 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
13970 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
13971 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
13972 * m4/mbswidth.m4: New file, from GNU coreutils.
13973
13974 * doc/bison.texinfo (Grammar Outline): Document // comments.
13975 (Symbols): Document that trigraphs have no special meaning in Bison,
13976 nor is backslash-newline allowed.
13977 (Actions): Document that trigraphs have no special meaning.
13978
13979 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
13980 no longer used.
13981
13982 2002-11-02 Paul Eggert <eggert@twinsun.com>
13983
13984 * src/reader.c: Don't include quote.h; not needed.
13985 (get_merge_function): Reword warning to be consistent with
13986 type clash diagnostic in grammar_current_rule_check.
13987
13988 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
13989 bug in trigraph handling.
13990
13991 * src/output.c (prepare_symbols): When printing token names,
13992 escape "[" as "@<:@" and likewise for "]".
13993
13994 * src/system.h (errno): Remove declaration, as we are now
13995 assuming C89 or better, and C89 guarantees errno.
13996
13997 2002-10-30 Paul Eggert <eggert@twinsun.com>
13998
13999 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
14000 Check for close failures.
14001 * src/files.h (xfclose): Return void, not int, since it always
14002 returned zero.
14003 * src/files.c (xfclose): Likewise. Report I/O error if ferror
14004 indicates one.
14005 * src/output.c (output_skeleton): Use xfclose rather than fclose
14006 and ferror. xfclose now checks ferror.
14007
14008 * data/glr.c (YYLEFTMOST_STATE): Remove.
14009 (yyreportTree): Use a stack-based leftmost state. This avoids
14010 our continuing battles with bogus warnings about initializers.
14011
14012 2002-10-30 Akim Demaille <akim@epita.fr>
14013
14014 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
14015 #if.
14016
14017 2002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14018
14019 * tests/glr-regr1.at: New test for reported regressions.
14020 * tests/testsuite.at: Add glr-regr1.at test.
14021 * tests/Makefile.am: Add glr-regr1.at test.
14022
14023 2002-10-24 Paul Eggert <eggert@twinsun.com>
14024
14025 Version 1.75a.
14026
14027 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
14028 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
14029 we use malloc. Don't assume 'A' through 'Z' are contiguous.
14030 Don't assume strdup exists; POSIX says its an XSI extension.
14031 Check for buffer overflow on input.
14032
14033 2002-10-24 Akim Demaille <akim@epita.fr>
14034
14035 * src/output.c (output_skeleton): Don't disable M4sugar comments
14036 too soon: it results in comments being expanded.
14037 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
14038 first output.
14039
14040 2002-10-24 Akim Demaille <akim@epita.fr>
14041
14042 * data/yacc.c (m4_int_type): New.
14043 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
14044 char' as only yacc.c wants K&R portability.
14045 * data/glr.c (yysigned_char): Remove.
14046 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
14047 Reported by Quoc Peyrot.
14048
14049 2002-10-23 Paul Eggert <eggert@twinsun.com>
14050
14051 * src/main.c (main): With --trace=time, report times even if a
14052 non-fatal error occurs. Formerly, the times were reported in some
14053 such cases but not in others.
14054 * src/reader.c (reader): Just return if a complaint has been issued,
14055 instead of exiting, so that 'main' can report times.
14056
14057 2002-10-22 Akim Demaille <akim@epita.fr>
14058
14059 * src/system.h: Include sys/types.
14060 Reported by Bert Deknuydt.
14061
14062 2002-10-23 Paul Eggert <eggert@twinsun.com>
14063
14064 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
14065 Suggested by Art Haas.
14066
14067 2002-10-22 Paul Eggert <eggert@twinsun.com>
14068
14069 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
14070 decl; not needed any more.
14071 * src/main.c (main): Use return to exit, undoing yesterday's change.
14072 The last OS that we could find where this wouldn't work is
14073 SunOS 3.5, and that's too old to worry about now.
14074
14075 * data/glr.c (struct yyltype): Define members even when not
14076 doing locations. This is more consistent with yacc.c, and it
14077 works around the following bug reports:
14078 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
14079 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
14080
14081 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
14082 @acronym consistently. Standardize on "Yacc" instead of "YACC",
14083 "Algol" instead of "ALGOL". Give a bit more history about BNF.
14084
14085 2002-10-22 Akim Demaille <akim@epita.fr>
14086
14087 * data/README: New.
14088
14089 2002-10-21 Paul Eggert <eggert@twinsun.com>
14090
14091 Be consistent about 'bool'; the old code used an enum in one
14092 module and an int in another, and this violates the C standard.
14093 * m4/stdbool.m4: New file, from coreutils 4.5.3.
14094 * configure.ac (AC_HEADER_STDBOOL): Add.
14095 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
14096 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
14097 * src/symtab.c (hash_compare_symbol_t): Likewise.
14098 * src/system.h (bool, false, true): Use a definition consistent
14099 with ../lib/hash.c. All uses changed.
14100
14101 * src/complain.c (warning_issued): Renamed from warn_message_count,
14102 so that we needn't worry about integer overflow (!).
14103 Now of type bool. All uses changed.
14104 (complaint_issued): Renamed from complain_message_count; likewise.
14105
14106 * src/main.c (main): Use exit to exit with failure.
14107
14108 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
14109 rather than 1 and 0.
14110 * src/main.c (main): Likewise.
14111 * src/getargs.c (getargs): Likewise.
14112 * src/reader.c (reader): Likewise.
14113
14114 * src/getarg.c (getargs): Remove duplicate code for
14115 "Try `bison --help'".
14116
14117 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
14118 What was that "2" for?
14119
14120 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
14121 * src/getargs.c (usage): Likewise.
14122
14123 * src/getargs.c (getargs): When there are too few operands, report
14124 the last one. When there are too many, report the first extra
14125 one. This is how diffutils does it.
14126
14127 2002-10-20 Paul Eggert <eggert@twinsun.com>
14128
14129 Remove K&R vestiges.
14130 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
14131 * src/complain.c (VA_START): Remove. Assume prototypes.
14132 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
14133 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
14134 fatal): Assume prototypes.
14135 * src/complain.h: Assume prototypes.
14136 * src/system.h (PARAMS): Remove.
14137 Include <limits.h> unconditionally, since it's guaranteeed even
14138 for a freestanding C89 compiler.
14139 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
14140 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
14141
14142 2002-10-20 Akim Demaille <akim@epita.fr>
14143
14144 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
14145 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
14146 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
14147 (yyresolveStates, yyresolveAction, yyresolveStack)
14148 (yyprocessOneStack): Use them.
14149 (yy_reduce_print): New.
14150 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
14151
14152 2002-10-20 Akim Demaille <akim@epita.fr>
14153
14154 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
14155 arguments and output `void'.
14156 (b4_c_function): Rename as...
14157 (b4_c_function_def): this.
14158 (b4_c_function_decl, b4_c_ansi_function_def)
14159 (b4_c_ansi_function_decl): New.
14160 Change the interpretation of the arguments: before `int, foo', now
14161 `int foo, foo'.
14162 * data/yacc.c (yyparse): Prototype and define thanks to these.
14163 Adjust b4_c_function_def uses.
14164 * data/glr.c (yyparse): Likewise, but ANSI only.
14165
14166 2002-10-20 Akim Demaille <akim@epita.fr>
14167
14168 * src/output.c (prepare): Move the definition of `tokens_number',
14169 `nterms_number', `undef_token_number', `user_token_number_max'
14170 to...
14171 (prepare_tokens): Here.
14172 (prepare_tokens): Rename as...
14173 (prepare_symbols): this.
14174 (prepare): Move the definition of `rules_number' to...
14175 (prepare_rules): here.
14176 (prepare): Move the definition of `last', `final_state_number',
14177 `states_number' to...
14178 (prepare_states): here.
14179 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
14180
14181 2002-10-20 Akim Demaille <akim@epita.fr>
14182
14183 * src/tables.h, src/tables.c, src/output.c: Comment changes.
14184
14185 2002-10-20 Akim Demaille <akim@epita.fr>
14186
14187 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
14188 * data/c.m4: here.
14189
14190 2002-10-20 Akim Demaille <akim@epita.fr>
14191
14192 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
14193 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
14194 `pair'.
14195 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
14196 `name' to...
14197 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
14198 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
14199 These.
14200
14201 2002-10-19 Paul Eggert <eggert@twinsun.com>
14202
14203 Do not create a temporary file, as that involves security and
14204 cleanup headaches. Instead, use a pair of pipes.
14205 Derived from a suggestion by Florian Krohm.
14206 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
14207 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
14208 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
14209 (BISON_PREREQ_SUBPIPE): Add.
14210 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
14211 Add subpipe.h, subpipe.c.
14212 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
14213 * po/POTFILES.in: Add lib/subpipe.c.
14214 * src/output.c: Include "subpipe.h".
14215 (m4_invoke): Remove decl.
14216 (scan_skel): New decl.
14217 (output_skeleton): Use pipe rather than temporary file for m4 input.
14218 Check that m4sugar.m4 is readable, to avoid deadlock.
14219 Check for pipe I/O error.
14220 * src/scan-skel.l (readpipe): Remove decl.
14221 (scan_skel): New function, to be used in place of m4_invoke.
14222 Read from stream rather than file.
14223
14224 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
14225 float, as this generates a warning on Solaris 8 + GCC 3.2 with
14226 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
14227 this generates a more-accurate value anyway.
14228
14229 * lib/timevar.c (timervar_accumulate): Rename locals to
14230 avoid confusion with similarly-named more-global.
14231 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
14232
14233 * src/output.c (prepare): Use xstrdup to convert char const *
14234 to char *, to avoid GCC warning.
14235
14236 2002-10-19 Akim Demaille <akim@epita.fr>
14237
14238 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
14239 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
14240 Use them to have `calc.y' ready for %pure-parser.
14241 * data/yacc.c (YYLEX): Pass a yylex return type to
14242 b4_c_function_call.
14243
14244 2002-10-19 Akim Demaille <akim@epita.fr>
14245
14246 Prototype support of %lex-param and %parse-param.
14247
14248 * src/parse-gram.y: Add the definition of the %lex-param and
14249 %parse-param tokens, plus their rules.
14250 Drop the `_' version of %glr-parser.
14251 Add the "," token.
14252 * src/scan-gram.l (INITIAL): Scan them.
14253 * src/muscle_tab.c: Comment changes.
14254 (muscle_insert, muscle_find): Rename `pair' as `probe'.
14255 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
14256 (muscle_entry_s): The `value' member is no longer const.
14257 Adjust all dependencies.
14258 * src/muscle_tab.c (muscle_init): Adjust: use
14259 MUSCLE_INSERT_STRING.
14260 Initialize the obstack earlier.
14261 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
14262 (muscle_pair_list_grow): New.
14263 * data/c.m4 (b4_c_function_call, b4_c_args): New.
14264 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
14265 * tests/calc.at: Use %locations, not --locations.
14266 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
14267
14268 2002-10-19 Akim Demaille <akim@epita.fr>
14269
14270 * src/getargs.c (usage): Take status as argument and exit
14271 accordingly.
14272 Report the traditional `Try ... --help' message when status != 0.
14273 (usage, version): Don't take a FILE * as arg, it is pointless.
14274 (getargs): When there is an incorrect number of arguments, make it
14275 an error, and report it GNUlically thanks to `usage ()'.
14276
14277 2002-10-18 Paul Eggert <eggert@twinsun.com>
14278
14279 * data/glr.c (yyreportParseError): Don't assume that sprintf
14280 yields the length of the printed string, as this is not true
14281 on SunOS 4.1.4. Reported by Peter Klein.
14282
14283 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
14284 * tests/conflicts.at (%nonassoc and eof): Likewise.
14285 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
14286
14287 2002-10-17 Akim Demaille <akim@epita.fr>
14288
14289 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
14290 * src/getargs.c (trace_types, trace_args): Adjust.
14291 * src/reader.c (grammar_current_rule_prec_set)
14292 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
14293 Standardize error messages.
14294 And s/@prec/%prec/!
14295 (reader): Use trace_flag to enable scanner/parser debugging,
14296 instead of an adhoc scheme.
14297 * src/scan-gram.l: Remove trailing debugging code.
14298
14299 2002-10-16 Paul Eggert <eggert@twinsun.com>
14300
14301 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
14302 MUSCLE_TAB_H.
14303
14304 * NEWS: Officially drop support for building Bison with K&R C,
14305 since it didn't work anyway and it's not worth worrying about.
14306 * Makefile.maint (wget_files): Remove ansi2knr.c.
14307 (ansi2knr.c-url_prefix): Remove.
14308 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
14309 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
14310 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
14311
14312 2002-10-15 Paul Eggert <eggert@twinsun.com>
14313
14314 Stop using the "enum_" trick for K&R-style function definitions;
14315 it confused me, and I was the author! Instead, assume that people
14316 who want to use K&R C compilers (when using these modules in GCC,
14317 perhaps?) will run ansi2knr.
14318
14319 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
14320 All uses of "enum_" changed to "enum ".
14321 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
14322 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
14323
14324 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
14325 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
14326 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
14327 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
14328 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
14329 abitset_not, abitset_ones, abitset_or, abitset_or_and,
14330 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
14331 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
14332 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
14333 Use function prototypes; this removes the need for declaring
14334 static functions simply to provide their prototypes.
14335 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
14336 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
14337 bitset_count_, bitset_create, bitset_dump, bitset_first,
14338 bitset_free, bitset_init, bitset_last, bitset_next,
14339 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
14340 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
14341 bitset_print, bitset_release_memory, bitset_toggle_,
14342 bitset_type_choose, bitset_type_get, bitset_type_name_get,
14343 debug_bitset): Likewise.
14344 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
14345 * lib/bitset_stats.c (bitset_log_histogram_print,
14346 bitset_percent_histogram_print, bitset_stats_and,
14347 bitset_stats_and_cmp, bitset_stats_and_or,
14348 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
14349 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
14350 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
14351 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
14352 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
14353 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
14354 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
14355 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
14356 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
14357 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
14358 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
14359 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
14360 bitset_stats_zero): Likewise.
14361 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
14362 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
14363 bitsetv_dump, debug_bitsetv): Likewise.
14364 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
14365 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
14366 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
14367 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
14368 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
14369 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
14370 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
14371 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
14372 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
14373 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
14374 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
14375 Likewise.
14376 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
14377 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
14378 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
14379 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
14380 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
14381 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
14382 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
14383 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
14384 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
14385 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
14386 lbitset_xor_cmp, lbitset_zero): Likewise.
14387
14388 2002-10-14 Akim Demaille <akim@epita.fr>
14389
14390 Version 1.75.
14391
14392 2002-10-14 Akim Demaille <akim@epita.fr>
14393
14394 * tests/Makefile.am (maintainer-check-posix): New.
14395
14396 2002-10-14 Akim Demaille <akim@epita.fr>
14397
14398 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
14399 member.
14400
14401 2002-10-14 Akim Demaille <akim@epita.fr>
14402
14403 * src/tables.c (table_ninf_remap): base -> tab.
14404 Reported by Matt Rosing.
14405
14406 2002-10-14 Paul Eggert <eggert@twinsun.com>
14407
14408 * tests/action.at, tests/calc.at, tests/conflicts.at,
14409 tests/cxx-type.at, tests/headers.at, tests/input.at,
14410 tests/regression.at, tests/synclines.at, tests/torture.at:
14411 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
14412 so that the tests still work even if POSIXLY_CORRECT is set.
14413 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
14414
14415 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
14416 for portability to K&R hosts. Fix typo: signed char is guaranteed
14417 only to 127, not to 128.
14418 * data/glr.c (yysigned_char): New type.
14419 * data/yacc.c (yysigned_char): Likewise.
14420 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
14421
14422 2002-10-13 Paul Eggert <eggert@twinsun.com>
14423
14424 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
14425 true due to limited range of data type" warning from GCC.
14426
14427 * data/c.m4 (b4_token_defines): Protect against double-inclusion
14428 by wrapping enum yytokentype's definition inside #ifndef
14429 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
14430
14431 2002-10-13 Akim Demaille <akim@epita.fr>
14432
14433 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
14434 Un yy- yyrhs to avoid the name clash with the global YYRHS.
14435
14436 2002-10-13 Akim Demaille <akim@epita.fr>
14437
14438 * Makefile.maint: Update from Autoconf 2.54.
14439 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
14440
14441 2002-10-13 Akim Demaille <akim@epita.fr>
14442
14443 * src/print.c (print_state): Separate the list of solved conflicts
14444 from the other items.
14445 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
14446
14447 2002-10-13 Akim Demaille <akim@epita.fr>
14448
14449 Let nondeterministic skeletons be usable with deterministic
14450 tables.
14451
14452 With the patch, GAWK compiled by GCC without -O2 passes its test
14453 suite using a GLR parser driven by LALR tables. It fails with -O2
14454 because `struct stat' gives two different answers on my machine:
14455 88 (definition of an auto var) and later 96 (memset on this var).
14456 Hence the stack is badly corrumpted. The headers inclusion is to
14457 blame: if I move the awk.h inclusion before GLR's system header
14458 inclusion, the two struct stat have the same size.
14459
14460 * src/tables.c (pack_table): Always create conflict_table.
14461 (token_actions): Always create conflict_list.
14462 * data/glr.c (YYFLAG): Remove, unused.
14463
14464 2002-10-13 Akim Demaille <akim@epita.fr>
14465
14466 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
14467 (O0FLAGS): New.
14468 (VALGRIND, GXX): New.
14469 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
14470 * tests/bison.in: Run $PREBISON a pre-command.
14471 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
14472 (maintainer-check-g++): New.
14473 * Makefile.am (maintainer-check): New.
14474
14475 2002-10-13 Akim Demaille <akim@epita.fr>
14476
14477 * data/glr.c: Formatting changes.
14478 Tweak some trace messages to match yacc.c's.
14479
14480 2002-10-13 Akim Demaille <akim@epita.fr>
14481
14482 GLR parsers sometimes raise parse errors instead of performing the
14483 default reduction.
14484 Reported by Charles-Henry de Boysson.
14485
14486 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
14487 check the length of the traces when %glr.
14488 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
14489 GLR's traces.
14490 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
14491 Test GLR parsers.
14492 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
14493 (yyltype): Remove the yy prefix from the member names.
14494 (yytable): Complete its comment.
14495 (yygetLRActions): Map error action number from YYTABLE from
14496 YYTABLE_NINF to 0.
14497 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
14498 (which was a bug: it should have been YYTABEL_NINF, and yet it was
14499 not satisfying as we could compare an YYACTION computed from
14500 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
14501 only value for error actions.
14502 (yyreportParseError): In verbose parse error messages, don't issue
14503 `error' in the list of expected tokens.
14504 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
14505 next action to perform to match glr.c's decoding.
14506 (yytable): Complete its comment.
14507
14508 2002-10-13 Paul Eggert <eggert@twinsun.com>
14509
14510 Fix problem reported by Henrik Grubbstroem in
14511 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
14512 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
14513 because the Bison parser reads the second action before reducing
14514 the first one.
14515 * src/scan-gram.l (rule_length): New static var.
14516 Use it to keep track of the rule length in the scanner, since
14517 we can't expect the parser to be in lock-step sync with the scanner.
14518 (handle_action_dollar, handle_action_at): Use this var.
14519 * tests/actions.at (Exotic Dollars): Test for the problem.
14520
14521 2002-10-12 Paul Eggert <eggert@twinsun.com>
14522
14523 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
14524 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
14525 Include <sys/time.h> when checking for clock_t and struct tms.
14526 Use same include order as source.
14527 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
14528 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
14529
14530 * lib/timevar.c: Update copyright date and clarify comments.
14531 (get_time) [IN_GCC]: Keep the GCC version for reference.
14532
14533 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
14534 GCC version as of today, then merge Bison's changes.
14535 Change "GCC" to "Bison" in copyright notice. timevar.def's
14536 author is Akim, so change that too.
14537
14538 * src/reader.c (grammar_current_rule_check):
14539 Don't worry about the default action if $$ is untyped.
14540 Prevents bogus warnings reported by Jim Gifford in
14541 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
14542
14543 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
14544 * data/glr.c, data/lalr1.cc, data/yacc.c:
14545 Output token definitions before the first part of user declarations.
14546 Fixes compatibility problem reported by Jim Gifford for kbd in
14547 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14548
14549 2002-10-11 Paul Eggert <eggert@twinsun.com>
14550
14551 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
14552 (yyparse): here. This undoes some of the 2002-07-25 change.
14553 Compatibility problem reported by Ralf S. Engelschall with
14554 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
14555
14556 2002-10-11 Akim Demaille <akim@epita.fr>
14557
14558 * tests/regression.at Characters Escapes): New.
14559 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
14560 characters.
14561 Reported by Jan Nieuwenhuizen.
14562
14563 2002-10-11 Akim Demaille <akim@epita.fr>
14564
14565 * po/id.po: New.
14566
14567 2002-10-10 Paul Eggert <eggert@twinsun.com>
14568
14569 Portability fixes for bitsets; this also avoids several GCC
14570 warnings.
14571
14572 * lib/abitset.c: Include <stddef.h>, for offsetof.
14573 * lib/lbitset.c: Likewise.
14574
14575 * lib/abitset.c (abitset_bytes): Return a size that is aligned
14576 properly for vectors of objects. Do not assume that adding a
14577 header size to a multiple of a word size yields a value that is
14578 properly aligned for the whole union.
14579 * lib/bitsetv.c (bitsetv_alloc): Likewise.
14580
14581 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
14582 unique names for structures.
14583 * lib/ebitset.c (ebitset_bytes): Likewise.
14584 * lib/lbitset.c (lbitset_bytes): Likewise.
14585
14586 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
14587 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
14588 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
14589 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
14590 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
14591 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
14592 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
14593 to improve the type-checking that GCC can do.
14594 * lib/bitset.c (bitset_op4_cmp): Likewise.
14595 * lib/bitset_stats.c (bitset_stats_count,
14596 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
14597 bitset_stats_copy, bitset_stats_disjoint_p,
14598 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
14599 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
14600 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
14601 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
14602 bitset_stats_and_or_cmp, bitset_stats_andn_or,
14603 bitset_stats_andn_or_cmp, bitset_stats_or_and,
14604 bitset_stats_or_and_cmp): Likewise.
14605 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
14606 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
14607 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
14608 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
14609
14610 * lib/abitset.h: Include bitset.h, not bbitset.h.
14611 * lib/ebitset.h: Likewise.
14612 * lib/lbitset.h: Likewise.
14613
14614 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
14615 All instances of parameters of type enum bitset_opts are now of
14616 type enum_bitset_opts, to conform to the C Standard, and similarly
14617 for enum_bitset_type.
14618 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
14619 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
14620
14621 Do not use "struct bitset_struct" to mean different things in
14622 different modules. Not only is this confusing, it violates
14623 the C Standard, which requires that structure types in different
14624 modules must be compatible if one is to be passed to the other.
14625 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
14626 All instances of "struct bitset_struct *" replaced with "bitset".
14627 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
14628 (union bitset_union, struct abitset_struct, struct ebitset_struct,
14629 struct lbitset_struct, struct bitset_stats_struct): New types.
14630 All uses of struct bitset_struct changed to union bitset_union,
14631 etc.
14632 * lib/abitset.c (struct abitset_struct, abitset,
14633 struct bitset_struct): Remove.
14634 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
14635 struct bitset_struct): Remove.
14636 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
14637 bitset_struct): Remove.
14638 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
14639 Likewise.
14640
14641 Do not call a function of type T using a call that assumes the
14642 function is of a different type U. Standard C requires that a
14643 function must be called with a type that is compatible with its
14644 definition.
14645 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
14646 New decls.
14647 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
14648 New functions.
14649 * lib/ebitset.c (PFV): Remove.
14650 * lib/lbitset.c (PFV): Likewise.
14651 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
14652 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
14653 decls.
14654 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
14655 (ebitset_vtable): Use them.
14656 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
14657 lbitset_xor): New functions.
14658 (lbitset_vtable): Use them.
14659
14660 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
14661 Declare.
14662
14663 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
14664 GCC warning.
14665 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
14666 Use offsetof, for simplicity.
14667
14668 2002-10-06 Paul Eggert <eggert@twinsun.com>
14669
14670 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
14671 the same width as int. This reapplies a hunk of the 2002-08-12 patch
14672 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
14673 which was inadvertently undone by the 2002-09-30 patch.
14674 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
14675 the same width as int.
14676
14677 2002-10-04 Paul Eggert <eggert@twinsun.com>
14678
14679 Version 1.50.
14680
14681 * configure.ac (AC_INIT), NEWS: Increment version number.
14682
14683 * doc/bison.texinfo: Minor spelling, grammar, and white space
14684 fixes.
14685 (Symbols): Mention that any negative value returned from yylex
14686 signifies end-of-input. Warn about negative chars. Mention
14687 the portable Standard C character set.
14688
14689 The GNU coding standard says CFLAGS and YFLAGS are reserved
14690 for the installer to set.
14691 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
14692 * src/Makefile.am (AM_CFLAGS): Likewise.
14693 (AM_YFLAGS): Renamed from YFLAGS.
14694
14695 Fix some MAX and MIN problems.
14696 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
14697 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
14698 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
14699 * src/reader.c (reader): Use it.
14700
14701 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
14702 POSIX 1003.1-2001 has removed fgrep.
14703
14704 2002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
14705
14706 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
14707 interpreted as signed.
14708 * lib/ebitset.c (ebitset_list): Fix bug.
14709
14710 2002-10-01 Paul Eggert <eggert@twinsun.com>
14711
14712 More fixes for 64-bit hosts and large bitsets.
14713
14714 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
14715 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
14716 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
14717 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
14718 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
14719 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
14720 bitset_count_): Likewise.
14721 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
14722 bitset_first, bitset_last): Likewise.
14723 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
14724 bitset_stats_list_reverse, bitset_stats_size,
14725 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
14726 Likewise.
14727 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
14728 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
14729 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
14730 bitsetv_reflexive_transitive_closure): Likewise.
14731 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
14732 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
14733 Likewise.
14734 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
14735 Likewise.
14736
14737 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
14738 Use size_t, not unsigned int, to count bytes.
14739 * lib/abitset.h (abitset_bytes): Likewise.
14740 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
14741 Likewise.
14742 * lib/bitset.h (bitset_bytes): Likewise.
14743 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
14744 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
14745 * lib/bitsetv.c (bitsetv_alloc): Likewise.
14746 * lib/ebitset.c (ebitset_bytes): Likewise.
14747 * lib/ebitset.h (ebitset_bytes): Likewise.
14748 * lib/lbitset.c (lbitset_bytes): Likewise.
14749 * lib/lbitset.h (lbitset_bytes): Likewise.
14750
14751 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
14752 abitset_subset_p, abitset_disjoint_p, abitset_and,
14753 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
14754 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
14755 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
14756 abitset_or_and, abitset_or_and_cmp):
14757 Use bitset_windex instead of unsigned int.
14758 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
14759 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
14760 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
14761 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
14762 Likewise.
14763 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
14764
14765 * lib/bitset.c (bitset_print):
14766 Use proper printf formats for widths of integer types.
14767 * lib/bitset_stats.c (bitset_percent_histogram_print,
14768 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
14769 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
14770 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
14771 * lib/lbitset.c (lbitset_bytes): Likewise.
14772
14773 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
14774 BITSET_SIZE_MAX): New macros.
14775 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
14776 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
14777 to BITSET_WINDEX_MAX.
14778
14779 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
14780 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
14781 since we now return the bitset_bindex type (not int).
14782
14783 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
14784 when computing sizes.
14785 * lib/ebitset.c (ebitset_elts_grow): Likewise.
14786
14787 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
14788 and avoid cast to unsigned.
14789
14790 2002-09-30 Akim Demaille <akim@epita.fr>
14791
14792 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
14793 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
14794 Updates from Michael Hayes.
14795
14796 2002-09-30 Art Haas <ahaas@neosoft.com>
14797
14798 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
14799 invocations.
14800 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
14801 defined.
14802
14803 2002-09-27 Akim Demaille <akim@epita.fr>
14804
14805 Version 1.49c.
14806
14807 2002-09-27 Akim Demaille <akim@epita.fr>
14808
14809 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
14810 (Because of AC_LIBSOURCE).
14811
14812 2002-09-27 Akim Demaille <akim@epita.fr>
14813
14814 Playing with Autoscan.
14815
14816 * configure.ac: Remove the old LIBOBJ tweaks.
14817 (AC_REPLACE_FUNCS): Add strrchr and strtol.
14818 * lib/strrchr.c: New.
14819 * lib/strtol.c: New, from the Coreutils 4.5.1.
14820
14821 2002-09-27 Akim Demaille <akim@epita.fr>
14822
14823 Playing with Autoscan.
14824
14825 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
14826 * lib/Makefile.am (libbison_a_SOURCES): No longer include
14827 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
14828 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
14829 Coreutils 4.5.1.
14830
14831 2002-09-24 Akim Demaille <akim@epita.fr>
14832
14833 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
14834 (Frequently Asked Questions, Parser Stack Overflow): New.
14835
14836 2002-09-13 Akim Demaille <akim@epita.fr>
14837
14838 Playing with autoscan.
14839
14840 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
14841 * src/files.c (skeleton_find): Remove, unused.
14842 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
14843 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
14844
14845 2002-09-13 Akim Demaille <akim@epita.fr>
14846
14847 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
14848 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
14849
14850 2002-09-13 Akim Demaille <akim@epita.fr>
14851
14852 * configure.ac: Require 2.54.
14853 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
14854 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
14855 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
14856 Remove, provided by Autoconf macros.
14857
14858 2002-09-12 Akim Demaille <akim@epita.fr>
14859
14860 * m4/prereq.m4: Update, from Coreutils 4.5.1.
14861
14862 2002-09-12 Akim Demaille <akim@epita.fr>
14863
14864 * m4/prereq.m4: Update, from Fileutils 4.1.5.
14865 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
14866 Reported by Martin Mokrejs.
14867
14868 2002-09-10 Akim Demaille <akim@epita.fr>
14869
14870 * src/parse-gram.y: Associate a human readable string to each
14871 token type.
14872 * tests/regression.at (Invalid inputs): Adjust.
14873
14874 2002-09-10 Gary V. Vaughan <gary@gnu.org>
14875
14876 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
14877 with an Autoconf-2.5x style configure.ac.
14878
14879 2002-09-06 Paul Eggert <eggert@twinsun.com>
14880
14881 * doc/bison.texinfo (Conditions): Make explicit that the GPL
14882 exception applies only to yacc.c. This is a modification of a
14883 patch originally suggested by Akim Demaille.
14884
14885 2002-09-06 Akim Demaille <akim@epita.fr>
14886
14887 * data/c.m4 (b4_copyright): Move the GPL exception comment from
14888 here to...
14889 * data/yacc.c: here.
14890
14891 * data/lalr1.cc (struct yyltype): Don't define it, since we use
14892 LocationType.
14893 (b4_ltype): Default to yy::Location from location.hh.
14894
14895 2002-09-04 Jim Meyering <jim@meyering.net>
14896
14897 * data/yacc.c: Guard the declaration of yytoknum also with
14898 `#ifdef YYPRINT', so it is declared only when used.
14899
14900 2002-09-04 Akim Demaille <akim@epita.fr>
14901
14902 * configure.in: Rename as...
14903 * configure.ac: this.
14904 Bump to 1.49c.
14905
14906 2002-09-04 Akim Demaille <akim@epita.fr>
14907
14908 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
14909 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
14910 translate maintainer only messages.
14911
14912 2002-08-12 Paul Eggert <eggert@twinsun.com>
14913
14914 Version 1.49b.
14915
14916 * Makefile.am (SUBDIRS): Remove intl.
14917 (DISTCLEANFILES): Remove.
14918 * NEWS: Mention that GNU M4 is now required. Clarify what is
14919 meant by "larger grammars". Mention the pt_BR translation.
14920 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
14921 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
14922 Bump version from 0.11.2 to 0.11.5.
14923 (BISON_PREREQ_STAGE): Remove.
14924 (AM_GNU_GETTEXT): Use external gettext.
14925 (AC_OUTPUT): Remove intl/Makefile.
14926
14927 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
14928
14929 * data/glr.c: Include string.h, for strlen.
14930 (yyreportParseError): Use size_t for yysize.
14931 (yy_yypstack): No longer nested inside yypstates, as nested
14932 functions are not portable. Do not assume size_t is the
14933 same width as int.
14934 (yypstates): Do not assume that ptrdiff_t is the same width
14935 as int, and similarly for yyposn and YYINDEX.
14936
14937 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
14938
14939 * lib/Makefile.am (INCLUDES): Do not include from the intl
14940 directory, which has been removed.
14941 * src/Makefile.am (INCLUDES): Likewise.
14942
14943 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
14944 (bitsets_sources, additional_bitsets_sources, timevars_sources):
14945 New vars.
14946
14947 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
14948 * tests/Makefile.am (EXTRA_DIST): Likewise.
14949
14950 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
14951 Do not assume that bitset_windex is the same width as unsigned.
14952
14953 * lib/abitset.c (abitset_unused_clear): Do not assume that
14954 bitset_word is the same width as int.
14955 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
14956 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
14957 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
14958 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
14959 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
14960
14961 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
14962 portability to one's complement hosts!).
14963 * lib/ebitset.c (ebitset_op1): Likewise.
14964 * lib/lbitset.c (lbitset_op1): Likewise.
14965
14966 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
14967 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
14968 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
14969 Sync with fileutils.
14970 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
14971 lib/gettext.h: Sync with diffutils.
14972
14973 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
14974 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
14975
14976 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
14977 PROTOTYPES to check for prototypes, and "defined __STDC__" to
14978 check for void *.
14979
14980 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
14981 size_t; the old version tried to do this but casted improperly.
14982 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
14983 (bitset_test): Now returns int, not unsigned long.
14984
14985 * lib/bitset_stats.c: Include "gettext.h".
14986 (_): New macro.
14987 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
14988 name locals "index", as it generates unnecessary warnings on some
14989 hosts that have an "index" function.
14990
14991 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
14992 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
14993 they need translation.
14994 * src/LR0.c (state_list_append, new_itemsets, get_state,
14995 append_states, generate_states): Likewise.
14996 * src/assoc.c (assoc_to_string): Likewise.
14997 * src/closure.c (print_closure, set_firsts, closure): Likewise.
14998 * src/gram.c (grammar_dump): Likewise.
14999 * src/injections.c (injections_compute): Likewise.
15000 * src/lalr.c (lookaheads_print): Likewise.
15001 * src/relation.c (relation_transpose): Likewise.
15002 * src/scan-gram.l: Likewise.
15003 * src/tables.c (table_grow, pack_vector): Likewise.
15004
15005 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
15006 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
15007 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
15008 * m4/mbstate_t.m4: Sync with fileutils.
15009 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
15010
15011 * po/LINGUAS: Add pt_BR.
15012 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
15013 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
15014 lib/timevar.c.
15015 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
15016 manual recommends.
15017 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
15018
15019 * src/complain.c (strerror_r): Remove decl; not needed.
15020 (strerror): Use same pattern as ../lib/error.c.
15021
15022 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
15023
15024 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
15025
15026 * src/main.c (main): Cast result of bindtextdomain and textdomain
15027 to void, to avoid a GCC warning when --disable-nls is in effect.
15028
15029 * src/scan-gram.l: Use strings rather than escapes when possible,
15030 to minimize the number of warnings from xgettext.
15031 (handle_action_dollar, handle_action_at): Don't use isdigit,
15032 as it mishandles negative chars and it may not work as expected
15033 outside the C locale.
15034
15035 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
15036 this is a GCC extension and is not portable to other compilers.
15037
15038 * src/system.h (alloca): Use same pattern as ../lib/error.c.
15039 Do not include <ctype.h>; no longer needed.
15040 Do not include <malloc.h>; no longer needed (and generates
15041 warnings on OpenBSD 3.0).
15042
15043 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
15044 it's not portable.
15045
15046 * tests/regression.at: Do not use 'cc -c input.c -o input';
15047 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
15048
15049 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
15050 exit status as failure, not just exit status 1. Sun C exits
15051 with status 2 sometimes.
15052
15053 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
15054 Use it for the two large tests.
15055
15056 2002-08-02 Akim Demaille <akim@epita.fr>
15057
15058 * src/conflicts.c (conflicts_output): Don't output rules never
15059 reduced here, since anyway that computation doesn't work.
15060 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
15061 (rule_useless_p, rule_never_reduced_p): New.
15062 (grammar_rules_partial_print): Use a filter instead of a range.
15063 Display the title only if needed.
15064 (grammar_rules_print): Adjust.
15065 (grammar_rules_never_reduced_report): New.
15066 * src/tables.c (action_row): Move the computation of rules never
15067 reduced to...
15068 (token_actions): here.
15069 * src/main.c (main): Make the parser before making the report, so
15070 that rules never reduced are computed.
15071 Call grammar_rules_never_reduced_report.
15072 * src/print.c (print_results): Report rules never reduced.
15073 * tests/conflicts.at, tests/reduce.at: Adjust.
15074
15075 2002-08-01 Akim Demaille <akim@epita.fr>
15076
15077 Instead of attaching lookaheads and duplicating the rules being
15078 reduced by a state, attach the lookaheads to the reductions.
15079
15080 * src/state.h (state_t): Remove the `lookaheads',
15081 `lookaheads_rule' member.
15082 (reductions_t): Add a `lookaheads' member.
15083 Use a regular array for the `rules'.
15084 * src/state.c (reductions_new): Initialize the lookaheads member
15085 to 0.
15086 (state_rule_lookaheads_print): Adjust.
15087 * src/state.h, src/state.c (state_reductions_find): New.
15088 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
15089 (count_rr_conflicts): Adjust.
15090 * src/lalr.c (LArule): Remove.
15091 (add_lookback_edge): Adjust.
15092 (state_lookaheads_count): New.
15093 (states_lookaheads_initialize): Merge into...
15094 (initialize_LA): this.
15095 (lalr_free): Adjust.
15096 * src/main.c (main): Don't free nullable and derives too early: it
15097 is used by --verbose.
15098 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
15099
15100 2002-08-01 Akim Demaille <akim@epita.fr>
15101
15102 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
15103 `rule_number_t**'.
15104 (set_derives, free_derives): Rename as...
15105 (derives_compute, derives_free): this.
15106 Adjust all dependencies.
15107 * src/nullable.c (set_nullable, free_nullable): Rename as...
15108 (nullable_compute, nullable_free): these.
15109 (rule_list_t): Store rule_t *, not rule_number_t.
15110 * src/state.c (state_rule_lookaheads_print): Directly compare rule
15111 pointers, instead of their numbers.
15112 * src/main.c (main): Call nullable_free, and derives_free earlier,
15113 as they were lo longer used.
15114
15115 2002-08-01 Akim Demaille <akim@epita.fr>
15116
15117 * lib/timevar.c (get_time): Include children time.
15118 * src/lalr.h (LA, LArule): Don't export them: used with the
15119 state_t.
15120 * src/lalr.c (LA, LArule): Static.
15121 * src/lalr.h, src/lalr.c (lalr_free): New.
15122 * src/main.c (main): Call it.
15123 * src/tables.c (pack_vector): Check whether loc is >= to the
15124 table_size, not >.
15125 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
15126 (tables_generate): do it, since that's also it which allocates
15127 them.
15128 Don't free LA and LArule, main does.
15129
15130 2002-07-31 Akim Demaille <akim@epita.fr>
15131
15132 Separate parser tables computation and output.
15133
15134 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
15135 (conflict_list, conflict_list_cnt, table, check, table_ninf)
15136 (yydefgoto, yydefact, high): Move to...
15137 * src/tables.h, src/tables.c: here.
15138 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
15139 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
15140 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
15141 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
15142 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
15143 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
15144 (action_row, save_row, token_actions, save_column, default_goto)
15145 (goto_actions, sort_actions, matching_state, pack_vector)
15146 (table_ninf_remap, pack_table, prepare_actions): Move to...
15147 * src/tables.c: here.
15148 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
15149 * src/output.c (token_actions, output_base, output_conflicts)
15150 (output_check): Merge into...
15151 (prepare_actions): this.
15152 (actions_output): Rename as...
15153 (user_actions_output): this.
15154 * src/main.c (main): Call tables_generate and tables_free.
15155
15156 2002-07-31 Akim Demaille <akim@epita.fr>
15157
15158 Steal GCC's --time-report support.
15159
15160 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
15161 stolen/adjusted from GCC.
15162 * m4/stage.m4: Remove time related checks.
15163 * m4/timevar.m4: New.
15164 * configure.in: Adjust.
15165 * src/system.h: Adjust to using timevar.h.
15166 * src/getargs.h, src/getargs.c: Support trace_time for
15167 --trace=time.
15168 * src/main.c (stage): Remove.
15169 (main): Replace `stage' invocations with timevar calls.
15170 * src/output.c: Insert pertinent timevar calls.
15171
15172 2002-07-31 Akim Demaille <akim@epita.fr>
15173
15174 Let --trace have arguments.
15175
15176 * src/getargs.h (enum trace_e): New.
15177 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
15178 (long_options, short_options): --trace/-T takes an optional
15179 argument.
15180 Change all the uses of trace_flag to reflect the new flags.
15181 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
15182
15183 Strengthen `stage' portability.
15184
15185 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
15186 * configure.in: Use it.
15187 Don't check for malloc.h and sys/times.h.
15188 * src/system.h: Include them when appropriate.
15189 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
15190 times and struct tms are available.
15191
15192 2002-07-30 Akim Demaille <akim@epita.fr>
15193
15194 In verbose parse error message, don't report `error' as an
15195 expected token.
15196 * tests/actions.at (Printers and Destructors): Adjust.
15197 * tests/calc.at (Calculator $1): Adjust.
15198 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
15199 error message, do not report the parser accepts the error token in
15200 that state.
15201
15202 2002-07-30 Akim Demaille <akim@epita.fr>
15203
15204 Normalize conflict related messages.
15205
15206 * src/complain.h, src/complain.c (warn, complain): New.
15207 * src/conflicts.c (conflicts_print): Use them.
15208 (conflict_report_yacc): New, extracted from...
15209 (conflicts_print): here.
15210 * tests/conflicts.at, tests/existing.at: Adjust.
15211
15212 2002-07-30 Akim Demaille <akim@epita.fr>
15213
15214 Report rules which are never reduced by the parser: those hidden
15215 by conflicts.
15216
15217 * src/LR0.c (save_reductions): Don't make the final state too
15218 different: save its reduction (accept) instead of having a state
15219 without any action (no shift or goto, no reduce).
15220 Note: the final state is now a ``regular'' state, i.e., the
15221 parsers now contain `reduce 0' as default reduction.
15222 Nevertheless, since they decide to `accept' when yystate =
15223 final_state, they still will not reduce rule 0.
15224 * src/print.c (print_actions, print_reduction): Adjust.
15225 * src/output.c (action_row): Track reduced rules.
15226 (token_actions): Report rules never reduced.
15227 * tests/conflicts.at, tests/regression.at: Adjust.
15228
15229 2002-07-30 Akim Demaille <akim@epita.fr>
15230
15231 `stage' was accidently included in a previous patch.
15232 Initiate its autoconfiscation.
15233
15234 * configure.in: Look for malloc.h and sys/times.h.
15235 * src/main.c (stage): Adjust.
15236 Report only when trace_flag.
15237
15238 2002-07-29 Akim Demaille <akim@epita.fr>
15239
15240 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
15241 state_number_t.
15242 (errs_t): symbol_t*, not symbol_number_t.
15243 (reductions_t): rule_t*, not rule_number_t.
15244 (FOR_EACH_SHIFT): New.
15245 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
15246 * src/print.c, src/print_graph.c: Adjust.
15247
15248 2002-07-29 Akim Demaille <akim@epita.fr>
15249
15250 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
15251
15252 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
15253 (endtoken, accept): these.
15254 * src/reader.c (reader): Set endtoken's default tag to "$end".
15255 Set undeftoken's tag to "$undefined" instead of "$undefined.".
15256 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
15257 Adjust.
15258
15259 2002-07-29 Akim Demaille <akim@epita.fr>
15260
15261 * src/reduce.c (reduce_grammar): When the language is empty,
15262 complain about the start symbol, not the axiom.
15263 Use its location.
15264 * tests/reduce.at (Empty Language): New.
15265
15266 2002-07-26 Akim Demaille <akim@epita.fr>
15267
15268 * src/reader.h, src/reader.c (gram_error): ... can't get
15269 yycontrol without making too strong assumptions on the parser
15270 itself.
15271 * src/output.c (prepare_tokens): Use the real 0th value of
15272 token_translations instead of `0'.
15273 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
15274 visible here.
15275 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
15276 for the time being: %locations ought to provide it to yyerror.
15277
15278 2002-07-25 Akim Demaille <akim@epita.fr>
15279
15280 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
15281 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
15282 * tests/regression.at (Web2c Actions): Adjust.
15283
15284 2002-07-25 Akim Demaille <akim@epita.fr>
15285
15286 Stop storing rules from 1 to nrules + 1.
15287
15288 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
15289 * src/nullable.c, src/output.c, src/print.c, src/reader.c
15290 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
15291 Iterate from 0 to nrules.
15292 Use rule_number_as_item_number and item_number_as_rule_number.
15293 Adjust to `derive' now containing possibly 0.
15294 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
15295 Handle the `- 1' part in rule numbers from/to item numbers.
15296 * src/conflicts.c (log_resolution): Fix the message which reversed
15297 shift and reduce.
15298 * src/output.c (action_row): Initialize default_rule to -1.
15299 (token_actions): Adjust.
15300 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
15301 expected output.
15302 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
15303
15304 2002-07-25 Akim Demaille <akim@epita.fr>
15305
15306 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
15307 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
15308 (b4_c_knr_arg_decl): New.
15309 * data/yacc.c: Use it to define yysymprint, yydestruct, and
15310 yyreport_parse_error.
15311
15312 2002-07-25 Akim Demaille <akim@epita.fr>
15313
15314 * data/yacc.c (yyreport_parse_error): New, extracted from...
15315 (yyparse): here.
15316 (yydestruct, yysymprint): Move above yyparse.
15317 Be K&R compliant.
15318
15319 2002-07-25 Akim Demaille <akim@epita.fr>
15320
15321 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
15322 replace...
15323 (b4_sint_type, b4_uint_type): these.
15324 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
15325 * tests/regression.at (Web2c Actions): Adjust.
15326
15327 2002-07-25 Akim Demaille <akim@epita.fr>
15328
15329 * src/gram.h (TIEM_NUMBER_MAX): New.
15330 (item_number_of_rule_number, rule_number_of_item_number): Rename
15331 as...
15332 (rule_number_as_item_number, item_number_as_rule_number): these.
15333 Adjust dependencies.
15334 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
15335 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
15336 (symbol_number_to_vector_number): New.
15337 (order): Of vector_number_t* type.
15338 (base_t, BASE_MAX, BASE_MIN): New.
15339 (froms, tos, width, pos, check): Of base_t type.
15340 (action_number_t, ACTION_MIN, ACTION_MAX): New.
15341 (actrow): Of action_number_t type.
15342 (conflrow): Of unsigned int type.
15343 (table_ninf, base_ninf): New.
15344 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
15345 (muscle_insert_int_table, muscle_insert_base_table)
15346 (muscle_insert_rule_number_table): New.
15347 (prepare_tokens): Output `toknum' as int_table.
15348 (action_row): Returns a rule_number_t.
15349 Use ACTION_MIN, not SHRT_MIN.
15350 (token_actions): yydefact is rule_number_t*.
15351 (table_ninf_remap): New.
15352 (pack_table): Use it for `base' and `table'.
15353 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
15354 replaced with...
15355 (YYPACT_NINF, YYTABLE_NINF): these.
15356 (yypact, yytable): Compute their types instead of hard-coded
15357 `short'.
15358 * tests/regression.at (Web2c Actions): Adjust.
15359
15360 2002-07-19 Akim Demaille <akim@epita.fr>
15361
15362 * src/scan-gram.l (id): Can start with an underscore.
15363
15364 2002-07-16 Akim Demaille <akim@epita.fr>
15365
15366 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
15367 Adjust all former `associativity' dependencies.
15368 * src/symtab.c (symbol_new): Default associativity is `undef', not
15369 `right'.
15370 (symbol_check_alias_consistence): Adjust.
15371
15372 2002-07-09 Akim Demaille <akim@epita.fr>
15373
15374 * doc/bison.texinfo: Properly set the ``header'' part.
15375 Use @dircategory ``GNU programming tools'' as per Texinfo's
15376 documentation.
15377 Use @copying.
15378
15379 2002-07-09 Akim Demaille <akim@epita.fr>
15380
15381 * lib/quotearg.h: Protect against multiple inclusions.
15382 * src/location.h (location_t): Add a `file' member.
15383 (LOCATION_RESET, LOCATION_PRINT): Adjust.
15384 * src/complain.c (warn_at, complain_at, fatal_at): Drop
15385 `error_one_per_line' support.
15386
15387 2002-07-09 Akim Demaille <akim@epita.fr>
15388
15389 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
15390 * src/reader.c (lineno): Remove.
15391 Adjust all dependencies.
15392 (get_merge_function): Take a location and use complain_at.
15393 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
15394 * tests/regression.at (Invalid inputs, Mixing %token styles):
15395 Adjust.
15396
15397 2002-07-09 Akim Demaille <akim@epita.fr>
15398
15399 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
15400 recovery rule, and forbid extensions when --yacc.
15401 (gram_error): Use complain_at.
15402 * src/reader.c (reader): Exit if there were parse errors.
15403
15404 2002-07-09 Akim Demaille <akim@epita.fr>
15405
15406 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
15407 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
15408 Reported by R Blake <blakers@mac.com>.
15409
15410 2002-07-09 Akim Demaille <akim@epita.fr>
15411
15412 * data/yacc.c: Output the copyright notive in the header.
15413
15414 2002-07-03 Akim Demaille <akim@epita.fr>
15415
15416 * src/output.c (froms, tos): Are state_number_t.
15417 (save_column): sp, sp1, and sp2 are state_number_t.
15418 (prepare): Rename `final' as `final_state_number', `nnts' as
15419 `nterms_number', `nrules' as `rules_number', `nstates' as
15420 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
15421 unused.
15422 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
15423 * data/lalr1.cc (nsym_): Remove, unused.
15424
15425 2002-07-03 Akim Demaille <akim@epita.fr>
15426
15427 * src/lalr.h, src/lalr.c (goto_number_t): New.
15428 * src/lalr.c (goto_list_t): New.
15429 Propagate them.
15430 * src/nullable.c (rule_list_t): New.
15431 Propagate.
15432 * src/types.h: Remove.
15433
15434 2002-07-03 Akim Demaille <akim@epita.fr>
15435
15436 * src/closure.c (print_fderives): Use rule_rhs_print.
15437 * src/derives.c (print_derives): Use rule_rhs_print.
15438 (rule_list_t): New, replaces `shorts'.
15439 (set_derives): Add comments.
15440 * tests/sets.at (Nullable, Firsts): Adjust.
15441
15442 2002-07-03 Akim Demaille <akim@epita.fr>
15443
15444 * src/output.c (prepare_actions): Free `tally' and `width'.
15445 (prepare_actions): Allocate and free `order'.
15446 * src/symtab.c (symbols_free): Free `symbols'.
15447 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
15448 * src/output.c (m4_invoke): Move to...
15449 * src/scan-skel.l: here.
15450 (<<EOF>>): Close yyout, and free its name.
15451
15452 2002-07-03 Akim Demaille <akim@epita.fr>
15453
15454 Fix some memory leaks, and fix a bug: state 0 was examined twice.
15455
15456 * src/LR0.c (new_state): Merge into...
15457 (state_list_append): this.
15458 (new_states): Merge into...
15459 (generate_states): here.
15460 (set_states): Don't ensure a proper `errs' state member here, do it...
15461 * src/conflicts.c (conflicts_solve): here.
15462 * src/state.h, src/state.c: Comment changes.
15463 (state_t): Rename member `shifts' as `transitions'.
15464 Adjust all dependencies.
15465 (errs_new): For consistency, also take the values as argument.
15466 (errs_dup): Remove.
15467 (state_errs_set): New.
15468 (state_reductions_set, state_transitions_set): Assert that no
15469 previous value was assigned.
15470 (state_free): New.
15471 (states_free): Use it.
15472 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
15473 temporary storage: use `errs' and `nerrs' as elsewhere.
15474 (set_conflicts): Allocate and free this `errs'.
15475
15476 2002-07-02 Akim Demaille <akim@epita.fr>
15477
15478 * lib/libiberty.h: New.
15479 * lib: Update the bitset implementation from upstream.
15480 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
15481 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
15482 * src/main.c: Adjust bitset stats calls.
15483
15484 2002-07-01 Paul Eggert <eggert@twinsun.com>
15485
15486 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
15487 char, so that negative chars don't collide with $.
15488
15489 2002-06-30 Akim Demaille <akim@epita.fr>
15490
15491 Have the GLR tests be `warning' checked, and fix the warnings.
15492
15493 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
15494 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
15495 (yyremoveDeletes): `yyi' and `yyj' are size_t.
15496 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
15497 (yyaddDeferredAction): static.
15498 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
15499 (yyreportParseError): yyprefix is const.
15500 yytokenp is used only when verbose.
15501 (yy__GNUC__): Replace with __GNUC__.
15502 (yypdumpstack): yyi is size_t.
15503 (yypreference): Un-yy local variables and arguments, to avoid
15504 clashes with `yyr1'. Anyway, we are not in the user name space.
15505 (yytname_size): be an int, as is compared with ints.
15506 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
15507 Use them.
15508 * tests/cxx-gram.at: Use quotation to protect $1.
15509 Use AT_COMPILE to enable warnings hunts.
15510 Prototype yylex and yyerror.
15511 `Use' argc.
15512 Include `string.h', not `strings.h'.
15513 Produce and prototype stmtMerge only when used.
15514 yylex takes a location.
15515
15516 2002-06-30 Akim Demaille <akim@epita.fr>
15517
15518 We spend a lot of time in quotearg, in particular when --verbose.
15519
15520 * src/symtab.c (symbol_get): Store a quoted version of the key.
15521 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
15522 Adjust all callers.
15523
15524 2002-06-30 Akim Demaille <akim@epita.fr>
15525
15526 * src/state.h (reductions_t): Rename member `nreds' as num.
15527 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
15528 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
15529
15530 2002-06-30 Akim Demaille <akim@epita.fr>
15531
15532 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
15533 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
15534 (shifts_to): Rename as...
15535 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
15536 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
15537 (TRANSITION_IS_DISABLED, transitions_to): these.
15538
15539 2002-06-30 Akim Demaille <akim@epita.fr>
15540
15541 * src/print.c (print_shifts, print_gotos): Merge into...
15542 (print_transitions): this.
15543 (print_transitions, print_errs, print_reductions): Align the
15544 lookaheads columns.
15545 (print_core, print_transitions, print_errs, print_state,
15546 print_grammar): Output empty lines separator before, not after.
15547 (state_default_rule_compute): Rename as...
15548 (state_default_rule): this.
15549 * tests/conflicts.at (Defaulted Conflicted Reduction),
15550 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
15551 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
15552
15553 2002-06-30 Akim Demaille <akim@epita.fr>
15554
15555 Display items as we display rules.
15556
15557 * src/gram.h, src/gram.c (rule_lhs_print): New.
15558 * src/gram.c (grammar_rules_partial_print): Use it.
15559 * src/print.c (print_core): Likewise.
15560 * tests/conflicts.at (Defaulted Conflicted Reduction),
15561 (Unresolved SR Conflicts): Adjust.
15562 (Unresolved SR Conflicts): Adjust and rename as...
15563 (Resolved SR Conflicts): this, as was meant.
15564 * tests/regression.at (Web2c Report): Adjust.
15565
15566 2002-06-30 Akim Demaille <akim@epita.fr>
15567
15568 * src/print.c (state_default_rule_compute): New, extracted from...
15569 (print_reductions): here.
15570 Pessimize, but clarify the code.
15571 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
15572
15573 2002-06-30 Akim Demaille <akim@epita.fr>
15574
15575 * src/output.c (action_row): Let default_rule be always a rule
15576 number.
15577
15578 2002-06-30 Akim Demaille <akim@epita.fr>
15579
15580 * src/closure.c (print_firsts, print_fderives, closure):
15581 Use BITSET_EXECUTE.
15582 * src/lalr.c (lookaheads_print): Likewise.
15583 * src/state.c (state_rule_lookaheads_print): Likewise.
15584 * src/print_graph.c (print_core): Likewise.
15585 * src/print.c (print_reductions): Likewise.
15586 * src/output.c (action_row): Likewise.
15587 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
15588
15589 2002-06-30 Akim Demaille <akim@epita.fr>
15590
15591 * src/print_graph.c: Use report_flag.
15592
15593 2002-06-30 Akim Demaille <akim@epita.fr>
15594
15595 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
15596 to...
15597 * src/relation.h, src/relation.c (traverse, relation_digraph)
15598 (relation_print, relation_transpose): New.
15599
15600 2002-06-30 Akim Demaille <akim@epita.fr>
15601
15602 * src/state.h, src/state.c (shifts_to): New.
15603 * src/lalr.c (build_relations): Use it.
15604
15605 2002-06-30 Akim Demaille <akim@epita.fr>
15606
15607 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
15608 (item_number_of_rule_number, rule_number_of_item_number): New.
15609 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
15610 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
15611 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
15612 Propagate their use.
15613 Much remains to be done, in particular wrt `shorts' from types.h.
15614
15615 2002-06-30 Akim Demaille <akim@epita.fr>
15616
15617 * src/symtab.c (symbol_new): Initialize the `printer' member.
15618
15619 2002-06-30 Akim Demaille <akim@epita.fr>
15620
15621 * src/LR0.c (save_reductions): Remove, replaced by...
15622 * src/state.h, src/state.c (state_reductions_set): New.
15623 (reductions, errs): Rename as...
15624 (reductions_t, errs_t): these.
15625 Adjust all dependencies.
15626
15627 2002-06-30 Akim Demaille <akim@epita.fr>
15628
15629 * src/LR0.c (state_list_t, state_list_append): New.
15630 (first_state, last_state): Now symbol_list_t.
15631 (this_state): Remove.
15632 (new_itemsets, append_states, save_reductions): Take a state_t as
15633 argument.
15634 (set_states, generate_states): Adjust.
15635 (save_shifts): Remove, replaced by...
15636 * src/state.h, src/state.c (state_shifts_set): New.
15637 (shifts): Rename as...
15638 (shifts_t): this.
15639 Adjust all dependencies.
15640 * src/state.h (state_t): Remove the `next' member.
15641
15642 2002-06-30 Akim Demaille <akim@epita.fr>
15643
15644 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
15645 escaped in slot 0.
15646
15647 2002-06-30 Akim Demaille <akim@epita.fr>
15648
15649 Use hash.h for the state hash table.
15650
15651 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
15652 (allocate_storage): Use state_hash_new.
15653 (free_storage): Use state_hash_free.
15654 (new_state, get_state): Adjust.
15655 * src/lalr.h, src/lalr.c (states): Move to...
15656 * src/states.h (state_t): Remove the `link' member, no longer
15657 used.
15658 * src/states.h, src/states.c: here.
15659 (state_hash_new, state_hash_free, state_hash_lookup)
15660 (state_hash_insert, states_free): New.
15661 * src/states.c (state_table, state_compare, state_hash): New.
15662 * src/output.c (output_actions): Do not free states now, since we
15663 still need to know the final_state number in `prepare', called
15664 afterwards. Do it...
15665 * src/main.c (main): here: call states_free after `output'.
15666
15667 2002-06-30 Akim Demaille <akim@epita.fr>
15668
15669 * src/state.h, src/state.c (state_new): New, extracted from...
15670 * src/LR0.c (new_state): here.
15671 * src/state.h (STATE_ALLOC): Move to...
15672 * src/state.c: here.
15673 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
15674 * src/state.h, src/state.c: here.
15675
15676 2002-06-30 Akim Demaille <akim@epita.fr>
15677
15678 * src/reader.c (gensym): Rename as...
15679 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
15680 (getsym): Rename as...
15681 (symbol_get): this.
15682
15683 2002-06-30 Akim Demaille <akim@epita.fr>
15684
15685 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
15686 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
15687 * src/output.c, src/print.c, src/print_graph.c: Propagate.
15688 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
15689
15690 2002-06-30 Akim Demaille <akim@epita.fr>
15691
15692 Make the test suite pass with warnings checked.
15693
15694 * tests/actions.at (Printers and Destructors): Improve.
15695 Avoid unsigned vs. signed issues.
15696 * tests/calc.at: Don't exercise the scanner here, do it...
15697 * tests/input.at (Torturing the Scanner): here.
15698
15699 2002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15700
15701 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
15702 reorganize first lines parallel to yacc.c.
15703
15704 2002-06-28 Akim Demaille <akim@epita.fr>
15705
15706 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
15707 (b4_token_enum, b4_token_defines): New, factored from...
15708 * data/lalr1.cc, data/yacc.c, glr.c: here.
15709
15710 2002-06-28 Akim Demaille <akim@epita.fr>
15711
15712 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
15713 unused variables.
15714 * src/output.c (merger_output): static.
15715
15716 2002-06-28 Akim Demaille <akim@epita.fr>
15717
15718 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
15719 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
15720 pacify GCC.
15721 * src/output.c (save_row): Initialize all the variables to pacify GCC.
15722
15723 2002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15724
15725 Accumulated changelog for new GLR parsing features.
15726
15727 * src/conflicts.c (count_total_conflicts): Change name to
15728 conflicts_total_count.
15729 * src/conflicts.h: Ditto.
15730 * src/output.c (token_actions): Use the new name.
15731 (output_conflicts): Change conflp => conflict_list_heads, and
15732 confl => conflict_list for better readability.
15733 * data/glr.c: Use the new names.
15734 * NEWS: Add self to GLR announcement.
15735
15736 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
15737
15738 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
15739 Akim Demaille.
15740
15741 * data/bison.glr: Change name to glr.c
15742 * data/glr.c: Renamed from bison.glr.
15743 * data/Makefile.am: Add glr.c
15744
15745 * src/getargs.c:
15746
15747 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
15748 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
15749
15750 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15751
15752 * data/bison.glr: Be sure to restore the
15753 current #line when returning to the skeleton contents after having
15754 exposed the input file's #line.
15755
15756 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15757
15758 * data/bison.glr: Bring up to date with changes to bison.simple.
15759
15760 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15761
15762 * data/bison.glr: Correct definitions that use b4_prefix.
15763 Various reformatting.
15764 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
15765 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
15766 yytokenp argument; now part of stack.
15767 (yychar): Define to behave as documented.
15768 (yyclearin): Ditto.
15769
15770 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15771
15772 * src/reader.h: Add declaration for free_merger_functions.
15773
15774 * src/reader.c (merge_functions): New variable.
15775 (get_merge_function): New function.
15776 (free_merger_functions): New function.
15777 (readgram): Check for %prec that is not followed by a symbol.
15778 Handle %dprec and %merge declarations.
15779 (packgram): Initialize dprec and merger fields in rules array.
15780
15781 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
15782 conflict_list_cnt, conflict_list_free): New variables.
15783 (table_grow): Also grow conflict_table.
15784 (prepare_rules): Output dprec and merger tables.
15785 (conflict_row): New function.
15786 (action_row): Output conflict lists for GLR parser. Don't use
15787 default reduction in conflicted states for GLR parser so that there
15788 are spaces for the conflict lists.
15789 (save_row): Also save conflict information.
15790 (token_actions): Allocate conflict list.
15791 (merger_output): New function.
15792 (pack_vector): Pack conflict table, too.
15793 (output_conflicts): New function to output yyconflp and yyconfl.
15794 (output_check): Allocate conflict_tos.
15795 (output_actions): Output conflict tables, also.
15796 (output_skeleton): Output b4_mergers definition.
15797 (prepare): Output b4_max_rhs_length definition.
15798 Use 'bison.glr' as default skeleton for GLR parsers.
15799
15800 * src/gram.c (glr_parser): New flag.
15801 (grammar_free): Call free_merger_functions.
15802
15803 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
15804 all pairs of conflicting reductions, rather than just all tokens
15805 causing conflicts. Needed to size conflict tables.
15806 (conflicts_output): Modify call to count_rr_conflicts for new
15807 interface.
15808 (conflicts_print): Ditto.
15809 (count_total_conflicts): New function.
15810
15811 * src/reader.h (merger_list): New type.
15812 (merge_functions): New variable.
15813
15814 * src/lex.h (tok_dprec, tok_merge): New token types.
15815
15816 * src/gram.h (rule_s): Add dprec and merger fields.
15817 (glr_parser): New flag.
15818
15819 * src/conflicts.h (count_total_conflicts): New function.
15820
15821 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
15822
15823 * doc/bison.texinfo (Generalized LR Parsing): New section.
15824 (GLR Parsers): New section.
15825 (Language and Grammar): Mention GLR parsing.
15826 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
15827 Correct typo ("tge" -> "the").
15828
15829 * data/bison.glr: New skeleton for GLR parsing.
15830
15831 * tests/cxx-gram.at: New tests for GLR parsing.
15832
15833 * tests/testsuite.at: Include cxx-gram.at.
15834
15835 * tests/Makefile.am: Add cxx-gram.at.
15836
15837 * src/parse-gram.y:
15838
15839 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
15840
15841 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
15842
15843 2002-06-27 Akim Demaille <akim@epita.fr>
15844
15845 * src/options.h, src/options.c: Remove.
15846 * src/getargs.c (short_options, long_options): New.
15847
15848 2002-06-27 Akim Demaille <akim@epita.fr>
15849
15850 * data/bison.simple, data/bison.c++: Rename as...
15851 * data/yacc.c, data/lalr1.cc: these.
15852 * doc/bison.texinfo (Environment Variables): Remove.
15853
15854 2002-06-25 Raja R Harinath <harinath@cs.umn.edu>
15855
15856 * src/getargs.c (report_argmatch): Initialize strtok().
15857
15858 2002-06-20 Akim Demaille <akim@epita.fr>
15859
15860 * data/bison.simple (b4_symbol_actions): New, replaces...
15861 (b4_symbol_destructor, b4_symbol_printer): these.
15862 (yysymprint): Be sure to call YYPRINT only for tokens, and using
15863 user token numbers.
15864
15865 2002-06-20 Akim Demaille <akim@epita.fr>
15866
15867 * data/bison.simple (yydestructor): Rename as...
15868 (yydestruct): this.
15869
15870 2002-06-20 Akim Demaille <akim@epita.fr>
15871
15872 * src/symtab.h, src/symtab.c (symbol_type_set)
15873 (symbol_destructor_set, symbol_precedence_set): The location is
15874 the last argument.
15875 Adjust all callers.
15876
15877 2002-06-20 Akim Demaille <akim@epita.fr>
15878
15879 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
15880 internals.
15881 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
15882 Takes a location.
15883 * src/symtab.h, src/symtab.c (symbol_class_set)
15884 (symbol_user_token_number_set): Likewise.
15885 Adjust all callers.
15886 Promote complain_at.
15887 * tests/input.at (Type Clashes): Adjust.
15888
15889 2002-06-20 Akim Demaille <akim@epita.fr>
15890
15891 * data/bison.simple (YYLEX): Fix the declaration when
15892 %pure-parser.
15893
15894 2002-06-20 Akim Demaille <akim@epita.fr>
15895
15896 * data/bison.simple (yysymprint): Don't print the token number,
15897 just its name.
15898 * tests/actions.at (Destructors): Rename as...
15899 (Printers and Destructors): this.
15900 Also exercise %printer.
15901
15902 2002-06-20 Akim Demaille <akim@epita.fr>
15903
15904 * data/bison.simple (YYDSYMPRINT): New.
15905 Use it to remove many of the #if YYDEBUG/if (yydebug).
15906
15907 2002-06-20 Akim Demaille <akim@epita.fr>
15908
15909 * src/symtab.h, src/symtab.c (symbol_t): printer and
15910 printer_location are new members.
15911 (symbol_printer_set): New.
15912 * src/parse-gram.y (PERCENT_PRINTER): New token.
15913 Handle its associated rule.
15914 * src/scan-gram.l: Adjust.
15915 (handle_destructor_at, handle_destructor_dollar): Rename as...
15916 (handle_symbol_code_at, handle_symbol_code_dollar): these.
15917 * src/output.c (symbol_printers_output): New.
15918 (output_skeleton): Call it.
15919 * data/bison.simple (yysymprint): New. Cannot be named yyprint
15920 since there are already many grammar files with a user `yyprint'.
15921 Replace the calls to YYPRINT to calls to yysymprint.
15922 * tests/calc.at: Adjust.
15923 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
15924 taking advantage of parser very internal details (stack size!).
15925
15926 2002-06-20 Akim Demaille <akim@epita.fr>
15927
15928 * src/scan-gram.l: Complete the scanner with the missing patterns
15929 to pacify Flex.
15930 Use `quote' and `symbol_tag_get' where appropriate.
15931
15932 2002-06-19 Akim Demaille <akim@epita.fr>
15933
15934 * tests/actions.at (Destructors): Augment to test locations.
15935 * data/bison.simple (yydestructor): Pass it the current location
15936 if locations are enabled.
15937 Prototype only when __STDC__ or C++.
15938 Change the argument names to move into the yy name space: there is
15939 user code here.
15940
15941 2002-06-19 Akim Demaille <akim@epita.fr>
15942
15943 * data/bison.simple (b4_pure_if): New.
15944 Use it instead of #ifdef YYPURE.
15945
15946 2002-06-19 Akim Demaille <akim@epita.fr>
15947
15948 * data/bison.simple (b4_location_if): New.
15949 Use it instead of #ifdef YYLSP_NEEDED.
15950
15951 2002-06-19 Akim Demaille <akim@epita.fr>
15952
15953 Prepare @$ in %destructor, but currently don't bind it in the
15954 skeleton, as %location use is not cleaned up yet.
15955
15956 * src/scan-gram.l (handle_dollar, handle_destructor_at)
15957 (handle_action_at): New.
15958 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
15959 a braced_code_t and a location as additional arguments.
15960 (handle_destructor_dollar): Instead of requiring `b4_eval', just
15961 unquote one when outputting `b4_dollar_dollar'.
15962 Adjust callers.
15963 * data/bison.simple (b4_eval): Remove.
15964 (b4_symbol_destructor): Adjust.
15965 * tests/input.at (Invalid @n): Adjust.
15966
15967 2002-06-19 Zack Weinberg <zack@codesourcery.com>
15968
15969 * doc/bison.texinfo: Document ability to have multiple
15970 prologue sections.
15971
15972 2002-06-18 Akim Demaille <akim@epita.fr>
15973
15974 * src/files.c (compute_base_names): When computing the output file
15975 names from the input file name, strip the directory part.
15976
15977 2002-06-18 Akim Demaille <akim@epita.fr>
15978
15979 * data/bison.simple.new: Comment changes.
15980 Reported by Andreas Schwab.
15981
15982 2002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
15983
15984 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
15985 there are no `label `yyoverflowlab' defined but not used' warnings
15986 when yyoverflow is defined.
15987
15988 2002-06-18 Akim Demaille <akim@epita.fr>
15989
15990 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
15991 new member.
15992 (symbol_destructor_set): Adjust.
15993 * src/output.c (symbol_destructors_output): Output the destructor
15994 locations.
15995 Output the symbol name.
15996 * data/bison.simple (b4_symbol_destructor): Adjust.
15997
15998 2002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
15999 and Akim Demaille <akim@epita.fr>
16000
16001 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
16002 what's left on the stack when the error recovery hits EOF.
16003 * tests/actions.at (Destructors): Complete to exercise this case.
16004
16005 2002-06-17 Akim Demaille <akim@epita.fr>
16006
16007 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
16008 arguments is really empty, not only equal to `[]'.
16009 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
16010 member.
16011 (symbol_destructor_set): New.
16012 * src/output.c (symbol_destructors_output): New.
16013 * src/reader.h (brace_code_t, current_braced_code): New.
16014 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
16015 (handle_dollar): Rename as...
16016 (handle_action_dollar): this.
16017 (handle_destructor_dollar): New.
16018 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
16019 (grammar_declaration): Use it.
16020 * data/bison.simple (yystos): Is always defined.
16021 (yydestructor): New.
16022 * tests/actions.at (Destructors): New.
16023 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
16024
16025 2002-06-17 Akim Demaille <akim@epita.fr>
16026
16027 * src/symlist.h, src/symlist.c (symbol_list_length): New.
16028 * src/scan-gram.l (handle_dollar, handle_at): Compute the
16029 rule_length only when needed.
16030 * src/output.c (actions_output, token_definitions_output): Output
16031 the full M4 block.
16032 * src/symtab.c: Don't access directly to the symbol tag, use
16033 symbol_tag_get.
16034 * src/parse-gram.y: Use symbol_list_free.
16035
16036 2002-06-17 Akim Demaille <akim@epita.fr>
16037
16038 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
16039 (symbol_list_prepend, get_type_name): Move to...
16040 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
16041 (symbol_list_prepend, symbol_list_n_type_name_get): here.
16042 Adjust all callers.
16043 (symbol_list_free): New.
16044 * src/scan-gram.l (handle_dollar): Takes a location.
16045 * tests/input.at (Invalid $n): Adjust.
16046
16047 2002-06-17 Akim Demaille <akim@epita.fr>
16048
16049 * src/reader.h, src/reader.c (symbol_list_new): Export it.
16050 (symbol_list_prepend): New.
16051 * src/parse-gram.y (%union): `list' is a new member.
16052 (symbols.1): New, replaces...
16053 (terms_to_prec.1, nterms_to_type.1): these.
16054 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
16055 Take a location as additional argument.
16056 Adjust all callers.
16057
16058 2002-06-15 Akim Demaille <akim@epita.fr>
16059
16060 * src/parse-gram.y: Move %token in the declaration section so that
16061 we don't depend upon CVS Bison.
16062
16063 2002-06-15 Akim Demaille <akim@epita.fr>
16064
16065 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
16066 * src/print.c (print_core): Use it.
16067
16068 2002-06-15 Akim Demaille <akim@epita.fr>
16069
16070 * src/conflicts.c (log_resolution): Accept the rule involved in
16071 the sr conflicts instead of the lookahead number that points to
16072 that rule.
16073 (flush_reduce): Accept the current lookahead vector as argument,
16074 instead of the index in LA.
16075 (resolve_sr_conflict): Accept the current number of lookahead
16076 bitset to consider for the STATE, instead of the index in LA.
16077 (set_conflicts): Adjust.
16078 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
16079
16080 2002-06-15 Akim Demaille <akim@epita.fr>
16081
16082 * src/state.h (state_t): Replace the `lookaheadsp' member, a
16083 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
16084 Adjust all dependencies.
16085 * src/lalr.c (initialize_lookaheads): Split into...
16086 (states_lookaheads_count, states_lookaheads_initialize): these.
16087 (lalr): Adjust.
16088
16089 2002-06-15 Akim Demaille <akim@epita.fr>
16090
16091 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
16092 out of...
16093 (grammar_rules_print): here.
16094 * src/reduce.c (reduce_output): Use it.
16095 * tests/reduce.at (Useless Rules, Reduced Automaton)
16096 (Underivable Rules): Adjust.
16097
16098 2002-06-15 Akim Demaille <akim@epita.fr>
16099
16100 Copy BYacc's nice way to report the grammar.
16101
16102 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
16103 New.
16104 Don't print the rules' location, it is confusing and useless.
16105 (rule_print): Use grammar_rhs_print.
16106 * src/print.c (print_grammar): Use grammar_rules_print.
16107
16108 2002-06-15 Akim Demaille <akim@epita.fr>
16109
16110 Complete and rationalize `useless thing' warnings.
16111
16112 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
16113 (symbol_tag_print): New.
16114 Use them everywhere in place of accessing directly the tag member.
16115 * src/gram.h, src/gram.c (rule_print): New.
16116 Use it where a rule used to be printed `by hand'.
16117 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
16118 (reduce_grammar_tables): Report the useless rules.
16119 (reduce_print): Useless things are a warning, not an error.
16120 Report it as such.
16121 * tests/reduce.at (Useless Nonterminals, Useless Rules):
16122 (Reduced Automaton, Underivable Rules): Adjust.
16123 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
16124 * tests/conflicts.at (Unresolved SR Conflicts)
16125 (Solved SR Conflicts): Adjust.
16126
16127 2002-06-15 Akim Demaille <akim@epita.fr>
16128
16129 Let symbols have a location.
16130
16131 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
16132 (getsym): Adjust.
16133 Adjust all callers.
16134 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
16135 Use location_t, not int.
16136 * src/symtab.c (symbol_check_defined): Take advantage of the
16137 location.
16138 * tests/regression.at (Invalid inputs): Adjust.
16139
16140 2002-06-15 Akim Demaille <akim@epita.fr>
16141
16142 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
16143 (input): Don't try to initialize yylloc here, do it in the
16144 scanner.
16145 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
16146 * src/gram.h (rule_t): Change line and action_line into location
16147 and action_location, of location_t type.
16148 Adjust all dependencies.
16149 * src/location.h, src/location.c (empty_location): New.
16150 * src/reader.h, src/reader.c (grammar_start_symbol_set)
16151 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
16152 (grammar_current_rule_symbol_append)
16153 (grammar_current_rule_action_append): Expect a location as argument.
16154 * src/reader.c (grammar_midrule_action): Adjust to attach an
16155 action's location as dummy symbol location.
16156 * src/symtab.h, src/symtab.c (startsymbol_location): New.
16157 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
16158 the line numbers.
16159
16160 2002-06-14 Akim Demaille <akim@epita.fr>
16161
16162 Grammar declarations may be found in the grammar section.
16163
16164 * src/parse-gram.y (rules_or_grammar_declaration): New.
16165 (declarations): Each declaration may end with a semicolon, not
16166 just...
16167 (grammar_declaration): `"%union"'.
16168 (grammar): Branch to rules_or_grammar_declaration.
16169
16170 2002-06-14 Akim Demaille <akim@epita.fr>
16171
16172 * src/main.c (main): Invoke scanner_free.
16173
16174 2002-06-14 Akim Demaille <akim@epita.fr>
16175
16176 * src/output.c (m4_invoke): Extracted from...
16177 (output_skeleton): here.
16178 Free tempfile.
16179
16180 2002-06-14 Akim Demaille <akim@epita.fr>
16181
16182 * src/parse-gram.y (directives, directive, gram)
16183 (grammar_directives, precedence_directives, precedence_directive):
16184 Rename as...
16185 (declarations, declaration, grammar, grammar_declaration)
16186 (precedence_declaration, precedence_declarator): these.
16187 (symbol_declaration): New.
16188
16189 2002-06-14 Akim Demaille <akim@epita.fr>
16190
16191 * src/files.c (action_obstack): Remove, unused.
16192 (output_obstack): Remove it, and all its dependencies, as it is no
16193 longer needed.
16194 * src/reader.c (epilogue_set): Build the epilogue in the
16195 muscle_obstack.
16196 * src/output.h, src/output.c (muscle_obstack): Move to...
16197 * src/muscle_tab.h, src/muscle_tab.h: here.
16198 (muscle_init): Initialize muscle_obstack.
16199 (muscle_free): New.
16200 * src/main.c (main): Call it.
16201
16202 2002-06-14 Akim Demaille <akim@epita.fr>
16203
16204 * src/location.h: New, extracted from...
16205 * src/reader.h: here.
16206 * src/Makefile.am (noinst_HEADERS): Merge into
16207 (bison_SOURCES): this.
16208 Add location.h.
16209 * src/parse-gram.y: Use location_t instead of Bison's.
16210 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
16211 Use location_t instead of ints.
16212
16213 2002-06-14 Akim Demaille <akim@epita.fr>
16214
16215 * data/bison.simple, data/bison.c++: Be sure to restore the
16216 current #line when returning to the skeleton contents after having
16217 exposed the input file's #line.
16218
16219 2002-06-12 Akim Demaille <akim@epita.fr>
16220
16221 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
16222 eager.
16223 * tests/actions.at (Exotic Dollars): New.
16224
16225 2002-06-12 Akim Demaille <akim@epita.fr>
16226
16227 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
16228 ['"/] too eagerly.
16229 * tests/input.at (Torturing the Scanner): New.
16230
16231 2002-06-11 Akim Demaille <akim@epita.fr>
16232
16233 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
16234 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
16235 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
16236 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
16237 * src/reader.c (reader): Use it.
16238
16239 2002-06-11 Akim Demaille <akim@epita.fr>
16240
16241 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
16242 Adjust all callers.
16243 (scanner_last_string_free): New.
16244
16245 2002-06-11 Akim Demaille <akim@epita.fr>
16246
16247 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
16248 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
16249 (last_string, YY_OBS_FREE): New.
16250 Use them when returning an ID.
16251
16252 2002-06-11 Akim Demaille <akim@epita.fr>
16253
16254 Have Bison grammars parsed by a Bison grammar.
16255
16256 * src/reader.c, src/reader.h (prologue_augment): New.
16257 * src/reader.c (copy_definition): Remove.
16258
16259 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
16260 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
16261 (grammar_current_rule_prec_set, grammar_current_rule_check)
16262 (grammar_current_rule_symbol_append)
16263 (grammar_current_rule_action_append): Export.
16264 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
16265 (symbol_list_action_append): Remove.
16266 Hook the routines from reader.
16267 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
16268 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
16269
16270 * src/reader.c (read_declarations): Remove, unused.
16271
16272 * src/parse-gram.y: Handle the epilogue.
16273 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
16274 (grammar_start_symbol_set): this.
16275 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
16276 * src/reader.c (readgram): Remove, unused.
16277 (reader): Adjust to insert eoftoken and axiom where appropriate.
16278
16279 * src/reader.c (copy_dollar): Replace with...
16280 * src/scan-gram.h (handle_dollar): this.
16281 * src/parse-gram.y: Remove `%thong'.
16282
16283 * src/reader.c (copy_at): Replace with...
16284 * src/scan-gram.h (handle_at): this.
16285
16286 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
16287 New.
16288
16289 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
16290 time being.
16291
16292 * src/reader.h, src/reader.c (grammar_rule_end): New.
16293
16294 * src/parse.y (current_type, current_class): New.
16295 Implement `%nterm', `%token' support.
16296 Merge `%term' into `%token'.
16297 (string_as_id): New.
16298 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
16299 type name.
16300
16301 * src/parse-gram.y: Be sure to handle properly the beginning of
16302 rules.
16303
16304 * src/parse-gram.y: Handle %type.
16305 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
16306
16307 * src/parse-gram.y: More directives support.
16308 * src/options.c: No longer handle source directives.
16309
16310 * src/parse-gram.y: Fix %output.
16311
16312 * src/parse-gram.y: Handle %union.
16313 Use the prologue locations.
16314 * src/reader.c (parse_union_decl): Remove.
16315
16316 * src/reader.h, src/reader.c (epilogue_set): New.
16317 * src/parse-gram.y: Use it.
16318
16319 * data/bison.simple, data/bison.c++: b4_stype is now either not
16320 defined, then default to int, or to the contents of %union,
16321 without `union' itself.
16322 Adjust.
16323 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
16324
16325 * src/output.c (actions_output): Don't output braces, as they are
16326 already handled by the scanner.
16327
16328 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
16329 characters to themselves.
16330
16331 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
16332 that the epilogue has a proper #line.
16333
16334 * src/parse-gram.y: Handle precedence/associativity.
16335
16336 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
16337 a terminal.
16338 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
16339 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
16340 at all to define terminals that cannot be emitted.
16341
16342 * src/scan-gram.l: Escape M4 characters.
16343
16344 * src/scan-gram.l: Working properly with escapes in user
16345 strings/characters.
16346
16347 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
16348 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
16349 grammar.
16350 Use more modest sizes, as for the time being the parser does not
16351 release memory, and therefore the process swallows a huge amount
16352 of memory.
16353
16354 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
16355 stricter %token grammar.
16356
16357 * src/symtab.h (associativity): Add `undef_assoc'.
16358 (symbol_precedence_set): Do nothing when passed an undef_assoc.
16359 * src/symtab.c (symbol_check_alias_consistence): Adjust.
16360
16361 * tests/regression.at (Invalid %directive): Remove, as it is now
16362 meaningless.
16363 (Invalid inputs): Adjust to the new error messages.
16364 (Token definitions): The new grammar doesn't allow too many
16365 eccentricities.
16366
16367 * src/lex.h, src/lex.c: Remove.
16368 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
16369 (copy_character, copy_string2, copy_string, copy_identifier)
16370 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
16371 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
16372 (parse_action): Remove.
16373 * po/POTFILES.in: Adjust.
16374
16375 2002-06-11 Akim Demaille <akim@epita.fr>
16376
16377 * src/reader.c (parse_action): Don't store directly into the
16378 rule's action member: return the action as a string.
16379 Don't require `rule_length' as an argument: compute it.
16380 (grammar_current_rule_symbol_append)
16381 (grammar_current_rule_action_append): New, eved out from
16382 (readgram): here.
16383 Remove `action_flag', `rulelength', unused now.
16384
16385 2002-06-11 Akim Demaille <akim@epita.fr>
16386
16387 * src/reader.c (grammar_current_rule_prec_set).
16388 (grammar_current_rule_check): New, eved out from...
16389 (readgram): here.
16390 Remove `xaction', `first_rhs': useless.
16391 * tests/input.at (Type clashes): New.
16392 * tests/existing.at (GNU Cim Grammar): Adjust.
16393
16394 2002-06-11 Akim Demaille <akim@epita.fr>
16395
16396 * src/reader.c (grammar_midrule_action): New, Eved out from
16397 (readgram): here.
16398
16399 2002-06-11 Akim Demaille <akim@epita.fr>
16400
16401 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
16402 New.
16403 (readgram): Use them as replacement of inlined code, crule and
16404 crule1.
16405
16406 2002-06-11 Akim Demaille <akim@epita.fr>
16407
16408 * src/reader.c (grammar_end, grammar_symbol_append): New.
16409 (readgram): Use them.
16410 Make the use of `p' as local as possible.
16411
16412 2002-06-10 Akim Demaille <akim@epita.fr>
16413
16414 GCJ's parser requires the tokens to be defined before the prologue.
16415
16416 * data/bison.simple: Output the token definition before the user's
16417 prologue.
16418 * tests/regression.at (Braces parsing, Duplicate string)
16419 (Mixing %token styles): Check the output from bison.
16420 (Early token definitions): New.
16421
16422 2002-06-10 Akim Demaille <akim@epita.fr>
16423
16424 * src/symtab.c (symbol_user_token_number_set): Don't complain when
16425 assigning twice the same user number to a token, so that we can
16426 use it in...
16427 * src/lex.c (lex): here.
16428 Also use `symbol_class_set' instead of hand written code.
16429 * src/reader.c (parse_assoc_decl): Likewise.
16430
16431 2002-06-10 Akim Demaille <akim@epita.fr>
16432
16433 * src/symtab.c, src/symtab.c (symbol_class_set)
16434 (symbol_user_token_number_set): New.
16435 * src/reader.c (parse_token_decl): Use them.
16436 Use a switch instead of ifs.
16437 Use a single argument.
16438
16439 2002-06-10 Akim Demaille <akim@epita.fr>
16440
16441 Remove `%thong' support as it is undocumented, unused, duplicates
16442 `%token's job, and creates useless e-mail traffic with people who
16443 want to know what it is, why it is undocumented, unused, and
16444 duplicates `%token's job.
16445
16446 * src/reader.c (parse_thong_decl): Remove.
16447 * src/options.c (option_table): Remove "thong".
16448 * src/lex.h (tok_thong): Remove.
16449
16450 2002-06-10 Akim Demaille <akim@epita.fr>
16451
16452 * src/symtab.c, src/symtab.c (symbol_type_set)
16453 (symbol_precedence_set): New.
16454 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
16455 (value_components_used): Remove, unused.
16456
16457 2002-06-09 Akim Demaille <akim@epita.fr>
16458
16459 Move symbols handling code out of the reader.
16460
16461 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
16462 (axiom): Move to...
16463 * src/symtab.h, src/symtab.c: here.
16464
16465 * src/gram.c (start_symbol): Remove: use startsymbol->number.
16466 * src/reader.c (startval): Rename as...
16467 * src/symtab.h, src/symtab.c (startsymbol): this.
16468 * src/reader.c: Adjust.
16469
16470 * src/reader.c (symbol_check_defined, symbol_make_alias)
16471 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
16472 (token_translations_init)
16473 Move to...
16474 * src/symtab.c: here.
16475 * src/reader.c (packsymbols): Move to...
16476 * src/symtab.h, src/symtab.c (symbols_pack): here.
16477 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
16478 argument.
16479
16480 2002-06-03 Akim Demaille <akim@epita.fr>
16481
16482 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
16483 then statements.
16484
16485 2002-06-03 Akim Demaille <akim@epita.fr>
16486
16487 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
16488 structs with non literals.
16489 * src/scan-skel.l: never-interactive.
16490 * src/conflicts.c (enum conflict_resolution_e): No trailing
16491 comma.
16492 * src/getargs.c (usage): Split long literal strings.
16493 Reported by Hans Aberg.
16494
16495 2002-05-28 Akim Demaille <akim@epita.fr>
16496
16497 * data/bison.c++: Use C++ ostreams.
16498 (cdebug_): New member.
16499
16500 2002-05-28 Akim Demaille <akim@epita.fr>
16501
16502 * src/output.c (output_skeleton): Be sure to allocate enough room
16503 for `/' _and_ for `\0' in full_skeleton.
16504
16505 2002-05-28 Akim Demaille <akim@epita.fr>
16506
16507 * data/bison.c++: Catch up with bison.simple:
16508 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16509 and Paul Eggert <eggert@twinsun.com>: `error' handing.
16510 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
16511 and popping traces.
16512
16513 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16514
16515 * src/output.c (output_skeleton): Put an explicit path in front of
16516 the skeleton file name, rather than relying on the -I directory,
16517 to partially alleviate effects of having a skeleton file lying around
16518 in the current directory.
16519
16520 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16521
16522 * src/conflicts.c (log_resolution): Correct typo:
16523 obstack_printf should be obstack_fgrow1.
16524
16525 2002-05-26 Akim Demaille <akim@epita.fr>
16526
16527 * src/state.h (state_t): `solved_conflicts' is a new member.
16528 * src/LR0.c (new_state): Set it to 0.
16529 * src/conflicts.h, src/conflicts.c (print_conflicts)
16530 (free_conflicts, solve_conflicts): Rename as...
16531 (conflicts_print, conflicts_free, conflicts_solve): these.
16532 Adjust callers.
16533 * src/conflicts.c (enum conflict_resolution_e)
16534 (solved_conflicts_obstack): New, used by...
16535 (log_resolution): this.
16536 Adjust to attach the conflict resolution to each state.
16537 Complete the description with the precedence/associativity
16538 information.
16539 (resolve_sr_conflict): Adjust.
16540 * src/print.c (print_state): Output its solved_conflicts.
16541 * tests/conflicts.at (Unresolved SR Conflicts)
16542 (Solved SR Conflicts): Exercise --report=all.
16543
16544 2002-05-26 Akim Demaille <akim@epita.fr>
16545
16546 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
16547 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
16548 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
16549 (token_number_t, item_number_as_token_number)
16550 (token_number_as_item_number, muscle_insert_token_number_table):
16551 Rename as...
16552 (symbol_number_t, item_number_as_symbol_number)
16553 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
16554 these, since it is more appropriate.
16555
16556 2002-05-26 Akim Demaille <akim@epita.fr>
16557
16558 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
16559 `Error:' lines.
16560 * data/bison.simple (yystos) [YYDEBUG]: New.
16561 (yyparse) [YYDEBUG]: Display the symbols which are popped during
16562 error recovery.
16563 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
16564
16565 2002-05-25 Akim Demaille <akim@epita.fr>
16566
16567 * doc/bison.texinfo (Debugging): Split into...
16568 (Tracing): this new section, its former contents, and...
16569 (Understanding): this new section.
16570 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
16571 by...
16572 (report_flag): this.
16573 Adjust all dependencies.
16574 (report_args, report_types, report_argmatch): New.
16575 (usage, getargs): Report/support -r, --report.
16576 * src/options.h
16577 (struct option_table_struct): Rename as..,
16578 (struct option_table_s): this.
16579 Rename the `set_flag' member to `flag' to match with getopt_long's
16580 struct.
16581 * src/options.c (option_table): Split verbose into an entry for
16582 %verbose, and another for --verbose.
16583 Support --report/-r, so remove -r from the obsolete --raw.
16584 * src/print.c: Attach full item sets and lookaheads reports to
16585 report_flag instead of trace_flag.
16586 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
16587
16588 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16589 and Paul Eggert <eggert@twinsun.com>
16590
16591 * data/bison.simple (yyparse): Correct error handling to conform to
16592 POSIX and yacc. Specifically, after syntax error is discovered,
16593 do not reduce further before shifting the error token.
16594 Clean up the code a bit by removing the labels yyerrdefault,
16595 yyerrhandle, yyerrpop.
16596 * NEWS: Document the above.
16597
16598 2002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16599
16600 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
16601 type; it isn't always big enough, since it doesn't necessarily
16602 include non-terminals.
16603 (yytranslate): Expand definition of yy_token_number_type, so that
16604 the latter can be removed.
16605 (yy_token_number_type): Remove, only one use.
16606 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
16607 don't use TokenNumberType as element type.
16608
16609 * tests/regression.at: Modify expected output to agree with change
16610 to yyr1 and yytranslate.
16611
16612 2002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
16613
16614 * src/reader.c (parse_action): Use copy_character instead of
16615 obstack_1grow.
16616
16617 2002-05-13 Akim Demaille <akim@epita.fr>
16618
16619 * tests/regression.at (Token definitions): Prototype yylex and
16620 yyerror.
16621
16622 2002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16623
16624 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
16625 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
16626 32-bit arithmetic.
16627 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
16628
16629 2002-05-07 Akim Demaille <akim@epita.fr>
16630
16631 * tests/synclines.at: Be sure to prototype yylex and yyerror to
16632 avoid GCC warnings.
16633
16634 2002-05-07 Akim Demaille <akim@epita.fr>
16635
16636 Kill GCC warnings.
16637
16638 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
16639 over the RHS of each rule.
16640 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
16641 * src/state.h (state_t): Member `nitems' is unsigned short.
16642 * src/LR0.c (get_state): Adjust.
16643 * src/reader.c (packgram): Likewise.
16644 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
16645 `Type'.
16646 (muscle_insert_int_table): Remove, unused.
16647 (prepare_rules): Remove `max'.
16648
16649 2002-05-06 Akim Demaille <akim@epita.fr>
16650
16651 * src/closure.c (print_firsts): Display of the symbol tags.
16652 (bitmatrix_print): Move to...
16653 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
16654 here.
16655 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
16656
16657 2002-05-06 Akim Demaille <akim@epita.fr>
16658
16659 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
16660 hash_do_for_each.
16661
16662 2002-05-06 Akim Demaille <akim@epita.fr>
16663
16664 * src/LR0.c (new_state, get_state): Instead of using the global
16665 `kernel_size' and `kernel_base', have two new arguments:
16666 `core_size' and `core'.
16667 Adjust callers.
16668
16669 2002-05-06 Akim Demaille <akim@epita.fr>
16670
16671 * src/reader.c (packgram): No longer end `ritem' with a 0
16672 sentinel: it is not used.
16673
16674 2002-05-05 Akim Demaille <akim@epita.fr>
16675
16676 New experimental feature: display the lookaheads in the report and
16677 graph.
16678
16679 * src/print (print_core): When --trace-flag, display the rules
16680 lookaheads.
16681 * src/print_graph.c (print_core): Likewise.
16682 Swap the arguments.
16683 Adjust caller.
16684
16685 2002-05-05 Akim Demaille <akim@epita.fr>
16686
16687 * tests/torture.at (Many lookaheads): New test.
16688
16689 2002-05-05 Akim Demaille <akim@epita.fr>
16690
16691 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
16692 (GENERATE_MUSCLE_INSERT_TABLE): this.
16693 (output_int_table, output_unsigned_int_table, output_short_table)
16694 (output_token_number_table, output_item_number_table): Replace with...
16695 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
16696 (muscle_insert_short_table, muscle_insert_token_number_table)
16697 (muscle_insert_item_number_table): these.
16698 Adjust all callers.
16699 (prepare_tokens): Don't free `translations', since...
16700 * src/reader.h, src/reader.c (grammar_free): do it.
16701 Move to...
16702 * src/gram.h, src/gram.c (grammar_free): here.
16703 * data/bison.simple, data/bison.c++: b4_token_number_max is now
16704 b4_translate_max.
16705
16706 2002-05-05 Akim Demaille <akim@epita.fr>
16707
16708 * src/output.c (output_unsigned_int_table): New.
16709 (prepare_rules): `i' is unsigned.
16710 `prhs', `rline', `r2' are unsigned int.
16711 Rename muscle `rhs_number_max' as `rhs_max'.
16712 Output muscles `prhs_max', `rline_max', and `r2_max'.
16713 Free rline and r1.
16714 * data/bison.simple, data/bison.c++: Adjust to use these muscles
16715 to compute types instead of constant types.
16716 * tests/regression.at (Web2c Actions): Adjust.
16717
16718 2002-05-04 Akim Demaille <akim@epita.fr>
16719
16720 * src/symtab.h (SALIAS, SUNDEF): Rename as...
16721 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
16722 Adjust dependencies.
16723 * src/output.c (token_definitions_output): Be sure not to output a
16724 `#define 'a'' when fed with `%token 'a' "a"'.
16725 * tests/regression.at (Token definitions): New.
16726
16727 2002-05-03 Paul Eggert <eggert@twinsun.com>
16728
16729 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
16730 for K&R C.
16731
16732 2002-05-03 gettextize <bug-gnu-gettext@gnu.org>
16733
16734 * Makefile.am (SUBDIRS): Remove intl.
16735 (EXTRA_DIST): Add config/config.rpath.
16736
16737 2002-05-03 Akim Demaille <akim@epita.fr>
16738
16739 * data/bison.simple (m4_if): Don't output empty enums.
16740 And actually, output valid enum definitions :(.
16741
16742 2002-05-03 Akim Demaille <akim@epita.fr>
16743
16744 * configure.bat: Remove, completely obsolete.
16745 * Makefile.am (EXTRA_DIST): Adjust.
16746 Don't distribute config.rpath...
16747 * config/Makefile.am (EXTRA_DIST): Do it.
16748
16749 2002-05-03 Akim Demaille <akim@epita.fr>
16750
16751 * configure.in (GETTEXT_VERSION): New.
16752 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
16753
16754 2002-05-03 Akim Demaille <akim@epita.fr>
16755
16756 * data/bison.simple (b4_token_enum): New.
16757 (b4_token_defines): Use it to output tokens both as #define and
16758 enums.
16759 Suggested by Paul Eggert.
16760 * src/output.c (token_definitions_output): Don't output spurious
16761 white spaces.
16762
16763 2002-05-03 Akim Demaille <akim@epita.fr>
16764
16765 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
16766
16767 2002-05-02 Robert Anisko <robert@lrde.epita.fr>
16768
16769 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
16770 Update the stack class, give a try to deque as the default container.
16771
16772 2002-05-02 Akim Demaille <akim@epita.fr>
16773
16774 * data/bison.simple (yyparse): Do not implement @$ = @1.
16775 (YYLLOC_DEFAULT): Adjust to do it.
16776 * doc/bison.texinfo (Location Default Action): Fix.
16777
16778 2002-05-02 Akim Demaille <akim@epita.fr>
16779
16780 * src/reader.c (parse_braces): Merge into...
16781 (parse_action): this.
16782
16783 2002-05-02 Akim Demaille <akim@epita.fr>
16784
16785 * configure.in (ALL_LINGUAS): Remove.
16786 * po/LINGUAS, hr.po: New.
16787
16788 2002-05-02 Akim Demaille <akim@epita.fr>
16789
16790 Remove the so called hairy (semantic) parsers.
16791
16792 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
16793 * src/gram.h, src/gram.c (semantic_parser): Remove.
16794 (rule_t): Remove the guard and guard_line members.
16795 * src/lex.h (token_t): remove tok_guard.
16796 * src/options.c (option_table): Remove %guard and %semantic_parser
16797 support.
16798 * src/output.c, src/output.h (guards_output): Remove.
16799 (prepare): Adjust.
16800 (token_definitions_output): Don't output the `T'
16801 tokens (???).
16802 (output_skeleton): Don't output the guards.
16803 * src/files.c, src/files.c (attrsfile): Remove.
16804 * src/reader.c (symbol_list): Remove the guard and guard_line
16805 members.
16806 Adjust dependencies.
16807 (parse_guard): Remove.
16808 * data/bison.hairy: Remove.
16809 * doc/bison.texinfo (Environment Variables): Remove occurrences of
16810 BISON_HAIRY.
16811
16812 2002-05-02 Akim Demaille <akim@epita.fr>
16813
16814 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
16815 (parse_guard): Rename the formal argument `stack_offset' as
16816 `rule_length', which is more readable.
16817 Adjust callers.
16818 (copy_at, copy_dollar): Instead of outputting the hard coded
16819 values of $$, $n and so forth, output invocation to b4_lhs_value,
16820 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
16821 Note: this patch partially drops `semantic-parser' support: it
16822 always does `rule_length - n', where semantic parsers ought to
16823 always use `-n'.
16824 * data/bison.simple, data/bison.c++ (b4_lhs_value)
16825 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
16826
16827 2002-05-02 Akim Demaille <akim@epita.fr>
16828
16829 * configure.in (AC_INIT): Bump to 1.49b.
16830 (AM_INIT_AUTOMAKE): Short invocation.
16831
16832 2002-05-02 Akim Demaille <akim@epita.fr>
16833
16834 Version 1.49a.
16835
16836 2002-05-01 Akim Demaille <akim@epita.fr>
16837
16838 * src/skeleton.h: Remove.
16839
16840 2002-05-01 Akim Demaille <akim@epita.fr>
16841
16842 * src/skeleton.h: Fix the #endif.
16843 Reported by Magnus Fromreide.
16844
16845 2002-04-26 Paul Eggert <eggert@twinsun.com>
16846
16847 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
16848 Define if we define YYSTYPE and YYLTYPE, respectively.
16849 (YYCOPY): Fix [] quoting problem in the non-GCC case.
16850
16851 2002-04-25 Robert Anisko <robert@lrde.epita.fr>
16852
16853 * src/scan-skel.l: Postprocess quadrigraphs.
16854
16855 * src/reader.c (copy_character): New function, used to output
16856 single characters while replacing `[' and `]' with quadrigraphs, to
16857 avoid troubles with M4 quotes.
16858 (copy_comment): Output characters with copy_character.
16859 (read_additionnal_code): Likewise.
16860 (copy_string2): Likewise.
16861 (copy_definition): Likewise.
16862
16863 * tests/calc.at: Exercise M4 quoting.
16864
16865 2002-04-25 Akim Demaille <akim@epita.fr>
16866
16867 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
16868 between `!' and the command.
16869 Reported by Paul Eggert.
16870
16871 2002-04-24 Robert Anisko <robert@lrde.epita.fr>
16872
16873 * tests/calc.at: Exercise prologue splitting.
16874
16875 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
16876 `b4_post_prologue' instead of `b4_prologue'.
16877
16878 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
16879 muscles.
16880 (output): Free pre_prologue_obstack and post_prologue_obstack.
16881 * src/files.h, src/files.c (attrs_obstack): Remove.
16882 (pre_prologue_obstack, post_prologue_obstack): New.
16883 * src/reader.c (copy_definition): Add a parameter to specify the
16884 obstack to fill, instead of using attrs_obstack unconditionally.
16885 (read_declarations): Pass pre_prologue_obstack to copy_definition if
16886 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
16887
16888 2002-04-23 Paul Eggert <eggert@twinsun.com>
16889
16890 * data/bison.simple: Remove unnecessary commentary and white
16891 space differences from 1_29-branch.
16892 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
16893
16894 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
16895 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
16896 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
16897 constructors or destructors.
16898
16899 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
16900
16901 2002-04-23 Akim Demaille <akim@epita.fr>
16902
16903 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
16904 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
16905 location with columns.
16906 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
16907 All reported by Paul Eggert.
16908
16909 2002-04-22 Akim Demaille <akim@epita.fr>
16910
16911 * src/reduce.c (dump_grammar): Move to...
16912 * src/gram.h, src/gram.c (grammar_dump): here.
16913 Be sure to separate long item numbers.
16914 Don't read the members of a rule's prec if its nil.
16915
16916 2002-04-22 Akim Demaille <akim@epita.fr>
16917
16918 * src/output.c (table_size, table_grow): New.
16919 (MAXTABLE): Remove, replace uses with table_size.
16920 (pack_vector): Instead of dying when the table is too big, grow it.
16921
16922 2002-04-22 Akim Demaille <akim@epita.fr>
16923
16924 * data/bison.simple (yyr1): Its type is that of a token number.
16925 * data/bison.c++ (r1_): Likewise.
16926 * tests/regression.at (Web2c Actions): Adjust.
16927
16928 2002-04-22 Akim Demaille <akim@epita.fr>
16929
16930 * src/reader.c (token_translations_init): 256 is now the default
16931 value for the error token, i.e., it will be assigned another
16932 number if the user assigned 256 to one of her tokens.
16933 (reader): Don't force 256 to error.
16934 * doc/bison.texinfo (Symbols): Adjust.
16935 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
16936 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
16937 etc. instead of 10, 20, 30 (which was used to `jump' over error
16938 (256) and undefined (2)).
16939
16940 2002-04-22 Akim Demaille <akim@epita.fr>
16941
16942 Propagate more token_number_t.
16943
16944 * src/gram.h (token_number_as_item_number)
16945 (item_number_as_token_number): New.
16946 * src/output.c (GENERATE_OUTPUT_TABLE): New.
16947 Use it to create output_item_number_table and
16948 output_token_number_table.
16949 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
16950 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
16951 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
16952 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
16953
16954 2002-04-22 Akim Demaille <akim@epita.fr>
16955
16956 * src/output.h, src/output.c (get_lines_number): Remove.
16957
16958 2002-04-19 Akim Demaille <akim@epita.fr>
16959
16960 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
16961 as Lex/Flex'.
16962 (Debugging): More details about enabling the debugging features.
16963 (Table of Symbols): Describe $$, $n, @$, and @n.
16964 Suggested by Tim Josling.
16965
16966 2002-04-19 Akim Demaille <akim@epita.fr>
16967
16968 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
16969
16970 2002-04-10 Akim Demaille <akim@epita.fr>
16971
16972 * src/system.h: Rely on HAVE_LIMITS_H.
16973 Suggested by Paul Eggert.
16974
16975 2002-04-09 Akim Demaille <akim@epita.fr>
16976
16977 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
16978 full stderr, and strip it according to the bison options, instead
16979 of composing the error message from different bits.
16980 This makes it easier to check for several error messages.
16981 Adjust all the invocations.
16982 Add an invocation exercising the error token.
16983 Add an invocation demonstrating a stupid error message.
16984 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
16985 Adjust the tests.
16986 Error message are for stderr, not stdout.
16987
16988 2002-04-09 Akim Demaille <akim@epita.fr>
16989
16990 * src/gram.h, src/gram.c (error_token_number): Remove, use
16991 errtoken->number.
16992 * src/reader.c (reader): Don't specify the user token number (2)
16993 for $undefined, as it uselessly prevents using it.
16994 * src/gram.h (token_number_t): Move to...
16995 * src/symtab.h: here.
16996 (state_t.number): Is a token_number_t.
16997 * src/print.c, src/reader.c: Use undeftoken->number instead of
16998 hard coded 2.
16999 (Even though this 2 is not the same as above: the number of the
17000 undeftoken remains being 2, it is its user token number which
17001 might not be 2).
17002 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
17003 `user_token_number_max'.
17004 Output `undef_token_number'.
17005 * data/bison.simple, data/bison.c++: Use them.
17006 Be sure to map invalid yylex return values to
17007 `undef_token_number'. This saves us from gratuitous SEGV.
17008
17009 * tests/conflicts.at (Solved SR Conflicts)
17010 (Unresolved SR Conflicts): Adjust.
17011 * tests/regression.at (Web2c Actions): Adjust.
17012
17013 2002-04-08 Akim Demaille <akim@epita.fr>
17014
17015 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
17016 Adding #line.
17017 Remove the duplicate `typedefs'.
17018 (RhsNumberType): Fix the declaration and various other typos.
17019 Use __ofile__.
17020 * data/bison.simple: Use __ofile__.
17021 * src/scan-skel.l: Handle __ofile__.
17022
17023 2002-04-08 Akim Demaille <akim@epita.fr>
17024
17025 * src/gram.h (item_number_t): New, the type of item numbers in
17026 RITEM. Note that it must be able to code symbol numbers as
17027 positive number, and the negation of rule numbers as negative
17028 numbers.
17029 Adjust all dependencies (pretty many).
17030 * src/reduce.c (rule): Remove this `short *' pointer: use
17031 item_number_t.
17032 * src/system.h (MINSHORT, MAXSHORT): Remove.
17033 Include `limits.h'.
17034 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
17035 (shortcpy): Remove.
17036 (MAXTABLE): Move to...
17037 * src/output.c (MAXTABLE): here.
17038 (prepare_rules): Use output_int_table to output rhs.
17039 * data/bison.simple, data/bison.c++: Adjust.
17040 * tests/torture.at (Big triangle): Move the limit from 254 to
17041 500.
17042 * tests/regression.at (Web2c Actions): Ajust.
17043
17044 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
17045 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
17046 passes, but produces negative #line number, once fixed, GCC is
17047 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
17048 C), it passes.
17049 * src/state.h (state_h): Code input lines on ints, not shorts.
17050
17051 2002-04-08 Akim Demaille <akim@epita.fr>
17052
17053 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
17054 and then the grammar.
17055
17056 2002-04-08 Akim Demaille <akim@epita.fr>
17057
17058 * src/system.h: No longer using strndup.
17059
17060 2002-04-07 Akim Demaille <akim@epita.fr>
17061
17062 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
17063 * src/output.c (output_table_data): Return the longest number.
17064 (prepare_tokens): Output `token_number_max').
17065 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
17066 New.
17067 Use them to define yy_token_number_type/TokenNumberType.
17068 Use this type for yytranslate.
17069 * tests/torture.at (Big triangle): Push the limit from 124 to
17070 253.
17071 * tests/regression.at (Web2c Actions): Adjust.
17072
17073 2002-04-07 Akim Demaille <akim@epita.fr>
17074
17075 * tests/torture.at (Big triangle): New.
17076 (GNU AWK Grammar, GNU Cim Grammar): Move to...
17077 * tests/existing.at: here.
17078
17079 2002-04-07 Akim Demaille <akim@epita.fr>
17080
17081 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
17082 nritems.
17083 Adjust dependencies.
17084
17085 2002-04-07 Akim Demaille <akim@epita.fr>
17086
17087 * src/reader.c: Normalize increments to prefix form.
17088
17089 2002-04-07 Akim Demaille <akim@epita.fr>
17090
17091 * src/reader.c, symtab.c: Remove debugging code.
17092
17093 2002-04-07 Akim Demaille <akim@epita.fr>
17094
17095 Rename all the `bucket's as `symbol_t'.
17096
17097 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
17098 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
17099 * src/symtab.c, src/symtab.h (bucket): Rename as...
17100 (symbol_t): this.
17101 (symbol_list_new, bucket_check_defined, bucket_make_alias)
17102 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
17103 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
17104 (buckets_new, buckets_free, buckets_do): Rename as...
17105 (symbol_list_new, symbol_check_defined, symbol_make_alias)
17106 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
17107 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
17108 (symbols_new, symbols_free, symbols_do): these.
17109
17110 2002-04-07 Akim Demaille <akim@epita.fr>
17111
17112 Use lib/hash for the symbol table.
17113
17114 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
17115 EOF.
17116 * src/lex.c (lex): Set the `number' member of new terminals.
17117 * src/reader.c (bucket_check_defined, bucket_make_alias)
17118 (bucket_check_alias_consistence, bucket_translation): New.
17119 (reader, grammar_free, readgram, token_translations_init)
17120 (packsymbols): Adjust.
17121 (reader): Number the predefined tokens.
17122 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
17123 for predefined tokens.
17124 * src/symtab.h (bucket): Remove all the hash table related
17125 members.
17126 * src/symtab.c (symtab): Replace by...
17127 (bucket_table): this.
17128 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
17129 (buckets_new, buckets_do): New.
17130
17131 2002-04-07 Akim Demaille <akim@epita.fr>
17132
17133 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
17134 (start_symbol, max_user_token_number, semantic_parser)
17135 (error_token_number): Initialize.
17136 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
17137 Initialize.
17138 (reader): Don't.
17139 (errtoken, eoftoken, undeftoken, axiom): Extern.
17140
17141 2002-04-07 Akim Demaille <akim@epita.fr>
17142
17143 * src/gram.h (rule_s): prec and precsym are now pointers
17144 to the bucket giving the priority/associativity.
17145 Member `associativity' removed: useless.
17146 * src/reduce.c, src/conflicts.c: Adjust.
17147
17148 2002-04-07 Akim Demaille <akim@epita.fr>
17149
17150 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
17151 Properly escape the symbols' TAG when outputting them.
17152
17153 2002-04-07 Akim Demaille <akim@epita.fr>
17154
17155 * src/lalr.h (LA): Is a bitsetv, not bitset*.
17156
17157 2002-04-07 Akim Demaille <akim@epita.fr>
17158
17159 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
17160 (LArule): this, which is an array to rule_t*.
17161 * src/print.c, src/conflicts.c: Adjust.
17162
17163 2002-04-07 Akim Demaille <akim@epita.fr>
17164
17165 * src/gram.h (rule_t): Rename `number' as `user_number'.
17166 `number' is a new member.
17167 Adjust dependencies.
17168 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
17169
17170 2002-04-07 Akim Demaille <akim@epita.fr>
17171
17172 As a result of the previous patch, it is no longer needed
17173 to reorder ritem itself.
17174
17175 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
17176
17177 2002-04-07 Akim Demaille <akim@epita.fr>
17178
17179 Be sure never to walk through RITEMS, but use only data related to
17180 the rules themselves. RITEMS should be banished.
17181
17182 * src/output.c (output_token_translations): Rename as...
17183 (prepare_tokens): this.
17184 In addition to `translate', prepare the muscles `tname' and
17185 `toknum', which were handled by...
17186 (output_rule_data): this.
17187 Remove, and move the remainder of its outputs into...
17188 (prepare_rules): this new routines, which also merges content from
17189 (output_gram): this.
17190 (prepare_rules): Be sure never to walk through RITEMS.
17191 (output_stos): Rename as...
17192 (prepare_stos): this.
17193 (output): Always invoke prepare_states, after all, just don't use it
17194 in the output if you don't need it.
17195
17196 2002-04-07 Akim Demaille <akim@epita.fr>
17197
17198 * src/LR0.c (new_state): Display `nstates' as the name of the
17199 newly created state.
17200 Adjust to initialize first_state and last_state if needed.
17201 Be sure to distinguish the initial from the final state.
17202 (new_states): Create the itemset of the initial state, and use
17203 new_state.
17204 * src/closure.c (closure): Now that the initial state has its
17205 items properly set, there is no need for a special case when
17206 creating `ruleset'.
17207
17208 As a result, now the rule 0, reducing to $axiom, is visible in the
17209 outputs. Adjust the test suite.
17210
17211 * tests/conflicts.at (Solved SR Conflicts)
17212 (Unresolved SR Conflicts): Adjust.
17213 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
17214 * tests/conflicts.at (S/R in initial): New.
17215
17216 2002-04-07 Akim Demaille <akim@epita.fr>
17217
17218 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
17219 the RHS of the rules.
17220 * src/output.c (output_gram): Likewise.
17221
17222 2002-04-07 Akim Demaille <akim@epita.fr>
17223
17224 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
17225 bucket.
17226 Adjust all dependencies.
17227 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
17228 `number' of the buckets too.
17229 * src/gram.h: Include `symtab.h'.
17230 (associativity): Move to...
17231 * src/symtab.h: here.
17232 No longer include `gram.h'.
17233
17234 2002-04-07 Akim Demaille <akim@epita.fr>
17235
17236 * src/gram.h, src/gram.c (rules_rhs_length): New.
17237 (ritem_longest_rhs): Use it.
17238 * src/gram.h (rule_t): `number' is a new member.
17239 * src/reader.c (packgram): Set it.
17240 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
17241 the end of `rules', and count them out of `nrules'.
17242 (reduce_output, dump_grammar): Adjust.
17243 * src/print.c (print_grammar): It is no longer needed to check for
17244 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
17245 * tests/reduce.at (Reduced Automaton): New test.
17246
17247 2002-04-07 Akim Demaille <akim@epita.fr>
17248
17249 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
17250 lacking `+ 1' to nrules, Bison reported as useless a token if it
17251 was used solely to set the precedence of the last rule...
17252
17253 2002-04-07 Akim Demaille <akim@epita.fr>
17254
17255 * data/bison.c++, data/bison.simple: Don't output the current file
17256 name in #line, to avoid useless diffs between two identical
17257 outputs under different names.
17258
17259 2002-04-07 Akim Demaille <akim@epita.fr>
17260
17261 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
17262 Normalize loops to using `< nrules + 1', not `<= nrules'.
17263
17264 2002-04-07 Akim Demaille <akim@epita.fr>
17265
17266 * TODO: Update.
17267
17268 2002-04-07 Akim Demaille <akim@epita.fr>
17269
17270 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
17271 bucket.value as bucket.number.
17272
17273 2002-04-07 Akim Demaille <akim@epita.fr>
17274
17275 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
17276 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
17277 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
17278 RHS, instead of being an index in RITEMS.
17279
17280 2002-04-04 Paul Eggert <eggert@twinsun.com>
17281
17282 * doc/bison.texinfo: Update copyright date.
17283 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
17284 (Symbols): Warn about running Bison in one character set,
17285 but compiling and/or running in an incompatible one.
17286 Warn about character code 256, too.
17287
17288 2002-04-03 Paul Eggert <eggert@twinsun.com>
17289
17290 * src/bison.data (YYSTACK_ALLOC): Depend on whether
17291 YYERROR_VERBOSE is nonzero, not whether it is defined.
17292
17293 Merge changes from bison-1_29-branch.
17294
17295 2002-03-20 Paul Eggert <eggert@twinsun.com>
17296
17297 Merge fixes from Debian bison_1.34-1.diff.
17298
17299 * configure.in (AC_PREREQ): 2.53.
17300
17301 2002-03-20 Akim Demaille <akim@epita.fr>
17302
17303 * src/conflicts.c (log_resolution): Argument `resolution' is const.
17304
17305 2002-03-19 Paul Eggert <eggert@twinsun.com>
17306
17307 * src/bison.simple (YYCOPY): New macro.
17308 (YYSTACK_RELOCATE): Use it.
17309 Remove Type arg; no longer needed. All callers changed.
17310 (yymemcpy): Remove; no longer needed.
17311
17312 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
17313 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
17314
17315 2002-03-19 Akim Demaille <akim@epita.fr>
17316
17317 Test and fix the #line outputs.
17318
17319 * tests/atlocal.at (GCC): New.
17320 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
17321 (Prologue synch line, %union synch line, Postprologue synch line)
17322 (Action synch line, Epilogue synch line): New tests.
17323 * src/reader.c (parse_union_decl): Define the muscle stype_line.
17324 * data/bison.simple, data/bison.c++: Use it.
17325
17326 2002-03-19 Akim Demaille <akim@epita.fr>
17327
17328 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
17329 (Solved SR Conflicts, %expect not enough, %expect right)
17330 (%expect too much): Move to...
17331 * tests/conflicts.at: this new file.
17332
17333 2002-03-19 Akim Demaille <akim@epita.fr>
17334
17335 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
17336 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
17337 that we can move to enums for instance.
17338 * src/output.c (token_definitions_output): Output a list of
17339 `token-name, token-number' instead of the #define.
17340 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
17341
17342 2002-03-14 Akim Demaille <akim@epita.fr>
17343
17344 Use Gettext 0.11.1.
17345
17346 2002-03-09 Robert Anisko <robert@lrde.epita.fr>
17347
17348 * data/bison.c++: Make the user able to add members to the generated
17349 parser by subclassing.
17350
17351 2002-03-05 Robert Anisko <robert@lrde.epita.fr>
17352
17353 * src/reader.c (read_additionnal_code): `c' should be an integer, not
17354 a character.
17355 Reported by Nicolas Tisserand and Nicolas Burrus.
17356
17357 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
17358
17359 * src/reader.c: Warn about lacking semi-colons, do not complain.
17360
17361 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
17362
17363 * data/bison.c++: Remove a debug line.
17364
17365 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
17366
17367 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
17368 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
17369 provide a default implementation.
17370
17371 2002-03-04 Akim Demaille <akim@epita.fr>
17372
17373 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
17374 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
17375 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
17376 * tests/semantic.at (Parsing Guards): Similarly.
17377 * src/reader.at (readgram): Complain if the last rule is not ended
17378 with a semi-colon.
17379
17380 2002-03-04 Akim Demaille <akim@epita.fr>
17381
17382 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
17383 * src/closure.c: here.
17384 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
17385 RTC.
17386 * src/warshall.h, src/warshall.c: Remove.
17387 * tests/sets.at (Broken Closure): Adjust.
17388
17389 2002-03-04 Akim Demaille <akim@epita.fr>
17390
17391 * src/output.c (output_skeleton): tempdir is const.
17392 bytes_read is unused.
17393
17394 2002-03-04 Akim Demaille <akim@epita.fr>
17395
17396 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
17397 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
17398 Update.
17399 From Michael Hayes.
17400
17401 2002-03-04 Akim Demaille <akim@epita.fr>
17402
17403 * src/closure.c (closure): `r' is unused.
17404
17405 2002-03-04 Akim Demaille <akim@epita.fr>
17406
17407 * tests/sets.at (Broken Closure): Add the ending `;'.
17408 * src/reader.at (readgram): Complain if a rule is not ended with a
17409 semi-colon.
17410
17411 2002-03-04 Akim Demaille <akim@epita.fr>
17412
17413 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
17414 (count_sr_conflicts): Use bitset_count.
17415 * src/reduce.c (inaccessable_symbols): Ditto.
17416 (bits_size): Remove.
17417 * src/warshall.h, src/warshall.c: Convert to bitsetv.
17418
17419 2002-03-04 Akim Demaille <akim@epita.fr>
17420
17421 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
17422 * src/reduce.c: Remove the `bitset_zero's following the
17423 `bitset_create's, as now it is performed by the latter.
17424
17425 2002-03-04 Akim Demaille <akim@epita.fr>
17426
17427 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
17428 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
17429 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
17430 latest sources from Michael.
17431
17432 2002-03-04 Akim Demaille <akim@epita.fr>
17433
17434 * src/output.c (output): Don't free the grammar.
17435 * src/reader.c (grammar_free): New.
17436 * src/main.c (main): Call it and don't free symtab here.
17437
17438 2002-03-04 Akim Demaille <akim@epita.fr>
17439
17440 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
17441 before returning.
17442 Reported by Benoit Perrot.
17443
17444 2002-03-04 Akim Demaille <akim@epita.fr>
17445
17446 Use bitset operations when possible, not loops over bits.
17447
17448 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
17449 bitset_or.
17450 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
17451 * src/reduce.c (useless_nonterminals): Formatting changes.
17452 * src/warshall.c (TC): Use bitset_or.
17453
17454 2002-03-04 Akim Demaille <akim@epita.fr>
17455
17456 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
17457 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
17458 Ditto.
17459
17460 2002-03-04 Akim Demaille <akim@epita.fr>
17461
17462 * src/lalr.c (F): Now a bitset*.
17463 Adjust all dependencies.
17464
17465 2002-03-04 Akim Demaille <akim@epita.fr>
17466
17467 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
17468 Adjust all dependencies.
17469
17470 2002-03-04 Akim Demaille <akim@epita.fr>
17471
17472 * src/L0.c, src/LR0.h (nstates): Be size_t.
17473 Adjust comparisons (signed vs unsigned).
17474 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
17475 bitset*.
17476 Adjust all dependencies.
17477
17478 2002-03-04 Akim Demaille <akim@epita.fr>
17479
17480 * src/closure.c (firsts): Now, also a bitset.
17481 Adjust all dependencies.
17482 (varsetsize): Remove, now unused.
17483 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
17484
17485 2002-03-04 Akim Demaille <akim@epita.fr>
17486
17487 * src/print.c: Convert to use bitset.h, not hand coded iterations
17488 over ints.
17489
17490 2002-03-04 Akim Demaille <akim@epita.fr>
17491
17492 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
17493
17494 2002-03-04 Akim Demaille <akim@epita.fr>
17495
17496 * src/closure.c (ruleset): Be a bitset.
17497 (rulesetsize): Remove.
17498
17499 2002-03-04 Akim Demaille <akim@epita.fr>
17500
17501 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
17502 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
17503 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
17504 * src/closure.c (fderives): Be an array of bitsets.
17505
17506 2002-02-28 Robert Anisko <robert@lrde.epita.fr>
17507
17508 * data/bison.c++: Merge the two generated headers. Insert a copyright
17509 notice in each output file.
17510
17511 2002-02-28 Akim Demaille <akim@epita.fr>
17512
17513 * data/bison.c++: Copy the prologue of bison.simple to fetch
17514 useful M4 definitions, such as b4_header_guard.
17515
17516 2002-02-25 Akim Demaille <akim@epita.fr>
17517
17518 * src/getargs.c (version): Give the name of the authors, and use a
17519 translator friendly scheme for the bgr
17520 copyright notice.
17521
17522 2002-02-25 Akim Demaille <akim@epita.fr>
17523
17524 * src/output.c (header_output): Remove, now handled completely via
17525 M4.
17526
17527 2002-02-25 Akim Demaille <akim@epita.fr>
17528
17529 * m4/m4.m4: New, from CVS Autoconf.
17530 * configure.in: Invoke it.
17531 * src/output.c (output_skeleton): Use its result instead of the
17532 hard coded name.
17533
17534 2002-02-25 Akim Demaille <akim@epita.fr>
17535
17536 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
17537 Fileutils 4.1.5.
17538 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
17539 * src/output.c (output_skeleton): Use mkstemp to create a real
17540 temporary file.
17541 Move the filling of `skeleton' and its muscle to...
17542 (prepare): here.
17543 (output): Move the definition of the prologue muscle to...
17544 (prepare): here.
17545 * src/system.h (DEFAULT_TMPDIR): New.
17546
17547 2002-02-14 Paul Eggert <eggert@twinsun.com>
17548
17549 Remove the support for C++ namespace cleanliness; it was
17550 causing more problems than it was curing, since it didn't work
17551 properly on some nonstandard C++ compilers. This can wait
17552 for a proper C++ parser.
17553
17554 * NEWS: Document this.
17555 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
17556 of C++, as it's treated like C now.
17557 * src/bison.simple (YYSTD): Remove.
17558 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
17559 Treat C++ just like Standard C instead of trying to support
17560 namespace cleanliness.
17561
17562 2002-02-14 Akim Demaille <akim@epita.fr>
17563
17564 * tests/regression.at (else): Adjust to Andreas' change.
17565
17566 2002-02-14 Akim Demaille <akim@epita.fr>
17567
17568 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
17569
17570 2002-02-13 Andreas Schwab <schwab@suse.de>
17571
17572 * src/output.c (output_rule_data): Don't output NULL, it might
17573 not be defined yet.
17574
17575 2002-02-11 Robert Anisko <robert@lrde.epita.fr>
17576
17577 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
17578 (Copyright notice): Update.
17579
17580 2002-02-11 Akim Demaille <akim@epita.fr>
17581
17582 * tests/regression.at (%nonassoc and eof): Don't include
17583 nonportable headers.
17584
17585 2002-02-08 Robert Anisko <robert@lrde.epita.fr>
17586
17587 * data/bison.c++: Correct error recovery. Make the user able to
17588 initialize the starting location.
17589
17590 2002-02-07 Akim Demaille <akim@epita.fr>
17591
17592 * tests/input.at: New.
17593
17594 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
17595
17596 * data/bison.c++: Replace some direct m4 expansions by constants. Be
17597 more consistent when naming methods and variables. Put preprocessor
17598 directives around tables only needed for debugging.
17599
17600 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
17601
17602 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
17603 C++ parsers.
17604 (yy::b4_name::parse): Use print_.
17605
17606 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
17607
17608 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
17609
17610 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
17611
17612 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
17613 C++ parsers.
17614 (yy::b4_name::parse): Build verbose error messages, and use error_.
17615
17616 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
17617
17618 * data/bison.c++: Fix m4 quoting in comments.
17619
17620 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
17621
17622 * data/bison.c++: Adjust the parser code. Fix some muscles that were
17623 not expanded by m4.
17624
17625 2002-02-05 Akim Demaille <akim@epita.fr>
17626
17627 * data/bison.c++: Adjust to the M4 back end.
17628 More is certainly needed.
17629
17630 2002-02-05 Akim Demaille <akim@epita.fr>
17631
17632 Give a try to M4 as a back end.
17633
17634 * lib/readpipe.c: New, from wdiff.
17635 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
17636 BISON_HAIRY.
17637 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
17638 specific values. Now it is m4 that performs the lookup.
17639 * src/parse-skel.y: Remove.
17640 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
17641 * src/output.c (actions_output, guards_output)
17642 (token_definitions_output): No longer keeps track of the output
17643 line number, hence remove the second argument.
17644 (guards_output): Check against the guard member of a rule, not the
17645 action member.
17646 Adjust callers.
17647 (output_skeleton): Don't look for the skeleton location, let m4 do
17648 that.
17649 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
17650 file will be used.
17651 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
17652 (prepare): Given that for the time being changesyntax is not
17653 usable in M4, rename the muscles using `-' to `_'.
17654 Define `defines_flag', `output_parser_name' and `output_header_name'.
17655 * src/output.h (actions_output, guards_output)
17656 (token_definitions_output): Adjust prototypes.
17657 * src/scan-skel.l: Instead of scanning the skeletons, it now
17658 processes the output of m4: `__oline__' and `#output'.
17659 * data/bison.simple: Adjust to be used by M4(sugar).
17660 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
17661 to date.
17662 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
17663 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
17664 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
17665 shamelessly stolen from CVS Autoconf.
17666
17667 2002-02-05 Akim Demaille <akim@epita.fr>
17668
17669 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
17670 * configure.in: Check for the declarations of free and malloc.
17671 * src/muscle_tab.c: Adjust.
17672
17673 2002-02-05 Akim Demaille <akim@epita.fr>
17674
17675 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
17676 which have no values.
17677
17678 2002-02-05 Akim Demaille <akim@epita.fr>
17679
17680 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
17681 * data/: here.
17682
17683 2002-01-29 Paul Eggert <eggert@twinsun.com>
17684
17685 * src/bison.simple (YYSIZE_T): Do not define merely because
17686 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
17687 On some platforms, <alloca.h> does not declare YYSTD (size_t).
17688
17689 2002-01-27 Akim Demaille <akim@epita.fr>
17690
17691 Fix `%nonassoc and eof'.
17692
17693 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
17694 which were not properly copied! Replace
17695 memcpy (res->errs, src->errs, src->nerrs);
17696 with
17697 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
17698 !!!
17699 * tests/regression.at (%nonassoc and eof): Adjust to newest
17700 Autotest: `.' is not in the PATH.
17701
17702 2002-01-27 Akim Demaille <akim@epita.fr>
17703
17704 * tests/sets.at (AT_EXTRACT_SETS): New.
17705 (Nullable): Use it.
17706 (Firsts): New.
17707
17708 2002-01-26 Akim Demaille <akim@epita.fr>
17709
17710 * tests/actions.at, tests/calc.at, tests/headers.at,
17711 * tests/torture.at: Adjust to the newest Autotest which no longer
17712 forces `.' in the PATH.
17713
17714 2002-01-25 Akim Demaille <akim@epita.fr>
17715
17716 * tests/regression.at (%nonassoc and eof): New.
17717 Suggested by Robert Anisko.
17718
17719 2002-01-24 Akim Demaille <akim@epita.fr>
17720
17721 Bison dumps core when trying to complain about broken input files.
17722 Reported by Cris van Pelt.
17723
17724 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
17725 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
17726 into...
17727 (Invalid inputs): Strengthen: exercise parse_percent_token.
17728
17729 2002-01-24 Robert Anisko <robert.anisko@epita.fr>
17730
17731 * src/Makefile.am: Add bison.c++.
17732 * src/bison.c++: New skeleton.
17733
17734 2002-01-21 Paolo Bonzini <bonzini@gnu.org>
17735
17736 * po/it.po: New.
17737
17738 2002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
17739
17740 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
17741
17742 2002-01-20 Marc Autret <marc@gnu.org>
17743
17744 * src/files.c (compute_output_file_names): Fix
17745
17746 2002-01-20 Marc Autret <marc@gnu.org>
17747
17748 * tests/output.at: New test.
17749 * src/files.c (compute_base_names): Don't map extensions when
17750 the YACC flag is set, use defaults.
17751 Reported by Evgeny Stambulchik.
17752
17753 2002-01-20 Marc Autret <marc@gnu.org>
17754
17755 * src/system.h: Need to define __attribute__ away for non-GCC
17756 compilers as well (i.e., the vendor C compiler).
17757 Suggested by Albert Chin-A-Young.
17758
17759 2002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
17760
17761 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
17762 canonical definition.
17763 * src/system.h: Use the canonical definition for PARAMS (avoids
17764 a conflict with the macro from lib/hash.h).
17765
17766 2002-01-11 Akim Demaille <akim@epita.fr>
17767
17768 * configure.in: Use AC_FUNC_STRNLEN.
17769 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
17770
17771 2002-01-09 Akim Demaille <akim@epita.fr>
17772
17773 * src/files.c, src/files.h (output_infix): New.
17774 (tab_extension): Remove.
17775 (compute_base_names): Compute the former, drop the latter.
17776 * src/output.c (prepare): Insert the muscles `output-infix', and
17777 `output-suffix'.
17778 * src/parse-skel.y (string, string.1): New.
17779 (section.header): Use it.
17780 (section.yacc): Remove.
17781 (prefix): Remove too.
17782 * src/scan-skel.l: Adjust.
17783 * src/bison.simple, src/bison.hairy: Adjust.
17784
17785 2002-01-09 Akim Demaille <akim@epita.fr>
17786
17787 * configure.in (WERROR_CFLAGS): Compute it.
17788 * src/Makefile.am (CFLAGS): Pass it.
17789 * tests/atlocal.in (CFLAGS): Idem.
17790 * src/files.c: Fix a few warnings.
17791 (get_extension_index): Remove, unused.
17792
17793 2002-01-08 Akim Demaille <akim@epita.fr>
17794
17795 * src/getargs.c (AS_FILE_NAME): New.
17796 (getargs): Use it to convert DOSish file names.
17797 * src/files.c (base_name): Rename as full_base_name to avoid
17798 clashes with `base_name ()'.
17799 (filename_split): New.
17800 (compute_base_names): N-th rewrite, using filename_split.
17801
17802 2002-01-08 Akim Demaille <akim@epita.fr>
17803
17804 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
17805 New, stolen from the Fileutils 4.1.
17806 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
17807 * configure.in: Check for the presence of memrchr, and of its
17808 prototype.
17809
17810 2002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
17811
17812 * lib/hash.h (__P): Added definition for this macro.
17813 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
17814 BUILT_SOURCES, to ensure they are generated first.
17815 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
17816 %error-verbose to allow bootstrapping with bison 1.30x.
17817
17818 2002-01-06 Akim Demaille <akim@epita.fr>
17819
17820 * src/reader.c (parse_braces): Don't fetch the next char, the
17821 convention is to fetch on entry.
17822 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
17823 'switch' without a following semicolon.
17824 * tests/regression.at (braces parsing): New.
17825
17826 2002-01-06 Akim Demaille <akim@epita.fr>
17827
17828 Bison is dead wrong in its RR conflict reports.
17829
17830 * tests/torture.at (GNU Cim Grammar): New.
17831 * src/conflicts.c (count_rr_conflicts): Fix.
17832
17833 2002-01-06 Akim Demaille <akim@epita.fr>
17834
17835 Creating package.m4 from configure.ac causes too many problems.
17836
17837 * tests/Makefile.am (package.m4): Create it by hand,
17838 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
17839
17840 2002-01-06 Akim Demaille <akim@epita.fr>
17841
17842 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
17843 skeleton.h.
17844
17845 2002-01-04 Paul Eggert <eggert@twinsun.com>
17846
17847 * doc/bison.texinfo (Debugging):
17848 Remove YYSTDERR; it's no longer defined or used.
17849 Also, s/cstdio.h/cstdio/.
17850
17851 2002-01-03 Akim Demaille <akim@epita.fr>
17852
17853 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
17854
17855 2002-01-03 Akim Demaille <akim@epita.fr>
17856
17857 * src/parse-skel.y (process_skeleton): Don't bind the parser's
17858 tracing code to --trace, wait for a better --trace option, with
17859 args.
17860
17861 2002-01-03 Akim Demaille <akim@epita.fr>
17862
17863 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
17864 The ISO C++ standard is extremely clear about it: stderr is
17865 considered a macro, not a regular symbol (see table 94 `Header
17866 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
17867 Therefore std:: does not apply to it. It still does with fprintf.
17868 Also, s/cstdio.h/cstdio/.
17869
17870 2002-01-03 Akim Demaille <akim@epita.fr>
17871
17872 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
17873 for non system headers.
17874
17875 2002-01-02 Akim Demaille <akim@epita.fr>
17876
17877 Equip the skeleton chain with location tracking, runtime trace,
17878 pure parser and scanner.
17879
17880 * src/parse-skel.y: Request a pure parser, locations, and prefix
17881 renaming.
17882 (%union): Having several members with the same type does not help
17883 type mismatches, simplify.
17884 (YYPRINT, yyprint): New.
17885 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
17886 (skel_error): this.
17887 Handle locations.
17888 * src/scan-skel.l: Adjust to these changes.
17889 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
17890 (LOCATION_PRINT, skel_control_t): New.
17891
17892 2001-12-30 Akim Demaille <akim@epita.fr>
17893
17894 * src/parse-skel.y: Get rid of the shift/reduce conflict:
17895 replace `gb' with BLANKS.
17896 * src/scan-skel.l: Adjust.
17897
17898 2001-12-30 Akim Demaille <akim@epita.fr>
17899
17900 * src/system.h: We don't need nor want bcopy.
17901 Throw away MS-DOS crap: we don't need getpid.
17902 * configure.in: We don't need strndup. It was even causing
17903 problems: because Flex includes the headers *before* us,
17904 _GNU_SOURCE is not defined by config.h, and therefore strndup was
17905 not visible.
17906 * lib/xstrndup.c: New.
17907 * src/scan-skel.l: Use it.
17908 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
17909 * src/parse-skel.y: Use %directives instead of #defines.
17910
17911 2001-12-30 Akim Demaille <akim@epita.fr>
17912
17913 * src/skeleton.h: New.
17914 * src/output.c (output_parser, output_master_parser): Remove, dead
17915 code.
17916 * src/output.h (get_lines_number, actions_output, guards_output)
17917 (token_definitions_output): Prototype them.
17918 * src/parse-skel.y: Add the license notice.
17919 Include output.h and skeleton.h.
17920 (process_skeleton): Returns void, and takes a single parameter.
17921 * src/scan-skel.l: Add the license notice.
17922 Include skeleton.h.
17923 Don't use %option yylineno: it seems that then Flex imagines
17924 REJECT has been used, and therefore it won't reallocate its
17925 buffers (which makes no other sense to me than a bug). It results
17926 in warnings for `unused: yy_flex_realloc'.
17927
17928 2001-12-30 Robert Anisko <robert.anisko@epita.fr>
17929
17930 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
17931 (MUSCLE_INSERT_PREFIX): ...to there.
17932 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
17933 (MUSCLE_INSERT_PREFIX): Move from here...
17934
17935 * src/bison.hairy: Add a section directive. Put braces around muscle
17936 names. This parser skeleton is still broken, but Bison should not
17937 choke on a bad muscle 'syntax'.
17938 * src/bison.simple: Add a section directive. Put braces around muscle
17939 names.
17940
17941 * src/files.h (strsuffix, stringappend): Add declarations.
17942 (tab_extension): Add declaration.
17943 (short_base_name): Add declaration.
17944
17945 * src/files.c (strsuffix, stringappend): No longer static. These
17946 functions are used in the skeleton parser.
17947 (tab_extension): New.
17948 (compute_base_names): Use the computations done in this function
17949 to guess if the generated parsers should have '.tab' in their
17950 names.
17951 (short_base_name): No longer static.
17952
17953 * src/output.c (output_skeleton): New.
17954 (output): Disable call to output_master_parser, and give a try to
17955 a new skeleton handling system.
17956 (guards_output, actions_output): No longer static.
17957 (token_definitions_output, get_lines_number): No longer static.
17958
17959 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
17960
17961 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
17962 parse-skel.y.
17963
17964 * src/parse-skel.y: New file.
17965 * src/scan-skel.l: New file.
17966
17967 2001-12-29 Akim Demaille <akim@epita.fr>
17968
17969 %name-prefix is broken.
17970
17971 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
17972 Adjust all dependencies.
17973 * tests/headers.at (export YYLTYPE): Strengthen this test: use
17974 %name-prefix.
17975
17976 Renaming yylval but not yylloc is not consistent. Now we do.
17977
17978 * src/bison.simple: Prefix yylloc if used.
17979 * doc/bison.texinfo (Decl Summary): Document that.
17980
17981 2001-12-29 Akim Demaille <akim@epita.fr>
17982
17983 * doc/bison.texinfo: Promote `%long-directive' over
17984 `%long_directive'.
17985 Remove all references to fixed-output-files, yacc is enough.
17986
17987 2001-12-29 Akim Demaille <akim@epita.fr>
17988
17989 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
17990 user prologue. These are defaults.
17991 * tests/actions.at (Mid-rule actions): Make sure the user can
17992 define YYDEBUG and YYERROR_VERBOSE.
17993
17994 2001-12-29 Akim Demaille <akim@epita.fr>
17995
17996 * src/output.c (header_output): Don't forget to export YYLTYPE and
17997 yylloc.
17998 * tests/headers.at (export YYLTYPE): New, make sure it does.
17999 * tests/regression.at (%union and --defines, Invalid CPP headers):
18000 Move to...
18001 * tests/headers.at: here.
18002
18003 2001-12-29 Akim Demaille <akim@epita.fr>
18004
18005 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
18006
18007 2001-12-29 Akim Demaille <akim@epita.fr>
18008
18009 * tests/actions.at (Mid-rule actions): Output on a single line
18010 instead of several.
18011
18012 2001-12-29 Akim Demaille <akim@epita.fr>
18013
18014 * doc/bison.texinfo: Formatting changes.
18015
18016 2001-12-29 Akim Demaille <akim@epita.fr>
18017
18018 Don't store the token defs in a muscle, just be ready to output it
18019 on command. Now possible via `symbols'. Fixes a memory leak.
18020
18021 * src/output.c (token_definitions_output): New.
18022 (output_parser, header_output): Use it.
18023 * src/reader.c (symbols_save): Remove.
18024
18025 2001-12-29 Akim Demaille <akim@epita.fr>
18026
18027 * src/bison.simple: Do not provide a default for YYSTYPE and
18028 YYLTYPE before the user's prologue. Otherwise it's hardly... a
18029 default.
18030
18031 2001-12-29 Akim Demaille <akim@epita.fr>
18032
18033 Mid-rule actions are simply... ignored!
18034
18035 * src/reader.c (readgram): Be sure to attach mid-rule actions to
18036 the empty-rule associated to the dummy symbol, not to the host
18037 rule.
18038 * tests/actions.at (Mid-rule actions): New.
18039
18040 2001-12-29 Akim Demaille <akim@epita.fr>
18041
18042 Memory leak.
18043
18044 * src/reader.c (reader): Free grammar.
18045
18046 2001-12-29 Akim Demaille <akim@epita.fr>
18047
18048 Memory leak.
18049
18050 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
18051 since it allocates it for each state, although only one is needed.
18052 (allocate_storage): Do it here.
18053
18054 2001-12-29 Akim Demaille <akim@epita.fr>
18055
18056 * src/options.h, src/options.c (create_long_option_table): Rename
18057 as...
18058 (long_option_table_new): this, with a clearer prototype.
18059 (percent_table): Remove, unused,
18060 * src/getargs.c (getargs): Adjust.
18061
18062 2001-12-29 Akim Demaille <akim@epita.fr>
18063
18064 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
18065 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
18066 as states.
18067
18068 2001-12-29 Akim Demaille <akim@epita.fr>
18069
18070 * src/lalr.c (build_relations): Rename `states' as `states1'.
18071 Sorry, I don't understand exactly what it is, no better name...
18072
18073 2001-12-29 Akim Demaille <akim@epita.fr>
18074
18075 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
18076 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
18077 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
18078 as rules.
18079
18080 2001-12-29 Akim Demaille <akim@epita.fr>
18081
18082 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
18083 ago.
18084
18085 2001-12-29 Akim Demaille <akim@epita.fr>
18086
18087 * src/reader.c, src/reader.h (user_toknums): Remove.
18088 Adjust all users to use symbols[i]->user_token_number.
18089
18090 2001-12-29 Akim Demaille <akim@epita.fr>
18091
18092 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
18093 Adjust all users to use symbols[i]->prec or ->assoc.
18094
18095 2001-12-29 Akim Demaille <akim@epita.fr>
18096
18097 * src/reader.c, src/reader.h (tags): Remove.
18098 Adjust all users to use symbols[i]->tag.
18099
18100 2001-12-29 Akim Demaille <akim@epita.fr>
18101
18102 * src/gram.h, src/gram.c (symbols): New, similar to state_table
18103 and rule_table.
18104 * src/reader.c (packsymbols): Fill this table.
18105 Drop sprec.
18106 * src/conflicts.c (resolve_sr_conflict): Adjust.
18107 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
18108 single table.
18109 Use symbols[i]->tag instead of tags[i].
18110
18111 2001-12-29 Akim Demaille <akim@epita.fr>
18112
18113 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
18114 In addition, put a comment in there, to replace...
18115 * tests/regression.at (%union and C comments): Remove.
18116
18117 2001-12-29 Akim Demaille <akim@epita.fr>
18118
18119 * tests/regression.at (Web2c Actions): Blindly move the actual
18120 output as expected output. The contents *seem* right to me, but I
18121 can't pretend reading perfectly parser tables... Nonetheless, all
18122 the other tests pass correctly, the table look OK, even though the
18123 presence of `$axiom' is to be noted: AFAICS it is useless (but
18124 harmless).
18125
18126 2001-12-29 Akim Demaille <akim@epita.fr>
18127
18128 * src/reader.c (readgram): Don't add the rule 0 if there were no
18129 rules read. In other words, add it _after_ having performed
18130 grammar sanity checks.
18131 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
18132
18133 2001-12-29 Akim Demaille <akim@epita.fr>
18134
18135 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
18136 visible, and some states have now a different number.
18137
18138 2001-12-29 Akim Demaille <akim@epita.fr>
18139
18140 * src/reader.c (readgram): Bind the initial rule's lineno to that
18141 of the first rule.
18142 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
18143 (Solved SR Conflicts): Adjust rule 0's line number.
18144
18145 2001-12-29 Akim Demaille <akim@epita.fr>
18146
18147 Fix the `GAWK Grammar' failure.
18148
18149 * src/LR0.c (final_state): Initialize to -1 so that we do compute
18150 the reductions of the first state which was mistakenly confused
18151 with the final state because precisely final_state was initialized
18152 to 0.
18153 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
18154 now noticed by Bison.
18155 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
18156 have a reduction on $default.
18157
18158 2001-12-29 Akim Demaille <akim@epita.fr>
18159
18160 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
18161 rule line numbers.
18162 * src/closure.c (print_closure): Likewise.
18163 * src/derives.c (print_derives): Likewise.
18164 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
18165 now.
18166
18167 2001-12-29 Akim Demaille <akim@epita.fr>
18168
18169 * src/lalr.c (lookaheads_print): New.
18170 (lalr): Call it when --trace-flag.
18171 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
18172 are dumped.
18173
18174 2001-12-29 Akim Demaille <akim@epita.fr>
18175
18176 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
18177 when walking through ritem, even via rule->rhs.
18178 * src/reduce.c (dump_grammar, useful_production, reduce_output)
18179 (useful_production, useless_nonterminals): Likewise.
18180 (reduce_grammar_tables): Likewise, plus update nritems.
18181 * src/nullable.c (set_nullable): Likewise.
18182 * src/lalr.c (build_relations): Likewise.
18183 * tests/sets.at (Nullable): Adjust.
18184 Fortunately, now, the $axiom is no longer nullable.
18185
18186 2001-12-29 Akim Demaille <akim@epita.fr>
18187
18188 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
18189 the 0-sentinel.
18190 * src/gram.c (ritem_longest_rhs): Likewise.
18191 * src/reduce.c (nonterminals_reduce): Likewise.
18192 * src/print_graph.c (print_graph): Likewise.
18193 * src/output.c (output_rule_data): Likewise.
18194 * src/nullable.c (set_nullable): Likewise.
18195
18196 2001-12-29 Akim Demaille <akim@epita.fr>
18197
18198 * src/output.c: Comment changes.
18199
18200 2001-12-27 Paul Eggert <eggert@twinsun.com>
18201
18202 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
18203 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
18204 Sparc, as they were causing more porting problems than the
18205 (minor) performance improvement was worth.
18206
18207 Also, catch up with 1.31's YYSTD.
18208
18209 2001-12-27 Akim Demaille <akim@epita.fr>
18210
18211 * src/output.c (output_gram): Rely on nritems, not the
18212 0-sentinel. See below.
18213 Use -1 as separator, not 0.
18214 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
18215 Rely on -1 as separator in yyrhs, instead of 0.
18216 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
18217 twice `Now at end of input', therefore there are two lines less to
18218 expect.
18219
18220 2001-12-27 Akim Demaille <akim@epita.fr>
18221
18222 * tests/regression.at (Unresolved SR Conflicts):
18223 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
18224 below.
18225
18226 2001-12-27 Akim Demaille <akim@epita.fr>
18227
18228 * src/LR0.c (new_state): Recognize the final state by the fact it
18229 is reached by eoftoken.
18230 (insert_start_shifting_state, insert_eof_shifting_state)
18231 (insert_accepting_state, augment_automaton): Remove, since now
18232 these states are automatically computed from the initial state.
18233 (generate_states): Adjust.
18234 * src/print.c: When reporting a rule number to the user, substract
18235 1, so that the axiom rule is rule 0, and the first user rule is 1.
18236 * src/reduce.c: Likewise.
18237 * src/print_graph.c (print_core): For the time being, just as for
18238 the report, depend upon --trace-flags to dump the full set of
18239 items.
18240 * src/reader.c (readgram): Once the grammar read, insert the rule
18241 0: `$axiom: START-SYMBOL $'.
18242 * tests/set.at: Adjust: rule 0 is now displayed, and since the
18243 number of the states has changed (the final state is no longer
18244 necessarily the last), catch up.
18245
18246 2001-12-27 Akim Demaille <akim@epita.fr>
18247
18248 Try to make the use of the eoftoken valid. Given that its value
18249 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
18250 is used instead of > 0 where appropriate, (ii), depend upon nritems
18251 instead of the 0-sentinel.
18252
18253 * src/gram.h, src/gram.c (nritems): New.
18254 Expected to be duplication of nitems, but for the time being...
18255 * src/reader.c (packgram): Assert nritems and nitems are equal.
18256 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
18257 * src/closure.c (print_closure, print_fderives): Likewise.
18258 * src/gram.c (ritem_print): Likewise.
18259 * src/print.c (print_core, print_grammar): Likewise.
18260 * src/print_graph.c: Likewise.
18261
18262 2001-12-27 Akim Demaille <akim@epita.fr>
18263
18264 * src/main.c (main): If there are complains after grammar
18265 reductions, then output the report anyway if requested, then die.
18266 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
18267 * src/reader.c (eoftoken): New.
18268 (parse_token_decl): If the token being defined has value `0', it
18269 is the eoftoken.
18270 (packsymbols): No longer hack `tags' to insert `$' by hand.
18271 Be sure to preserve the value of the eoftoken.
18272 (reader): Make sure eoftoken is defined.
18273 Initialize nsyms to 0: now eoftoken is created just like the others.
18274 * src/print.c (print_grammar): Don't special case the eof token.
18275 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
18276 lie anyway, albeit pleasant.
18277 * tests/calc.at: Exercise error messages with eoftoken.
18278 Change the grammar so that empty input is invalid.
18279 Adjust expectations.
18280 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
18281
18282 2001-12-27 Akim Demaille <akim@epita.fr>
18283
18284 * configure.in: Check the protos of strchr ans strspn.
18285 Replace strchr if needed.
18286 * src/system.h: Provide the protos of strchr, strspn and memchr if
18287 missing.
18288 * lib/strchr.c: New.
18289 * src/reader.c (symbols_save): Use strchr.
18290
18291 2001-12-27 Akim Demaille <akim@epita.fr>
18292
18293 * src/print.c, src/print_graph.c (escape): New.
18294 Use it to quote the TAGS outputs.
18295 * src/print_graph.c (print_state): Now errors are in red, and
18296 reductions in green.
18297 Prefer high to wide: output the state number on a line of its own.
18298
18299 2001-12-27 Akim Demaille <akim@epita.fr>
18300
18301 * src/state.h, src/state.c (reductions_new): New.
18302 * src/LR0.c (set_state_table): Let all the states have a
18303 `reductions', even if reduced to 0.
18304 (save_reductions): Adjust.
18305 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
18306 * src/print.c (print_reductions, print_actions): Adjust.
18307 * src/output.c (action_row): Adjust.
18308
18309 2001-12-27 Akim Demaille <akim@epita.fr>
18310
18311 * src/state.h, src/state.c (errs_new, errs_dup): New.
18312 * src/LR0.c (set_state_table): Let all the states have an errs,
18313 even if reduced to 0.
18314 * src/print.c (print_errs, print_reductions): Adjust.
18315 * src/output.c (output_actions, action_row): Adjust.
18316 * src/conflicts.c (resolve_sr_conflict): Adjust.
18317
18318 2001-12-27 Akim Demaille <akim@epita.fr>
18319
18320 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
18321
18322 2001-12-27 Akim Demaille <akim@epita.fr>
18323
18324 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
18325 * src/print.c: here.
18326 (lookaheadset, shiftset): New, used as additional storage by
18327 print_reductions.
18328 (print_results): Adjust.
18329 (print_shifts, print_gotos, print_errs): New, extracted from...
18330 (print_actions): here.
18331 * src/print_graph.c (print_actions): Remove dead code.
18332
18333 2001-12-27 Akim Demaille <akim@epita.fr>
18334
18335 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
18336 `$n' and `@n'.
18337
18338 2001-12-27 Akim Demaille <akim@epita.fr>
18339
18340 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
18341 (build_relations): Adjust.
18342
18343 2001-12-27 Akim Demaille <akim@epita.fr>
18344
18345 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
18346 duplication.
18347
18348 2001-12-27 Akim Demaille <akim@epita.fr>
18349
18350 * src/reader.c (packgram): Catch nitems overflows.
18351
18352 2001-12-27 Akim Demaille <akim@epita.fr>
18353
18354 * src/files.c, src/files.h (guard_obstack): Remove.
18355 * src/output.c (output): Adjust.
18356 * src/reader.c (parse_braces): New, factoring...
18357 (copy_action, copy_guard): these two which are renamed as...
18358 (parse_action, parse_guard): these.
18359 As a voluntary consequence, using braces around guards is now
18360 mandatory.
18361
18362 2001-12-27 Akim Demaille <akim@epita.fr>
18363
18364 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
18365 * src/reader.c (symbol_list): `guard' and `guard_line' are new
18366 members.
18367 (symbol_list_new): Adjust.
18368 (copy_action): action_line is the first line, not the last.
18369 (copy_guard): Just as for actions, store the `action' only, not
18370 the switch/case/break flesh.
18371 Don't parse the user action that might follow the guard, let...
18372 (readgram): do it, i.e., now, there can be an action after a
18373 guard.
18374 In other words the guard is just explicitly optional.
18375 (packgram): Adjust.
18376 * src/output.c (guards_output): New.
18377 (output_parser): Call it when needed.
18378 (output): Also free the guard and attrs obstacks.
18379 * src/files.c, src/files.h (obstack_save): Remove.
18380 (output_files): Remove.
18381 As a result, if one needs the former `.act' file, using an
18382 appropriate skeleton which requires actions and guards is now
18383 required.
18384 * src/main.c (main): Adjust.
18385 * tests/semantic.at: New.
18386 * tests/regression.at: Use `input.y' as input file name.
18387 Avoid 8+3 problems by requiring input.c when the test needs the
18388 parser.
18389
18390 2001-12-27 Akim Demaille <akim@epita.fr>
18391
18392 * src/reader.c (symbol_list_new): Be sure to initialize all the
18393 fields.
18394
18395 2001-12-27 Akim Demaille <akim@epita.fr>
18396
18397 All the hacks using a final pseudo state are now useless.
18398
18399 * src/LR0.c (set_state_table): state_table holds exactly nstates.
18400 * src/lalr.c (nLA): New.
18401 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
18402 instead of lookaheadsp from the pseudo state (nstate + 1).
18403
18404 2001-12-27 Akim Demaille <akim@epita.fr>
18405
18406 * src/output.c (action_row, token_actions): Use a state_t instead
18407 of a integer, and nlookaheads instead of the following state's
18408 lookaheadsp.
18409
18410 2001-12-27 Akim Demaille <akim@epita.fr>
18411
18412 * src/conflicts.c (log_resolution, flush_shift)
18413 (resolve_sr_conflict, set_conflicts, solve_conflicts)
18414 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
18415 (conflicts_print, print_reductions): Use a state_t instead of an
18416 integer when referring to a state.
18417 As much as possible, depend upon nlookaheads, instead of the
18418 `lookaheadsp' member of the following state (since lookaheads of
18419 successive states are successive, the difference between state n + 1
18420 and n served as the number of lookaheads for state n).
18421 * src/lalr.c (add_lookback_edge): Likewise.
18422 * src/print.c (print_core, print_actions, print_state)
18423 (print_results): Likewise.
18424 * src/print_graph.c (print_core, print_actions, print_state)
18425 (print_graph): Likewise.
18426 * src/conflicts.h: Adjust.
18427
18428 2001-12-27 Akim Demaille <akim@epita.fr>
18429
18430 * src/bison.hairy: Formatting/comment changes.
18431 ANSIfy.
18432 Remove `register' indications.
18433 Add plenty of `static'.
18434
18435 2001-12-27 Akim Demaille <akim@epita.fr>
18436
18437 * src/output.c (prepare): Drop the muscle `ntbase' which
18438 duplicates ntokens.
18439 * src/bison.simple: Formatting/comment changes.
18440 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
18441 is an undocumented synonym.
18442
18443 2001-12-22 Akim Demaille <akim@epita.fr>
18444
18445 * src/output.c (output_table_data): Change the prototype to use
18446 `int' for array ranges: some invocations do pass an int, not a
18447 short.
18448 Reported by Wayne Green.
18449
18450 2001-12-22 Akim Demaille <akim@epita.fr>
18451
18452 Some actions of web2c.y are improperly triggered.
18453 Reported by Mike Castle.
18454
18455 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
18456 * tests/regression.at (Web2c): Rename as...
18457 (Web2c Report): this.
18458 (Web2c Actions): New.
18459
18460 2001-12-22 Akim Demaille <akim@epita.fr>
18461
18462 Reductions in web2c.y are improperly reported.
18463 Reported by Mike Castle.
18464
18465 * src/conflicts.c (print_reductions): Fix.
18466 * tests/regression.at (Web2c): New.
18467
18468 2001-12-18 Akim Demaille <akim@epita.fr>
18469
18470 Some host fail on `assert (!"foo")', which expands to
18471 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
18472 Reported by Nelson Beebee.
18473
18474 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
18475 `#define it_succeeded 0' and `assert (it_succeeded)'.
18476
18477 2001-12-17 Marc Autret <autret_m@epita.fr>
18478
18479 * src/bison.simple: Don't hard code the skeleton line and filename.
18480 * src/output.c (output_parser): Rename 'line' as 'output_line'.
18481 New line counter 'skeleton_line' (skeleton-line muscle).
18482
18483 2001-12-17 Paul Eggert <eggert@twinsun.com>
18484
18485 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
18486 YYDEBUG must be defined to a nonzero value.
18487
18488 * src/bison.simple (yytname): Do not assume that the user defines
18489 YYDEBUG to a properly parenthesized expression.
18490
18491 2001-12-17 Akim Demaille <akim@epita.fr>
18492
18493 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
18494 nlookaheads is a new member.
18495 Adjust all users.
18496 * src/lalr.h (nlookaheads): Remove this orphan declaration.
18497 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
18498 state.
18499
18500 2001-12-17 Akim Demaille <akim@epita.fr>
18501
18502 * src/files.h, src/files.c (open_files, close_files): Remove.
18503 * src/main.c (main): Don't open/close files, nor invoke lex_free,
18504 let...
18505 * src/reader.c (reader): Do it.
18506
18507 2001-12-17 Akim Demaille <akim@epita.fr>
18508
18509 * src/conflicts.c (print_reductions): Formatting changes.
18510
18511 2001-12-17 Akim Demaille <akim@epita.fr>
18512
18513 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
18514 (flush_reduce): New.
18515 (resolve_sr_conflict): Adjust.
18516
18517 2001-12-17 Akim Demaille <akim@epita.fr>
18518
18519 * src/output.c (output_obstack): Be static and rename as...
18520 (format_obstack): this, to avoid any confusion with files.c's
18521 output_obstack.
18522 * src/reader.h (muscle_obstack): Move to...
18523 * src/output.h: here, since it's defined in output.c.
18524
18525 2001-12-17 Akim Demaille <akim@epita.fr>
18526
18527 * src/output.c (action_row, save_column, default_goto)
18528 (sort_actions, matching_state, pack_vector): Better variable
18529 locality.
18530
18531 2001-12-17 Akim Demaille <akim@epita.fr>
18532
18533 * src/output.c: Various formatting changes.
18534
18535 2001-12-17 Akim Demaille <akim@epita.fr>
18536
18537 * src/files.c (output_files): Free the output_obstack.
18538 * src/main.c (main): Call print and print_graph conditionally.
18539 * src/print.c (print): Work unconditionally.
18540 * src/print_graph.c (print_graph): Work unconditionally.
18541 * src/conflicts.c (log_resolution): Output only if verbose_flag.
18542
18543 2001-12-16 Marc Autret <autret_m@epita.fr>
18544
18545 * src/output.c (actions_output): Fix. When we use %no-lines,
18546 there is one less line per action.
18547
18548 2001-12-16 Marc Autret <autret_m@epita.fr>
18549
18550 * src/bison.simple: Remove a useless #line directive.
18551 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
18552 * src/output.c (get_lines_number): New.
18553 (output_parser): Adjust, now takes care about the lines of a
18554 output muscles.
18555 Fix line numbering.
18556 (actions_output): Computes the number of lines taken by actions.
18557 (output_master_parser): Insert new skeleton which is the name of
18558 the output parser file name.
18559
18560 2001-12-15 Marc Autret <autret_m@epita.fr>
18561
18562 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
18563
18564 2001-12-15 Marc Autret <autret_m@epita.fr>
18565
18566 * src/output.c (output_gram): Keep track of the hairy one.
18567
18568 2001-12-15 Akim Demaille <akim@epita.fr>
18569
18570 Make `make distcheck' work.
18571
18572 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
18573 system.h which uses libgettext.h.
18574
18575 2001-12-15 Akim Demaille <akim@epita.fr>
18576
18577 * src/nullable.c (set_nullable): Useless rules must be skipped,
18578 otherwise, since we range over their symbols, we might look at a
18579 nonterminal which no longer ``exists'', i.e., it is not counted in
18580 `nvars', hence we overflow our arrays.
18581
18582 2001-12-15 Akim Demaille <akim@epita.fr>
18583
18584 The header can also be produced directly, without any obstack!
18585 Yahoo!
18586
18587 * src/files.c, src/files.h (defines_obstack): Remove.
18588 (compute_header_macro): Global.
18589 (defines_obstack_save): Remove.
18590 * src/reader.c (parse_union_decl): No longer output to
18591 defines_obstack: its content can be found in the `stype' muscle
18592 anyway.
18593 (output_token_translations): Merge into...
18594 (symbols_output): this.
18595 Rename as...
18596 (symbols_save): this.
18597 (reader): Adjust.
18598 * src/output.c (header_output): New.
18599 (output): Call it.
18600
18601 2001-12-15 Akim Demaille <akim@epita.fr>
18602
18603 * src/reader.c (parse_union_decl): Instead of handling two obstack
18604 simultaneously, use one to define the `stype' muscle, and use the
18605 value of the latter to fill defines_obstack.
18606 (copy_comment): Remove.
18607 (copy_comment2): Work for a single obstack.
18608 Rename as...
18609 (copy_comment): this.
18610
18611 2001-12-15 Akim Demaille <akim@epita.fr>
18612
18613 * src/lex.c, src/lex.h (xgetc): No longer static.
18614 * src/reader.c (parse_union_decl): Revamp.
18615
18616 2001-12-15 Akim Demaille <akim@epita.fr>
18617
18618 Still making progress in separating Bison into (i) input, (ii)
18619 process, (iii) output: now we can directly output the parser file
18620 without using table_obstack at all.
18621
18622 * src/files.c, src/files.h (table_obstack): Bye bye.
18623 (parser_file_name): New.
18624 * src/files.c (compute_output_file_names): Compute it.
18625 * src/output.c (actions_output, output_parser)
18626 (output_master_parser): To a file instead of an obstack.
18627
18628 2001-12-15 Akim Demaille <akim@epita.fr>
18629
18630 Attach actions to rules, instead of pre-outputting them to
18631 actions_obstack.
18632
18633 * src/gram.h (rule_t): action and action_line are new members.
18634 * src/reader.c (symbol_list): Likewise.
18635 (copy_action): Save the actions within the rule.
18636 (packgram): Save them in rule_table.
18637 * src/output.c (actions_output): New.
18638 (output_parser): Use it on `%%actions'.
18639 (output_rule_data): Don't free rule_table.
18640 (output): Do it.
18641 (prepare): Don't save the `action' muscle.
18642 * src/bison.simple: s/%%action/%%actions/.
18643
18644 2001-12-15 Akim Demaille <akim@epita.fr>
18645
18646 * src/reader.c (copy_action): When --yacc, don't append a `;'
18647 to the user action: let it fail if lacking.
18648 Suggested by Arnold Robbins and Tom Tromey.
18649
18650 2001-12-14 Akim Demaille <akim@epita.fr>
18651
18652 * src/lex.c (literalchar): Simply return the char you decoded, non
18653 longer mess around with obstacks and int pointers.
18654 Adjust all callers.
18655
18656 2001-12-14 Akim Demaille <akim@epita.fr>
18657
18658 * src/lex.c (literalchar): Don't escape the special characters,
18659 just decode them, and keep them as char (before, eol was output as
18660 the 2 char string `\n' etc.).
18661 * src/output.c (output_rule_data): Use quotearg to output the
18662 token strings.
18663
18664 2001-12-13 Paul Eggert <eggert@twinsun.com>
18665
18666 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
18667 Do not infringe on the global user namespace when using C++.
18668 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
18669 All uses of `fprintf' and `stderr' changed.
18670
18671 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
18672
18673 2001-12-13 Akim Demaille <akim@epita.fr>
18674
18675 The computation of nullable is broken: it doesn't handle empty
18676 RHS's properly.
18677
18678 * tests/torture.at (GNU AWK Grammar): New.
18679 * tests/sets.at (Nullable): New.
18680 * src/nullable.c (set_nullable): Instead of blindly looping over
18681 `ritems', loop over the rules, and then over their rhs's.
18682
18683 Work around Autotest bugs.
18684
18685 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
18686 frame, because Autotest understand lines starting with a `+' as
18687 traces from the shell. Then, they are not processed properly.
18688 Admittedly an Autotest bug, but we don't have time to wait for
18689 Autotest to catch up.
18690 * tests/regression.at (Broken Closure): Adjust to the new table
18691 frames.
18692 Move to...
18693 * tests/sets.at: here.
18694
18695 2001-12-13 Akim Demaille <akim@epita.fr>
18696
18697 * src/closure.c (closure): Use nrules instead of playing tricks
18698 with BITS_PER_WORD.
18699
18700 2001-12-13 Akim Demaille <akim@epita.fr>
18701
18702 * src/print.c (print_actions): Output the handling of `$' as the
18703 traces do: shifting the token EOF. Before EOF was treated as a
18704 nonterminal.
18705 * tests/regression.at: Adjust some tests.
18706 * src/print_graph.c (print_core): Complete the set of items via
18707 closure. The next-to-final and final states are still unsatisfying,
18708 but that's to be addressed elsewhere.
18709 No longer output the rule numbers, but do output the state number.
18710 A single loop for the shifts + gotos is enough, but picked a
18711 distinct color for each.
18712 (print_graph): Initialize and finalize closure.
18713
18714 2001-12-13 Akim Demaille <akim@epita.fr>
18715
18716 * src/reader.c (readgram): Remove dead code, an strip useless
18717 braces.
18718 (get_type): Remove, unused.
18719
18720 2001-12-12 Akim Demaille <akim@epita.fr>
18721
18722 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
18723 on that of lib/error.c.
18724
18725 2001-12-12 Akim Demaille <akim@epita.fr>
18726
18727 Some hosts don't like `/' in includes.
18728
18729 * src/system.h: Include libgettext.h without qualifying the path.
18730 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
18731 $(top_srcdir).
18732
18733 2001-12-11 Marc Autret <autret_m@epita.fr>
18734
18735 * src/output.c (output_parser): Remove useless muscle.
18736
18737 2001-12-11 Marc Autret <autret_m@epita.fr>
18738
18739 * src/bison.simple: Remove #line just before %%epilogue. It
18740 is now handled in ...
18741 * src/reader.c (read_additionnal_code): Add the output of a
18742 #line for the epilogue.
18743
18744 2001-12-10 Marc Autret <autret_m@epita.fr>
18745
18746 * src/reader.c (copy_definition): Re-use CPP-outed code which
18747 replace precedent remove.
18748 * src/bison.simple: Remove #line before %%prologue because
18749 %%input-line is wrong at this time.
18750
18751 2001-12-10 Marc Autret <autret_m@epita.fr>
18752
18753 * src/reader.c (symbols_output): Clean up.
18754 * src/output.c (output_gram, output): Clean up.
18755
18756 2001-12-10 Akim Demaille <akim@epita.fr>
18757
18758 * src/lalr.c (initialize_lookaheads): New. Extracted from...
18759 * src/LR0.c (set_state_table): here.
18760 * src/lalr.c (lalr): Call it.
18761
18762 2001-12-10 Akim Demaille <akim@epita.fr>
18763
18764 * src/state.h (shifts): Remove the `number' member: shifts are
18765 attached to state, hence no longer need to be labelled with a
18766 state number.
18767
18768 2001-12-10 Akim Demaille <akim@epita.fr>
18769
18770 Now that states have a complete set of members, the linked list of
18771 shifts is useless: just fill directly the state's shifts member.
18772
18773 * src/state.h (shifts): Remove the `next' member.
18774 * src/LR0.c (first_state, last_state): Remove.
18775 Adjust the callers.
18776 (augment_automaton): Don't look for the shifts that must be added
18777 a shift on EOF: it is those of the state we looked for! But now,
18778 since shifts are attached, it is no longer needed to looking
18779 merely by its id: its number.
18780
18781 2001-12-10 Akim Demaille <akim@epita.fr>
18782
18783 * src/LR0.c (augment_automaton): Better variable locality.
18784 Remove an impossible branch: if there is a state corresponding to
18785 the start symbol being shifted, then there is shift for the start
18786 symbol from the initial state.
18787
18788 2001-12-10 Akim Demaille <akim@epita.fr>
18789
18790 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
18791 only when appropriate: when insert_start_shifting_state' is not
18792 invoked.
18793 * tests/regression.at (Rule Line Numbers): Adjust.
18794
18795 2001-12-10 Akim Demaille <akim@epita.fr>
18796
18797 * src/LR0.c (augment_automaton): Now that all states have shifts,
18798 merge the two cases addition shifts to the initial state.
18799
18800 2001-12-10 Akim Demaille <akim@epita.fr>
18801
18802 * src/lalr.c (set_state_table): Move to...
18803 * src/LR0.c: here.
18804 * src/lalr.c (lalr): Don't call it...
18805 * src/LR0.c (generate_states): do it.
18806 * src/LR0.h (first_state): Remove, only the table is used.
18807
18808 2001-12-10 Akim Demaille <akim@epita.fr>
18809
18810 * src/LR0.h (first_shift, first_reduction): Remove.
18811 * src/lalr.c: Don't use first_shift: find shifts through the
18812 states.
18813
18814 2001-12-10 Akim Demaille <akim@epita.fr>
18815
18816 * src/LR0.c: Attach shifts to states as soon as they are
18817 computed.
18818 * src/lalr.c (set_state_table): Instead of assigning shifts to
18819 state, just assert that the mapping was properly done.
18820
18821 2001-12-10 Akim Demaille <akim@epita.fr>
18822
18823 * src/LR0.c (insert_start_shift): Rename as...
18824 (insert_start_shifting_state): this.
18825 (insert_eof_shifting_state, insert_accepting_state): New.
18826 (augment_automaton): Adjust.
18827 Better locality of the variables.
18828 When looking if the start_symbol is shifted from the initial
18829 state, using `while (... symbol != start_symbol ...)' sounds
18830 better than `while (... symbol < start_symbol ...)': If fail
18831 to see how the order between symbols could be relevant!
18832
18833 2001-12-10 Akim Demaille <akim@epita.fr>
18834
18835 * src/getargs.h: Don't declare `spec_name_prefix' and
18836 `spec_file_prefix', declared by src/files.h.
18837 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
18838 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
18839 * src/output.c (prepare): Adjust.
18840 * src/reader.c (symbols_output): Likewise.
18841 * src/vmsgetargs.c: Vaguely adjust, but who cares?
18842
18843 2001-12-10 Akim Demaille <akim@epita.fr>
18844
18845 * src/muscle_tab.c (muscle_init): NULL is a better default than
18846 `"0"'.
18847
18848 2001-12-10 Akim Demaille <akim@epita.fr>
18849
18850 * src/reader.c (reader): Calling symbols_output once is enough.
18851
18852 2001-12-10 Akim Demaille <akim@epita.fr>
18853
18854 Now that states have a complete set of members, the linked list of
18855 reductions is useless: just fill directly the state's reductions
18856 member.
18857
18858 * src/state.h (struct reductions): Remove member `number' and
18859 `next'.
18860 * src/LR0.c (first_reduction, last_reduction): Remove.
18861 (save_reductions): Don't link the new reductions, store them in
18862 this_state.
18863 * src/lalr.c (set_state_table): No need to attach reductions to
18864 states, it's already done.
18865 * src/output.c (output_actions): No longer free the shifts, then
18866 the reductions, then the states: free all the states and their
18867 members.
18868
18869 2001-12-10 Akim Demaille <akim@epita.fr>
18870
18871 * src/options.c (OPTN, DRTV, BOTH): New.
18872 (option_table): Use them.
18873
18874 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
18875 the job of system.h.
18876 * src/options.c: Don't include stdio.h and xalloc.h for the same
18877 reasons.
18878
18879 2001-12-10 Akim Demaille <akim@epita.fr>
18880
18881 * src/output.c (output, prepare): Make sure the values of the
18882 muscles `action' and `prologue' are 0-terminated.
18883
18884 2001-12-10 Akim Demaille <akim@epita.fr>
18885
18886 Clean up GCC warnings.
18887
18888 * src/reader.c (copy_action): `buf' is not used.
18889 (parse_skel_decl): Be static.
18890 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
18891 * src/options.h (create_long_option_table): Have a real prototype.
18892 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
18893 (hash_delete_at): Return const void *.
18894 Adjust casts to preserve the const.
18895
18896 2001-12-10 Akim Demaille <akim@epita.fr>
18897
18898 * configure.in: Require 2.52g.
18899 M4 is not needed, but AUTOM4TE is.
18900 * m4/m4.m4: Remove.
18901 * tests/Makefile.am: Adjust.
18902
18903 2001-12-10 Akim Demaille <akim@epita.fr>
18904
18905 One structure for states is enough, even though theoretically
18906 there are LR(0) states and LALR(1) states.
18907
18908 * src/lalr.h (state_t): Remove.
18909 (state_table): Be state_t **, not state_t *.
18910 * src/state.h (core, CORE_ALLOC): Rename as...
18911 (state_t, STATE_ALLOC): this.
18912 Add the LALR(1) members: shifts, reductions, errs.
18913 * src/LR0.c (state_table): Rename as...
18914 (state_hash): this, to avoid name clashes with the global
18915 `state_table'.
18916 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
18917 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
18918
18919 2001-12-10 Akim Demaille <akim@epita.fr>
18920
18921 Bison dumps core on bash.y.
18922 Reported by Pascal Bart.
18923
18924 * src/warshall.c (bitmatrix_print): New.
18925 (TC): Use it.
18926 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
18927 j must be the outer loop.
18928 * tests/regression.at (Broken Closure): New.
18929
18930 2001-12-05 Akim Demaille <akim@epita.fr>
18931
18932 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
18933 its argument.
18934 Reported by Peter Hamorsky.
18935
18936 2001-12-05 Akim Demaille <akim@epita.fr>
18937
18938 * src/conflicts.c (err_table): Remove.
18939 (resolve_sr_conflict): Adjust.
18940 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
18941 Rename as...
18942 (state_t.reductions, state_t.shifts): this.
18943
18944 2001-12-05 Akim Demaille <akim@epita.fr>
18945
18946 * src/reduce.c (reduce_grammar_tables): No longer disable the
18947 removal of useless rules via CPP but via `if (0)', so that the
18948 compiler still check the code is valid.
18949 For instance, it should have noticed `rline' no longer exists: use
18950 the `line' member of rule_t.
18951 * src/gram.c (dummy, rline): Remove, unused.
18952
18953 2001-12-05 Akim Demaille <akim@epita.fr>
18954
18955 * src/output.c (pack_vector): Use assert, not berror.
18956 * src/main.c (berror): Remove, unused.
18957
18958 2001-12-05 Akim Demaille <akim@epita.fr>
18959
18960 New experimental feature: if --verbose --trace output all the
18961 items of a state, not only its kernel.
18962
18963 * src/print.c (print_core): If `trace_flag', then invoke closure
18964 before outputting the items of the state (print_core is no longer
18965 a correct name them).
18966 (print_results): Invoke new_closure/free_closure if needed.
18967
18968 2001-12-05 Akim Demaille <akim@epita.fr>
18969
18970 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
18971 * src/closure.c, src/closure.h (itemsetsize): Rename as...
18972 (nitemset): for consistency with the rest of the project.
18973
18974 2001-12-05 Akim Demaille <akim@epita.fr>
18975
18976 * src/closure.c (print_closure): Improve.
18977 (closure): Use it for printing input and output.
18978
18979 2001-12-05 Akim Demaille <akim@epita.fr>
18980
18981 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
18982 indexed by nonterminals.
18983
18984 2001-12-05 Akim Demaille <akim@epita.fr>
18985
18986 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
18987 what it was!).
18988 * src/warshall.h: Remove accidental duplication of the content.
18989
18990 2001-12-05 Akim Demaille <akim@epita.fr>
18991
18992 * src/closure.c (set_fderives): De-obfuscate.
18993
18994 2001-12-05 Akim Demaille <akim@epita.fr>
18995
18996 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
18997
18998 2001-12-05 Akim Demaille <akim@epita.fr>
18999
19000 * src/closure.c (set_firsts): De-obfuscate.
19001
19002 2001-12-05 Akim Demaille <akim@epita.fr>
19003
19004 * src/output.c (action_row): De-obfuscate
19005 using the good o' techniques: arrays not pointers, variable
19006 locality, BITISSET, RESETBIT etc.
19007
19008 2001-12-05 Akim Demaille <akim@epita.fr>
19009
19010 Pessimize the code to simplify it: from now on, all the states
19011 have a valid SHIFTS, which NSHIFTS is possibly 0.
19012
19013 * src/LR0.c (shifts_new): Be global and move to..
19014 * src/state.c, src/state.h: here.
19015 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
19016 * src/print_graph: Adjust.
19017
19018 2001-12-05 Akim Demaille <akim@epita.fr>
19019
19020 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
19021 * src/conflicts.c: Use it.
19022 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
19023 incorrectly ``simplified''.
19024
19025 2001-12-05 Akim Demaille <akim@epita.fr>
19026
19027 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
19028 using the good o' techniques: arrays not pointers, variable
19029 locality, BITISSET, RESETBIT etc.
19030
19031 2001-12-05 Akim Demaille <akim@epita.fr>
19032
19033 * src/state.h (SHIFT_SYMBOL): New.
19034 * src/conflicts.c: Use it to deobfuscate.
19035
19036 2001-12-05 Akim Demaille <akim@epita.fr>
19037
19038 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
19039 (print_reductions): De-obfuscate using the good o' techniques:
19040 arrays not pointers, variable locality, BITISSET.
19041
19042 2001-12-05 Akim Demaille <akim@epita.fr>
19043
19044 * src/conflicts.c (print_reductions): Arrays, not pointers.
19045 Use BITISSET.
19046
19047 2001-12-05 Akim Demaille <akim@epita.fr>
19048
19049 * src/conflicts.c (print_reductions): Pessimize, but clarify.
19050
19051 2001-12-05 Akim Demaille <akim@epita.fr>
19052
19053 * src/conflicts.c (print_reductions): Improve variable locality.
19054
19055 2001-12-05 Akim Demaille <akim@epita.fr>
19056
19057 * src/conflicts.c (print_reductions): Pessimize, but clarify.
19058
19059 2001-12-05 Akim Demaille <akim@epita.fr>
19060
19061 * src/conflicts.c (print_reductions): Improve variable locality.
19062
19063 2001-12-05 Akim Demaille <akim@epita.fr>
19064
19065 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
19066 * src/lalr.c: Use them.
19067
19068 2001-12-05 Akim Demaille <akim@epita.fr>
19069
19070 * src/LR0.c (augment_automaton): Formatting changes.
19071 Better variable locality.
19072
19073 2001-12-05 Akim Demaille <akim@epita.fr>
19074
19075 * src/lalr.c (matrix_print): New.
19076 (transpose): Use it.
19077 Use arrays instead of pointers.
19078
19079 2001-12-05 Akim Demaille <akim@epita.fr>
19080
19081 * src/lalr.c (maxrhs): Move to...
19082 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
19083 * src/lalr.c (build_relations): Adjust.
19084
19085 2001-12-05 Akim Demaille <akim@epita.fr>
19086
19087 * src/lalr.c (transpose): Free the memory allocated to the
19088 argument, as it is replaced by the results by the unique caller.
19089 (build_relations): Merely invoke transpose: it handles the memory
19090 deallocation.
19091 Improve variable locality.
19092 Avoid variables used as mere abbreviations.
19093 (compute_lookaheads): Use arrays instead of pointers.
19094
19095 2001-12-05 Akim Demaille <akim@epita.fr>
19096
19097 * src/lalr.c (initialize_F): Improve variable locality.
19098 Avoid variables used as mere abbreviations.
19099
19100 2001-12-05 Akim Demaille <akim@epita.fr>
19101
19102 * src/derives.c (print_derives): Display the ruleno.
19103 * src/lalr.c (initialize_F, transpose): Better variable locality
19104 to improve readability.
19105 Avoid variables used as mere abbreviations.
19106
19107 2001-12-05 Akim Demaille <akim@epita.fr>
19108
19109 * src/lalr.c (traverse): Use arrays instead of pointers.
19110
19111 2001-12-05 Akim Demaille <akim@epita.fr>
19112
19113 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
19114 the handling of squeue.
19115 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
19116
19117 2001-12-05 Akim Demaille <akim@epita.fr>
19118
19119 Because useless nonterminals are now kept alive (instead of being
19120 `destroyed'), we now sometimes examine them, and store information
19121 related to them. Hence we need to know their number, and adjust
19122 memory allocations.
19123
19124 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
19125 static.
19126 * src/LR0.c (allocate_itemsets): The memory allocated to
19127 `symbol_count' was used for two different purpose: once to count
19128 the number of occurrences of each symbol, and later reassigned to
19129 `shift_symbol', containing the symbol that can be shifted from a
19130 given state.
19131 Deobfuscate, i.e., allocate, use and free `symbol_count' here
19132 only, and...
19133 (new_itemsets): Allocate `shift_symbol' here.
19134 (allocate_itemsets): symbol_count includes useless nonterminals.
19135 Make room for them.
19136 (free_storage): Use `free', not `XFREE', for pointers that cannot
19137 be null.
19138
19139 2001-12-05 Akim Demaille <akim@epita.fr>
19140
19141 * src/nullable.c (set_nullable): Deobfuscate the handling of
19142 ritem.
19143 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
19144
19145 2001-12-05 Akim Demaille <akim@epita.fr>
19146
19147 * src/gram.c, src/gram.h (ritem_print): New.
19148 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
19149 (This useless function was defined only to work around VMS linkers
19150 that can't handle compilation units with variables only).
19151 * src/reduce.c (dump_grammar): Use it to trace the construction of
19152 ritem.
19153
19154 2001-12-04 Paul Eggert <eggert@twinsun.com>
19155
19156 * src/bison.simple (union yyalloc): Change member names
19157 to be the same as the stack names.
19158 (yyparse): yyptr is now union yyalloc *, not char *.
19159 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
19160 and may generate better code on some machines.
19161 (yystpcpy): Use prototype if __STDC__ is defined, not just
19162 if __cplusplus is defined.
19163
19164 2001-11-30 Akim Demaille <akim@epita.fr>
19165
19166 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
19167 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
19168 Gettext doesn't compile cleanly, and dies with -Werror.
19169 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
19170 Include WARNING_CFLAGS here.
19171 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
19172 before being defined.
19173
19174 2001-11-27 Paul Eggert <eggert@twinsun.com>
19175
19176 * lib/quotearg.h (quotearg_n, quotearg_n_style):
19177 First arg is int, not unsigned.
19178 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
19179 (SIZE_MAX, UINT_MAX): New macros.
19180 (quotearg_n_options): Abort if N is negative.
19181 Avoid overflow check on hosts where size_t is 64 bits and int
19182 is 32 bits, as overflow is impossible there.
19183 Fix off-by-one typo that caused unnecessary reallocation.
19184
19185 2001-11-29 Paul Eggert <eggert@twinsun.com>
19186
19187 Name space cleanup in generated parser.
19188
19189 * doc/bison.texinfo (Bison Parser): Discuss system headers
19190 and their effect on the user name space.
19191
19192 * src/bison.simple:
19193 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
19194 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
19195 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
19196
19197 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
19198 on user names when possible.
19199
19200 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
19201 Simplify test for whather <alloca.h> exists.
19202
19203 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
19204
19205 (<stdio.h>): Include if YYDEBUG.
19206
19207 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
19208 ! defined (yyoverflow) && ! defined (yymemcpy).
19209
19210 (yymemcpy, yyparse): Rename local variables as needed so that
19211 they all begin with 'yy'.
19212
19213 (yystrlen, yystpcpy): New functions.
19214
19215 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
19216 All uses changed.
19217
19218 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
19219 instead of relying on string.h functions. Use YYSTACK_ALLOC
19220 and YYSTACK_FREE instead of malloc and free.
19221
19222 2001-11-30 Akim Demaille <akim@epita.fr>
19223
19224 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
19225 before their first uses.
19226 (YYBISON, YYPURE): Move to the top of the output.
19227
19228 2001-11-30 Akim Demaille <akim@epita.fr>
19229
19230 * tests/reduce.at (Useless Nonterminals): Fix.
19231
19232 2001-11-30 Akim Demaille <akim@epita.fr>
19233
19234 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
19235 if body instead of `;' to pacify GCC's warnings.
19236
19237 2001-11-30 Akim Demaille <akim@epita.fr>
19238
19239 Instead of mapping the LHS of unused rules to -1, keep the LHS
19240 valid, but flag the rules as invalid.
19241
19242 * src/gram.h (rule_t): `useful' is a new member.
19243 * src/print.c (print_grammar): Adjust.
19244 * src/derives.c (set_derives): Likewise.
19245 * src/reader.c (packgram, reduce_output): Likewise.
19246 * src/reduce.c (reduce_grammar_tables): Likewise.
19247 * tests/reduce.at (Underivable Rules, Useless Rules): New.
19248
19249 2001-11-30 Akim Demaille <akim@epita.fr>
19250
19251 * src/reduce.c (reduce_output): Formatting changes.
19252 * src/print.c (print_results, print_grammar): Likewise.
19253 * tests/regression.at (Rule Line Numbers)
19254 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
19255
19256 2001-11-30 Akim Demaille <akim@epita.fr>
19257
19258 * src/reduce.c (nonterminals_reduce): Instead of throwing away
19259 useless nonterminals, move them at the end of the symbol arrays.
19260 (reduce_output): Adjust.
19261 * tests/reduce.at (Useless Nonterminals): Adjust.
19262
19263 2001-11-30 Akim Demaille <akim@epita.fr>
19264
19265 * src/reduce.c: Various comment/formatting changes.
19266 (nonterminals_reduce): New, extracted from...
19267 (reduce_grammar_tables): here.
19268 (reduce_grammar): Call nonterminals_reduce.
19269
19270 2001-11-29 Paul Eggert <eggert@twinsun.com>
19271
19272 * src/bison.simple (YYSTACK_REALLOC): Remove.
19273 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
19274 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
19275 New macros.
19276 (union yyalloc): New type.
19277 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
19278 an arbitrary restriction on hosts where size_t is wider than int.
19279
19280 (yyparse): Don't dump core if alloca or malloc fails; instead, report
19281 a parser stack overflow. Allocate just one block of memory for all
19282 three stacks, instead of allocating three blocks; this typically is
19283 faster and reduces fragmentation.
19284
19285 Do not limit the number of items in the stack to a value that fits
19286 in 'int', as this is an arbitrary limit on hosts with 64-bit
19287 size_t and 32-bit int.
19288
19289 2001-11-29 Marc Autret <autret_m@epita.fr>
19290
19291 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
19292 of defining YYERROR_VERBOSE.
19293 [AT_DATA]: $4 is now out of C declarations in the prologue.
19294
19295 2001-11-28 Marc Autret <autret_m@epita.fr>
19296
19297 * src/reader.c (parse_dquoted_param): New.
19298 (parse_skel_decl): Use it.
19299 * src/lex.h: Add its prototype.
19300 * src/lex.c (literalchar): Become not static.
19301
19302 2001-11-28 Marc Autret <autret_m@epita.fr>
19303
19304 * src/output.h: And put its extern declaration here.
19305 * src/output.c (error_verbose): Define here.
19306 (prepare): Echo name modification.
19307 * src/getargs.h: Clean its extern declaration.
19308 * src/getargs.c (error_verbose_flag): Remove.
19309 (getargs): Remove case 'e'.
19310 * src/options.c (option_table): 'error-verbose' is now seen as simple
19311 percent option.
19312 Include output.h.
19313
19314 * src/reader.c (read_declarations): Remove case tok_include.
19315 (parse_include_decl): Remove.
19316 * src/lex.h (token_t): Remove tok_include.
19317 * src/options.c (option_table): 'include' is now a simple command line
19318 option.
19319
19320 2001-11-28 Marc Autret <autret_m@epita.fr>
19321
19322 * src/bison.simple: Adjust muscle names.
19323 * src/muscle_tab.c (muscle_init): Also rename the muscles.
19324 * src/output.c (prepare): s/_/-/ for the muscles names.
19325 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
19326
19327 2001-11-28 Marc Autret <autret_m@epita.fr>
19328
19329 * src/bison.simple: Fix debug.
19330 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
19331
19332 2001-11-28 Akim Demaille <akim@epita.fr>
19333
19334 * src/LR0.c (shifts_new): New.
19335 (save_shifts, insert_start_shift, augment_automaton): Use it.
19336
19337 2001-11-28 Akim Demaille <akim@epita.fr>
19338
19339 * src/closure.c (closure): `b' and `ruleno' denote the same value:
19340 keep ruleno only.
19341
19342 2001-11-28 Akim Demaille <akim@epita.fr>
19343
19344 * src/closure.c (closure): Instead of looping over word in array
19345 then bits in words, loop over bits in array.
19346
19347 2001-11-28 Akim Demaille <akim@epita.fr>
19348
19349 * src/closure.c (closure): No longer optimize the special case
19350 where all the bits of `ruleset[r]' are set to 0, to make the code
19351 clearer.
19352
19353 2001-11-28 Akim Demaille <akim@epita.fr>
19354
19355 * src/closure.c (closure): `r' and `c' are new variables, used to
19356 de-obfuscate accesses to RULESET and CORE.
19357
19358 2001-11-28 Akim Demaille <akim@epita.fr>
19359
19360 * src/reduce.c (reduce_print): Use ngettext.
19361 (dump_grammar): Improve the trace accuracy.
19362
19363 2001-11-28 Akim Demaille <akim@epita.fr>
19364
19365 * src/reduce.c (dump_grammar): Don't translate trace messages.
19366
19367 2001-11-28 Akim Demaille <akim@epita.fr>
19368
19369 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
19370 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
19371 as all tags are free'ed afterwards.
19372 From Enrico Scholz.
19373
19374 2001-11-27 Paul Eggert <eggert@twinsun.com>
19375
19376 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
19377 use alloca when we didn't want to, and vice versa.
19378
19379 2001-11-27 Marc Autret <autret_m@epita.fr>
19380
19381 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
19382 initialization.
19383 * src/output.c (prepare): Remove its update.
19384
19385 2001-11-27 Marc Autret <autret_m@epita.fr>
19386
19387 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
19388 Use %error-verbose.
19389
19390 2001-11-27 Marc Autret <autret_m@epita.fr>
19391
19392 * src/bison.simple: Remove YYERROR_VERBOSE using.
19393 Use %%error_verbose.
19394 (yyparse): Likewise.
19395 * src/output.c (prepare): Give its final value.
19396 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
19397 * src/getargs.h: Add its extern declaration.
19398 * src/getargs.c (error_verbose_flag): New int.
19399 (getargs): Update to catch new case.
19400 * src/options.c (option_table): 'error-verbose' is a new option.
19401 (shortopts): Update.
19402
19403 2001-11-27 Akim Demaille <akim@epita.fr>
19404
19405 * src/system.h: Use intl/libgettext.h.
19406 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
19407
19408 2001-11-27 Akim Demaille <akim@epita.fr>
19409
19410 * tests/torture.at (Exploding the Stack Size with Malloc):
19411 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
19412
19413 2001-11-27 Akim Demaille <akim@epita.fr>
19414
19415 * src/files.c: Include error.h.
19416 Reported by Hans Aberg.
19417
19418 2001-11-26 Marc Autret <autret_m@epita.fr>
19419
19420 * src/reader.c (parse_include_decl): New, not yet implemented.
19421 (read_declarations): Add case tok_include.
19422 * src/getargs.h (include): Add its extern definition.
19423 * src/getargs.c (include): New const char *.
19424 (getargs): Add case '-I'.
19425 * src/options.c (option_table): Add include as command line and
19426 percent option.
19427 * src/lex.h (token_t): Add tok_include.
19428
19429 2001-11-26 Akim Demaille <akim@epita.fr>
19430
19431 * src/reader.c (readgram): Make sure rules for mid-rule actions
19432 have a lineno equal to that of their host rule.
19433 Reported by Hans Aberg.
19434 * tests/regression.at (Rule Line Numbers): New.
19435
19436 2001-11-26 Akim Demaille <akim@epita.fr>
19437
19438 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
19439 size_ts.
19440
19441 2001-11-26 Akim Demaille <akim@epita.fr>
19442
19443 * src/complain.c, src/complain.h (error): Remove, provided by
19444 lib/error.[ch].
19445
19446 2001-11-26 Akim Demaille <akim@epita.fr>
19447
19448 * src/reader.c (read_declarations): Don't abort on tok_illegal,
19449 issue an error message.
19450 * tests/regression.at (Invalid %directive): New.
19451 Reported by Hans Aberg.
19452
19453 2001-11-26 Akim Demaille <akim@epita.fr>
19454
19455 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
19456 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
19457
19458 2001-11-26 Akim Demaille <akim@epita.fr>
19459
19460 * src/conflicts.c (conflicts_print): Don't complain at all when
19461 there are no reduce/reduce conflicts, and as many shift/reduce
19462 conflicts as expected.
19463 * tests/regression.at (%expect right): Adjust.
19464
19465 2001-11-23 Akim Demaille <akim@epita.fr>
19466
19467 * lib/alloca.c: Update, from fileutils.
19468
19469 2001-11-23 Akim Demaille <akim@epita.fr>
19470
19471 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
19472
19473 2001-11-23 Akim Demaille <akim@epita.fr>
19474
19475 * src/system.h: Include alloca.h.
19476 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
19477
19478 2001-11-23 Akim Demaille <akim@epita.fr>
19479
19480 * src/print_graph.c (print_actions): Remove `rule', unused.
19481 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
19482 pacify GCC's signed < unsigned warnings.
19483 * src/closure.c (itemsetsize): Likewise.
19484 * src/reader.c (symbol_list_new): Static.
19485
19486 2001-11-23 Akim Demaille <akim@epita.fr>
19487
19488 Attaching lineno to buckets is stupid, since only one copy of each
19489 symbol is kept, only the line of the first occurrence is kept too.
19490
19491 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
19492 * src/reader.c (rline_allocated): Remove, unused.
19493 (symbol_list): Have a `line' member.
19494 (symbol_list_new): New.
19495 (readgram): Use it.
19496 * src/print.c (print_grammar): Output the rule line numbers.
19497 * tests/regression.at (Solved SR Conflicts)
19498 (Unresolved SR Conflicts): Adjust.
19499 Reported by Hans Aberg.
19500
19501 2001-11-22 Marc Autret <autret_m@epita.fr>
19502
19503 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
19504
19505 2001-11-22 Marc Autret <autret_m@epita.fr>
19506
19507 * src/muscle_tab.c (muscle_init): Remove initialization of
19508 skeleton muscle.
19509 * src/output.c (output_master_parser): Do it here.
19510
19511 2001-11-20 Akim Demaille <akim@epita.fr>
19512
19513 * po/sv.po: New.
19514 * configure.in (ALL_LINGUAS): Adjust.
19515 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
19516 longer contains strings to translate.
19517
19518 2001-11-19 Akim Demaille <akim@epita.fr>
19519
19520 * src/conflicts.c (conflicts_print): Add a missing \n.
19521
19522 2001-11-19 Akim Demaille <akim@epita.fr>
19523
19524 * src/nullable.c (nullable_print): New.
19525 (set_nullable): Call it when tracing.
19526 Better locality of variables.
19527
19528 2001-11-19 Akim Demaille <akim@epita.fr>
19529
19530 * src/print.c (print_actions): Better locality of variables.
19531
19532 2001-11-19 Akim Demaille <akim@epita.fr>
19533
19534 * src/derives.c (print_derives): Fix and enrich.
19535 * src/closure.c (print_fderives): Likewise.
19536
19537 2001-11-19 Akim Demaille <akim@epita.fr>
19538
19539 * src/closure.c (itemsetend): Remove, replaced with...
19540 (itemsetsize): new.
19541
19542 2001-11-19 Akim Demaille <akim@epita.fr>
19543
19544 * src/LR0.c (kernel_end): Remove, replaced with...
19545 (kernel_size): new.
19546
19547 2001-11-19 Akim Demaille <akim@epita.fr>
19548
19549 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
19550 to clarify.
19551
19552 2001-11-19 Akim Demaille <akim@epita.fr>
19553
19554 * src/closure.c (closure): Use arrays instead of pointers to clarify.
19555
19556 2001-11-19 Akim Demaille <akim@epita.fr>
19557
19558 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
19559 trace messages.
19560 * src/LR0.c: Likewise.
19561 (allocate_itemsets): Use arrays instead of pointers to clarify.
19562
19563 2001-11-19 Akim Demaille <akim@epita.fr>
19564
19565 * src/getargs.c (statistics_flag): Replace with...
19566 (trace_flag): New.
19567 (longopts): Accept --trace instead of --statistics.
19568 * src/getargs.h, src/options.c: Adjust.
19569 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
19570 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
19571
19572 2001-11-19 Akim Demaille <akim@epita.fr>
19573
19574 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
19575 pointers to clarify the code.
19576 (save_reductions, save_shifts): Factor common parts of alternatives.
19577
19578 2001-11-19 Akim Demaille <akim@epita.fr>
19579
19580 * src/LR0.c (new_state, get_state): Complete TRACE code.
19581 * src/closure.c: Include `reader.h' to get `tags', needed by the
19582 trace code.
19583 Rename the conditional DEBUG as TRACE.
19584 Output consistently TRACEs to stderr, not stdout.
19585 * src/derives.c: Likewise.
19586 * src/reduce.c: (inaccessable_symbols): Using if is better style
19587 than goto.
19588 Use `#if TRACE' instead of `#if 0' for tracing code.
19589
19590 2001-11-19 Akim Demaille <akim@epita.fr>
19591
19592 * src/system.h (LIST_FREE, shortcpy): New.
19593 * src/LR0.c: Use them.
19594 * src/output.c (free_itemsets, free_reductions, free_shifts):
19595 Remove, replaced by LIST_FREE.
19596
19597 2001-11-19 Akim Demaille <akim@epita.fr>
19598
19599 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
19600 (REDUCTIONS_ALLOC): New.
19601 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
19602 allocation.
19603
19604 2001-11-19 Akim Demaille <akim@epita.fr>
19605
19606 * src/LR0.c (new_state): Complete trace code.
19607 * src/nullable.c (set_nullable): Don't translate traces.
19608
19609 2001-11-19 Akim Demaille <akim@epita.fr>
19610
19611 * src/print_graph.c (print_core): Better locality of variables.
19612 * src/print.c (print_core): Likewise.
19613
19614 2001-11-19 Akim Demaille <akim@epita.fr>
19615
19616 * src/vcg.c: You do the output, so you are responsible of the
19617 handling of VCG syntax, in particular: use quotearg.
19618 * src/print_graph.c: Don't.
19619 (print_actions): Don't output the actions as part of the nodes,
19620 since that's the job of the edges.
19621 (print_state): Don't output by hand: fill the node description,
19622 and ask for its output.
19623
19624 2001-11-19 Akim Demaille <akim@epita.fr>
19625
19626 * src/bison.simple (yyparse): When verbosely reporting an error,
19627 no longer put additional quotes around token names.
19628 * tests/calc.at: Adjust.
19629
19630 2001-11-19 Akim Demaille <akim@epita.fr>
19631
19632 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
19633 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
19634 * src/output.c: Adjust.
19635
19636 2001-11-19 Akim Demaille <akim@epita.fr>
19637
19638 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
19639 (rule_t): this.
19640 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
19641
19642 2001-11-19 Akim Demaille <akim@epita.fr>
19643
19644 * src/gram.h (rule_t): New.
19645 (rule_table): New.
19646 (rrhs, rlhs): Remove, part of state_t.
19647 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
19648 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
19649 * src/reader.c, src/reduce.c: Adjust.
19650
19651 2001-11-19 Akim Demaille <akim@epita.fr>
19652
19653 * src/reader.c (symbols_output): New, extracted from...
19654 (packsymbols): Here.
19655 (reader): Call it.
19656
19657 2001-11-19 Akim Demaille <akim@epita.fr>
19658
19659 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
19660 (maxrhs): this new function.
19661
19662 2001-11-19 Akim Demaille <akim@epita.fr>
19663
19664 * src/lalr.c (F): New macro to access the variable F.
19665 Adjust.
19666
19667 2001-11-19 Akim Demaille <akim@epita.fr>
19668
19669 * src/lalr.h (LA): New macro to access the variable LA.
19670 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
19671 * src/lalr.c: Adjust.
19672
19673 2001-11-19 Akim Demaille <akim@epita.fr>
19674
19675 * src/lalr.c (initialize_LA): Only initialize LA. Let...
19676 (set_state_table): handle the `lookaheads' members.
19677
19678 2001-11-19 Akim Demaille <akim@epita.fr>
19679
19680 * src/lalr.h (lookaheads): Removed array, whose contents is now
19681 a member of...
19682 (state_t): this structure.
19683 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
19684 Adjust.
19685
19686 2001-11-19 Akim Demaille <akim@epita.fr>
19687
19688 * src/lalr.h (consistent): Removed array, whose contents is now
19689 a member of...
19690 (state_t): this structure.
19691 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
19692 Adjust.
19693
19694 2001-11-19 Akim Demaille <akim@epita.fr>
19695
19696 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
19697 contents are now members of...
19698 (state_t): this structure.
19699 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
19700 Adjust.
19701
19702 2001-11-19 Akim Demaille <akim@epita.fr>
19703
19704 * src/lalr.h (state_t): New.
19705 (state_table): Be a state_t * instead of a core **.
19706 (accessing_symbol): Remove, part of state_t.
19707 * src/lalr.c: Adjust.
19708 (set_accessing_symbol): Merge into...
19709 (set_state_table): this.
19710 * src/print_graph.c, src/conflicts.c: Adjust.
19711
19712 2001-11-14 Akim Demaille <akim@epita.fr>
19713
19714 * tests/calc.at, tests/output.at, tests/regression.at,
19715 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
19716 now the tests are run in private dirs, therefore AC_CLEANUP and
19717 family can be simplified to 0-ary.
19718 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
19719 use abs. path to find config.h.
19720 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
19721 stderr, there can be way too much random noise.
19722 Instead pass -Werror to GCC and rely on the exit status.
19723 Reported by Wolfram Wagner.
19724
19725 2001-11-14 Akim Demaille <akim@epita.fr>
19726
19727 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
19728 defined only if yyoverflow is defined, to avoid `warning: unused
19729 variable `yyvs1''.
19730 Reported by The Test Suite.
19731
19732 2001-11-14 Akim Demaille <akim@epita.fr>
19733
19734 * src/print.c: Include reduce.h.
19735 Reported by Hans Aberg.
19736
19737 2001-11-14 Akim Demaille <akim@epita.fr>
19738
19739 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
19740 Revert a previous patch: these are really const.
19741 * src/conflicts.c (conflict_report): Additional useless pair of
19742 braces to pacify GCC's warnings for `if () if () {} else {}'.
19743 * src/lex.c (parse_percent_token): Replace equal_offset with
19744 arg_offset.
19745 arg is const.
19746 Be sure to strdup `arg' when used, since there is no reason for
19747 token_buffer not to change.
19748
19749 2001-11-14 Akim Demaille <akim@epita.fr>
19750
19751 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
19752 definition.
19753 * src/main.c (main): Use them.
19754 Suggested by Hans Aberg.
19755
19756 2001-11-12 Akim Demaille <akim@epita.fr>
19757
19758 * src/system.h (ngettext): Now that we use ngettext, be sure to
19759 provide a default definition when NLS are not used.
19760
19761 2001-11-12 Akim Demaille <akim@epita.fr>
19762
19763 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
19764 Use @kbd to denote user input.
19765 (Language and Grammar): ANSIfy the example.
19766 Adjust its layout for info/notinfo.
19767 (Location Tracking Calc): Output error messages to stderr.
19768 Output locations in a more GNUtically correct way.
19769 Fix a couple of Englishos.
19770 Adjust @group/@end group pairs.
19771
19772 2001-11-12 Akim Demaille <akim@epita.fr>
19773
19774 %expect was not functioning at all.
19775
19776 * src/conflicts.c (expected_conflicts): Set to -1.
19777 (conflict_report): Use ngettext.
19778 (conflicts_print): Check %expect and make its violation an error.
19779 * doc/bison.texinfo (Expect Decl): Adjust.
19780 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
19781 * tests/regression.at (%expect not enough, %expect right)
19782 (%expect too much): New.
19783
19784 2001-11-12 Akim Demaille <akim@epita.fr>
19785
19786 * tests/regression.at (Conflicts): Rename as...
19787 (Unresolved SR Conflicts): this.
19788 (Solved SR Conflicts): New.
19789
19790 2001-11-12 Akim Demaille <akim@epita.fr>
19791
19792 * src/reduce.c (print_results): Rename as...
19793 (reduce_output): This.
19794 Output to OUT, passed as argument, instead of output_obstack.
19795 (dump_grammar): Likewise.
19796 (reduce_free): New.
19797 Also free V1.
19798 (reduce_grammar): No longer call reduce_output, since...
19799 * src/print.c (print_results): do it.
19800 * src/main.c (main): Call reduce_free;
19801
19802 2001-11-12 Akim Demaille <akim@epita.fr>
19803
19804 * src/conflicts.c (print_reductions): Accept OUT as argument.
19805 Output to it, not to output_obstack.
19806 * src/print.c (print_actions): Adjust.
19807
19808 2001-11-12 Akim Demaille <akim@epita.fr>
19809
19810 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
19811 the result instead of using...
19812 (src_total, rrc_total, src_count, rrc_count): Remove.
19813 (any_conflicts): Remove.
19814 (print_conflicts): Split into...
19815 (conflicts_print, conflicts_output): New.
19816 * src/conflicts.h: Adjust.
19817 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
19818 * src/print.c (print_grammar): Issue `\n' between two rules.
19819 * tests/regression.at (Conflicts): New.
19820 Reported by Tom Lane.
19821
19822 2001-11-12 Akim Demaille <akim@epita.fr>
19823
19824 * tests/regression.at (Invalid input): Remove, duplicate with
19825 ``Invalid input: 1''.
19826
19827 2001-11-12 Akim Demaille <akim@epita.fr>
19828
19829 * tests/torture.at (AT_DATA_STACK_TORTURE)
19830 (Exploding the Stack Size with Alloca)
19831 (Exploding the Stack Size with Malloc): New.
19832
19833 2001-11-12 Akim Demaille <akim@epita.fr>
19834
19835 * src/bison.simple (YYSTACK_REALLOC): New.
19836 (yyparse) [!yyoverflow]: Use it and free the old stack.
19837 Reported by Per Allansson.
19838
19839 2001-11-12 Pascal Bart <pascal.bart@epita.fr>
19840
19841 * src/bison.simple: Define type yystype instead of YYSTYPE, and
19842 define CPP macro, which substitute YYSTYPE by yystype.
19843 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
19844 with yyltype/YYLTYPE. This allows inclusion of the generated
19845 header within the parser if the compiler, such as GGC, accepts
19846 multiple equivalent #defines.
19847 From Akim.
19848
19849 2001-11-05 Akim Demaille <akim@epita.fr>
19850
19851 * src/reader.c (symbols_output): New, extracted from...
19852 (packsymbols): here.
19853 (reader): Adjust.
19854
19855 2001-11-05 Akim Demaille <akim@epita.fr>
19856
19857 * src/lex.c (parse_percent_token): s/quotearg/quote/.
19858
19859 2001-11-05 Akim Demaille <akim@epita.fr>
19860
19861 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
19862 pattern.
19863
19864 2001-11-05 Akim Demaille <akim@epita.fr>
19865
19866 * src/options.h (struct option_table_struct): set_flags is void*.
19867 * src/options.c (longopts): Support `--output' and `%output'.
19868 (usage): Adjust.
19869 * src/lex.h (tok_setopt): Remove, replaced with...
19870 (tok_intopt, tok_stropt): these new guys.
19871 * src/lex.c (getopt.h): Not needed.
19872 (token_buffer, unlexed_token_buffer): Not const.
19873 (percent_table): Promote `-' over `_' in directive names.
19874 Active `%name-prefix', `file-prefix', and `output'.
19875 (parse_percent_token): Accept possible arguments to directives.
19876 Promote `-' over `_' in directive names.
19877
19878 2001-11-04 Akim Demaille <akim@epita.fr>
19879
19880 * doc/bison.texinfo (Decl Summary): Split the list into
19881 `directives for grammars' and `directives for bison'.
19882 Sort'em.
19883 Add description of `%name-prefix', `file-prefix', and `output'.
19884 Promote `-' over `_' in directive names.
19885 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
19886 Simplify the description of `--name-prefix'.
19887 Promote `-' over `_' in directive names.
19888 Promote `--output' over `--output-file'.
19889 Fix the description of `--defines'.
19890 * tests/output.at: Exercise %file-prefix and %output.
19891
19892 2001-11-02 Akim Demaille <akim@epita.fr>
19893
19894 * doc/refcard.tex: Update.
19895
19896 2001-11-02 Akim Demaille <akim@epita.fr>
19897
19898 * src/symtab.h (SUNDEF): New.
19899 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
19900 stand for `uninitialized', instead of 0.
19901 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
19902 * src/lex.c (lex): Adjust.
19903
19904 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
19905 Number it 0.
19906 Let yylex return it instead of a plain 0.
19907 Reported by Dick Streefland.
19908
19909 2001-11-02 Akim Demaille <akim@epita.fr>
19910
19911 * tests/regression.at (Mixing %token styles): New test.
19912
19913 2001-11-02 Akim Demaille <akim@epita.fr>
19914
19915 * src/reader.c (parse_thong_decl): Formatting changes.
19916 (token_translations_init): New, extracted from...
19917 (packsymbols): Here.
19918 Adjust.
19919
19920 2001-11-01 Akim Demaille <akim@epita.fr>
19921
19922 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
19923 Check that `9foo.y' produces correct cpp guards.
19924 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
19925 guards.
19926 Reported by Wwp.
19927
19928 2001-11-01 Akim Demaille <akim@epita.fr>
19929
19930 * tests/regression.at (Invalid input: 2): New.
19931 * src/lex.c (unlexed_token_buffer): New.
19932 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
19933 too.
19934 Reported by Wwp.
19935
19936 2001-11-01 Akim Demaille <akim@epita.fr>
19937
19938 * tests/calc.at: Catch up with 1.30.
19939 * configure.in: Bump to 1.49a.
19940 Adjust to newer Autotest.
19941
19942 2001-10-19 Pascal Bart <pascal.bart@epita.fr>
19943
19944 * src/conflicts.c: Move global variables rrc_total and src_total ...
19945 (print_conflicts): here.
19946 * src/output.c (output): Free global variable user_toknums.
19947 * src/lex.c (token_obstack): Become static.
19948
19949 2001-10-18 Akim Demaille <akim@epita.fr>
19950
19951 * tests/atlocal.in (GCC): Add.
19952 * tests/calc.at: s/m4_match/m4_bmatch/.
19953 s/m4_patsubst/m4_bpatsubst/.
19954 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
19955 * configure.in: AC_SUBST(GCC).
19956
19957 2001-10-14 Marc Autret <autret_m@epita.fr>
19958
19959 * src/options.c (create_long_option_table): Fix.
19960
19961 2001-10-10 Akim Demaille <akim@epita.fr>
19962
19963 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
19964
19965 2001-10-04 Akim Demaille <akim@epita.fr>
19966
19967 * src/reader.c (parse_union_decl): Push the caracters in
19968 union_obstack, not attrs_obstack.
19969
19970 2001-10-04 Akim Demaille <akim@epita.fr>
19971
19972 Merge in the branch 1.29.
19973
19974 * src/reader.c (packsymbols): Use a temporary obstack for
19975 `%%tokendef', since output_stack is already used elsewhere.
19976
19977 2001-10-02 Akim Demaille <akim@epita.fr>
19978
19979 Bump 1.29d.
19980
19981 2001-10-02 Akim Demaille <akim@epita.fr>
19982
19983 Version 1.29c.
19984
19985 2001-10-02 Akim Demaille <akim@epita.fr>
19986
19987 * tests/regression.at (Invalid CPP headers): New.
19988 From Alexander Belopolsky.
19989 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
19990
19991 2001-10-02 Akim Demaille <akim@epita.fr>
19992
19993 * tests/regression.at (Invalid input): New.
19994 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
19995 Reported by Shura.
19996
19997 2001-10-02 Akim Demaille <akim@epita.fr>
19998
19999 * tests/calc.at: Now that --debug works, the tests must be adjusted.
20000
20001 2001-10-02 Akim Demaille <akim@epita.fr>
20002
20003 * src/output.c (output_parser): Assert `skeleton'.
20004 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
20005 systems.
20006 From Shura.
20007
20008 2001-10-01 Marc Autret <autret_m@epita.fr>
20009
20010 * src/lex.h: Echo modifications.
20011 * src/lex.c (unlex): Parameter is now token_t.
20012 From Hans Aberg.
20013
20014 2001-10-01 Marc Autret <autret_m@epita.fr>
20015
20016 * src/main.c: Include lex.h.
20017 From Hans Aberg.
20018
20019 2001-09-29 Akim Demaille <akim@epita.fr>
20020
20021 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
20022
20023 2001-09-28 Akim Demaille <akim@epita.fr>
20024
20025 * tests/testsuite.at: Update to newer Autotest.
20026 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
20027
20028 2001-09-27 Akim Demaille <akim@epita.fr>
20029
20030 Position independent wrapper.
20031
20032 * tests/bison: Remove.
20033 * tests/bison.in: New.
20034 * configure.in: Adjust.
20035
20036 2001-09-27 Paul Eggert <eggert@twinsun.com>
20037
20038 Port quotearg fixes from tar 1.13.24.
20039
20040 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
20041 tm to be declared.
20042 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
20043 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
20044
20045 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
20046 * m4/mbrtowc.m4: New file.
20047 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
20048 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
20049
20050 2001-09-27 Akim Demaille <akim@epita.fr>
20051
20052 Bump to 1.29c.
20053
20054 2001-09-27 Akim Demaille <akim@epita.fr>
20055
20056 Version 1.29b.
20057
20058 2001-09-25 Akim Demaille <akim@epita.fr>
20059
20060 * src/system.h: Include `xalloc.h'.
20061 Remove it from the C files.
20062 * src/files.c (output_files): Free the obstacks.
20063 * src/lex.c (init_lex): Rename as...
20064 (lex_init): this.
20065 (lex_free): New.
20066 * src/main.c (main): Use it.
20067
20068 2001-09-24 Marc Autret <autret_m@epita.fr>
20069
20070 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
20071 to output informations in fout (FILE*).
20072 (open_graph, close_graph): Likewise.
20073 (output_graph, output_edge, output_node): Likewise.
20074 * src/vcg.h: Update function prototypes.
20075 * src/print_graph.c (print_graph): Open output graph file.
20076 (print_actions): Adjust.
20077 * src/files.h: Remove extern declaration.
20078 * src/files.c: Remove graph_obstack declaration.
20079 (open_files): Remove graph_obstack initialization.
20080 (output_files): Remove graph_obstack saving.
20081
20082 2001-09-24 Marc Autret <autret_m@epita.fr>
20083
20084 * src/files.c (compute_output_file_names): Fix.
20085
20086 2001-09-24 Marc Autret <autret_m@epita.fr>,
20087 Akim Demaille <akim@epita.fr>
20088
20089 * src/reader.c (reader): Remove call to free_symtab ().
20090 * src/main.c (main): Call it here.
20091 Include symtab.h.
20092 * src/conflicts.c (initialize_conflicts): Rename as...
20093 (solve_conflicts): this.
20094 * src/print.c (print_core, print_actions, print_state)
20095 (print_grammar): Dump to a file instead a `output_obstack'.
20096 (print_results): Dump `output_obstack', and then proceed with the
20097 FILE *.
20098 * src/files.c (compute_output_file_names, close_files): New.
20099 (output_files): Adjust.
20100 * src/main.c (main): Adjust.
20101
20102 2001-09-23 Marc Autret <autret_m@epita.fr>
20103
20104 * src/files.c (compute_header_macro): Computes header macro name
20105 from spec_defines_file when given.
20106
20107 2001-09-23 Marc Autret <autret_m@epita.fr>
20108
20109 * src/files.c (output_files): Add default extensions.
20110
20111 2001-09-22 Akim Demaille <akim@epita.fr>
20112
20113 * src/conflicts.c (finalize_conflicts): Rename as...
20114 (free_conflicts): this.
20115
20116 2001-09-22 Akim Demaille <akim@epita.fr>
20117
20118 * src/gram.c (gram_free): Rename back as...
20119 (dummy): this.
20120 (output_token_translations): Free `token_translations'.
20121 * src/symtab.c (free_symtab): Free the tag field.
20122
20123 2001-09-22 Akim Demaille <akim@epita.fr>
20124
20125 Remove `translations' as it is always set to true.
20126
20127 * src/gram.h: Adjust.
20128 * src/reader.c (packsymbols, parse_token_decl): Adjust
20129 * src/print.c (print_grammar): Adjust.
20130 * src/output.c (output_token_translations): Adjust.
20131 * src/lex.c (lex): Adjust.
20132 * src/gram.c: Be sure the set pointers to NULL.
20133 (dummy): Rename as...
20134 (gram_free): this.
20135
20136 2001-09-22 Akim Demaille <akim@epita.fr>
20137
20138 * configure.in: Invoke AM_LIB_DMALLOC.
20139 * src/system.h: Use dmalloc.
20140 * src/LR0.c: Be sure to have pointers initialized to NULL.
20141 (allocate_itemsets): Allocate kernel_items only if needed.
20142
20143 2001-09-22 Akim Demaille <akim@epita.fr>
20144
20145 * configure.in: Bump to 1.29b.
20146 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
20147 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
20148 need xmalloc.c in calc.y.
20149 From Pascal Bart.
20150
20151 2001-09-21 Akim Demaille <akim@epita.fr>
20152
20153 Version 1.29a.
20154 * Makefile.maint, config/config.guess, config/config.sub,
20155 * config/missing: Update from masters.
20156 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
20157 upon package.m4.
20158 * configure.in (ALL_LINGUAS): Add `tr'.
20159
20160 2001-09-21 Akim Demaille <akim@epita.fr>
20161
20162 * tests/Makefile.am (package.m4): Move to...
20163 ($(srcdir)/$(TESTSUITE)): here.
20164
20165 2001-09-20 Akim Demaille <akim@epita.fr>
20166
20167 * src/complain.c: No longer try to be standalone: use system.h.
20168 Don't assume __STDC__ is defined to 1. Just test if it is defined.
20169 * src/complain.h: Likewise.
20170 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
20171 Remove the unused variable `n'.
20172 From Albert Chin-A-Young.
20173
20174 2001-09-18 Marc Autret <autret_m@epita.fr>
20175
20176 * doc/bison.1: Update.
20177 * doc/bison.texinfo (Bison Options): Update --defines and --graph
20178 descriptions.
20179 (Option Cross Key): Update.
20180 Add --graph.
20181
20182 2001-09-18 Marc Autret <autret_m@epita.fr>
20183
20184 * tests/regression.at: New test (comment in %union).
20185
20186 2001-09-18 Marc Autret <autret_m@epita.fr>
20187
20188 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
20189 do that.
20190 Reported by Keith Browne.
20191
20192 2001-09-18 Marc Autret <autret_m@epita.fr>
20193
20194 * tests/output.at: Add tests for --defines and --graph.
20195
20196 2001-09-18 Marc Autret <autret_m@epita.fr>
20197
20198 * tests/output.at: Removes tests of %{header,src}_extension features.
20199
20200 2001-09-18 Akim Demaille <akim@epita.fr>
20201
20202 * tests/Makefile.am (package.m4): New.
20203 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
20204 (_AT_CHECK_CALC_ERROR): Likewise.
20205 Factor the `, ' part of verbose error messages.
20206
20207 2001-09-18 Marc Autret <autret_m@epita.fr>
20208
20209 * src/getargs.c (longopts): Declare --defines and --graph as options
20210 with optional arguments.
20211 * src/files.h: Add extern declarations.
20212 * src/files.c (spec_graph_file, spec_defines_file): New.
20213 (output_files): Update.
20214 Remove CPP-outed code.
20215
20216 2001-09-18 Marc Autret <autret_m@epita.fr>
20217
20218 Turn off %{source,header}_extension feature.
20219
20220 * src/files.c (compute_exts_from_gf): Update.
20221 (compute_exts_from_src): Update.
20222 (output_files): CPP-out useless code.
20223 * src/files.h: Remove {header,source}_extension extern declarations.
20224 * src/reader.c (parse_dquoted_param): CPP-out.
20225 (parse_header_extension_decl): Remove.
20226 (parse_source_extension_decl): Remove.
20227 (read_declarations): Remove cases tok_{hdrext,srcext}.
20228 * src/lex.c (percent_table): Remove {header,source}_extension entries.
20229 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
20230
20231 2001-09-10 Akim Demaille <akim@epita.fr>
20232
20233 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
20234 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
20235 (AT_CHECK_OUTPUT): this.
20236 Merely check ls' exit status, its output is useless.
20237
20238 2001-09-10 Akim Demaille <akim@epita.fr>
20239
20240 * tests/calc.at: Use m4_match.
20241 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
20242
20243 2001-09-10 Marc Autret <autret_m@epita.fr>,
20244 Akim Demaille <akim@epita.fr>
20245
20246 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
20247 enum color_e.
20248 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
20249 to `normal'.
20250 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
20251 * src/lex.h: Adjust prototype.
20252 (token_t): Add `tok_undef'.
20253 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
20254 (parse_percent_token): Now returns token_t.
20255 Add default statement in switch.
20256 (lex): Separate `c' as an input variable, from the token_t result
20257 part.
20258 (unlexed): Is a token_t.
20259
20260 2001-09-10 Akim Demaille <akim@epita.fr>
20261
20262 * configure.in: Bump to 1.29a.
20263
20264 2001-09-07 Akim Demaille <akim@epita.fr>
20265
20266 Version 1.29.
20267
20268 2001-08-30 Akim Demaille <akim@epita.fr>
20269
20270 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
20271 * m4/atconfig.m4: Remove.
20272 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
20273 * tests/bison: New.
20274 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
20275 m4_if, m4_patsubst, and m4_regexp.
20276 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
20277 `input' file instead of echo.
20278
20279 2001-08-29 Akim Demaille <akim@epita.fr>
20280
20281 Bump to 1.28e.
20282
20283 2001-08-29 Akim Demaille <akim@epita.fr>
20284
20285 Version 1.28d.
20286
20287 2001-08-29 Paul Eggert <eggert@twinsun.com>
20288
20289 * src/bison.simple (yyparse): Don't take the address of an
20290 item before the start of an array, as that doesn't conform to
20291 the C Standard.
20292
20293 2001-08-29 Robert Anisko <anisko_r@epita.fr>
20294
20295 * doc/bison.texinfo (Location Tracking Calc): New node.
20296
20297 2001-08-29 Paul Eggert <eggert@twinsun.com>
20298
20299 * src/output.c (output): Do not define const, as this now
20300 causes more problems than it cures.
20301
20302 2001-08-29 Akim Demaille <akim@epita.fr>
20303
20304 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
20305 the nodes.
20306 Be sure to tag the `detailmenu'.
20307
20308 2001-08-29 Akim Demaille <akim@epita.fr>
20309
20310 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
20311 download in a tmp dir.
20312
20313 2001-08-28 Marc Autret <autret_m@epita.fr>
20314
20315 * config/depcomp: New file.
20316
20317 2001-08-28 Marc Autret <autret_m@epita.fr>
20318
20319 * doc/bison.1 (mandoc): Adjust.
20320 From Juan Manuel Guerrero.
20321
20322 2001-08-28 Marc Autret <autret_m@epita.fr>
20323
20324 * src/print_graph.c (print_state): Fix.
20325
20326 2001-08-27 Marc Autret <autret_m@epita.fr>
20327
20328 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
20329 char * members.
20330 Echo modifications to the functions prototypes.
20331 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
20332
20333 2001-08-27 Marc Autret <autret_m@epita.fr>
20334
20335 * src/vcg.c: Include `xalloc.h'.
20336 (add_colorentry): New.
20337 (add_classname): New.
20338 (add_infoname): New.
20339 * src/vcg.h: Add new prototypes.
20340
20341 2001-08-27 Akim Demaille <akim@epita.fr>
20342
20343 * Makefile.maint: Sync. again with CVS Autoconf.
20344
20345 2001-08-27 Akim Demaille <akim@epita.fr>
20346
20347 * Makefile.maint: Formatting changes.
20348 (po-update, cvs-update, update): New targets.
20349 (AMTAR): Remove.
20350
20351 2001-08-27 Akim Demaille <akim@epita.fr>
20352
20353 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
20354 * Makefile.maint: Sync. with CVS Autoconf.
20355
20356 2001-08-27 Marc Autret <autret_m@epita.fr>
20357
20358 * src/vcg.h (struct infoname_s): New.
20359 (struct colorentry_s): New.
20360 (graph_s): New fields {vertical,horizontal}_order in structure.
20361 Add `infoname' field.
20362 Add `colorentry' field;
20363 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
20364 (G_HORIZONTAL_ORDER): New.
20365 (G_INFONAME): New.
20366 (G_COLORENTRY): New.
20367 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
20368 Add output of `infoname'.
20369 Add output of `colorentry'.
20370
20371 2001-08-27 Marc Autret <autret_m@epita.fr>
20372
20373 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
20374 This one shadowed a global parameter.
20375
20376 2001-08-24 Marc Autret <autret_m@epita.fr>
20377
20378 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
20379 instead of `unsigned'.
20380 (print_state): Do not call obstack_object_size () in obstack_grow ()
20381 to avoid macro variables shadowing.
20382
20383 2001-08-23 Marc Autret <autret_m@epita.fr>
20384
20385 * src/lex.c (percent_table): Typo: s/naem/name/.
20386 Add graph option.
20387 Normalize new options declarations.
20388
20389 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
20390
20391 * tests/suite.at: Exercise %header_extension and %source_extension.
20392
20393 2001-08-16 Marc Autret <autret_m@epita.fr>
20394
20395 * src/reader.c (parse_dquoted_param): New.
20396 (parse_header_extension_decl): Use it.
20397 (parse_source_extension_decl): Likewise.
20398
20399 2001-08-16 Marc Autret <autret_m@epita.fr>
20400
20401 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
20402 (get_xxxx_str): Use assert () instead of complain ().
20403 Remove return invokations in default cases.
20404 (get_decision_str): Modify default behaviour. Remove second argument.
20405 Echo modifications on calls.
20406 (output_graph): Fix.
20407
20408 2001-08-16 Marc Autret <autret_m@epita.fr>
20409
20410 * src/getargs.c (usage): Update with ``-g, --graph''.
20411
20412 2001-08-16 Marc Autret <autret_m@epita.fr>
20413
20414 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
20415 (Option Cross Key): Likewise.
20416 * doc/bison.1: Update.
20417
20418 2001-09-25 Pascal Bart <pascal.bart@epita.fr>
20419
20420 * src/output.c (output_master_parser): Don't finish action_obstack.
20421 (output_parser): Don't care about the muscle action, here.
20422 (prepare): Copy the action_obstack in the action muscle.
20423 (output): Free action_obstack.
20424
20425 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
20426
20427 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
20428 will contain `%union' declaration.
20429 (parse_union_decl): Delete #line directive output.
20430 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
20431 informations about %union.
20432 (parse_union_decl): Copy the union_obstack in the muscle stype.
20433 * src/bison.simple: Add new #line directive.
20434 Add typdef %%stype YYSTYPE.
20435
20436 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
20437
20438 * src/bison.simple: Add new `#line' directive.
20439
20440 2001-09-22 Pascal Bart <pascal.bart@epita.fr>
20441
20442 * src/bison.simple: New `#line' directive.
20443 * src/output.c (output_parser): Support new dynamic muscle input_line.
20444
20445 2001-09-22 Marc Autret <autret_m@epita.fr>
20446
20447 * src/output.c (output_master_parser): New.
20448 (output_parser): Be more re-entrant.
20449
20450 2001-09-21 Marc Autret <autret_m@epita.fr>
20451
20452 * src/reader.c (copy_definition, parse_union_decl): Update and use
20453 `linef' muscle.
20454 (copy_action): Likewise.
20455 Use obstack_1grow ().
20456 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
20457
20458 2001-09-21 Marc Autret <autret_m@epita.fr>
20459
20460 * src/options.c (option_table): Adjust.
20461 * src/lex.c (parse_percent_token): Fix.
20462
20463 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
20464
20465 * src/options.c (symtab.h): Include it, need by lex.h.
20466
20467 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
20468
20469 * src/lex.c (parse_percent_token): Change type of variable `tx', which
20470 is now an option_table_struct*.
20471 (option_strcmp): New function option_strcmp.
20472 (parse_percent_token): Call option_strcmp.
20473 * src/getargs.c (xalloc.h, options.h): Include it.
20474 (getargs): Call create_long_option_table.
20475 (getargs): Free longopts at the end of the function.
20476 (shortopts): Move in options.c.
20477 * src/options.c (create_long_option_table): New function. Convert
20478 information from option_table to option structure.
20479 * src/reader.c (options.h): Include it.
20480
20481 * src/Makefile.am: Adjust.
20482 * src/options.c (option_table): Create from longopts and percent_table.
20483 * src/getargs.c (longopts): Delete.
20484 * src/lex.c (struct percent_table_struct): Delete.
20485 (percent_table): Delete.
20486 (options.h): Include it.
20487 * src/options.c: Create.
20488 * src/options.h: Create.
20489 Declare enum opt_access_e.
20490 Define struct option_table_struct.
20491
20492 2001-09-20 Marc Autret <autret_m@epita.fr>
20493
20494 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
20495 sections of Bison.
20496
20497 2001-09-19 Pascal Bart <pascal.bart@epita.fr>
20498
20499 * src/bison.simple: s/%%filename/%%skeleton.
20500 * src/muscle_tab.c (getargs.h): Include it.
20501 (muscle_init): Insert new muscle skeleton.
20502
20503 2001-09-18 Pascal Bart <pascal.bart@epita.fr>
20504
20505 * src/output.c (output_parser): Delete unused variable actions_dumped.
20506
20507 2001-09-07 Pascal Bart <pascal.bart@epita.fr>
20508
20509 * src/output.c (output): Delete call to reader_output_yylsp.
20510 * src/reader.c (reader): Likewise.
20511 * src/reader.h: Delete declaration of reader_output_yylsp.
20512
20513 2001-09-02 Marc Autret <autret_m@epita.fr>
20514
20515 * src/reader.c: Include muscle_tab.h.
20516 (parse_union_decl): Update.
20517 (parse_macro_decl): Rename parse_muscle_decl.
20518 Update to use renamed functions and variable.
20519 (read_declarations, copy_action, read_additionnal_code, : Updated
20520 with correct variables and functions names.
20521 (packsymbols, reader): Likewise.
20522
20523 * src/reader.h (muscle_obstack): Extern declaration update.
20524
20525 * src/output.c: Include muscle_tab.h
20526 In all functions using macro_insert, change by using muscle_insert ().
20527 (macro_obstack): Rename muscle_obstack.
20528 Echo modifications in the whole file.
20529 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
20530 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
20531 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
20532
20533 * src/muscle_tab.h: Update double inclusion macros.
20534 (macro_entry_s): Rename muscle_entry_s.
20535 Update prototypes.
20536
20537 * src/muscle_tab.c: Include muscle_tab.h.
20538 Rename macro_tabble to muscle_table.
20539 (mhash1, mhash2, mcmp): Use muscle_entry.
20540 (macro_init): Rename muscle_init. Update.
20541 (macro_insert): Rename muscle_insert. Update.
20542 (macro_find): Rename muscle_find. Update.
20543
20544 * src/main.c: Include muscle_tab.h.
20545 (main): Call muscle_init ().
20546 * src/Makefile.am (bison_SOURCES): Echo modifications.
20547
20548 2001-09-02 Marc Autret <autret_m@epita.fr>
20549
20550 Now the files macro_tab.[ch] are named muscle_tab.[ch].
20551
20552 * src/muscle_tab.c, src/muscle_tab.h: Add files.
20553
20554 2001-09-02 Marc Autret <autret_m@epita.fr>
20555
20556 * src/macrotab.c, src/macrotab.h: Remove.
20557
20558 2001-09-01 Pascal Bart <pascal.bart@epita.fr>
20559
20560 * src/reader.c (copy_guard): Use muscle to specify the `#line'
20561 filename.
20562
20563 2001-09-01 Marc Autret <autret_m@epita.fr>
20564
20565 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
20566 to an explicit value to activate the feature. We do it here.
20567
20568 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
20569
20570 * src/output.c (prepare): Delete the `filename' muscule insertion.
20571 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
20572 (parse_union_decl): Likewise.
20573 * src/macrotab.c (macro_init): Initialize filename by infile.
20574
20575 2001-08-31 Marc Autret <autret_m@epita.fr>
20576
20577 * src/bison.simple (YYLSP_NEEDED): New definition.
20578 * src/output.c (prepare): Add macro insertion of `locations_flag'
20579
20580 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
20581
20582 * src/output.c (prepare): Delete insertion of previous muscles,
20583 and insert the `prefix' muscles.
20584 * src/macrotab.c (macro_init): Likewise.
20585 (macro_init): Initialization prefix directive by `yy'.
20586 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
20587 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
20588 yylval, yydebug, yyerror, yynerrs and yyparse.
20589 New directive `#define' to substitute yydebug, ... with option
20590 name_prefix.
20591
20592 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
20593
20594 * src/main.c (main): Standardize.
20595 * src/output.c (output_table_data, output_parser): Likewise.
20596 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
20597
20598 2001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
20599
20600 * src/reader.c (read_additionnal_code): Rename %%user_code to
20601 %%epilogue.
20602 * src/output.c (output): Rename %%declarations to %%prologue.
20603 * src/bison.simple: Echo modifications.
20604
20605 2001-08-31 Marc Autret <autret_m@epita.fr>
20606
20607 * src/reader.c (readgram): CleanUp.
20608 (output_token_defines): Likewise.
20609 (packsymbols): Likewise.
20610 (reader): Likewise.
20611 * src/output.c (output): CPP-out useless code.
20612
20613 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
20614
20615 * src/reader.c (reader): Delete obsolete call to function
20616 output_trailers and output_headers.
20617 * src/output.h: Remove obsolete functions prototypes of output_headers
20618 and output_trailers.
20619
20620 2001-08-30 Pascal Bart <pascal.bart@epita.fr>
20621
20622 * src/main.c: Include macrotab.h.
20623 * src/macrotab.h (macro_entry_s): Constify fields.
20624 Adjust functions prototypes.
20625 * src/macrotab.c (macro_insert): Constify key and value.
20626 (macro_find): Constify key.
20627 (macro_insert): Include 'xalloc.h'
20628 (macro_insert): Use XMALLOC.
20629 (macro_find): Constify return value.
20630 * src/output.c (output_table_data): Rename table to table_data.
20631 (output_parser): Constify macro_key, macro_value.
20632
20633 2001-08-30 Marc Autret <autret_m@epita.fr>
20634
20635 * src/reader.c (parse_skel_decl): New.
20636 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
20637 * src/lex.h (token_t): New token `tok_skel'.
20638 * src/lex.c (percent_table): Add skeleton option entry.
20639 Standardize.
20640
20641 2001-08-29 Marc Autret <autret_m@epita.fr>
20642
20643 * src/bison.simple: Add %%user_code directive at the end.
20644 * src/reader.c (read_additionnal_code): New.
20645 (reader): Use it.
20646 * src/output.c (output_program): Remove.
20647 (output): Update.
20648
20649 2001-08-28 Marc Autret <autret_m@epita.fr>
20650
20651 * src/output.c (output_actions): Clean up.
20652 (output_gram): CPP-out useless code.
20653 * src/reader.c (reader): Clean up, CPP-out useless code.
20654
20655 2001-08-28 Pascal Bart <pascal.bart@epita.fr>
20656
20657 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
20658 directive.
20659 * src/bison.simple: Add `%%definitions'.
20660
20661 2001-08-28 Marc Autret <autret_m@epita.fr>
20662
20663 * config/depcomp: New file.
20664
20665 2001-08-27 Paul Eggert <eggert@twinsun.com>
20666
20667 * src/bison.simple (yyparse): Don't take the address of an
20668 item before the start of an array, as that doesn't conform to
20669 the C Standard.
20670
20671 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
20672
20673 * src/output.c (output): Remove the initialization of the macro
20674 obstack. It was done too late here.
20675
20676 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
20677 completely wrong.
20678 (reader): Initialize the macro obstack here, since we need it to grow
20679 '%define' directives.
20680
20681 * src/reader.h: Declare the macro obstack as extern.
20682
20683 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
20684
20685 * src/output.c (output_parser): Fix. Store single '%' characters in
20686 the output obstack instead of throwing them away.
20687
20688 2001-08-27 Akim Demaille <akim@epita.fr>
20689
20690 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
20691
20692 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20693
20694 * lib/Makefile.am: Adjust.
20695
20696 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20697
20698 * src/bison.simple: Update and add '%%' directives.
20699
20700 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20701
20702 * src/reader.c (reader): Remove calls to 'output_headers' and
20703 'output_trailers'. Remove some C output.
20704 (readgram): Disable a piece of code that was writing a default
20705 definition for 'YYSTYPE'.
20706 (reader_output_yylsp): Remove.
20707 (packsymbols): Output token defintions to a macro.
20708 (copy_definition): Disable C output.
20709
20710 * src/reader.c (parse_macro_decl): New function used to parse macro
20711 declarations.
20712 (copy_string2): Put the body of copy_string into this new function.
20713 Add a parameter to let the caller choose whether he wants to copy the
20714 string delimiters or not.
20715 (copy_string): Be a simple call to copy_string2 with the last argument
20716 bound to true.
20717 (read_declarations): Add case for macro definition.
20718 (copy_identifier): New.
20719 (parse_macro_decl): Read macro identifiers using copy_identifier
20720 rather than lex.
20721
20722 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20723
20724 * src/output.c (prepare): Add prefixed names.
20725 (output_parser): Output semantic actions.
20726 (output_parser): Fix bug on '%%line' directives.
20727
20728 * src/output.c (output_headers): Remove. The C code printed by this
20729 function should now be in the skeletons.
20730 (output_trailers): Remove.
20731 (output): Disable call to 'reader_output_yylsp'.
20732 (output_rule_data): Do not output tables to the table obstack.
20733
20734 * src/output.c: Remove some C dedicated output.
20735 Improve the use of macro and output obstacks.
20736 (output_defines): Remove.
20737
20738 * src/output.c (output_token_translations): Associate 'translate'
20739 table with a macro. No output to the table obstack.
20740 (output_gram): Same for 'rhs' and 'prhs'.
20741 (output_stos): Same for 'stos'.
20742 (output_rule_data): Same for 'r1' and 'r2'.
20743 (token_actions): Same for 'defact'.
20744 (goto_actions): Same for 'defgoto'.
20745 (output_base): Same for 'pact' and 'pgoto'.
20746 (output_table): Same for 'table'.
20747 (output_check): Same for 'check'.
20748
20749 * src/output.c (output_table_data): New function.
20750 (output_short_table): Remove.
20751 (output_short_or_char_table): Remove.
20752
20753 * src/output.c (output_parser): Replace most of the skeleton copy code
20754 with something new. Skeletons are now processed character by character
20755 rather than line by line, and Bison looks for '%%' macros. This is the
20756 first step in making Bison's output process (a lot) more flexible.
20757 (output_parser): Use the macro table.
20758
20759 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20760
20761 * src/main.c (main): Initialize the macro table.
20762
20763 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20764
20765 * src/lex.c (percent_table): Add tok_define.
20766 * src/lex.h: Add tok_define.
20767
20768 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20769
20770 * src/macrotab.c: New file.
20771 * src/macrotab.h: New file.
20772 * src/Makefile.am: Update.
20773
20774 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20775
20776 * lib/hash.c: New file.
20777 * lib/hash.h: New file.
20778 * lib/Makefile.am: Update.
20779
20780 2001-08-15 Akim Demaille <akim@epita.fr>
20781
20782 Version 1.28c.
20783
20784 2001-08-15 Marc Autret <autret_m@epita.fr>
20785
20786 * src/reader.c (readgram): Indent output macro YYSTYPE.
20787 (packsymbols): Likewise.
20788 (output_token_defines): Likewise.
20789 * src/files.c: Standardize.
20790 (compute_header_macro): New.
20791 (defines_obstack_save): New. Use compute_header_macro.
20792 (output_files): Update. Use defines_obstack_save.
20793
20794 2001-08-15 Akim Demaille <akim@epita.fr>
20795
20796 * doc/bison.texinfo (Table of Symbols): Document
20797 YYSTACK_USE_ALLOCA.
20798
20799 2001-08-15 Akim Demaille <akim@epita.fr>
20800
20801 * missing: Update from CVS Automake.
20802 * config/config.guess, config/config.sub, config/texinfo.tex:
20803 Update from gnu.org.
20804
20805 2001-08-15 Akim Demaille <akim@epita.fr>
20806
20807 * Makefile.maint: Sync with CVS Autoconf.
20808
20809 2001-08-14 Pascal Bart <pascal.bart@epita.fr>
20810
20811 * doc/bison.texinfo: Include GNU Free Documentation License from
20812 `fdl.texi'.
20813 * doc/fdl.texi: Add to package.
20814
20815 2001-08-14 Marc Autret <autret_m@epita.fr>
20816
20817 Turn on %{source,header}_extension features.
20818
20819 * src/lex.c (percent_table): Un-CPP out header_extension and
20820 source_extension.
20821 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
20822 (compute_exts_from_src): Remove conditions. It restores priorities
20823 between options.
20824
20825 2001-08-14 Marc Autret <autret_m@epita.fr>
20826
20827 * src/files.c (compute_base_names): Add extensions computing when
20828 `--file-prefix' used.
20829 Standardize function calls.
20830
20831 2001-08-13 Marc Autret <autret_m@epita.fr>
20832
20833 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
20834 defining it (defined but null disables alloca).
20835
20836 2001-08-13 Marc Autret <autret_m@epita.fr>
20837
20838 * src/bison.simple (_yy_memcpy): CPP reformat.
20839
20840 2001-08-13 Pascal Bart <pascal.bart@epita.fr>
20841
20842 * tests/atconfig.in (CPPFLAGS): Fix.
20843
20844 2001-08-10 Pascal Bart <pascal.bart@epita.fr>
20845
20846 * doc/bison.texinfo: Include GNU General Public License from
20847 `gpl.texi'.
20848 * doc/gpl.texi: Add to package.
20849
20850 2001-08-10 Marc Autret <autret_m@epita.fr>
20851
20852 * src/print_graph.h: Fix.
20853 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
20854
20855 2001-08-10 Akim Demaille <akim@epita.fr>
20856
20857 * src/system.h: Provide default declarations for stpcpy, strndup,
20858 and strnlen.
20859
20860 2001-08-10 Robert Anisko <anisko_r@epita.fr>
20861
20862 * doc/bison.texinfo (Locations): Update @$ stuff.
20863
20864 2001-08-09 Robert Anisko <anisko_r@epita.fr>
20865
20866 * src/bison.simple (YYLLOC_DEFAULT): Update.
20867 (yyparse): Adjust.
20868
20869 2001-08-08 Marc Autret <autret_m@epita.fr>
20870
20871 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
20872 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
20873 Reported by Fabrice Bauzac.
20874
20875 2001-08-08 Marc Autret <autret_m@epita.fr>
20876
20877 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
20878 * src/vcg.c (output_node): Fix.
20879 * src/vcg.h: Cleanup.
20880 * src/print_graph.c: Add comments.
20881 (node_output_size): New global variable. Simplify the formatting of
20882 the VCG graph output.
20883 (print_actions): Unused code is now used. It notifies the final state
20884 and no action states in the VCG graph. It also give the reduce actions.
20885 The `shift and goto' edges are red and the `go to state' edges are
20886 blue.
20887 Get the current node name and node_obstack by argument.
20888 (node_obstack): New variable.
20889 (print_state): Manage node_obstack.
20890 (print_core): Use node_obstack given by argument.
20891 A node is not only computed here but in print_actions also.
20892 (print_graph): CPP out useless code instead of commenting it.
20893
20894 2001-08-07 Pascal Bart <pascal.bart@epita.fr>
20895
20896 * tests/atconfig.in (CPPFLAGS): Fix.
20897
20898 2001-08-07 Akim Demaille <akim@epita.fr>
20899
20900 * src/print_graph.c (quote): New.
20901 (print_core): Use it.
20902
20903 2001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
20904
20905 * src/vcg.c (complain.h): Include it.
20906 Unepitaize `return' invocations.
20907 [NDEBUG] (main): Remove.
20908 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
20909 * src/files.c (open_files): Initialize graph_obstack.
20910 * src/print_graph.c (print_actions): CPP out useless code.
20911 (print_core): Don't output the last `\n' in labels.
20912 Use `quote'.
20913 * src/files.c (output_files): Output the VCG file.
20914 * src/main.c (main): Invoke print_graph ();
20915
20916 2001-08-06 Marc Autret <autret_m@epita.fr>
20917
20918 Automaton VCG graph output.
20919 Using option ``-g'' or long option ``--graph'', you can generate
20920 a gram_filename.vcg file containing a VCG description of the LALR (1)
20921 automaton of your grammar.
20922
20923 * src/main.c: Call to print_graph() function.
20924 * src/getargs.h: Update.
20925 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
20926 (graph_flag): New flag.
20927 (longopts): Update.
20928 (getargs): Add case `g'.
20929 * src/files.c (graph_obstack): New obstack struct.
20930 (open_files): Initialize new obstack.
20931 (output_files): Saves graph_obstack if required.
20932 * src/files.h (graph_obstack): New extern declaration.
20933 * src/Makefile.am: Add new source files.
20934
20935 2001-08-06 Marc Autret <autret_m@epita.fr>
20936
20937 * src/print_graph.c, src/print_graph.h (graph): New.
20938 * src/vcg.h: New file.
20939 * src/vcg.c: New file, VCG graph handling.
20940
20941 2001-08-06 Marc Autret <autret_m@epita.fr>
20942
20943 Add of %source_extension and %header_extension which specify
20944 the source or/and the header output file extension.
20945
20946 * src/files.c (compute_base_names): Remove initialisation of
20947 src_extension and header_extension.
20948 (compute_exts_from_gf): Update.
20949 (compute_exts_from_src): Update.
20950 (output_files): Update.
20951 * src/reader.c (parse_header_extension_decl): New.
20952 (parse_source_extension_decl): New.
20953 (read_declarations): New case statements for the new tokens.
20954 * src/lex.c (percent_table): Add entries for %source_extension
20955 and %header_extension.
20956 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
20957
20958 2001-08-06 Marc Autret <autret_m@epita.fr>
20959
20960 * configure.in: Bump to 1.28c.
20961 * doc/bison.texinfo: Texinfo thingies.
20962
20963 2001-08-04 Pascal Bart <pascal.bart@epita.fr>
20964
20965 * tests/atconfig.in (CPPFLAGS): Add.
20966 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
20967
20968 2001-08-03 Akim Demaille <akim@epita.fr>
20969
20970 Version 1.28b.
20971
20972 2001-08-03 Akim Demaille <akim@epita.fr>
20973
20974 * tests/Makefile.am (check-local): Ship testsuite.
20975 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
20976 Include `string.h'.
20977
20978 2001-08-03 Akim Demaille <akim@epita.fr>
20979
20980 * configure.in: Try using -Wformat when compiling.
20981
20982 2001-08-03 Akim Demaille <akim@epita.fr>
20983
20984 * configure.in: Bump to 1.28b.
20985
20986 2001-08-03 Akim Demaille <akim@epita.fr>
20987
20988 * src/complain.c: Adjust strerror_r portability issues.
20989
20990 2001-08-03 Akim Demaille <akim@epita.fr>
20991
20992 Version 1.28a.
20993
20994 2001-08-03 Akim Demaille <akim@epita.fr>
20995
20996 * src/getargs.c, src/getarg.h (skeleton)): Constify.
20997 * src/lex.c (literalchar): Avoid name clashes on `buf'.
20998 * src/getargs.c: Include complain.h.
20999 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
21000 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
21001
21002 2001-08-03 Akim Demaille <akim@epita.fr>
21003
21004 * src/reader.c (readgram): Display hidden chars in error messages.
21005
21006 2001-08-03 Akim Demaille <akim@epita.fr>
21007
21008 Update to gettext 0.10.39.
21009
21010 2001-08-03 Akim Demaille <akim@epita.fr>
21011
21012 * lib/strspn.c: New.
21013
21014 2001-08-01 Marc Autret <autret_m@epita.fr>
21015
21016 * doc/bison.texinfo: Update.
21017 * doc/bison.1 (mandoc): Update.
21018 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
21019 * src/files.c: Support output files extensions computing.
21020 (src_extension): New static variable.
21021 (header_extension): New static variable.
21022 (tr): New function.
21023 (get_extension_index): New function, gets the index of an extension
21024 filename in a string.
21025 (compute_exts_from_gf): New function, computes extensions from the
21026 grammar file extension.
21027 (compute_exts_from_src): New functions, computes extensions from the
21028 C source file extension, file given by ``-o'' option.
21029 (compute_base_names): Update.
21030 (output_files): Update.
21031
21032 2001-08-01 Robert Anisko <anisko_r@epita.fr>
21033
21034 * doc/bison.texi: Document @$.
21035 (Locations): New section.
21036
21037 2001-07-18 Akim Demaille <akim@epita.fr>
21038
21039 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
21040 * config/prev-version.txt, config/move-if-change: New.
21041 * Makefile.am: Adjust.
21042
21043 2001-07-08 Pascal Bart <pascal.bart@epita.fr>
21044
21045 * src/bison.simple (yyparse): Suppress warning `comparaison
21046 between signed and unsigned'.
21047
21048 2001-07-05 Pascal Bart <pascal.bart@epita.fr>
21049
21050 * src/getargs.h (raw_flag): Remove.
21051 * src/getargs.c: Die on `-r'/`--raw'.
21052 * src/lex.c (parse_percent_token): Die on `%raw'.
21053 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
21054 * tests/calc.at: Suppress test with option `--raw'.
21055
21056 2001-07-14 Akim Demaille <akim@epita.fr>
21057
21058 * config/: New.
21059 * configure.in: Require Autoconf 2.50.
21060 Update to gettext 0.10.38.
21061
21062 2001-03-16 Akim Demaille <akim@epita.fr>
21063
21064 * doc/bison.texinfo: ANSIfy the examples.
21065
21066 2001-03-16 Akim Demaille <akim@epita.fr>
21067
21068 * getargs.c (skeleton): New variable.
21069 (longopts): --skeleton is a new option.
21070 (shortopts, getargs): -S is a new option.
21071 * getargs.h: Declare skeleton.
21072 * output.c (output_parser): Use it.
21073
21074 2001-03-16 Akim Demaille <akim@epita.fr>
21075
21076 * m4/strerror_r.m4: New.
21077 * m4/error.m4: Run AC_FUNC_STRERROR_R.
21078 * lib/error.h, lib/error.c: Update.
21079
21080 2001-03-16 Akim Demaille <akim@epita.fr>
21081
21082 * src/getargs.c (longopts): Clean up.
21083
21084 2001-02-21 Akim Demaille <akim@epita.fr>
21085
21086 * src/reader.c (gensym): `gensym_count' is your own.
21087 Use a static buf to create the symbol name, as token_buffer is no
21088 longer a buffer.
21089
21090 2001-02-08 Akim Demaille <akim@epita.fr>
21091
21092 * src/conflicts.c (conflict_report): Be sure not to append to res
21093 between two calls, which could happen if both first sprintf were
21094 skipped, but not the first cp += strlen.
21095
21096 2001-02-08 Akim Demaille <akim@epita.fr>
21097
21098 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
21099 New, from fileutils 4.0.37.
21100 * configure.in: Require Autoconf 2.49c. I took some time before
21101 making this decision. This is the only way out for portability
21102 issues in Bison, it would mean way too much duplicate effort to
21103 import in Bison features implemented in 2.49c since 2.13.
21104 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
21105
21106 2001-02-02 Akim Demaille <akim@epita.fr>
21107
21108 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
21109 * lib/xalloc.h, lib/xmalloc.c: Update.
21110
21111 2001-01-19 Akim Demaille <akim@epita.fr>
21112
21113 Get rid of the ad hoc handling of token_buffer in the scanner: use
21114 the obstacks.
21115
21116 * src/lex.c (token_obstack): New.
21117 (init_lex): Initialize it. No longer call...
21118 (grow_token_buffer): this. Remove it.
21119 Adjust all the places which used it to use the obstack.
21120
21121 2001-01-19 Akim Demaille <akim@epita.fr>
21122
21123 * src/lex.h: Rename all the tokens:
21124 s/\bENDFILE\b/tok_eof/g;
21125 s/\bIDENTIFIER\b/tok_identifier/g;
21126 etc.
21127 Let them be enums, not #define, to ease debugging.
21128 Adjust all the code.
21129
21130 2001-01-18 Akim Demaille <akim@epita.fr>
21131
21132 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
21133 * src/lex.c (maxtoken, grow_token_buffer): Static.
21134
21135 2001-01-18 Akim Demaille <akim@epita.fr>
21136
21137 Since we now use obstacks, more % directives can be enabled.
21138
21139 * src/lex.c (percent_table): Also accept `%yacc',
21140 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
21141 `%debug'.
21142 Handle the actions for `%semantic_parser' and `%pure_parser' here,
21143 instead of returning a token.
21144 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
21145 * src/reader.c (read_declarations): Adjust.
21146 * src/files.c (open_files): Don't call `compute_base_names', don't
21147 compute `attrsfile' since they depend upon data which might be
21148 *in* the input file now.
21149 (output_files): Do it here.
21150 * src/output.c (output_headers): Document the fact that this patch
21151 introduces a guaranteed SEGV for semantic parsers.
21152 * doc/bison.texinfo: Document them.
21153 * tests/suite.at: Exercise these %options.
21154
21155 2000-12-20 Akim Demaille <akim@epita.fr>
21156
21157 Also handle the output file (--verbose) with obstacks.
21158
21159 * files.c (foutput): Remove.
21160 (output_obstack): New.
21161 Adjust all dependencies.
21162 * src/conflicts.c: Return a string.
21163 * src/system.h (obstack_grow_string): Rename as...
21164 (obstack_sgrow): this. Be ready to work with non literals.
21165 (obstack_fgrow4): New.
21166
21167 2000-12-20 Akim Demaille <akim@epita.fr>
21168
21169 * src/files.c (open_files): Fix the computation of short_base_name
21170 in the case of `-o foo.tab.c'.
21171
21172 2000-12-20 Akim Demaille <akim@epita.fr>
21173
21174 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
21175 (copy_dollar): Now that everything uses obstacks, get rid of the
21176 FILE * parameters.
21177
21178 2000-12-20 Akim Demaille <akim@epita.fr>
21179
21180 * src/files.c (open_files): Actually the `.output' file is based
21181 on the short_base_name, not base_name.
21182 * tests/suite.at (Checking output file names): Adjust.
21183
21184 2000-12-20 Akim Demaille <akim@epita.fr>
21185
21186 * src/bison.s1: Remove, we now use directly...
21187 * src/bison.simple: this.
21188 * src/Makefile.am: Use pkgdata instead of data.
21189
21190 2000-12-20 Akim Demaille <akim@epita.fr>
21191
21192 * src/files.c (guard_obstack): New.
21193 (open_files): Initialize it.
21194 (output_files): Dump it...
21195 * src/files.h: Export it.
21196 * src/reader.c (copy_guard): Use it.
21197
21198 2000-12-19 Akim Demaille <akim@epita.fr>
21199
21200 * src/files.c (outfile, defsfile, actfile): Removed as global
21201 vars.
21202 (open_files): Don't compute them.
21203 (output_files): Adjust.
21204 (base_name, short_base_name): Be global.
21205 Adjust dependencies.
21206
21207 2000-12-19 Akim Demaille <akim@epita.fr>
21208
21209 * src/files.c (strsuffix): New.
21210 (stringappend): Be just like strcat but allocate.
21211 (base_names): Eve out from open_files.
21212 Try to simplify the rather hairy computation of base_name and
21213 short_base_name.
21214 (open_files): Use it.
21215 * tests/suite.at (Checking output file names): New test.
21216
21217 2000-12-19 Akim Demaille <akim@epita.fr>
21218
21219 * src/system.h (obstack_grow_literal_string): Rename as...
21220 (obstack_grow_string): this.
21221 * src/output.c (output_parser): Recognize `%% actions' instead of
21222 `$'.
21223 * src/bison.s1: s/$/%% actions/.
21224 * src/bison.hairy: Likewise.
21225
21226 2000-12-19 Akim Demaille <akim@epita.fr>
21227
21228 * src/output.c (output_parser): Compute the `#line' lines when
21229 there are.
21230 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
21231 Suggested by Hans Aberg.
21232
21233 2000-12-19 Akim Demaille <akim@epita.fr>
21234
21235 Let the handling of the skeleton files be local to the procedures
21236 that use it.
21237
21238 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
21239 longer static.
21240 (fparser, open_extra_files): Remove.
21241 (open_files, output_files): Don't take care of fparser.
21242 * src/files.h: Adjust.
21243 * src/output.c (output_parser): Open and close the file to the
21244 skeleton.
21245 * src/reader.c (read_declarations): When %semantic_parser, open
21246 fguard.
21247
21248 2000-12-19 Akim Demaille <akim@epita.fr>
21249
21250 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
21251 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
21252
21253 2000-12-19 Akim Demaille <akim@epita.fr>
21254
21255 * src/files.c (open_files): Yipee! We no longer need all the code
21256 looking for `/tmp' since we have no tmp file.
21257
21258 2000-12-19 Akim Demaille <akim@epita.fr>
21259
21260 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
21261 New macros.
21262 * src/files.c (open_files): Less dependency on MSDOS etc.
21263
21264 2000-12-14 Akim Demaille <akim@epita.fr>
21265
21266 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
21267 Provide a default definition.
21268 Use it when executing the default @ action.
21269 * src/reader.c (reader_output_yylsp): No longer include
21270 `timestamp' and `text' in the default YYLTYPE.
21271
21272 2000-12-12 Akim Demaille <akim@epita.fr>
21273
21274 * src/reader.c (copy_definition, parse_union_decl, copy_action)
21275 (copy_guard): Quote the file names.
21276 Reported by Laurent Mascherpa.
21277
21278 2000-12-12 Akim Demaille <akim@epita.fr>
21279
21280 * src/output.c (output_headers, output_program, output): Be sure
21281 to escape special characters when outputting filenames.
21282 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
21283 (output_headers): Don't depend on them, Use ACTSTR.
21284
21285 2000-11-17 Akim Demaille <akim@epita.fr>
21286
21287 * lib/obstack.h: Formatting changes.
21288 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
21289 prevents type checking.
21290 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
21291 cast the value to (void *): assigning a `foo *' to a `void *'
21292 variable is valid.
21293 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
21294 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
21295 append characters.
21296
21297 2000-11-17 Akim Demaille <akim@epita.fr>
21298
21299 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
21300 as...
21301 (suite.m4, regression.m4, calc.m4): these.
21302 * tests/atgeneral.m4: Update from CVS Autoconf.
21303
21304 2000-11-17 Akim Demaille <akim@epita.fr>
21305
21306 * tests/regression.m4 (%union and --defines): New test,
21307 demonstrating a current bug in the obstack implementation.
21308
21309 2000-11-17 Akim Demaille <akim@epita.fr>
21310
21311 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
21312 macros.
21313 Use them to declare the variables which are global or local to
21314 `yyparse'.
21315
21316 2000-11-17 Akim Demaille <akim@epita.fr>
21317
21318 * acconfig.h: Remove, no longer used.
21319
21320 2000-11-07 Akim Demaille <akim@epita.fr>
21321
21322 * src: s/Copyright (C)/Copyright/g.
21323
21324 2000-11-07 Akim Demaille <akim@epita.fr>
21325
21326 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
21327 defining.
21328 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
21329
21330 2000-11-07 Akim Demaille <akim@epita.fr>
21331
21332 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
21333 Merge in a single CPP if/else.
21334
21335 2000-11-07 Akim Demaille <akim@epita.fr>
21336
21337 * src/output.c (output): Remove useless variables.
21338 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
21339 argument `data' for consistency with the prototypes.
21340 Qualify it `const'.
21341 (obstack_copy, obstack_copy0): Rename the second argument as
21342 `address' for consistency. Qualify it `const'.
21343 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
21344 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
21345 `const' their input argument (`data' or `address').
21346 Adjust the corresponding macros to include `const' in casts.
21347
21348 2000-11-03 Akim Demaille <akim@epita.fr>
21349
21350 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
21351 s/PFILE1/BISON_HAIRY/.
21352 Adjust dependencies.
21353
21354 2000-11-03 Akim Demaille <akim@epita.fr>
21355
21356 For some reason, this was not applied.
21357
21358 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
21359 `unlink': it's no longer used.
21360
21361 2000-11-03 Akim Demaille <akim@epita.fr>
21362
21363 * src/files.c (skeleton_find): New function, eved out of...
21364 (open_files, open_extra_files): here.
21365
21366 2000-11-03 Akim Demaille <akim@epita.fr>
21367
21368 Don't use `atexit'.
21369
21370 * src/files.c (obstack_save): New function.
21371 (done): Rename as...
21372 (output_files): this.
21373 Use `obstack_save'.
21374 * src/main.c (main): Don't use `atexit' to register `done', since
21375 it no longer has to remove tmp files, just call `output_files'
21376 when there are no errors.
21377
21378 2000-11-02 Akim Demaille <akim@epita.fr>
21379
21380 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
21381 `unlink': it's no longer used.
21382 * src/files.h: Formatting changes.
21383
21384 2000-11-02 Akim Demaille <akim@epita.fr>
21385
21386 Remove the last uses of mktemp and unlink/delete.
21387
21388 * src/files.c (fdefines, ftable): Removed.
21389 (defines_ostack, table_obstack): New.
21390 Adjust dependencies of the former into uses of the latter.
21391 * src/output.c (output_short_or_char_table, output_short_table):
21392 Convert to using obstacks.
21393 * src/reader.c (copy_comment2): Accept one FILE * and two
21394 obstacks.
21395 (output_token_defines, reader_output_yylsp): Use obstacks.
21396 * src/system.h (obstack_fgrow3): New.
21397 * po/POTFILES.in: Adjust.
21398
21399 2000-11-01 Akim Demaille <akim@epita.fr>
21400
21401 Change each use of `fattrs' into a use of `attrs_obstack'.
21402
21403 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
21404 * src/files.c (fattrs): Remove.
21405 (attrs_obstack): New.
21406 Adjust all dependencies.
21407 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
21408
21409 2000-11-01 Akim Demaille <akim@epita.fr>
21410
21411 Introduce obstacks.
21412 Change each use of `faction' into a use of `action_obstack'.
21413
21414 * lib/obstack.h, lib/obstack.c: New files.
21415 * src/files.c (faction): Remove.
21416 (action_obstack): New.
21417 Adjust all dependencies.
21418
21419 2000-10-20 Akim Demaille <akim@epita.fr>
21420
21421 * lib/quote.h (PARAMS): New macro. Use it.
21422
21423 2000-10-16 Akim Demaille <akim@epita.fr>
21424
21425 * src/output.c (output_short_or_char_table): New function.
21426 (output_short_table, output_token_translations): Use it.
21427 (goto_actions): Use output_short_table.
21428
21429 2000-10-16 Akim Demaille <akim@epita.fr>
21430
21431 * src/symtab.c (bucket_new): New function.
21432 (getsym): Use it.
21433
21434 * src/output.c (output_short_table): New argument to display the
21435 comment associated with the table.
21436 Adjust dependencies.
21437 (output_gram): Use it.
21438 (output_rule_data): Nicer output layout for YYTNAME.
21439
21440 2000-10-16 Akim Demaille <akim@epita.fr>
21441
21442 * src/lex.c (read_typename): New function.
21443 (lex): Use it.
21444 * src/reader.c (copy_dollar): Likewise.
21445
21446 2000-10-16 Akim Demaille <akim@epita.fr>
21447
21448 * src/reader.c (copy_comment2): Expect the input stream to be on
21449 the `/' which is suspected to open a comment, instead of being
21450 called after `//' or `/*' was read.
21451 (copy_comment, copy_definition, parse_union_decl, copy_action)
21452 (copy_guard): Adjust.
21453
21454 2000-10-16 Akim Demaille <akim@epita.fr>
21455
21456 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
21457 `read_signed_integer'.
21458
21459 2000-10-16 Akim Demaille <akim@epita.fr>
21460
21461 * src/reader.c (copy_dollar): New function.
21462 (copy_guard, copy_action): Use it.
21463
21464 2000-10-16 Akim Demaille <akim@epita.fr>
21465
21466 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
21467 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
21468 New files, from Fileutils 4.0.27.
21469 * src/main.c (printable_version): Remove.
21470 * src/lex.c, src/reader.c: Use `quote'.
21471
21472 2000-10-04 Akim Demaille <akim@epita.fr>
21473
21474 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
21475
21476 2000-10-04 Akim Demaille <akim@epita.fr>
21477
21478 * doc/bison.texinfo: Various typos spotted by Neil Booth.
21479
21480 2000-10-04 Akim Demaille <akim@epita.fr>
21481
21482 When a literal string is used to define two different tokens,
21483 `bison -v' segfaults.
21484 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
21485
21486 * tests/regression.m4: New file.
21487 Include the core of the sample provided by Piotr Gackiewicz.
21488 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
21489 properly.
21490
21491 2000-10-04 Akim Demaille <akim@epita.fr>
21492
21493 * src/reader.c (parse_expect_decl): Keep `count' within the size
21494 of `buffer'.
21495 From Neil Booth.
21496
21497 2000-10-02 Paul Eggert <eggert@twinsun.com>
21498
21499 * bison.s1 (yyparse): Assign the default value
21500 unconditionally, to avoid a GCC warning and make the parser a
21501 tad smaller.
21502
21503 2000-10-02 Akim Demaille <akim@epita.fr>
21504
21505 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
21506 options.
21507
21508 2000-10-02 Akim Demaille <akim@epita.fr>
21509
21510 * src/derives.c, src/print.c, src/reduce.c: To ease the
21511 translation, move some `\n' out of the translated strings.
21512
21513 2000-10-02 Akim Demaille <akim@epita.fr>
21514
21515 The location tracking mechanism is precious for parse error
21516 messages. Nevertheless, it is enabled only when `@n' is used in
21517 the grammar, which is a different issue (you can use it in error
21518 message, but not in the grammar per se). Therefore, there should
21519 be another means to enable it.
21520
21521 * src/getargs.c (getargs): Support `--locations'.
21522 (usage): Report it.
21523 * src/getargs.h (locationsflag): Export it.
21524 * src/lex.c (percent_table): Support `%locations'.
21525 * src/reader.c (yylsp_needed): Remove this variable, now replaced
21526 with `locationsflag'.
21527 * doc/bison.texinfo: Document `--locations' and `%locations'.
21528 Sort the options.
21529 * tests/calc.m4: Test it.
21530
21531 For regularity of the names, replace each
21532 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
21533 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
21534 In addition replace each `flag' with `_flag'.
21535
21536 2000-10-02 Akim Demaille <akim@epita.fr>
21537
21538 Also test parse error messages, including with YYERROR_VERBOSE.
21539
21540 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
21541 associative).
21542 Use it to check the computations.
21543 Use it to check `nonassoc' is honored.
21544 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
21545 `--yyerror-verbose'.
21546 (_AT_CHECK_CALC): Adjust to this option.
21547 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
21548
21549 2000-10-02 Akim Demaille <akim@epita.fr>
21550
21551 Test also `--verbose', `--defines' and `--name-prefix'. Testing
21552 the latter demonstrates a flaw in the handling of non debugging
21553 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
21554 was used in order to simplify:
21555
21556 #if YYDEBUG
21557 if (yydebug)
21558 {
21559 ...
21560 }
21561 #endif
21562
21563 into
21564
21565 if (yydebug)
21566 {
21567 ...
21568 }
21569
21570 unfortunately this leads to a CPP conflict when
21571 `--name-prefix=foo' is used since it produces `#define yydebug
21572 foodebug'.
21573
21574 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
21575 (YYDPRINTF): New macro.
21576 Spread its use.
21577 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
21578 the bison options.
21579 Also test `--verbose', `--defines' and `--name-prefix'.
21580
21581 2000-10-02 Akim Demaille <akim@epita.fr>
21582
21583 Improve the readability of the produced parsers.
21584
21585 * src/bison.s1: Formatting changes.
21586 Improve the comment related to the `$' mark.
21587 (yydefault): Don't fall through to `yyresume': `goto' there.
21588 * src/output.c (output_parser): When the `$' is met, skip the end
21589 of its line.
21590 New variable, `number_of_dollar_signs', to check there's exactly
21591 one `$' in the parser skeleton.
21592
21593 2000-10-02 Akim Demaille <akim@epita.fr>
21594
21595 * lib/xstrdup.c: New file, from the fileutils.
21596 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
21597 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
21598 instead of strlen + xmalloc + strcpy.
21599 * src/symtab.c (copys): Remove, use xstrdup instead.
21600
21601 2000-10-02 Akim Demaille <akim@epita.fr>
21602
21603 * src/gram.h (associativity): New enum type which replaces the
21604 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
21605 `right_assoc', `left_assoc' and `non_assoc'.
21606 Adjust all dependencies.
21607 * src/reader.c: Formatting changes.
21608 (LTYPESTR): Don't define it, use it as a literal in
21609 `reader_output_yylsp'.
21610 * src/symtab.h (symbol_class): New enum type which replaces the
21611 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
21612 `sunknown', `stoken and `snterm'.
21613
21614 2000-10-02 Akim Demaille <akim@epita.fr>
21615
21616 * src/getargs.c (fixed_outfiles): Rename as...
21617 (yaccflag): for consistency and accuracy.
21618 Adjust dependencies.
21619
21620 2000-10-02 Akim Demaille <akim@epita.fr>
21621
21622 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
21623 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
21624 difficult and introduced a lot of core dump. It turns out that
21625 Bison used an implementation of `xmalloc' based on `calloc', and
21626 at various places it does depend upon the initialization to 0. I
21627 have not tried to isolate the pertinent places, and all the former
21628 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
21629 someone should address this issue.
21630
21631 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
21632 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
21633 files.
21634 Adjust dependencies.
21635 * src/warshall.h: New file.
21636 Propagate.
21637
21638 2000-10-02 Akim Demaille <akim@epita.fr>
21639
21640 Various anti-`extern in *.c' changes.
21641
21642 * src/system.h: Include `assert.h'.
21643
21644 2000-10-02 Akim Demaille <akim@epita.fr>
21645
21646 * src/state.h (nstates, final_state, first_state, first_shift)
21647 (first_reduction): Move their exportation from here...
21648 * src/LR0.h: to here.
21649 Adjust dependencies.
21650 * src/getargs.c (statisticsflag): New variable.
21651 Add support for `--statistics'.
21652 Adjust dependencies.
21653
21654 Remove a lot of now useless `extern' statements in most files.
21655
21656 2000-10-02 Akim Demaille <akim@epita.fr>
21657
21658 * src/LR0.h: New file.
21659 Propagate its use.
21660
21661 2000-10-02 Akim Demaille <akim@epita.fr>
21662
21663 * src/print.h: New file.
21664 Propagate its use.
21665 * src/print.c: Formatting and ordering changes.
21666 (verbose, terse): Replace with...
21667 (print_results): this new function.
21668 Adjust dependencies.
21669
21670 2000-10-02 Akim Demaille <akim@epita.fr>
21671
21672 * src/conflicts.c (conflict_report): New function.
21673 (conflict_log, verbose_conflict_log): Replace with...
21674 (print_conflicts): this function.
21675 Adjust dependencies.
21676 * src/conflicts.h: New file.
21677 Propagate its inclusion.
21678
21679 2000-10-02 Akim Demaille <akim@epita.fr>
21680
21681 * src/nullable.h: New file.
21682 Propagate its inclusion.
21683 * src/nullable.c: Formatting changes.
21684
21685 2000-10-02 Akim Demaille <akim@epita.fr>
21686
21687 * src/reduce.h: New file.
21688 Propagate its inclusion.
21689 * src/reduce.c: Topological sort and other formatting changes.
21690 (bool, TRUE, FALSE): Move their definition to...
21691 * src/system.h: here.
21692
21693 2000-10-02 Akim Demaille <akim@epita.fr>
21694
21695 * src/files.c: Formatting changes.
21696 (tryopen, tryclose, openfiles): Rename as...
21697 (xfopen, xfclose, open_files): this.
21698 (stringappend): static.
21699 * src/files.h: Complete the list of exported symbols.
21700 Propagate its use.
21701
21702 2000-10-02 Akim Demaille <akim@epita.fr>
21703
21704 * src/reader.h: New file.
21705 Propagate its use instead of tedious list of `extern' and
21706 prototypes.
21707 * src/reader.c: Formatting changes, topological sort,
21708 s/register//.
21709
21710 2000-10-02 Akim Demaille <akim@epita.fr>
21711
21712 * src/lex.h: Prototype `lex.c' exported functions.
21713 * src/reader.c: Adjust.
21714 * src/lex.c: Formatting changes.
21715 (safegetc): Rename as...
21716 (xgetc): this.
21717
21718 2000-10-02 Akim Demaille <akim@epita.fr>
21719
21720 * src/lalr.h: New file.
21721 Propagate its inclusion instead of prototypes and `extern'.
21722 * src/lalr.c: Formatting changes, topological sorting etc.
21723
21724 2000-10-02 Akim Demaille <akim@epita.fr>
21725
21726 * src/output.c (token_actions): Introduce a temporary array,
21727 YYDEFACT, that makes it possible for this function to use
21728 output_short_table.
21729
21730 2000-10-02 Akim Demaille <akim@epita.fr>
21731
21732 `user_toknums' is output as a `short[]' in `output.c', while it is
21733 defined as a `int[]' in `reader.c'. For consistency with the
21734 other output tables, `user_toknums' is now defined as a table of
21735 shorts.
21736
21737 * src/reader.c (user_toknums): Be a short table instead of an int
21738 table.
21739 Adjust dependencies.
21740
21741 Factor the short table outputs.
21742
21743 * src/output.c (output_short_table): New function.
21744 * src/output.c (output_gram, output_stos, output_rule_data)
21745 (output_base, output_table, output_check): Use it.
21746
21747 2000-10-02 Akim Demaille <akim@epita.fr>
21748
21749 * src/output.c (output): Topological sort of the functions, in
21750 order to get rid of the `static' prototypes.
21751 No longer use `register'.
21752 * src/output.h: New file.
21753 Propagate its inclusion in files explicitly prototyping functions
21754 from output.c.
21755
21756 2000-09-21 Akim Demaille <akim@epita.fr>
21757
21758 * src/atgeneral.m4: Update from Autoconf.
21759
21760 2000-09-21 Akim Demaille <akim@epita.fr>
21761
21762 * src/closure.h: New file.
21763 * src/closure.c: Formatting changes, topological sort over the
21764 functions, use of closure.h.
21765 (initialize_closure, finalize_closure): Rename as...
21766 (new_closure, free_closure): these. Adjust dependencies.
21767 * src/LR0.c: Formatting changes, topological sort, use of
21768 cloture.h.
21769 (initialize_states): Rename as...
21770 (new_states): this.
21771 * src/Makefile.am (noinst_HEADERS): Adjust.
21772
21773 2000-09-20 Akim Demaille <akim@epita.fr>
21774
21775 * src/acconfig.h: Don't protect config.h against multiple
21776 inclusion.
21777 Don't define PARAMS.
21778 * src/system.h: Define PARAMS.
21779 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
21780 purpose of config.h. system.h must not try to fix wrong
21781 definitions in config.h.
21782
21783 2000-09-20 Akim Demaille <akim@epita.fr>
21784
21785 * src/derives.h: New file.
21786 * src/main.c, src/derives.h: Use it.
21787 Formatting changes.
21788 * src/Makefile.am (noinst_HEADERS): Adjust.
21789
21790 2000-09-20 Akim Demaille <akim@epita.fr>
21791
21792 * tests/atgeneral.m4: Update from Autoconf.
21793 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
21794 (AT_CHECK_CALC): New macros.
21795 Use these macros to test bison with options `', `--raw',
21796 `--debug', `--yacc', `--yacc --debug'.
21797
21798 2000-09-19 Akim Demaille <akim@epita.fr>
21799
21800 * src/output.c: Formatting changes.
21801 * src/machine.h: Remove, leaving its contents in...
21802 * src/system.h: here.
21803 Include stdio.h.
21804 Adjust all dependencies on stdio.h and machine.h.
21805 * src/getargs.h: New file.
21806 Let all `extern' declarations about getargs.c be replaced with
21807 inclusion of `getargs.h'.
21808 * src/Makefile.am (noinst_HEADERS): Adjust.
21809
21810 * tests/calc.m4 (yyin): Be initialized in main, not on the global
21811 scope.
21812 (yyerror): Returns void, not int.
21813 * doc/bison.texinfo: Formatting changes.
21814
21815 2000-09-19 Akim Demaille <akim@epita.fr>
21816
21817 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
21818 portable.
21819
21820 2000-09-18 Akim Demaille <akim@epita.fr>
21821
21822 * configure.in: Append WARNING_CFLAGS to CFLAGS.
21823 * src/Makefile.am (INCLUDES): Don't.
21824 Be ready to fetch headers in lib/.
21825
21826 2000-09-18 Akim Demaille <akim@epita.fr>
21827
21828 * doc/bison.texinfo: Update the copyright.
21829 ANSIfy and GNUify the examples.
21830 Remove the old menu.
21831
21832 2000-09-18 Akim Demaille <akim@epita.fr>
21833
21834 First set of tests: use the `calc' example from the documentation.
21835
21836 * src/bison.s1 (yyparse): Condition the code using `yytname' which
21837 is defined only when YYDEBUG is.
21838 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
21839 * src/files.c (tryopen, tryclose): Formatting changes.
21840 Move to the top and be static.
21841 * src/reader.c (read_signed_integer): Likewise.
21842 * tests/calc.m4: New file.
21843 * Makefile.am, suite.m4: Adjust.
21844 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
21845
21846 2000-09-18 Akim Demaille <akim@epita.fr>
21847
21848 Add support for an Autotest test suite for Bison.
21849
21850 * m4/m4.m4, m4/atconfig.m4: New files.
21851 * m4/Makefile.am (EXTRA_DIST): Adjust.
21852 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
21853 files.
21854 * src/getargs.c: Display a more standard --version message.
21855 * src/reader.c (reader): Formatting changes.
21856 No longer depend upon VERSION_STRING.
21857 * configure.in: No longer use `dnl'.
21858 Set up the test suite and the new directory `tests/.
21859 (VERSION_STRING): Remove.
21860
21861 2000-04-14 Akim Demaille <akim@epita.fr>
21862
21863 * src/reader.c (copy_comment2): New function, same as former
21864 `copy_comment', but outputs into two FILE *.
21865 (copy_comment): Use it.
21866 (parse_union_decl): Use it.
21867 (get_type, parse_start_decl): Use the same `invalid' message.
21868 (parse_start_decl, parse_union_decl): Use the same `multiple'
21869 message.
21870 (parse_union_decl, copy_guard, copy_action): Use the same
21871 `unmatched' message.
21872 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
21873
21874 2000-03-31 Akim Demaille <akim@epita.fr>
21875
21876 * src/files.c (tryopen, tryclose): Move to the top.
21877 Be static.
21878
21879 2000-03-31 Akim Demaille <akim@epita.fr>
21880
21881 * src/main.c (main): Don't call `done', exit does it.
21882
21883 2000-03-31 Akim Demaille <akim@epita.fr>
21884
21885 * allocate.c: s/return (foo)/return foo/.
21886 * lalr.c: Likewise.
21887 * LR0.c: Likewise.
21888 * output.c: Likewise.
21889 * reader.c: Likewise.
21890 * symtab.c: Likewise.
21891 * vmsgetargs.c: Likewise.
21892
21893 2000-03-31 Akim Demaille <akim@epita.fr>
21894
21895 Clean up the error reporting functions.
21896
21897 * src/report.c: New file.
21898 * src/report.h: Likewise.
21899 * src/Makefile.am: Adjust.
21900 * m4/error.m4: New file.
21901 * m4/Makefile.am: Adjust.
21902 * configure.in (jm_PREREQ_ERROR): Call it.
21903 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
21904 Remove.
21905 (fatal, fatals): Remove. All callers use complain.c::fatal.
21906 (warn, warni, warns, warnss, warnss): Remove. All callers use
21907 complain.c::complain.
21908 (toomany): Remove, use fatal instead.
21909 * src/files.c (done): No argument, use complain_message_count.
21910 * src/main.c (main): Register `done' to `atexit'.
21911
21912 * src/getargs.c (usage): More `fputs', less `fprintf'.
21913
21914 2000-03-28 Akim Demaille <akim@epita.fr>
21915
21916 * lib/: New directory.
21917 * Makefile.am (SUBDIRS): Adjust.
21918 * configure.in: Adjust.
21919 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
21920 useless.
21921 * src/alloca.c: Moved to lib/.
21922 * src/getopt.c: Likewise.
21923 * src/getopt1.c: Likewise.
21924 * src/getopt.h: Likewise.
21925 * src/ansi2knr.c: Likewise.
21926 * src/ansi2knr.1: Likewise.
21927 * src/Makefile.am: Adjust.
21928 * lib/Makefile.am: New file.
21929
21930 2000-03-28 Akim Demaille <akim@epita.fr>
21931
21932 * src/getargs.c (usage): Refresh the help message.
21933
21934 2000-03-17 Akim Demaille <akim@epita.fr>
21935
21936 * src/getopt1.c: Updated from textutils 2.0e
21937 * src/getopt.c: Likewise.
21938 * src/getopt.h: Likewise.
21939
21940 2000-03-17 Akim Demaille <akim@epita.fr>
21941
21942 * src/Makefile.am (bison.simple): Fix the awk program: quote only
21943 the file name, not the whole `#line LINE FILE'.
21944
21945 2000-03-17 Akim Demaille <akim@epita.fr>
21946
21947 On syntax errors, report the token on which we choked.
21948
21949 * src/bison.s1 (yyparse): In the label yyerrlab, when
21950 YYERROR_VERBOSE, add yychar in msg.
21951
21952 2000-03-17 Akim Demaille <akim@epita.fr>
21953
21954 * src/reader.c (copy_at): New function.
21955 (copy_guard): Use it.
21956 (copy_action): Use it.
21957
21958 2000-03-17 Akim Demaille <akim@epita.fr>
21959
21960 Be kind to translators, save some useless translations.
21961
21962 * src/main.c (banner): New function.
21963 (fatal_banner): Use it.
21964 (warn_banner): Use it.
21965
21966 2000-03-17 Akim Demaille <akim@epita.fr>
21967
21968 * src/reader.c (copy_definition): Use copy_string and
21969 copy_comment. Removed now unused `match', `ended',
21970 `cplus_comment'.
21971 (copy_comment, copy_string): Moved, to be visible from
21972 copy_definition.
21973
21974 2000-03-17 Akim Demaille <akim@epita.fr>
21975
21976 * src/reader.c (copy_string): Declare `static inline'. No
21977 problems with inline, since it is checked by configure.
21978 (copy_comment): Likewise.
21979
21980 2000-03-17 Akim Demaille <akim@epita.fr>
21981
21982 * src/reader.c (packsymbols): Formatting changes.
21983
21984 2000-03-17 Akim Demaille <akim@epita.fr>
21985
21986 * src/reader.c (copy_comment): New function, factored out from:
21987 (copy_action): Use it. Removed now unused `match', `ended',
21988 `cplus_comment'.
21989 (copy_guard): Likewise.
21990
21991 2000-03-17 Akim Demaille <akim@epita.fr>
21992
21993 * src/reader.c (copy_string): New function, factored out from:
21994 (copy_action): Use it.
21995 (copy_guard): Likewise.
21996
21997 2000-03-17 Akim Demaille <akim@epita.fr>
21998
21999 Change the handling of @s so that they behave exactly like $s.
22000 There is now a pseudo variable @$ (readble and writable), location
22001 of the lhs of the rule (by default ranging from the location of
22002 the first symbol of the rhs, to the location of the last symbol,
22003 or, if the rhs is empty, YYLLOC).
22004
22005 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
22006 yyval.
22007 (yyparse): When providing a default semantic action, provide a
22008 default location action.
22009 (after the $): No longer change `*YYLSP', just stack YYLOC the
22010 same way you stack YYVAL.
22011 * src/reader.c (read_declarations): Use warns.
22012 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
22013 (copy_action, case '@'): Likewise.
22014 Use a standard error message, to save useless work from
22015 translators.
22016
22017 2000-03-17 Akim Demaille <akim@epita.fr>
22018
22019 * src/bison.s1: Formatting and cosmetics changes.
22020 * src/reader.c: Likewise.
22021 Update the Copyright notice.
22022
22023 2000-03-17 Akim Demaille <akim@epita.fr>
22024
22025 * src/bison.s1 (#line): All set to `#line' only, since the
22026 Makefile now handles them.
22027
22028 2000-03-16 Akim Demaille <akim@epita.fr>
22029
22030 * src/output.c (output_rule_data): Output the documentation of
22031 some of the tables.
22032 (Copyright notice): Update.
22033 Formatting changes.
22034
22035 2000-03-16 Akim Demaille <akim@epita.fr>
22036
22037 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
22038 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
22039 One `#if YYDEBUG' remains, since it uses variables which are
22040 defined only if `YYDEBUG != 0'.
22041
22042 2000-03-16 Akim Demaille <akim@epita.fr>
22043
22044 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
22045 and related variables so that the similarities are highlighted.
22046
22047 2000-03-16 Akim Demaille <akim@epita.fr>
22048
22049 * src/bison.s1: Properly indent CPP directives.
22050
22051 2000-03-16 Akim Demaille <akim@epita.fr>
22052
22053 * src/bison.s1: Properly indent the `alloca' CPP section.
22054
22055 2000-03-16 Akim Demaille <akim@epita.fr>
22056
22057 Do not hard code values of directories in `configure.in'.
22058 Update the `configure' tool chain.
22059
22060 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
22061 src/makefile.am.
22062 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
22063 (AC_OUTPUT): Add m4/Makefile.
22064 Bump to bison 1.28a, 1.29 has never been released.
22065 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
22066 handled via src/Makefile.am.
22067 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
22068 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
22069 autoheader.
22070 * Makefile.am (SUBDIRS): Add m4.
22071 (ACLOCAL_AM_FLAGS): New variable.
22072 (AUTOMAKE_OPTIONS): Add check-news.
22073 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
22074 the proper line number and file name.
22075 (DEFS): Propagate the location of bison library files and of the
22076 locale files.
22077 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
22078 builddir.
22079 * acinclude.m4: Remove, replaced by the directory m4.
22080 * m4/Makefile.am (EXTRA_DIST): New variable.
22081 * m4/gettext.m4: New file, from the fileutils.
22082 * m4/lcmessage.m4: Likewise
22083 * m4/progtest.m4: Likewise.
22084 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
22085
22086 2000-03-10 Akim Demaille <akim@epita.fr>
22087
22088 * src/closure.c:
22089 Formatting changes of various comments.
22090 Respect the GNU coding standards at various places.
22091 Don't use `_()' when no translation is needed.
22092
22093 1999-12-13 Jesse Thilo <jthilo@gnu.org>
22094
22095 * src/files.c:
22096 OS/2 honors TMPDIR environment variable.
22097
22098 1999-12-13 Jesse Thilo <jthilo@gnu.org>
22099
22100 * doc/bison.texinfo: Tweaked spelling and grammar.
22101 Updated ISBN.
22102 Removed reference to price of printed copy.
22103 Mention BISON_SIMPLE and BISON_HAIRY.
22104
22105 1999-12-13 Jesse Thilo <jthilo@gnu.org>
22106
22107 * configure.in, NEWS:
22108 Bison 1.29 released.
22109
22110 1999-10-27 Jesse Thilo <jthilo@gnu.org>
22111
22112 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
22113 Added reference card.
22114
22115 1999-07-26 Jesse Thilo <jthilo@gnu.org>
22116
22117 * po/ru.po: Added Russian translation.
22118
22119 1999-07-26 Jesse Thilo <jthilo@gnu.org>
22120
22121 * configure.in: Added Russian translation.
22122
22123 1999-07-06 Jesse Thilo <jthilo@gnu.org>
22124
22125 * configure.in, NEWS, README:
22126 Released version 1.28.
22127
22128 1999-06-14 Jesse Thilo <jthilo@gnu.org>
22129
22130 * src/system.h:
22131 Squashed redefinition warning on some systems.
22132
22133 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
22134 Have configure build version string instead of relying on ANSI string
22135 concatentation.
22136
22137 1999-06-14 Jesse Thilo <jthilo@gnu.org>
22138
22139 * po/POTFILES.in: Got rid of version.c.
22140
22141 1999-06-14 Jesse Thilo <jthilo@gnu.org>
22142
22143 * acconfig.h, configure.in:
22144 Have configure build version string instead of relying on ANSI string
22145 concatentation.
22146
22147 1999-06-08 Jesse Thilo <jthilo@gnu.org>
22148
22149 * doc/bison.1:
22150 Dropped mention of `+' for long-named options.
22151
22152 1999-05-30 Jesse Thilo <jthilo@gnu.org>
22153
22154 * src/files.c: Added <unistd.h> for unlink().
22155
22156 * src/Makefile.am, src/system.h:
22157 I18n fixes.
22158
22159 1999-05-30 Jesse Thilo <jthilo@gnu.org>
22160
22161 * README: Added a FAQ list.
22162
22163 * configure.in, acconfig.h:
22164 I18n fixes.
22165
22166 1999-05-30 Jesse Thilo <jthilo@gnu.org>
22167
22168 * doc/FAQ, doc/Makefile.am:
22169 Added a FAQ list.
22170
22171 1999-05-19 Jesse Thilo <jthilo@gnu.org>
22172
22173 * src/alloc.h, src/symtab.h, src/version.c:
22174 Protected inclusion of "config.h" with HAVE_CONFIG_H.
22175
22176 1999-04-18 Jesse Thilo <jthilo@gnu.org>
22177
22178 * src/.cvsignore, src/Makefile.am:
22179 Reorganized: sources in `src', documentation in `doc'.
22180
22181 * src/lex.c (literalchar):
22182 fixed the code for escaping double quotes (thanks
22183 Jonathan Czisny.)
22184
22185 1999-04-18 Jesse Thilo <jthilo@gnu.org>
22186
22187 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
22188 Adjusted paths to reflect directory reorganization.
22189
22190 1999-04-18 Jesse Thilo <jthilo@gnu.org>
22191
22192 * doc/.cvsignore, doc/Makefile.am:
22193 Reorganized: sources in `src', documentation in `doc'.
22194
22195 1999-04-18 Jesse Thilo <jthilo@gnu.org>
22196
22197 * configure.in:
22198 Updated AC_INIT file to reflect directory reorganization.
22199
22200 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
22201 Reorganized: sources in `src', documentation in `doc'.
22202
22203 1999-04-13 Jesse Thilo <jthilo@gnu.org>
22204
22205 * src/allocate.c:
22206 Don't declare calloc() and realloc() if not necessary.
22207
22208 1999-04-13 Jesse Thilo <jthilo@gnu.org>
22209
22210 * configure.in, acconfig.h, acinclude.m4:
22211 Don't declare calloc() and realloc() if not necessary.
22212
22213 1999-03-23 Jesse Thilo <jthilo@gnu.org>
22214
22215 * po/.cvsignore: Added i18n support.
22216
22217 1999-03-23 Jesse Thilo <jthilo@gnu.org>
22218
22219 * acconfig.h, configure.in, Makefile.am:
22220 Added i18n support.
22221
22222 1999-03-22 Jesse Thilo <jthilo@gnu.org>
22223
22224 * src/bison.s1: Fixed #line numbers.
22225
22226 1999-03-15 Jesse Thilo <jthilo@gnu.org>
22227
22228 * po/es.po, po/fr.po, po/nl.po, po/de.po:
22229 Added PO files from Translation Project.
22230
22231 1999-03-03 Jesse Thilo <jthilo@gnu.org>
22232
22233 * Makefile.am:
22234 Added support for non-ANSI compilers (ansi2knr).
22235
22236 1999-02-16 Jesse Thilo <jthilo@gnu.org>
22237
22238 * configure.in: Bumped version number to 1.27.
22239
22240 * Makefile.am:
22241 Added `bison.simple' to list of files removed by `make distclean'.
22242
22243 1999-02-12 Jesse Thilo <jthilo@gnu.org>
22244
22245 * src/files.c, src/files.h:
22246 Defined locations of parser files in config.h instead of Makefile.
22247
22248 1999-02-12 Jesse Thilo <jthilo@gnu.org>
22249
22250 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
22251 Defined locations of parser files in config.h instead of Makefile.
22252
22253 1999-02-09 Jesse Thilo <jthilo@gnu.org>
22254
22255 * Makefile.am:
22256 Removed inappropriate use of $< macro.
22257
22258 1999-02-05 Jesse Thilo <jthilo@gnu.org>
22259
22260 * po/Makefile.in.in, po/POTFILES.in:
22261 Add `po' directory skeleton.
22262
22263 1999-01-27 Jesse Thilo <jthilo@gnu.org>
22264
22265 * README: Document help-bison list.
22266
22267 * configure.in: Add check for mkstemp().
22268
22269 1999-01-20 Jesse Thilo <jthilo@gnu.org>
22270
22271 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
22272 Hush a few compiler warnings.
22273
22274 * src/files.c:
22275 Add tryclose(), which verifies that fclose was successful.
22276 Hush a couple of compiler warnings.
22277
22278 1999-01-20 Jesse Thilo <jthilo@gnu.org>
22279
22280 * Makefile.am, OChangeLog:
22281 ChangeLog is now automatically generated. Include the old version as
22282 OChangeLog.
22283
22284 1999-01-14 Jesse Thilo <jthilo@gnu.org>
22285
22286 * 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:
22287 Update FSF address.
22288
22289 1999-01-14 Jesse Thilo <jthilo@gnu.org>
22290
22291 * doc/bison.texinfo: Fix formatting glitch.
22292
22293 * doc/bison.texinfo: Update FSF address.
22294
22295 1999-01-14 Jesse Thilo <jthilo@gnu.org>
22296
22297 * acconfig.h: Update FSF address.
22298
22299 1999-01-08 Jesse Thilo <jthilo@gnu.org>
22300
22301 * src/system.h:
22302 Don't define PACKAGE here, since config.h defines it.
22303
22304 1998-12-30 Jesse Thilo <jthilo@gnu.org>
22305
22306 * src/reader.c: Update copyright date.
22307
22308 * src/main.c:
22309 Ditch sprintf to statically-sized buffers in fatal/warn functions in
22310 favor of output directly to stderr (avoids buffer overruns).
22311
22312 * src/reader.c: Some checks for premature EOF.
22313
22314 * 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:
22315 Use prototypes if the compiler understands them.
22316
22317 * src/files.c: Honor TMPDIR on Unix hosts.
22318 Use prototypes if the compiler understands them.
22319
22320 * src/reader.c:
22321 Fix a couple of buffer overrun bugs.
22322 Use prototypes if the compiler understands them.
22323
22324 * src/system.h: Include unistd.h and ctype.h.
22325 Use #ifdef instead of #if for NLS symbols.
22326
22327 1998-12-30 Jesse Thilo <jthilo@gnu.org>
22328
22329 * doc/bison.texinfo:
22330 Delete comment "consider using @set for edition number, etc..." since
22331 we now are doing so.
22332
22333 1998-12-30 Jesse Thilo <jthilo@gnu.org>
22334
22335 * configure.in:
22336 Use prototypes if the compiler understands them.
22337
22338 * NEWS: Document 1.26 highlights.
22339
22340 * Makefile.am: Require Automake 1.3 or later.
22341
22342 * acconfig.h:
22343 Use prototypes if the compiler understands them.
22344
22345 1998-12-29 Jesse Thilo <jthilo@gnu.org>
22346
22347 * src/version.c:
22348 Use VERSION symbol from automake for version number.
22349
22350 1998-12-29 Jesse Thilo <jthilo@gnu.org>
22351
22352 * acconfig.h, configure.in, version.cin:
22353 Use VERSION symbol from automake for version number.
22354
22355 1998-11-28 Jesse Thilo <jthilo@gnu.org>
22356
22357 * Makefile.am:
22358 Distribute original version of simple parser (bison.s1), not built
22359 version (bison.simple).
22360
22361 1998-11-28 Jesse Thilo <jthilo@gnu.org>
22362
22363 * doc/bison.texinfo: Add info dir entry.
22364
22365 * doc/bison.texinfo:
22366 Let automake put version number into documentation.
22367
22368 1998-11-26 Jesse Thilo <jthilo@gnu.org>
22369
22370 * src/bison.cld, src/build.com, src/vmshlp.mar:
22371 Add non-RCS files from /gd/gnu/bison.
22372
22373 1998-11-26 Jesse Thilo <jthilo@gnu.org>
22374
22375 * doc/bison.1:
22376 Document the BISON_HAIRY and BISON_SIMPLE variables.
22377
22378 1998-11-25 Jesse Thilo <jthilo@gnu.org>
22379
22380 * src/version.c: Build version.c automatically.
22381
22382 * src/reader.c:
22383 Fix token numbering (used to start at 258, not 257).
22384
22385 * src/system.h: Include config.h.
22386
22387 * src/getargs.c: Update bug report address.
22388
22389 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
22390 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
22391
22392 1998-11-25 Jesse Thilo <jthilo@gnu.org>
22393
22394 * Makefile.am:
22395 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
22396
22397 * configure.in, version.cin:
22398 Build version.c automatically.
22399
22400 * AUTHORS: Add AUTHORS file.
22401
22402 * README: Update bug report address.
22403
22404 * bison.simple:
22405 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
22406
22407 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
22408 Add automake stuff.
22409
22410 1998-11-25 Jesse Thilo <jthilo@gnu.org>
22411
22412 * doc/bison.texinfo: Clean up some formatting.
22413
22414 1998-05-05 Richard Stallman <rms@gnu.org>
22415
22416 * doc/bison.texinfo:
22417 Explain better why to make a pure parser.
22418
22419 1998-01-05 Richard Stallman <rms@gnu.org>
22420
22421 * src/files.c (openfiles):
22422 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
22423 find a temporary directory, if possible. Do not unlink files while
22424 they are open.
22425
22426 1997-08-25 Richard Stallman <rms@gnu.org>
22427
22428 * src/reader.c (stack_offset;):
22429 Change some warni to warns.
22430
22431 * src/lex.c (literalchar): Use warns, not warni.
22432
22433 1997-06-28 Richard Stallman <rms@gnu.org>
22434
22435 * src/bison.s1: Add a Bison version comment.
22436
22437 * src/main.c (fatal, warn, berror):
22438 Use program_name.
22439
22440 1997-06-28 Richard Stallman <rms@gnu.org>
22441
22442 * Makefile.in (bison_version): New variable.
22443 (dist): Use that variable.
22444 (bison.s1): Substitute the Bison version into bison.simple.
22445
22446 * bison.simple: Add a Bison version comment.
22447
22448 1997-06-18 Richard Stallman <rms@gnu.org>
22449
22450 * src/main.c (fatal, warn, berror):
22451 Make error messages standard.
22452 (toomany): Improve error message text.
22453
22454 * 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:
22455 new.h renamed to alloc.h.
22456
22457 1997-06-18 Richard Stallman <rms@gnu.org>
22458
22459 * Makefile.in: new.h renamed to alloc.h.
22460
22461 1997-05-24 Richard Stallman <rms@gnu.org>
22462
22463 * src/lex.c (literalchar):
22464 Fix the code for escaping \, " and '.
22465
22466 (lex): Avoid trouble when there are many chars
22467 to discard in a char literal with just several chars in it.
22468
22469 1997-05-17 Richard Stallman <rms@gnu.org>
22470
22471 * src/bison.s1:
22472 Use malloc, if using alloca is troublesome.
22473 (YYSTACK_USE_ALLOCA): New flag macro.
22474 Define it for some systems and compilers.
22475 (YYSTACK_ALLOC): New macro.
22476 (yyparse): Use YYSTACK_ALLOC to allocate stack.
22477 If it was malloc'd, free it.
22478
22479 1997-05-17 Richard Stallman <rms@gnu.org>
22480
22481 * bison.simple:
22482 Use malloc, if using alloca is troublesome.
22483 (YYSTACK_USE_ALLOCA): New flag macro.
22484 Define it for some systems and compilers.
22485 (YYSTACK_ALLOC): New macro.
22486 (yyparse): Use YYSTACK_ALLOC to allocate stack.
22487 If it was malloc'd, free it.
22488
22489 1997-04-23 Richard Stallman <rms@gnu.org>
22490
22491 * src/bison.s1:
22492 (alloca) [__hpux]: Always define as __builtin_alloca.
22493
22494 1997-04-23 Richard Stallman <rms@gnu.org>
22495
22496 * bison.simple:
22497 (alloca) [__hpux]: Always define as __builtin_alloca.
22498
22499 1997-04-22 Richard Stallman <rms@gnu.org>
22500
22501 * src/bison.s1:
22502 [__hpux]: Include alloca.h (right for HPUX 10)
22503 instead of declaring alloca (right for HPUX 9).
22504
22505 * src/bison.s1 (__yy_memcpy):
22506 Declare arg `count' as unsigned int.
22507 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
22508
22509 1997-04-22 Richard Stallman <rms@gnu.org>
22510
22511 * bison.simple:
22512 [__hpux]: Include alloca.h (right for HPUX 10)
22513 instead of declaring alloca (right for HPUX 9).
22514
22515 * bison.simple (__yy_memcpy):
22516 Declare arg `count' as unsigned int.
22517 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
22518
22519 1997-01-03 Richard Stallman <rms@gnu.org>
22520
22521 * src/allocate.c: [__STDC__ or _MSC_VER]:
22522 Declare calloc and realloc to return void *.
22523
22524 1997-01-02 Richard Stallman <rms@gnu.org>
22525
22526 * src/system.h:
22527 [_MSC_VER]: Include stdlib.h and process.h.
22528 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
22529
22530 * src/main.c (main): Return FAILURE as a value.
22531 (printable_version): Declare arg as int, not char.
22532
22533 1997-01-02 Richard Stallman <rms@gnu.org>
22534
22535 * Makefile.in (dist):
22536 Explicitly check for symlinks, and copy them.
22537
22538 1996-12-19 Richard Stallman <rms@gnu.org>
22539
22540 * src/files.c:
22541 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
22542
22543 1996-12-18 Paul Eggert <eggert@gnu.org>
22544
22545 * src/bison.s1 (yyparse):
22546 If __GNUC__ and YYPARSE_PARAM are both defined,
22547 declare yyparse to have a void * argument.
22548
22549 1996-12-18 Paul Eggert <eggert@gnu.org>
22550
22551 * bison.simple (yyparse):
22552 If __GNUC__ and YYPARSE_PARAM are both defined,
22553 declare yyparse to have a void * argument.
22554
22555 1996-12-17 Richard Stallman <rms@gnu.org>
22556
22557 * src/reduce.c (nbits): Add some casts.
22558
22559 1996-08-12 Richard Stallman <rms@gnu.org>
22560
22561 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
22562
22563 1996-08-12 Richard Stallman <rms@gnu.org>
22564
22565 * bison.simple: Test _MSDOS as well as _MSDOS_.
22566
22567 1996-07-31 Richard Stallman <rms@gnu.org>
22568
22569 * src/bison.s1:
22570 [__sun && __i386]: Include alloca.h.
22571
22572 1996-07-31 Richard Stallman <rms@gnu.org>
22573
22574 * bison.simple:
22575 [__sun && __i386]: Include alloca.h.
22576
22577 1996-07-30 Richard Stallman <rms@gnu.org>
22578
22579 * src/bison.s1: Comment change.
22580
22581 * src/bison.s1: Test _MSDOS_, not MSDOS.
22582
22583 1996-07-30 Richard Stallman <rms@gnu.org>
22584
22585 * bison.simple: Comment change.
22586
22587 * bison.simple: Test _MSDOS_, not MSDOS.
22588
22589 1996-06-01 Richard Stallman <rms@gnu.org>
22590
22591 * 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:
22592 Insert `_' macro around many string constants.
22593
22594 * src/main.c:
22595 Insert `_' macro around many string constants.
22596
22597 (main): Call setlocale, bindtextdomain and textdomain.
22598
22599 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
22600 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
22601 [ENABLE_NLS]: Include libintl.h.
22602 [ENABLE_NLS] (gettext): Define.
22603 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
22604 (N_, PACKAGE, LOCALEDIR): New macros.
22605
22606 1996-06-01 Richard Stallman <rms@gnu.org>
22607
22608 * POTFILES.in: New file.
22609
22610 * Makefile.in (allocate.o):
22611 Define target explicitly.
22612
22613 * Makefile.in (CFLAGS): Set to @CFLAGS@.
22614 (LDFLAGS): Set to @LDFLAGS@.
22615 (configure): Run autoconf only if preceding `cd' succeeds.
22616 (bison.s1): Redirect output to temporary file then move the
22617 temporary to the target, rather than redirecting directly to bison.s1.
22618 (clean): Remove config.status and config.log.
22619 (distclean): Don't remove config.status here.
22620
22621 1996-05-12 Richard Stallman <rms@gnu.org>
22622
22623 * src/bison.s1:
22624 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
22625
22626 1996-05-12 Richard Stallman <rms@gnu.org>
22627
22628 * bison.simple:
22629 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
22630
22631 1996-05-11 Richard Stallman <rms@gnu.org>
22632
22633 * src/bison.s1 (__yy_memcpy):
22634 Really reorder the args, as was supposedly done on Feb 14 1995.
22635 (yyparse): Calls changed accordingly.
22636
22637 1996-05-11 Richard Stallman <rms@gnu.org>
22638
22639 * Makefile.in (dist): Don't use $(srcdir).
22640
22641 * bison.simple (__yy_memcpy):
22642 Really reorder the args, as was supposedly done on Feb 14 1995.
22643 (yyparse): Calls changed accordingly.
22644
22645 1996-01-27 Richard Stallman <rms@gnu.org>
22646
22647 * src/output.c (output_rule_data):
22648 Test YYERROR_VERBOSE in the conditional
22649 around the definition of ttyname.
22650
22651 1995-12-29 Richard Stallman <rms@gnu.org>
22652
22653 * src/bison.s1:
22654 Fix line numbers in #line commands.
22655
22656 1995-12-29 Richard Stallman <rms@gnu.org>
22657
22658 * bison.simple:
22659 Fix line numbers in #line commands.
22660
22661 1995-12-27 Richard Stallman <rms@gnu.org>
22662
22663 * src/bison.s1 (YYPARSE_PARAM_DECL):
22664 In C++, make it always null.
22665 (YYPARSE_PARAM_ARG): New macro.
22666 (yyparse): Use YYPARSE_PARAM_ARG.
22667
22668 1995-12-27 Richard Stallman <rms@gnu.org>
22669
22670 * bison.simple (YYPARSE_PARAM_DECL):
22671 In C++, make it always null.
22672 (YYPARSE_PARAM_ARG): New macro.
22673 (yyparse): Use YYPARSE_PARAM_ARG.
22674
22675 1995-11-29 Richard Stallman <rms@gnu.org>
22676
22677 * doc/bison.texinfo:
22678 Describe literal string tokens, %raw, %no_lines, %token_table.
22679
22680 1995-11-29 Daniel Hagerty <hag@gnu.org>
22681
22682 * doc/bison.texinfo: Fixed update date
22683
22684 1995-10-16 Richard Stallman <rms@gnu.org>
22685
22686 * src/version.c: Version 1.25.
22687
22688 1995-10-16 Richard Stallman <rms@gnu.org>
22689
22690 * NEWS: *** empty log message ***
22691
22692 1995-10-16 Richard Stallman <rms@gnu.org>
22693
22694 * doc/bison.1, doc/bison.rnh:
22695 Add new options.
22696
22697 1995-10-15 Richard Stallman <rms@gnu.org>
22698
22699 * src/vmsgetargs.c, src/getargs.c:
22700 Added -n, -k, and -raw switches.
22701 (noparserflag, toknumflag, rawtoknumflag): New variables.
22702
22703 * src/symtab.h (SALIAS):
22704 New #define for adding aliases to %token.
22705 (struct bucket): Added `alias' field.
22706
22707 * src/reduce.c (reduce_grammar):
22708 Revise error message.
22709 (print_notices): Remove final `.' from error message.
22710
22711 * src/reader.c (reader_output_yylsp):
22712 New function.
22713 (readgram): Use `#if 0' around code that accepted %command
22714 inside grammar rules: The documentation doesn't allow it,
22715 and it will fail since the %command processors scan for the next %.
22716 (parse_token_decl): Extended the %token
22717 declaration to allow a multi-character symbol as an alias.
22718 (parse_thong_decl): New function.
22719 (read_declarations): Added %thong declarations.
22720 (read_declarations): Handle NOOP to deal with allowing
22721 % declarations as another means to specify the flags.
22722 (readgram): Allow %prec prior to semantics embedded in a rule.
22723 (skip_to_char, read_declarations, copy_definition)
22724 (parse_token_decl, parse_start_decl, parse_type_decl)
22725 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
22726 (get_type_name, copy_guard, copy_action, readgram)
22727 (get_type, packsymbols): Revised most error messages.
22728 Changed `fatal' to `warnxxx' to avoid aborting for error.
22729 Revised and use multiple warnxxx functions to avoid using VARARGS1.
22730 (read_declarations): Improve the error message for
22731 an invalid character. Do not abort.
22732 (read_declarations, copy_guard, copy_action): Use
22733 printable_version to avoid unprintable characters in printed output.
22734 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
22735 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
22736 Allow the type of a non-terminal can be given
22737 more than once, as long as all specifications give the same type.
22738
22739 * src/output.c:
22740 (output_headers, output_trailers, output, output_gram)
22741 (output_rule_data): Implement noparserflag variable.
22742 Implement toknumflag variable.
22743 (output): Call reader_output_yylsp to output LTYPESTR.
22744
22745 * src/main.c (main):
22746 If reader sees an error, don't process the grammar.
22747 (fatals): Updated to not use VARARGS1.
22748 (printable_version, int_to_string, warn, warni, warns, warnss)
22749 (warnsss): New error reporting functions. Avoid abort for error.
22750
22751 * src/lex.h:
22752 Added THONG and NOOP for alias processing.
22753 Added SETOPT for the new code that allows setting options with %flags.
22754
22755 * src/lex.c:
22756 Include getopt.h. Add some extern decls.
22757 (safegetc): New function to deal with EOF gracefully.
22758 (literalchar); new function to deal with reading \ escapes.
22759 (lex): Use literalchar.
22760 (lex): Implemented "..." tokens.
22761 (literalchar, lex, parse_percent_token): Made tokenbuffer
22762 always contain the token. This includes growing the token
22763 buffer while reading an integer.
22764 (parse_percent_token): Replaced if-else statement with percent_table.
22765 (parse_percent_token): Added % declarations as another
22766 way to specify the flags -n, -l, and -r. Also added hooks for
22767 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
22768 major changes to files.c.
22769 (lex) Retain in the incoming stream a character following
22770 an incorrect '/'.
22771 (skip_white_space, lex): Revised most error messages
22772 and changed fatal to warn to avoid aborting.
22773 (percent_table): Added %thong declarations.
22774
22775 * src/gram.h: Comment changes.
22776
22777 * src/files.c (openfiles, open_extra_files, done):
22778 Add faction flag
22779 and actfile file. Handle noparserflag. Both for -n switch.
22780
22781 * src/conflicts.c (resolve_sr_conflict):
22782 Remove use of alloca.
22783
22784 1995-06-01 Jim Meyering <meyering@gnu.org>
22785
22786 * doc/bison.texinfo: *** empty log message ***
22787
22788 1995-05-06 Richard Stallman <rms@gnu.org>
22789
22790 * src/bison.s1: Comment change.
22791
22792 1995-05-06 Richard Stallman <rms@gnu.org>
22793
22794 * bison.simple: Comment change.
22795
22796 1995-05-03 Richard Stallman <rms@gnu.org>
22797
22798 * src/version.c: Version now 1.24.
22799
22800 * src/bison.s1: Change distribution terms.
22801
22802 * src/version.c: Version now 1.23.
22803
22804 1995-05-03 Richard Stallman <rms@gnu.org>
22805
22806 * doc/bison.texinfo:
22807 Rewrite "Conditions for Using Bison".
22808 Update version to 1.24.
22809
22810 1995-05-03 Richard Stallman <rms@gnu.org>
22811
22812 * bison.simple: Change distribution terms.
22813
22814 1995-02-23 Richard Stallman <rms@gnu.org>
22815
22816 * src/files.c: Test __VMS_POSIX as well as VMS.
22817
22818 1995-02-14 Jim Meyering <meyering@gnu.org>
22819
22820 * src/bison.s1 (__yy_memcpy):
22821 Renamed from __yy_bcopy to avoid
22822 confusion. Reverse FROM and TO arguments to be consistent with
22823 those of memcpy.
22824
22825 1995-02-14 Jim Meyering <meyering@gnu.org>
22826
22827 * bison.simple (__yy_memcpy):
22828 Renamed from __yy_bcopy to avoid
22829 confusion. Reverse FROM and TO arguments to be consistent with
22830 those of memcpy.
22831
22832 1994-11-10 David J. MacKenzie <djm@gnu.org>
22833
22834 * NEWS: reformat
22835
22836 * NEWS: New file.
22837
22838 * Makefile.in (DISTFILES): Include NEWS.
22839
22840 * Makefile.in (DISTFILES):
22841 Include install-sh, not install.sh.
22842
22843 * configure.in: Update to Autoconf v2 macro names.
22844
22845 1994-10-05 David J. MacKenzie <djm@gnu.org>
22846
22847 * Makefile.in: fix typo
22848
22849 * Makefile.in (prefix, exec_prefix):
22850 Let configure set them.
22851
22852 1994-09-28 David J. MacKenzie <djm@gnu.org>
22853
22854 * Makefile.in: Set datadir to $(prefix)/share.
22855
22856 1994-09-15 Richard Stallman <rms@gnu.org>
22857
22858 * src/bison.s1:
22859 Update copyright notice and GPL version.
22860
22861 1994-09-15 Richard Stallman <rms@gnu.org>
22862
22863 * bison.simple:
22864 Update copyright notice and GPL version.
22865
22866 1994-07-12 Richard Stallman <rms@gnu.org>
22867
22868 * src/reduce.c, src/reader.c:
22869 entered into RCS
22870
22871 1994-05-05 David J. MacKenzie <djm@gnu.org>
22872
22873 * Makefile.in: entered into RCS
22874
22875 1994-03-26 Richard Stallman <rms@gnu.org>
22876
22877 * src/bison.s1: entered into RCS
22878
22879 1994-03-26 Richard Stallman <rms@gnu.org>
22880
22881 * bison.simple: entered into RCS
22882
22883 1994-03-25 Richard Stallman <rms@gnu.org>
22884
22885 * src/main.c: entered into RCS
22886
22887 1994-03-24 Richard Stallman <rms@gnu.org>
22888
22889 * src/conflicts.c: entered into RCS
22890
22891 1994-01-02 Richard Stallman <rms@gnu.org>
22892
22893 * Makefile.in: *** empty log message ***
22894
22895 1993-11-21 Richard Stallman <rms@gnu.org>
22896
22897 * src/bison.s1: *** empty log message ***
22898
22899 1993-11-21 Richard Stallman <rms@gnu.org>
22900
22901 * doc/bison.texinfo: entered into RCS
22902
22903 * doc/bison.texinfo: *** empty log message ***
22904
22905 1993-11-21 Richard Stallman <rms@gnu.org>
22906
22907 * bison.simple: *** empty log message ***
22908
22909 1993-10-25 David J. MacKenzie <djm@gnu.org>
22910
22911 * doc/bison.texinfo: *** empty log message ***
22912
22913 1993-10-19 Richard Stallman <rms@gnu.org>
22914
22915 * src/bison.s1: *** empty log message ***
22916
22917 1993-10-19 Richard Stallman <rms@gnu.org>
22918
22919 * bison.simple: *** empty log message ***
22920
22921 1993-10-14 Richard Stallman <rms@gnu.org>
22922
22923 * src/bison.s1: *** empty log message ***
22924
22925 1993-10-14 Richard Stallman <rms@gnu.org>
22926
22927 * bison.simple: *** empty log message ***
22928
22929 1993-09-14 David J. MacKenzie <djm@gnu.org>
22930
22931 * doc/bison.texinfo: *** empty log message ***
22932
22933 1993-09-13 Noah Friedman <friedman@gnu.org>
22934
22935 * Makefile.in: *** empty log message ***
22936
22937 1993-09-10 Richard Stallman <rms@gnu.org>
22938
22939 * src/conflicts.c: *** empty log message ***
22940
22941 * src/system.h: entered into RCS
22942
22943 1993-09-10 Richard Stallman <rms@gnu.org>
22944
22945 * doc/bison.1: entered into RCS
22946
22947 1993-09-06 Noah Friedman <friedman@gnu.org>
22948
22949 * src/version.c: entered into RCS
22950
22951 1993-09-06 Noah Friedman <friedman@gnu.org>
22952
22953 * Makefile.in: *** empty log message ***
22954
22955 1993-07-30 David J. MacKenzie <djm@gnu.org>
22956
22957 * Makefile.in: *** empty log message ***
22958
22959 1993-07-24 Richard Stallman <rms@gnu.org>
22960
22961 * src/bison.s1: *** empty log message ***
22962
22963 1993-07-24 Richard Stallman <rms@gnu.org>
22964
22965 * bison.simple: *** empty log message ***
22966
22967 1993-07-08 David J. MacKenzie <djm@gnu.org>
22968
22969 * Makefile.in: *** empty log message ***
22970
22971 1993-07-04 Richard Stallman <rms@gnu.org>
22972
22973 * src/bison.s1: *** empty log message ***
22974
22975 1993-07-04 Richard Stallman <rms@gnu.org>
22976
22977 * bison.simple: *** empty log message ***
22978
22979 1993-06-26 David J. MacKenzie <djm@gnu.org>
22980
22981 * src/getargs.c: entered into RCS
22982
22983 1993-06-26 David J. MacKenzie <djm@gnu.org>
22984
22985 * doc/bison.texinfo: *** empty log message ***
22986
22987 * doc/bison.1: New file.
22988
22989 1993-06-25 Richard Stallman <rms@gnu.org>
22990
22991 * src/getargs.c: New file.
22992
22993 1993-06-16 Richard Stallman <rms@gnu.org>
22994
22995 * src/bison.s1: *** empty log message ***
22996
22997 1993-06-16 Richard Stallman <rms@gnu.org>
22998
22999 * bison.simple: *** empty log message ***
23000
23001 1993-06-03 Richard Stallman <rms@gnu.org>
23002
23003 * src/bison.s1: New file.
23004
23005 1993-06-03 Richard Stallman <rms@gnu.org>
23006
23007 * doc/bison.texinfo: *** empty log message ***
23008
23009 1993-06-03 Richard Stallman <rms@gnu.org>
23010
23011 * bison.simple: New file.
23012
23013 1993-05-19 Richard Stallman <rms@gnu.org>
23014
23015 * doc/bison.texinfo: New file.
23016
23017 1993-05-07 Noah Friedman <friedman@gnu.org>
23018
23019 * Makefile.in: *** empty log message ***
23020
23021 1993-04-28 Noah Friedman <friedman@gnu.org>
23022
23023 * src/reader.c: *** empty log message ***
23024
23025 1993-04-23 Noah Friedman <friedman@gnu.org>
23026
23027 * src/alloc.h: entered into RCS
23028
23029 1993-04-20 David J. MacKenzie <djm@gnu.org>
23030
23031 * src/version.c: *** empty log message ***
23032
23033 * src/files.c, src/allocate.c:
23034 entered into RCS
23035
23036 * src/reader.c: *** empty log message ***
23037
23038 * src/lex.c: entered into RCS
23039
23040 * src/conflicts.c: New file.
23041
23042 * src/symtab.c: entered into RCS
23043
23044 * src/alloc.h: New file.
23045
23046 * src/LR0.c: entered into RCS
23047
23048 1993-04-18 Noah Friedman <friedman@gnu.org>
23049
23050 * src/reader.c: New file.
23051
23052 * src/version.c: *** empty log message ***
23053
23054 1993-04-18 Noah Friedman <friedman@gnu.org>
23055
23056 * Makefile.in: *** empty log message ***
23057
23058 1993-04-17 Noah Friedman <friedman@gnu.org>
23059
23060 * Makefile.in: *** empty log message ***
23061
23062 1993-04-15 Richard Stallman <rms@gnu.org>
23063
23064 * src/main.c, src/files.c:
23065 New file.
23066
23067 1993-04-15 Noah Friedman <friedman@gnu.org>
23068
23069 * configure.in: entered into RCS
23070
23071 * configure.in: *** empty log message ***
23072
23073 * configure.in: New file.
23074
23075 1993-04-14 Richard Stallman <rms@gnu.org>
23076
23077 * Makefile.in: New file.
23078
23079 1993-04-13 Richard Stallman <rms@gnu.org>
23080
23081 * src/version.c: New file.
23082
23083 1993-03-25 Richard Stallman <rms@gnu.org>
23084
23085 * src/output.c: entered into RCS
23086
23087 1992-09-25 Richard Stallman <rms@gnu.org>
23088
23089 * configure.bat: entered into RCS
23090
23091 1992-06-22 Richard Stallman <rms@gnu.org>
23092
23093 * src/vmsgetargs.c: entered into RCS
23094
23095 1992-06-22 Richard Stallman <rms@gnu.org>
23096
23097 * doc/bison.rnh: entered into RCS
23098
23099 1992-04-20 David J. MacKenzie <djm@gnu.org>
23100
23101 * README: entered into RCS
23102
23103 1992-01-22 Richard Stallman <rms@gnu.org>
23104
23105 * src/machine.h: entered into RCS
23106
23107 1991-12-21 Richard Stallman <rms@gnu.org>
23108
23109 * src/lalr.c, src/closure.c:
23110 entered into RCS
23111
23112 1991-12-20 Richard Stallman <rms@gnu.org>
23113
23114 * src/state.h: entered into RCS
23115
23116 1991-12-18 Richard Stallman <rms@gnu.org>
23117
23118 * src/print.c, src/nullable.c, src/derives.c:
23119 entered into RCS
23120
23121 1991-11-03 David J. MacKenzie <djm@gnu.org>
23122
23123 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
23124 entered into RCS
23125
23126 1988-09-09 Richard Stallman <rms@gnu.org>
23127
23128 * src/bison.hairy: entered into RCS
23129
23130 1987-12-16 Richard Stallman <rms@gnu.org>
23131
23132 * REFERENCES: entered into RCS
23133
23134
23135 -----
23136
23137 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
23138 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
23139 Free Software Foundation, Inc.
23140
23141 Copying and distribution of this file, with or without
23142 modification, are permitted provided the copyright notice and this
23143 notice are preserved.