]> git.saurik.com Git - bison.git/blob - ChangeLog
s/_FLAGS/FLAGS/.
[bison.git] / ChangeLog
1 2008-11-26 Akim Demaille <demaille@gostai.com>
2
3 s/_FLAGS/FLAGS/.
4 * tests/local.mk (TESTSUITE_FLAGS, AUTOTEST_FLAGS): Rename as...
5 (TESTSUITEFLAGS, AUTOTESTFLAGS): these to compy with the GCS.
6 Reported by Eric Blake.
7
8 2008-11-26 Akim Demaille <demaille@gostai.com>
9
10 Use b4_parser_tables_define in glr.cc.
11 * data/glr.c: Use b4_parser_tables_define instead of defining the
12 (deterministic integral) tables by hand.
13
14 2008-11-26 Akim Demaille <demaille@gostai.com>
15
16 Use b4_parser_tables_define in Java.
17 * data/java.m4 (b4_typed_parser_table): Rename as...
18 (b4_typed_parser_table_define): this, for consistency.
19 Accept a comment as $4.
20 Move $2 into yy*_.
21 (b4_integral_parser_table): Rename as...
22 (b4_integral_parser_table_define): this.
23 * data/lalr1.java: Adjust all uses.
24 Use b4_parser_tables_define instead of generation by hand.
25
26 2008-11-26 Akim Demaille <demaille@gostai.com>
27
28 Prepare the convergence bw C style and Java table generation.
29 * data/bison.m4 (b4_tables_map, b4_tables_declare)
30 (b4_tables_define): Rename as...
31 (b4_integral_parser_tables_map, b4_parser_tables_declare)
32 (b4_parser_tables_define): these.
33 * data/c.m4 (b4_table_define): Rename as...
34 (b4_integral_parser_table_define): this.
35 * data/lalr1.cc: Adjust.
36 (b4_table_define, b4_table_declare): Rename as...
37 (b4_integral_parser_table_define)
38 (b4_integral_parser_table_declare): these.
39 (yyrline_): Move the comment where it is actually used.
40 * data/yacc.c: Adjust.
41 (yyrline): Use b4_integral_parser_table_define.
42
43 2008-11-26 Akim Demaille <demaille@gostai.com>
44
45 Regen.
46 * src/parse-gram.h, src/parse-gram.c: Regen.
47
48 2008-11-26 Akim Demaille <demaille@gostai.com>
49
50 Factor the generation of the (integral) tables bw yacc.c and lalr1.cc.
51 * data/lalr1.cc (b4_tables_map): Move to...
52 * data/bison.m4: here.
53 Update the comment for yytable during the flight.
54 (b4_tables_declare, b4_tables_define): New.
55 * data/lalr1.cc: Use them.
56 * data/c.m4 (b4_table_define): New.
57 * data/yacc.c: Use b4_tables_define instead of output the tables
58 by hand.
59 * tests/regression.at (Web2c Actions): Adjust the expected output,
60 the order of the tables changed.
61
62 2008-11-26 Akim Demaille <demaille@gostai.com>
63
64 Get rid of (yy)rhs and (yy)prhs.
65 These tables are no longer needed in the parsers, and they don't seem to
66 be useful. They are not documented either.
67
68 * src/output.c (prepare_rules): Get rid of rhs and prhs.
69 Adjust the computation of (yy)r2.
70
71 2008-11-26 Akim Demaille <demaille@gostai.com>
72
73 Rule length is unsigned.
74 * src/gram.h, src/gram.c (rule_rhs_length): Return a size_t.
75
76 2008-11-26 Akim Demaille <demaille@gostai.com>
77
78 Get rid of lalr1-split.cc.
79 It was no longer maintainer.
80
81 * data/lalr1-split.cc: Remove.
82 * etc/bench.pl.in (bench_fusion_parser): Remove.
83 Adjust.
84
85 2008-11-26 Akim Demaille <demaille@gostai.com>
86
87 Use yy* consistently.
88 * data/glr.c: Now that yyrhs no longer exists as a global
89 variable, rename local "rhs" variables into "yyrhs" for
90 consistency.
91
92 2008-11-25 Akim Demaille <demaille@gostai.com>
93
94 Get rid of yyrhs and yyprhs in glr.c.
95 * data/glr.c (yyrhs, yyprhs): Remove.
96 Instead, use the state stack and yystos.
97
98 2008-11-25 Akim Demaille <demaille@gostai.com>
99
100 Flag glr tests.
101 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): If glr, declare it
102 as an Autotest keyword.
103
104 2008-11-25 Akim Demaille <demaille@gostai.com>
105
106 Prefer TESTSUITE_FLAGS.
107 TESTSUITEFLAGS is barely readable.
108
109 * tests/local.mk (TESTSUITE_FLAGS): Default to $(TESTSUITEFLAGS)
110 for backward compatibility.
111 Use the former instead of the latter.
112
113 2008-11-25 Akim Demaille <demaille@gostai.com>
114
115 Get rid of yyrhs and yyprhs in larl1.java.
116 * data/lalr1.java (yyrhs_, yyprhs_): Remove.
117 (yy_reduce_print): Rather, use yystos_ and the state stack.
118
119 2008-11-25 Akim Demaille <demaille@gostai.com>
120
121 Formatting changes.
122
123 2008-11-25 Akim Demaille <demaille@gostai.com>
124
125 Get rid of yyrhs and yyprhs in yacc.c.
126 They were used to get the symbol types, given a rule number, when
127 displaying the top of the stack before a reduction. But the symbol type
128 is available from the state stack. This has two be benefits: two tables
129 less in the parser (making it smaller), and a more consistent use of the
130 three stacks which will help to fuse them.
131
132 * data/yacc.c (yyprhs, yyrhs): Remove.
133 (YY_REDUCE_PRINT): Pass yyssp to yy_reduce_print.
134 (yy_reduce_print): Take yyssp as argument.
135 Use it, together with yystos, to get the symbol type.
136 * tests/regression.at (Web2c Report): Remove these tables from the
137 expected output.
138
139 2008-11-25 Akim Demaille <demaille@gostai.com>
140
141 b4_tables_map.
142 The point is to factor the generation of the tables across skeletons.
143 This is language dependant.
144
145 * data/c.m4 (b4_comment_): New.
146 Should be usable to define how to generate tables independently of
147 the language.
148 (b4_c_comment): New.
149 (b4_comment): Bounce to b4_c_comment.
150 Now support $2 = [PREFIX] for indentation.
151 * data/lalr1.cc (b4_table_declare): Don't output a comment if
152 there is no comment.
153 Indent it properly when there is one.
154 Output the ending semicolon.
155 (b4_table_define): Space changes.
156 Output the ending semicolon.
157 (b4_tables_map): New.
158 Use it twice instead of declaring and defining the (integral)
159 tables by hand.
160
161 2008-11-25 Akim Demaille <demaille@gostai.com>
162
163 b4_table_declare.
164 * data/lalr1.cc (b4_table_declare): New.
165 Use it to declare the tables defined with b4_table_define.
166 (b4_table_define): Declare a third arg to match b4_table_declare
167 signature.
168 Move all the comments around invocations of b4_table_define into
169 the invocations itselves.
170 Move things around to have the order for declarations and
171 definitions.
172
173 2008-11-25 Akim Demaille <demaille@gostai.com>
174
175 Formatting changes.
176 * data/lalr1.java: here.
177
178 2008-11-25 Akim Demaille <demaille@gostai.com>
179
180 b4_args is more general than only C++.
181 * data/lalr1.cc (b4_args, _b4_args): Move to...
182 * data/bison.m4: here.
183
184 2008-11-21 Di-an Jan <dianj@freeshell.org>
185
186 Implement no-XXX arguments for --warnings, --report, --trace.
187 * src/getargs.c (flags_argmatch): Handles no-XXX.
188 Fix typo in doxygen comment.
189
190 2008-11-21 Akim Demaille <demaille@gostai.com>
191
192 Display the changes in cross-options.texi.
193 * build-aux/cross-options.pl ($sep): New, to separate items.
194 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Use diff to display the
195 changes.
196
197 2008-11-20 Di-an Jan <dianj@freeshell.org>
198
199 Improves options in the manual.
200 * doc/bison.texinfo (-g, -x): Add space before argument.
201 (Option Cross Key): Implement FIXME: listing directives also.
202 * build-aux/cross-options.pl: Read from <STDIN> rather than <>.
203 (Short Option): Special case -d. Put arguments inside @option.
204 (Bison Directive): Add column, automatically extracted from
205 src/scan-gram.l (actual name passed as the first argument)
206 with special case for %define.
207 * doc/local.mk (doc/cross-options.texi): Pass src/scan-gram.l
208 to build-aux/cross-options.pl.
209 * src/getargs.c (usage): Document limitations of cross-options.pl.
210 * src/scan-gram.l: Likewise.
211
212 2008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
213
214 Fix unexpanded macros in GLR defines file.
215 Reported by Csaba Raduly at
216 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
217 * THANKS (Csaba Raduly): Add.
218 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
219 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
220 lexer in a separate module that includes the defines file.
221 (AT_CHECK_CALC): From AT_FULL_COMPILE, request compilation of lexer
222 source.
223 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
224 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
225 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
226 (AT_DATA_SOURCE_PROLOGUE): New.
227 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
228 (AT_DATA_SOURCE): New.
229 (AT_FULL_COMPILE): Extend to support an additional source file.
230
231 2008-11-18 Akim Demaille <demaille@gostai.com>
232
233 More TODO.
234 * TODO: More short term issues.
235
236 2008-11-18 Akim Demaille <demaille@gostai.com>
237
238 Regen.
239 * src/parse-gram.h, src/parse-gram.c: Regen.
240
241 2008-11-18 Akim Demaille <demaille@gostai.com>
242
243 Use b4_subtract where possible.
244 * data/lalr1.cc (b4_subtract): Move to...
245 * data/bison.m4: here.
246 * data/glr.c (b4_rhs_data): Use it.
247 * data/yacc.c (b4_rhs_value, b4_rhs_location): Use it.
248
249 2008-11-18 Akim Demaille <demaille@gostai.com>
250
251 Remove incorrect mode specification.
252 * data/glr.cc: Don't pretend it's C code.
253
254 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
255
256 Simplify last patch slightly.
257 * src/getargs.c (getargs): Here.
258
259 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
260
261 Fix last warning from --enable-gcc-warnings.
262 * src/getargs.c (getargs): Don't assign const address to non-const
263 pointer.
264
265 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
266
267 Don't let maintainer-*-check targets force a version update.
268 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
269 handled.
270
271 2008-11-17 Di-an Jan <dianj@freeshell.org>
272
273 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
274 Align menus. Adjust word wrapping. Use node names for menu names.
275 (Examples): Don't abbreviate node names.
276 (LocalWords): Remove abbreviations.
277 (Copying): Make description a sentence.
278 (Java Action Features): Remove period to match the rest of menu.
279
280 2008-11-17 Di-an Jan <dianj@freeshell.org>
281
282 Handles several --enable-gcc-warnings.
283 * src/getargs.c (command_line_location): Set parameters to void.
284 * src/output.c (symbol_type_name_cmp): Make static.
285 (symbols_by_type_name): Set parameters to void.
286 (symbol_definitions_output): Remove unused parameter. Rename as...
287 (prepare_symbol_definitions): this.
288 (muscles_output): Move symbol_definitions_output to...
289 (output): here as prepare_symbol_definitions.
290 * tests/c++.at (AT_CHECK_VARIANTS): Remove unused parameters of main.
291 (AT_CHECK_NAMESPACE): Make unused parameter lloc unnamed.
292
293 2008-11-17 Di-an Jan <dianj@freeshell.org>
294
295 * tests/c++.at (AT_CHECK_VARIANTS): Fixes tests 198-202.
296 Use AT_DATA_GRAMMAR instead of AT_DATA for compiled tests.
297
298 2008-11-16 Akim Demaille <demaille@gostai.com>
299
300 Add missing $(EXEEXT).
301 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): The target is
302 "src/bison$(EXEEXT)".
303 Reported by Di-an Jan.
304
305 2008-11-15 Akim Demaille <demaille@gostai.com>
306
307 * TODO: Update.
308
309 2008-11-15 Akim Demaille <demaille@gostai.com>
310
311 Formatting changes.
312 * tests/input.at: here.
313
314 2008-11-15 Akim Demaille <demaille@gostai.com>
315
316 Remove duplicate header inclusion.
317 * src/LR0.c: here.
318
319 2008-11-15 Akim Demaille <demaille@gostai.com>
320
321 * src/parse-gram.h, src/parse-gram.c: Regen.
322
323 2008-11-15 Akim Demaille <demaille@gostai.com>
324
325 Support parametric types.
326
327 There are two issues to handle: first scanning nested angle
328 bracket pairs to support types such as std::pair< std::string,
329 std::list<std::string> > >.
330
331 Another issue is to address idiosyncracies of C++: do not glue two
332 closing angle brackets together (otherwise it's operator>>), and
333 avoid sticking blindly a TYPE to the opening <, as it can result
334 in '<:' which is a digraph for '['.
335
336 * src/scan-gram.l (brace_level): Rename as...
337 (nesting): this.
338 (SC_TAG): New.
339 Implement support for complex tags.
340 (tag): Accept
341 , but not <.
342 * data/lalr1.cc (b4_symbol_value, b4_symbol_value_template)
343 (b4_symbol_variant): Leave space around types as parameters.
344 * examples/variant.yy: Use nested template types and leading ::.
345 * src/parse-gram.y (TYPE, TYPE_TAG_ANY, TYPE_TAG_NONE, type.opt):
346 Rename as...
347 (TAG, TAG_ANY, TAG_NONE, tag.opt): these.
348 * tests/c++.at: Test parametric types.
349
350 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
351
352 Test token.prefix.
353 This is not sufficient, but we test at least that the make_SYMBOL
354 interface is not affected by token.prefix. A more general test
355 will be implemented when the support of token.prefix is generalized
356 to more skeletons.
357
358 * tests/c++.at: One more variant test, using token.prefix.
359
360 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
361
362 Test the make_TOKEN interface.
363 * tests/c++.at (AT_CHECK_VARIANTS): Require and use locations.
364 Factor the common code in yylex.
365 Use it to test "%define lex_symbol".
366
367 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
368
369 Formatting change.
370
371 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
372
373 Simplify code for variants bench marks.
374 * etc/bench.pl.in (&generate_grammar_list): Define and use
375 location_type.
376 Factor the common code in yylex.
377
378 2008-11-15 Akim Demaille <demaille@gostai.com>
379
380 Better error message.
381 * bootstrap (find_tool): Fix the error message.
382
383 2008-11-15 Akim Demaille <demaille@gostai.com>
384
385 Update variant.yy to newest interface.
386 * examples/variant.yy: Define lex_symbol.
387 Adjust.
388
389 2008-11-15 Akim Demaille <demaille@gostai.com>
390
391 Don't use locations in variant.yy.
392 * examples/variant.yy: Adjust to not using locations.
393
394 2008-11-15 Akim Demaille <demaille@gostai.com>
395
396 Comment changes.
397 * data/local.mk, etc/local.mk, examples/local.mk: Use Automake
398 comments for the license.
399
400 2008-11-15 Akim Demaille <demaille@gostai.com>
401
402 Remove tests/Makefile.am.
403 * tests/Makefile.am: Rename as...
404 * tests/local.mk: this.
405 * Makefile.am, configure.ac: Adjust.
406 * Makefile.am (DISTCLEANFILES): Define.
407 (maintainer-check, maintainer-xml-check, maintainer-push-check):
408 Remove, we no longer need to bounce to the real targets.
409
410 2008-11-15 Akim Demaille <demaille@gostai.com>
411
412 Comment changes.
413
414 2008-11-15 Akim Demaille <demaille@gostai.com>
415
416 djgpp/local.mk.
417 * Makefile.am (EXTRA_DIST): Move djgpp related part to...
418 * djgpp/local.mk: this new file.
419
420 2008-11-15 Akim Demaille <demaille@gostai.com>
421
422 Remove doc/Makefile.am.
423 * doc/Makefile.am: Rename as...
424 * doc/local.mk: this.
425 Adjust paths
426 * Makefile.am, configure.ac: Adjust.
427 * Makefile.am (MOSTLYCLEANFILES): New.
428 * src/local.mk: Adjust.
429
430 2008-11-15 Akim Demaille <demaille@gostai.com>
431
432 Move sc_tight_scope into maint.mk.
433 It does not work, and I don't know how it was supposed to work: it
434 seems to be looking for sources in the build tree. I just moved
435 it at a better place, fixing it is still required.
436
437 * src/local.mk (echo): Remove.
438 (sc_tight_scope): Move to...
439 * maint.mk: here.
440
441 2008-11-15 Akim Demaille <demaille@gostai.com>
442
443 Regen.
444 * src/parse-gram.h, src/parse-gram.h: Regen.
445
446 2008-11-15 Akim Demaille <demaille@gostai.com>
447
448 Remove src/Makefile.am.
449 * src/Makefile.am: Rename as...
450 * src/local.mk: this.
451 Prefix all the paths with src/.
452 (AUTOMAKE_OPTIONS): Build object files in the sub dirs.
453 (AM_CPPFLAGS): Find find in builddir/src.
454 (YACC): Move the flags into...
455 (AM_YFLAGS): here.
456 * maint.mk (sc_tight_scope): Disable.
457 It used to bounce to the version in src/Makefile.am which is now
458 part of this very Makefile.
459 * Makefile.am, configure.ac: Adjust.
460 * src/scan-code-c.c, src/scan-code.l: We can no longer rely on
461 include "..." to find files "here": we are no longer in src/, so
462 qualify the includes with src/.
463 * doc/Makefile.am (PREPATH): No longer include the top_builddir
464 prefix.
465 (.x.1): Adjust to be able to create src/foo from the top level
466 Makefile, instead of going bounce to src/Makefile the creation of
467 foo.
468
469 2008-11-15 Akim Demaille <demaille@gostai.com>
470
471 Remove useless variable.
472 * doc/Makefile.am (srcsrcdir): Remove.
473
474 2008-11-15 Akim Demaille <demaille@gostai.com>
475
476 Remove data/Makefile.am.
477 * data/Makefile.am: Rename as...
478 * data/local.mk: this.
479 Adjust paths.
480 * Makefile.am, configure.ac: Adjust.
481
482 2008-11-15 Akim Demaille <demaille@gostai.com>
483
484 Remove etc/Makefile.am.
485 * etc/Makefile.am: Rename as...
486 * etc/local.mk: this.
487 Adjust.
488 * Makefile.am, configure.ac: Adjust.
489
490 2008-11-15 Akim Demaille <demaille@gostai.com>
491
492 Remove examples/local.mk.
493 examples/calc++/Makefile.am might be interesting to keep as is, since
494 it is an example in itself.
495
496 * examples/Makefile.am: Rename as...
497 * examples/local.mk: this.
498 Adjust.
499 * Makefile.am, configure.ac: Adjust.
500
501 2008-11-15 Akim Demaille <demaille@gostai.com>
502
503 Remove build-aux/Makefile.am.
504 Recursive Makefiles are really way too slow, let's get rid of some of
505 them.
506
507 * build-aux/Makefile.am: Rename as...
508 * build-aux/local.mk: this.
509 Adjust paths.
510 * Makefile.am, configure.ac: Adjust.
511
512 2008-11-15 Akim Demaille <demaille@gostai.com>
513
514 Provide convenience constructors for locations and positions.
515 * data/location.cc (position::position): Accept file, line and
516 column as arguments with default values.
517 Always qualify initial line and column literals as unsigned.
518 (location::location): Provide convenience constructors.
519
520 2008-11-15 Akim Demaille <demaille@gostai.com>
521
522 Instead of using make_symbol<TOK_FOO>, generate make_FOO for each
523 token type.
524 Using template buys us nothing, and makes it uselessly complex to
525 construct a symbol. Besides, it could not be generalized to other
526 languages, while make_FOO would work in C/Java etc.
527
528 * data/lalr1.cc (b4_symbol_): New.
529 (b4_symbol): Use it.
530 (b4_symbol_constructor_declaration_)
531 (b4_symbol_constructor_definition_): Instead of generating
532 specializations of an overloaded template function, just generate
533 several functions whose names are forged from the token names
534 without the token.prefix.
535 (b4_symbol_constructor_declarations): Generate them for all the
536 symbols, not just by class of symbol type, now that instead of
537 specializing a function template by the token, we generate a
538 function named after the token.
539 (b4_symbol_constructor_specialization_)
540 (b4_symbol_constructor_specializations): Remove.
541 * etc/bench.pl.in: Adjust to this new API.
542
543 2008-11-13 Akim Demaille <demaille@gostai.com>
544
545 %define token.prefix.
546 Provide a means to add a prefix to the name of the tokens as
547 output in the generated files. Because of name clashes, it is
548 good to have such a prefix such as TOK_ that protects from names
549 such as EOF, FILE etc. But it clutters the grammar itself.
550
551 * data/bison.m4 (token.prefix): Empty by default.
552 * data/c.m4 (b4_token_enum, b4_token_define): Use it.
553 * data/lalr1.cc (b4_symbol): Ditto.
554
555 2008-11-13 Akim Demaille <demaille@gostai.com>
556
557 Compute at M4 time some of the subtractions.
558 * data/lalr1.cc (b4_subtract): New.
559 (b4_rhs_data): Use it.
560
561 2008-11-13 Akim Demaille <demaille@gostai.com>
562
563 symbol::token.
564 This allows the user to get the type of a token returned by yylex.
565
566 * data/lalr1.cc (symbol::token): New.
567 (yytoknum_): Define when %define lex_symbol, independently of
568 %debug.
569 (yytoken_number_): Move into...
570 (symbol::token): here, since that's the only use.
571 The other one is YYPRINT which was not officially supported
572 by lalr1.cc, and anyway it did not work since YYPRINT uses this
573 array under a different name (yytoknum).
574
575 2008-11-13 Akim Demaille <demaille@gostai.com>
576
577 YYERRCODE.
578 * TODO (YYERRCODE): Mention the case of $undef.
579
580 2008-11-13 Akim Demaille <demaille@gostai.com>
581
582 TODO: YYPRINT.
583 * TODO (YYPRINT): New.
584
585 2008-11-13 Akim Demaille <demaille@gostai.com>
586
587 Comment changes.
588 * data/lalr1.cc, data/yacc.c: Fix the description of the
589 yytranslate and yytoknum tables.
590
591 2008-11-13 Akim Demaille <demaille@gostai.com>
592
593 Define make_symbol in the header.
594 To reach good performances these functions should be inlined (yet
595 this is to measure precisely). To this end they must be available
596 to the caller.
597
598 * data/lalr1.cc (b4_symbol_constructor_definition_): Qualify
599 location_type with the class name.
600 Since will now be output in the header, declare "inline".
601 No longer use b4_symbol_constructor_specializations, but
602 b4_symbol_constructor_definitions in the header.
603 Don't call it in the *.cc file.
604
605 2008-11-13 Akim Demaille <demaille@gostai.com>
606
607 Define yytranslate in the header for lex_symbol.
608 * data/lalr1.cc: Move the invocation of b4_yytranslate_definition
609 into the header file when using %define lex_symbol.
610 (yytranslate_): Declare inline.
611
612 2008-11-13 Akim Demaille <demaille@gostai.com>
613
614 Define the constructors of symbol_type in
615 b4_symbol_constructor_definitions.
616 The constructors are called by the make_symbol functions, which a
617 forthcoming patch will move elsewhere. Hence the interest of
618 putting them together.
619
620 The stack_symbol_type does not need to be moved, it is used only
621 by the parser.
622
623 * data/lalr1.cc: Move symbol_type and symbol_base_type
624 constructors into...
625 (b4_symbol_constructor_definitions): here.
626 Adjust.
627
628 2008-11-13 Akim Demaille <demaille@gostai.com>
629
630 Make it easier to move the definition of yytranslate_.
631 Forthcoming changes will make it possible to use yytranslate_
632 from outside the parser implementation file.
633
634 * data/lalr1.cc (b4_yytranslate_definition): New.
635 Use it.
636
637 2008-11-13 Akim Demaille <demaille@gostai.com>
638
639 Remove useless class specification.
640 * data/lalr1.cc (b4_symbol_constructor_specialization_): No need
641 to refer to the class name to use a type defined by the class for
642 arguments of member functions.
643
644 2008-11-13 Akim Demaille <demaille@gostai.com>
645
646 Finer input type for yytranslate.
647 This patch is debatable: the tradition expects yylex to return an int
648 which happens to correspond to token_number (which is an enum). This
649 allows for instance to return characters (such as '*' etc.). But this
650 goes against the stronger typing I am trying to have with the new
651 lex interface which return a symbol_type. So in this case, feed
652 yytranslate_ with a token_type.
653
654 * data/lalr1.cc (yytranslate_): When in %define lex-symbol,
655 expect a token_type.
656
657 2008-11-13 Akim Demaille <demaille@gostai.com>
658
659 Honor lex-params in %define lex_symbol mode.
660 * data/lalr1.cc: Use b4_lex_param.
661
662 2008-11-13 Akim Demaille <demaille@gostai.com>
663
664 Simplify names.
665 * src/output.c (symbol_definitions_output): Rename symbol
666 attributes type_name and has_type_name as type and has_type.
667 * data/lalr1.cc: Adjust uses.
668
669 2008-11-13 Akim Demaille <demaille@gostai.com>
670
671 Use b4_type_names for the union type.
672 The union used to compute the size of the variant used to iterate
673 over the type of all the symbols, with a lot of redundancy. Now
674 iterate over the lists of symbols having the same type-name.
675
676 * data/lalr1.cc (b4_char_sizeof_): New.
677 (b4_char_sizeof): Use it.
678 Adjust to be called with a list of numbers instead of a single
679 number.
680 Adjust its caller for new-line issues.
681
682 2008-11-13 Akim Demaille <demaille@gostai.com>
683
684 Define the "identifier" of a symbol.
685 Symbols may have several string representations, for instance if
686 they have an alias. What I call its "id" is a string that can be
687 used as an identifier. May not exist.
688
689 Currently the symbols which have the "tag_is_id" flag set are
690 those that don't have an alias. Look harder for the id.
691
692 * src/output.c (is_identifier): Move to...
693 * src/symtab.c (is_identifier): here.
694 * src/symtab.h, src/symtab.c (symbol_id_get): New.
695 * src/output.c (symbol_definitions_output): Use it to define "id"
696 and "has_id".
697 Remove the definition of "tag_is_id".
698 * data/lalr1.cc: Use the "id" and "has_id" whereever "tag" and
699 "tag_is_id" were used to produce code.
700 We still use "tag" for documentation.
701
702 2008-11-11 Akim Demaille <demaille@gostai.com>
703
704 Locations are no longer required by lalr1.cc.
705 * data/lalr1.cc (_b4_args, b4_args): New.
706 Adjust all uses of locations to make them optional.
707 * tests/c++.at (AT_CHECK_VARIANTS): No longer use the locations.
708 (AT_CHECK_NAMESPACE): Check the use of locations.
709 * tests/calc.at (_AT_DATA_CALC_Y): Adjust to be usable with or
710 without locations with lalr1.cc.
711 Test these cases.
712 * tests/output.at: Check lalr1.cc with and without location
713 support.
714 * tests/regression.at (_AT_DATA_EXPECT2_Y, _AT_DATA_DANCER_Y):
715 Don't use locations.
716
717 2008-11-11 Akim Demaille <demaille@gostai.com>
718
719 AT_FULL_COMPILE.
720 * tests/local.at (AT_FULL_COMPILE): New.
721 * tests/actions.at, tests/calc.at, tests/regression.at: Use it.
722
723 2008-11-11 Akim Demaille <demaille@gostai.com>
724
725 Support parens in calc++.
726 * doc/bison.texinfo (Calc++ Scanner, Calc++ Parser): Support parens.
727 * examples/calc++/test (run): Check the expected output.
728 Adjust callers.
729 Check parens too.
730
731 2008-11-11 Akim Demaille <demaille@gostai.com>
732
733 Simplify lalr1.cc since %defines is mandatory.
734 * data/lalr1.cc: Remove useless calls to b4_defines_if.
735
736 2008-11-11 Akim Demaille <demaille@gostai.com>
737
738 TODO: yyfmt.
739 * TODO (yysyntax_error): New item.
740
741 2008-11-11 Akim Demaille <demaille@gostai.com>
742
743 Prefer M4 to CPP.
744 * data/lalr1.cc: Use b4_error_verbose_if instead of #if
745 YYERROR_VERBOSE.
746
747 2008-11-11 Akim Demaille <demaille@gostai.com>
748
749 Support i18n of the parse error messages.
750 * TODO (lalr1.cc/I18n): Remove.
751 * data/lalr1.cc (yysyntax_error_): Support the translation of the
752 error messages, as done in yacc.c.
753 Stay within the yy* pseudo namespace.
754
755 2008-11-11 Akim Demaille <demaille@gostai.com>
756
757 More TODO.
758 * TODO (single stack, yysyntax_error): New.
759
760 2008-11-11 Akim Demaille <demaille@gostai.com>
761
762 Make it possible to return a symbol_type from yylex.
763 * data/lalr1.cc (b4_lex_symbol_if): New.
764 (parse): When lex_symbol is defined, expected yylex to return the
765 complete lookahead.
766 * etc/bench.pl.in (generate_grammar_list): Extend to support this
767 yylex interface.
768 (bench_variant_parser): Exercise it.
769
770 2008-11-11 Akim Demaille <demaille@gostai.com>
771
772 Remove useless bench case.
773 * etc/bench.pl.in (bench_variant_parser): VARIANT_DESTROY is
774 no longer used.
775
776 2008-11-11 Akim Demaille <demaille@gostai.com>
777
778 Improve display of directives.
779 * etc/bench.pl.in (parse_term): Don't add useless eol.
780
781 2008-11-11 Akim Demaille <demaille@gostai.com>
782
783 Use string_cast in the bench.
784 * etc/bench.pl.in (generate_grammar_list): Define and use
785 string_cast.
786
787 2008-11-11 Akim Demaille <demaille@gostai.com>
788
789 Replace yychar with a Boolean.
790 * data/lalr1.cc (parse::yychar): Replace by...
791 (parse::yyempty): this.
792
793 2008-11-11 Akim Demaille <demaille@gostai.com>
794
795 Factor the tables.
796 * TODO: New item.
797
798 2008-11-11 Akim Demaille <demaille@gostai.com>
799
800 Let yytranslate handle the eof case.
801 * data/lalr1.cc (yytranslate_): Handle the EOF case.
802 Adjust callers.
803 No longer expect yychar to be equal to yyeof_, rather, test the
804 lookahead's (translated) kind.
805
806 2008-11-11 Akim Demaille <demaille@gostai.com>
807
808 yychar cannot be empty in yyerrlab.
809 * TODO (yychar == yyempty_): New.
810 * data/lalr1.cc: Remove the handling of this case.
811 This eases forthcoming changes related to yychar and yytranslate.
812
813 2008-11-11 Akim Demaille <demaille@gostai.com>
814
815 Bench: syntactic sugar for %define/#define.
816 * etc/bench.pl.in (parse_dirs): Support %d and #d with arguments.
817 (&bench_push_parser, bench_variant_parser): Use this feature.
818 (&eat): New.
819 Use it.
820
821 2008-11-11 Akim Demaille <demaille@gostai.com>
822
823 Less memory pressure on the "list" bench.
824 * etc/bench.pl.in (generate_grammar_list): Do not accumulate all
825 the values, to limit memory pressure.
826
827 2008-11-11 Akim Demaille <demaille@gostai.com>
828
829 Introduce make_symbol.
830 make_symbol provides a means to construct a full symbol (kind,
831 value, location) in a single shot. It is meant to be a Symbol
832 constructor, parameterized by the symbol kind so that overloading
833 would prevent incorrect kind/value pairs. Unfortunately
834 parameterized constructors do not work well in C++ (unless the
835 parameter also appears as an argument, which is not acceptable),
836 hence the use of a function instead of a constructor.
837
838 * data/lalr1.cc (b4_symbol_constructor_declaration_)
839 (b4_symbol_constructor_declarations)
840 (b4_symbol_constructor_specialization_)
841 (b4_symbol_constructor_specializations)
842 (b4_symbol_constructor_definition_)
843 (b4_symbol_constructor_definitions): New.
844 Use them where appropriate to generate declaration, declaration of
845 the specializations, and implementations of the templated
846 overloaded function "make_symbol".
847 (variant::variant): Always define a default ctor.
848 Also provide a copy ctor.
849 (symbol_base_type, symbol_type): New ctor overloads for value-less
850 symbols.
851 (symbol_type): Now public, so that functions such as yylex can use
852 it.
853
854 2008-11-11 Akim Demaille <demaille@gostai.com>
855
856 Inform m4 whether a tag is a valid id.
857 * src/output.c (is_identifier): New.
858 (symbol_definitions_output): Use it to define tag_is_id.
859 But maybe this should be done at m4 level?
860
861 2008-11-11 Akim Demaille <demaille@gostai.com>
862
863 Test 214 was failing: it greps with a pattern containing [ ]*
864 which obviously meant to catch spaces and tabs, but contained only
865 spaces. Tabulations in sources are a nuisance, so to simplify the
866 matter, get rid of all the tabulations in the Java sources. The
867 other skeletons will be treated equally later.
868
869 * data/java.m4, data/lalr1.java: Untabify.
870 * tests/java.at: Simplify AT_CHECK_JAVA_GREP invocations:
871 tabulations are no longer generated.
872
873 2008-11-11 Paolo Bonzini <bonzini@gnu.org>
874
875 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
876 * configure.ac: Adjust usage.
877 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
878 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
879 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
880
881 2008-11-10 Di-an Jan <dianj@freeshell.org>
882
883 Workaround Java's ``code too large'' problem for parser tables
884 in most cases, by using one function per initialization.
885 * data/java.m4 (b4_typed_parser_table, b4_integral_parser_table): New.
886 * data/lalr1.java (yypact_, yydefact_, yypgoto_, yydefgoto_,
887 yytable_, yycheck_, yystos_, yytoken_number_, yyr1_, yyr2_, yyrhs_
888 yyprhs_, yyrline_, yytranslate_table_): Use b4_integral_parser_table.
889 (yytname_): Use b4_typed_parser_table.
890 * doc/bison.texinfo (Java Bison Interface): Add note on Java's
891 ``code too large'' error.
892
893 2008-11-10 Di-an Jan <dianj@freeshell.org>
894
895 * NEWS: Document them.
896
897 General Java skeleton improvements.
898 * configure.ac (gt_JAVACOMP): Request target of 1.4, which allows
899 using gcj < 4.3 in the testsuite, according to comments in
900 gnulib/m4/javacomp.m4.
901 * data/java.m4 (stype, parser_class_name, lex_throws, throws,
902 location_type, position_type): Remove extraneous brackets from
903 b4_percent_define_default.
904 (b4_lex_param, b4_parse_param): Remove extraneous brackets from
905 m4_define and m4_define_default.
906 * data/lalr1.java (b4_pre_prologue): Change to b4_user_post_prologue,
907 which marks the end of user code with appropriate syncline, like all
908 the other skeletons.
909 (b4_user_post_prologue): Add. Don't silently drop.
910 (yylex): Remove.
911 (parse): Inline yylex.
912 * doc/bison.texinfo (bisonVersion, bisonSkeleton): Document.
913 (%{...%}): Fix typo of %code imports.
914 * tests/java.at (AT_JAVA_COMPILE): Add "java" keyword.
915
916 Support annotations on parser class with %define annotations.
917 * data/lalr1.java (annotations): Add to parser class modifier.
918 * doc/bison.texinfo (Java Parser Interface): Document
919 %define annotations.
920 (Java Declarations Summary): Document %define annotations.
921 * tests/java.at (Java parser class modifiers): Test annotations.
922
923 Do not generate code for %error-verbose unless requested.
924 * data/lalr1.java (errorVerbose): Rename to yyErrorVerbose.
925 Make private. Make conditional on %error-verbose.
926 (getErrorVerbose, setErrorVerbose): New.
927 (yytnamerr_): Make conditional on %error-verbose.
928 (yysyntax_error): Make some code conditional on %error-verbose.
929 * doc/bison.texinfo (Java Bison Interface): Remove the parts
930 about %error-verbose having no effect.
931 (getErrorVerbose, setErrorVerbose): Document.
932
933 Move constants for token names to Lexer interface.
934 * data/lalr1.java (Lexer): Move EOF, b4_token_enums(b4_tokens) here.
935 * data/java.m4 (b4_token_enum): Indent for move to Lexer interface.
936 (parse): Qualify EOF to Lexer.EOF.
937 * doc/bison.texinfo (Java Parser Interface): Move documentation of
938 EOF and token names to Java Lexer Interface.
939 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove Calc qualifier.
940
941 Make yyerror public.
942 * data/lalr1.java (Lexer.yyerror): Use longer parameter name.
943 (yyerror): Change to public. Add Javadoc comments. Use longer
944 parameter names. Make the body rather than the declarator
945 conditional on %locations.
946 * doc/bison.texinfo (yyerror): Document. Don't mark as protected.
947
948 Allow user to add code to the constructor with %code init.
949 * data/java.m4 (b4_init_throws): New, for %define init_throws.
950 * data/lalr1.java (YYParser.YYParser): Add b4_init_throws.
951 Add %code init to the front of the constructor body.
952 * doc/bison.texinfo (YYParser.YYParser): Document %code init
953 and %define init_throws.
954 (Java Declarations Summary): Document %code init and
955 %define init_throws.
956 * tests/java.at (Java %parse-param and %lex-param): Adjust grep.
957 (Java constructor init and init_throws): Add tests.
958
959 2008-11-10 Akim Demaille <demaille@gostai.com>
960
961 Update TODO.
962 * TODO (-D): is implemented.
963 (associativity): Same precedence must have the same associativity.
964 For instance, how can a * b / c be parsed if * is %left and / is
965 %right?
966 (YYERRORCODE, YYFAIL, YYBACKUP): New.
967
968 2008-11-10 Akim Demaille <demaille@gostai.com>
969
970 Formatting changes.
971
972 2008-11-10 Akim Demaille <demaille@gostai.com>
973
974 More information about the symbols.
975 * src/output.c (type_names_output): Document all the symbols,
976 including those that don't have a type-name.
977 (symbol_definitions_output): Define "is_token" and
978 "has_type_name".
979 * data/lalr1.cc (b4_type_action_): Skip symbols that have an empty
980 type-name, now that they are defined too in b4_type_names.
981
982 2008-11-10 Akim Demaille <demaille@gostai.com>
983
984 Regen.
985
986 2008-11-10 Akim Demaille <demaille@gostai.com>
987
988 Make parser::yytranslate static.
989 Small speedup (1%) on the list grammar. And makes yytranslate_
990 available in non member functions.
991
992 * data/lalr1.cc (yytranslate_): Does not need to be a instance
993 function.
994
995 2008-11-10 Akim Demaille <demaille@gostai.com>
996
997 Avoid trailing spaces.
998 * data/c.m4: b4_comment(TEXT): Don't indent empty lines.
999 * data/lalr1.cc: Don't indent before rule and symbol actions, as
1000 they can be empty, and anyway this incorrectly indents the first
1001 action.
1002
1003 2008-11-10 Akim Demaille <demaille@gostai.com>
1004
1005 Comment changes.
1006
1007 2008-11-10 Akim Demaille <demaille@gostai.com>
1008
1009 Use "enum" for integral constants.
1010 This is just nicer to read, I observed no speedup.
1011
1012 * data/lalr1.cc (yyeof_, yylast_, yynnts_, yyempty_, yyfinal_)
1013 (yterror_, yyerrcode_, yyntokens_): Define as members of an enum.
1014 (yyuser_token_number_max_, yyundef_token_): Move into...
1015 (yytranslate_): here.
1016
1017 2008-11-10 Akim Demaille <demaille@gostai.com>
1018
1019 Shortcuts in bench directives.
1020 * etc/bench.pl.in (parse_dirs): New.
1021 Use it.
1022 (bench_variant_parser, bench_fusion_parser): Use %s and %d.
1023 Create the benches in "benches/".
1024
1025 2008-11-10 Akim Demaille <demaille@gostai.com>
1026
1027 Formatting changes.
1028 * data/lalr1.cc: here.
1029
1030 2008-11-10 Akim Demaille <demaille@gostai.com>
1031
1032 Adjust verbose message to using emacs.
1033 * etc/bench.pl.in: Inform compilation-mode when we change the
1034 directory.
1035 (generate_grammar_list): Recognize %define "variant" in addition
1036 to %define variant.
1037
1038 2008-11-10 Akim Demaille <demaille@gostai.com>
1039
1040 Classify symbols by type-name.
1041 * src/uniqstr.h (UNIQSTR_CMP): New.
1042 * src/output.c (symbol_type_name_cmp, symbols_by_type_name)
1043 (type_names_output): New.
1044 (muscles_output): Use it.
1045 * data/lalr1.cc (b4_symbol_action_): Remove.
1046 (b4_symbol_case_, b4_type_action_): New.
1047 Adjust uses of b4_symbol_action_ to use b4_type_action_.
1048
1049 2008-11-10 Akim Demaille <demaille@gostai.com>
1050
1051 Change the handling of the symbols in the skeletons.
1052 Before we were using tables which lines were the symbols and which
1053 columns were things like number, tag, type-name etc. It is was
1054 difficult to extend: each time a column was added, all the numbers had
1055 to be updated (you asked for colon $2, not for "tag"). Also, it was
1056 hard to filter these tables when only a subset of the symbols (say the
1057 tokens, or the nterms, or the tokens that have and external number
1058 *and* a type-name) was of interest.
1059
1060 Now instead of monolithic tables, we define one macro per cell. For
1061 instance "b4_symbol(0, tag)" is a macro name which contents is
1062 self-decriptive. The macro "b4_symbol" provides easier access to
1063 these cells.
1064
1065 * src/output.c (type_names_output): Remove.
1066 (symbol_numbers_output, symbol_definitions_output): New.
1067 (muscles_output): Call them.
1068 (prepare_symbols): Define b4_symbols_number.
1069
1070 2008-11-10 Akim Demaille <demaille@gostai.com>
1071
1072 --trace=muscles
1073 * src/getargs.h, src/getargs.c (trace_muscle): New.
1074 (trace_types, trace_args): Support it.
1075 * src/output.c (output_skeleton): Use it.
1076
1077 2008-11-10 Akim Demaille <demaille@gostai.com>
1078
1079 muscles_output.
1080 * src/output.c (muscles_output): New, extracted from...
1081 (output_skeleton): here.
1082 Adjust.
1083
1084 2008-11-10 Akim Demaille <demaille@gostai.com>
1085
1086 Formatting changes.
1087
1088 2008-11-10 Akim Demaille <demaille@gostai.com>
1089
1090 Update the variant example.
1091 * examples/variant.yy: Formatting changes.
1092 One stage build.
1093
1094 2008-11-10 Akim Demaille <demaille@gostai.com>
1095
1096 Support constructor with an argument.
1097 This improves the "list" bench by 2%.
1098
1099 * data/lalr1.cc (variant::build): Add an overloaded version with
1100 an argument.
1101 * tests/c++.at (AT_CHECK_VARIANT): Check it.
1102
1103 2008-11-10 Akim Demaille <demaille@gostai.com>
1104
1105 Test variants.
1106 * tests/c++.at (AT_CHECK_VARIANTS): New.
1107 Use it with and without %define assert.
1108
1109 2008-11-10 Akim Demaille <demaille@gostai.com>
1110
1111 Add %precedence support.
1112 Unfortunately it is not possible to reuse the %prec directive. This
1113 is because to please POSIX, we do not require to end the rules with a
1114 semicolon. As a result,
1115
1116 foo: bar %prec baz
1117
1118 is ambiguous: either a rule which precedence is that of baz, or a rule,
1119 and then a declaration of the precedence of the token baz.
1120
1121 * doc/bison.texinfo: Document %precedence.
1122 (Precedence Only): New.
1123 * src/assoc.h, src/assoc.c (precedence_assoc): New.
1124 * src/conflicts.c (resolve_sr_conflict): Support it.
1125 * src/scan-gram.l, src/parse-gram.y (%precedence): New token.
1126 Parse it.
1127 * tests/calc.at: Use %precedence for NEG.
1128 * tests/conflicts.at (%precedence does not suffice)
1129 (%precedence suffices): New tests.
1130
1131 2008-11-09 Akim Demaille <demaille@gostai.com>
1132
1133 Make benches in a sub dirs.
1134 * etc/bench.pl.in ($dir): New.
1135 Use it.
1136 Check the use of constructors with an argument.
1137 (bench_variant_parser): Fix.
1138
1139 2008-11-09 Akim Demaille <demaille@gostai.com>
1140
1141 fix eof condition
1142
1143 2008-11-09 Akim Demaille <demaille@gostai.com>
1144
1145 Fix --help.
1146
1147 2008-11-09 Akim Demaille <demaille@gostai.com>
1148
1149 Require the generation of parse-gram.output.
1150 * src/Makefile.am (YACC): Pass --report=all.
1151
1152 2008-11-09 Akim Demaille <demaille@gostai.com>
1153
1154 Formatting changes.
1155
1156 2008-11-09 Akim Demaille <demaille@gostai.com>
1157
1158 Update TODO.
1159 * TODO: Remove obsolete items.
1160 Update others.
1161
1162 2008-11-09 Akim Demaille <demaille@gostai.com>
1163
1164 Enhance bench.pl.
1165 * etc/bench.pl.in (parse, parse_expr, parse_term, parse_fact)
1166 (@token, $grammar, $bench): New.
1167 (generate_grammar_variant): Rename as...
1168 (generate_grammar_list): this.
1169 (generate_grammar): Adjust.
1170 (bench_grammar): Rename as...
1171 (bench): this.
1172 Use it in the various bench-marking routines.
1173 (-b, -g): New options.
1174
1175 2008-11-09 Akim Demaille <demaille@gostai.com>
1176
1177 Use a static hierarchy for symbols in the C++ parser.
1178 * data/lalr1.cc (symbol_base_type, symbol_type)
1179 (stack_symbol_type): Make it a static hierarchy.
1180 Adjust dependencies.
1181
1182 2008-11-09 Akim Demaille <demaille@gostai.com>
1183
1184 bench.pl -d, --directive.
1185 * etc/bench.pl.in (@directive): New.
1186 (&bench_grammar): Use it.
1187 (&bench_list_grammar): New, to provide access to the "variant"
1188 grammar.
1189 Use it.
1190 (getopts): Support -d, --directive.
1191
1192 2008-11-09 Akim Demaille <demaille@gostai.com>
1193
1194 Use inline for small operations.
1195 * data/lalr1.cc (symbol_base_type, symbol_type)
1196 (stack_symbol_type): Declare constructor and other operations as
1197 inline.
1198 (yy_destroy_): Inline.
1199
1200 2008-11-09 Akim Demaille <demaille@gostai.com>
1201
1202 Introduce a hierarchy for symbols.
1203 * data/lalr1.cc (symbol_base_type, symbol_type): New.
1204 (data_type): Rename as...
1205 (stack_symbol_type): this.
1206 Derive from symbol_base_type.
1207 (yy_symbol_value_print_): Merge into...
1208 (yy_symbol_print_): this.
1209 Rename as...
1210 (yy_print_): this.
1211 (yydestruct_): Rename as...
1212 (yy_destroy_): this.
1213 (b4_symbols_actions, YY_SYMBOL_PRINT): Adjust.
1214 (parser::parse): yyla is now of symbol_type.
1215 Use its type member instead of yytoken.
1216
1217 2008-11-09 Akim Demaille <demaille@gostai.com>
1218
1219 Rename data_type and stack_symbol_type.
1220 * data/lalr1.cc (data_type): Rename as...
1221 (stack_symbol_type): this.
1222
1223 2008-11-09 Akim Demaille <demaille@gostai.com>
1224
1225 Handle semantic value and location together.
1226 * data/lalr1.cc (b4_symbol_actions): Bounce $$ and @$ to
1227 yydata.value and yydata.location.
1228 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_)
1229 (YY_SYMBOL_PRINT): Now take semantic value and location as a
1230 single arg.
1231 Adjust all callers.
1232 (yydestruct_): New overload for a stack symbol.
1233
1234 2008-11-09 Akim Demaille <demaille@gostai.com>
1235
1236 Push a complete symbol, not connected parts.
1237 * data/lalr1.cc (yypush_): Take a data_type&, not disconnected
1238 state, value and location.
1239 Adjust callers.
1240
1241 2008-11-09 Akim Demaille <demaille@gostai.com>
1242
1243 Agregate yylval and yylloc.
1244 * data/lalr1.cc (parser::yylval, parser::yylloc): Replace by...
1245 (parser::yyla): this.
1246
1247 2008-11-09 Akim Demaille <demaille@gostai.com>
1248
1249 Rely on the state stack to display reduction traces.
1250 To display rhs symbols before a reduction, we used information
1251 about the rule reduced, which required the tables yyrhs and
1252 yyprhs. Now use rely only on the state stack to get the same
1253 information.
1254
1255 * data/lalr1.cc (b4_rhs_data, b4_rhs_state): New.
1256 Use them.
1257 (parser::yyrhs_, parser::yyprhs_): Remove.
1258 (parser::yy_reduce_print_): Use the state stack.
1259
1260 2008-11-09 Akim Demaille <demaille@gostai.com>
1261
1262 Fuse yyval and yyloc into yylhs.
1263 * data/lalr1.cc (b4_lhs_value, b4_lhs_location): Adjust to using
1264 yylhs.
1265 (parse): Replace yyval and yyloc with yylhs.value and
1266 yylhs.location.
1267 After a user action, compute yylhs.state earlier.
1268 (yyerrlab1): Do not play tricks with yylhs.location, rather, use a
1269 fresh error_token.
1270
1271 2008-11-09 Di-an Jan <dianj@freeshell.org>
1272
1273 Remove unused variable.
1274 * src/output.c (type_names_output): Remove unused variable sep.
1275
1276 2008-11-09 Paolo Bonzini <bonzini@gnu.org>
1277
1278 Change tests/output.at quoting.
1279 * tests/output.at (AT_CHECK_OUTPUT): Use conventional m4 quoting when
1280 expanding arguments.
1281
1282 2008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
1283
1284 Don't add a semicolon to actions for %skeleton or %language.
1285 It breaks Java test cases as reported by Akim Demaille.
1286 * src/scan-code.l: Implement.
1287
1288 2008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
1289
1290 Clean up %skeleton and %language priority implementation.
1291 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
1292 remove static qualifier because others will soon need to see it.
1293 (language_prio): Likewise.
1294 (getargs): Use command_line_prio rather than 0.
1295 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
1296 enum fields.
1297 (skeleton_prio): Extern it.
1298 (language_prio): Extern it.
1299 * src/parse-gram.y: Use grammar_prio rather than 1.
1300
1301 2008-11-07 Akim Demaille <demaille@gostai.com>
1302
1303 Moving push traces into yypush_.
1304 * data/lalr1.cc (yypush_): Now takes a optional trace message.
1305 Adjust all uses.
1306
1307 2008-11-07 Akim Demaille <demaille@gostai.com>
1308
1309 The single-stack C++ parser is now the standard one.
1310 * data/lalr1.cc: Rename as...
1311 * data/lalr1-split.cc: this.
1312 * data/lalr1-fusion.cc: Rename as...
1313 * data/lalr1.cc: this.
1314 * etc/bench.pl.in: Adjust.
1315
1316 2008-11-07 Akim Demaille <demaille@gostai.com>
1317
1318 Avoid empty-if warnings.
1319 Reported by Quentin Hocquet.
1320
1321 * data/lalr1-fusion.cc (YY_SYMBOL_PRINT, YY_REDUCE_PRINT)
1322 (YY_STACK_PRINT): Provide some contents even when !YYDEBUG.
1323
1324 2008-11-07 Akim Demaille <demaille@gostai.com>
1325
1326 Pass command line location to skeleton_arg and language_argmatch.
1327 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
1328 The location argument is now mandatory.
1329 Adjust all dependencies.
1330 (getargs): Use command_line_location.
1331
1332 2008-11-07 Akim Demaille <demaille@gostai.com>
1333
1334 -D, --define.
1335 * src/getargs.c (usage): Document -D.
1336 Fix help string for --locations.
1337 (command_line_location): New.
1338 (short_options, long_options, getargs): Support -D, --define.
1339 (getargs): Move -d support at the right place.
1340 * doc/bison.texinfo (Bison Options): Update.
1341 * tests/input.at (%define, --define): New.
1342
1343 2008-11-07 Akim Demaille <demaille@gostai.com>
1344
1345 Initialize the muscle table before parsing the command line.
1346 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
1347 (getargs): Define file_name.
1348 * src/main.c (main): Initialize muscle_tab before calling
1349 getargs.
1350 * src/muscle_tab.c (muscle_init): No longer define file_name, as
1351 its value is not available yet.
1352
1353 2008-11-07 Akim Demaille <demaille@gostai.com>
1354
1355 Locations without columns for command line arguments.
1356 * src/location.c (location_print): Don't display negative columns.
1357 * src/location.h: Document this.
1358
1359 2008-11-07 Akim Demaille <demaille@gostai.com>
1360
1361 Fix --help.
1362 * src/getargs.c (usage): Fix help string for -W.
1363
1364 2008-11-07 Akim Demaille <demaille@gostai.com>
1365
1366 Handle more general types of option arguments.
1367 * build-aux/cross-options.pl: The argument ends at the first
1368 space, not the first non-symbol character.
1369 Use @var for each word appearing the argument description.
1370
1371 2008-11-07 Akim Demaille <demaille@gostai.com>
1372
1373 Destroy the variants that remain on the stack in case of error.
1374 * data/lalr1-fusion.cc (yydestruct_): Invoke the variant's
1375 destructor.
1376 Display the value only if yymsg is nonnull.
1377 (yyreduce): Invoke yydestruct_ when popping lhs symbols.
1378
1379 2008-11-07 Akim Demaille <demaille@gostai.com>
1380
1381 Add "%define assert" to variants.
1382 This is used to help the user catch cases where some value gets
1383 ovewritten by a new one. This should not happen, as this will
1384 probably leak.
1385
1386 Unfortunately this uncovered a bug in the C++ parser itself: the
1387 lookahead value was not destroyed between two calls to yylex. For
1388 instance if the previous lookahead was a std::string, and then an int,
1389 then the value of the std::string was correctly taken (i.e., the
1390 lookahead was now an empty string), but std::string structure itself
1391 was not reclaimed.
1392
1393 This is now done in variant::build(other&) (which is used to take the
1394 value of the lookahead): other is not only stolen from its value, it
1395 is also destroyed. This incurs a new performance penalty of a few
1396 percent, and union becomes faster again.
1397
1398 * data/lalr1-fusion.cc (variant::build(other&)): Destroy other.
1399 (b4_variant_if): New.
1400 (variant::built): New.
1401 Use it whereever the status of the variant changes.
1402 * etc/bench.pl.in: Check the penalty of %define assert.
1403
1404 2008-11-07 Akim Demaille <demaille@gostai.com>
1405
1406 Use "%define variant" in bench.pl.
1407 * etc/bench.pl.in: No longer use the pseudo directive %variants,
1408 just use %define variants.
1409
1410 2008-11-07 Akim Demaille <demaille@gostai.com>
1411
1412 Regen.
1413 * src/parse-gram.h, src/parse-gram.c: Regen.
1414
1415 2008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
1416
1417 Fix user actions without a trailing semicolon.
1418 Reported by Sergei Steshenko at
1419 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
1420 * THANKS (Sergei Steshenko): Add.
1421 * src/scan-code.l (SC_RULE_ACTION): Fix it.
1422 * tests/regression.at (Fix user actions without a trailing semicolon):
1423 New test case.
1424
1425 2008-11-04 Akim Demaille <demaille@gostai.com>
1426
1427 Use b4_copyright_years.
1428 * data/yacc.c (b4_copyright_years): New.
1429 Fix its value according to the comments in the file.
1430 Use it and undefine it.
1431
1432 2008-11-04 Akim Demaille <demaille@gostai.com>
1433
1434 Formatting changes.
1435 * data/lalr1-fusion.cc, src/parse-gram.y: here.
1436
1437 2008-11-04 Akim Demaille <demaille@gostai.com>
1438
1439 Formatting changes.
1440 * data/lalr1-fusion.cc: here.
1441
1442 2008-11-04 Akim Demaille <demaille@gostai.com>
1443
1444 Use strict on bench.pl.
1445 * etc/bench.pl.in (&run, &generate_grammar): New.
1446 Rename the grammar generating functions for consistency.
1447 Change the interface so that the list of benches to run is passed
1448 as (optionless) arguments.
1449 (&compile): Use &run.
1450
1451 2008-11-04 Akim Demaille <demaille@gostai.com>
1452
1453 Remove spurious initial empty lines.
1454 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
1455 * data/yacc.c: End the @output lines with an @.
1456
1457 2008-11-04 Akim Demaille <demaille@gostai.com>
1458
1459 Improve the display of sizes.
1460 * etc/bench.p.in: Higher precision.
1461 Sort by decreasing size.
1462
1463 2008-11-04 Akim Demaille <demaille@gostai.com>
1464
1465 Don't memcpy C++ structures.
1466 * data/lalr1-fusion.cc (b4_symbol_variant): Adjust additional
1467 arguments.
1468 (variant::build): New overload for
1469 copy-construction-that-destroys.
1470 (variant::swap): New.
1471 (parser::yypush_): Use it in variant mode.
1472
1473 2008-11-04 Akim Demaille <demaille@gostai.com>
1474
1475 Better defaults for bench.pl.
1476 * etc/bench.pl.in ($verbose, $cflags, $iterations): Change the
1477 default values.
1478 Adjust &verbose uses.
1479 (-q, --quiet): New.
1480
1481 2008-11-04 Akim Demaille <demaille@gostai.com>
1482
1483 Make variant.yy more complex.
1484 std::list cannot be copied via memcpy, they are more demanding than
1485 std::string. Use one std::list to strengthen the test.
1486
1487 * examples/variant.yy: Use lalr1-fusion.cc, not lalr1.cc.
1488 Adjust.
1489 Create a list of strings, instead of a single large string.
1490
1491 2008-11-04 Akim Demaille <demaille@gostai.com>
1492
1493 bench.pl --bench.
1494 * etc/bench.pl.in (--bench, $bench): New.
1495
1496 2008-11-04 Akim Demaille <demaille@gostai.com>
1497
1498 Sort methods.
1499 * data/lalr1-fusion.cc (destroy): Use as() in its definition.
1500 Define it after as().
1501
1502 2008-11-04 Akim Demaille <demaille@gostai.com>
1503
1504 Useless parens.
1505 * data/lalr1-fusion.cc (b4_rhs_location): Remove useless parens.
1506
1507 2008-11-04 Akim Demaille <demaille@gostai.com>
1508
1509 Issue missing synclines after user actions.
1510 * data/c.m4 (b4_case): Issue synclines on the output file.
1511
1512 2008-11-04 Akim Demaille <demaille@gostai.com>
1513
1514 Remove trailing empty line.
1515 * data/lalr1-fusion.cc: Don't add an empty line after the user's
1516 epilogue.
1517
1518 2008-11-04 Akim Demaille <demaille@gostai.com>
1519
1520 Fix output of copyright years.
1521 * data/bison.m4 (b4_copyright): Fix the indentation of the
1522 copyright year paragraph.
1523 Use b4_copyright_years when no years are given.
1524 * data/lalr1.cc, data/lalr1-fusion.cc, data/location.cc
1525 (b4_copyright_years): New.
1526 Use it.
1527
1528 2008-11-04 Akim Demaille <demaille@gostai.com>
1529
1530 Avoid the spurious initial empty line.
1531 * data/lalr1-fusion.cc, data/location.cc: Put a trailing "@" at
1532 the end of @output request to suppress the empty line that
1533 results.
1534
1535 2008-11-04 Akim Demaille <demaille@gostai.com>
1536
1537 Remove parser::rhs_number_type.
1538 * data/lalr1-fusion.cc (rhs_number_type): No longer define it.
1539 (yyrhs_): Use b4_table_define.
1540
1541 2008-11-04 Akim Demaille <demaille@gostai.com>
1542
1543 Fix iteration type.
1544 * data/lalr1-fusion.cc: Use an int to iterate up to an int.
1545
1546 2008-11-04 Akim Demaille <demaille@gostai.com>
1547
1548 Factor the declaration of the integer tables.
1549 * data/lalr1-fusion.cc (b4_table_define): New.
1550 Use it.
1551
1552 2008-11-03 Akim Demaille <demaille@gostai.com>
1553
1554 Fix indentation of tables in lalr1.cc
1555 * data/lalr1-fusion.cc: Fix the indentation.
1556
1557 2008-11-03 Akim Demaille <demaille@gostai.com>
1558
1559 Destroy the lhs symbols after reduction.
1560 * data/lalr1-fusion.cc (parse): After the user action, when in
1561 variant mode, destroy the lhs symbols.
1562
1563 2008-11-03 Akim Demaille <demaille@gostai.com>
1564
1565 Simplify yysyntax_error_ use.
1566 * data/lalr1-fusion.cc (yysyntax_error_): Always pass it the token
1567 type, but make it unnamed in the declaration when it is not used.
1568
1569 2008-11-03 Akim Demaille <demaille@gostai.com>
1570
1571 Let yy::variant::build return an lvalue.
1572 * data/lalr1-fusion.cc (variant::build): Return a reference to the
1573 object.
1574
1575 2008-11-03 Akim Demaille <demaille@gostai.com>
1576
1577 Define yy::variant only when needed.
1578 * data/lalr1-fusion.cc (yy::variant): Define only if variants are
1579 used.
1580
1581 2008-11-03 Akim Demaille <demaille@gostai.com>
1582
1583 Bench the three-stack lalr1.cc.
1584 * etc/bench.pl.in: Bench the three-stack lalr1.cc vs. the
1585 one-stack one.
1586
1587 2008-11-03 Akim Demaille <demaille@gostai.com>
1588
1589 Fail on parse error in calc++.
1590 * doc/bison.texinfo (calc++.cc): Propagate failures to the exit
1591 status.
1592 * examples/calc++/test ($me, $number, $exit, run): New.
1593 Use them to propagate errors to the exit status.
1594
1595 2008-11-03 Akim Demaille <demaille@gostai.com>
1596
1597 Don't specify the skeleton twice in the example.
1598 * examples/calc++/Makefile.am: Don't pass -S to Bison, the grammar
1599 file does what is needed.
1600
1601 2008-11-03 Akim Demaille <demaille@gostai.com>
1602
1603 bench: Improve output.
1604 * etc/bench.pl.in (bench_grammar): Tune the printf format.
1605
1606 2008-11-03 Akim Demaille <demaille@gostai.com>
1607
1608 bench: check impact of %debug on variants.
1609 * etc/bench.pl.in (variant_grammar): Fix the computation of
1610 $variant.
1611 Generate a grammar file that can work with or without %debug.
1612 Do use the @directive.
1613 (bench_variant_parser): Check impact of %debug.
1614 (@directives): Rename all the occurrences to...
1615 (@directive): this, for consistency.
1616
1617 2008-11-03 Akim Demaille <demaille@gostai.com>
1618
1619 bench: report the size too.
1620 * etc/bench.pl.in ($iterations): Defaults to -3.
1621 (&bench_grammar): Require hireswallclock.
1622 Compute and display the size of the result.
1623 More comments.
1624
1625 2008-11-03 Akim Demaille <demaille@gostai.com>
1626
1627 bench: More use of the verbosity level.
1628 * etc/bench.pl.in ($verbose, &verbose): New.
1629 Use them.
1630 More POD documentation.
1631
1632 2008-11-03 Akim Demaille <demaille@gostai.com>
1633
1634 bench.pl: a command line interface
1635 * etc/bench.pl.in: More doc.
1636 Some fixes in the documentation.
1637 ($cflags, $iterations, &help, &getopt): New.
1638 Use them.
1639 (&variant_grammar): Let the number of stages be 10 times what is
1640 specified.
1641
1642 2008-11-03 Akim Demaille <demaille@gostai.com>
1643
1644 Bench the use of Boost.Variants.
1645 * etc/bench.pl.in ($cxx, &variant_grammar, &bench_variant_parser):
1646 New.
1647 (&compile): Be ready to compile C++ parsers.
1648 (&bench_push_parser): Move debug information to the outermost
1649 level.
1650 * THANKS: Add Michiel De Wilde.
1651
1652 2008-11-03 Akim Demaille <demaille@gostai.com>
1653
1654 bench.pl: Pass directives as a list instead of as a string.
1655 * etc/bench.pl.in (&directives): New.
1656 (&triangular_grammar, &calc_grammar): Use it to format the Bison
1657 directives.
1658 (&triangular_grammar): Do use the directives (were ignored).
1659 (&bench_grammar, &bench_push_parser): Adjust to pass lists of
1660 directives.
1661
1662 2008-11-03 Akim Demaille <demaille@gostai.com>
1663
1664 Improve genericity of bench.pl.
1665 * etc/bench.pl.in (&bench_grammar): Take the set of benches as
1666 argument.
1667 (&bench_push_parser): New.
1668 Call it.
1669
1670 2008-11-03 Akim Demaille <demaille@gostai.com>
1671
1672 Add documentation to bench.pl.
1673 * etc/bench.pl.in: Comment changes.
1674
1675 2008-11-03 Akim Demaille <demaille@gostai.com>
1676
1677 Fuse the three stacks into a single one.
1678
1679 In order to make it easy to perform benchmarks to ensure that
1680 there are no performance loss, lalr1.cc is forked into
1681 lalr1-fusion.cc. Eventually, lalr1-fusion.cc will replace
1682 lalr1.cc.
1683
1684 Meanwhile, to make sure that lalr1-fusion.cc is correctly
1685 exercized by the test suite, the user must install a symbolic link
1686 from lalr1.cc to it.
1687
1688 Instead of having three stacks (state, value, location), use a
1689 stack of triples. This considerably simplifies the code (and it
1690 will be easier not to require locations as currently does the C++
1691 parser), and also gives a 10% speedup according to
1692 etc/bench (probably mainly since memory allocation is done once
1693 instead of three times).
1694
1695 Another motivation is to make it easier to destruct properly
1696 semantic values: now that they are bound to their state (hence
1697 symbol type) it will be easier to call the appropriate destructor.
1698
1699 These changes should probably benefit the C parser too.
1700
1701 * data/lalr1.cc: Copy as...
1702 * data/lalr1-fusion.cc: this new file.
1703 (b4_rhs_value, b4_rhs_location): New definitions overriding those
1704 from c++.m4.
1705 (state_stack_type, semantic_stack_type, location_stack_type)
1706 (yystate_stack_, yysemantic_stack_, yylocation_stack_): Remove.
1707 (data_type, stack_type, yystack_): New.
1708 (YYLLOC_DEFAULT, yypush_): Adjust.
1709 (yyerror_range): Now based on data_type, not location_type.
1710
1711 2008-11-03 Akim Demaille <demaille@gostai.com>
1712
1713 Push the state, value, and location at the same time.
1714 This is needed to prepare a forthcoming patch that fuses the three
1715 stacks into one.
1716
1717 * data/lalr1.cc (parser::yypush_): New.
1718 (parser::yynewstate): Change the semantics: instead of arriving to
1719 this label when value and location have been pushed, but yystate
1720 is to be pushed on the state stack, now the three of them must
1721 have been pushed before. yystate still must be the new state.
1722 This allows to use yypush_ everywhere instead of individual
1723 handling of the stacks.
1724
1725 2008-11-03 Akim Demaille <demaille@gostai.com>
1726
1727 Prefer references to pointers.
1728 * data/lalr1.cc (b4_symbol_actions): New, overrides the default C
1729 definition to use references instead of pointers.
1730 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_):
1731 Take the value and location as references.
1732 Adjust callers.
1733
1734 2008-11-03 Akim Demaille <demaille@gostai.com>
1735
1736 stack::size instead of stack::height.
1737 * data/lalr1.cc (stack::height): Rename as...
1738 (stack::size): this.
1739 Fix the output type.
1740 Comment changes.
1741
1742 2008-11-03 Akim Demaille <demaille@gostai.com>
1743
1744 Use variants to support objects as semantic values.
1745 This patch was inspired by work by Michiel De Wilde. But he used
1746 Boost variants which (i) requires Boost on the user side, (ii) is
1747 slow, and (iii) has useless overhead (the parser knows the type of
1748 the semantic value there is no reason to duplicate this
1749 information as Boost.Variants do).
1750
1751 This implementation reserves a buffer large enough to store the
1752 largest objects. yy::variant implements this buffer. It was
1753 implemented with Quentin Hocquet.
1754
1755 * src/output.c (type_names_output): New.
1756 (output_skeleton): Invoke it.
1757 * data/c++.m4 (b4_variant_if): New.
1758 (b4_symbol_value): If needed, provide a definition for variants.
1759 * data/lalr1.cc (b4_symbol_value, b4_symbol_action_)
1760 (b4_symbol_variant, _b4_char_sizeof_counter, _b4_char_sizeof_dummy)
1761 (b4_char_sizeof, yy::variant): New.
1762 (parser::parse): If variants are requested, define
1763 parser::union_type, parser::variant, change the definition of
1764 semantic_type, construct $$ before running the user action instead
1765 of performing a default $$ = $1.
1766 * examples/variant.yy: New.
1767 Based on an example by Michiel De Wilde.
1768
1769 2008-11-03 Akim Demaille <demaille@gostai.com>
1770
1771 Parameterize the extraction of semantic values.
1772 To make future changes easier, no longer rely on ".TYPE" being the
1773 way to get a semantic value.
1774
1775 * data/c.m4 (b4_symbol_value): New.
1776 Use it.
1777 * data/c++.m4, data/yacc.c: Use it.
1778 * data/glr.c: Use b4_symbol_value.
1779 (b4_rhs_data): New.
1780 Use it.
1781
1782 2008-11-03 Akim Demaille <demaille@gostai.com>
1783
1784 Prepare easier M4 changes.
1785 * data/lalr1.cc: Use escaped [] instead of literals to prepare
1786 future changes.
1787
1788 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1789
1790 Initiate further development.
1791 * NEWS: Create an empty section for new entries.
1792 * gnulib: Update submodule to HEAD.
1793
1794 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1795
1796 * NEWS: Version 2.4.
1797
1798 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1799
1800 Prepare for next release.
1801 * NEWS: Briefly mention changes since 2.3b.
1802 * README: Say GNU m4 1.4.6, which we've been requiring in release
1803 announcements already, not 1.4.3, which breaks the build.
1804
1805 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1806
1807 Say %language is experimental.
1808 We're thinking of extending it's effect on output file naming. See the
1809 thread at
1810 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
1811 * NEWS: Say it's experimental.
1812 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
1813 recommend it over %skeleton for now.
1814 (Bison Options): Likewise.
1815 (C++ Bison Interface): Use %skeleton not %language.
1816 (Calc++ Parser): Use %skeleton not %language.
1817 * src/getargs.c (usage): Say it's experimental.
1818
1819 2008-11-01 Di-an Jan <dianj@freeshell.org>
1820 Paolo Bonzini <bonzini@gnu.org>
1821
1822 Support all Java parser class modifiers.
1823 * data/java.m4 (b4_percent_define_get3): New.
1824 (b4_final_if, b4_strictfp_if): New.
1825 * data/lalr1.java (final, strictfp, extends, implements): Support.
1826 * doc/bison.texinfo (final, strictfp, extends, implements): Add
1827 documentation.
1828 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
1829 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
1830 (AT_CHECK_JAVA_GREP): New.
1831 (Java parser class modifiers): New test.
1832 (Java parser class extends and implements): New test.
1833
1834 Model exception propagation better with throws and lex_throws.
1835 * data/java.m4 (b4_list2): New.
1836 (throws): Change default.
1837 * data/lalr1.java (yyaction): Add throws.
1838 (parse): Add lex_throws in addition to throws.
1839 * doc/bison.texinfo (throws, lex_throws): Add documentation.
1840 * tests/java.at (Java throws specifications): New test.
1841
1842 Improve documentation for Java parsers.
1843 * doc/bison.texinfo (Java Parsers): Add subsections.
1844 Don't quote first argument of %define.
1845 (Java Bison Interface): Document output files. Move documentation
1846 of parser class and merge into Java Parser Interface. Document
1847 features that error out. Document directives with no effect.
1848 Move note about Javadoc higher.
1849 (Java Semantic Values): Explicitly mention stype.
1850 Document that generic types cannot be used.
1851 (Java Location Values): Use @deftypeivar. Document constructors.
1852 Correct return value for toString.
1853 (Java Parser Interface): List undocumented constants/fields.
1854 Move documentation of fields added by %parse-param closer to list
1855 of members. Document that token names are added as fields.
1856 Document constructors accurately. Remove error method.
1857 (Java Scanner Interface): Move note on %pure-parser to Java Bison
1858 Interface. Describe %code lexer and yylex accutately.
1859 Remove documentation that does not match the code.
1860 (Java Action Features): New.
1861 (Java Differences): Add reference. Add item on semantic values.
1862 Add note about @{ ... @}. Clarify %% epilogue placement.
1863 (Java Declarations Summary): New.
1864
1865 Fix Java skeleton.
1866 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
1867 (b4_remove_comma): Quote test argument.
1868 (b4_identification): Remove "bison" field.
1869 * tests/java.at (Java parser class and package names): New test.
1870 (Java %parse-param and %lex-param): New test.
1871 (Java stype, position_class and location_class): New test.
1872
1873 2008-10-31 Di-an Jan <dianj@freeshell.org>
1874
1875 * data/lalr1.jave: Update copyright years.
1876 (YYParser): Correct name of "generated from" file in Javadoc:
1877 use b4_file_name instead of @ofile@.
1878 (Location constructor): Correct Javadoc parameter name.
1879 (yylloc): Add missing opening m4 quote after b4_location_if.
1880 This removes a stray [ in the Javadoc of Lexer.getStartPos.
1881 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
1882 (YYParser constructor): Correct Javadoc parameter name.
1883
1884 2008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
1885
1886 Always put auxiliary code files in the same dir as other output files.
1887 * src/files.c (compute_file_name_parts): When the user specifies
1888 --output but not --file-prefix, extract the directory prefix from the
1889 file prefix not from the grammar file name. This affects the location
1890 of files like location.hh generated by the C++ skeleton. The includes
1891 in the other output files require this fix.
1892 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
1893 for expected output files.
1894 (Output files): Add a test for the above.
1895
1896 2008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
1897
1898 * gnulib: Update submodule to HEAD.
1899
1900 2008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
1901
1902 Update copyright year.
1903 * src/files.c: Here.
1904
1905 2008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
1906
1907 Don't overwrite the input file.
1908 * src/files.c (output_file_name_check): Fatal error if using input file
1909 for output.
1910 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
1911 argument.
1912 (Conflicting output files): Add test.
1913
1914 2008-10-28 Akim Demaille <demaille@gostai.com>
1915
1916 Space changes.
1917 * data/lalr1.cc: Formatting changes.
1918
1919 2008-10-28 Akim Demaille <demaille@gostai.com>
1920
1921 Don't define debugging functions when !YYDEBUG.
1922 * data/lalr1.cc (debug_stream, set_debug_stream)
1923 (debug_level_type, debug_level, set_debug_level): Don't
1924 declare them when YYDEBUG is not defined.
1925 The implementation are already YYDEBUG-aware.
1926
1927 2008-10-28 Akim Demaille <demaille@gostai.com>
1928
1929 Prefer "continue" for empty loop bodies.
1930 * etc/bench.pl.in: Use "continue" instead of {}.
1931
1932 2008-10-28 Akim Demaille <demaille@gostai.com>
1933
1934 Space and comments changes.
1935 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
1936 * data/c.m4, data/lalr1.cc: Space changes.
1937
1938 2008-10-28 Akim Demaille <demaille@gostai.com>
1939
1940 Make gnulib a submodule.
1941 * gnulib: New.
1942 * .gitmodules (gnulib): New.
1943
1944 2008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
1945
1946 Fix yyerror_range for user-defined location type in C++. Reported by
1947 Georg Sauthoff at
1948 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
1949 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
1950 * THANKS (Georg Sauthoff): Add.
1951
1952 2008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
1953
1954 Update several administrative files mainly to facilitate releasing.
1955 * HACKING (Administrivia): Make the git-merge-changelog notes more
1956 helpful.
1957 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
1958 (Release Procedure): Update for git and add numerous details that were
1959 previously missing.
1960 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
1961 * maint.mk (announcement): Don't list bison as a bootstrap tool so
1962 that announcements don't claim we bootstrapped with whatever bison
1963 happened to be in PATH. Add flex as a bootstrap tool.
1964 * Makefile.maint: Remove, previously replaced by maint.mk.
1965 * Makefile.cfg: Remove, and migrate settings to...
1966 * cfg.mk: ... here for the sake of `make announcement'.
1967 * bootstrap.conf (gnulib_modules): Add announce-gen.
1968 * README: Say GNU Bison instead of just Bison. Suggested by Karl
1969 Berry.
1970
1971 2008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
1972
1973 Small but important bugfixes for the Java skeleton.
1974 * data/lalr1.java (yyerror): Change Location to b4_location_type.
1975 (yy_symbol_print): Call toString on yyvaluep.
1976
1977 2008-08-29 Akim Demaille <demaille@gostai.com>
1978
1979 Clarify UPDATED use.
1980 * doc/bison.texinfo: It refers to the last edition of this file,
1981 not to the release date of Bison.
1982 Reported by Joel E. Denny.
1983
1984 2008-08-29 Akim Demaille <demaille@gostai.com>
1985
1986 * README: Update FAQ pointer.
1987 Reported by Joel E. Denny.
1988
1989 2008-08-27 Eric Blake <ebb9@byu.net>
1990
1991 Resync m4sugar from autoconf.
1992 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
1993 (m4_init): Adjust to latest m4.git changes.
1994 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
1995 effects.
1996 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
1997 (_m4_list_cmp): Reduce side effects.
1998
1999 2008-08-27 Akim Demaille <demaille@gostai.com>
2000
2001 Check yyerrok in calc.at.
2002 * tests/calc.at (calc.y): Use yyerrok on "( error )".
2003 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
2004 expected.
2005
2006 2008-08-27 Akim Demaille <demaille@gostai.com>
2007
2008 Support yyerrok in lalr1.cc.
2009 YYBACKUP is still to import back into lalr1.cc.
2010 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
2011
2012 2008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
2013
2014 For maintainer-check*, don't recompile for a $(VERSION) update.
2015 * cfg.mk: New file.
2016 (_is-dist-target): Override the one in GNUmakefile.
2017 * Makefile.am (EXTRA_DIST): Add cfg.mk.
2018
2019 2008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
2020
2021 Update for recent change to gnulib.
2022 * src/parse-gram.y: Don't include strverscmp.h. It comes from
2023 string.h now.
2024
2025 2008-08-15 Eric Blake <ebb9@byu.net>
2026
2027 Remaining m4sugar merge from autoconf.
2028 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
2029 * data/m4sugar/foreach.m4: New file, copied from autoconf.
2030 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
2031 * src/output.c (output_skeleton): Tell m4 how to find it.
2032
2033 Partial m4sugar merge from autoconf: m4_map.
2034 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
2035 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
2036 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
2037 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
2038 for empty list.
2039 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
2040 Likewise.
2041 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
2042 declares it.
2043
2044 2008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
2045
2046 Keep .version and PACKAGE_VERSION in sync.
2047 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
2048 dependency, and add comments justifying this in more detail. Discussed
2049 starting at
2050 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
2051
2052 2008-08-06 Eric Blake <ebb9@byu.net>
2053
2054 Partial m4sugar merge from autoconf: m4_shiftn.
2055 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
2056 (m4_shift2, m4_shift3): New macros.
2057 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
2058 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
2059 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
2060 * data/java.m4 (b4_remove_comma): Likewise.
2061
2062 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
2063 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
2064 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
2065 (m4_init): Consolidate wrapped text into single m4_wrap.
2066 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
2067 in wrapped text.
2068
2069 2008-08-05 Eric Blake <ebb9@byu.net>
2070
2071 Partial m4sugar merge from autoconf: builtins, version.m4.
2072 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
2073 (m4_prepend): Remove, as it is unused and inherently quadratic,
2074 whereas m4_append is linear in newer m4.
2075 (m4_mkstemp): New builtin.
2076 (m4_symbols): Make rename conditional.
2077 (m4_version_prereq): Ensure fatal error if used in bison, which
2078 intentionally lacks version.m4.
2079
2080 Fix comments in m4sugar.
2081 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
2082
2083 2008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
2084
2085 Update for recent .gitignore fix in Gnulib.
2086 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
2087 anchored .gitignore entries.
2088
2089 2008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
2090
2091 Set gnu or gnits strictness.
2092 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
2093 development and gnits strictness for releases. Based on Eric Blake's
2094 suggestion at
2095 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
2096
2097 2008-07-31 Paolo Bonzini <bonzini@gnu.org>
2098
2099 * NEWS: Clarify documentation of %language.
2100
2101 2008-07-31 Paolo Bonzini <bonzini@gnu.org>
2102
2103 Support usage of git-merge-changelog.
2104 * .gitattributes: New.
2105 * HACKING: Document usage of git-merge-changelog.
2106 * bootstrap: Install git-merge-changelog entries in .git/config
2107 if appropriate.
2108
2109 2008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
2110
2111 Remove remaining dependence on CVS Id keyword.
2112 * ChangeLog: For the sake of people still using CVS, don't use dollars
2113 when mentioning Id.
2114 * data/xslt/bison.xsl: Remove Id from header comments, where it was
2115 unusual anyway.
2116 * data/xslt/xml2dot.xsl: Likewise.
2117 * data/xslt/xml2text.xsl: Likewise.
2118 * data/xslt/xml2xhtml.xsl: Likewise.
2119 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
2120 * doc/Makefile.am (neutralize): Remove, no longer needed.
2121 (.x.1): Don't use neutralize.
2122 (edit): Don't substitute for ID.
2123 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
2124
2125 2008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
2126
2127 Fix dependence on computed configure variables.
2128 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
2129 $(top_srcdir)/configure.ac so that changes to computed variables, such
2130 as PACKAGE_VERSION, are seen.
2131 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
2132
2133 2008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
2134
2135 Update copyright dates for recent changes.
2136 * Makefile.am: Here.
2137 * src/Makefile.am: Here.
2138 * src/reduce.c: Here.
2139 * tests/reduce.at: Here.
2140
2141 2008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
2142
2143 Use git-version-gen for version names between releases.
2144 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
2145 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
2146 * .prev-version: New.
2147 * .version.in: Remove.
2148 * ChangeLog: Remove the Id previously used for capturing the CVS
2149 revision.
2150 * GNUmakefile: Remove, now copied from Gnulib.
2151 * Makefile.am: Add code suggested by comments in
2152 build-aux/git-version-gen.
2153 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
2154 .prev-version, and .version.
2155 * NEWS (2.3b+): Rename to...
2156 (?.?): ... this because we're dropping the "+" version naming scheme,
2157 but, in general, we still can't be sure of our next release name.
2158 * bootstrap: Add a quick hack to remove from .gitignore the
2159 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
2160 entry. This should really be fixed in gnulib instead.
2161 * bootstrap.conf (gnulib_modules): Add gnumakefile.
2162 * configure.ac (AC_INIT): Set version name by invoking
2163 build-aux/git-version-gen.
2164 (AC_CONFIG_FILES): Remove .version, now generated by
2165 build-aux/git-version-gen.
2166 * maint.mk: New, copied from coreutils.
2167 * doc/.cvsignore (bison.1): Add.
2168 * doc/.gitignore (/bison.1): Add.
2169 * doc/bison.1: Remove, generated.
2170 * src/.cvsignore (revision.c): Remove.
2171 * src/.gitignore (/revision.c): Remove.
2172 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
2173 (BUILT_SOURCES): Remove revision.c.
2174 (revision.c): Remove.
2175 * src/getargs.c (version): Don't print revision after the VERSION.
2176 * src/revision.h: Remove.
2177
2178 2008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
2179
2180 Fix untranslatable composition of sentences. Reported by Goran
2181 Uddeborg at
2182 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
2183 * THANKS (Goran Uddeborg): Add.
2184 * src/reduce.c (reduce_print): Report the number of nonterminals and
2185 rules useless in the grammar in separate sentences.
2186 * tests/reduce.at (Useless Rules): Update output.
2187 (Reduced Automaton): Likewise.
2188 (Underivable Rules): Likewise.
2189 (Empty Language): Likewise.
2190
2191 2008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
2192
2193 Fix some .gitignore and .cvsignore problems.
2194 * bootstrap (insert_sorted_if_absent): Replace all uses with...
2195 (insert_vc_ignore): ... this new function, which prepends `/' to all
2196 .gitignore entries before passing them to insert_sorted_if_absent.
2197 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
2198 .cvsignore files are maintained even though Bison developers run
2199 bootstrap while using Git.
2200 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
2201 unneeded by Bison.
2202 (gnulib): Add.
2203 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
2204 unneeded. Reported by Eric Blake.
2205 * lib/.gitignore (/*~): Add.
2206 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
2207 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
2208 Blake.
2209 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
2210
2211 2008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
2212
2213 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
2214 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
2215 * bootstrap.conf (gnulib_modules): Add unsetenv.
2216 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
2217 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
2218 (/setenv.m4): Add.
2219 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
2220 the first argument because it may become position-dependent, and unset
2221 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
2222 Add comments explaining these issues in more detail.
2223
2224 2008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
2225
2226 Add .gitignore everywhere based on .cvsignore.
2227 * .gitignore: New.
2228 * build-aux/.gitignore: New.
2229 * data/.gitignore: New.
2230 * doc/.gitignore: New.
2231 * etc/.gitignore: New.
2232 * examples/.gitignore: New.
2233 * examples/calc++/.gitignore: New.
2234 * lib/.gitignore: New.
2235 * m4/.gitignore: New.
2236 * po/.gitignore: New.
2237 * runtime-po/.gitignore: New.
2238 * src/.gitignore: New.
2239 * tests/.gitignore: New.
2240
2241 2008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
2242
2243 * NEWS (2.3b+): New section, empty for now.
2244 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
2245
2246 2008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
2247
2248 * NEWS (2.3b): Update release date since there has been a delay in
2249 getting the announcements and tarballs out.
2250
2251 2008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
2252
2253 * NEWS: Version 2.3b.
2254 * configure.ac (AC_INIT): Likewise.
2255 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
2256
2257 2008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
2258
2259 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
2260 been doing it for years.
2261 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
2262 (Release Procedure): Add FIXME about make alpha being unmaintained.
2263
2264 2008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
2265
2266 * data/yacc.c: Reformat m4 a little for readability.
2267 * src/lalr.c (build_relations): Correct comment.
2268
2269 2008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2270
2271 DJGPP specific issue.
2272 * djgpp/config.sed: Fixes required to run configure scripts generated
2273 by autoconf 2.62.
2274
2275 2008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
2276
2277 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
2278 coordinator@translationproject.org.
2279
2280 2008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
2281
2282 * THANKS: Add Eric Blake.
2283
2284 2008-04-23 Eric Blake <ebb9@byu.net>
2285
2286 Revert prior patch, by working around autoconf regression.
2287 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
2288 ("Output file name: ("): Uncomment test.
2289 ("Output file name: )"): Likewise.
2290 Based on an idea from Noah Misch.
2291
2292 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2293
2294 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
2295 2.61. Reported by Juan Manuel Guerrero at
2296 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
2297 * tests/output.at ("Output file name: ("): Comment out test case for
2298 now.
2299 ("Output file name: )"): Likewise.
2300
2301 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2302
2303 * GNUmakefile: Update git-version-gen invocation so make dist
2304 succeeds.
2305
2306 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2307
2308 Update to the current gnulib CVS repository, and fix trigraph handling
2309 in Bison.
2310 * bootstrap: Update gnulib CVS repository URL.
2311 (symlink_to_dir): Encapsulate the code that guarantees the destination
2312 directory exists into...
2313 (check_dst_dir): ... this new function, and...
2314 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
2315 fail when copying files into lib/uniwidth/.
2316 * src/output.c (prepare_symbols): When writing yytname muscles, where
2317 symbol names will be encoded in C-string literals, tell quotearg to
2318 escape trigraphs. This used to be the default in gnulib.
2319 * tests/regression.at (Token definitions): Because of the change in
2320 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
2321 escapes trigraphs in symbol names. Thus, yytname no longer has
2322 trigraphs unnecessarily doubly escaped. Update test case output.
2323 Extend test case to be sure Bison's own error messages will no longer
2324 have trigraphs in symbol names unnecessarily escaped once.
2325
2326 2008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
2327
2328 Fix make dist infinite loop reported by Juan Manuel Guerrero at
2329 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
2330 * .cvsignore: Add .version.
2331 * .version.in: New.
2332 * bootstrap.conf (gnulib_modules): Add git-version-gen.
2333 * configure.ac (AC_CONFIG_FILES): Add .version.
2334 * build-aux/.cvsignore: Add git-version-gen.
2335
2336 2008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
2337
2338 * NEWS (2.3a+): Mention that -g now takes an argument.
2339 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
2340 consistency. Update the -g and -x entries now that they take
2341 arguments. Use brackets to indicate optional arguments.
2342 * src/getargs.c (usage): Explain the relationship between arguments of
2343 long and short options more completely. Document --defines and -d
2344 separately since the former takes an argument but, for POSIX Yacc, the
2345 latter does not.
2346 (short_options): Let -W take an optional argument like --warnings.
2347 (getargs): Sort cases.
2348
2349 2008-02-28 Akim Demaille <demaille@gostai.com>
2350
2351 * doc/bison.texinfo: Fix a few typos.
2352
2353 2008-02-28 Akim Demaille <akim@epita.fr>
2354
2355 * doc/bison.texinfo (Bison Options): Document -W.
2356 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
2357
2358 2008-02-28 Akim Demaille <akim@epita.fr>
2359
2360 * src/getargs.c (short_options): Split and sort for readability.
2361 -g and -x take optional arguments, just like their long options.
2362 * build-aux/cross-options.pl: Use /x to make the regexp easier to
2363 understand.
2364 Fix the handling of $opt which resulted in all the argument to be
2365 considered as optional.
2366
2367 2008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
2368
2369 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
2370 say its interface is experimental.
2371 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
2372 Java.
2373 (Bison Options): In the -L and --language entry, mention Java.
2374 (Java Bison Interface): Say the interface is experimental.
2375 * src/getargs.c (usage): Mention -L and --language.
2376
2377 * NEWS (2.3a+): Say the push parsing interface is experimental.
2378 * doc/bison.texinfo (Push Decl): Likewise.
2379 (Decl Summary): Likewise in the "%define api.push_pull" entry.
2380 (Push Parser Function): Likewise.
2381 (Pull Parser Function): Likewise.
2382 (Parser Create Function): Likewise.
2383 (Parser Delete Function): Likewise.
2384 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
2385 yypull_parse, and yypush_parse entries.
2386
2387 * NEWS (2.3a+): Mention XML support, and say the schema is
2388 experimental.
2389 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
2390 * src/getargs.c (usage): Say the XML schema is experimental.
2391
2392 * NEWS (2.3a+): Say option instead of flag.
2393
2394 2008-02-21 Wojciech Polak <polak@gnu.org>
2395
2396 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
2397 text.
2398
2399 2008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
2400
2401 Fix impure push parser compile error reported by Bob Rossi at
2402 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
2403 * data/yacc.c: Clean up whitespace in the output a little.
2404 (yypstate_allocated): Define for impure push parsers regardless of
2405 whether the pull interface is also requested.
2406 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
2407 check impure push parsers without the pull interface.
2408
2409 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
2410 yyerror takes arguments specified by %parse-param while yypstate_new
2411 does not.
2412 * doc/bison.texinfo (Parser Create Function): Document that
2413 yypstate_new returns 0 for multiple impure parser instances.
2414 * tests/push.at (Push Parsing: Multiple impure instances): Update
2415 expected stderr output.
2416
2417 2008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
2418
2419 * runtime-po/POTFILES.in (push.c): Remove.
2420
2421 2008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
2422
2423 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
2424 * data/push.c: Rename to...
2425 * data/yacc.c: ... this, overwriting it.
2426 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
2427 `%push-pull-parser' -> `%define api.push_pull "both"'.
2428 Remove old yacc.c tests, and update push.c tests to yacc.c.
2429
2430 2008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
2431
2432 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
2433 `"%code top" blocks' instead of `%code "top" blocks'.
2434 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
2435 Clean up whitespace in the output a little.
2436
2437 2008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
2438
2439 Fix documentation problems reported by Tim Josling at
2440 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
2441 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
2442 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
2443 integers. Explain the effect of literal string aliases on error
2444 messages. Copy token 0 documentation from the C++ skeleton
2445 documentation.
2446
2447 2008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
2448
2449 Accept a token number in a %left, %right, or %nonassoc for POSIX
2450 conformance. Reported by Tim Josling at
2451 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
2452 * NEWS (2.3a+): Mention.
2453 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
2454 and code numbers are treated by precedence declarations.
2455 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
2456 of symbols.1.
2457 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
2458 of symbol.
2459 (symbol.prec): New, just like symbol but allows INT.
2460 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
2461 longer holds.
2462 * tests/regression.at (Token number in precedence declaration): New
2463 test case.
2464
2465 2008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2466
2467 DJGPP specific issues.
2468 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
2469 be changed. Copyright timestamp adjusted.
2470 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
2471 be changed. Copyright timestamp adjusted.
2472 * djgpp/config.site: Copyright timestamp adjusted.
2473 * djgpp/config_h.sed: Copyright timestamp adjusted.
2474 * djgpp/djunpack.bat: Copyright timestamp adjusted.
2475 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
2476 filename translation list.
2477 * djgpp/subpipe.c (init_subpipe): Check the environment variables
2478 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
2479 files shall be created. Before trying to use the temp dir where the
2480 environment variable points to check that the dir really exists. If
2481 not default to the cwd as temp dir. Copyright timestamp adjusted.
2482 * djgpp/subpipe.h: Copyright timestamp adjusted.
2483 * djgpp/testsuite.sed: Copyright timestamp adjusted.
2484
2485 2008-01-30 Paul Eggert <eggert@cs.ucla.edu>
2486
2487 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
2488
2489 2008-01-09 Paul Eggert <eggert@cs.ucla.edu>
2490
2491 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
2492 Problem reported by Claudio Saavedra in
2493 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
2494
2495 2008-01-05 Wojciech Polak <polak@gnu.org>
2496
2497 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
2498 document's title with the input grammar file name.
2499
2500 2007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
2501
2502 Automate regression testing of the XML/XSLT implementation. Discussed
2503 starting at
2504 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
2505 * configure.ac (XSLTPROC): New substitution.
2506 * Makefile.am (maintainer-xml-check): New phony target invoking...
2507 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
2508 invoking make maintainer-check with BISON_TEST_XML=1.
2509 * tests/atlocal.in (XSLTPROC): New.
2510 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
2511 not to report reachable memory when Bison is expected to have a
2512 non-zero exit status and (2) to compare XML/XSLT output with --graph
2513 and --report=all output for every working grammar when
2514 BISON_TEST_XML=1.
2515 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
2516 (AT_BISON_CHECK_XML): New.
2517 (AT_QUELL_VALGRIND): New.
2518 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
2519 (AT_CHECK): ... don't redefine this since this was the old way to
2520 quell Valgrind.
2521 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
2522 AT_BISON_CHECK invocations.
2523 * tests/c++.at: Likewise.
2524 * tests/calc.at: Likewise.
2525 * tests/conflicts.at: Likewise.
2526 * tests/cxx-type.at: Likewise.
2527 * tests/existing.at: Likewise.
2528 * tests/glr-regression.at: Likewise.
2529 * tests/headers.at: Likewise.
2530 * tests/input.at: Likewise.
2531 * tests/java.at: Likewise.
2532 * tests/output.at: Likewise.
2533 * tests/push.at: Likewise.
2534 * tests/reduce.at: Likewise.
2535 * tests/regression.at: Likewise.
2536 * tests/sets.at: Likewise.
2537 * tests/skeletons.at: Likewise.
2538 * tests/synclines.at: Likewise.
2539 * tests/torture.at: Likewise.
2540 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
2541 tends to hang xsltproc.
2542 (Big horizontal): Likewise.
2543
2544 2007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
2545
2546 In XML output, remove redundant class attribute on symbol element.
2547 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
2548 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
2549 look up a symbol to determine whether it's a nonterminal or terminal.
2550 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
2551 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
2552
2553 Add prec/assoc information to XML output.
2554 * src/gram.c (grammar_rules_print_xml): For each rule that has a
2555 %prec, add a percent_prec attribute.
2556 * src/print-xml.c (print_grammar): For each terminal that has a
2557 precedence or associativity, add a prec or assoc attribute.
2558 (xml_indent): New.
2559 (xml_puts): Use xml_indent.
2560 (xml_printf): Use xml_indent.
2561 * src/print-xml.h (xml_indent): Prototype.
2562
2563 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
2564 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
2565
2566 2007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
2567
2568 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
2569 (bison:ruleByNumber): ... this for clarity.
2570 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
2571 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
2572 (xsl:template match="reduction"): Update.
2573 (xsl:template match="item"): Update.
2574 (xsl:template match="reduction"): Update.
2575
2576 In the XML output, don't print the list of rules where symbols appear.
2577 Compute it in XSLT instead. Discussed at
2578 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
2579 * data/xslt/bison.xsl (bison:ruleByLhs): New.
2580 (bison:ruleByRhs): New.
2581 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
2582 bison:ruleByRhs.
2583 (xsl:template match="terminal/rule"): Remove.
2584 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
2585 bison:ruleByRhs.
2586 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
2587 Remove.
2588 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
2589 bison:ruleByRhs and mode="number-link" for rule template.
2590 (xsl:template match="terminal/rule"): Remove.
2591 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
2592 bison:ruleByRhs and mode="number-link" for rule template.
2593 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
2594 Rewrite as...
2595 (xsl:template match="rule" mode="number-link"): ... this.
2596 * src/print-xml.c (print_grammar): Don't print the list of rules.
2597
2598 2007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
2599
2600 Don't let --report affect XML output; always print all information.
2601 Discussed at
2602 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
2603 * src/conflicts.c (log_resolution): Implement.
2604 * src/print-xml.c (print_core): Implement.
2605 (print_state): Implement.
2606 (print_xml): Implement.
2607
2608 * NEWS (2.3a+): Fix quotes.
2609 * src/parse-gram.y (prologue_declaration): For consistency with -v,
2610 don't let %verbose clear the list specified by --report.
2611
2612 2007-11-26 Akim Demaille <akim@epita.fr>
2613
2614 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
2615
2616 2007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
2617
2618 In the XML output, list useless and unused symbols and rules with the
2619 useful ones and add a "usefulness" attribute. Discussed starting at
2620 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
2621 * src/gram.c (grammar_rules_partial_print_xml): Remove.
2622 (grammar_rules_print_xml): Print all rules instead of just those
2623 useful in the grammar, and add a "usefulness" attribute.
2624 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
2625 * src/print-xml.c (print_rules_useless_in_parser): Remove.
2626 (print_grammar): Print all nonterminals instead of just useful ones,
2627 and add a "usefulness" attribute to nonterminals and terminals.
2628 (print_xml): Don't print a separate "reductions" or
2629 "rules-useless-in-parser" element.
2630 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
2631 (reduce_xml): Remove.
2632 (reduce_token_unused_in_grammar): New.
2633 (reduce_nonterminal_useless_in_grammar): New.
2634 * src/reduce.h (reduce_xml): Remove prototype.
2635 (reduce_token_unused_in_grammar): Add prototype.
2636 (reduce_nonterminal_useless_in_grammar): Add prototype.
2637 * data/xslt/xml2text.xsl: Update for XML changes.
2638 * data/xslt/xml2xhtml.xsl: Update for XML changes.
2639 * tests/reduce.at (Useless Terminals): Update output.
2640 (Useless Rules): Update output.
2641 (Reduced Automaton): Update output.
2642
2643 Say "Terminals unused in grammar" instead of "Unused terminals".
2644 * NEWS (2.3a+): Update.
2645 * doc/bison.texinfo (Understanding): Update example output.
2646 * src/reduce.c (reduce_output): Implement.
2647 * data/xslt/xml2text.xsl: Implement.
2648 * data/xslt/xml2xhtml.xsl: Implement.
2649
2650 2007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
2651
2652 Accept --report-file=FILE to override the default `.output' filename.
2653 * NEWS (2.3a+): Mention.
2654 * doc/bison.texinfo (Bison Options): Add an entry.
2655 * src/files.c (compute_output_file_names): Don't override
2656 spec_verbose_file if already set.
2657 * src/getargs.c (usage): Document --report-file.
2658 (REPORT_FILE_OPTION): New anonymous enum member.
2659 (long_options): Add entry for it.
2660 (getargs): Add case for it setting spec_verbose_file.
2661
2662 * build-aux/cross-options.pl: Don't record a short option just because
2663 there's an arg.
2664 * doc/.cvsignore: Add yacc.1.
2665
2666 2007-11-14 Akim Demaille <akim@epita.fr>
2667
2668 * doc/yacc.1.in: New.
2669 * configure.ac, doc/Makefile.am: Adjust.
2670 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
2671 config.h symbol.
2672 Use AC_SUBST for assignments too.
2673 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
2674
2675 2007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
2676
2677 * src/gram.c: Remove comments that duplicate comments in gram.h.
2678
2679 When reporting useless rules and nonterminals, say "useless in grammar"
2680 instead of "useless", and say "useless in parser" instead of "never
2681 reduced". Discussed starting at
2682 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
2683 * NEWS (2.3a+): Mention this change.
2684 * data/xslt/xml2text.xsl: Update output text and expected input XML
2685 element names to match changes below.
2686 * data/xslt/xml2xhtml.xsl: Likewise.
2687 (xsl:template match="bison-xml-report"): Add missing entry in Table of
2688 Contents: "Rules useless in parser due to conflicts".
2689 * doc/bison.texinfo (Decl Summary): Reword a little.
2690 (Understanding): Update example output for changes below.
2691 * src/gram.c: (rule_useful_p): Rename to...
2692 (rule_useful_in_grammar_p): ... this.
2693 (rule_useless_p): Rename to...
2694 (rule_useless_in_grammar_p): ... this.
2695 (rule_never_reduced_p): Rename to...
2696 (rule_useless_in_parser_p): ... this.
2697 (grammar_rules_print): Update for renames.
2698 (grammar_rules_print_xml): Update for renames.
2699 (grammar_rules_never_reduced_report): Rename to...
2700 (grammar_rules_useless_report): ... this since it is used for either
2701 kind of useless rule.
2702 * src/gram.h: Reword comments and update function names in prototypes.
2703 * src/main.c (main): Say "rule useless in parser due to conflicts".
2704 * src/print-xml.c (print_rules_never_reduced): Rename to...
2705 (print_rules_useless_in_parser): ... this, and rename output XML
2706 element "rules-never-reduced" to "rules-useless-in-parser".
2707 (print_xml): Update for rename.
2708 * src/print.c (print_results): Say "Rules useless in parser due to
2709 conflicts".
2710 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
2711 (nonterminals_reduce): Say "nonterminal useless in grammar".
2712 (reduce_output): Say "Nonterminals useless in grammar".
2713 Say "Rules useless in grammar".
2714 (reduce_xml): Rename output XML element "useless" to
2715 "useless-in-grammar".
2716 (reduce_print): Don't report the count of grammatically useless rules
2717 as "rules never reduced" just because %yacc is specified.
2718 In the correct report of this count, say nonterminal(s) and rule(s)
2719 "useless in grammar".
2720 * tests/conflicts.at (S/R in initial): Update expected output.
2721 (Defaulted Conflicted Reduction): Likewise.
2722 (Unreachable States After Conflict Resolution): Likewise.
2723 * tests/existing.at (GNU pic Grammar): Likewise.
2724 * tests/reduce.at (Useless Nonterminals): Likewise.
2725 (Useless Rules): Likewise.
2726 (Reduced Automaton): Likewise.
2727 (Underivable Rules): Likewise.
2728 (Empty Language): Likewise.
2729
2730 2007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
2731
2732 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
2733 here document and before the EOF so that BSD's implementation of Bourne
2734 shell doesn't parse the delimiter as part of the here document.
2735 * doc/.cvsignore: Add cross-options.texi.
2736 * src/getargs.c (usage): Add a blank line after the warning categories.
2737
2738 2007-11-08 Paolo Bonzini <bonzini@gnu.org>
2739
2740 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
2741
2742 2007-11-05 Akim Demaille <akim@epita.fr>
2743
2744 Remove Id: from bison.1.
2745 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
2746 (perl -0777 -pi -e 's/\.PP\nId): New.
2747 (.x.1): Use it to ignore the version control revision.
2748
2749 2007-11-05 Akim Demaille <demaille@gostai.com>
2750
2751 * build-aux/Makefile.am: Ship cross-options.pl.
2752 * doc/Makefile.am: Always refer to cross-options.texi with
2753 $(srcdir).
2754 (MAINTAINERCLEANFILES): Add it.
2755
2756 2007-11-04 Akim Demaille <demaille@gostai.com>
2757
2758 Generate the long/short option cross-table.
2759 * build-aux/cross-options.pl: New.
2760 * doc/Makefile.am (cross-options.texi): New.
2761 * doc/bison.texinfo: Use it.
2762
2763 2007-11-04 Akim Demaille <demaille@gostai.com>
2764
2765 Generate bison.1 using help2man.
2766 * doc/common.x, doc/bison.x: New.
2767 * doc/Makefile.am (bison.1, .x.1): New.
2768 The code is taken from autoconf-2.61/man/Makefile.am.
2769 * configure.ac: Look for help2man.
2770
2771 2007-11-04 Akim Demaille <demaille@gostai.com>
2772
2773 Complete --help.
2774 * src/getargs.c (usage): Document -W, make it clear that -d,
2775 -g and -x have optional arguments.
2776
2777 2007-11-04 Akim Demaille <demaille@gostai.com>
2778
2779 Find sha1sum when named gsha1sum.
2780 * bootstrap (find_tool): New.
2781 ($SHA1SUM): New.
2782
2783 2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
2784
2785 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
2786 at
2787 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
2788 * NEWS (2.3a+): Mention.
2789 * data/bison.m4 (b4_pure_if): Don't define it here.
2790 * data/c.m4 (b4_identification): Depend on individual skeletons to
2791 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
2792 values of the %define variables api.pure or api.push_pull. Define
2793 YYPURE, YYPUSH, and YYPULL accordingly.
2794 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
2795 glr.cc has already defined b4_pure_flag.
2796 * data/push.c: Define b4_pure_if based on `%define api.pure'.
2797 Remove YYPUSH and YYPULL since they're back in b4_identification again.
2798 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
2799 * doc/bison.texinfo (Pure Decl): Update.
2800 (Push Decl): Update.
2801 (Decl Summary): Add api.pure to %define entry.
2802 In %pure-parser entry, say it's deprecated and reference %define.
2803 (Pure Calling): Update.
2804 (Error Reporting): Update.
2805 (C++ Scanner Interface): Update.
2806 (How Can I Reset the Parser): Update.
2807 (Table of Symbols): In %pure-parser entry, say it's deprecated and
2808 reference %define.
2809 * src/getargs.c (pure_parser): Remove global variable.
2810 * src/getargs.h (pure_parser): Remove extern.
2811 * src/output.c (prepare): Don't define pure_flag muscle.
2812 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
2813 wrapper around `%define api.pure'.
2814 * tests/calc.at (Simple LALR Calculator): Update.
2815 (Simple GLR Calculator): Update.
2816 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
2817 Update.
2818 (GLR: Resolve ambiguity, pure, locations): Update.
2819 (GLR: Merge conflicting parses, pure, no locations): Update.
2820 (GLR: Merge conflicting parses, pure, locations): Update.
2821 * tests/glr-regression.at (Uninitialized location when reporting
2822 ambiguity): Update
2823 * tests/input.at (Unused %define api.pure): New test case.
2824 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
2825 AT_PURE_IF and AT_PURE_AND_LOC_IF.
2826 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
2827
2828 2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
2829
2830 %define push_pull -> %define api.push_pull. Discussed starting at
2831 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
2832 * data/push.c: Expect the new name.
2833 * data/yacc.c: Likewise.
2834 * doc/bison.texinfo (Push Decl): Update.
2835 (Decl Summary): Update %define entry.
2836 (Push Parser Function): Update.
2837 (Pull Parser Function): Update.
2838 (Parser Create Function): Update.
2839 (Parser Delete Function): Update.
2840 * tests/calc.at (Simple LALR Calculator): Update.
2841 * tests/input.at (%define enum variables): Update.
2842 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
2843 (Push Parsing: Multiple impure instances): Update.
2844 (Push Parsing: Unsupported Skeletons): Update.
2845 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
2846 (Exploding the Stack Size with Malloc): Update.
2847
2848 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
2849 other entries some.
2850
2851 2007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
2852
2853 For the XML output's terminal element, rename @number to @token-number,
2854 and add @symbol-number. In the nonterminal element, rename @number to
2855 @symbol-number. Discussed starting at
2856 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
2857 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
2858 renames.
2859 (xsl:template match="nonterminal"): Likewise.
2860 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
2861 (xsl:template match="nonterminal"): Likewise.
2862 * src/print-xml.c (print_grammar): Implement.
2863
2864 2007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2865
2866 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
2867 2007-10-11 change, the child elements here are items not rules.
2868 (xsl:template match="item"): New.
2869 (xsl:template match="rule"): Update for new reduced itemset.
2870 (xsl:template match="point"): Remove.
2871 (xsl:template match="empty"): For consistency with --graph, don't
2872 output "/* empty */".
2873 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
2874 line-wrap, don't pass a negative value as first-line-length since this
2875 won't work with the following changes.
2876 (xsl:template name="line-wrap"): Simplify slightly.
2877 (xsl:template name="ws-search"): Eliminate recursion.
2878 * src/print_graph.c (print_core): Don't print a reduction's lookahead
2879 set next to an item whose dot is not at the end of the RHS even if it
2880 happens to be associated with the same rule.
2881
2882 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
2883
2884 Add %define lr.keep_unreachable_states.
2885 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
2886 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
2887 * src/main.c (main): Implement it.
2888 * tests/conflicts.at (Unreachable States After Conflict Resolution):
2889 Extend to test it, and fix a typo.
2890
2891 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
2892
2893 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
2894 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
2895 the example .output text.
2896 * tests/regression.at (Extra lookahead sets in report): Improve wording
2897 of comments.
2898
2899 2007-10-17 Wojciech Polak <polak@gnu.org>
2900
2901 * src/print-xml.c (print_grammar): Renamed
2902 <terminal> and <nonterminal> attributes:
2903 "type" to "number" and "symbol" to "name".
2904 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
2905 Use new attribute names.
2906 (xsl:template match="nonterminal"): Likewise.
2907 * data/xslt/xml2xhtml.xsl: Likewise.
2908
2909 2007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
2910
2911 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
2912 (Option Cross Key): Likewise.
2913
2914 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
2915 next to an item whose dot is not at the end of the RHS even if it
2916 happens to be associated with the same rule.
2917 * src/print.c (print_core): Likewise.
2918 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
2919 (Resolved SR Conflicts): Update output.
2920 * tests/regression.at (Extra lookahead sets in report): New test case.
2921
2922 2007-10-11 Wojciech Polak <polak@gnu.org>
2923
2924 * src/print-xml.c (print_core): Remove item set
2925 redundancy.
2926 * data/xslt/bison.xsl (bison:ruleNumber): New key.
2927 Improve processing time. Suggested by Joel E. Denny.
2928 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
2929 Write xsl:param "required" attribute as comment.
2930 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
2931 (xsl:template match="rule"): Support new reduced itemset.
2932 (xsl:template match="point"): Remove.
2933 * data/xslt/xml2xhtml.xsl: Likewise.
2934
2935 2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
2936
2937 * src/getargs.c (version): Update copyright year.
2938
2939 2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
2940
2941 Make xml2dot.xsl and --graph produce the same output.
2942 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
2943 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
2944 escaped later.
2945 (xsl:template name="output-node"): Use the new escape template instead
2946 of the string-replace template directly.
2947 (xsl:template name="output-edge"): Likewise.
2948 (xsl:template name="escape"): New, escapes backslashes and newlines in
2949 addition to quotation marks.
2950 * src/graphviz.c (start_graph, output_node, output_edge): Add
2951 whitespace to output for legibility.
2952
2953 Make xml2text.xsl and --report produce the same output, and remove the
2954 XML "conflicts" element since a conflict summary is easily extracted
2955 from the automaton.
2956 * data/xslt/bison.xsl: New.
2957 (xsl:template match="state" mode="bison:count-conflicts): New.
2958 * data/xslt/xml2text.xsl: Import bison.xsl.
2959 (xsl:template match="bison-xml-report"): Instead of styling the
2960 "conflicts" element, style the "automaton" element with mode
2961 "conflicts". Unlike the former, the latter lists S/R and R/R
2962 conflicts for a state on the same line.
2963 (xsl:template match="conflicts"): Remove.
2964 (xsl:template match="conflict"): Remove.
2965 (xsl:template match="terminal"): Line-wrap the list of rules in which
2966 the terminal is used.
2967 (xsl:template match="nonterminal"): Likewise for nonterminals.
2968 (xsl:template match="automaton" mode="conflicts"): New.
2969 (xsl:template match="state" mode="conflicts"): New.
2970 (xsl:template name="line-wrap"): New.
2971 (xsl:template name="ws-search"): New.
2972 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
2973 (xsl:template match="bison-xml-report"): Instead of styling the
2974 "conflicts" element, style the "automaton" element with mode
2975 "conflicts."
2976 (xsl:template match="conflicts"): Remove.
2977 (xsl:template match="conflict"): Remove.
2978 (xsl:template match="automaton" mode="conflicts"): New.
2979 (xsl:template match="state" mode="conflicts): New.
2980 * src/conflicts.c (conflicts_output_xml): Remove.
2981 * src/conflicts.h (conflicts_output_xml): Remove prototype.
2982 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
2983 * src/print.c (print_grammar): Consistently wrap at the 66th column so
2984 the corresponding XSLT is easier. Also, never wrap between a word and
2985 the comma that follows it.
2986
2987 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
2988
2989 Improve C++ namespace support. Discussed starting at
2990 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
2991 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
2992 b4_namespace_close): New macros that interpret the %define variable
2993 "namespace" so its value can contain "::" to indicate nested
2994 namespaces.
2995 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
2996 the above macros.
2997 * data/lalr1.cc (b4_namespace): Likewise.
2998 * data/location.cc (b4_namespace): Likewise.
2999 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
3000 inside a new table in the general %define entry. Document `%define
3001 namespace' there as well. Point the %name-prefix entry to it since it
3002 explains it more completely in the case of C++.
3003 (C++ Bison Interface): Mention `%define namespace' instead of
3004 %name-prefix.
3005 (Table of Symbols): Remove the `%define push_pull' entry. The %define
3006 entry suffices.
3007 * tests/c++.at (Relative namespace references): New test case.
3008 (Absolute namespace references): New test case.
3009 (Syntactically invalid namespace references): New test case.
3010 * tests/input.at (C++ namespace reference errors): New test case.
3011
3012 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
3013
3014 Add syncline support and location accessor to internal %define
3015 interfaces.
3016 * data/bison.m4 (b4_percent_define_get_loc): New.
3017 (b4_percent_define_get_syncline): New.
3018 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
3019 (b4_percent_define_default): Record defining location as line 1 rather
3020 than 0 for the sake of synchronizing #line's, and define
3021 b4_percent_define_syncline(VARIABLE).
3022 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
3023 * src/muscle_tab.c (muscle_syncline_grow): New.
3024 (muscle_code_grow): Use muscle_syncline_grow.
3025 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
3026 define b4_percent_define_syncline(VARIABLE).
3027 (muscle_percent_define_get_loc): New.
3028 (muscle_percent_define_get_syncline): New.
3029 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
3030 remove some unused variables.
3031 (muscle_percent_define_default): Record defining location as line 1
3032 rather than 0 for the sake of synchronizing #line's, and define
3033 b4_percent_define_syncline(VARIABLE).
3034 (muscle_percent_define_check_values): Use
3035 muscle_percent_define_get_loc.
3036 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
3037 (muscle_percent_define_get_syncline): Prototype.
3038 * tests/skeletons.at (%define Boolean variables: invalid skeleton
3039 defaults): Update output for location change.
3040 (Complaining during macro argument expansion): Extend to test
3041 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
3042
3043 2007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
3044
3045 Fix some error-reporting macro bugs.
3046 * data/bison.m4 (b4_cat): New.
3047 (b4_error, b4_error_at): Use b4_cat to send error directives directly
3048 to stdout so they don't become arguments to other macros. Update
3049 comments and add examples.
3050 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
3051 add examples.
3052 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
3053 after printing the error directive so that M4 doesn't report subsequent
3054 problems that are induced by this problem.
3055 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
3056 instead of just in them. Recognize @\n in both places. Both expand to
3057 the empty string. Needed by b4_cat.
3058 * tests/skeletons.at (Complaining during macro argument expansion):
3059 New test case.
3060 (Fatal errors make M4 exit immediately): New test case.
3061
3062 2007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
3063
3064 Implement --print-datadir.
3065 * src/getargs.c (usage): Mention.
3066 (PRINT_DATADIR_OPTION): New anonymous enum member.
3067 (long_options): Add entry for it.
3068 (getargs): Add case for it calling compute_pkgdatadir.
3069 * src/output.c (output_skeleton): Encapsulate data directory
3070 computation from here...
3071 (prepare): ... and from here...
3072 (compute_pkgdatadir): ... into this new function.
3073 * src/output.h (compute_pkgdatadir): Prototype.
3074
3075 2007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
3076
3077 * src/print-xml.c (escape_bufs): New static global variable
3078 replacing...
3079 (xml_escape_n): ... the static local variable buf here.
3080 (print_xml): Free memory for escape_bufs.
3081 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
3082
3083 2007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
3084
3085 Replace `%push-parser' and `%push-pull-parser' with
3086 `%define push_pull "push"' and `%define push_pull "both"'.
3087 `%define push_pull "pull"' is the default.
3088 * doc/bison.texinfo (Push Decl, Push Parser Function,
3089 Pull Parser Function, Parser Create Function, Parser Delete Function):
3090 Update declarations.
3091 (Decl Summary, Table of Symbols): Replace %push-parser and
3092 %push-pull-parser entries with a %define push_pull entry.
3093 * data/bison.m4 (b4_percent_define_check_values): New macro.
3094 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
3095 definitions...
3096 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
3097 definitions...
3098 * data/push.c: ... to here and compute them from the value of the
3099 %define variable push_pull.
3100 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
3101 parsing requests here...
3102 * data/yacc.c: ... hack this to switch to push.c any time
3103 b4_use_push_pull_flag or the %define variable push_pull is set. This
3104 will go away when we mv push.c yacc.c.
3105 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
3106 push parsing is not supported since unused %define variables are
3107 reported anyway.
3108 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
3109 * src/muscle_tab.h (muscle_percent_define_check_values): Update
3110 comments for consistency with b4_percent_define_check_values.
3111 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
3112 muscles.
3113 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
3114 Remove.
3115 (prologue_declaration): Remove %push-parser and %push-pull-parser
3116 rules.
3117 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
3118 * tests/calc.at: Update declarations.
3119 * tests/input.at (%define enum variables): New test case.
3120 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
3121 declaration.
3122 (Push Parsing: Multiple impure instances): Update declaration.
3123 (Push Parsing: Unsupported Skeletons): New test case.
3124 * tests/torture.at (Exploding the Stack Size with Alloca): Update
3125 declaration.
3126 (Exploding the Stack Size with Malloc): Update declaration.
3127
3128 2007-09-24 Wojciech Polak <polak@gnu.org>
3129
3130 Add XSLT transformations.
3131
3132 * data/xslt/xml2dot.xsl: Transform XML into DOT.
3133 * data/xslt/xml2text.xsl: Transform XML into plain text.
3134 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
3135 * data/Makefile.am (xsltdir): New variable.
3136 (dist_xslt_DATA): Add xslt/*.xsl files.
3137
3138 2007-09-23 Paul Eggert <eggert@cs.ucla.edu>
3139
3140 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
3141 Problem reported by Wojciech Polak.
3142 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
3143 (xml_printf): Undo change I made on 21 September; that is,
3144 indent 2 spaces, not 1.
3145
3146 2007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
3147
3148 Pacify ./configure --enable-gcc-warnings.
3149 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
3150 `char const *' instead of `char *'.
3151 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
3152 local variable `sep'.
3153
3154 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
3155
3156 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
3157 elsewhere.
3158 * src/print-xml.c: Prefer "const" after types; that's more consistent.
3159 (xml_printf): Indent just 1 space for level.
3160 (e_char, xlate_char): Remove.
3161 (xml_escape_string): Rewrite to avoid undefined behavior (used
3162 storage that was freed from the stack).
3163 (xml_escape_n): Don't bother checking for subscript error.
3164
3165 2007-09-21 Wojciech Polak <polak@gnu.org>
3166
3167 Add Bison XML Automaton Report.
3168
3169 Add support for an -x option to generate an XML report.
3170 It is not documented yet.
3171 * src/print-xml.c: New file.
3172 * src/print-xml.h: Likewise.
3173 * lib/timevar.def (TV_XML): New var.
3174 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
3175 * src/conflicts.c: Include print-xml.h.
3176 (solved_conflicts_xml_obstack): New var.
3177 (log_resolution, conflicts_solve, conflicts_free):
3178 Add support for XML report.
3179 (conflicts_output_val): New function.
3180 * src/conflicts.h (conflicts_output_val): New decl.
3181 * src/files.c (spec_xml_file): New var.
3182 (compute_output_file_names, output_file_names_free): Add XML support.
3183 * src/files.h (spec_xml_file): New decl.
3184 * src/getargs.c (xml_flag): New var.
3185 (usage, short_options, long_options, getargs): Add XML support.
3186 * src/getargs.h (xml_flag): New decl.
3187 * src/gram.c: Include print-xml.h.
3188 (rule_lhs_print_xml, rule_rhs_print_xml):
3189 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
3190 New functions.
3191 * src/gram.h: Declare external ones.
3192 * src/main.c: Include print-xml.h.
3193 (main): Add XML support.
3194 * src/reduce.c: Include print-xml.h.
3195 (reduce_xml): New function.
3196 * src/reduce.h: Declare it.
3197 * src/state.c: Include print-xml.h.
3198 (state_new): Add XML support.
3199 (state_rule_lookahead_tokens_print_xml): New function.
3200 * src/state.h: Declare it.
3201 (struct state): New member solved_conflicts_xml.
3202 * src/symtab.c (symbol_class_get_string): New function.
3203 * src/symtab.h: Declare it.
3204
3205 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
3206
3207 * GNUmakefile: Switch to coreutils's version.
3208 * bootstrap: Likewise.
3209 * Makefile.cfg: Adjust to new GNUmakefile.
3210 * README-hacking: Likewise.
3211
3212 Import from gnulib:
3213
3214 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
3215 Bruno Haible <bruno@clisp.org>
3216
3217 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
3218 and is a script that invokes bison. Tighten the code. Add comments.
3219
3220 2007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
3221
3222 Spell "boolean" as "Boolean". Reported by Akim Demaille.
3223 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
3224 * doc/bison.texinfo (Decl Summary): Fix.
3225 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
3226 * tests/input.at (Boolean %define variables): Update output.
3227 * tests/skeletons.at (%define boolean variables: invalid skeleton
3228 defaults): Rename to...
3229 (%define Boolean variables: invalid skeleton defaults): ... this and
3230 update output.
3231
3232 2007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
3233
3234 In impure push mode, don't allow more than one yypstate to be allocated
3235 since multiple impure parsers would corrupt yynerrs.
3236 * data/push.c (yypstate_allocated): New static global variable
3237 initialized to 0.
3238 (yypull_parse): If yypstate_new returns 0, don't report it as memory
3239 exhaustion if yypstate_allocated is 1, but still return 2.
3240 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
3241 already 1. Otherwise, set it to 1.
3242 (yypstate_delete): Set it to 0.
3243 * tests/push.at (Push Parsing: Multiple impure instances): New test
3244 case.
3245
3246 2007-08-17 Bob Rossi <bob@brasko.net>
3247
3248 * doc/bison.texinfo (Push Decl): Document the push parser.
3249 (Table of Symbols): Ditto.
3250 (Pure Decl): Ditto.
3251 (Decl Summary): Ditto.
3252 (Multiple Parsers, Push Parser Function, Pull Parser Function,
3253 Parser Create Function, Parser Delete Function):
3254 Add new push parser symbols.
3255 (Table of Symbols): Document push-parser, push-pull-parser,
3256 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
3257
3258 2007-08-15 Paul Eggert <eggert@cs.ucla.edu>
3259
3260 Update to GPLv3.
3261 * doc/gpl-3.0.texi: New file.
3262 * doc/gpl.texi: Remove.
3263 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
3264 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
3265 * README-hacking, TODO, bootstrap, bootstrap.conf:
3266 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
3267 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
3268 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
3269 * data/lalr1.cc, data/lalr1.java, data/location.cc:
3270 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
3271 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
3272 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
3273 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
3274 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
3275 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
3276 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
3277 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
3278 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
3279 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
3280 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
3281 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
3282 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
3283 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
3284 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
3285 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
3286 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
3287 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
3288 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
3289 * src/complain.c, src/complain.h, src/conflicts.c:
3290 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
3291 * src/files.h, src/flex-scanner.h, src/getargs.c:
3292 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
3293 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
3294 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
3295 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
3296 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
3297 * src/print.c, src/print.h, src/print_graph.c:
3298 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
3299 * src/reduce.h, src/relation.c, src/relation.h:
3300 * src/revision.h, src/scan-code.h, src/scan-code.l:
3301 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
3302 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
3303 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
3304 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
3305 * tests/Makefile.am, tests/actions.at, tests/c++.at:
3306 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
3307 * tests/existing.at, tests/glr-regression.at:
3308 * tests/headers.at, tests/input.at, tests/java.at:
3309 * tests/local.at, tests/output.at, tests/push.at:
3310 * tests/reduce.at, tests/regression.at, tests/sets.at:
3311 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
3312 * tests/torture.at:
3313 Update to GPLv3.
3314
3315 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
3316
3317 Get rid of broken %no-parser, -n, and --no-parser implementation and
3318 documentation.
3319 * TODO: Don't mention them.
3320 * doc/bison.1: Likewise.
3321 * doc/bison.texinfo (Decl Summary): Likewise.
3322 (Bison Options): Likewise.
3323 (Option Cross Key): Likewise.
3324 * src/getargs.c (no_parser_flag): Remove global variable.
3325 (usage): Don't print description of -n and --no-parser.
3326 (long_options): Remove --no-parser entry here.
3327 (getargs): Remove -n case in the switch here.
3328 * src/getargs.h (no_parser_flag): Remove extern.
3329 * tests/regression.at (Web2c Actions): Remove comment that mentions
3330 --no-parser.
3331
3332 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
3333
3334 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
3335 name user variables starting with `yy'. Just pass NULL instead of a
3336 dummy local &yylval to yypush_parse.
3337 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
3338 starting with `yy'.
3339
3340 2007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
3341
3342 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
3343 true since it's then always used regardless of whether yyoverflow is
3344 defined. Reported by Christian Burger at
3345 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
3346 * THANKS: Add Christian Burger.
3347
3348 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
3349 node names: say "Decl Summary" not "Bison Declaration Summary".
3350
3351 2007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
3352
3353 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
3354 determine whether this function has already complained about an invalid
3355 value for a %define boolean variable, don't check whether Bison has
3356 ever examined the value. As written, the check was a tautology.
3357 Instead, record and check for this complaint using a separate muscle.
3358
3359 2007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
3360
3361 Fix push parsing memory leak reported by Brandon Lucia at
3362 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
3363 * THANKS: Add Brandon Lucia.
3364 * data/push.c (yypstate_delete): Free the stack if it was reallocated
3365 but the parse never completed and thus freed it.
3366 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
3367 * tests/testsuite.at: Include push.at.
3368 * test/push.at: New.
3369 (Push Parsing: Memory Leak for Early Deletion): New test case.
3370
3371 2007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
3372
3373 Improve handling of multiple S/R conflicts in the same state and of S/R
3374 conflicts involving multiple reductions.
3375 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
3376 set for a state here or Bison will abort if it is reassigned on a
3377 later conflicted reduction in the same state.
3378 Similarly, don't finalize and assign the solved conflicts report here
3379 or it will be lost if it is reassigned on a later conflicted reduction
3380 in the same state.
3381 (set_conflicts): Instead, assign them both here after all S/R conflicts
3382 in the state have been fully examined.
3383 * src/print.c (shift_set): Rename to...
3384 (no_reduce_set): ... this.
3385 (print_reductions): Update for rename, and add %nonassoc error action
3386 tokens to no_reduce_set so that, when printing the first remaining
3387 reduction on an error action token, the reduction is enclosed in
3388 brackets.
3389 (print_results): Update for rename.
3390 * tests/conflicts.at (Solved conflicts report for multiple reductions
3391 in a state): New test case.
3392 (%nonassoc error actions for multiple reductions in a state): New test
3393 case.
3394
3395 * src/main.c (main): Don't depend on C99 features.
3396
3397 2007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
3398
3399 * build-aux/.cvsignore: Add compile.
3400 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
3401 uniwidth.
3402
3403 2007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
3404
3405 * bootstrap (slurp): Create target directories that don't exist.
3406 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
3407
3408 2007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
3409
3410 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
3411 than item number.
3412 * closure.c (closure): Likewise.
3413 * state.h (reductions): Comment sorting of rules.
3414 (state): Comment sorting of items.
3415
3416 2007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
3417
3418 Fix C++ test cases after recent Gnulib changes. Discussed starting at
3419 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
3420 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
3421 definition in order to avoid Gnulib headers since we don't use config.h
3422 here.
3423 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
3424 rather than AT_DATA so that config.h is included.
3425
3426 2007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
3427
3428 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
3429 instead of fprintf. Guard these functions with #if YYDEBUG instead of
3430 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
3431 and so that YYFPRINTF is guaranteed to be defined here.
3432
3433 2007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
3434
3435 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
3436 with...
3437 (muscle_percent_define_check_values): ... this more helpful function.
3438 Again, it's not used yet, but it will be.
3439 * src/muscle_tab.h: Likewise.
3440
3441 Improve some comments in parser table construction.
3442 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
3443 (generate_states): Don't mention ruleset, which is internal to closure.
3444 * src/closure.c (closure): Explain sorting of core and itemset, which
3445 is required for this function to behave correctly.
3446 * src/closure.h (closure): Mention sorting.
3447
3448 2007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
3449
3450 * src/lalr.c (state_lookahead_tokens_count): For code readability,
3451 move the check for disabled transitions to an aver since conflict
3452 resolution hasn't happened yet.
3453
3454 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
3455 labels a state as inconsistent just because it has error transitions.
3456 The original form of this check appeared in revision 1.1 of lalr.c,
3457 which was committed on 1991-12-21. Now (at least), changing the
3458 consistency label on such a state appears to have no useful effect in
3459 any of the places it is examined, which I enumerate below. The key
3460 point to understanding each item in this enumeration is that a state
3461 with an error transition is labelled consistent in the first place only
3462 if it has no rules, so the check cannot matter for states that have
3463 rules. (1) Labelling a state as inconsistent will cause set_conflicts
3464 to try to identify its conflicts, and a state must have *rules* to have
3465 conflicts. (2) Labelling a state as inconsistent will affect how
3466 action_row sets the default *rule* for the state. (3) Labelling a
3467 state as inconsistent will cause build_relations to add lookback edges
3468 to *rules* in that state.
3469 * src/state.h (struct state): Word the comment for member consistent
3470 more carefully.
3471
3472 2007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
3473
3474 Don't depend on C99 features.
3475 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
3476 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
3477 * src/reader.c (check_and_convert_grammar): Fix for-loop.
3478 * src/state.c (state_mark_reachable_states): Fix for-loop.
3479 (state_remove_unreachable_states): Fix for-loop.
3480
3481 Don't widen struct state with member reachable just to temporarily
3482 record reachability. Instead, use a local bitset.
3483 * src/state.h (struct state): Remove member.
3484 * src/state.c (state_new): Don't initialize it.
3485 (state_mark_reachable_states): Rename to...
3486 (state_record_reachable_states): ... this, and use bitset.
3487 (state_remove_unreachable_states): Use bitset.
3488
3489 2007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
3490
3491 * src/Makefile.am (yacc): Quote target action commands properly so
3492 that the yacc script isn't corrupt. Reported by Hans Aberg at
3493 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
3494
3495 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
3496 the case of pure parsers. Reported by Frans Englich at
3497 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
3498 * THANKS: Add Frans Englich.
3499
3500 * NEWS (2.3a+): In the %code entry, reference section `Bison
3501 Declaration Summary' from the manual now since the %code summary has
3502 moved there.
3503 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
3504 in the rules section must be terminated by semicolons.
3505
3506 2007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
3507
3508 Extend the front-end API for %define variables to more completely
3509 mirror the back-end. This will be useful in the future.
3510 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
3511 Update comments to mention the new front-end counterparts of these
3512 macros.
3513 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
3514 for muscle_string_decode and muscle_location_decode.
3515 (muscle_string_decode): New static function.
3516 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
3517 (muscle_percent_define_get, muscle_percent_define_ifdef): New
3518 functions.
3519 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
3520 muscle_percent_define_get to mimic the b4_percent_define_flag_if
3521 implementation more closely.
3522 (muscle_percent_define_invalid_value): New function.
3523 * src/muscle_tab.h (muscle_percent_define_get,
3524 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
3525 Prototype.
3526
3527 2007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
3528
3529 * NEWS (2.3a+): Mention yesterday's state-removal change.
3530 (2.3a): Remove the %language entry, which was added after 2.3a.
3531 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
3532 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
3533 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
3534 tests/existing.at: Update copyright date.
3535
3536 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
3537
3538 If conflict resolution makes states unreachable, remove those states,
3539 report rules that are then unused, and don't report conflicts in those
3540 states.
3541 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
3542 New global function.
3543 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
3544 function.
3545 * src/main.c (main): After conflict resolution, remove the unreachable
3546 states and update all data structures that reference states by number.
3547 * src/state.c (state_new): Initialize each state's reachable member to
3548 false.
3549 (state_mark_reachable_states): New static function.
3550 (state_remove_unreachable_states): New global function.
3551 * src/state.h (struct state): Add member bool reachable.
3552 (state_remove_unreachable_states): Prototype.
3553 * tests/conflicts.at (Unreachable States After Conflict Resolution):
3554 New test case.
3555 * tests/existing.at (GNU pic Grammar): Update test case output now that
3556 an unused rule is discovered.
3557
3558 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
3559
3560 Minor code cleanup in parser table construction.
3561 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
3562 (new_itemsets, save_reductions): Update for rename to nitemset.
3563 * src/closure.c (nritemset): Rename to...
3564 (nitemset): ... this since the "r" appears to meaningless and isn't
3565 used in the comments.
3566 (closure): Update for rename.
3567 * src/closure.h (nritemset): Update extern to...
3568 (nitemset): ... this.
3569 * src/lalr.c (LA): Fix a typo in comments.
3570 * src/print.c (print_core): Update for rename to nitemset.
3571 * src/print_graph.c (print_graph): Likewise.
3572 * src/state.h: Fix some typos in header comments.
3573
3574 2007-04-04 Paul Eggert <eggert@cs.ucla.edu>
3575
3576 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
3577 still sticks to ASCII. Sorry!
3578
3579 * README-hacking: New file, taken mostly from coreutils, with changes
3580 for Bison. Contains much of the contents of:
3581 * README-cvs: Remove.
3582 * bootstrap: Sync from gnulib.
3583 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
3584 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
3585
3586 2007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
3587
3588 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
3589 Setzer.
3590 (Java Differences): Fix some typos.
3591 * THANKS: Add Sebastian Setzer.
3592
3593 2007-03-07 Paolo Bonzini <bonzini@gnu.org>
3594
3595 * data/java.m4 (b4_single_class_if): Remove.
3596 (b4_abstract_if): Look at "%define abstract".
3597 (b4_lexer_if): New.
3598 (b4_union_name): Rename...
3599 (b4_yystype): ... to this. Map to "%define stype".
3600 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
3601 b4_maybe_throws): Fix quoting.
3602 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
3603 * data/lalr1.java (Lexer interface): Always define.
3604 (Lexer interface within parser class): Remove.
3605 (YYLexer class): New, used when "%code lexer" is present.
3606 (constructor): When "%code lexer" is used, pass %lex-param
3607 to the lexer constructor.
3608 (yylex, yyparse): Remove %lex-param from method invocations
3609 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
3610
3611 * doc/bison.texinfo (Java Bison Interface): Mention "%define
3612 abstract". Rename "%define union_name" to "%define stype".
3613 Rename method names according to previous patch.
3614 (Java Scanner Interface): Describe "%code lexer" instead of
3615 "%pure-parser" and "%define single_class".
3616 (Java Differences): Mention "%code lexer".
3617
3618 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
3619 Include scanner here, using macros from tests/local.at.
3620 (AT_DATA_CALC_Y): Remove final argument.
3621 (_AT_CHECK_JAVA_CALC): Likewise.
3622 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
3623 of %locations and %error-verbose.
3624 (main): Test with and without %lex-param.
3625 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
3626 (AT_BISON_OPTION_POPDEFS): Pop it.
3627
3628 2007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3629
3630 DJGPP spefic issue. Inhibit the use of disallowed characters for
3631 file name genertion on Win98, WinXP, etc. These are |<>":?*\
3632 and concern testsuite case 46.
3633 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
3634 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
3635 * djgpp/config.bat: Inhibit the use of disallowed characters.
3636
3637 2007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
3638
3639 Miscellaneous %define and %code cleanup.
3640 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
3641 values are interpreted.
3642 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
3643 documentation a little more.
3644 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
3645 muscle_percent_define_insert, muscle_percent_code_grow): New
3646 functions/macros.
3647 * src/muscle_tab.h (muscle_percent_define_insert,
3648 muscle_percent_code_grow): Prototype.
3649 * src/parse-gram.y (prologue_declaration): Use
3650 muscle_percent_define_insert and muscle_percent_code_grow when parsing
3651 %define and %code directives.
3652
3653 Make it easy to share %define boolean variables between the front-end
3654 and back-end. Though not used yet, this will be useful in the future.
3655 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
3656 Bison uses of names rather than just skeleton uses of names.
3657 (b4_percent_define_get, b4_percent_define_ifdef): Rename
3658 b4_percent_define_skeleton_variables(VARIABLE) to
3659 b4_percent_define_bison_variables(VARIABLE).
3660 (b4_percent_code_get, b4_percent_code_ifdef): Rename
3661 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
3662 b4_percent_code_bison_qualifiers(QUALIFIER).
3663 (b4_check_user_names_wrap): Update for renames.
3664 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
3665 muscle_percent_define_default): New functions mimicking
3666 b4_percent_define_flag_if and b4_percent_define_default.
3667
3668 For %define variables, report locations for invalid values and
3669 redefinitions.
3670 * data/bison.m4 (b4_percent_define_flag_if): Read
3671 b4_percent_define_loc(VARIABLE) to report the location of an invalid
3672 value for VARIABLE.
3673 (b4_percent_define_default): Save a special location in
3674 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
3675 must later be reported as invalid.
3676 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
3677 functions.
3678 (muscle_percent_define_insert): Record the location of VARIABLE in
3679 muscle percent_define_loc(VARIABLE), and use it to report the previous
3680 location for a redefinition.
3681 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
3682 (muscle_percent_define_default): Update like b4_percent_define_default.
3683 (muscle_grow_user_name_list): Rename to...
3684 (muscle_user_name_list_grow): ... this for consistency and use
3685 muscle_location_grow.
3686 * src/muscle_tab.h (muscle_location_grow): Prototype.
3687 * tests/input.at (%define errors): Update expected output.
3688 * tests/skeletons.at (%define boolean variables: invalid skeleton
3689 defaults): New test case.
3690
3691 2007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
3692
3693 * src/print.c (lookahead_set, state_default_rule): Remove.
3694 (print_reductions): Replace state_default_rule invocation with
3695 equivalent use of yydefact, which was computed in token_actions in
3696 tables.c.
3697 (print_results): Don't allocate lookahead_set.
3698
3699 2007-02-27 Paolo Bonzini <bonzini@gnu.org>
3700
3701 * data/lalr1.java: Prefix all private members with yy.
3702
3703 2007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
3704
3705 Use YYFPRINTF instead of fprintf where appropriate. Reported by
3706 Sebastien Fricker at
3707 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
3708 * THANKS: Add Sebastien Fricker.
3709 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
3710 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
3711 accept a variable number of arguments.
3712
3713 2007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
3714
3715 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
3716
3717 2007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3718
3719 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
3720 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
3721 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
3722
3723 2007-02-11 Paul Eggert <eggert@cs.ucla.edu>
3724
3725 Undo my 2007-02-07 change, switching back to the c-strcase module
3726 introduced in the 2007-02-03 change. Bruno Haible reported that
3727 the 2007-02-07 change would be dangerous in Turkish if we add a
3728 language whose name contains "i", since "i" is not lowercase "I"
3729 in Turkish.
3730 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
3731 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
3732 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
3733 * m4/.cvsignore: Remove strcase.m4.
3734 * src/getargs.c: Revert 2007-02-07 change, as follows.
3735 Include c-strcase.h.
3736 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
3737
3738 2007-02-11 Bruno Haible <bruno@clisp.org>
3739
3740 Enable the Java related testsuite tests when the only Java compiler
3741 found is a gcj < 4.3. Discussed at
3742 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
3743 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
3744
3745 2007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
3746
3747 * data/Makefile.am: Update copyright date.
3748 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
3749 yypstate_new returns NULL.
3750 (yypstate_new): Return NULL if malloc does.
3751 * src/reader.c (packgram): Move translation of rule actions from the
3752 beginning of packgram to...
3753 (check_and_convert_grammar): ... here right before packgram is invoked
3754 so it's easier to write more complete comments, and remove redundant
3755 code.
3756
3757 2007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
3758
3759 As in semantic actions, make @$ in %initial-action, %destructor, and
3760 %printer imply %locations.
3761 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
3762 scanning @$.
3763 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
3764 (@$ in %initial-action implies %locations,
3765 @$ in %destructor implies %locations,
3766 @$ in %printer implies %locations): ... these new test cases.
3767
3768 2007-02-07 Paul Eggert <eggert@cs.ucla.edu>
3769
3770 Undo most of the 2007-02-03 change, switching to the strcase module
3771 now that gnulib strcase has been fixed.
3772 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
3773 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
3774 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
3775 * m4/.cvsignore: Add strcase.m4.
3776 * src/getargs.c: Revert 2007-02-03 change, as follows.
3777 Don't include c-strcase.h.
3778 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
3779 strcasecmp has "unspecified behavior" outside the POSIX locale,
3780 but it works fine in practice if at least one argument is ASCII,
3781 as is the case in Bison.
3782
3783 2007-02-07 Paolo Bonzini <bonzini@gnu.org>
3784
3785 * tests/java.at: Skip tests if only one of javac/java is present.
3786 Reported by Joel E. Denny.
3787 * tests/atlocal.in: Adjust copyright years.
3788
3789 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
3790
3791 * data/lalr1.java (Stack): Work around old verifiers that disallow
3792 access to the private fields of an inner class, from the outer class.
3793 We can make Stack's fields public because user code doesn't have access
3794 to the instance of Stack used by parse(). Reported by Paul Eggert.
3795
3796 2007-02-03 Paul Eggert <eggert@cs.ucla.edu>
3797
3798 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
3799 the right spot for these files?
3800 * bootstrap.conf (gnulib_modules): Add c-strcase.
3801 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
3802 c-strncasecmp.c.
3803 * src/getargs.c: Include c-strcase.h.
3804 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
3805 to avoid unspecified behavior.
3806
3807 2007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
3808
3809 * doc/bison.texinfo (Decl Summary): Correct typo.
3810
3811 2007-01-30 Paolo Bonzini <bonzini@gnu.org>
3812
3813 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
3814 Complain if the value does not match empty, "true" or "false".
3815 * data/c++.m4: Adjust default definitions of %define variables.
3816 * data/java.m4: Adjust default definitions of %define variables.
3817 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
3818 to above behavior.
3819 * tests/input.at (Boolean %define variables): Test new behavior.
3820
3821 2007-01-29 Paolo Bonzini <bonzini@gnu.org>
3822
3823 * NEWS: Mention java.
3824 * TODO: Remove things that are done.
3825 * bootstrap.conf: Add javacomp-script and javaexec-script.
3826 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
3827
3828 * data/Makefile.am: Add new files.
3829 * data/java-skel.m4: New.
3830 * data/java.m4: New.
3831 * data/lalr1.java: New.
3832
3833 * doc/bison.texinfo: Put "A Complete C++ Example" under
3834 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
3835 under Other Languages.
3836
3837 * src/getargs.c (valid_languages): Add Java.
3838 * src/getargs.h (struct bison_language): Update size of string fields.
3839
3840 * tests/Makefile.am: Add java.at.
3841 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
3842 * tests/java.at: New.
3843 * tests/testsuite.at: Include it.
3844
3845 2007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
3846
3847 Clean up.
3848 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
3849 at_directive_argv arguments so these no longer have to be global
3850 variables. Also, update the implementation for the following changes.
3851 (fail_for_at_directive_too_many_args,
3852 fail_for_at_directive_too_few_args): Add at_directive_name argument.
3853 (at_directive_name): Remove as at_directive_argv[0] will be used for
3854 this now.
3855 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
3856 for the directive name.
3857 (at_directive_argc, at_directive_argv): Make these local within
3858 skel_lex instead of global.
3859 (INITIAL): Update directive start action for above changes.
3860 (SC_AT_DIRECTIVE_ARG): Rename to...
3861 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
3862 (SC_AT_DIRECTIVE_SKIP_WS): Update.
3863 (scan_skel): Move yylex_destroy to...
3864 (skel_scanner_free): ... here.
3865 * tests/skeletons.at (installed skeleton file name): Rename to...
3866 (installed skeleton file names): ... this.
3867
3868 2007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
3869
3870 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
3871 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
3872 Summary" not "Directives".
3873 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
3874 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
3875 since the former is now the more complete one.
3876 (Prologue Alternatives): Likewise and do the same for %defines.
3877 (Table of Symbols): Add summary of %code, add summary of %define, and
3878 move full %code documentation to...
3879 (Decl Summary): ... here for consistency with other entries in these
3880 sections.
3881 Move %define entry in order to keep this list alphabetized.
3882 Reword %define entry a little to put less emphasis on the skeleton
3883 concept, which most users shouldn't have to think about.
3884
3885 2007-01-26 Paul Eggert <eggert@cs.ucla.edu>
3886
3887 Adjust to recent gnulib changes.
3888 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
3889 Add string.h, string_.h, unistd_.h, wchar_.h.
3890 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
3891 * src/system.h: Don't include <stpcpy.h>; this is now done by
3892 <string.h>.
3893
3894 2007-01-23 Paolo Bonzini <bonzini@gnu.org>
3895
3896 Simplify implementation of unqualified %code, implement macros for
3897 uniform treatment of boolean %define flags. Document %define.
3898 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
3899 b4_percent_code_ifdef): New.
3900 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
3901 * data/c++.m4: Define default value for global_tokens_and_yystype.
3902 * data/glr.cc: Likewise.
3903 * data/location.cc: Use b4_percent_define_flag_if.
3904
3905 * doc/bison.texinfo (Decl Summary): Document %define.
3906
3907 * src/parse-gram.y (Unqualified %code): Change muscle name to
3908 b4_percent_code().
3909 (content.opt): Default to empty.
3910
3911 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
3912
3913 Implement support for relative and absolute skeleton file names.
3914 Discussed starting at
3915 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
3916 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
3917 (Bison Options): Document in --skeleton entry.
3918 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
3919 full_skeleton can't necessarily hold all of pkgdatadir.
3920 If the specified skeleton file name contains a `/', don't prepend
3921 pkgdatadir.
3922 * src/parse-gram.y (prologue_declaration): If the specified skeleton
3923 file name contains a `/', prepend the grammar file directory.
3924 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
3925 * skeletons.at: New file.
3926 (relative skeleton file names): New test case.
3927 (installed skeleton file names): New test case.
3928 * tests/testsuite.at: Include skeletons.at.
3929
3930 * bootstrap: Update copyright to 2007.
3931
3932 2007-01-17 Paolo Bonzini <bonzini@gnu.org>
3933
3934 * bootstrap: Remove occurrences of .#bootmp from the files.
3935
3936 2007-01-17 Akim Demaille <akim@epita.fr>
3937
3938 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
3939 nonterminals.
3940 Use per-type %printer.
3941
3942 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
3943
3944 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
3945 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
3946 djgpp/config.site, src/files.c, src/files.h, src/main.c,
3947 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
3948 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
3949 tests/glr-regression.at, tests/input.at, tests/local.at,
3950 tests/output.at, tests/torture.at: Update copyright to 2007.
3951
3952 2007-01-16 Akim Demaille <akim@epita.fr>
3953
3954 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
3955 error code.
3956 (Calc++ Scanner): Exit with failure if we can't open the input
3957 file.
3958 Accept "-" standing for stdin.
3959 (Calc++ Top Level): Print the result only if the parsing was
3960 successful.
3961
3962 2007-01-16 Akim Demaille <akim@epita.fr>
3963
3964 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
3965
3966 2007-01-15 Paolo Bonzini <bonzini@gnu.org>
3967 and Joel E. Denny <jdenny@ces.clemson.edu>
3968
3969 Clean up %define and %code implementation in M4 some. Most
3970 importantly, rename all related macros to be in the b4_percent_define
3971 and b4_percent_code namespaces. Also, complete support for `.' in
3972 %define variable names and %code qualifiers.
3973 * data/bison.m4 (b4_check_user_names): Check for special
3974 "SKELETON-NAMESPACE(name)" macros instead of using two nested
3975 m4_foreach loops.
3976 (b4_get_percent_define, b4_get_percent_code): Rename to...
3977 (b4_percent_define_get, b4_percent_code_get): ... these.
3978 Extend documentation with examples.
3979 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
3980 b4_percent_define_skeleton_variables and
3981 b4_percent_code_skeleton_qualifiers.
3982 Expect any value for the %define variable `foo' to be stored in the
3983 macro named `b4_percent_define(foo)'; expect any %code blocks for the
3984 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
3985 expect any unqualified %code blocks to be stored in a macro named
3986 `b4_percent_code_unqualified'.
3987 Use m4_indir so that %define variable names and %code qualifiers can
3988 contain `.', which is allowed by the grammar parser.
3989 (b4_percent_define_default): New macro to set a default value for a
3990 %define variable.
3991 (m4_wrap): Update wrapped code, and fix some underquoting.
3992 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
3993 Expect grammar uses of %define variables and %code qualifiers to be
3994 defined in b4_percent_define_user_variables and
3995 b4_percent_code_user_qualifiers.
3996 * data/c++.m4: Use b4_percent_define_default rather than
3997 m4_define_default. Fix some underquoting. Skeleton usage of %define
3998 variable define_location_comparison now implies skeleton usage of
3999 %define variable filename_type.
4000 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
4001 data/push.c, data/yacc.c: Update macro names.
4002 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
4003 muscle names.
4004
4005 2007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4006
4007 DJGPP specific issues.
4008
4009 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
4010 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
4011
4012 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
4013
4014 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
4015 run parsers in all tests so that Valgrind is invoked during
4016 maintainer-check-valgrind.
4017 (Duplicate representation of merged trees): Free all semantic values.
4018 (Duplicated user destructor for lookahead): Likewise.
4019
4020 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
4021
4022 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
4023 command-line prefix.
4024 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
4025 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
4026 miss Valgrind messages.
4027 (Exploding the Stack Size with Malloc): Likewise.
4028
4029 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
4030
4031 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
4032 locals. Reported by Juan Manuel Guerrero at
4033 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
4034 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
4035 Fix some indentation also.
4036 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
4037 explaining this issue.
4038
4039 2007-01-09 Paolo Bonzini <bonzini@gnu.org>
4040 and Joel E. Denny <jdenny@ces.clemson.edu>
4041
4042 Simplify union and prologue handling, and escape union and lex/parse
4043 params with digraphs.
4044 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
4045 values to the empty string since these are no longer guaranteed
4046 initialized by the front-end.
4047 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
4048 braces around b4_user_stype since this is no longer done by the
4049 front-end.
4050 * src/files.c, src/files.h (pre_prologue_obstack,
4051 post_prologue_obstack): Remove.
4052 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
4053 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
4054 with digraphs. This fixes lex params and parse params.
4055 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
4056 * src/output.c (prepare): Remove muscle insertion of the prologues.
4057 (output): Remove freeing of pre_prologue_obstack and
4058 post_prologue_obstack.
4059 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
4060 than prologue_augment for prologue parsing so you don't need prologue
4061 obstacks.
4062 (grammar_declaration): For %union RHS, use `braceless' instead of
4063 "{...}" so that braces are already stripped and code is escaped with
4064 digraphs.
4065 * src/reader.c (prologue_augment): Remove.
4066 (reader): Remove initialization of pre_prologue_obstack and
4067 post_prologue_obstack.
4068 * src/reader.h (prologue_augment): Remove.
4069
4070 * data/c.m4: Remove stray parenthesis.
4071
4072 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
4073
4074 Remove quotes from variables names in %define directives and from
4075 qualifiers in %code directives, and restrict the characters that are
4076 allowed in them to M4-friendly ones. For %define, continue to support
4077 the quoted form as a deprecated feature. Discussed starting at
4078 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
4079 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
4080 %code.
4081 * doc/bison.texinfo (Prologue Alternatives): Update.
4082 (Decl Summary): In %defines entry, update mention of `%code requires'
4083 and `%code provides'.
4084 (C++ Location Values): Update %define uses.
4085 (Calc++ Parser Interface): Likewise.
4086 (Calc++ Parser): Likewise, and update `%code requires' uses.
4087 (Table of Symbols): Update %code documentation.
4088 * src/parse-gram.y (prologue_declaration): For %define variables, use
4089 `variable' instead of `STRING'.
4090 (grammar_declaration): For %code qualifiers, use `ID' instead of
4091 `STRING'.
4092 (variable): New nonterminal that takes an `ID' or a `STRING'.
4093 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
4094 and %define uses.
4095 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
4096 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
4097 (%define errors): Update %define uses.
4098
4099 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
4100
4101 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
4102 instead of muscle_insert for %define values so that M4-special
4103 characters are replaced with digraphs.
4104 * tests/input.at (%define errors): Extend to check weird values.
4105
4106 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
4107
4108 Instead of having skeletons declare all valid %define variables and
4109 %code qualifiers, provide macros that retrieve the associated values
4110 and build these lists automatically. Thus Bison will now warn when a
4111 variable or qualifier is not used by the skeleton in the current
4112 invocation regardless of whether it might sometimes be used by that
4113 skeleton in other invocations. Also, move all %define value macros to
4114 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
4115 form, which is replaced by %code.
4116 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
4117 (b4_check_user_names): ... this, and change the series of valid name
4118 arguments to a single list argument for names used in the skeleton
4119 similar to the existing list argument for names used in the grammar.
4120 Warn instead of complaining.
4121 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
4122 values and %code code, to format %code code properly, and to build
4123 lists of all %define variables and %code qualifiers used in the
4124 skeleton: b4_skeleton_percent_define_variables and
4125 b4_skeleton_percent_code_qualifiers.
4126 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
4127 Remove, and...
4128 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
4129 the skeleton names lists can finish building first. In place of
4130 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
4131 expect the lists b4_user_percent_define_variables and
4132 b4_user_percent_code_qualifiers.
4133 * data/c++.m4: Where setting default values for b4_parser_class_name,
4134 b4_location_type, b4_filename_type, b4_namespace, and
4135 b4_define_location_comparison, update their names to the
4136 b4_percent_define_ namespace.
4137 * data/glr.c: Don't use b4_check_percent_define_variables and
4138 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
4139 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
4140 (b4_parser_class_name, b4_namespace): Define these using
4141 b4_get_percent_define for parser_class_name and namespace.
4142 * data/location.cc: Use b4_get_percent_define.
4143 * data/push.c: Don't use b4_check_percent_define_variables and
4144 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
4145 * data/yacc.c: Likewise, and don't call m4_exit in
4146 b4_use_push_for_pull_if or m4_wrap code will never execute.
4147 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
4148 Rename to...
4149 (muscle_grow_user_name_list): ... this for consistency with the
4150 terminology used in bison.m4.
4151 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
4152 %define variable names, and rename muscle used_percent_define_variables
4153 to user_percent_define_variables.
4154 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
4155 user_percent_code_qualifiers.
4156 (content): Remove.
4157 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
4158 {CODE} form is no longer accepted.
4159 * tests/input.at (Reject bad %code qualifiers): Rename to...
4160 (Reject unused %code qualifiers): ... this, and update test output.
4161 (%define error): Update test output.
4162
4163 2007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
4164
4165 Check for unrecognized %define variables similar to checking for
4166 unrecognized %code qualifiers. Check for redefined %define variables.
4167 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
4168 generalizes...
4169 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
4170 (b4_check_percent_define_variables): New, also wraps it.
4171 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
4172 variables using b4_check_percent_define_variables.
4173 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
4174 all those exercised in the test suite and all those listed in the
4175 `Default values' section of c++.m4. Are there others?
4176 * data/push.c, data/yacc.c: Declare no valid %define variables.
4177 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
4178 similar to muscle_find, but it works even when the muscle stores a
4179 const value.
4180 (muscle_grow_used_name_list): New function for constructing the used
4181 name list muscles that b4_check_for_unrecognized_names requires.
4182 * src/parse-gram.y (prologue_declaration): Warn if a variable is
4183 %define'd more than once. Define the b4_used_percent_define_variables
4184 muscle with muscle_grow_used_name_list.
4185 (grammar_declaration): Abbreviate %code code with
4186 muscle_grow_used_name_list.
4187 * tests/input.at (%define errors): New.
4188
4189 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
4190
4191 Provide warn_at, complain_at, and fatal_at function callbacks to the
4192 skeletons, and use this for %code qualifier complaints.
4193 * data/bison.m4 (b4_error_at): New, invoked by...
4194 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
4195 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
4196 @fatal_at(...@) directives.
4197 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
4198 qualifiers in b4_used_percent_code_qualifiers and to use
4199 b4_complain_at.
4200 * src/location.c, src/location.h (boundary_set_from_string): New global
4201 function.
4202 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
4203 function.
4204 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
4205 to b4_used_percent_code_qualifiers.
4206 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
4207 function.
4208 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
4209 (lineno): Rename to...
4210 (out_lineno): ... this so I don't misunderstand it again.
4211 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
4212 here; these newlines are in the input but not the output file.
4213 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
4214 (at_directive_perform): ... this new static function, and add handling
4215 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
4216 directives.
4217 * tests/input.at (Reject bad %code qualifiers): Update test output with
4218 locations and extend.
4219
4220 * tests/output.at (Output file name: [, Output file name: ]): Remove
4221 bogus comment about these tests failing.
4222
4223 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
4224
4225 Clean up b4_check_percent_code_qualifiers a little.
4226 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
4227 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
4228 documentation and add examples.
4229 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
4230 qualifiers here.
4231
4232 2007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
4233
4234 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
4235 unreliable -- especially when they're hidden inside another macro.
4236 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
4237 data/c.m4: Remove m4_divert(-1).
4238 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
4239 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
4240 m4_divert_push(0) and m4_divert_pop(0).
4241 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
4242 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
4243 pushed and popped by m4sugar, should be first on the stack.
4244
4245 Provide warn, complain, and fatal function callbacks to the skeletons.
4246 This provides more flexibility than m4_fatal, improves the error
4247 message format, and captures messages for translation. Discussed
4248 starting at
4249 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
4250 * data/bison.m4 (b4_error): New, invoked by...
4251 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
4252 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
4253 directives. Because these M4 macros might be called when the current
4254 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
4255 the previous removal of uses of m4_divert, which caused trouble.
4256 (b4_check_percent_code_qualifiers): Use b4_complain instead of
4257 m4_fatal to report unrecognized %code qualifiers.
4258 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
4259 push parser requests.
4260 * data/glr.c: Use b4_complain instead of m4_fatal to report
4261 non-deterministic push parser requests.
4262 Update @output usage to @output(...@) form.
4263 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
4264 report missing %defines. Update @output usage to @output(...@) form.
4265 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
4266 @output(...@) form.
4267 * src/main.c (main): Invoke skel_scanner_free.
4268 * src/scan-skel.h (skel_scanner_free): Prototype new function.
4269 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
4270 obstack_for_string from flex-scanner.h.
4271 (YY_DECL): Use to declare skel_lex static.
4272 (decode_at_digraphs): Remove; now handled in the new
4273 SC_AT_DIRECTIVE_ARG start condition.
4274 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
4275 functions.
4276 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
4277 at_directive_argv): New static globals.
4278 (INITIAL): Use fail_for_invalid_at.
4279 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
4280 recognize the start of a generalized `@directive(...@)' form and
4281 start...
4282 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
4283 directive args (using the new obstack_for_string), to decode the
4284 contained @ diagraphs, and to perform the directive. It recognizes
4285 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
4286 @output(...@).
4287 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
4288 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
4289 `@,'.
4290 (scan_skel): Initialize obstack_for_string on the first call.
4291 (skel_scanner_free): New function to free obstack_for_string.
4292 * tests/input.at (Reject bad %code qualifiers): Update test output.
4293
4294 2007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
4295
4296 Consolidate the 4 prologue alternative directives (%code, %requires,
4297 %provides, and %code-top) into a single %code directive with an
4298 optional qualifier field. Discussed at
4299 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
4300 * NEWS (2.3a+): Rewrite the existing entry for the prologue
4301 alternatives.
4302 * doc/bison.texinfo (Prologue Alternatives): Update.
4303 (Decl Summary): Update to %code "requires" and %code "provides".
4304 (Calc++ Parser): Update to %code "requires".
4305 (Table of Symbols): Remove entries for %requires, %provides, and
4306 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
4307 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
4308 are replaced by b4_percent_code_provides and b4_percent_code_requires,
4309 which are skeleton-specific.
4310 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
4311 declare what %code qualifiers it supports and to complain if any other
4312 qualifiers were used in the grammar.
4313 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
4314 and b4_user_code([b4_percent_code_provides]) in place of
4315 b4_user_requires and b4_user_provides.
4316 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
4317 Add b4_user_code([b4_percent_code_top]) and
4318 b4_user_code([b4_percent_code]).
4319 Invoke b4_check_percent_code_qualifiers.
4320 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
4321 PERCENT_REQUIRES): Remove.
4322 (grammar_declaration): Remove RHS's for %code-top, %provides, and
4323 %requires. Rewrite the %code RHS as the unqualified form defining the
4324 muscle b4_percent_code. Add another RHS for the qualified %code form,
4325 which defines muscles of the form b4_percent_code_QUALIFIER and the
4326 b4_used_percent_code_qualifiers muscle.
4327 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
4328 PERCENT_REQUIRES): Remove.
4329 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
4330 %code "requires" and %code "provides".
4331 * tests/input.at (Reject bad %code qualifiers): New.
4332
4333 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
4334
4335 Use the new code_props interface for destructors and printers.
4336 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
4337 printer_location members, and change the type of the destructor and
4338 printer members to code_props.
4339 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
4340 symbol_printer_get, semantic_type_destructor_set,
4341 semantic_type_printer_set, default_tagged_destructor_set,
4342 default_tagless_destructor_set, default_tagged_printer_set,
4343 default_tagless_printer_set): Use code_props in arguments and return
4344 types in place of char const * and location.
4345 (symbol_destructor_location_get, symbol_printer_location_get): Remove
4346 since the locations are now contained in the return of
4347 symbol_destructor_get and symbol_printer_get.
4348 * src/output.c (symbol_destructors_output, symbol_printers_output):
4349 Replace with...
4350 (symbol_code_props_output): ... this to eliminate duplicate code.
4351 (output_skeleton): Update to use symbol_code_props_output.
4352 * src/reader.c (symbol_should_be_used): Update use of
4353 symbol_destructor_get.
4354 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
4355 Update uses of the various _destructor_set and _printer_set functions.
4356 * src/symtab.c: (default_tagged_destructor_location,
4357 default_tagless_destructor_location, default_tagged_printer_location,
4358 default_tagless_printer_location): Remove since we...
4359 (default_tagged_destructor, default_tagless_destructor,
4360 default_tagged_printer, default_tagless_printer): ... change the type
4361 of these to code_props.
4362 (symbol_new, semantic_type_new, symbol_destructor_set,
4363 semantic_type_destructor_set, symbol_destructor_get,
4364 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
4365 symbol_check_alias_consistency, default_tagged_destructor_set,
4366 default_tagless_destructor_set, default_tagged_printer_set,
4367 default_tagless_printer_set): Update.
4368 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
4369 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
4370 code_props members.
4371 (symbol_print): Use SYMBOL_CODE_PRINT.
4372
4373 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
4374
4375 Use the new code_props interface for rule actions.
4376 * src/symlist.h (symbol_list): Replace action, action_location, and
4377 used members with a code_props action_props member.
4378 * src/reader.c (symbol_should_be_used, grammar_rule_check,
4379 grammar_midrule_action, grammar_current_rule_merge_set,
4380 grammar_current_rule_symbol_append, packgram): Update.
4381 * src/scan-code.h (translate_rule_action): Remove, no longer used.
4382 * src/scan-code.l (handle_action_dollar): Update.
4383 (translate_rule_action): Remove, no longer used.
4384 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
4385
4386 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
4387
4388 Use the new code_props interface in parse-gram.y.
4389 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
4390 Update all uses of translate_* functions to use the new code_props
4391 interface and to use gram_scanner_last_string_free and
4392 code_scanner_last_string_free where possible.
4393 (grammar_declaration): symbol_list_destructor_set and
4394 symbol_list_printer_set now perform the translation, so don't do it
4395 here. Use gram_scanner_last_string_free where possible.
4396 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
4397 translate_code): Remove, no longer used.
4398 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
4399 symbol_list_printer_set): Perform code translation here rather than
4400 depending on the caller to do so.
4401
4402 * src/symlist.h (struct symbol_list): Correct some documentation typos.
4403 * src/scan-gram.h (gram_last_string): Remove declaration.
4404 * src/scan-gram.l (last_string): Declare it static.
4405
4406 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
4407
4408 Encapsulate code properties and related functionality for the various
4409 destructors, printers, and actions into a code_props structure and
4410 interface. This patch merely implements code_props in scan-code.h and
4411 scan-code.l. Future patches will rewrite other modules to use it.
4412 Discussed starting at
4413 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
4414 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
4415 consistently initialize const structs that have an empty location
4416 field.
4417 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
4418 to ensure consistency.
4419 * src/scan-code.h (code_props): New structure.
4420 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
4421 function, macro, and const global variable for initializing a
4422 code_props with no code.
4423 (code_props_plain_init, code_props_symbol_action_init,
4424 code_props_rule_action_init, code_props_translate_code): The rest of
4425 the new code_props functional interface. Among other things, the init
4426 functions set the code_props kind field so that
4427 code_props_translate_code will know whether to behave like
4428 translate_symbol_action, translate_rule_action, or translate_code.
4429 These old translate functions must remain until all other modules are
4430 updated to use the new code_props interface.
4431 (code_scanner_last_string_free): New function similar to
4432 gram_scanner_last_string_free.
4433 (code_scanner_free): Add documentation.
4434 * src/scan-code.l: Implement the new interface.
4435 (code_lex): Make it static, add a code_props* argument, and remove the
4436 rule argument.
4437 (last_string): New static global similar to the one in scan-gram.l.
4438 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
4439 instead of rule.
4440 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
4441 code_props since Bison may one day use this information for destructors
4442 and printers.
4443 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
4444 (handle_action_dollar): Use symbol_list_n_get and set used flag
4445 directly since symbol_list_n_used_set is removed.
4446 (translate_action): Add a code_props* argument and remove the rule,
4447 action, and location arguments. Pass the code_props* on to code_lex.
4448 (translate_rule_action, translate_symbol_action, translate_code):
4449 Rewrite as wrappers around the new code_props interface.
4450 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
4451 it would eventually need to break the encapsulation of code_props.
4452
4453 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
4454
4455 * etc/.cvsignore: New.
4456
4457 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
4458
4459 Add maintainer-push-check to run maintainer-check using push parsing in
4460 place of pull parsing where available.
4461 * Makefile.am (maintainer-push-check): New.
4462 * data/bison.m4 (b4_use_push_for_pull_if): New.
4463 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
4464 appropriately based on their existing values.
4465 (yypush_parse): Don't print push-parser-specific diagnostics if push
4466 parsing is being used in place of pull parsing.
4467 * data/yacc.c: If push parsing should replace pull parsing, redirect to
4468 push.c.
4469 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
4470 variable, and insert b4_use_push_for_pull_flag into muscles.
4471 * tests/Makefile.am (maintainer-push-check): New.
4472
4473 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
4474
4475 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
4476 (whether successful or failed) so that yypush_parse can be invoked
4477 again to start a new parse using the same yypstate.
4478 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
4479 check multiple yypull_parse invocations on the same yypstate. For pull
4480 mode, extend to check multiple yyparse invocations.
4481 (Exploding the Stack Size with Alloca): Extend to try with
4482 %push-pull-parser.
4483 (Exploding the Stack Size with Malloc): Likewise.
4484
4485 * tests/calc.at (Simple LALR Calculator): Don't specify
4486 %skeleton "push.c" since %push-pull-parser implies that now.
4487 * tests/headers.at (export YYLTYPE): Don't check for the push
4488 declarations. Otherwise, this test case can't be used to see if push
4489 mode can truly emulate pull mode.
4490 * tests/input.at (Torturing the Scanner): Likewise.
4491 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
4492 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
4493 AT_YACC_IF, which now includes the case of push mode since %skeleton
4494 need not be used for push mode. This will be more intuitive once
4495 push.c is renamed to yacc.c.
4496
4497 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
4498
4499 For push mode, convert yyparse from a macro to a function, invoke yylex
4500 instead of passing a yylexp argument to yypull_parse, and don't
4501 generate yypull_parse or yyparse unless %push-pull-parser is declared.
4502 Discussed starting at
4503 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
4504 * data/bison.m4 (b4_pull_if): New.
4505 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
4506 * data/push.c: Improve M4 quoting a little.
4507 (b4_generate_macro_args, b4_parenthesize): Remove.
4508 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
4509 any time a pull parser is requested.
4510 Don't #define this as a wrapper around yypull_parse. Instead, when
4511 both push and pull are requested, make it a function that does that
4512 same thing.
4513 (yypull_parse): If there's a b4_prefix, #define this to
4514 b4_prefix[pull_parse] when both push and pull are requested.
4515 Don't define this as a function unless both push and pull are
4516 requested.
4517 Remove the yylexp argument and hard-code yylex invocation instead.
4518 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
4519 %push-parser.
4520 * src/getargs.c (pull_parser): New global initialized to true.
4521 * getargs.h (pull_parser): extern it.
4522 * src/output.c (prepare): Insert pull_flag muscle.
4523 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
4524 (prologue_declaration): Set both push_parser and pull_parser = true for
4525 %push-pull-parser. Set push_parser = true and pull_parser = false for
4526 %push-parser.
4527 * src/scan-gram.l: Don't accept %push_parser as an alternative to
4528 %push-parser since there's no backward-compatibility concern here.
4529 Scan %push-pull-parser.
4530 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
4531 instead of %push-parser.
4532 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
4533 prototype it in the module that calls yyparse.
4534 * tests/input.at (Torturing the Scanner): Likewise.
4535 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
4536
4537 2006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
4538
4539 Update etc/bench.pl. Optimize push mode a little (the yyn change
4540 deserves most of the credit).
4541 * Makefile.am (SUBDIRS): Add etc subdirectory.
4542 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
4543 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
4544 yytoken, yyval, and yyloc declarations to...
4545 (yyparse or yypush_parse): ... here to improve performance. For
4546 yypush_parse invocations after the first, be sure to assign yyn its old
4547 value again.
4548 (yypstate_new): Don't bother initializing the yyresult field since the
4549 initial value isn't used.
4550 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
4551 remove the #define that, in push mode, set it to yyps->NAME.
4552 * etc/Makefile.am: New.
4553 * etc/bench.pl: Remove and build it instead from...
4554 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
4555 "tests/bison" from the build directory by default rather than just
4556 invoking "bison" from $PATH.
4557 (calc_grammar): Update push parser code: don't declare yylval globally,
4558 don't define yyparse_wrapper, and don't #define yyparse.
4559 (bench_grammar): Update to check all working combinations of yacc.c,
4560 push.c, impure, pure, pull, and push.
4561
4562 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
4563
4564 For push mode, add pull wrappers around yypush_parse.
4565 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
4566 (yypull_parse): New function wrapping yypush_parse.
4567 (yyparse): New #define wrapping yypull_parse.
4568 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
4569 is declared.
4570 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
4571 prototype yylex in the module that calls yyparse, and don't prototype
4572 yyparse there. Otherwise, the yyparse expansion won't compile.
4573 * tests/input.at (Torturing the Scanner): Likewise.
4574
4575 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
4576
4577 Enable push parsers to operate in impure mode. Thus, %push-parser no
4578 longer implies %pure-parser. The point of this change is to move
4579 towards being able to test the push parser code by running the entire
4580 test suite as if %push-parser had been declared.
4581 * data/push.c (yypush_parse): For impure mode, remove the
4582 yypushed_char, yypushed_val, and yypushed_loc arguments.
4583 Instead, declare these as local variables initialized to the global
4584 yychar, yylval, and yylloc.
4585 For the first yypush_parse invocation only, restore the initial values
4586 of these global variables when it's time to read a token since they
4587 have been overwritten.
4588 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
4589 %push-parser.
4590 * tests/calc.at (Simple LALR(1) Calculator): Always declare
4591 %pure-parser along with %push-parser since this test case was designed
4592 for pure push parsers.
4593 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
4594 (AT_YACC_OR_PUSH_IF): New.
4595 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
4596 add a note that it's still wrong for some cases (as it has been for a
4597 while).
4598 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
4599 %push-parser no longer implies %pure-parser.
4600
4601 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4602
4603 Remove some unnecessary differences between the pull parser code and
4604 the push parser code. This patch enables yynerrs in push mode.
4605 * data/push.c: Reformat M4 a little.
4606 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
4607 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
4608 because push mode is on. Instead, if pure mode is on, move yynerrs
4609 to...
4610 (b4_declare_parser_state_variables): ... here.
4611 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
4612 to yyps->NAME so it can be used in yypush_parse.
4613 (yypush_parse): Don't omit uses of yynerrs in push mode.
4614
4615 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4616
4617 Fix bug such that the first pushed token's value and location are
4618 sometimes overwritten (sometimes by %initial-action) before being used.
4619 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
4620 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
4621 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
4622 more closely mimic the pull parser logic.
4623 Don't copy the pushed token to yychar, yylval, and yylloc until it's
4624 time to read a token, which is after any initialization of yylval and
4625 yylloc.
4626 (gottoken): Rename label to...
4627 (yyread_pushed_token): ... for clarity and to avoid infringing on the
4628 user namespace.
4629
4630 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4631
4632 Rearrange initialization of the parser state variables so that the
4633 skeleton doesn't have to have a copy for pull mode and another for push
4634 mode. This patch also fixes at least a bug such that yylloc was not
4635 initialized (with b4_location_initial_line and
4636 b4_location_initial_column) upon calling yypush_parse. However, that
4637 initialization now overwrites the first token's location;
4638 %initial-action assigning @$ already did the same thing, and both bugs
4639 will be fixed in a later patch.
4640 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
4641 (b4_declare_parser_state_variables): Remove initialization of yytoken,
4642 yyss, yyvs, yyls, and yystacksize.
4643 (yypstate_new): Remove initialization of some yypstate fields: yystate,
4644 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
4645 yylsp.
4646 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
4647 yyps->NAME so it can be used in yypush_parse.
4648 (yyparse or yypush_parse): For yypush_parse, don't print the
4649 "Starting parse" diagnostic for invocations after the first.
4650 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
4651 yypush_parse, only do it for the first invocation.
4652 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
4653 initialization to occur in yypush_parse but only on the first
4654 invocation.
4655
4656 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
4657
4658 * data/push.c: Add CPP guards around push parser declarations in both
4659 the header and the code file.
4660 In the code file, move the push parser declarations to the same place
4661 they appear in the header file.
4662 Clean up the M4 some, especially the inconsistent underquoting in
4663 some b4_c_function_def and b4_c_function_decl uses.
4664
4665 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
4666
4667 Encapsulate the push parser state variables into an M4 macro so the
4668 push skeleton doesn't have to list them again for pull mode's yyparse.
4669 For push mode, remove yypush_parse's local equivalents of these
4670 variables to eliminate unnecessary copying between the two sets at
4671 run-time. This patch also fixes at least a bug related to multiple
4672 %initial-action invocations in push mode.
4673 * data/push.c (b4_declare_parser_variables): Rename to...
4674 (b4_declare_scanner_communication_variables): ... this for clarity and
4675 update both uses.
4676 (b4_declare_yyparse_variables): Remove and move its contents to the one
4677 spot where it was invoked.
4678 (b4_declare_parser_state_variables): New macro containing the parser
4679 state variables required by push mode.
4680 (struct yypstate): Replace all fields but yynew with
4681 b4_declare_parser_state_variables.
4682 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
4683 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
4684 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
4685 (yyparse or yypush_parse): For yyparse in pull mode, replace local
4686 parser state variable declarations with
4687 b4_declare_parser_state_variables.
4688 Don't initialize parser state variables when calling yypush_parse since
4689 yypstate_new already does that.
4690 Invoke the user's initial action only upon the first yypush_parse
4691 invocation.
4692 Remove all code that copies between the local parser state variables
4693 and the yypstate.
4694
4695 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
4696
4697 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
4698 prevent a name collision in a future patch where these names will
4699 sometimes be #define'd.
4700 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
4701 since it no longer has the same name as the existing argument.
4702 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
4703
4704 2006-12-19 Paolo Bonzini <bonzini@gnu.org>
4705 and Joel E. Denny <jdenny@ces.clemson.edu>
4706
4707 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
4708 that the argument is case-insensitive, and there's no `=' here.
4709 For the %skeleton entry, mention that %language is better.
4710 (Bison Options): Likewise for --language and --skeleton. Move the
4711 --skeleton entry so that the `Tuning the parser' section is sorted
4712 alphabetically on long options.
4713 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
4714 %language directive in detail here; cross-reference the %language
4715 documentation instead.
4716 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
4717 `%require "2.3b"' so that the example is always up-to-date.
4718 (Table of Symbols): Add entries for %language and %skeleton.
4719 * examples/extexi (normalize): Instead of replacing every %require
4720 argument with the current Bison version, just substitute for
4721 `@value{VERSION}'. This guarantees that we're testing what actually
4722 appears in the documentation.
4723 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
4724 rather than `@VERSION@'.
4725
4726 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
4727
4728 * NEWS: Reword the %language news a bit, and put it earlier.
4729
4730 * src/getargs.c (skeleton_arg): Last arg is now location const *.
4731 Rewrite to simplify the logic.
4732 (language_argmatch): Likewise.
4733 (program_name): We now own this var.
4734 * src/getargs.h (struct bison_language): Use char[] rather than
4735 const char *.
4736
4737 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
4738 Java is supported.
4739 * src/complain.c (program_name): Remove decl; no longer needed.
4740 * src/main.c (program_name): Remove; now belongs to getargs.
4741
4742 2006-12-18 Paolo Bonzini <bonzini@gnu.org>
4743
4744 * NEWS: Document %language.
4745
4746 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
4747
4748 * data/c-skel.m4, data/c++-skel.m4: New files.
4749 * data/glr.c: Complain on push parsers.
4750
4751 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
4752 over %skeleton.
4753 (Decl Summary): Document %language and %skeleton.
4754 (Command line): Document -L.
4755
4756 * examples/extexi: Rewrite %require directive.
4757 * examples/calc++/Makefile.am: Pass VERSION to extexi.
4758
4759 * src/files.c (compute_exts_from_gc): Look in language structure
4760 for .y extension.
4761 (compute_file_name_parts): Check whether .tab should be added.
4762 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
4763 (language, skeleton_arg, language_argmatch): New.
4764 (long_options): Add --language.
4765 (getargs): Use skeleton_arg, add -L/--language.
4766 * src/getargs.h: Include location.h.
4767 (struct bison_language, language, skeleton_arg, language_argmatch): New.
4768 * src/output.c (prepare): Pick default skeleton from struct language.
4769 Don't dispatch C skeletons here.
4770 * src/parse-gram.y (PERCENT_LANGUAGE): New.
4771 (prologue_declaration): Add "%language" rule, use skeleton_arg.
4772 * src/scan-gram.l ("%language"): New rule.
4773
4774 * tests/calc.at: Test %skeleton and %language.
4775 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
4776 (AT_GLR_IF): Look for %skeleton "glr.cc".
4777 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
4778 (AT_YACC_IF): Reject %language.
4779
4780 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
4781
4782 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
4783 since it wasn't used; only the typedef name 'semantic_type' is needed.
4784 Also, omit trailing white space.
4785
4786 * bootstrap: Sync from coreutils.
4787 (gnulib_extra_files): Add build-aux/announce.gen.
4788 (slurp): Adjust .gitignore files like .cvsignore files.
4789 * build-aux/announce-gen: Remove from CVS, since bootstrap
4790 now creates this.
4791
4792 2006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
4793
4794 Make %push-parser imply %pure-parser. This fixes several bugs; see
4795 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
4796 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
4797 pure_parser = true.
4798 * data/push.c: Don't bother testing b4_push_if when deciding whether
4799 to expand b4_declare_parser_variables globally.
4800 (yypush_parse): Likewise in here.
4801
4802 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
4803 (yy_reduce_print): Reformat M4 for readability.
4804
4805 2006-12-15 Bob Rossi <bob@brasko.net>
4806 and Joel Denny <jdenny@ces.clemson.edu>
4807
4808 * data/push.c (yypstate): Add typedef, and update all uses of
4809 struct yypstate to just yypstate.
4810 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
4811
4812 2006-12-14 Bob Rossi <bob@brasko.net>
4813
4814 * data/push.c (yypush_parse): Declare prototype regardless of
4815 %locations option.
4816
4817 2006-12-14 Bob Rossi <bob@brasko.net>
4818
4819 * data/push.c (yyparse): Remove the prototype and the #define when in
4820 push-parser mode.
4821
4822 2006-12-13 Bob Rossi <bob@brasko.net>
4823
4824 * data/push.c (yypstate_init): Rename to...
4825 (yypstate_new): ... this and use b4_c_function_def.
4826 (yypstate_delete): New.
4827 (yypush_parse): Change parameters yynval and yynlloc to be const.
4828 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
4829 yypstate_delete functions.
4830
4831 2006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
4832
4833 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
4834 strange test case titles. Reported by Bob Rossi.
4835
4836 2006-12-13 Paul Eggert <eggert@cs.ucla.edu>
4837
4838 * TODO: Add pointer to Sylvain Schmitz's work on static detection
4839 of potential ambiguities in GLR grammers.
4840
4841 2006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
4842
4843 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
4844 `bison ', use m4_index instead of m4_substr since chopping up a string
4845 containing M4-special characters causes problems here.
4846
4847 Fix a couple of bugs related to special characters in user-specified
4848 file names, and make it easier for skeletons to compute output file
4849 names with the same file name prefix as Bison-computed output file
4850 names.
4851 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
4852 b4_parser_file_name and b4_spec_defines_file instead of
4853 @output_parser_name@ and @output_header_name@, which are now redundant.
4854 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
4855 b4_parser_file_name, b4_spec_defines_file, and the new
4856 @basename(FILENAME@) instead of @output_parser_name@ and
4857 @output_header_name@, which inappropriately escaped the file names as
4858 C string literals.
4859 * src/files.c (all_but_ext): Remove static qualifier.
4860 (compute_output_file_names): Move `free (all_but_ext)' to...
4861 (output_file_names_free): ... here since all_but_ext is needed later.
4862 * src/files.h (all_but_ext): Extern.
4863 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
4864 exactly what MUSCLE_INSERT_STRING used to do.
4865 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
4866 characters are escaped properly.
4867 * src/output.c (prepare): Define muscle file_name_all_but_ext as
4868 all_but_ext.
4869 For pkgdatadir muscle, maintain previous functionality by using
4870 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
4871 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
4872 digraphs would never be expanded. Hopefully no one has M4-special
4873 characters in his Bison installation path.
4874 * src/scan-skel.l: Don't parse @output_header_name@ and
4875 @output_parser_name@ anymore since they're now redundant.
4876 In @output, use decode_at_digraphs.
4877 Parse a new @basename command that invokes last_component.
4878 (decode_at_digraphs): New.
4879 (BASE_QPUTS): Remove unused.
4880 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
4881 (Output file name): New tests.
4882
4883 2006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
4884
4885 Warn about output files that are generated by the skeletons and that
4886 conflict with other output files.
4887 * data/glr.c: Don't generate the header file here when glr.cc does.
4888 * src/files.c (file_names, file_names_count): New static globals.
4889 (compute_output_file_names): Invoke output_file_name_check for files
4890 not generated by the skeletons and remove existing checks.
4891 (output_file_name_check): New function that warns about conflicting
4892 output file names.
4893 (output_file_names_free): Free file_names.
4894 * src/files.h (output_file_name_check): Declare.
4895 * src/scan-skel.l: Invoke output_file_name_check for files generated by
4896 the skeletons.
4897 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
4898 (Conflicting output files): New tests.
4899
4900 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4901
4902 * doc/bison.texinfo: Fix a couple of typos.
4903
4904 2006-12-08 Bob Rossi <bob@brasko.net>
4905
4906 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
4907 Rename to...
4908 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
4909 update all uses.
4910 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
4911 (yypush_parse): Rename yypvars argument to yyps and remove redundant
4912 local pv.
4913 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
4914 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
4915
4916 2006-12-07 Bob Rossi <bob@brasko.net>
4917 and Joel Denny <jdenny@ces.clemson.edu>
4918
4919 * data/push.c (yypvarsinit): Change return type from void* to struct
4920 yypvars*. No longer cast to void* on return.
4921 (struct yypvars): Remove yylen since it need not be remembered between
4922 yypushparse invocations.
4923 (yypushparse): Don't copy between yylen and pv->yylen.
4924
4925 2006-12-05 Bob Rossi <bob@brasko.net>
4926
4927 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
4928 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
4929 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
4930 (struct yypvars): Remove b4_declare_parser_variables.
4931 (yypvarsinit): Remove init code for removed variables.
4932 (global scope): Do not declare b4_declare_parser_variables if
4933 push or pure mode.
4934 (yypushparse): Add b4_declare_parser_variables.
4935 Init new local variables, and remove init code for removed
4936 yypvars variables.
4937 (yyparse): Delete.
4938 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
4939 and yyparse for other modes.
4940 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
4941 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
4942 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
4943 (AT_PURE_LEX_IF): True if pure or push parser.
4944
4945 2006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
4946
4947 Document Yacc prologue alternatives and default %destructor's and
4948 %printer's as experimental. Don't mention Java yet. Discussed at
4949 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
4950 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
4951 (2.3a): Annotate this entry to say the old forms of these features were
4952 also experimental.
4953 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
4954 Table of Symbols): Say they're experimental. Comment out any mention
4955 of Java (we'll want this back eventually).
4956
4957 2006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
4958
4959 Support a file name argument to %defines. Deprecate `=' in
4960 %file-prefix, %name-prefix, and %output. Discussed at
4961 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
4962 * NEWS (2.3a+): Mention.
4963 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
4964 form of %defines, and remove `=' from entries for %file-prefix,
4965 %name-prefix, and %output.
4966 * src/parse-gram.y (prologue_declaration): Implement.
4967 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
4968 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
4969 all but one occurrence of %name-prefix.
4970 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
4971 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
4972 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
4973 occurrence of each of %file-prefix and %output. Add check for %defines
4974 with argument.
4975 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
4976 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
4977 Remove the `=' from %output.
4978
4979 2006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
4980
4981 Don't escape $ in test case titles since Autoconf 2.61 now does that
4982 correctly.
4983 * tests/actions.at (Default %printer and %destructor are not for error
4984 or $undefined): Here.
4985 (Default %printer and %destructor are not for $accept): Here.
4986 * tests/input.at (Invalid $n and @n): Here.
4987
4988 2006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
4989
4990 Rename <!> to <>. Discussed starting at
4991 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
4992 * NEWS (2.3a+): Update.
4993 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
4994 Update.
4995 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
4996 * src/scan-gram.l (INITIAL): Implement.
4997 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
4998 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
4999 comment.
5000 * tests/actions.at (Default tagless %printer and %destructor,
5001 Default tagged and per-type %printer and %destructor,
5002 Default %printer and %destructor are not for error or $undefined,
5003 Default %printer and %destructor are not for $accept,
5004 Default %printer and %destructor for mid-rule values): Update.
5005 * tests/input.at (Default %printer and %destructor redeclared,
5006 Unused values with default %destructor): Update.
5007
5008 2006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
5009
5010 Don't let %prec take a nonterminal.
5011 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
5012 token.
5013 * tests/input.at (%prec takes a token): New test checking that %prec
5014 won't take a nonterminal.
5015
5016 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
5017
5018 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
5019 it was double-quoted.
5020 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
5021 grammar is maintained with Bison's highest standards.
5022 * src/getargs.c: Fix some typos in Doxygen comments.
5023
5024 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
5025
5026 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
5027 later. Reported by Paul Eggert in
5028 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
5029 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
5030 * src/scan-code.l (translate_action): Don't bother invoking
5031 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
5032 (code_scanner_free): Instead of invoking
5033 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
5034 which frees more.
5035 * src/scan-gram.l (gram_scanner_free): Likewise.
5036 * src/scan-skel.l (scan_skel): Likewise.
5037
5038 2006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
5039
5040 * src/files.c (tr): Change return type to void.
5041 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
5042 has been called previously for the same key.
5043 (muscle_find): Return storage instead of value so that
5044 --enable-gcc-warnings doesn't produce warnings that the return discards
5045 const. aver that the value and storage are the same since storage
5046 could potentially be NULL when value is not.
5047 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
5048 same as 0.
5049
5050 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
5051
5052 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
5053 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
5054 us a slightly cleaner distribution, and also works.
5055 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
5056 gnulib changes.
5057
5058 2006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
5059 and Paul Eggert <eggert@cs.ucla.edu>
5060
5061 Don't let Bison leak memory except when it complains.
5062 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
5063 (spec_defines_file, dir_prefix): Now char *, not const char *,
5064 since they are freed.
5065 * src/files.c: Likewise.
5066 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
5067 Likewise.
5068 (tr): Now operates in-place. All uses changed.
5069 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
5070 values.
5071 (compute_file_name_parts, compute_output_file_names): Don't store
5072 read-only data in variables that will be freed.
5073 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
5074 src_extension, and header_extension.
5075 (output_file_names_free): New public function to free
5076 spec_verbose_file, spec_graph_file, spec_defines_file,
5077 parser_file_name, and dir_prefix.
5078 * src/getargs.c (getargs): Don't store read-only data in variables that
5079 will be freed.
5080 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
5081 (which previously existed but was unused), and quotearg_free.
5082 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
5083 * src/muscle_tab.c: Likewise.
5084 (muscle_entry): Make the value char const *,
5085 and add a new storage member that is char * and can be freed.
5086 (muscle_entry_free): New private function.
5087 (muscle_init): Use it instead of free.
5088 (muscle_insert, muscle_grow): Update and use new storage member.
5089 (muscle_code_grow): Free the string passed to muscle_grow
5090 since it's not needed anymore.
5091 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
5092 add a new `char *code' member.
5093 ("{...}"): Declare semantic type as code.
5094 * src/scan-code.h (translate_rule_action):
5095 (translate_symbol_action, translate_code, translate_action): Return
5096 `char const *' rather than `char *' since external code should not free
5097 these strings.
5098 * src/scan-code.l: Likewise.
5099 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
5100 which is "{...}" in the parser.
5101 * tests/Makefile.am (maintainer-check-valgrind): Set
5102 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
5103 Valgrind.
5104 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
5105 complain.
5106 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
5107 expecting a non-zero exit status sets --leak-check=summary and
5108 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
5109 this case, and we don't want to hear about it.
5110
5111 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
5112
5113 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
5114 instead of from the template, to simplify configuration a bit.
5115 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
5116 and m4/wint_t.m4, as they are needed with the latest gnulib.
5117
5118 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
5119
5120 Disable unset/unused mid-rule value warnings by default, and recognize
5121 --warnings=midrule-values to enable them. Discussed starting at
5122 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
5123 * NEWS (2.3a+): Mention.
5124 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
5125 warnings): Add entry for midrule-values subargument.
5126 * src/reader.c (symbol_should_be_used): Don't return true just because
5127 the value is a set/used mid-rule value unless
5128 --warnings=midrule-values was specified.
5129 * tests/input.at (Unused values, Unused values before symbol
5130 declarations): Run tests with and without --warnings=midrule-values.
5131
5132 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
5133 than LIST_FREE directly.
5134
5135 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
5136
5137 Finish implementing --warnings=error, which should not be implied by
5138 --warnings=all (or by its synonyms -W and --warnings without
5139 subarguments).
5140 * src/complain.c (set_warning_issued): New function to report that
5141 warnings are being treated as errors and to record an error if so.
5142 Invoke...
5143 (warn_at, warn): ... here.
5144 * src/getargs.c (warnings_args, warnings_types): Reorder so that
5145 "error - warnings are errors" does not appear above "all - all of the
5146 above".
5147 (getargs): For -W and --warnings without subarguments, don't let
5148 FLAGS_ARGMATCH set warnings_error in warnings_flag.
5149 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
5150
5151 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
5152
5153 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
5154 empty subargument list. For example: `bison --warnings= parser.y'.
5155
5156 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
5157
5158 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
5159 the parser header file so that gcc doesn't warn.
5160
5161 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
5162
5163 Split the default %destructor/%printer into two kinds: <*> and <!>.
5164 Discussed starting at
5165 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
5166 * NEWS (2.3a+): Mention.
5167 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
5168 previous change today related to mid-rules.
5169 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
5170 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
5171 (TYPE_TAG_ANY): Add as <*>.
5172 (TYPE_TAG_NONE): Add as <!>.
5173 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
5174 for <*> and <!>.
5175 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
5176 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
5177 * src/symlist.c (symbol_list_default_new): Split into tagged and
5178 tagless versions.
5179 (symbol_list_destructor_set, symbol_list_printer_set): Split
5180 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
5181 SYMLIST_DEFAULT_TAGLESS.
5182 * src/symlist.h: Update symbol_list_default*_new prototypes.
5183 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
5184 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
5185 * src/symtab.c (default_destructor, default_destructor_location,
5186 default_printer, default_printer_location): Split each into tagged and
5187 tagless versions.
5188 (symbol_destructor_get, symbol_destructor_location_get,
5189 symbol_printer_get, symbol_printer_location_get): Implement tagged
5190 default and tagless default cases.
5191 (default_destructor_set, default_printer_set): Split each into tagged
5192 and tagless versions.
5193 * src/symtab.h: Update prototypes.
5194 * tests/actions.at (Default %printer and %destructor): Rename to...
5195 (Default tagless %printer and %destructor): ... this, and extend.
5196 (Per-type %printer and %destructor): Rename to...
5197 (Default tagged and per-type %printer and %destructor): ... this, and
5198 extend.
5199 (Default %printer and %destructor for user-defined end token): Extend.
5200 (Default %printer and %destructor are not for error or $undefined):
5201 Update.
5202 (Default %printer and %destructor are not for $accept): Update.
5203 (Default %printer and %destructor for mid-rule values): Extend.
5204 * tests/input.at (Default %printer and %destructor redeclared): Extend.
5205 (Unused values with default %destructor): Extend.
5206
5207 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
5208
5209 Don't apply the default %destructor/%printer to an unreferenced midrule
5210 value. Mentioned at
5211 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
5212 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
5213 like $@n instead of just @n so that the default %destructor/%printer
5214 logic doesn't see them as user-defined symbols.
5215 (symbol_is_dummy): Check for both forms of the name.
5216 * src/reader.c (packgram): Remove the `$' from each midrule symbol
5217 name for which the midrule value is referenced in any action.
5218 * tests/actions.at (Default %printer and %destructor for mid-rule
5219 values): New test.
5220 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
5221 for change to dummy symbol names.
5222
5223 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
5224
5225 Warn about unset midrule $$ if the corresponding $n is used.
5226 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
5227 $n usage.
5228 (packgram): Before invoking grammar_rule_check on any rule, make sure
5229 all actions have already been scanned in order to set `used' flags.
5230 Otherwise, checking that a midrule's $$ is set will not always work
5231 properly because the midrule check must forward-reference the midrule's
5232 parent rule.
5233 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
5234 warning.
5235
5236 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
5237
5238 More improvements to the documentation of the prologue alternatives:
5239 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
5240 Bison manual.
5241 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
5242 some text to clarify the relative importance of the new directives and
5243 to show how these directives may be viewed as code labels.
5244
5245 2006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
5246
5247 Similar to the recently removed %before-header, add %code-top as the
5248 alternative to the pre-prologue. Mentioned at
5249 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
5250 Also, let the prologue alternatives appear in the grammar section.
5251 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
5252 (prologue_declaration): Move the existing prologue alternatives to...
5253 (grammar_declaration): ... here and add %code-top.
5254 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
5255
5256 Clean up and extend documentation for the prologue alternatives.
5257 * NEWS (2.3a+): Describe prologue alternatives.
5258 * doc/bison.texinfo (Prologue): Move discussion of prologue
5259 alternatives to...
5260 (Prologue Alternatives): ... this new section, and extend it to discuss
5261 all 4 directives in detail.
5262 (Table of Symbols): Clean up discussion of prologue alternatives and
5263 add %code-top.
5264
5265 2006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5266
5267 DJGPP specific issues.
5268
5269 * djgpp/config.bat: config.hin has been moved to lib. Adjust
5270 config.bat accordingly.
5271 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
5272 * djgpp/config.site: Likewise.
5273
5274 2006-10-16 Paolo Bonzini <bonzini@gnu.org>
5275
5276 Replace %*-header with %provides, %requires, %code. See discussion at
5277 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
5278
5279 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
5280 (b4_user_start_header): Remove.
5281 * data/glr.c: Use new macros instead of b4_*start_header
5282 and b4_*end_header.
5283 * data/glr.cc: Likewise.
5284 * data/lalr1.cc: Likewise.
5285 * data/push.c: Likewise.
5286 * data/yacc.c: Likewise.
5287
5288 * doc/bison.texinfo: Remove %before-header, rename
5289 %{start,end,after}-header to %requires, %provides, %code.
5290
5291 * src/parse-gram.y: Likewise (also rename token names accordingly).
5292 * src/scan-gram.l: Likewise.
5293 * tests/actions.at: Likewise.
5294
5295 2006-10-14 Paul Eggert <eggert@cs.ucla.edu>
5296
5297 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
5298 Problem reported by Joel E. Denny.
5299
5300 2006-10-14 Jim Meyering <jim@meyering.net>
5301
5302 (Sync from coreutils.)
5303 Work also when the working directory (with e.g. coreutils sources)
5304 is version controlled with git, rather than CVS.
5305 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
5306 rather than CVS.
5307 In messages and comments, say e.g., "checked-out sources",
5308 rather than "CVS sources".
5309 (version_controlled_file): New function. Work for git as well as
5310 for CVS. Don't use grep's -q option.
5311 (slurp): Call it here, in place of CVS-specific code.
5312
5313 2006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
5314
5315 Fix testsuite for ./configure --enable-gcc-warnings:
5316 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
5317 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
5318 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
5319 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
5320 * test/regression.at (Diagnostic that expects two alternatives):
5321 Likewise.
5322
5323 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
5324
5325 * bootstrap.conf (gnulib_modules): Add config-h.
5326 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
5327 worry about HAVE_CONFIG_H.
5328 * lib/abitset.c: Likewise.
5329 * lib/bitset.c: Likewise.
5330 * lib/bitset_stats.c: Likewise.
5331 * lib/bitsetv-print.c: Likewise.
5332 * lib/bitsetv.c: Likewise.
5333 * lib/ebitset.c: Likewise.
5334 * lib/get-errno.c: Likewise.
5335 * lib/lbitset.c: Likewise.
5336 * lib/subpipe.c: Likewise.
5337 * lib/timevar.c: Likewise.
5338 * lib/vbitset.c: Likewise.
5339 * lib/bitset.c: Include "bitset.h" first, to test interface.
5340 * lib/bitset_stats.c: Include "bitset_stats.h" first.
5341 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
5342 * lib/bitsetv.c: Include "bitsetv.h" first.
5343 * lib/get-errno.c: Include "get-errno.h" first.
5344 * m4/.cvsignore: Add config-h.m4.
5345 * tests/actions.at (Default %printer and %destructor for ...):
5346 Adjust expected line numbers in output to reflect removal of #if
5347 HAVE_CONFIG_H lines.
5348 * tests/glr-regression.at (Missed %merge type warnings when ...):
5349 Likewise.
5350 * tests/regression.at (Braced code in declaration in rules section):
5351 Likewise.
5352 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
5353 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
5354 Include <config.h> unconditionally.
5355
5356 * bootstrap: Sync from coreutils, as follows:
5357
5358 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
5359
5360 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
5361 variable was sometimes used without being initialized. This
5362 messed up the installation of the INSTALL file in some cases.
5363
5364 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
5365
5366 * bootstrap (usage, main program, symlink_to_gnulib): Add option
5367 --copy. Inspired by a suggestion from Bruno Haible.
5368
5369 2006-10-03 Jim Meyering <jim@meyering.net>
5370
5371 * bootstrap: Undo last change to this file, since now gnulib-tool
5372 sticks with the automake default in generating dependencies.
5373
5374 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
5375
5376 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
5377 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
5378
5379 * doc/bison.1: Add copyright notice.
5380
5381 * data/glr.c: Don't include <stdarg.h>; not used.
5382
5383 * NEWS: The -g and --graph options now output graphs in Graphviz
5384 DOT format, not VCG format.
5385 * doc/bison.1: Likewise.
5386 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
5387 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
5388 of this change in
5389 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
5390 * TODO: Remove Graphviz entry.
5391 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
5392 remove vcg.c, vcg.h, vcg_defaults.h.
5393 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
5394 * src/graphviz.c, src/graphviz.h: New files.
5395 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
5396 * src/files.h: Make comment more generic.
5397 * src/main.c (main): Likewise.
5398 * src/print_graph.h: Likewise.
5399 * src/getargs.c (usage): Make usage description more generic.
5400 * src/print_graph.c: Include graphviz.h rather than vcg.h.
5401 (static_graph, fgraph): Remove. All uses changed to pass
5402 arguments instead of sharing a static var.
5403 (print_core, print_actions, print_state, print_graph):
5404 Output graphviz format rather than VCG format.
5405 * tests/.cvsignore: Remove *.vcg; add *.dot.
5406 * tests/output.at: Expect *.dot files, not *.vcg files.
5407
5408 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
5409 accommodates the 2006-10-08 change.
5410
5411 2006-10-11 Bob Rossi <bob@brasko.net>
5412
5413 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
5414 (b4_yyssa, b4_yyerror_range): New macros.
5415 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
5416 (yypvarsinit): Remove init of removed fields.
5417 (yypushparse): Remove use of removed fields; use new macros instead.
5418
5419 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
5420
5421 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
5422 in a push parser. Reindent slightly to match yacc.c better.
5423
5424 2006-10-11 Bob Rossi <bob@brasko.net>
5425
5426 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
5427 yymsg_alloc fields.
5428 (yypvarsinit, yypushparse): Remove init of removed fields.
5429 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
5430
5431 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
5432
5433 * THANKS: Add Paolo Bonzini and Bob Rossi.
5434
5435 2006-10-08 Paolo Bonzini <bonzini@gnu.org>
5436
5437 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
5438 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
5439 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
5440 b4_define_user_cde and uses): Remove.
5441 (b4_comment, b4_prefix, b4_sync_start): New.
5442 * data/bison.m4: New file, with most of the content removed from c.m4.
5443 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
5444 * src/output.c (output_skeleton): Pass bison.m4.
5445 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
5446 only if specified.
5447
5448 2006-10-05 Paul Eggert <eggert@cs.ucla.edu>
5449
5450 Fix test failure reported by Tom Lane in
5451 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
5452 and try to make such failures easier to catch in the future.
5453 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
5454 that's now the caller's responsibility.
5455 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
5456 Set yychar = YYEOF if it's negative.
5457 * tests/actions.at (yylex): Abort if asked to read past EOF.
5458 * tests/conflicts.at (yylex): Likewise.
5459 * tests/cxx-type.at (yylex): Likewise.
5460 * tests/glr-regression.at (yylex): Likewise.
5461 * tests/input.at (yylex): Likewise.
5462 * tests/regression.at (yylex): Likewise.
5463 * tests/torture.at (yylex): Likewise.
5464
5465 2006-10-01 Paul Eggert <eggert@cs.ucla.edu>
5466
5467 Fix problems with translating English-language diagnostics.
5468 * bootstrap: Fix bug introduced in recent bootstrap changes, with
5469 respect to bison-runtime pot generation. The YY_ stuff
5470 wasn't being captured.
5471 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
5472 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
5473 * runtime-po/POTFILES.in: Add data/push.c.
5474
5475 2006-09-29 Paul Eggert <eggert@cs.ucla.edu>
5476
5477 Merge bootstrap changes from coreutils.
5478
5479 2006-09-28 Jim Meyering <jim@meyering.net>
5480
5481 Automatically generated dependencies are important even
5482 when all of the sources in a directory come from gnulib.
5483 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
5484 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
5485
5486 2006-09-23 Jim Meyering <jim@meyering.net>
5487
5488 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
5489
5490 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
5491
5492 * bootstrap: Add support for --force.
5493 (usage): New function. Describe usage less tersely.
5494 (CVS_only_file): New var.
5495
5496 2006-09-21 Paul Eggert <eggert@cs.ucla.edu>
5497
5498 * data/push.c (YYPUSH_MORE): Make it an enum instead.
5499 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
5500 Adjust white space and comments to match GNU style better.
5501
5502 2006-09-20 Bob Rossi <bob@brasko.net>
5503
5504 * data/push.c (yyresult_get): Remove function.
5505 (YYPUSH_MORE): Add #define.
5506 (yypushparse): Modify return value.
5507
5508 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
5509
5510 * stamp-h.in: Remove; no longer needed.
5511 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
5512 Remove config.h, config.hin, intl (no longer created).
5513 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
5514 stamp-h1.
5515
5516 Sync bootstrap from coreutils, as follows:
5517
5518 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
5519
5520 * bootstrap (symlink_to_gnulib): New function.
5521 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
5522 to copies-of-gnulib.
5523 (cp_mark_as_generated, slurp, gnulib_files):
5524 Avoid making a copy if it's the same as the old version.
5525 (gnulib_files): Add support for this variable (used by Bison).
5526
5527 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
5528
5529 * src/getargs.c (usage): Rework to use conventions similar to
5530 coreutils, to make translation a bit easier and the code a bit
5531 smaller. Problem reported by Tim Van Holder.
5532
5533 2006-09-15 Paul Eggert <eggert@cs.ucla.edu>
5534
5535 Use some of gnulib's new modules, taken from coreutils.
5536
5537 * bootstrap: Sync from coreutils, except add support for gnulib_files.
5538 * bootstrap.conf: New file.
5539 (gnulib_modules): Add configmake, inttypes, unistd.
5540 (XGETTEXT_OPTIONS): Add complain, complain_at,
5541 fatal, fatal_at, warn, warn_at, unexpected_end.
5542 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
5543 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
5544 (gl_EARLY): Add.
5545 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
5546 (gl_INIT): Add
5547 (GNULIB_AUTOCONF_SNIPPET): Remove.
5548 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
5549 the pickiest.
5550 * lib/.cvsignore: Add inttypes_.h.
5551 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
5552 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
5553 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
5554 no-longer-necessary initializations.
5555 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
5556 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
5557 use the unistd module.
5558 * src/system.h: Likewise.
5559 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
5560 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
5561 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
5562 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
5563 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
5564 * src/system.h: Include inttypes.h unconditionally, now that we
5565 use the inttypes module. Don't bother to include stdint.h, since
5566 inttypes.h now does that for us.
5567 (LOCALEDIR): Remove, now that we use the configmake module.
5568 * src/getargs.c: Include configmake.h.
5569 * src/main.c: Likewise.
5570 * src/output.c: Likewise.
5571 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
5572 not from $abs_top_builddir, since config.h moved.
5573
5574
5575 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
5576 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
5577
5578 * src/parse-gram.y (symbol_declaration): Don't put statements
5579 before declarations; it's not portable to C89.
5580 * src/scan-code.l (handle_action_at): Likewise.
5581
5582 * src/scan-code.l: Always initialize braces_level; the old code
5583 left it uninitialized and therefore had undefined behavior.
5584
5585 Don't attempt to redefine 'assert', since it runs afoul of
5586 systems where standard headers (mistakenly) include <assert.h>.
5587 Instead, define and use our own alternative, called 'aver'.
5588 * src/reader.c: Don't include assert.h, since we no longer
5589 use assert.
5590 * src/scan-code.l: Likewise.
5591 * src/system.h (assert): Remove, replacing with....
5592 (aver): New function, taking a bool arg. All uses changed.
5593 * src/tables.c (pack_vector): Ensure that aver arg is bool,
5594 not merely an integer.
5595
5596 2006-09-15 Bob Rossi <bob@brasko.net>
5597
5598 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
5599 * data/c.m4 (YYPUSH): New.
5600 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
5601 * src/getargs.c (push_parser): New var.
5602 * src/getargs.h (push_parser): New declaration.
5603 * src/output.c (prepare): Add macro insertion of `push_flag'.
5604 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
5605 (prologue_declaration): Parse %push-parser.
5606 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
5607 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
5608 list of removed lines from the traces observed.
5609 (AT_CHECK_CALC_LALR): Added push parser tests.
5610
5611 2006-09-13 Paul Eggert <eggert@cs.ucla.edu>
5612
5613 * NEWS: Version 2.3a.
5614 * configure.ac (AC_INIT): Likewise.
5615
5616 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
5617 "#define YYSTYPE int" that caused "make maintainer-check" to fail
5618 due to header ordering dependencies. I don't know why the #define
5619 was there.
5620
5621 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
5622 runtime cost when YYDEBUG is not defined, and so that some tests
5623 that used to fail now work. Problem and initial suggestion by
5624 Paolo Bonzini.
5625 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
5626 * data/glr.cc (b4_parser_class_name):
5627 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
5628 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
5629 (yydebug_) [YYDEBUG]: New member.
5630 (yycdebug_): Now defined only if YYDEBUG.
5631 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
5632 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
5633 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
5634 if YYYDEBUG.
5635 (debug_stream, set_debug_stream, debug_level, set_debug_level):
5636 Define only if YYDEBUG.
5637 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
5638 set_debug_level.
5639 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
5640 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
5641 AT_CHECK_CALC_GLR_CC that are working now.
5642
5643 2006-09-12 Paul Eggert <eggert@cs.ucla.edu>
5644
5645 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
5646 We don't need them in glr.cc, and glr.c defines them.
5647 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
5648 assumes that defining it to anything is the same as defining
5649 it to 1. Problem reported by Paolo Bonzini.
5650
5651 2006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
5652
5653 * data/c.m4 (b4_null, b4_case): Define.
5654 * src/output.c (prepare_symbols): Use b4_null.
5655 (user_actions_output): Use b4_case.
5656
5657 2006-09-11 Paul Eggert <eggert@cs.ucla.edu>
5658
5659 * data/glr.c (b4_shared_declarations): Put start-header first,
5660 before any #includes that we generate, so that feature-test
5661 macros work. Problem reported by Michael Deutschmann in
5662 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
5663 * data/lalr1.cc: Likewise.
5664 * doc/bison.texinfo (Prologue): Document that feature-test macros
5665 should be defined before any Bison declarations.
5666 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
5667 that depend on location.hh after, not before, Bison decls, since
5668 we now include location.hh after the first user prologue.
5669
5670 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
5671 Sander Brandenburg in
5672 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
5673 Also, fix minor white space and comment issues.
5674 (Prologue): Mention that it's better to define feature-test macros
5675 before Bison declarations. Problem reported by Michael Deutschmann.
5676
5677 * README-cvs: Fix typo: "&" should be "&&". Problem reported
5678 by Jim Meyering.
5679 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
5680 This adjusts to recent gnulib changes.
5681
5682 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
5683
5684 Finish implementation of per-type %destructor/%printer. Discussed
5685 starting at
5686 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
5687 and
5688 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
5689 * NEWS (2.3+): Add a description of this feature to the default
5690 %destructor/%printer description.
5691 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
5692 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
5693 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
5694 list node contains a semantic type.
5695 * src/symtab.c, src/symtab.h: Extend with a table that associates
5696 semantic types with their %destructor's and %printer's.
5697 (semantic_type_from_uniqstr, semantic_type_get,
5698 semantic_type_destructor_set, semantic_type_printer_set): New functions
5699 composing the public interface of that table.
5700 (symbol_destructor_get, symbol_destructor_location_get,
5701 symbol_printer_get, symbol_printer_location_get): If there's no
5702 per-symbol %destructor/%printer, look up the per-type before trying
5703 the default.
5704 * tests/actions.at (Per-type %printer and %destructor): New test case.
5705 * tests/input.at (Default %printer and %destructor redeclared):
5706 Extend to check that multiple occurrences of %symbol-default in a
5707 single %destructor/%printer declaration is an error.
5708 (Per-type %printer and %destructor redeclared, Unused values with
5709 per-type %destructor): New test cases.
5710
5711 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
5712
5713 Require default %destructor/%printer to be declared using
5714 %symbol-default instead of an empty symbol list, and start working on
5715 new per-type %destructor/%printer. Discussed at
5716 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
5717 * NEWS (2.3+): Add %symbol-default to example.
5718 * bison.texinfo (Freeing Discarded Symbols): Likewise.
5719 (Table of Symbols): Add entry for %symbol-default.
5720 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
5721 (generic_symlist, generic_symlist_item): New nonterminals for creating
5722 a list in which each item is a symbol, semantic type, or
5723 %symbol-default.
5724 (grammar_declaration): Use generic_symlist in %destructor and %printer
5725 declarations instead of symbols.1 or an empty list.
5726 (symbol_declaration, precedence_declaration, symbols.1): Update actions
5727 for changes to symbol_list.
5728 * src/reader.c: Update for changes to symbol_list.
5729 * src/scan-code.l: Likewise.
5730 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
5731 * src/symlist.c, src/symlist.h: Extend such that a list node may
5732 represent a semantic type or a %symbol-default in addition to just an
5733 ordinary symbol. Add switched functions for setting %destructor's and
5734 %printer's.
5735 * tests/actions.at, tests/input.at: Add %symbol-default to all default
5736 %destructor/%printer declarations.
5737
5738 2006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
5739
5740 Whether the default %destructor/%printer applies to a particular symbol
5741 isn't a question of whether the user *declares* that symbol (in %token,
5742 for example). It's a question of whether the user by any means
5743 *defines* the symbol at all (by simply using a char token, for
5744 example). $end is defined by Bison whereas any other token with token
5745 number 0 is defined by the user. The error token is always defined by
5746 Bison regardless of whether the user declares it with %token, but we
5747 may one day let the user define error as a nonterminal instead.
5748 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
5749 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
5750 the meaning of "user-defined".
5751 * tests/actions.at (Default %printer and %destructor for user-declared
5752 end token): Rename to...
5753 (Default %printer and %destructor for user-defined end token): ...
5754 this.
5755
5756 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
5757 computation of whether to apply the default, don't maintain a list of
5758 every Bison-defined symbol. Instead, just check for a first character
5759 of '$', which a user symbol cannot have, and check for the error token.
5760
5761 2006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
5762
5763 Don't apply the default %destructor or %printer to the error token,
5764 $undefined, or $accept. This change fits the general rule that the
5765 default %destructor and %printer are only for user-declared symbols,
5766 and it solves several difficulties that are described in the new test
5767 cases listed below.
5768 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
5769 * tests/actions.at (Default %printer and %destructor are not for error
5770 or $undefined, Default %printer and %destructor are not for $accept):
5771 New test cases.
5772
5773 2006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
5774
5775 Allow %start after the first rule.
5776 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
5777 when parsing the first rule.
5778 (check_and_convert_grammar): Search for it here after all grammar
5779 declarations have been parsed. Skip midrules, which have dummy LHS
5780 nonterminals.
5781 * src/symtab.c (symbol_is_dummy): New function.
5782 * src/symtab.h (symbol_is_dummy): Declare it.
5783 * tests/input.at (%start after first rule): New test.
5784
5785 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
5786
5787 Redo some of the previous commit: add back the ability to use
5788 non-aliased/undeclared string literals since it might be useful to
5789 those declaring %token-table.
5790 * src/reader.c (check_and_convert_grammar): Undo changes in previous
5791 commit: don't worry about complaints from symbols_pack.
5792 * src/symtab.c (symbol_new, symbol_class_set,
5793 symbol_check_alias_consistency): Undo changes in previous commit: count
5794 each string literal as a new symbol and token, assign it a symbol
5795 number, and don't complain about non-aliased string literals.
5796 (symbols_pack): Since symbol_make_alias still does not decrement symbol
5797 and token counts but does still set aliased tokens to the same number,
5798 symbol_pack_processor now leaves empty slots in the symbols array.
5799 Remove those slots.
5800 * tests/regression.at (Undeclared string literal): Remove test case
5801 added in previous commit since non-aliased string literals are allowed
5802 again.
5803 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
5804 remove unnecessary string literal declarations.
5805 * tests/sets.at (Firsts): Likewise.
5806
5807 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
5808
5809 Don't allow an undeclared string literal, but allow a string literal to
5810 be used before its declaration.
5811 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
5812 symbols_pack complained.
5813 * src/symtab.c (symbol_new): Don't count a string literal as a new
5814 symbol.
5815 (symbol_class_set): Don't count a string literal as a new token, and
5816 don't assign it a symbol number since symbol_make_alias does that.
5817 (symbol_make_alias): It's not necessary to decrement the symbol and
5818 token counts anymore. Don't assume that an alias declaration occurs
5819 before any uses of the identifier or string, and thus don't assert that
5820 one of them has the highest symbol number so far.
5821 (symbol_check_alias_consistency): Complain if there's a string literal
5822 that wasn't declared as an alias.
5823 (symbols_pack): Bail if symbol_check_alias_consistency failed since
5824 symbol_pack asserts that every token has been assigned a symbol number
5825 although undeclared string literals have not.
5826 * tests/regression.at (String alias declared after use, Undeclared
5827 string literal): New test cases.
5828 (Characters Escapes, Web2c Actions): Declare string literals as
5829 aliases.
5830 * tests/sets.at (Firsts): Likewise.
5831
5832 2006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
5833
5834 In the grammar scanner, STRING_FINISH unclosed constructs and return
5835 them to the parser in order to improve error messages.
5836 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
5837 SC_BRACED_CODE, SC_PROLOGUE): Implement.
5838 * tests/input.at (Unclosed constructs): New test case.
5839 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
5840 seen.
5841
5842 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
5843 unused global.
5844
5845 2006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
5846
5847 Handle string aliases for character tokens correctly.
5848 * src/symtab.c (symbol_user_token_number_set): If the token has an
5849 alias, check and set its alias's user token number instead of its own,
5850 which is set to indicate the alias. Previously, every occurrence of
5851 the character token in the grammar overwrote that alias indicator with
5852 the character code.
5853 * tests/input.at (String aliases for character tokens): New test.
5854
5855 2006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
5856
5857 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
5858
5859 2006-08-11 Paul Eggert <eggert@cs.ucla.edu>
5860
5861 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
5862 to prevent failures when building on older platforms.
5863 Check for autopoint failure.
5864 Set XGETTEXT_OPTIONS to values that check for C format strings,
5865 so that translators are warned about them (this also helps
5866 prevent core dumps).
5867
5868 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
5869 function, since it simplifies our code a bit.
5870
5871 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
5872 rather than -W, so we don't get bogus warnings about sign comparisons.
5873 Add -Wpointer-arith, since that warning is useful (it reports code
5874 that does not conform to C89 and that some compilers reject).
5875 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
5876 since it's no longer needed.
5877
5878 2006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
5879
5880 Clean up scanners a bit.
5881 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
5882 definitions so gcc won't warn when obstack_for_string is unused.
5883 * src/scan-code.l: config.h and system.h are already #include'd by
5884 scan-code-c.c, so get rid of them here.
5885 * src/scan-gram.l: Likewise.
5886 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
5887 definitions rather than duplicating the rest of it.
5888 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
5889
5890 2006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
5891
5892 Suppress signed/unsigned comparison warnings for yycheck.
5893 * data/c.m4 (b4_safest_int_type): New macro.
5894 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
5895 a signed int type, cast it to b4_safest_int_type first.
5896 * data/yacc.c: Likewise.
5897 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
5898 also overwritten.
5899
5900 2006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
5901
5902 * doc/bison.texinfo: Fix some typos.
5903
5904 2006-08-02 Paul Eggert <eggert@cs.ucla.edu>
5905
5906 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
5907 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
5908
5909 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
5910 the latest gnulib does this a different way.
5911 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
5912 translation was patched, so stop omitting it.
5913
5914 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
5915
5916 Enable declaration of default %printer/%destructor. Make the parser
5917 use these for all user-declared grammar symbols for which the user does
5918 not declare a specific %printer/%destructor. Thus, the parser uses it
5919 for token 0 if the user declares it but not if Bison generates it as
5920 $end. Discussed starting at
5921 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
5922 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
5923 and
5924 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
5925 * NEWS (2.3+): Mention.
5926 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
5927 declare a %destructor for a mid-rule's semantic value. It's just
5928 impossible to declare one specific to it.
5929 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
5930 code. Describe default %destructor form.
5931 * src/parse-gram.y (grammar_declaration): Parse default
5932 %printer/%destructor declarations.
5933 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
5934 and symbol_destructor_location_get rather than accessing the destructor
5935 and destructor_location members of struct symbol.
5936 (symbol_printers_output): Likewise but for %printer's.
5937 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
5938 again.
5939 * src/symtab.c (default_destructor, default_destructor_location,
5940 default_printer, default_printer_location): New static global
5941 variables to record the default %destructor and %printer.
5942 (symbol_destructor_get, symbol_destructor_location_get,
5943 symbol_printer_get, symbol_printer_location_get): New functions to
5944 compute the appropriate %destructor and %printer for a symbol.
5945 (default_destructor_set, default_printer_set): New functions to set the
5946 default %destructor and %printer.
5947 * src/symtab.h: Prototype all those new functions.
5948 * tests/actions.at (Default %printer and %destructor): New test to
5949 check that the right %printer and %destructor are called, that they're
5950 not called for $end, and that $$ and @$ work correctly.
5951 (Default %printer and %destructor for user-declared end token): New
5952 test to check that the default %printer and %destructor are called for
5953 a user-declared end token.
5954 * tests/input.at (Default %printer and %destructor redeclared, Unused
5955 values with default %destructor): New tests to check related grammar
5956 warnings and errors.
5957
5958 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
5959
5960 Clean up handling of %destructor for the end token (token 0).
5961 Discussed starting at
5962 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
5963 and
5964 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
5965
5966 Make the skeletons consistent in how they pop the end token and invoke
5967 its %destructor.
5968 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
5969 state, which has token number 0, since this would invoke the
5970 %destructor for the end token.
5971 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
5972 until after shifting the end token, or else it won't be popped.
5973 * data/yacc.c (yyparse): Likewise.
5974
5975 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
5976 it's the end token. Upon termination, destroy an unshifted lookahead
5977 even when it's the end token.
5978 * data/lalr1.cc (yy::parser::parse): Likewise.
5979 * data/yacc.c (yyparse): Likewise.
5980
5981 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
5982 value warnings for the end token when the user gives the end token a
5983 %destructor.
5984
5985 * tests/actions.at (Printers and Destructors): Test all the above.
5986
5987 2006-07-24 Paul Eggert <eggert@cs.ucla.edu>
5988
5989 Update to latest gnulib and gettext versions.
5990 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
5991 Add fopen-safer.
5992 (gnulib_files): Add m4/warning.m4. Don't worry about files
5993 overwritten by autopoint.
5994 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
5995 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
5996 rejects them.
5997 Don't use autoreconf; instead, invoke autopoint etc. by hand,
5998 so that we can remove the intl files at a better time.
5999 (intl_files_to_remove): Remove aclocal.m4, since it gets
6000 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
6001 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
6002 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
6003 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
6004 Remove datarootdir hack; no longer needed.
6005 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
6006 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
6007 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
6008 strdup.h.
6009 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
6010 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
6011
6012 2006-07-20 Paul Eggert <eggert@cs.ucla.edu>
6013
6014 * bootstrap: Adjust to today's change to gnulib-tool by invoking
6015 it with --assume-autoconf='latest-stable'.
6016
6017 2006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
6018
6019 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
6020 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
6021 YYSTYPE' and `{'.
6022 * src/muscle_tab.h (muscle_grow): Replace the header comments with
6023 those from muscle_tab.c since the old ones are misleading.
6024
6025 2006-07-13 Akim Demaille <akim@epita.fr>
6026
6027 Support %define "KEY" {VALUE}.
6028 * src/scan-code.h, src/scan-code.l (translate_action)
6029 (translate_rule_action, translate_symbol_action, translate_code):
6030 Return char *, not const char *.
6031 * src/parse-gram.y (declaration): Rename as...
6032 (prologue_declaration): this.
6033 (string_content): Remove this nonterminal, use STRING.
6034 (braceless, content, content.opt): New nonterminal.
6035 Use them.
6036 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
6037 as value.
6038 * src/scan-gram.l (getargs.h): Don't include it.
6039
6040 2006-07-12 Paul Eggert <eggert@cs.ucla.edu>
6041
6042 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
6043 rather than a for-loop that declares a local bool variable. This
6044 should work around a compatibility problem with a Cray x1e C++
6045 compiler reported by Hung Nguyen in
6046 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
6047 The for-loop was introduced in the 2004-11-17 change but I don't
6048 know why it was needed.
6049
6050 2006-07-12 Akim Demaille <akim@epita.fr>
6051
6052 * data/c.m4: Comment changes.
6053
6054 2006-07-10 Akim Demaille <akim@lrde.epita.fr>
6055
6056 * src/complain.c (error_message, ERROR_MESSAGE): New.
6057 To factor...
6058 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
6059 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
6060
6061 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
6062
6063 * NEWS: Instead of %union, you can define and use your own union type
6064 YYSTYPE if your grammar contains at least one <type> tag.
6065 Your YYSTYPE need not be a macro; it can be a typedef.
6066 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
6067 (Union Decl, Decl Summary): Document this.
6068 * data/glr.c (YYSTYPE): Implement this.
6069 * data/glr.cc (YYSTYPE): Likewise.
6070 * data/lalr1.cc (YYSTYPE): Likewise.
6071 * data/yacc.c (YYSTYPE): Likewise.
6072 * src/output.c (prepare): Output tag_seen_flag.
6073 * src/parse-gram.y (declaration, grammar_declaration):
6074 Use 'union_seen' rather than 'typed' to determine whether
6075 %union has been seen, since grammars can now be typed without
6076 %union.
6077 (symbol_declaration, type.opt, symbol_def):
6078 Keep track of whether a tag has been seen.
6079 * src/reader.c (union_seen, tag_seen): New vars.
6080 (typed): remove.
6081 * src/reader.h (union_seen, tag_seen, typed): Likewise.
6082 * src/scan-code.l (untyped_var_seen): New variable.
6083 (handle_action_dollar): Adjust to above changes.
6084 (handle_action_dollar, handle_action_at):
6085 Improve overflow checking for outlandish numbers.
6086 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
6087 avoid new diagnostics generated by above changes.
6088 * tests/regression.at (YYSTYPE typedef): Add test to check
6089 for type tags without %union.
6090
6091 * src/symlist.c (symbol_list_length): Return int, not unsigned
6092 int, since callers expect int. This may need to get revisited
6093 once we have proper integer overflow checking.
6094
6095 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
6096 object is now static.
6097
6098 * src/getargs.c (flags_argmatch): Return void, not int,
6099 to pacify ./configure --enable-gcc-warnings.
6100
6101 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
6102 since last_string is already defined to FLEX_PREFIX (last_string).
6103
6104 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
6105
6106 Implement --warnings/-W.
6107 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
6108 replaced by...
6109 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
6110 Adjust callers.
6111 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
6112 (warnings_args, warnings_types): New.
6113 (getargs, short_options, long_options): Accept -W/--warnings.
6114 Sort the options by alphabetical order, upper case letter right
6115 before its lower case.
6116
6117 2006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
6118
6119 Change %merge result type clash warnings to errors. Discussed at
6120 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
6121 * src/reader.c (record_merge_function_type): Use complain_at.
6122 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
6123 declared later): Update test case results.
6124
6125 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
6126
6127 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
6128 to be in alphabetical order.
6129 (trace_args): Spelling fixes.
6130
6131 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
6132
6133 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
6134 so they don't collide with user-defined macros.
6135 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
6136 this was never guaranteed, and now that we're using gnulib stdint,
6137 which defines int_fast16_t to long int, the problem is exposed.
6138
6139 2006-07-08 Paul Eggert <eggert@cs.ucla.edu>
6140
6141 * data/c.m4 (b4_basename): Simplify a bit, since we don't
6142 need the full POSIX semantics (and weren't implementing them
6143 anyway).
6144
6145 Adjust to Autoconf 2.60 and today's gnulib.
6146 * bootstrap (gnulib_modules): Add stdint.
6147 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
6148 no longer copies it.
6149 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
6150 since stdint needs the former and wcwidth (which is now required
6151 by mbswidth) needs the latter.
6152 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
6153 work around a compatibility glitch between gettext 0.14.6 and
6154 Autoconf 2.60.
6155 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
6156 Do not check for uintptr_t, since new stdint module does the right
6157 thing.
6158 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
6159 Add stdint.h, stdint_.h, wcwidth.h.
6160 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
6161 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
6162 stdint.m4, wchar_t.m4, wcwidth.m4.
6163 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
6164 usual order for ../lib/*.h files.
6165 (file_name_split): Use last_component, not base_name, to adjust
6166 to gnulib changes.
6167 * src/parse-gram.h: Include <strverscmp.h> in the usual order
6168 for ../lib/*.h files.
6169 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
6170 Define unconditionally, since we now assume the stdint module.
6171 * src/scan-skel.l: Include <dirname.h>.
6172 (BASE_QPUTS): Use last_component, not base_name.
6173 * src/system.h: Include <unlocked-io.h> in the usual order
6174 for ../lib/*.h files. Include <stdint.h> unconditionally,
6175 since we now use the stdint module.
6176 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
6177 HAVE_UINTPTR_T, since we now use the stdint module.
6178 (base_name): Remove decl, since files now include <dirname.h>
6179 to get the decl.
6180
6181 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
6182
6183 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
6184 New, default to 1.
6185 * data/yacc.c, data/glr.c, data/location.cc: Use them.
6186 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
6187 default.
6188 * tests/calc.at: Adjust.
6189
6190 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
6191
6192 * data/c.m4 (b4_basename): New.
6193 (b4_syncline): Also output the location of its invocation (from
6194 the skeleton).
6195 (b4_user_action, b4_define_user_action, b4_user_actions)
6196 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
6197 (b4_user_stype): New.
6198 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
6199
6200 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
6201
6202 In the grammar file, the first column is 1 not 0 on the first line as
6203 on every other line.
6204 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
6205 * tests/input.at (Torturing the Scanner): Update output.
6206
6207 * src/scan-gram.l (scanner_cursor): Declare it static.
6208
6209 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
6210
6211 In warnings, say "previous declaration" rather than "first
6212 declaration".
6213 * src/symtab.c (redeclaration): Do that here.
6214 * src/reader.c (record_merge_function_type): In the case of a result
6215 type clash, report the previous declaration rather than the very first
6216 one in the grammar file.
6217 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
6218 declared later): Add a third declaration to check this behavior.
6219 * tests/input.at (Incompatible Aliases): Update output.
6220
6221 2006-06-27 Akim Demaille <akim@epita.fr>
6222
6223 * doc/Doxyfile.in: New.
6224 * doc/Makefile.am: Use it.
6225 * src/lalr.h, src/symtab.h: Initial doxygenation.
6226
6227 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
6228
6229 Don't miss %merge result type warnings just because the LHS types are
6230 declared after the %merge. This continues the effort of the previous
6231 patch.
6232 * src/reader.c (get_merge_function): Don't set the merger type yet.
6233 (record_merge_function_type): New function for setting the merger type
6234 and checking for clashes.
6235 (grammar_current_rule_merge_set): Set the location of the %merge for
6236 the current rule.
6237 (packgram): Invoke record_merge_function_type for each rule now that
6238 all symbol type declarations have been parsed.
6239 * src/reader.h (merger_list.type_declaration_location): New member
6240 storing the location of the first %merge from which the type for this
6241 merging function was derived.
6242 * src/symlist.h (symbol_list.merger_declaration_location): New member
6243 storing the location of a rule's %merge, if any.
6244 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
6245 declared later): New test to catch the error fixed by the above patch.
6246
6247 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
6248
6249 Get action warnings (grammar_rule_check) right even when symbol
6250 declarations appear after the rules. Discussed at
6251 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
6252 and
6253 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
6254 Don't mistake the type of $$ in a midrule to be that of its parent
6255 rule's $$.
6256 * src/reader.c (grammar_current_rule_end): Don't invoke
6257 grammar_rule_check yet since not all symbol declarations may have been
6258 parsed yet.
6259 (grammar_midrule_action): Likewise.
6260 Don't record whether the midrule's $$ has been used yet since actions
6261 haven't been translated yet.
6262 Record the midrule's parent rule and its RHS index within the parent
6263 rule.
6264 (grammar_current_rule_action_append): Don't translate the action yet
6265 since not all symbol declarations may have been parsed yet and, thus,
6266 warnings about types for $$, $n, @$, and @n can't be reported yet.
6267 (packgram): Translate the action and invoke grammar_rule_check now that
6268 all symbol declarations have been parsed.
6269 * src/scan-code.l (handle_action_dollar): Now that this is invoked
6270 after parsing the entire grammar file, the symbol list here in the case
6271 of a midrule is actually the midrule's empty RHS, so reference its
6272 parent rule's RHS where necessary.
6273 On the other hand, now that you can already know it's a midrule, you
6274 aren't forced to think $$ has the same type as its parent rule's $$.
6275 (handle_action_at): In the case of a midrule, reference the parent rule
6276 where necessary.
6277 * src/symlist.c (symbol_list_new): Initialize new midrule-related
6278 members.
6279 (symbol_list_length): Now that this is invoked after all rules have
6280 been parsed, a NULL symbol (rather than a NULL symbol list node)
6281 terminates a rule. symbol_list_print already does this correctly.
6282 * src/symlist.h (symbol_list.midrule_parent_rule,
6283 symbol_list.midrule_parent_rhs_index): New members so that midrules can
6284 remember their relationships with their parents.
6285 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
6286 fixed by the above patch.
6287 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
6288 implementing...
6289 (Unused values): ... this old test case and...
6290 (Unused values before symbol declarations): ... this new test case.
6291 This one is the same as `Unused values' except that all symbol
6292 declarations appear after the rules in order to catch the rest of the
6293 errors fixed by the above patch.
6294
6295 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
6296
6297 More cleanup.
6298 * src/reader.c (current_rule): Declare it static since it's no longer
6299 used outside this file.
6300 (grammar_current_rule_action_append): Remove redundant arguments from
6301 translate_rule_action invocation.
6302 * src/reader.h (current_rule): Remove this unused extern.
6303 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
6304 * src/scan-code.l (translate_rule_action): Likewise.
6305
6306 2006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
6307
6308 Clean up yesterday's patch.
6309 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
6310 to...
6311 * src/reader.c (grammar_current_rule_action_append): ... here for
6312 consistency with grammar_current_rule_symbol_append.
6313 * tests/regression.at (Braced code in declaration in rules section):
6314 Make yyerror and yylex static as usual.
6315
6316 2006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
6317
6318 Fix bug that mistakes braced code in a declaration in the rules section
6319 to be a rule action. Mentioned at
6320 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
6321 * src/scan-gram.l: Move midrule action detection from the start of the
6322 scanning of any braced code to...
6323 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
6324 action. For readability, use $2 and @2 rather than the equivalent
6325 global variables.
6326 * tests/regression.at (Braced code in declaration in rules section):
6327 New test to catch the error fixed by the above patch.
6328
6329 Work on code readability some.
6330 * src/scan-code.l (current_rule): Get rid of this misleading and
6331 redundant declaration: it's actually extern'ed in reader.h.
6332 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
6333 translate_action): Add a rule argument and use it instead of the global
6334 current_rule.
6335 (translate_rule_action): This already receives current_rule through an
6336 argument, so pass it on to translate_action instead of assigning
6337 current_rule to current_rule.
6338 (translate_symbol_action, translate_code): Pass rule = NULL to
6339 translate_action.
6340
6341 2006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
6342
6343 Rename %before-definitions to %start-header and %after-definitions to
6344 %end-header. Don't use these declarations to separate pre-prologue
6345 blocks from post-prologue blocks. Add new order-independent
6346 declarations %before-header and %after-header as alternatives to the
6347 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
6348 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
6349 * NEWS (2.3+): Update for these changes.
6350 * data/glr.c (b4_before_definitions): Update to...
6351 (b4_start_header): ... this.
6352 (b4_after_definitions): Update to...
6353 (b4_end_header): ... this.
6354 * data/glr.cc: Likewise.
6355 * data/lalr1.cc: Likewise.
6356 * data/yacc.c: Likewise.
6357 * doc/bison.texinfo (The prologue): Update names, and replace remaining
6358 prologue blocks with %*-header declarations.
6359 (Calc++ Parser): Likewise.
6360 (Decl Summary): Update names.
6361 (Table of Symbols): Update description.
6362 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
6363 (PERCENT_END_HEADER): ... this.
6364 (PERCENT_BEFORE_DEFINITIONS): Update to...
6365 (PERCENT_START_HEADER): ... this.
6366 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
6367 (declaration): Update token names and m4 macro names.
6368 When parsing %end-header and %start-header, invoke translate_code
6369 before muscle_code_grow, and no longer set global booleans to remember
6370 whether these declarations have been seen.
6371 Parse new %after-header and %before-header.
6372 * src/reader.c (before_definitions, after_definitions): Remove.
6373 (prologue_augment): Accept a new bool argument to specify whether to
6374 augment the pre-prologue or post-prologue.
6375 * src/reader.h (before_definitions, after_definitions): Remove these
6376 extern's.
6377 (prologue_augment): Add new bool argument.
6378 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
6379 (PERCENT_END_HEADER): ... this.
6380 (PERCENT_BEFORE_DEFINITIONS): Update to...
6381 (PERCENT_START_HEADER): ... this.
6382 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
6383 * tests/actions.at (Printers and Destructors): Update names.
6384
6385 2006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
6386
6387 Add comparison operators for C++ location classes. Discussed at
6388 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
6389 * data/c++.m4 (b4_define_location_comparison): New boolean %define
6390 declaration indicating whether filename_type has an operator==. If
6391 filename_type is `std::string', it defaults to `1', `0' otherwise.
6392 * data/location.cc: Iff b4_define_location_comparison is `1', add
6393 operator== and operator!= for class position and for class location.
6394
6395 Some minor fixes.
6396 * src/scan-action.l: Remove unused file.
6397 * src/symtab.c (symbol_printer_set): Use printer_location not
6398 destructor_location.
6399 * src/symtab.h (struct symbol): Replace incorrect source comment for
6400 printer members.
6401 * tests/input.at (Incompatible Aliases): Update output with correct
6402 printer location.
6403
6404 2006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
6405
6406 Don't put the pre-prologue in the header file. For the yacc.c code
6407 file and the glr.c header and code files, move the pre-prologue before
6408 the token definitions. Add new %before-definitions and
6409 %after-definitions to declare code that will go in both the header file
6410 and code file. Discussed at
6411 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
6412 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
6413 and
6414 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
6415 * NEWS (2.3+): Describe these changes.
6416 * data/glr.c (b4_pre_prologue): Move from within to before...
6417 (b4_shared_declarations): ... this.
6418 Add new b4_before_definitions before b4_token_enums.
6419 Add new b4_after_definitions at the end.
6420 * data/glr.cc (b4_pre_prologue): Replace with...
6421 (b4_before_definitions): ... this in the header file.
6422 (b4_after_definitions): New near the end of the header file.
6423 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
6424 code file right before including the header file.
6425 (b4_before_definitions): New in the previous position of
6426 b4_pre_prologue in the header file.
6427 (b4_after_definitions): New near the end of the header file.
6428 * data/yacc.c: Clean up some m4 quoting especially in the header file.
6429 (b4_token_enums_defines): In the code file, move to right before
6430 YYSTYPE for consistency with the header file.
6431 (b4_before_definitions): New right before b4_token_enums_defines in
6432 both the header and code file.
6433 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
6434 header and code file.
6435 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
6436 of prologues for %union dependencies.
6437 (Decl Summary): In %defines description, mention the effect of
6438 %before-definitions and %after-definitions on the header file.
6439 (Calc++ Parser): Forward declare driver in a %before-definitions rather
6440 than in the pre-prologue so that make check succeeds.
6441 (Table of Symbols): Add entries for %before-definitions and
6442 %after-definitions.
6443 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
6444 %before-definitions.
6445 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
6446 (declaration): Parse those declarations and append to
6447 b4_before_definitions and b4_after_definitions, respectively.
6448 * src/reader.c (before_definitions, after_definitions): New bools to
6449 track whether those declarations have been seen.
6450 (prologue_augment): Add to the post-prologue if %union,
6451 %before-definitions, or %after-definitions has been seen.
6452 * src/reader.h (before_definitions, after_definitions): New extern's.
6453 * src/scan-gram.l: Scan the new declarations.
6454 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
6455 prologue block in a %before-definitions or a %after-definitions based
6456 on whether the %union is declared.
6457 * tests/regression.at (Early token definitions with --yacc, Early token
6458 definitions without --yacc): Move tests for token definitions into the
6459 post-prologue since token names are no longer defined in the
6460 pre-prologue.
6461
6462 2006-06-20 Akim Demaille <akim@epita.fr>
6463
6464 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
6465 (symbol_get): Use it.
6466 * src/parse-gram.y: Use it.
6467
6468 2006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
6469
6470 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
6471 build succeeds when configured with --enable-gcc-warnings.
6472
6473 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
6474
6475 * src/parse-gram.y (char_name): New function.
6476 (CHAR, STRING, string_content): For %printer, properly escape.
6477 (ID): Prefer fputs to fprintf.
6478 (id): Reindent to be consistent with other rules.
6479 Properly quote char.
6480
6481 The Translation Project changed its way of publishing translations
6482 to maintainers. I haven't received any responses to my request
6483 for supporting the old way, or for documenting the new way. I
6484 have modified 'bootstrap' to use screen scraping
6485 (in this case, HTML scraping). This is unreliable and inelegant,
6486 but I don't see any better way. Yuck.
6487 * bootstrap (TP_URL, WGET_COMMAND): New vars.
6488 (get_translations): New function, which uses HTML scraping to
6489 deduce locations of latest translations.
6490 Use this function to grab both bison and bison-runtime .po files.
6491 Don't bother priming the pump for the runtime-po domain any more,
6492 as it's now translated better than bison is.
6493
6494 2006-06-19 Akim Demaille <akim@epita.fr>
6495
6496 * src/scan-gram.l: No longer "parse" things after `%union' until
6497 `{'. Rather, return a single "%union" token.
6498 No longer make symbols: return strings, and leave the conversion
6499 to symbols to the parser.
6500 (SC_PRE_CODE, token_type): Remove.
6501 * src/parse-gram.y (%union): New field `character'.
6502 Sort tokens.
6503 (CHAR): New token.
6504 (ID, ID_COLON): Now that the scanner no longer makes them
6505 identifiers, adjust all uses to invoke symbol_get.
6506 (id_colon): New, wraps the conversion from string to symbol.
6507 (%union): Accept a possible union_name.
6508 (symbol): Now can be a char.
6509 * data/c.m4 (b4_union_name): Leave a default value.
6510 * data/glr.c, data/yacc.c: Use it.
6511
6512 2006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
6513
6514 For associating token numbers with token names for "yacc.c", don't use
6515 #define statements unless `--yacc' is specified; always use enum
6516 yytokentype. Most important discussions start at:
6517 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
6518 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
6519 and
6520 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
6521 * NEWS (2.3+): Mention.
6522 * data/c.m4 (b4_yacc_if): New.
6523 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
6524 token #define's.
6525 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
6526 on token name definitions.
6527 * src/getargs.c (usage): Capitalize `Yacc' in English.
6528 * src/output.c (prepare): Define b4_yacc_flag.
6529 * tests/regression.at (Early token definitions): Test that tokens names
6530 are defined before the pre-prologue not just before the post-prologue.
6531 Remove this test case and copy to...
6532 (Early token definitions with --yacc): ... this to test #define's.
6533 (Early token definitions without --yacc): ... and this to test enums.
6534
6535 2006-06-11 Paul Eggert <eggert@cs.ucla.edu>
6536
6537 * NEWS: Reword the post-2.3 change to not be so optimistic about
6538 removing the old "look-ahead" spelling.
6539 Update previous look-ahead/lookahead change reports.
6540 * REFERENCES: look-ahead -> lookahead (since that's
6541 what he actually wrote).
6542 * doc/refcard.tex: look ahead -> lookahead,
6543 look-ahead -> lookahead
6544
6545 2006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
6546
6547 For consistency, use `lookahead' instead of `look-ahead' or
6548 `look_ahead'. Discussed starting at
6549 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
6550 and then at
6551 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
6552 * NEWS: For the next release, note the change to `--report'.
6553 * TODO, doc/bison.1: Update English.
6554 * doc/bison.texinfo: Update English.
6555 (Understanding Your Parser, Bison Options): Document as
6556 `--report=lookahead' rather than `--report=look-ahead'.
6557 * src/conflicts.c: Update English in comments.
6558 (lookahead_set): Rename from look_ahead_set.
6559 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
6560 (resolve_sr_conflict): Rename local look_ahead_tokens to
6561 lookahead_tokens, and update other uses.
6562 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
6563 count_rr_conflicts, conflicts_free): Update uses.
6564 * src/getargs.c (report_args): Move "lookahead" before alternate
6565 spellings.
6566 (report_types): Update uses.
6567 (usage): For `--report' usage description, state `lookahead' spelling
6568 rather than `look-ahead'.
6569 * src/getargs.h (report.report_lookahead_tokens): Rename from
6570 report_look_ahead_tokens.
6571 * src/lalr.c: Update English in comments.
6572 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
6573 (state_lookahead_tokens_count): Rename from
6574 state_look_ahead_tokens_count.
6575 Rename local n_look_ahead_tokens to n_lookahead_tokens.
6576 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
6577 Rename local n_look_ahead_tokens to n_lookahead_tokens.
6578 Update other uses.
6579 Update English in output.
6580 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
6581 * src/print.c: Update English in comments.
6582 (lookahead_set): Rename from look_ahead_set.
6583 (print_reduction): Rename argument lookahead_token from
6584 look_ahead_token.
6585 (print_core, state_default_rule, print_reductions, print_results):
6586 Update uses.
6587 * src/print_graph.c: Update English in comments.
6588 (print_core): Update uses.
6589 * src/state.c: Update English in comments.
6590 (reductions_new): Update uses.
6591 (state_rule_lookahead_tokens_print): Rename from
6592 state_rule_look_ahead_tokens_print, and update other uses.
6593 * src/state.h: Update English in comments.
6594 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
6595 (state_rule_lookahead_tokens_print): Rename from
6596 state_rule_look_ahead_tokens_print.
6597 * src/tables.c: Update English in comments.
6598 (conflict_row, action_row): Update uses.
6599 * tests/glr-regression.at
6600 (Incorrect lookahead during deterministic GLR,
6601 Incorrect lookahead during nondeterministic GLR): Rename
6602 print_look_ahead to print_lookahead.
6603 * tests/torture.at: Update English in comments.
6604 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
6605 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
6606 (Many lookahead tokens): Update uses.
6607 * data/glr.c: Update English in comments.
6608 * lalr1.cc: Likewise.
6609 * yacc.c: Likewise.
6610 * src/conflicts.h: Likewise.
6611 * src/lalr.h: Likewise.
6612 * src/main.c: Likewise.
6613 * src/output.c: Likewise.
6614 * src/parse-gram.c: Likewise.
6615 * src/tables.h: Likewise.
6616 * tests/calc.at: Likewise.
6617
6618 2006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
6619
6620 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
6621
6622 2006-06-07 Paul Eggert <eggert@cs.ucla.edu>
6623
6624 * TODO: Add request from Nelson H. F. Beebe to be able to install
6625 Bison without installing the yacc script.
6626
6627 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
6628
6629 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
6630 and yytext if they're already #define'd.
6631 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
6632 * src/scan-code-c.c: ... here.
6633 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
6634 <config.h>.
6635
6636 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
6637
6638 Get Bison to build again when configured with --enable-gcc-warnings.
6639 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
6640 missing #include's.
6641 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
6642 loc argument as it shadows a global.
6643 * src/scan-gram.l: Remove stray comma that prevents boundary_set
6644 invocation.
6645
6646 * src/.cvsignore: Add scan-code.c.
6647
6648 2006-06-07 Akim Demaille <akim@epita.fr>
6649
6650 * src/scan-gram.l: Move the "add a trailing ; to actions" code
6651 to...
6652 * src/scan-code.l: here.
6653 * tests/input.at (Torturing the Scanner): Fix another location
6654 error.
6655
6656 2006-06-07 Akim Demaille <akim@epita.fr>
6657
6658 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
6659
6660 2006-06-06 Akim Demaille <akim@epita.fr>
6661
6662 Extract the parsing of user actions from the grammar scanner.
6663 As a consequence, the relation between the grammar scanner and
6664 parser is much simpler. We can also split "composite tokens" back
6665 into simple tokens.
6666 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
6667 * src/scan-gram.l (add_column_width, adjust_location): Move to and
6668 rename as...
6669 * src/location.h, src/location.c (add_column_width)
6670 (location_compute): these.
6671 Fix the column count: the initial column is 0.
6672 (location_print): Be robust to ending column being 0.
6673 * src/location.h (boundary_set): New.
6674 * src/main.c: Adjust to scanner_free being renamed as
6675 gram_scanner_free.
6676 * src/output.c: Include scan-code.h.
6677 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
6678 Use boundary_set.
6679 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
6680 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
6681 which is now, again, a separate token.
6682 Adjust all dependencies.
6683 Whereever actions with $ and @ are used, use translate_code.
6684 (action): Remove this nonterminal which is now useless.
6685 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
6686 (grammar_current_rule_action_append): Use translate_code.
6687 (packgram): Bound check ruleno, itemno, and rule_length.
6688 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
6689 (last_string, last_braced_code_loc, max_left_semantic_context)
6690 (scanner_initialize, scanner_free, scanner_last_string_free)
6691 (gram_out, gram_lineno, YY_DECL_): Move to...
6692 * src/scan-gram.h: this new file.
6693 (YY_DECL): Rename as...
6694 (GRAM_DECL): this.
6695 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
6696 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
6697 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
6698 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
6699 Move these declarations, and...
6700 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
6701 these to...
6702 * src/flex-scanner.h: this new file.
6703 * src/scan-gram.l (rule_length, rule_length_overflow)
6704 (increment_rule_length): Remove.
6705 (last_braced_code_loc): Rename as...
6706 (gram_last_braced_code_loc): this.
6707 Adjust to the changes of the parser.
6708 Move all the handling of $ and @ into...
6709 * src/scan-code.l: here.
6710 * src/scan-gram.l (handle_dollar, handle_at): Remove.
6711 (handle_action_dollar, handle_action_at): Move to...
6712 * src/scan-code.l: here.
6713 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
6714 scan-code.h, scan-code-c.c, scan-gram.h.
6715 (EXTRA_bison_SOURCES): Add scan-code.l.
6716 (BUILT_SOURCES): Add scan-code.c.
6717 (yacc): Be robust to white spaces.
6718
6719 * tests/conflicts.at, tests/input.at, tests/reduce.at,
6720 * tests/regression.at: Adjust the column numbers.
6721 * tests/regression.at: Adjust the error message.
6722
6723 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
6724
6725 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
6726 Use Akim's wording from
6727 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
6728
6729 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
6730
6731 Between Bison releases, manually append `+' to the previous Bison
6732 release number, and use that as a signal to automatically print the
6733 ChangeLog's CVS Id keyword from --version. Discussed starting at
6734 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
6735 * ChangeLog: Add Id header.
6736 * configure.ac (AC_INIT): Append `+' to `2.3'.
6737 * src/.cvsignore: Add revision.c.
6738 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
6739 (BUILT_SOURCES): Add revision.c.
6740 (revision.c): New target rule. This file defines a new global variable
6741 named revision. It initializes it with either the Id from ChangeLog
6742 or, if VERSION doesn't contain `+', with the empty string.
6743 * src/getargs.c (version): Print the value of revision.
6744 * src/revision.h: Extern revision.
6745
6746 2006-06-05 Paul Eggert <eggert@cs.ucla.edu>
6747
6748 * NEWS: Version 2.3.
6749 * configure.ac (AC_INIT): Likewise.
6750
6751 2006-05-30 Paul Eggert <eggert@cs.ucla.edu>
6752
6753 * data/glr.c (YYRECOVERING): Define to be a function-like macro
6754 with no arguments, not as an object-like macro. This is for
6755 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
6756 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
6757 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
6758 Document this.
6759
6760 2006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
6761
6762 * src/getargs.c (usage): Back out yesterday's modification of the
6763 --help output so that we don't have to wait for translation before
6764 releasing 2.3.
6765
6766 2006-05-29 Paul Eggert <eggert@cs.ucla.edu>
6767
6768 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
6769 Problem reported by Akim Demaille.
6770
6771 2006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
6772
6773 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
6774
6775 2006-05-26 Paul Eggert <eggert@cs.ucla.edu>
6776
6777 * data/yacc.c (yy_reduce_print): Omit trailing white space in
6778 generated source code. Problem reported by Frans Englich in
6779 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
6780
6781 2006-05-22 Paul Eggert <eggert@cs.ucla.edu>
6782
6783 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
6784 shell, not within 'make', so that 'make' by an ordinary builder
6785 (using GNU make) does not worry about configuring gzip. This also
6786 works around a bug reported independently by Keith Thompson and by
6787 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
6788 stderr rather than stdout, messing up the build logs.
6789
6790 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
6791
6792 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
6793 to make sure that YYID will never be unused. This fixes a 'make
6794 maintainer-check' failure caused by the recent changes to the 'Trivial
6795 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
6796 not used.
6797 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
6798
6799 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
6800
6801 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
6802 state before an empty RHS is always resolved here. Only the location
6803 of that state is guaranteed to be resolved, and that's enough. This
6804 fixes the remaining bug reported by Derek M. Jones in
6805 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
6806 * tests/glr-regression.at (Uninitialized location when reporting
6807 ambiguity): Test the above case.
6808 Also, the embedded comments in this test case claim it checks the case
6809 of an empty RHS that has inherited the initial location. However, the
6810 corresponding LHS was already resolved, so yyresolveLocations didn't
6811 actually have reason to modify it. Fix this by forcing
6812 nondeterministic operation at the beginning of the parse.
6813
6814 2006-05-20 Paul Eggert <eggert@cs.ucla.edu>
6815
6816 * data/c.m4 (b4_yy_symbol_print_generate):
6817 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
6818 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
6819 of the bugs reported today by Derek M Jones in
6820 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
6821 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
6822 defined to be a type name without parens or brackets.
6823 (Location Type): Similarly for YYLTYPE.
6824 * tests/regression.at (Trivial grammars): Put in a test for this
6825 bug that will be caught by 'make maintainer-check' (though not,
6826 alas, by 'make check' unless your compiler is picky).
6827
6828 2006-05-19 Paul Eggert <eggert@cs.ucla.edu>
6829
6830 * NEWS: Version 2.2.
6831 * configure.ac (AC_INIT): Likewise.
6832
6833 2006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
6834
6835 * data/glr.c (yyreportTree): Make room in yystates for the state
6836 preceding the RHS. This fixes the segmentation fault reported by Derek
6837 M. Jones in
6838 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
6839 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
6840 to the user. Reported for yyreportTree by Derek M. Jones later in the
6841 same thread.
6842 * THANKS: Add Derek M. Jones.
6843 Update my email address.
6844 Fix typo in Steve Murphy's name.
6845
6846 2006-05-14 Paul Eggert <eggert@cs.ucla.edu>
6847
6848 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
6849 checking against YYLAST that caused the parser to miss a potential
6850 alternative in its diagnostic.
6851 Problem reported by Maria Jose Moron Fernandez in
6852 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
6853 * data/lalr1.cc (yysyntax_error_): Likewise.
6854 * data/yacc.c (yysyntax_error): Likewise.
6855 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
6856 tokens, in case we run into an older C compiler.
6857 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
6858 Use them to check for the off-by-one error fixed above.
6859
6860 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
6861 YYSIZE_T, not size_t.
6862 * tests/regression.at (Trivial grammars): New test, to catch
6863 the error fixed by the above patch.
6864
6865 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
6866
6867 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
6868 scheme.
6869 Reported by Steve Murphy.
6870
6871 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
6872
6873 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
6874 * data/glr.cc: b4_location_flag is now b4_locations_flag.
6875
6876 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
6877
6878 Implement --trace=m4.
6879 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
6880 * src/output.c (output_skeleton): When set, pass -dV to m4.
6881
6882 Factor the handling of flags in m4.
6883 * src/output.c (prepare): Rename the muscle names debug, defines,
6884 error_verbose to debug_flag, defines_flag, error_verbose_flag.
6885 * data/c.m4: Adjust.
6886 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
6887 Use b4_define_flag_if to define other b4_FLAG_if macros.
6888 (b4_location_if): As a consequence, rename as...
6889 (b4_locations_if): this, for consistency.
6890 Adjust all the skeletons.
6891
6892 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
6893
6894 * etc/bench.pm: Shorten bench names.
6895
6896 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
6897
6898 * src/output.h, src/output.c (error_verbose): Move to...
6899 * src/getargs.h, src/getargs.c: here.
6900 Sort the flags.
6901 Adjust dependencies.
6902
6903 2006-05-13 Paul Eggert <eggert@cs.ucla.edu>
6904
6905 * data/c.m4 (b4_copyright): Put the special exception for Bison
6906 skeletons here, so we don't have to put it in each skeleton. All
6907 uses changed. Suggested by Akim Demaille. Also, wrap the
6908 copyright notice, in case it is longer than 80 columns. Replace
6909 comma by newline after title.
6910
6911 2006-05-11 Paul Eggert <eggert@cs.ucla.edu>
6912
6913 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
6914 incompatibility, not a bug. Mention that it wasn't fixed as of
6915 flex 2.5.33.
6916
6917 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
6918
6919 * examples/extexi: Enforce the precedence of concatenation over
6920 >>.
6921 Reported by Tommy Nordgren.
6922
6923 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
6924
6925 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
6926 with the member "token".
6927 Reported by Martin Nylin.
6928
6929 2006-05-08 Paul Eggert <eggert@cs.ucla.edu>
6930
6931 * data/glr.c: Switch to Bison 2.2 special-exception language in
6932 the copyright notice. Use more-regular format for titles and
6933 copyright notices.
6934 * data/glr.cc: Likewise.
6935 * data/location.cc: Likewise.
6936 * data/yacc.cc: Likewise.
6937 * doc/bison.texinfo (Conditions): Document this.
6938 * NEWS: likewise. Upgrade version to 2.2.
6939
6940 2006-04-27 Akim Demaille <akim@lrde.epita.fr>
6941
6942 * data/glr.cc: Remove dead code.
6943
6944 2006-04-25 Paul Eggert <eggert@cs.ucla.edu>
6945
6946 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
6947 that variable and the line breaks the bootstrap. Problem reported
6948 by Juan M. Guerrero.
6949
6950 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
6951
6952 * doc/bison.texinfo (Multiple start-symbols): New.
6953
6954 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
6955
6956 * etc/README, etc/bench.pl: New.
6957
6958 2006-04-03 Akim Demaille <akim@lrde.epita.fr>
6959
6960 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
6961 rule.
6962 Reported by Mickael Labau.
6963 * tests/input.at (Torturing the Scanner): Test it.
6964
6965 2006-03-16 Paul Eggert <eggert@cs.ucla.edu>
6966
6967 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
6968 Problem reported by Bob Rossi.
6969
6970 2006-03-13 Paul Eggert <eggert@cs.ucla.edu>
6971
6972 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
6973 and didn't really work.
6974 For the index, use @ifnotinfo, not @iftex.
6975 Minor cleanups of spacing and terminology.
6976
6977 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
6978
6979 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
6980 of AT_NAME_PREFIX when %name-prefix is not used.
6981
6982 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
6983
6984 Apply --prefix to C++ skeletons too: they change the namespace.
6985 The test suite already exercize these cases.
6986 * data/c++.m4 (b4_namespace): New.
6987 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
6988 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
6989 * data/yacc.c, data/glr.c: Remove a useless `[]'.
6990 * doc/bison.texinfo: Document it.
6991 (Option Cross Key): Use @multitable in all formats. It looks
6992 nicer, even in TeX outputs.
6993 (Rules): Use the same code whatever the output type is.
6994 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
6995 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
6996 * tests/calc.at: Use it, instead of hard coding `yy'.
6997
6998 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
6999
7000 * TODO: Remove dead items.
7001
7002 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
7003
7004 * doc/FAQ: Remove, merged into...
7005 * doc/bison.texinfo (FAQ): this.
7006 * doc/Makefile.am (EXTRA_DIST): Adjust.
7007
7008 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
7009
7010 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
7011 even if empty.
7012 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
7013 * doc/bison.texinfo (Calc++ Scanner): Use it.
7014
7015 2006-03-09 Paul Eggert <eggert@cs.ucla.edu>
7016
7017 Fix two nits reported by twlevo, plus one more that I discovered.
7018
7019 * src/assoc.h (assoc_to_string): Give a name to the arg, as
7020 this is the usual Bison style.
7021 * src/location.h (location_print): Likewise.
7022
7023 * src/reader.h (token_name): Likewise.
7024
7025 2006-03-08 Paul Eggert <eggert@cs.ucla.edu>
7026
7027 Fix some nits reported by twlevo.
7028 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
7029 and "POSIX". Use more-modern syntax for URLs. Mention C++
7030 and ask for Java. Don't hardwire OS version numbers. Add
7031 copyright notice.
7032 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
7033 * src/conflicts.c (solved_conflicts_obstack): Now static.
7034
7035 2006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
7036
7037 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
7038 page. Say "you can use it" not "you may use it" as on the web page;
7039 we're describing capabilities not granting permission.
7040
7041 2006-03-06 Paul Eggert <eggert@cs.ucla.edu>
7042
7043 * data/glr.c (yyresolveLocations): Rename local variables to avoid
7044 shadowing warnings. Use usual patter for iterating through RHS.
7045 * tests/glr-regression.at
7046 (Uninitialized location when reporting ambiguity):
7047 Modify yylex so that it uses its argument, rather than trying
7048 to rely on ARGSUSED (which doesn't work for gcc with warnings).
7049 const char -> char const.
7050
7051 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
7052 Don't use tabs inside commands; it messes up 'ps'.
7053 Problem reported by twlevo.
7054
7055 2006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
7056
7057 * tests/glr-regression.at (Uninitialized location when reporting
7058 ambiguity): New test case.
7059 * data/glr.c (yyresolveLocations): New function, which uses
7060 YYLLOC_DEFAULT.
7061 (yyresolveValue): Invoke yyresolveLocations before reporting an
7062 ambiguity.
7063 * doc/bison.texinfo (Default Action for Locations): Note
7064 YYLLOC_DEFAULT's usage for ambiguity locations.
7065 (GLR Semantic Actions): Cross-reference those notes.
7066
7067 2006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
7068
7069 * tests/glr-regression.at (Leaked semantic values when reporting
7070 ambiguity): Remove unnecessary union and type declarations.
7071 (Leaked lookahead after nondeterministic parse syntax error): New test
7072 case.
7073 * data/glr.c (yyparse): Check for zero stacks remaining before
7074 attempting to shift the lookahead so that you don't lose it.
7075
7076 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
7077
7078 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
7079 * tests/glr-regression.at (Leaked semantic values when reporting
7080 ambiguity): New test case.
7081 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
7082 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
7083 now unnecessary yystackp parameter.
7084 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
7085 destructors can be called.
7086
7087 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
7088 in existing testcases.
7089
7090 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
7091
7092 Don't leak semantic values for parent RHS when a user action cuts the
7093 parser, and clean up related code a bit.
7094 * tests/glr-regression.at (Leaked merged semantic value if user action
7095 cuts parse): Rename to...
7096 (Leaked semantic values if user action cuts parse): ... this. Add check
7097 for leaked parent RHS values.
7098 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
7099 between an unresolved state (non-empty chain of semantic options) and
7100 an incomplete one (signaled by an empty chain).
7101 (yyresolveStates): Document the interface. Move all manipulation of a
7102 successfully or unsuccessfully resolved yyGLRState to...
7103 (yyresolveValue): ... here so that yyresolveValue always leaves a
7104 yyGLRState with consistent data and thus is easier to understand.
7105 Remove the yyvalp and yylocp parameters since they are always just
7106 taken from the yys parameter. When reporting a discarded merged value
7107 in debugging output, note that it is incompletely merged. Document the
7108 interface.
7109 (yyresolveAction): If resolving any of the RHS states fails, destroy
7110 them all rather than leaking them. Thus, as long as user actions are
7111 written to clean up the RHS correctly, yyresolveAction always cleans up
7112 the RHS of a semantic option. Document the interface.
7113
7114 2006-02-27 Paul Eggert <eggert@cs.ucla.edu>
7115
7116 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
7117 led to a segmentation fault in GNU Pascal. Problem reported
7118 by Waldek Hebisch.
7119
7120 2006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
7121
7122 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
7123 mid-rule action inside a nonterminal symbol in order to declare a
7124 destructor for its semantic value.
7125
7126 2006-02-16 Paul Eggert <eggert@cs.ucla.edu>
7127
7128 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
7129 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
7130 __cplusplus && ! defined _STDLIB_H && !
7131 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
7132 defined free))]: Include <stdlib.h> rather than rolling our own
7133 declarations of malloc and free, to avoid problems with
7134 incompatible declarations (using 'throw') C++'s stdlib.h. This
7135 should fix Debian bug 340012
7136 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
7137 reported by Guillaume Melquiond.
7138
7139 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
7140
7141 * NEWS: Clarify symbols versus types in unused-value warnings.
7142
7143 * configure.ac (AC_INIT): Bump version number.
7144
7145 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
7146
7147 * NEWS: Version 2.1a.
7148 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
7149 since C99 requires this.
7150
7151 2006-02-11 Paul Eggert <eggert@cs.ucla.edu>
7152
7153 * m4/c-working.m4: New file.
7154 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
7155
7156 2006-02-10 Paul Eggert <eggert@cs.ucla.edu>
7157
7158 * Makefile.maint: Merge from coreutils.
7159
7160 2006-02-09 Paul Eggert <eggert@cs.ucla.edu>
7161
7162 More portability fixes for problems summarized by Nelson H. F. Beebe.
7163
7164 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
7165 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
7166 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
7167 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
7168 messes up because C++ code is compiled in 32-bit mode but linked
7169 in 64-bit mode.
7170
7171 2006-02-08 Paul Eggert <eggert@cs.ucla.edu>
7172
7173 More portability fixes for problems summarized by Nelson H. F. Beebe.
7174
7175 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
7176 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
7177
7178 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
7179 nodist_PROGRAMS, since we don't need to actually compile the
7180 example if we're just doing a plain 'make'. This avoids bothering
7181 the installer unnecessarily about problems due to weird C++
7182 compilers.
7183
7184 2006-02-06 Paul Eggert <eggert@cs.ucla.edu>
7185
7186 More portability fixes for problems summarized by Nelson H. F. Beebe.
7187
7188 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
7189 than #include "...", and compile with -I'.'. The old method was
7190 not portable, according to Posix and the C standard, and it does
7191 not work with Sun C 5.7, where previous #line directives affect
7192 the working directory used in later #include "..." directives.
7193
7194 2006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7195
7196 Various DJGGP specific issues in /djgpp
7197
7198 2006-02-02 Paul Eggert <eggert@cs.ucla.edu>
7199
7200 More portability fixes for problems summarized by Nelson H. F. Beebe.
7201
7202 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
7203 '#include <map>' works and that you can apply ++ to iterators.
7204
7205 2006-02-01 Paul Eggert <eggert@cs.ucla.edu>
7206
7207 Work around portability problems summarized by Nelson H. F. Beebe in
7208 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
7209
7210 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
7211 that '#include <string>' works.
7212
7213 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
7214 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
7215 "warning: sorry: semantics of inline function static data `const
7216 unsigned char translate_table[262]' are wrong (you'll wind up with
7217 multiple copies)".
7218
7219 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
7220 or, xor to not_, and_, or_, and xor_, respectively. This works
7221 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
7222 random system header somewhere that includes the equivalent of
7223 <iso646.h>.
7224
7225 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
7226 -E" works; it apparently doesn't work with PathScale EKO Compiler
7227 Suite Version 2.0.
7228
7229 2006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
7230
7231 During deterministic GLR operation, user actions should be able to
7232 influence the parse by changing yychar. To make this easier to fix and
7233 to make glr.c easier to evolve in general, don't maintain yytoken in
7234 parallel with yychar; just compute yytoken when needed.
7235 * tests/glr-regression.at (Incorrect lookahead during deterministic
7236 GLR): Check that setting yychar in a user action has the intended
7237 effect.
7238 * data/glr.c (yyGLRStack): Remove yytokenp member.
7239 (yyclearin): Don't set *yytokenp.
7240 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
7241 yychar rather than *yytokenp to determine the current lookahead.
7242 Compute yytoken locally when needed.
7243 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
7244 point to.
7245
7246 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
7247 after `--report' documentation.
7248
7249 2006-01-30 Paul Eggert <eggert@cs.ucla.edu>
7250
7251 * src/parse-gram.y (grammar_declaration): Location of printer
7252 symbol is @1, not list->location. Bug reported by twlevo.
7253 * tests/input.at (Incompatible Aliases): Adjust to above change.
7254
7255 2006-01-29 Paul Eggert <eggert@cs.ucla.edu>
7256
7257 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
7258 all the test at once. This makes the output easier to read in the
7259 normal case.
7260
7261 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
7262 got from <http://bro-ids.org/download.html>. The bug is that
7263 when two actions appeared in succession, the second one was
7264 scanned before the first one was added to the grammar rule
7265 as a midrule action. Bison then output the incorrect warning
7266 "parse.y:905.17-906.36: warning: unused value: $3".
7267 * src/parse-gram.y (BRACED_CODE, action): These are no longer
7268 associated with a value.
7269 (rhs): Don't invoke grammar_current_rule_action_append.
7270 (action): Invoke it here instead.
7271 * src/reader.c (grammar_midrule_action): Now extern.
7272 (grammar_current_rule_action_append): Don't invoke
7273 grammar_midrule_action; that is now the scanner's job.
7274 * src/reader.h (last_string, last_braced_code_loc):
7275 (grammar_midrule_action): New decls.
7276 * src/scan-gram.l (last_string): Now extern, sigh.
7277 (last_braced_code_loc): New extern variable.
7278 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
7279 rule already has an action.
7280 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
7281 * tests/input.at (AT_CHECK_UNUSED_VALUES):
7282 Add some tests to check that the above changes fixed the bug.
7283
7284 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
7285
7286 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
7287 All used changed. Check whether the symbol has a destructor,
7288 not whether it is typed.
7289 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
7290 that the values are still reported as unused. All line numbers
7291 adjusted.
7292
7293 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
7294
7295 Work around a bug in bro 0.8, which underparenthesizes its
7296 definition of YYLLOC_DEFAULT.
7297 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
7298 their arguments.
7299 * data/lalr1.cc: Likewise.
7300 * data/yacc.cc: Likewise.
7301
7302 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
7303
7304 Work around a bug in Pike 7.0, and give the Pike folks a
7305 better way to override the usual int widths.
7306 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
7307 user can override the types.
7308 (short): #undef, to work around a bug in Pike 7.0.
7309 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
7310 (union yyalloc.yyss): Use yytype_int16 rather than short.
7311 All uses changed.
7312 (yysigned_char): Remove.
7313 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
7314 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
7315 * tests/regression.at (Web2c Actions): Adjust to above changes.
7316
7317 * src/reader.c (check_and_convert_grammar): New function.
7318 (reader): Close the input file even if something went wrong during
7319 parsing. Minor file descriptor leak reported by twlevo.
7320
7321 * src/assoc.c (assoc_to_string): Use a default: abort (); case
7322 to pacify gcc -Wswitch-default.
7323 * src/scan-gram.l (adjust_location): Use a default: break; case
7324 to pacify gcc -Wswitch-default.
7325 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
7326 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
7327 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
7328 Move these decls to scan-skel.l, since they don't need to be
7329 visible elsewhere.
7330 * src/scan-skel.l: Accept the above decls.
7331 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
7332 is used.
7333
7334 2006-01-21 Paul Eggert <eggert@cs.ucla.edu>
7335
7336 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
7337 since we don't want to insist on a version number at the start
7338 of the changelog every time.
7339 * Makefile.maint: Sync from coreutils a bit better.
7340 (sc_trailing_blank): Renamed from sc_trailing_space.
7341 All uses changed.
7342 (sc_no_if_have_config_h, sc_require_config_h):
7343 (sc_prohibit_assert_without_use): New rules.
7344 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
7345 (sc_dd_max_sym_length): Fix leading spaces in rule.
7346 (sc_system_h_headers): Prefix with @.
7347 (sc_useless_cpp_parens, m4-check): Output line numbers.
7348 (changelog-check): Allow version only in head.
7349 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
7350 satisfy new Makefile.maint rule.
7351 * data/glr.c: Likewise.
7352 * data/glr.cc: Likewise.
7353 * data/lalr1.cc: Likewise.
7354 * data/yacc.c: Likewise.
7355 * lib/ebitsetv.c: Likewise.
7356 * lib/lbitset.c: Likewise.
7357 * lib/subpipe.c: Likewise.
7358 * lib/timevar.c: Likewise.
7359 * src/system.h: Likewise.
7360 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
7361 * djgpp/Makefile.maint: Add copyright notice.
7362 * djgpp/README.in: Likewise.
7363 * djgpp/config.bat: Likewise.
7364 * djgpp/config.site: Likewise.
7365 * djgpp/config_h.sed: Likewise.
7366 * djgpp/djunpack.bat: Likewise.
7367 * djgpp/config.sed: Fix copyright notice to match standard format.
7368 * djgpp/subpipe.h: Likewise.
7369 * lib/bitsetv-print.c: Likewise.
7370 * lib/bitsetv.c: Likewise.
7371 * lib/subpipe.h: Likewise.
7372 * lib/timevar.c: Likewise.
7373 * lib/timevar.h: Likewise.
7374 * djgpp/subpipe.c: Use standard recipe for config.h.
7375 * lib/abitset.c: Likewise.
7376 * lib/bitset.c: Likewise.
7377 * lib/bitset_stats.c: Likewise.
7378 * lib/bitsetv-print.c: Likewise.
7379 * lib/bitsetv.c: Likewise.
7380 * lib/ebitsetv.c: Likewise.
7381 * lib/get-errno.c: Likewise.
7382 * lib/lbitset.c: Likewise.
7383 * lib/subpipe.c: Likewise.
7384 * lib/timevar.c: Likewise.
7385 * lib/vbitset.c: Likewise.
7386 * tests/local.at: Likewise.
7387 * src/scan-gram.l: Don't include verify.h, since system.h does
7388 that for us.
7389 * .x-sc_require_config_h: New file.
7390 * .x-sc_unmarked_diagnostics: New file.
7391
7392 2006-01-20 Paul Eggert <eggert@cs.ucla.edu>
7393
7394 Be a bit more systematic about using 'abort'.
7395 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
7396 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
7397 Put 'default: abort ();' before some other case, to satisfy older
7398 pedantic compilers.
7399 * lib/bitset_stats.c (bitset_stats_init): Likewise.
7400 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
7401 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
7402 * src/conflicts.c (resolve_sr_conflict): Likewise.
7403 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
7404 (get_decision_str, get_orientation_str, get_node_alignment_str):
7405 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
7406 (get_linestyle_str, get_arrowstyle_str): Likewise.
7407 * src/conflicts.c (resolve_sr_conflict):
7408 Use a default case rather than one for the one remaining enum
7409 value, to catch invalid enum values as well.
7410 * src/lalr.c (set_goto_map, map_goto):
7411 Prefer "assert (FOO);" to "if (!FOO) abort ();".
7412 * src/nullable.c (nullable_compute, token_definitions_output):
7413 Likewise.
7414 * src/reader.c (packgram, reader): Likewise.
7415 * src/state.c (transitions_to, state_new, state_reduction_find):
7416 Likewise.
7417 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
7418 (symbol_pack): Likewise.
7419 * src/tables.c (conflict_row, pack_vector): Likewise.
7420 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
7421 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
7422 * src/system.h: Don't include <assert.h>.
7423 (assert): New macro.
7424
7425 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
7426 (Destructor Decl, Parser Function, Pure Calling):
7427 Describe rules for braces inside C code more carefully.
7428
7429 2006-01-19 Paul Eggert <eggert@cs.ucla.edu>
7430
7431 Fix some porting glitches found by Nelson H. F. Beebe.
7432 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
7433 compilers that don't understand that abort () does not return.
7434 * src/state.c (transitions_to): Likewise.
7435 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
7436 that '#include <cstdlib>' works.
7437 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
7438 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
7439 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
7440 for the benefit of some pre-C99 compilers.
7441
7442 * bootstrap: Undo changes to gnulib files that autoreconf made.
7443
7444 Minor fixups to get 'make maintainer-check' to work.
7445 * configure.ac: Don't use -Wnested-externs, as it's incompatible
7446 with the new verify.h implementation.
7447 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
7448 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
7449 * data/yacc.c (YYUSE): Likewise.
7450 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
7451 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
7452 * src/parse-gram.y (declaration): Don't pass a string constant
7453 to a function that expects char *, since GCC might complain
7454 about the constant value.
7455 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
7456 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
7457 before #defining them.
7458 * tests/glr-regression.at
7459 (Incorrectly initialized location for empty right-hand side in GLR):
7460 In yyerror, use the msg arg.
7461 (Corrupted semantic options if user action cuts parse):
7462 (Incorrect lookahead during deterministic GLR):
7463 (Incorrect lookahead during nondeterministic GLR):
7464 Don't name a local var 'index'; it shadows string.h's 'index'.
7465
7466 2006-01-19 Akim Demaille <akim@epita.fr>
7467
7468 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
7469 location, not just parts of it.
7470
7471 2006-01-18 Paul Eggert <eggert@cs.ucla.edu>
7472
7473 * NEWS: Document the fact that multiple %unions are now allowed.
7474 * doc/bison.texinfo (Union Decl): Likewise.
7475 * TODO: This feature is now implemented, so remove it from
7476 the wishlist.
7477
7478 * Makefile.maint: Merge with coreutils Makefile.maint.
7479 (CVS_LIST): Use build-aux version if available.
7480 (VERSION_REGEXP): New macro.
7481 (syntax-check-rules): Add sc_no_if_have_config_h,
7482 sc_prohibit_assert_without_use, sc_require_config_h,
7483 sc_useless_cpp_parens.
7484 (sc_obsolete_symbols): Check for O_NDELAY.
7485 (sc_dd_max_sym_length): Track coreutils.
7486 (sc_unmarked_diagnostics): Look in all files, not just *.c.
7487 (sc_useless_cpp_parens): New rule.
7488 (news-date-check): Look for version or today's date.
7489 (changelog-check): Don't require version number near head.
7490 (copyright-check): Use current year instead of hardwiring 2005.
7491 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
7492 (announcement): Add --gpg-key-ID.
7493
7494 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
7495 with "file system".
7496
7497 Avoid undefined behavior that addressed just before the start of an
7498 array. Problem reported by twlevo.
7499 * src/reader.c (packgram): Prepend a new sentinel before ritem.
7500 * src/lalr.c (build_relations): Rely on new sentinel.
7501 * src/gram.c (gram_free): Adjust to new sentinel.
7502
7503 2006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
7504
7505 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
7506 yylookaheadNeeds. All uses updated.
7507 (yysplitStack): Rename local yynewLookaheadStatuses to
7508 yynewLookaheadNeeds.
7509 * data/glr-regression.at (Incorrect lookahead during nondeterministic
7510 GLR): In comments, change `lookahead status' to `lookahead need'.
7511
7512 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7513
7514 * data/glr.c (yysplitStack): A little stylistic rewrite.
7515
7516 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7517
7518 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
7519
7520 2006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
7521
7522 * doc/bison.texinfo: Fix some typos.
7523 (GLR Semantic Actions): New subsection discussing special
7524 considerations because GLR semantic actions might be deferred.
7525 (Actions): Mention look-ahead usage of yylval.
7526 (Actions and Locations): Mention look-ahead usage of yylloc.
7527 (Special Features for Use in Actions): Add YYEOF entry and mention it
7528 in the yychar entry.
7529 In the yychar entry, remove mention of the local yychar case (pure
7530 parser) since this is irrelevant information when writing semantic
7531 actions and since it's already discussed in `Table of Symbols' where
7532 yychar is otherwise described as an external variable.
7533 In the yychar entry, don't call it the `current' look-ahead since it
7534 isn't when semantic actions are deferred.
7535 In the yychar and yyclearin entries, add note about deferred semantic
7536 actions.
7537 Add yylloc and yylval entries discussing look-ahead usage.
7538 (Look-Ahead Tokens): When discussing yychar, don't call it the
7539 `current' look-ahead, and do mention yylval and yylloc.
7540 (Error Recovery): Cross-reference `Action Features' when mentioning
7541 yyclearin.
7542 (Table of Symbols): In the yychar entry, don't call it the `current'
7543 look-ahead.
7544 In the yylloc and yylval entries, mention look-ahead usage.
7545
7546 2006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
7547
7548 * tests/glr-regression.at: Update copyright year to 2006.
7549
7550 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
7551
7552 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
7553 use during nondeterministic operation to track which stacks have
7554 actually needed the current lookahead.
7555 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
7556 Allocate, deallocate, resize, and otherwise shuffle space for
7557 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
7558 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
7559 appropriately during nondeterministic operation.
7560 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
7561 members to store the current lookahead to be used by the deferred
7562 user action.
7563 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
7564 from which the RHS is taken. Set the lookahead members of the new
7565 yySemanticOption according to the lookahead status for stack yyk.
7566 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
7567 yyaddDeferredAction.
7568 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
7569 members of yySemanticOption before invoking yyuserAction, and then set
7570 them back to their current values afterward.
7571 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
7572 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
7573 * tests/glr-regression.at: Remove `.' from the ends of recent test case
7574 titles for consistency.
7575 (Leaked merged semantic value if user action cuts parse): In order to
7576 suppress lint warnings, use arguments in merge function, and assign
7577 char value < 128 in main.
7578 (Incorrect lookahead during deterministic GLR): New test case.
7579 (Incorrect lookahead during nondeterministic GLR): New test case.
7580
7581 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
7582
7583 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
7584 !yyvaluep as signal that no semantic value is available to print.
7585 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
7586 to print a semantic value.
7587
7588 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
7589
7590 * tests/glr-regression.at: For consistency with my newer test cases,
7591 don't thank myself.
7592
7593 2006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
7594
7595 * data/glr.c (yyresolveValue): When merging semantic options, if at
7596 least one user action succeeds but a later one cuts the parse, then
7597 destroy the semantic value before returning rather than leaking it.
7598 (yyresolveStates): If a user action cuts the parse and thus
7599 yyresolveValue fails, ignore the (unset) semantic value rather than
7600 corrupting the yyGLRState, and empty the semantic options list since
7601 the user actions should have called all necessary destructors.
7602 Simplify code with YYCHK.
7603 * tests/glr-regression.at (Corrupted semantic options if user action
7604 cuts parse): New test case.
7605 (Undesirable destructors if user action cuts parse): New test case.
7606 Before applying any of this patch, this test case never actually failed
7607 for me... but only because the corrupted semantic options usually
7608 masked this bug.
7609 (Leaked merged semantic value if user action cuts parse): New test
7610 case.
7611
7612 2006-01-05 Akim Demaille <akim@epita.fr>
7613
7614 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
7615
7616 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
7617
7618 * data/c.m4 (b4_c_modern): New macro, with a new provision for
7619 _MSC_VER. Problem reported by Cenzato Marco.
7620 (b4_c_function_def): Use it.
7621 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
7622 b4_c_modern.
7623 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
7624 than rolling our own.
7625
7626 2006-01-04 Akim Demaille <akim@epita.fr>
7627
7628 Also warn about non-used mid-rule values.
7629 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
7630 member.
7631 (symbol_list_new): Adjust.
7632 * src/reader.c (symbol_typed_p): New.
7633 (grammar_rule_check): Use it.
7634 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
7635 Check its rule.
7636 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
7637 Use it.
7638 * tests/actions.at (Exotic Dollars): Adjust.
7639
7640 2006-01-04 Akim Demaille <akim@epita.fr>
7641
7642 * src/reader.c (grammar_midrule_action): If $$ is set in a
7643 mid-rule, move the `used' bit to its lhs.
7644 * tests/input.at (Unused values): New.
7645 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
7646
7647 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
7648
7649 * doc/bison.texinfo (Bison Options): Say more accurately what
7650 --yacc does.
7651 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
7652 about declarations in the grammar when in Yacc mode, as POSIX does
7653 not require a diagnostic when the grammar uses extensions.
7654
7655 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
7656
7657 Warn about dubious constructions like "%token T T".
7658 Reported by twlevo.
7659 * src/symtab.h (struct symbol.declared): New member.
7660 * src/symtab.c (symbol_new): Initialize it to false.
7661 (symbol_class_set): New arg DECLARING, specifying whether
7662 this is a declaration that we want to warn about, if there
7663 is more than one of them. All uses changed.
7664
7665 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
7666 Allow multiple %union directives, whose contents concatenate.
7667 * src/parse-gram.y (grammar_declaration): Likewise.
7668 Use muscle_code_grow, so that we don't need stype_line any more.
7669 All uses changed.
7670
7671 * src/muscle_tab.c (muscle_grow): Fix comment.
7672
7673 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
7674 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
7675 Update copyright year to 2006.
7676
7677 2006-01-03 Akim Demaille <akim@epita.fr>
7678
7679 Have glr.cc pass (some of) the calc.at tests.
7680 * data/glr.cc (b4_parse_param_orig): New.
7681 (b4_parse_param): Improve its definition, and bound it more
7682 clearly in the skeleton.
7683 (b4_epilogue): Append, instead of prepending, in order to keep
7684 #line consistency.
7685 Simplify the generation of auxiliary functions: locations and
7686 purity are mandated.
7687 (b4_global_tokens_and_yystype): Honor it.
7688 * data/location.cc (c++.m4): Don't include it.
7689 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
7690 and AT_SKEL_CC_IF.
7691 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
7692 AT_LALR1_CC_IF.
7693 Be sure to initialize the first position's filename.
7694 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
7695 mandated anyway.
7696 (AT_CHECK_CALC_GLR_CC): New.
7697 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
7698
7699 2006-01-02 Akim Demaille <akim@epita.fr>
7700
7701 * src/output.c (output_skeleton): Don't hard wire the inclusion of
7702 c.m4.
7703 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
7704 * data/glr.cc: Do not include stack.hh.
7705
7706 2006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
7707
7708 * data/glr.c: Reformat whitespace with tabs.
7709 (b4_lpure_formals): Remove this unused m4 macro.
7710 * tests/cxx-type.at: Reformat whitespace with tabs.
7711 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
7712 since it's a member. Rename type to isNterm for clarity.
7713
7714 2005-12-29 Akim <akim@sulaco.local>
7715
7716 Let glr.cc catch up with symbol_value_print.
7717 * data/glr.cc (b4_yysymprint_generate): Replace by...
7718 (b4_yy_symbol_print_generate): this.
7719 (yy_symbol_print, yy_symbol_value_print): Declare them.
7720
7721 2005-12-28 Paul Eggert <eggert@cs.ucla.edu>
7722
7723 * src/location.h (boundary): Note that a line or column equal
7724 to INT_MAX indicates an overflow.
7725 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
7726 (rule_length_overflow, increment_rule_length, add_column_width):
7727 New functions.
7728 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
7729 (<SC_BRACED_CODE>"}"):
7730 Use increment_rule_length rather than incrementing it by hand.
7731 (adjust_location, handle_syncline): Diagnose overflow.
7732 (handle_action_dollar, handle_action_at):
7733 Fix bug with monstrosities like $-2147483648.
7734 Remove now-unnecessary checks.
7735 (scan_integer): Verify assumptions and remove now-unnecessary checks.
7736 (convert_ucn_to_byte): Verify assumptions.
7737 (handle_syncline): New arg LOC. All callers changed.
7738 Don't store through a value derived from char const * pointer.
7739
7740 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
7741 GCC warnings.
7742
7743 2005-12-27 Paul Eggert <eggert@cs.ucla.edu>
7744
7745 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
7746 Remove unnecessary forward static decls.
7747
7748 2005-12-27 Akim Demaille <akim@epita.fr>
7749
7750 * src/reader.c (grammar_current_rule_check): Also check that $$
7751 is used.
7752 Take the rule to check as argument, hence rename as...
7753 (grammar_rule_check): this.
7754 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
7755 Rename as...
7756 (grammar_rule_begin, grammar_rule_end): these, for consistency.
7757 (grammar_midrule_action, grammar_symbol_append): Now static.
7758 * tests/torture.at (input): Don't rely on the default action
7759 being always performed.
7760 * tests/calc.at: "Set" $$ even when the action is "cut" with
7761 YYERROR or other.
7762 * tests/actions.at (Exotic Dollars): Instead of using unused
7763 values, check that the warning is issued.
7764
7765 2005-12-22 Paul Eggert <eggert@cs.ucla.edu>
7766
7767 * NEWS: Improve wording for unused-value warnings.
7768
7769 2005-12-22 Akim Demaille <akim@epita.fr>
7770
7771 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
7772 (b4_yysymprint_generate): Rename as...
7773 (b4_yy_symbol_print_generate): this.
7774 Generate yy_symbol_print instead of yysymprint.
7775 Generate also yy_symbol_value_print, and use it.
7776
7777 2005-12-22 Akim Demaille <akim@epita.fr>
7778
7779 * NEWS: Warn about unused values.
7780 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
7781 a `used' member.
7782 (symbol_list_n_get, symbol_list_n_used_set): New.
7783 (symbol_list_n_type_name_get): Use symbol_list_n_get.
7784 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
7785 * src/reader.c (grammar_current_rule_check): Check that values are
7786 used.
7787 * src/symtab.c (symbol_print): Accept 0.
7788 * tests/existing.at: Remove the type information.
7789 Empty the actions.
7790 Remove useless actions (beware of mid-rule actions: perl -000
7791 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
7792 * tests/actions.at (Exotic Dollars): Use unused values.
7793 * tests/calc.at: Likewise.
7794 * tests/glr-regression.at (No users destructors if stack 0 deleted):
7795 Likewise.
7796
7797 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
7798 rule_useful_p.
7799
7800 2005-12-21 Paul Eggert <eggert@cs.ucla.edu>
7801
7802 Undo 2005-12-01 tentative license wording change. The wording is
7803 still being reviewed by the lawyers, and we don't want to wait for
7804 them before publishing a test release. For now, revert to the
7805 previous wording.
7806 * NEWS: Undo 2005-12-01 change.
7807 * data/glr.c: Revert to previous license wording.
7808 * data/glr.cc: Likewise.
7809 * data/lalr1.cc: Likewise.
7810 * data/location.cc: Likewise.
7811 * data/yacc.c: Likewise.
7812
7813 * NEWS: Reword %destructor vs YYABORT etc.
7814 * data/glr.c: Use American spacing, for consistency.
7815 * data/glr.cc: Likewise.
7816 * data/lalr1.cc: Likewise.
7817 * data/yacc.c: Likewise.
7818 * data/yacc.c: Reformat comments slightly.
7819 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
7820 for consistency. Fix some spelling errors and reword recently-included
7821 text slightly.
7822 * tests/cxx-type.at: Cast results of malloc, for C++.
7823
7824 2005-12-21 Joel E. Denny <address@hidden>
7825
7826 * tests/cxx-type.at: Construct a tree, count the parents of shared
7827 nodes, and free each node once and only once. Previously, the memory
7828 for semantic values was leaked instead.
7829
7830 2005-12-21 Joel E. Denny <address@hidden>
7831
7832 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
7833 (yylval, yylloc): If pure, #define to yystackp->yyval and
7834 yystackp->yyloc similar to yychar and yynerrs.
7835 (yyparse): If pure, remove local yylval and yylloc. Add local
7836 yystackp to accommodate pure definitions of yylval and yylloc.
7837 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
7838 yylvalp and yyllocp to &yylval and &yylloc.
7839 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
7840 namespace. Previously, nerrs and char were missing, but lval and lloc
7841 weren't necessary.
7842 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
7843 yylvalp and yyllocp parameters since, if pure, these are now always
7844 accessible through yystackp. If not pure, they are still accessible
7845 globally.
7846 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
7847 `if (YYID (N))' to pacify lint.
7848
7849 2005-12-21 Akim Demaille <akim@epita.fr>
7850
7851 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
7852 destroy the RHS symbols of a rule.
7853 * data/yacc.c (yylen): Initialize to 0.
7854 Keep its value to the number of items to possibly shift.
7855 In particular, a regular successful parse that ends on YYFINAL by
7856 a (internal) YYACCEPT must not have yylen != 0.
7857 (yyerrorlab, yyreturn): Pop the RHS.
7858 Reorder a bit to emphasize the `shifting' bits of code.
7859 (YYPOPSTACK): Now accept a number of items to pop.
7860 * data/lalr1.cc: Likewise.
7861 * data/glr.c: Formatting changes.
7862 Use goto instead of fall through.
7863 * doc/bison.texinfo (Destructor Decl): Complete.
7864
7865 2005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7866
7867 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
7868 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
7869 * djgpp/config.bat: Replace every occurence of the file name
7870 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
7871 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
7872 * djgpp/config.sed: Replace every occurence of the file name
7873 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
7874 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
7875 * djgpp/djunpack.bat: DJGPP specific file.
7876 * djgpp/fnchange.lst: DJGPP specific file.
7877 * djgpp/README.in: Add new information about how to unpack the bison
7878 source on MSDOS and other systems which have 8.3 file name restrictions
7879 using djunpack.bat and fnchange.lst.
7880
7881 2005-12-12 Paul Eggert <eggert@cs.ucla.edu>
7882
7883 * bootstrap (build_cvs_prefix): Remove; unused.
7884 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
7885 when getting gnulib.
7886
7887 2005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
7888
7889 * data/glr.c: Reorder typedef declarations for structs to match order
7890 of struct declarations.
7891 Rename yystack everywhere to yystackp except in yyparse where it's not
7892 a pointer.
7893 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
7894 consistency.
7895 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
7896 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
7897 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
7898 lint.
7899
7900 2005-12-09 Paul Eggert <eggert@cs.ucla.edu>
7901
7902 * tests/sets.at (Accept): Fix typos in regular expression used to
7903 sed out the final state number.
7904
7905 Work around portability problem on Solaris 10: flex-generated
7906 files include <stdio.h> before <config.h>, which messes up
7907 because the latter defines __EXTENSIONS__. Address the problem
7908 by creating two new little files that include <config.h> first,
7909 then include the flex-generated files. Rewrite everyone else
7910 to include <config.h> first, as well.
7911 * lib/timevar.c: Always include "config.h".
7912 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
7913 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
7914 (EXTRA_bison_SOURCES): New macro.
7915 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
7916 * src/system.h: Don't include config.h.
7917 * src/LR0.c: Include <config.h> first.
7918 * src/assoc.c: Likewise.
7919 * src/closure.c: Likewise.
7920 * src/complain.c: Likewise.
7921 * src/conflicts.c: Likewise.
7922 * src/derives.c: Likewise.
7923 * src/files.c: Likewise.
7924 * src/getargs.c: Likewise.
7925 * src/gram.c: Likewise.
7926 * src/lalr.c: Likewise.
7927 * src/location.c: Likewise.
7928 * src/main.c: Likewise.
7929 * src/muscle_tab.c: Likewise.
7930 * src/nullable.c: Likewise.
7931 * src/output.c: Likewise.
7932 * src/parse-gram.y: Likewise.
7933 * src/print.c: Likewise.
7934 * src/print_graph.c: Likewise.
7935 * src/reader.c: Likewise.
7936 * src/reduce.c: Likewise.
7937 * src/relation.c: Likewise.
7938 * src/state.c: Likewise.
7939 * src/symlist.c: Likewise.
7940 * src/symtab.c: Likewise.
7941 * src/tables.c: Likewise.
7942 * src/uniqstr.c: Likewise.
7943 * src/vcg.c: Likewise.
7944
7945 * src/parse-gram.y: Fix minor problems uncovered by lint.
7946 (current_lhs, current_lhs_location): Now static.
7947 (current_assoc): Remove unused variable.
7948
7949 Cleanups so that Bison-generated parsers have less lint.
7950 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
7951 Prepend /*ARGSUSED*/, for lint's sake.
7952 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
7953 definition if 'lint' is defined.
7954 (YYID): New macro (or function, if lint).
7955 All uses of /*CONSTCOND*/0 replaced by YYID(0).
7956 * data/yacc.c: Likewise.
7957 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
7958 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
7959 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
7960 is C++ only.
7961 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
7962 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
7963 Use YYID(0) rather than 0, for lint.
7964 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
7965 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
7966
7967 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
7968
7969 * tests/glr-regression.at
7970 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
7971 Close memory leak reported by twlevo.
7972
7973 2005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
7974
7975 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
7976 all stacks.
7977 (yyparse): Iterate another stack in order to call user destructors.
7978 * tests/glr-regression.at (No users destructors if stack 0 deleted):
7979 New test case.
7980 (Duplicated user destructor for lookahead): This test now is expected
7981 to succeed.
7982
7983 2005-12-01 Paul Eggert <eggert@cs.ucla.edu>
7984
7985 * NEWS: Document the following change.
7986 * data/yacc.c: Say "parser skeleton" rather than "file", since
7987 it's no longer just a file.
7988 * data/glr.c: Grant a special exception for C GLR parsers, that
7989 reads like the already-existing exception for C LALR(1) parsers.
7990 * data/glr.cc: Likewise.
7991 * data/lalr1.cc: Likewise.
7992 * data/location.cc: Likewise.
7993 * data/yacc.c: Reword the "written by" statement to clarify that
7994 it was the parser skeleton, not the entire output file.
7995 * data/glr.c: Written by Paul Hilfinger.
7996 * data/glr.cc: Written by Akim Demaille.
7997 * data/lalr1.cc: Likewise.
7998
7999 2005-11-18 Paul Eggert <eggert@cs.ucla.edu>
8000
8001 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
8002 Fix typos in previous change that broke 'make check'.
8003 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
8004 supported in C.
8005 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
8006 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
8007 We can revert this once things settle down.
8008
8009 * src/conflicts.c (conflicts_print): Don't print file name twice
8010 when %expect fails because there were no conflicts.
8011 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
8012 change.
8013 * tests/conflicts.at (%expect not enough, %expect too much):
8014 (%expect with reduce conflicts): Adjust to new behavior.
8015
8016 2005-11-18 Akim Demaille <akim@epita.fr>
8017
8018 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
8019 errors.
8020 * NEWS: Document this.
8021 * doc/bison.texinfo (Expect Decl): Likewise.
8022
8023 2005-11-16 Akim Demaille <akim@epita.fr>
8024
8025 Generalize the display of semantic values and locations in traces.
8026 * data/glr.c (yy_reduce_print): Fix indices (again).
8027 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
8028 literal integers.
8029 * data/lalr1.cc (yyreduce_print): Rename as...
8030 (yy_reduce_print): this.
8031 Display values and locations.
8032 * data/yacc.c (yy_reduce_print): Likewise.
8033 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
8034 (yysymprint): Move higher to be visible from yy_reduce_print).
8035 (yyparse): Adjust.
8036 * tests/calc.at: Adjust the expected length of the traces.
8037
8038 2005-11-14 Akim Demaille <akim@epita.fr>
8039
8040 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
8041 from 1 to N, while values and location start at 0.
8042 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
8043
8044 2005-11-14 Akim Demaille <akim@epita.fr>
8045
8046 * data/glr.c (yy_reduce_print): Fix the $ number.
8047
8048 2005-11-14 Akim Demaille <akim@epita.fr>
8049
8050 "Use" parse parameters.
8051 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
8052 * data/glr.c, data/glr.cc: Use them.
8053 * data/glr.c (YYUSE): Have a C++ definition that supports
8054 non-pointer types.
8055
8056 2005-11-14 Akim Demaille <akim@epita.fr>
8057
8058 * data/glr.c (yyexpandGLRStack): Declare only if defined.
8059
8060 2005-11-14 Akim Demaille <akim@epita.fr>
8061
8062 * data/glr.cc: New.
8063 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
8064
8065 2005-11-12 Akim Demaille <akim@epita.fr>
8066
8067 Let position and location be PODs.
8068 * data/location.cc (position::initialize, location::initialize): New.
8069 (position::position, location::location): Define only if
8070 b4_location_constructors is defined.
8071 * data/lalr1.cc (b4_location_constructors): Define it for backward
8072 compatibility.
8073 * doc/bison.texinfo (Initial Action Decl): Use initialize.
8074
8075 2005-11-12 Akim Demaille <akim@epita.fr>
8076
8077 * data/lalr1.cc: Move the body of the ctor and dtor into the
8078 parser file (instead of the header).
8079 Wrap the implementations in a "namespace yy".
8080
8081 2005-11-12 Akim Demaille <akim@epita.fr>
8082
8083 Have glr.c include its header file when created.
8084 * data/glr.c (b4_shared_declarations): New.
8085 Output them verbatim in the parser if !%defines, otherwise
8086 output then in the header file, and include it instead.
8087
8088 2005-11-11 Akim Demaille <akim@epita.fr>
8089
8090 * data/glr.c: Comment changes.
8091
8092 2005-11-11 Akim Demaille <akim@epita.fr>
8093
8094 When yydebug, report semantic and location values for reductions.
8095 * data/glr.c (yy_reduce_print): Report the semantic values and the
8096 locations.
8097 (YY_REDUCE_PRINT): Adjust.
8098 (yyglrReduce): Use them.
8099 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
8100 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
8101 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
8102 traces.
8103
8104 2005-11-10 Akim Demaille <akim@epita.fr>
8105
8106 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
8107 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
8108 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
8109
8110 2005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
8111
8112 * m4/cxx.m4, examples/Makefile.am: Don't build
8113 examples/calc++ if no C++ compiler is available. (trivial change)
8114
8115 2005-11-09 Akim Demaille <akim@epita.fr>
8116
8117 * src/scan-skel.l: Use a couple of asserts.
8118
8119 2005-11-03 Akim Demaille <akim@epita.fr>
8120
8121 In some (weird) cases, the final state number is incorrect.
8122 Reported by Alexandre Duret-Lutz.
8123 * src/LR0.c (state_list_append): Remove the computation of
8124 final_state.
8125 (save_reductions): Do it here.
8126 (get_state): Alpha conversion.
8127 (generate_states): Use a for loop.
8128 * src/gram.h (item_number_is_rule_number)
8129 (item_number_is_symbol_number): New.
8130 * src/state.c: Use assert.
8131 * src/system.h: Include assert.h.
8132 * tests/sets.at (Accept): New.
8133
8134 2005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8135
8136 * data/glr.c (yyfill): Adjust comment.
8137 (yyresolveAction): Initialize default location properly
8138 for empty right-hand sides.
8139 (yydoAction): Ditto.
8140 Add comment explaining apparently dead code.
8141 * tests/glr-regression.at
8142 (Incorrectly initialized location for empty right-hand side in GLR):
8143 New test.
8144
8145 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
8146
8147 * bootstrap (cleanup_gnulib): New function. Use it to clean up
8148 gnulib when interrupted. This fixes some race conditions and
8149 works around some portability problems (one noted by Paul
8150 Hilfinger).
8151
8152 2005-10-22 Akim <akim@epita.fr>
8153
8154 * Makefile.cfg: Adjust to config -> build-aux.
8155 Reported by twledo.
8156
8157 2005-10-21 Akim Demaille <akim@epita.fr>
8158
8159 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
8160 the %parse-params.
8161 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
8162 * data/yacc.c (b4_Pure_if): Rename as...
8163 (b4_yacc_pure_if): this.
8164 (YY_SYMBOL_PRINT, yyparse): Adjust.
8165 * doc/bison.texinfo: Formatting changes.
8166
8167 2005-10-21 Akim Demaille <akim@epita.fr>
8168
8169 Finish the transition config -> build-aux.
8170 * configure.ac, Makefile.am: Use build-aux.
8171 * config/prev-version, config/announce-gen, config/Makefile.am:
8172 Move to...
8173 * build-aux/prev-version, build-aux/announce-gen,
8174 * build-aux/Makefile.am: here.
8175
8176 2005-10-14 Akim Demaille <akim@epita.fr>
8177
8178 * examples/calc++/test: Use set -x only when VERBOSE.
8179
8180 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
8181
8182 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
8183 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
8184
8185 2005-10-13 Akim Demaille <akim@epita.fr>
8186
8187 * src/scan-skel.l: Output the base name parts of the parser and
8188 header file names.
8189 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
8190 additional checks.
8191 Use this to exercise C++ outputs in subdirs.
8192 Reported by Oleg Smolsky.
8193
8194 2005-10-12 Paul Eggert <eggert@cs.ucla.edu>
8195
8196 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
8197 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
8198 Problem reported by John P. Hartmann.
8199 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
8200 already defined it.
8201
8202 2005-10-12 Akim Demaille <akim@epita.fr>
8203
8204 * src/parse-gram.y (version_check): Exit 63 to please missing
8205 (stands for "version mismatch).
8206 * tests/input.at, doc/bison.texinfo: Adjust.
8207
8208 2005-10-10 Paul Eggert <eggert@cs.ucla.edu>
8209
8210 Work around portability problems with Visual Age C compiler
8211 (xlc and xlC_r) reported by John P. Hartmann.
8212 * data/location.cc (initial_column, initial_line): Remove.
8213 All uses replaced by 0 and 1.
8214 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
8215 that xlc complains about.
8216 * src/scan-skel.l (skel_wrap): Likewise.
8217 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
8218 as __STDC__.
8219 * data/yacc.c (YYMODERN_C): New macro, which also looks at
8220 __STDC_VERSION__. Use it everywhere instead of looking at
8221 __STDC__ and __cplusplus.
8222
8223 2005-10-10 Akim Demaille <akim@epita.fr>
8224
8225 * examples/calc++/test: Be quiet unless VERBOSE.
8226
8227 2005-10-05 Paul Eggert <eggert@cs.ucla.edu>
8228
8229 * data/c.m4 (yydestruct, yysymprint):
8230 Use YYUSE instead of casting to void.
8231 * data/glr.c (YYUSE): New macro.
8232 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
8233 Use it instead of rolling our own.
8234 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
8235 (YYCHK1):
8236 Use /*CONSTCOND*/ to suppress lint warnings.
8237 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
8238 (YY_STACK_PRINT): Use 'false' not '0'.
8239 (YYUSE): New macro.
8240 (yysymprint_, yydestruct_): Use it instead of rolling our own.
8241 * data/yacc.c (YYUSE): New macro.
8242 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
8243 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
8244 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
8245
8246
8247 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
8248 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
8249
8250 2005-10-04 Paul Eggert <eggert@cs.ucla.edu>
8251
8252 Undo the parts of the unlocked-I/O change that substituted
8253 putc or puts for printf. This might hurt performance a bit,
8254 but some people prefer the printf style.
8255 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
8256 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
8257 All uses replaced by YYFPRINTF and YYDPRINTF.
8258 * data/yacc.c: Likewise.
8259 * lib/bitset.c (bitset_print): Likewise.
8260 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
8261 putc and puts.
8262 * lib/lbitset.c (debug_lbitset): Likewise.
8263 * src/closure.c (print_firsts, print_fderives): Likewise.
8264 * src/gram.c (grammar_dump): Likewise.
8265 * src/lalr.c (look_ahead_tokens_print): Likewise.
8266 * src/output.c (escaped_output): Likewise.
8267 (user_actions_output): Break apart two printfs.
8268 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
8269 * src/reduce.c (reduce_print): Likewise.
8270 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
8271 * src/system.h: Include unlocked-io.h rathe than stdio.h.
8272
8273 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
8274 Use assignments rather than casts-to-void to suppress
8275 unused-variable warnings. This pacifies 'lint'.
8276 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
8277 unused-variable warnings.
8278
8279 2005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8280
8281 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
8282
8283 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
8284
8285 Use unlocked I/O for a minor performance improvement on hosts like
8286 GNU/Linux and Solaris that support unlocked I/O. The basic idea
8287 is to use the gnlib unlocked-io module, and to prefer putc and
8288 puts to printf when either will work (since the latter doesn't
8289 come in an unlocked flavor).
8290 * bootstrap (gnulib_modules): Add unlocked-io.
8291 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
8292 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
8293 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
8294 and similarly for puts and putc and printf.
8295 * data/yacc.c: Likewise.
8296 * lib/bitset.c (bitset_print): Likewise.
8297 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
8298 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
8299 to printf.
8300 * lib/lbitset.c (debug_lbitset): Likewise.
8301 * src/closure.c (print_firsts, print_fderives): Likewise.
8302 * src/gram.c (grammar_dump): Likewise.
8303 * src/lalr.c (look_ahead_tokens_print): Likewise.
8304 * src/output.c (escaped_output): Likewise.
8305 (user_actions_output): Coalesce two printfs.
8306 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
8307 * src/reduce.c (reduce_print): Likewise.
8308 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
8309 * src/system.h: Include unlocked-io.h rather than stdio.h.
8310
8311 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
8312 this confuses xgettext.
8313
8314 2005-10-02 Akim Demaille <akim@epita.fr>
8315
8316 * bootstrap (gnulib_modules): Add strverscmp.
8317 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
8318 * m4/.cvsignore: Add strverscmp.m4.
8319 * src/parse-gram.y (%require): New token, new rule.
8320 (version_check): New.
8321 * src/scan-gram.l (%require): Adjust.
8322 * tests/input.at (AT_REQUIRE): New.
8323 Use it.
8324 * doc/bison.texinfo (Require Decl): New.
8325 (Calc++ Parser): Use %require.
8326
8327 2005-10-02 Akim Demaille <akim@epita.fr>
8328
8329 * data/location.cc: New.
8330
8331 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
8332 Akim Demaille <akim@epita.fr>
8333
8334 Make sure -odir/foo.cc creates dir/location.hh etc.
8335 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
8336 (spec_file_prefix, spec_verbose_file, spec_graph_file)
8337 (spec_defines_file): Now const.
8338 (dir_prefix): New.
8339 (short_base_name): Remove.
8340 * src/files.c: Adjust.
8341 (dirname.h): Include.
8342 (base_name): Don't prototype it.
8343 (finput): Remove, duplicates gram_in.
8344 (full_base_name, short_base_name): Replace by...
8345 (all_but_ext, all_but_tab_ext): these.
8346 (compute_base_names): Rename as...
8347 (compute_file_name_parts): this.
8348 Update to compute the new variables, including dir_prefix.
8349 Adjust dependencies.
8350 * src/output.c (prepare): Output them.
8351 * src/reader.c: Adjust to use gram_in, not finput.
8352 * src/scan-skel.l (@dir_prefix@): New.
8353
8354 2005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8355
8356 * lib/subpipe.c: New function end_of_output_subpipe() added
8357 to allow support for non-posix systems. This is a no-op function
8358 for posix systems.
8359
8360 * lib/subpipe.h: New function end_of_output_subpipe() added
8361 to allow support for non-posix systems. This is a no-op function
8362 for posix systems.
8363
8364 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
8365 handle the lack of pipe/fork functionality on non-posix systems.
8366
8367 * djgpp/Makefile.maint: DJGPP specific file.
8368
8369 * djgpp/README.in: DJGPP specific file.
8370
8371 * djgpp/config.bat: DJGPP specific configuration file.
8372
8373 * djgpp/config.sed: DJGPP specific configuration file.
8374
8375 * djgpp/config.site: DJGPP specific configuration file.
8376
8377 * djgpp/config_h.sed: DJGPP specific configuration file.
8378
8379 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
8380
8381 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
8382
8383 2005-10-02 Akim Demaille <akim@epita.fr>
8384
8385 * data/location.cc: New, extract from...
8386 * data/lalr1.cc: here.
8387 (location.hh): Include it after the user prologue, in case the
8388 filename type is defined by the user.
8389 Forward declation location and position before the pre-prologue.
8390 (yyresult_): Rename as...
8391 (yyresult): this, it's a local variable, not an attribute.
8392 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
8393
8394 2005-10-01 Akim Demaille <akim@epita.fr>
8395
8396 * examples/extexi: Restore the #line generation.
8397
8398 2005-09-30 Akim Demaille <akim@epita.fr>,
8399 Alexandre Duret-Lutz <adl@gnu.org>
8400
8401 Move the token type and YYSTYPE in the parser class.
8402 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
8403 (parser::token): New, from the moved free definition of tokens.
8404 (parser::semantic_value): Now a full definition instead of an
8405 indirection to YYSTYPE.
8406 (b4_post_prologue): No longer included in the header file, but
8407 in the implementation file.
8408 * doc/bison.texi (C+ Language Interface): Update.
8409 * src/parse-gram.y: Support unary %define.
8410 * tests/actions.at: Define global_tokens_and_yystype for backward
8411 compatibility until we update the tests.
8412 * tests/calc.at: Idem.
8413 (first_line, first_column, last_line, last_column): Define for lalr1.cc
8414 to simplify the code.
8415
8416 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
8417
8418 Port to SunOS 4.1.4, which lacks strtoul and strerror.
8419 Ah, the good old days! Problem reported by Peter Klein.
8420 * bootstrap (gnulib_modules): Add strerror, strtoul.
8421 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
8422 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
8423
8424 2005-09-29 Akim Demaille <akim@epita.fr>
8425
8426 * data/c.m4 (b4_error_verbose_if): New.
8427 * data/lalr1.cc: Use it.
8428 (YYERROR_VERBOSE_IF): Remove.
8429 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
8430 parser members, replaced by...
8431 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
8432 local variables.
8433 (yysyntax_error_): Takes the state number as argument.
8434 (yyreduce_print_): Use the argument yyrule, not the former
8435 attribute yyn_.
8436
8437 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
8438
8439 * bootstrap (gnulib_modules): Add verify.
8440 * lib/.cvsignore: Add verify.h.
8441 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
8442 * src/system.h (verify): Remove.
8443 Include verify.h instead.
8444 * src/tables.c (tables_generate): Use new API for 'verify'.
8445
8446 2005-09-21 Paul Eggert <eggert@cs.ucla.edu>
8447
8448 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
8449 local variables whose names begin with 'yy'.
8450 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
8451 Trivial changes from Joel E. Denny.
8452
8453 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
8454 it itself.
8455 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
8456 don't use alloca any more.
8457
8458 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
8459 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
8460 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
8461 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
8462 to match yacc.c, to test more hosts.
8463
8464 2005-09-20 Paul Eggert <eggert@cs.ucla.edu>
8465
8466 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
8467 doesn't affect behavior.
8468 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
8469 Solaris, AIX, MSC.
8470 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
8471 This works a bit better with glibc, if user code has already included
8472 stdlib.h.
8473 * doc/bison.texinfo (Bison Parser): Document that users can't
8474 arbitrarily use malloc and free for other purposes. Document
8475 that <alloca.h> and <malloc.h> might be included.
8476 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
8477 user must declare alloca.
8478
8479 * HACKING (release): Forwarn the Translation Project about
8480 stable releses.
8481
8482 2005-09-20 Akim Demaille <akim@epita.fr>
8483
8484 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
8485
8486 2005-09-19 Paul Eggert <eggert@cs.ucla.edu>
8487
8488 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
8489 (YYSTACK_ALLOC_MAXIMUM): Use it.
8490 (yysyntax_error): New function.
8491 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
8492 multiple syntax errors are reported, and alloca is being used.
8493 Instead, reallocate buffers twice as big each time, so that
8494 we waste at most half the allocated memory. Start with a small
8495 (128-byte) buffer that will suffice in most cases anyway.
8496 Use yysyntax_error to do most of the work.
8497
8498 * doc/bison.texinfo (Error Reporting, Table of Symbols):
8499 yynerrs is the number of errors reported, not the number of
8500 errors encountered.
8501
8502 * tests/glr-regression.at (Duplicated user destructor for lookahead):
8503 Mark it as expected to fail.
8504 Cast result of malloc; problem reported by twlevo@xs4all.nl.
8505 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
8506 Don't start user-code symbols with "yy", to avoid name space problems.
8507
8508 2005-09-19 Akim Demaille <akim@epita.fr>
8509
8510 Remove the traits, failed experiment.
8511 It never proved useful, and anyway because of the current
8512 definition, it was not possible to have several specialization of
8513 this traits, making it useless.
8514 * data/lalr1.cc (yy:traits): Remove.
8515 Inline its definitions in the parser class.
8516
8517 2005-09-19 Akim Demaille <akim@epita.fr>
8518
8519 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
8520 least Mac OSX with a /usr/local install of gettext.
8521
8522 2005-09-19 Akim Demaille <akim@epita.fr>
8523
8524 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
8525 and yytoken for similarity with the other skeletons.
8526
8527 2005-09-19 Akim Demaille <akim@epita.fr>
8528
8529 * NEWS, configure.ac: update version number to 2.1a.
8530
8531 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
8532
8533 * NEWS: Version 2.1.
8534
8535 * NEWS: Remove notice of yytname change, since it was never in an
8536 official release.
8537 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
8538 diagnostic.
8539 * src/output.c (prepare): Likewise.
8540 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
8541 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
8542 is not defined. This is an awful hack, but it's enough for now.
8543 All callers changed.
8544 * tests/glr-regression-at (make_value): Args are const pointers now,
8545 to avoid GCC warning.
8546 (Duplicated user destructor for lookahead): New test. Currently
8547 skipped. It fails on my host but I'm not sure it'll always fail.
8548
8549 2005-09-16 Akim Demaille <akim@epita.fr>
8550
8551 * src/symtab.h (struct symbol): Declare the printer and destructor
8552 as const, to avoid accidental calls to free.
8553 (symbol_destructor_set, symbol_printer_set): Adjust.
8554 * src/symtab.c: Adjust.
8555
8556 2005-09-16 Akim Demaille <akim@epita.fr>
8557
8558 * data/c.m4 (b4_token_enums): New.
8559 (b4_token_defines): Rename as...
8560 (b4_token_enums_defines): this.
8561 (b4_token_defines): New, output only the #defines.
8562 * data/yacc.c, data/glr.c: Adjust.
8563 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
8564 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
8565 as default values.
8566
8567 2005-09-16 Akim Demaille <akim@epita.fr>
8568
8569 * data/lalr1.cc (yylex_): Remove, inline its code.
8570 (yyreport_syntax_error_): Remove, replaced by...
8571 (yysyntax_error_): this which returns a string and leaves to the
8572 caller the call to the users' error function.
8573 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
8574 Move from members of the parser object...
8575 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
8576 to local variables of the parse function.
8577
8578 2005-09-16 Akim Demaille <akim@epita.fr>
8579
8580 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
8581 since it's in Bison's name space.
8582
8583 2005-09-15 Paul Eggert <eggert@cs.ucla.edu>
8584
8585 * data/glr.c (yyresolveValue): Add default case to pacify
8586 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
8587
8588 * NEWS: Document when yyparse started to return 2.
8589 * doc/bison.texinfo (Parser Function): Document when yyparse
8590 returns 2.
8591
8592 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
8593 (b4_filename_type): Renamed back from b4_file_name_type. All uses
8594 changed.
8595 (class position): file_name -> filename (reverting). All uses changed.
8596
8597 2005-09-14 Paul Eggert <eggert@cs.ucla.edu>
8598
8599 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
8600 do anything if $@ exists. This reverts part of the 2005-07-07
8601 patch.
8602
8603 2005-09-11 Paul Eggert <eggert@cs.ucla.edu>
8604
8605 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
8606 contains obsolete information and isn't worth distributing as a
8607 separate file anyway.
8608 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
8609 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
8610 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
8611 (yyparse): Abort if user code uses longjmp to throw an unexpected
8612 value.
8613
8614 2005-09-09 Paul Eggert <eggert@cs.ucla.edu>
8615
8616 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
8617 Suggested by twlevo@xs4all.nl.
8618
8619 * data/glr.c (YYCHK1): Do not assume YYE is in range.
8620 This avoids a diagnostic from gcc -Wswitch-enum.
8621 Problem reported by twlevo@xs4all.nl.
8622
8623 * doc/bison.texinfo: Don't use "filename", as per GNU coding
8624 standards. Use "file name" or "file" or "name", depending on
8625 the context.
8626 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
8627 not to hack/foo.tab.c.
8628 (Calc++ Top Level): 2nd arg of main is not const.
8629 * data/glr.c: b4_filename -> b4_file_name.
8630 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
8631 All uses changed.
8632 (class position): filename -> file_name. All uses changed.
8633 * data/yacc.c: b4_filename -> b4_file_name.
8634 * lib/bitset.h: filename -> file_name in local vars.
8635 * lib/bitset_stats.c: Likewise.
8636 * src/files.c: Likewise.
8637 * src/scan-skel.l ("@output ".*\n): Likewise.
8638 * src/files.c (file_name_split): Renamed from filename_split.
8639 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
8640
8641 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
8642
8643 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
8644 to accommodate latest gnulib.
8645
8646 * tests/glr-regression.at (Duplicate representation of merged trees):
8647 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
8648
8649 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
8650 needed.
8651
8652 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
8653
8654 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
8655 All uses changed. Invoke user destructor after an error during a
8656 split parse (trivial change from Joel E. Denny).
8657
8658 * tests/glr-regression.at
8659 (User destructor after an error during a split parse): New test case.
8660 Problem reported by Joel E. Denny in:
8661 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
8662
8663 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
8664
8665 * README-cvs: Give URLs for recommended tools.
8666 Mention Gzip version problem, and bootstrapping issues.
8667 Remove troubleshooting section, as it's somewhat obsolete.
8668
8669 * bootstrap (no_cache): New var, to accommodate different wget
8670 variants. Use it instead of '-C off'. Problem reported by
8671 twlevo@xs4all.nl.
8672
8673 * data/glr.c (yydestroyStackItem): New function.
8674 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
8675 debugging information. Problem reported by Joel E. Denny.
8676
8677 2005-08-25 Akim Demaille <akim@epita.fr>
8678
8679 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
8680
8681 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
8682
8683 * data/glr.c (yyrecoverSyntaxError, yyreturn):
8684 Don't invoke destructor on unresolved entries.
8685 * tests/glr-regression.at
8686 (User destructor for unresolved GLR semantic value): New test case.
8687 Problem reported by Joel E. Denny in:
8688 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
8689
8690 2005-08-21 Paul Eggert <eggert@cs.ucla.edu>
8691
8692 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
8693 Add strnlen.c.
8694 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
8695 lib-prefix.m4, po.m4.
8696
8697 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
8698 in yydestruct diagnostic, since it might not be an error.
8699 Problem reported by Joel Denny near end of
8700 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
8701 * data/lalr1.cc (yyerturn): Likewise.
8702 * data/yacc.c (yyreturn): Likewise.
8703 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
8704
8705 * src/files.c: Remove obsolete FIXME comment.
8706
8707 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
8708 with the other templates, and to fix bogus run-on messages such
8709 as the one reported at the end of
8710 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
8711 All callers changed to avoid the newline.
8712 (yyprocessOneStack): Output two lines rather than one, to accommodate
8713 the above change. This changes the debug output format slightly.
8714
8715 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
8716 reported by Joel E. Denny in
8717 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
8718 (trivial change).
8719 * tests/glr-regression.at (Duplicate representation of merged trees):
8720 New test, from Joel E. Denny in:
8721 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
8722 * THANKS: Add Joel E. Denny.
8723
8724 * configure.ac (AC_INIT): Bump to 2.0c.
8725
8726 2005-07-24 Paul Eggert <eggert@cs.ucla.edu>
8727
8728 * NEWS: Version 2.0b.
8729
8730 * Makefile.am (SUBDIRS): Put examples before tests, so that
8731 "make check" doesn't finish with "All 1 tests passed".
8732
8733 * tests/regression.at (Token definitions): Don't rely on
8734 AT_PARSER_CHECK for data that contains backslashes. It currently
8735 uses 'echo', and 'echo' isn't portable if its argument contains
8736 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
8737 that the byte '\0xff' is not printable in the C locale; it is,
8738 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
8739 not printable, so use '\0x81' to test.
8740
8741 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
8742 version of GCC, since the macro is used with non-GCC compilers.
8743
8744 Fix core dump reported by Pablo De Napoli in
8745 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
8746 * tests/regression.at (Invalid inputs with {}): New test.
8747 * src/parse-gram.y (token_name): Translate type before using
8748 it as an index.
8749
8750 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
8751 the user's name space. All uses changed to __attribute__
8752 ((__unused__)).
8753 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
8754 Add __attribute__ ((__noreturn__)).
8755
8756 * etc/clcommit: Remove. We weren't using it, and it failed
8757 "make maintainer-distcheck".
8758 * Makefile.maint: Merge from coreutils.
8759 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
8760 (syntax-check-rules): Change list of rules as described below.
8761 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
8762 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
8763 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
8764 (sc_trailing_space): New rules.
8765 (sc_xalloc_h_in_src): Remove.
8766 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
8767 (sc_space_tab, sc_error_exit_success, sc_changelog):
8768 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
8769 (makefile-check, po-check, author_mark_check):
8770 (makefile_path_separator_check, copyright-check):
8771 Use grep -n, to make it easier to find violations.
8772 Use CVS_LIST and CVS_LIST_EXCEPT.
8773 (header_regexp, h_re): Remove.
8774 (dd_c): New macro.
8775 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
8776 (my-distcheck): Use more-modern GCC flags.
8777 (signatures, %.asc): Remove.
8778 (rel-files, announcement): Remove signatures.
8779 Restore old updating code, even though we don't use it, so
8780 that we're the same as coreutils.
8781 (alpha, beta, major): Depend on news-date-check.
8782 Make the upload commands.
8783
8784 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
8785 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
8786 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
8787 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
8788 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
8789 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
8790 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
8791 * tests/sets.at: Likewise.
8792
8793 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
8794 we comment out the Autoconf version number.
8795 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
8796 it's error-prone and "make maintainer-distcheck" rejects it.
8797
8798 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
8799 Indent calls to "error" to pacify "make maintainer-distcheck",
8800 when the calls are not intended to be translated.
8801 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
8802
8803 * src/Makefile.am (DEFS): Use +=, to pacify
8804 "make maintainer-distcheck".
8805 (bison_SOURCES): Add scan-skel.h.
8806 (sc_tight_scope): New rule, from coreutils.
8807
8808 * src/files.c (src_extension, header_extension):
8809 Now static, not extern.
8810 * src/getargs.c (short_options): Likewise.
8811 * src/muscle_tab.c (muscle_table): Likewise.
8812 * src/parse-gram.y (current_class, current_type, current_prec):
8813 Likewise.
8814 * src/reader.c (grammar_end, previous_rule_end): Likewise.
8815 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
8816 * src/main.c (main): Cast bindtextdomain and textdomain calls to
8817 void, to avoid warning when NLS is disabled.
8818 * src/output.c: Include scan-skel.h.
8819 (scan_skel): Remove decl, since scan-skel.h does this.
8820 (output_skeleton):
8821 Indent calls to "error" to pacify "make maintainer-distcheck".
8822 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
8823 * src/reader.h (gram_end, gram_lineno): New decls to pacify
8824 "make maintainer-distcheck".
8825 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
8826 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
8827 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
8828 (skel_lex_destroy, scan_skel): Move these decls to...
8829 * src/scan-skel.h: New file.
8830 * src/uniqstr.c (uniqstr_assert):
8831 Indent calls to "error" to pacify "make maintainer-distcheck".
8832
8833 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
8834 not @VAR@.
8835
8836 * tests/torture.at: Revamp to avoid misuse of atoi that
8837 "make maintainer-distcheck" complained about.
8838
8839 * examples/extexi (message): Don't print a message more than once,
8840 and omit line-number decoration that makes Emacs compile think
8841 that informative messages are worth worrying about.
8842
8843 2005-07-22 Paul Eggert <eggert@cs.ucla.edu>
8844
8845 * configure.ac: Update version number.
8846
8847 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
8848 accidentally.
8849 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
8850 autogenerated by the maintainer.
8851 * examples/calc++/.cvsignore: Add *.yy.
8852
8853 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
8854 * lib/bitset_stats.c (bitset_stats_init): Likewise.
8855 * lib/bitsetv.c (bitsetv_alloc): Likewise.
8856
8857 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
8858
8859 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
8860 from maintainer-distcheck about casting the argument of 'free'.
8861
8862 * NEWS: Mention recent yytname changes.
8863 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
8864
8865 * bootstrap: For translations that have not yet been upgraded to
8866 the new runtime-po domain, prime the pump by extracting the
8867 relevant strings from the obsolete translations. This code can be
8868 removed once the bison-runtime domain has been translated by each
8869 team.
8870
8871 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
8872 now that token names are already quoted.
8873
8874 Fix problem reported by Anthony Heading.
8875 * data/glr.c (YYTOKEN_TABLE): New macro.
8876 (yytname): Define if YYTOKEN_TABLE.
8877 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
8878 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
8879 (YYERROR_VERBOSE): Define the same way the other skeletons do.
8880 * src/output.c (prepare_symbols): Output token_table_flag.
8881
8882 2005-07-21 Paul Eggert <eggert@cs.ucla.edu>
8883
8884 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
8885 again if the first call fails.
8886
8887 * data/glr.c (yytnamerr): New function.
8888 (yyreportSyntaxError): Use it to dequote most string literals.
8889 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
8890 with other skeletons. All uses changed.
8891 (yytnameerr_): New function.
8892 (yyreport_syntax_error): Use it to dequote most string literals.
8893 * data/yacc.c (yytnamerr): New function.
8894 (yyerrlab): Use it to decode most string literals.
8895 * doc/bison.texinfo (Decl Summary, Calling Convention):
8896 Clarify quoting convention of yytname.
8897 * src/output.c (prepare_symbols): Quote all names. This undoes
8898 the 2005-04-17 change, which is now accomplished (mostly) via
8899 changes in the parsers as described above.
8900 * tests/regression.at (Token definitions, Web2c Actions):
8901 Undo most 2005-04-17 change here, too.
8902
8903 2005-07-20 Paul Eggert <eggert@cs.ucla.edu>
8904
8905 Fix more problems reported by twlevo@xs4all.nl.
8906 * tests/cxx-type.at: Don't pipe output of ./types through sed to
8907 remove trailing spaces. This loses the exit status of ./types,
8908 and isn't needed since ./types shouldn't be emitting trailing
8909 spaces.
8910 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
8911 as the stack isn't valid in that case.
8912
8913 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
8914 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
8915 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
8916 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
8917 is used.
8918 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
8919 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
8920 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
8921 Likewise.
8922
8923 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
8924 overly-picky compilers that reject 'char *foo = "bar";'.
8925
8926 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
8927 to FILE * parameter, not to stderr. This fixes a typo introduced
8928 in the 2005-07-12 change.
8929
8930 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
8931 warnings from GCC 4.
8932
8933 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
8934 (yyglrShiftDefer, yysplitStack):
8935 Remove unused parameters b4_pure_formals. All uses changed.
8936 (yyglrShift): Remove unused parameters b4_user_formals.
8937 All uses changed.
8938 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
8939
8940 2005-07-18 Paul Eggert <eggert@cs.ucla.edu>
8941
8942 Destructor cleanups and regularization among the three skeletons.
8943 * NEWS: Document the behavior changes.
8944 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
8945 stack before failing, as the cleanup code will do it for us now.
8946 * data/lalr1.cc (yyerrlab): Likewise.
8947 * data/glr.c (yyparse): Pop everything off the stack before
8948 freeing it, so that destructors get called properly.
8949 * data/lalr1.cc (yyreturn): Likewise.
8950 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
8951 This is more consistent.
8952 * doc/bison.texinfo (Destructor Decl): Mention more reasons
8953 why destructors might be called. 1.875 -> 2.1.
8954 (Destructor Decl, Decl Summary, Table of Symbols):
8955 Some English-language cleanups for %destructor.
8956 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
8957 Add output line for destructor of start symbol.
8958 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
8959 because of that same extra output line.
8960
8961 * NEWS: Document minor wording changes in diagnostics of
8962 Bison-generated parsers.
8963 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
8964 Remove unused formals. All uses changed.
8965 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
8966 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
8967 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
8968 Rename yyoverflowab to yyexhaustedlab.
8969 When memory exhaustion occurs during syntax-error reporting,
8970 report it separately rather than in a single diagnostic; this
8971 eases translation.
8972 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
8973 (Memory Exhausted): Renamed from Parser Stack Overflow.
8974 Revamp wording slightly to prefer "memory exhaustion".
8975 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
8976
8977 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
8978
8979 Add i18n support to the GLR skeleton. Partially fix the C++
8980 skeleton; a C++ expert needs to finish this. Remove debugging
8981 msgids; there's little point to having them translated, since they
8982 can be understood only by someone who can read the
8983 (English-language) source code.
8984
8985 Generate runtime-po/bison-runtime.pot automatically, so that we
8986 don't have to worry about garbage getting in that file. We'll
8987 make sure after the next official release that old msgids don't
8988 get lost. See
8989 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
8990
8991 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
8992 Now auto-generated.
8993 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
8994 Fix typos in explanations of the runtime file.
8995 * bootstrap: Change gettext keyword from YYI18N to YY_.
8996 Use standard Makefile.in.in in runtime-po, since we'll arrange
8997 for backward-compatible bison-runtime.po files in a different way.
8998 * data/glr.c (YY_): New macro, from yacc.c.
8999 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
9000 Translate messages intended for users.
9001 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
9002 the wording in the other skeletons. We don't know that the memory
9003 is virtual.
9004 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
9005 Use same method that yacc.c uses.
9006 Don't translate debugging messages.
9007 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
9008 it doesn't work (yet), and requires C++ expertise to fix.
9009 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
9010 Move defn to a more logical place, to be consistent with other
9011 skeletons.
9012 Don't translate debugging messages.
9013 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
9014 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
9015 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
9016 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
9017
9018 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
9019 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
9020 void, not int.
9021 * tests/glr-regression.at (Badly Collapsed GLR States):
9022 Likewise.
9023 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
9024 yylex should return 0 at EOF rather than aborting.
9025
9026 Improve tests for stack overflow in GLR parser.
9027 Problem reported by twlevo@xs4all.nl.
9028 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
9029 All uses removed.
9030 (yyStackOverflow): Just longjmp, but with value 2 so that caller
9031 can handle the problem.
9032 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
9033 (yyparse): New local variable yyresult to record the result.
9034 Use result of setjmp to set it, rather than storing itinto
9035 struct.
9036 (yyDone): Remove label.
9037 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
9038 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
9039 if YYABORT is used).
9040 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
9041 yyparse status; put status > 1 into diagnostic.
9042 Check that status==2 works.
9043 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
9044 Use exit status 3 for failure to open (which shouldn't happen).
9045
9046 2005-07-17 Paul Eggert <eggert@cs.ucla.edu>
9047
9048 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
9049 1 on syntax error; just let yyparse do its thing.
9050 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
9051 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
9052 (Exploding the Stack Size with Alloca):
9053 (Exploding the Stack Size with Malloc):
9054 Expect exit status 2, not 1, since the parser is supposed to blow
9055 its stack. Problem reported by twlevo@xs4all.nl.
9056
9057 * data/glr.c (yyparse): Don't assume that the initial calls
9058 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
9059 Print a stack-overflow message and fail instead.
9060 Initialize the line-number information before creating the stack,
9061 so that the stack-overflow message can report line zero safely.
9062
9063 2005-07-14 Paul Eggert <eggert@cs.ucla.edu>
9064
9065 Fix problems reported by twlevo@xs4all.nl.
9066 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
9067 (yyuserMerge): Provide a default case if b4_mergers is empty.
9068 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
9069 * tests/glr-regression.at
9070 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
9071 Add casts to pacify C++ compilers.
9072 * tests/glr-regression.at (Improper merging of GLR delayed action
9073 sets): Declare yylex before using it.
9074 * tests/Makefile.am (maintainer-check-g++): Fix a stray
9075 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
9076 test for valgrind; valgrind is independent of g++.
9077 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
9078 for compatibility with POSIX 1003.1-2001 (if running coreutils).
9079 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
9080 Use a destructor, so that we can expand the stack. Change
9081 YYSTYPE to char * so that we can free it. Cast result of malloc.
9082
9083 2005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
9084
9085 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
9086 a valgrind failure. Problem reported by twlevo@xs4all.nl.
9087
9088 2005-07-13 Paul Eggert <eggert@cs.ucla.edu>
9089
9090 * PACKAGING: New file, suggested by Bruno Haible and taken from
9091 similar wording in gettext's PACKAGING file.
9092 * NEWS: Mention PACKAGING.
9093 * Makefile.am (EXTRA_DIST): Add PACKAGING.
9094
9095 2005-07-12 Paul Eggert <eggert@cs.ucla.edu>
9096
9097 * NEWS: Document recent i18n improvements.
9098 * bootstrap: Get runtime translations into runtime-po.
9099 Create runtime-po files automatically, if possible.
9100 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
9101 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
9102 does not infringe on the user's name space.
9103 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
9104 * doc/bison.texinfo (Internationalization): Revamp the English
9105 and Texinfo syntax a bit, to try to make it clearer.
9106 (Bison Options, Option Cross Key): Mention --print-localedir.
9107 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
9108 YYENABLE_NLS. Quote a bit more.
9109 * runtime-po/.cvsignore: New file.
9110 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
9111 * runtime-po/Rules-quot: Remove; now created by bootstrap.
9112 * runtime-po/quot.sed: Likewise.
9113 * runtime-po/boldquot.sed: Likewise.
9114 * runtime-po/en@quot.header: Likewise.
9115 * runtime-po/en@boldquot.header: Likewise.
9116 * runtime-po/insert-header.sin: Likewise.
9117 * runtime-po/remove-potcdate.sin: Likewise.
9118 * runtime-po/Makevars: Likewise.
9119 * runtime-po/LINGUAS: Likewise.
9120 * runtime-po/de.po: Likewise; we will rely on the translation project
9121 to maintain this, so "bootstrap" should get it.
9122 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
9123 its value.
9124 * src/main.c (main): Bind the bison-runtime domain, too.
9125
9126 2005-07-12 Bruno Haible <bruno@clisp.org>
9127
9128 * data/yacc.c: Include <libintl.h> when NLS is enabled.
9129 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
9130 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
9131 * runtime-po: New directory.
9132 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
9133 $(DOMAIN).pot-update rule, so that old messages are never dropped.
9134 * runtime-po/Rules-quot: New file, copied from po/.
9135 * runtime-po/quot.sed: Likewise.
9136 * runtime-po/boldquot.sed: Likewise.
9137 * runtime-po/en@quot.header: Likewise.
9138 * runtime-po/en@boldquot.header: Likewise.
9139 * runtime-po/insert-header.sin: Likewise.
9140 * runtime-po/remove-potcdate.sin: Likewise.
9141 * runtime-po/Makevars: New file.
9142 * runtime-po/POTFILES.in: New file.
9143 * runtime-po/LINGUAS: New file.
9144 * runtime-po/bison-runtime.pot: New file.
9145 * runtime-po/de.po: New file.
9146 * m4/bison.m4: New file.
9147 * Makefile.am (SUBDIRS): Add runtime-po.
9148 (aclocaldir, aclocal_DATA): New variables.
9149 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
9150 Define aclocaldir.
9151 * src/getargs.c (usage): Document --print-localedir option.
9152 (PRINT_LOCALEDIR_OPTION): New enum item.
9153 (long_options): Add --print-localedir option.
9154 (getargs): Handle --print-localedir option.
9155 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
9156 (Internationalization): New section.
9157
9158 2005-07-12 Akim Demaille <akim@epita.fr>
9159
9160 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
9161 for consistency with the rest of the code.
9162 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
9163 Add separators.
9164
9165 2005-07-12 Akim Demaille <akim@epita.fr>
9166
9167 * src/parse-gram.y: Use %printer instead of YYPRINT.
9168
9169 2005-07-12 Akim Demaille <akim@epita.fr>
9170
9171 * src/symtab.h, src/symtab.c (symbol_print): New.
9172 * src/symlist.h, src/symlist.c (symbol_list_print): New.
9173 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
9174
9175 2005-07-12 Akim Demaille <akim@epita.fr>
9176
9177 * data/glr.c (b4_syncline): Fix (swap) the definitions of
9178 b4_at_dollar and b4_dollar_dollar.
9179
9180 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
9181
9182 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
9183 and Pennello's paper.
9184
9185 2005-07-09 Paul Eggert <eggert@cs.ucla.edu>
9186
9187 * data/yacc.c (yyparse): Undo previous patch. Instead,
9188 set yylsp[0] and yyvsp[0] only if the initial action
9189 sets yylloc and yylval, respectively.
9190
9191 * data/yacc.c (yyparse): In the initial action, set
9192 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
9193 This avoids the use of undefined variables if the initial
9194 action does not set yylloc and/or yylval.
9195
9196 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
9197
9198 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
9199 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
9200 Remove from CVS. These files are automatically generated.
9201 * examples/extexi: Clarify that this file is now part of Bison,
9202 not GNU M4, and that it works with any POSIX-compatible Awk.
9203 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
9204 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
9205 so that we also get calc++-parser.yy. Geneate it.
9206 Use $(AWK), not gawk, since any conforming Awk will do.
9207 Put comment before action, since older 'make' can't handle comment
9208 in action.
9209 $(BUILT_SOURCES): List all built sources, not just some of them.
9210 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
9211 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
9212 $($(calc_sources_generated)): Remove unnecessary test for existence
9213 of target. (This had a shell syntax error anyway; a stray "x".)
9214 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
9215 calc++-parser.yy.
9216 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
9217
9218 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
9219 implied by the other modules.
9220
9221 2005-07-06 Akim Demaille <akim@epita.fr>
9222
9223 Bind examples/calc++ to the package.
9224 * examples/calc++/Makefile: Remove, replaced by...
9225 * examples/calc++/Makefile.am: ... this new file.
9226 * examples/calc++/test: Remove input.
9227 * examples/calc++/compile: Remove.
9228 * examples/Makefile.am: New.
9229 * configure.ac, Makefile.am: Adjust.
9230 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
9231
9232 2005-07-05 Paul Eggert <eggert@cs.ucla.edu>
9233
9234 * data/glr.c (yyFail): Drastically simplify; since the format argument
9235 never had any % directives, we can simply pass it to yyerror.
9236 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
9237 be modified later, as that is the usual style in glr.c.
9238 Problems reported by Paul Hilfinger.
9239
9240 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
9241 and size overflow errors.
9242 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
9243 in case the user prolog sets feature-test macros like _GNU_SOURCE.
9244 (YYSIZEMAX): New macro.
9245 (yystpcpy): New function, taken from yacc.c.
9246 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
9247 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
9248 so that we don't have to maintain their signatures.
9249 (yyFail): Check for buffer overflow, by using vsnprintf rather
9250 than vsprintf. Allocate a bigger buffer if possible.
9251 Report an error if buffer allocation fails.
9252 (yyStackOverflow): New function.
9253 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
9254 the initialization was successful. It might fail if storage was
9255 exhausted.
9256 (yyexpandGLRStack): Add more checks for storage allocation failure.
9257 Use yyStackOverflow to report failures.
9258 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
9259 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
9260 Don't assume stack number fits in int.
9261 (yysplitStack): Check for storage allocation failure.
9262 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
9263 can print diagnostics on storage allocation failure. All callers
9264 changed.
9265 (yyresolveValue): Use yybool for boolean.
9266 (yyreportSyntaxError): Check for size-calculation overflow.
9267 This code is taken from yacc.c.
9268 (yyparse): Check for storage allocation errors when allocating
9269 the initial stack.
9270
9271 2005-07-05 Akim Demaille <akim@epita.fr>
9272
9273 Extract calc++ from the documentation.
9274 * doc/bison.texinfo (Calc++): Add the extraction marks.
9275 * examples/extexi: New, from the aborted GNU Programming 2E.
9276 Separate the different paragraph of a file with empty lines.
9277 * examples/Makefile: Use it to extract the whole calc++ example.
9278
9279 2005-06-24 Akim Demaille <akim@epita.fr>
9280
9281 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
9282 class typedefs.
9283
9284 2005-06-22 Akim Demaille <akim@epita.fr>
9285
9286 * doc/bison.texinfo (C++ Language Interface): First stab.
9287 (C++ Parsers): Remove.
9288
9289 2005-06-22 Akim Demaille <akim@epita.fr>
9290
9291 * data/lalr1.cc (yylex_): Honor %lex-param.
9292
9293 2005-06-22 Akim Demaille <akim@epita.fr>
9294
9295 Start a set of simple examples.
9296 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
9297 * examples/calc++/calc++-driver.hh,
9298 * examples/calc++/calc++-parser.yy,
9299 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
9300 * examples/calc++/compile, examples/calc++/test: New.
9301
9302 2005-06-09 Paul Eggert <eggert@cs.ucla.edu>
9303
9304 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
9305 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
9306 which stems from the 2005-05-27 patch.
9307
9308 2005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
9309
9310 * data/glr.c: Modify treatment of unused parameters to permit use
9311 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
9312
9313 2005-05-30 Paul Eggert <eggert@cs.ucla.edu>
9314
9315 Fix infringement on user name space reported by Janos Zoltan Szabo.
9316 * data/yacc.c (yyparse): strlen -> yystrlen.
9317
9318 2005-05-30 Akim Demaille <akim@epita.fr>
9319
9320 * data/lalr1.cc (_): New.
9321 Translate the various messages.
9322
9323 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
9324
9325 Fix infringement on user name space reported by Bruno Haible.
9326 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
9327 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
9328 the user's name space.
9329 (alloca): Include <stdlib.h> to get it, if it's not built in.
9330 (YYMALLOC, YYFREE): Define only if needed.
9331 (malloc, free): Declare, but only if needed, as this infringes on
9332 the user name space.
9333
9334 2005-05-25 Paul Eggert <eggert@cs.ucla.edu>
9335
9336 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
9337 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
9338 with %d format.
9339 * lib/ebitset.c (min, max): Undef before defining.
9340 * lib/vbitset.c (min, max): Likewise.
9341 * lib/subpipe.c (create_subpipe): Save local variables in case
9342 vfork clobbers them.
9343
9344 2005-05-24 Bruno Haible <bruno@clisp.org>
9345
9346 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
9347 error message syntax used by gcc-4.0.
9348
9349 2005-05-23 Paul Eggert <eggert@cs.ucla.edu>
9350
9351 * README: Mention m4 1.4.3. Remove obsolete advice about
9352 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
9353
9354 * bootstrap: Remove workaround for problem I encountered with
9355 gettext 0.14.1; it seems to be fixed now.
9356
9357 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
9358
9359 * NEWS: Version 2.0a.
9360
9361 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
9362 the previous change.
9363
9364 Various maintainer cleanups.
9365 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
9366 conftest*, for benefit of CVS commands run at the same time as
9367 "configure". Add build-aux, since "bootstrap" now creates it and
9368 its subfiles.
9369 * Makefile.cfg (move_if_change): Remove.
9370 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
9371 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
9372 (po_repo, do-po-update, po-update, wget_files, get-targets):
9373 (config.guess-url_prefix, config.sub-url_prefix):
9374 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
9375 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
9376 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
9377 Remove.
9378 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
9379 this is now the recommended name.
9380 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
9381 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
9382 ylwrap. These files now go into build-aux.
9383 * config/move-if-change: Remove.
9384 * config/prev-version.txt: Bump from 1.75 to 2.0.
9385
9386 * bootstrap: Add stdio-safer, unistd-safer modules.
9387 Remove m4/glibc2.m4 (introduced by latest gnulib, but
9388 we don't need it).
9389 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
9390 fopen-safer.c, stdio-safer.h, unistd-safer.h.
9391 * lib/subpipe.c: Include "unistd-safer.h".
9392 (create_subpipe): Make sure all the newly-created
9393 file descriptors are > 2, so that diagnostics don't
9394 get sent down them (which might cause Bison to hang, in theory).
9395 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
9396 * src/files.c (xfopen): Use fopen_safer, not fopen.
9397
9398 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
9399 yesterday's yacc.c fix.
9400
9401 2005-05-21 Paul Eggert <eggert@cs.ucla.edu>
9402
9403 * data/glr.c, data/lalr1.cc: Update copyright date.
9404
9405 Fix a destructor bug reported by Wolfgang Spraul in
9406 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
9407 * data/yacc.c (yyabortlab): Don't call destructor, and
9408 don't set yychar to EMPTY.
9409 (yyoverflowlab): Don't call destructor.
9410 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
9411 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
9412 since we no longer output the message "discarding lookahead token
9413 end of input ()".
9414
9415 2005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
9416
9417 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
9418 fix a small glitch in debugging output.
9419 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
9420 after YY_SYMBOL_PRINT where needed.
9421
9422 (struct yyGLRState): Add some comments.
9423 (struct yySemanticOption): Add some comments.
9424 (union yyGLRStackItem): Add comment.
9425
9426 (yymergeOptionSets): Correct this to properly perform the union,
9427 avoiding infinite reported by Michael Rosien.
9428 Update comment.
9429
9430 * tests/glr-regression.at: Add test for GLR merging error reported
9431 by M. Rosien.
9432
9433 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
9434
9435 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
9436 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
9437 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
9438 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
9439 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
9440 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
9441 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
9442 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
9443 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
9444 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
9445 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
9446 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
9447 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
9448 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
9449 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
9450 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
9451 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
9452 src/derives.h, src/files.c, src/files.h, src/getargs.c,
9453 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
9454 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
9455 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
9456 src/output.h, src/parse-gram.c, src/parse-gram.h,
9457 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
9458 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
9459 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
9460 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
9461 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
9462 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
9463 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
9464 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
9465 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
9466 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
9467 tests/reduce.at, tests/regression.at, tests/sets.at,
9468 tests/synclines.at, tests/testsuite.at, tests/torture.at:
9469 Update FSF postal mail address.
9470
9471 2005-05-11 Paul Eggert <eggert@cs.ucla.edu>
9472
9473 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
9474 Problem reported by Ralf Menzel.
9475
9476 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
9477
9478 * tests/actions.at: Test that stack overflow invokes destructors.
9479 From Marcus Holland-Moritz.
9480 * data/yacc.c (yyerrlab): Move the code that destroys the stack
9481 from here....
9482 (yyreturn): to here. That way, destructors are called properly
9483 even if the stack overflows, or the user calls YYACCEPT or
9484 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
9485 (yyoverflowlab): Destroy the lookahead.
9486
9487 2005-04-24 Paul Eggert <eggert@cs.ucla.edu>
9488
9489 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
9490
9491 2005-04-17 Paul Eggert <eggert@cs.ucla.edu>
9492
9493 * NEWS: Bison-generated C parsers no longer quote literal strings
9494 associated with tokens.
9495 * src/output.c (prepare_symbols): Don't escape strings,
9496 since users don't want to see C escapes.
9497 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
9498 in diagnostics.
9499 * tests/input.at (Torturing the Scanner): Likewise.
9500 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
9501
9502 2005-04-16 Paul Eggert <eggert@cs.ucla.edu>
9503
9504 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
9505 the data size is known to be too small and we can't increase it.
9506 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
9507
9508 2005-04-15 Paul Eggert <eggert@cs.ucla.edu>
9509
9510 * src/parse-gram.y: Include quotearg.h.
9511 (string_as_id): Quote $1 before using it as a key, since the
9512 lexer no longer quotes it for us.
9513 (string_content): Don't strip quotes, since lexer no longer
9514 quotes it for us.
9515 * src/scan-gram.l: Include quotearg.h.
9516 ("\""): Omit quote.
9517 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
9518 a key, since the rest of the lexer doesn't quote it.
9519 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
9520 * tests/regression.at (Token definitions): Check for backslashes
9521 in token strings.
9522
9523 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
9524 (YYSIZE_T): Define to unsigned long int when using an older compiler.
9525 (yyparse): Revamp code to generate long syntax error message, to
9526 make it easier to translate, and to avoid problems with arithmetic
9527 overflow. Change "virtual memory" to "memory" in diagnostic, since
9528 we don't know whether the memory is virtual.
9529
9530 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
9531
9532 * NEWS: Bison-generated C parsers now use the _ macro to
9533 translate strings.
9534 * data/yacc.c (_) [!defined _]: New macro.
9535 All English strings wrapped inside this macro.
9536 * doc/bison.texinfo (Bison Parser): Document _.
9537 * po/POTFILES.in: Include src/parse-gram.c, since it now
9538 includes translateable strings that parse-gram.y doesn't.
9539
9540 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
9541
9542 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
9543 reverting the 2004-10-11 change to this function.
9544 (symbol_check_alias_consistency): Don't call symbol_type_set
9545 if the type name is already correct.
9546 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
9547
9548 2005-03-25 Paul Eggert <eggert@cs.ucla.edu>
9549
9550 * tests/regression.at (Token definitions): Don't use a token named
9551 c, as that generates a "#define c ..." that runs afoul of buggy
9552 stdlib.h that uses the identifier c as a member of struct
9553 drand48_data. Problem reported by Horst Wente.
9554
9555 2005-03-21 Paul Eggert <eggert@cs.ucla.edu>
9556
9557 * bootstrap: Change translation URL from
9558 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
9559 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
9560 redirection glitches. Problem reported by twlevo@xs4all.nl.
9561
9562 2005-03-20 Paul Eggert <eggert@cs.ucla.edu>
9563
9564 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
9565 after operands; POSIX says this isn't portable for the c99 command.
9566
9567 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
9568
9569 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
9570 immediately if a data overrun has occurred; this may help us track
9571 down what may be a spurious failure on MacOS.
9572
9573 2005-03-17 Paul Eggert <eggert@cs.ucla.edu>
9574
9575 Respond to problems reported by twlevo@xs4all.nl.
9576
9577 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
9578
9579 * src/vcg.h: Comment fix.
9580 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
9581 (G_CMAX): Change to -1 instead of INT_MAX.
9582
9583 * data/yacc.c (yyparse): Omit spaces before #line.
9584
9585 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
9586
9587 * src/tables.c (state_number_to_vector_number): Put it inside an
9588 "#if 0", since it's not currently used. Problem reported by
9589 Roland McGrath.
9590
9591 2005-03-06 Paul Eggert <eggert@cs.ucla.edu>
9592
9593 * src/output.c (escaped_output): Renamed from
9594 escaped_file_name_output, since we now use it for symbol tags as
9595 well. All uses changed.
9596 (symbol_destructors_output, symbol_printers_output):
9597 Escape symbol tags too.
9598 Problem reported by Matyas Forstner in
9599 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
9600
9601 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
9602 not needed.
9603 * src/output.c (user_actions_output, token_definitions_output,
9604 symbol_destructors_output, symbol_printers_output): Likewise.
9605 * src/reader.c (prologue_augment): Likewise.
9606 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
9607
9608 * src/vcg.c (output_edge): Don't quote linestyle arg.
9609 Problem reported by twlevo@xs4all.nl.
9610
9611 2005-02-28 Paul Eggert <eggert@cs.ucla.edu>
9612
9613 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
9614 example, reported by Derek M Jones. Also, make the example even
9615 more outrageous, to better illustrate how bad the problem is.
9616
9617 2005-02-24 Paul Eggert <eggert@cs.ucla.edu>
9618
9619 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
9620 putsym. Typo reported by Sebastian Piping.
9621
9622 2005-02-23 Paul Eggert <eggert@cs.ucla.edu>
9623
9624 * doc/bison.texinfo (Language and Grammar): some -> same
9625 (Epilogue): int he -> in the
9626 Typos reported by Sebastian Piping via Justin Pence.
9627
9628 2005-02-07 Paul Eggert <eggert@cs.ucla.edu>
9629
9630 * tests/glr-regression.at (Improper handling of embedded actions
9631 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
9632 embedded actions and $-N in GLR parsers", work around an Autoconf bug
9633 with dollar signs in test names.
9634 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
9635 for a similar reason.
9636
9637 2005-01-28 Paul Eggert <eggert@cs.ucla.edu>
9638
9639 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
9640 wants to redefine G_VIEW.
9641
9642 2005-01-27 Paul Eggert <eggert@cs.ucla.edu>
9643
9644 * src/vcg.c (get_view_str): Remove case for normal_view.
9645 Problem reported by twlevo@xs4all.nl.
9646
9647 2005-01-24 Paul Eggert <eggert@cs.ucla.edu>
9648
9649 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
9650 Problem reported by twlevo@xs4all.nl.
9651
9652 * doc/bison.texinfo: Change @dircategory from "GNU programming
9653 tools" to "Software development". Requested by Richard Stallman
9654 via Karl Berry.
9655
9656 2005-01-23 Paul Eggert <eggert@cs.ucla.edu>
9657
9658 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
9659 Problem reported by twlevo@xs4all.nl.
9660
9661 2005-01-21 Paul Eggert <eggert@cs.ucla.edu>
9662
9663 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
9664 keyword; it's not needed with modern compilers, and it doesn't
9665 affect correctness with older compilers. Suggested by
9666 twlevo@xs4all.nl.
9667
9668 2005-01-17 Paul Eggert <eggert@cs.ucla.edu>
9669
9670 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
9671 gcc -Wswitch-default.
9672 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
9673 * data/yacc.c (yyparse): Likewise.
9674
9675 2005-01-12 Paul Eggert <eggert@cs.ucla.edu>
9676
9677 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
9678 already. Let config.h define any nonstandard values.
9679
9680 2005-01-10 Paul Eggert <eggert@cs.ucla.edu>
9681
9682 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
9683 for the benefit of slower hosts. Problem reported by
9684 Nelson H. F. Beebe.
9685
9686 2005-01-07 Paul Eggert <eggert@cs.ucla.edu>
9687
9688 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
9689 being defined and not used.
9690 * data/lalr1.cc (yyparse): Likewise.
9691 Use "if (false)" rather than "if (0)".
9692
9693 2005-01-05 Paul Eggert <eggert@cs.ucla.edu>
9694
9695 * TODO: Mention that we should allow NUL bytes in tokens.
9696
9697 2005-01-02 Paul Eggert <eggert@cs.ucla.edu>
9698
9699 * src/scan-skel.l (<<EOF>>): Don't close standard output.
9700 Problem reported by Hans Aberg.
9701
9702 2005-01-01 Paul Eggert <eggert@cs.ucla.edu>
9703
9704 * src/getargs.c (version): Happy new year; update overall
9705 program copyright date from 2004 to 2005.
9706
9707 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
9708 Problem reported by Hans Aberg.
9709 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
9710 (Output file names.): Add a test for the case when standard output
9711 is closed.
9712
9713 2004-12-26 Paul Eggert <eggert@cs.ucla.edu>
9714
9715 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
9716 to fix an oversight in the Bison 2.0 manual.
9717
9718 2004-12-25 Paul Eggert <eggert@cs.ucla.edu>
9719
9720 * NEWS: Version 2.0. Reformat the existing news items since
9721 1.875, so that related items are grouped together.
9722 * configure.ac (AC_INIT): Bump version to 2.0.
9723 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
9724
9725 * tests/torture.at (Exploding the Stack Size with Alloca): Set
9726 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
9727 otherwise, we're not testing alloca. Unfortunately there's no
9728 simple way to consult HAVE_ALLOCA here.
9729
9730 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
9731 for yymsg, too.
9732
9733 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
9734 hand. This avoids a warning about comparing int to size_t when
9735 GCC warnings are enabled.
9736
9737 2004-12-22 Paul Eggert <eggert@cs.ucla.edu>
9738
9739 * NEWS: Bison-generated parsers no longer default to using the
9740 alloca function (when available) to extend the parser stack, due
9741 to widespread problems in unchecked stack-overflow detection.
9742 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
9743 responsibility to set it to a positive value. This lets the user
9744 specify a value that is not a preprocessor constant.
9745 * data/yacc.c (YYMAXDEPTH): Likewise.
9746 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
9747 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
9748 to be a compile-time constant. However, explain the constraints on it.
9749 Also, explain the constraints on YYINITDEPTH.
9750 (Table of Symbols): Explain that alloca is no longer the default.
9751 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
9752 to 1.
9753
9754 * doc/bison.texinfo (Location Default Action): Mention that n must
9755 be zero when k is zero. Suggested by Frank Heckenbach.
9756
9757 2004-12-22 Akim Demaille <akim@epita.fr>
9758
9759 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
9760 (parser::state_type, parser::semantic_type, parser::location_type):
9761 Private, not public.
9762 (parser::parse): Return ints, not bool.
9763 Returning a bool introduces a problem: 0 corresponds to false, and
9764 it seems weird to return false on success. Returning true changes
9765 the conventions for yyparse.
9766 Alternatively we could return void and send an exception.
9767 There is no clear consensus (yet?).
9768 (state_stack, semantic_stack, location_stack): Rename as...
9769 (state_stack_type, semantic_stack_type, location_stack_type): these.
9770 Private, not public.
9771 * tests/c++.at: New.
9772 * tests/testsuite.at, tests/Makefile.am: Adjust.
9773
9774 2004-12-21 Akim Demaille <akim@epita.fr>
9775
9776 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
9777
9778 2004-12-21 Akim Demaille <akim@epita.fr>
9779
9780 Don't impose std::string for filenames.
9781
9782 * data/lalr1.cc (b4_filename_type): New.
9783 (position::filename): Use it.
9784 (parser.hh): Move the inclusion of stack.hh and location.hh below
9785 the user code, so that needed headers for the filename type can be
9786 included first.
9787 Forward declare them before the user code.
9788 * tests/Makefile.am (check-local, installcheck-local): Pass
9789 TESTSUITEFLAGS to the TESTSUITE.
9790
9791 2004-12-20 Akim Demaille <akim@epita.fr>
9792
9793 Use more STL like names: my_class instead of MyClass.
9794
9795 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
9796 (SemanticStack, SemanticType, StateStack, StateType)
9797 (TokenNumberType, Stack, Slice, Traits, Parser::location)
9798 (Parser::value): Rename as...
9799 (location_stack, location_type, rhs_number_type, semantic_stack)
9800 (semantic_type, state_stack, state_type, token_number_type, stack)
9801 (slice, traits, parser::yylloc, parser::yylval): these.
9802
9803 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
9804
9805 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
9806
9807 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
9808 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
9809
9810 2004-12-17 Paul Eggert <eggert@cs.ucla.edu>
9811
9812 Remove uses of 'short int' and 'unsigned short int'. This raises
9813 some arbitrary limits. It uses more memory but nowadays that's
9814 not much of an issue.
9815
9816 This change does not affect the generated parsers; that's a different
9817 task, as some users will want to conserve memory there.
9818
9819 Ideally we should use size_t to represent all object counts, and
9820 something like ptrdiff_t to represent signed differences of object
9821 counts; but that will require more code-cleanup than I have the
9822 time to do right now.
9823
9824 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
9825 Use size_t, not int or short int, to count objects.
9826 * src/closure.c (nritemset, closure): Likewise.
9827 * src/closure.h (nritemset, closure): Likewise.
9828 * src/nullable.c (nullable_compute): Likewise.
9829 * src/print.c (print_core): Likewise.
9830 * src/print_graph.c (print_core): Likewise.
9831 * src/state.c (state_compare, state_hash): Likewise.
9832 * src/state.h (struct state): Likewise.
9833 * src/tables.c (default_goto, goto_actions): Likewise.
9834
9835 * src/gram.h (rule_number, rule): Use int, not short int.
9836 * src/output.c (prepare_rules): Likewise.
9837 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
9838 errs, reductions): Likewise.
9839 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
9840 Likewise.
9841 * src/tables.c (vector_number, tally, action_number,
9842 ACTION_NUMBER_MINIMUM): Likewise.
9843 * src/output.c (muscle_insert_short_int_table): Remove.
9844
9845 2004-12-17 Akim Demaille <akim@epita.fr>
9846
9847 * data/lalr1.cc: Extensive Doxygenation.
9848 (error_): Rename as...
9849 (error): this, since it is visible to the user.
9850 Adjust callers.
9851 (Parser::message): Now an automatic variable from...
9852 (Parser::yyreport_syntax_error_): here.
9853 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
9854 Parser::error.
9855 * tests/input.at: Escape $.
9856
9857 2004-12-16 Paul Eggert <eggert@cs.ucla.edu>
9858
9859 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
9860 Parenthesize rhs to avoid obscure problems with mistakes like
9861 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
9862 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
9863 b4_rhs_location): Likewise.
9864 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
9865 b4_rhs_location): Likewise.
9866
9867 2004-12-16 Akim Demaille <akim@epita.fr>
9868
9869 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
9870 yacc.c: be sure to stay within yycheck_.
9871 * tests/actions.at: Re-enable C++ tests.
9872
9873 2004-12-16 Akim Demaille <akim@epita.fr>
9874
9875 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
9876 real.
9877
9878 2004-12-16 Akim Demaille <akim@epita.fr>
9879
9880 Use #define to handle the %name-prefix.
9881
9882 * data/glr.c, data/yacc.c: Comment changes.
9883 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
9884 so that one can refer to yylex in the parser file, and have it
9885 renamed, as is the case with other skeletons.
9886
9887 2004-12-16 Akim Demaille <akim@epita.fr>
9888
9889 Move lalr1.cc internals into yy*.
9890
9891 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
9892 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
9893 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
9894 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
9895 (empty_, final_, terror_, errcode_, ntokens_)
9896 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
9897 (looka_, ilooka_, error_range_, nerrs_):
9898 Rename as...
9899 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
9900 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
9901 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
9902 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
9903 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
9904 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
9905 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
9906 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
9907 these.
9908
9909 2004-12-15 Paul Eggert <eggert@cs.ucla.edu>
9910
9911 Fix some problems reported by twlevo at xs4all.
9912 * src/symtab.c (symbol_new): Report an error if the input grammar
9913 contains too many symbols. This is better than calling abort() later.
9914 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
9915 (struct node, struct graph):
9916 Rename member expand to stretch. All uses changed.
9917 (struct graph): Remove member layoutalgorithm. All uses removed.
9918 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
9919 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
9920 All uses changed.
9921 (N_STRETCH): Rename from N_EXPAND. All uses changed.
9922
9923 2004-12-15 Akim Demaille <akim@epita.fr>
9924
9925 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
9926 Add more Doxygen comments.
9927 (symprint_, stack_print_, reduce_print_, destruct_, pop)
9928 (report_syntax_error_, translate_): Rename as...
9929 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
9930 (yypop_, yyreport_syntax_error_, yytranslate_): this.
9931
9932 2004-12-15 Akim Demaille <akim@epita.fr>
9933
9934 * data/lalr1.cc (lex_): Rename as...
9935 (yylex_): this.
9936 Move the trace here.
9937 Take the %name-prefix into account.
9938 Reported by Alexandre Duret-Lutz.
9939
9940 2004-12-15 Akim Demaille <akim@epita.fr>
9941
9942 Simplify the C++ parser constructor.
9943
9944 * data/lalr1.cc (debug_): Rename as...
9945 (yydebug_): so that the parser's internals are always in the yy*
9946 pseudo namespace.
9947 Adjust uses.
9948 (b4_parse_param_decl): Remove the leading comma as it is now only
9949 called as unique argument list.
9950 (Parser::Parser): Remove the constructor accepting a location and
9951 an initial debugging level.
9952 Remove from the other ctor the argument for the debugging level.
9953 (debug_level_type, debug_level, set_debug_level): New.
9954
9955 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
9956 constructor calls.
9957
9958 2004-12-15 Akim Demaille <akim@epita.fr>
9959
9960 Remove b4_root related material: failure experiment
9961 (which goal was to allow to derive from a class).
9962
9963 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
9964 definitions and uses.
9965
9966 2004-12-14 Paul Eggert <eggert@cs.ucla.edu>
9967
9968 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
9969 not 2, since it's not portable to subtract 1 from the start of an
9970 array. The new item 0 is never set or used. All uses changed.
9971
9972 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
9973 the default definition of YYLLOC_DEFAULT. Problem reported
9974 by Frank Heckenbach.
9975
9976 2004-12-12 Paul Eggert <eggert@cs.ucla.edu>
9977
9978 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
9979 the normal case and one for the error case. Just use the
9980 first one uniformly. Problem reported by Frank Heckenbach.
9981 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
9982 use exactly the same macro in both places.
9983 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
9984 so that the normal-case YYRHSLOC works for the error case too.
9985 All uses changed.
9986 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
9987 (YYLLOC_DEFAULT): Use the same macro as glr.c.
9988 * doc/bison.texinfo (Location Default Action): Don't claim that
9989 we have an array of locations. Use the same macro for both glr
9990 and lalr parsers. Mention YYRHSLOC. Mention what happens when
9991 the index is 0.
9992
9993 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
9994
9995 * HACKING: Update email addresses to send announcements to.
9996
9997 * configure.ac (AC_INIT): Bump version to 1.875f.
9998
9999 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
10000
10001 * NEWS: Version 1.875e.
10002 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
10003
10004 * src/scan-skel.l: Include "complain.h", for "fatal".
10005
10006 * src/relation.h (relation_print, relation_digraph):
10007 Relation sizes are of type relation_node, not size_t (this is
10008 merely a doc fix, since the two types are equivalent).
10009 (relation_transpose): Relation sizes are of type relation_node,
10010 not int.
10011 * src/relation.c: Likewise.
10012 (top, infinity): Now of type relation_node, not int.
10013 (traverse, relation_transpose): Use relation_node, not int.
10014
10015 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
10016 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
10017 (yyparse): Remove unused local introduced in 2004-10-25 patch.
10018
10019 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
10020 specifying whether the test should be skipped. Use it tp
10021 specify that the [%defines %skeleton "lalr1.cc"] tests currently
10022 fail on some hosts, and should be skipped.
10023
10024 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
10025
10026 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
10027 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
10028 unless otherwise specified below.
10029
10030 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
10031 to allocate kernel_base, kernel_items, kernel_size, since
10032 they needn't be initialized to 0.
10033 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
10034 * src/closure.c (new_closure): Likewise, for itemset.
10035 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
10036 * src/lalr.c (set_goto_map): Likewise, for temp_map.
10037 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
10038 (build_relations): Likewise for edge, states1, includes.
10039 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
10040 * src/reader.c (packgram): Likewise, for ritem, rules.
10041 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
10042 * src/relation.c (relation_digraph): Likewise for VERTICES.
10043 (relation_transpose): Likewise for new_R, end_R.
10044 * src/symtab.c (symbols_token_translations_init): Likewise for
10045 token_translations.
10046 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
10047 (token_actions): Likewise for yydefact, actrow, conflrow,
10048 conflict_list.
10049 (save_column): Likewise for froms[symno], tos[symno].
10050 (goto_actions): Likewise for state_count.
10051 (pack_table): Likewise for base, pos, check.
10052 (tables_generate): Likewise for width.
10053
10054 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
10055 for initial core. Just have a separate core, so we needn't worry
10056 about whether kernel_size and kernel_base are initialized.
10057
10058 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
10059 kernel_size, kernel_items): Remove unnecessary initialization.
10060 * src/conflicts.c (conflicts): Likewise.
10061 * src/derives.c (derives): Likewise.
10062 * src/muscle_tablc (muscle_insert): Likewise.
10063 * src/relation.c (relation_digraph): Likewise.
10064 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
10065 conflrow, conflict_table, conflict_list, table, check):
10066 Likewise.
10067
10068 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
10069 This is because all callers pass unsigned int.
10070 * src/closure.h (new_closure): Likewise.
10071
10072 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
10073 (build_relations): Initialize includes[i] in all cases.
10074 * src/reader.c (packgram): Always initialize rules[ruleno].prec
10075 and rules[ruleno].precsym. Initialize members in order.
10076 * src/relation.c (relation_transpose): Always initialize new_R[i]
10077 and end_R[i].
10078 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
10079
10080 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
10081 conflict_list[0] was always 0, but now it isn't initialized.
10082
10083 * src/table.c (table_grow): When conflict_table grew, the grown
10084 area wasn't cleared. Fix this.
10085
10086 * lib/.cvsignore: Add strdup.c, strdup.h.
10087 * m4/.cvsignore: Add strdup.m4.
10088
10089 2004-12-07 Paul Eggert <eggert@cs.ucla.edu>
10090
10091 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
10092 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
10093 GOTO_NUMBER_MAXIMUM, since we occasionally compute
10094 ngotos + 1 without checking for overflow.
10095 (build_relations): Use END_NODE, not -1, to denote end of edges.
10096 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
10097 build_relations): Use goto_number, not int, for goto numbers.
10098 * src/tables.c (save_column, default_goto): Likewise.
10099
10100 2004-11-23 Akim Demaille <akim@epita.fr>
10101
10102 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
10103 of #defining from yystype.
10104 Don't typedef yystype, C++ does not need it.
10105 This lets it possible to forward declare it as union.
10106
10107 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
10108
10109 * bootstrap (gnulib_modules): Add extensions.
10110 Problem reported by Jim Meyering.
10111
10112 2004-11-22 Paul Eggert <eggert@cs.ucla.edu>
10113
10114 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
10115 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
10116 src/system.h, src/tables.c: XFREE -> free, to accommodate
10117 recent change to gnulib xalloc.h.
10118 Problem reported by Jim Meyering.
10119
10120 2004-11-17 Akim Demaille <akim@epita.fr>
10121
10122 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
10123
10124 2004-11-17 Akim Demaille <akim@epita.fr>,
10125 Alexandre Duret-Lutz <adl@gnu.org>
10126
10127 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
10128 changes.
10129 (YYCDEBUG): Adjust.
10130 Use it instead of cdebug_.
10131 (Parser::debug_stream, Parser::set_debug_stream): New.
10132 (Parser::symprint_): Define cdebug_ for temporary backward
10133 compatibility.
10134 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
10135 debug_stream ().
10136
10137 2004-11-17 Akim Demaille <akim@epita.fr>
10138
10139 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
10140 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
10141 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
10142 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
10143
10144 2004-10-27 Paul Eggert <eggert@cs.ucla.edu>
10145
10146 * data/glr.c (yyloc_default): Remove; not used.
10147 Problem reported by Frank Heckenbach.
10148
10149 2004-10-25 Akim Demaille <akim@epita.fr>
10150
10151 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
10152 Introduce another definition to address simple location arrays.
10153 (yyGLRStack): New member: yyerror_range.
10154 (yyrecoverSyntaxError, yyparse): Update it.
10155 (yyrecoverSyntaxError): Use it when shifting the error token to
10156 have an accurate range, equivalent to the one computed by both
10157 yacc.c and lalr1.cc.
10158 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
10159 that column numbers start at column 0, as per GNU Coding
10160 Standards, the others tests, and the doc.
10161 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
10162 Adjust to the above change (first column is 0).
10163 And adjust the location of the "<error>", now covering the whole
10164 line.
10165
10166 2004-10-22 Akim Demaille <akim@epita.fr>
10167 and Paul Eggert <eggert@cs.ucla.edu>
10168
10169 Remove some arbitrary limits on goto numbers and relations.
10170 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
10171 initial values, since they're never used.
10172 (set_goto_map): ngotos is now unsigned, so test for overflow
10173 by seeing whether it wraps around to zero.
10174 * src/lalr.h (goto_number): Now size_t, not short int.
10175 (GOTO_NUMBER_MAXIMUM): Remove.
10176 * src/relation.c (relation_print, traverse, relation_transpose):
10177 Check for END_NODE rather than looking at sign.
10178 * src/relation.h (END_NODE): New macro.
10179 (relation_node): Now size_t, not short int.
10180
10181 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
10182
10183 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
10184 keyword, not an identifier. Problem reported by Baron Schwartz in
10185 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
10186
10187 2004-10-11 Akim Demaille <akim@epita.fr>
10188
10189 * src/symtab.c (symbol_check_alias_consistency): Also check
10190 type names, destructors, and printers.
10191 Reported by Alexandre Duret-Lutz.
10192 Recode the handling of associativity and precedence in terms
10193 of symbol_precedence_set.
10194 Accept no redeclaration at all, not even equal to the previous
10195 value.
10196 (redeclaration): New.
10197 Use it to factor redeclaration complaints.
10198 (symbol_make_alias): Don't set the type of the alias, let
10199 symbol_check_alias_consistency do it as for other features.
10200 * src/symtab.h (symbol): Add new member prec_location, and
10201 type_location.
10202 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
10203 * tests/input.at (Incompatible Aliases): New.
10204
10205 2004-10-09 Paul Eggert <eggert@cs.ucla.edu>
10206
10207 .cvsignore fixes to accommodate gnulib changes,
10208 and the practice of naming build directories "_build".
10209 * .cvsignore: Add "_*". Sort.
10210 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
10211 * m4/.cvsignore: Add "*_gl.m4".
10212
10213 2004-10-06 Akim Demaille <akim@epita.fr>
10214
10215 * src/parse-gram.y (add_param): Fix the truncation of trailing
10216 spaces.
10217
10218 2004-10-05 Akim Demaille <akim@epita.fr>
10219
10220 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
10221 whether the reducion was empty or not. This leaves room to
10222 improve the use of YYLLOC_DEFAULT in such a case.
10223 lalr1.cc is still experimental, so changing this is acceptable.
10224 And finally, there are probably not many users who changed the
10225 handling of locations in GLR, so changing is admissible too.
10226
10227 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
10228 empty reduction, set @$ to an empty location ending the previously
10229 stacked symbol.
10230 Adjust uses to make sure the code is triggered on empty
10231 reductions.
10232 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
10233 expected output: empty reductions have empty locations.
10234
10235 2004-09-29 Akim Demaille <akim@epita.fr>
10236
10237 * data/lalr1.cc: Move towards a more standard C++ coding style
10238 for templates: Class < T > -> Class<T>.
10239
10240 2004-09-29 Akim Demaille <akim@epita.fr>
10241
10242 * data/lalr1.cc: Reinstall the former ctor, for sake of
10243 compatibility, but warn it will be removed.
10244 Move towards a more standard C++ coding style (i.e., type *var ->
10245 type* var).
10246
10247 2004-09-27 Paul Eggert <eggert@cs.ucla.edu>
10248
10249 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
10250 since it's less likely to work if NULs are involved in the future.
10251
10252 2004-09-27 Akim Demaille <akim@epita.fr>
10253
10254 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
10255
10256 2004-09-27 Akim Demaille <akim@epita.fr>
10257
10258 * data/lalr1.cc (b4_parse_param_decl_1): New.
10259 (b4_parse_param_decl): Use it to have different names between attribute
10260 and argument names.
10261 (b4_cc_constructor_call): Likewise.
10262
10263 2004-09-24 Akim Demaille <akim@epita.fr>
10264
10265 * src/parse-gram.y (add_param): Strip the leading and trailing
10266 blanks from a formal argument declaration.
10267 (YY_LOCATION_PRINT): New.
10268
10269 2004-09-24 Akim Demaille <akim@epita.fr>
10270
10271 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
10272 after the location.
10273
10274 2004-09-24 Akim Demaille <akim@epita.fr>
10275
10276 * doc/bison.texinfo (Table of Symbols): Sort.
10277
10278 2004-09-21 Akim Demaille <akim@epita.fr>
10279
10280 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
10281 the useless parentheses.
10282 Suggested by Paul Eggert.
10283
10284 2004-09-20 Akim Demaille <akim@epita.fr>
10285
10286 Let the initial-action act on the look-ahead, and use it for the
10287 "initial push" (corresponding to an hypothetical beginning-of-file).
10288 And let lalr1.cc honor %initial-action.
10289
10290 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
10291 example.
10292 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
10293 (Parser::Parser): Remove the ctor that used to initialize it.
10294 (Parser::parse): Like in the other skeletons, issue the "starting
10295 parse" message before any action.
10296 Honor %initial-action.
10297 Initialize the stacks with the lookahead.
10298 * data/yacc.c: Let $$ and @$ in %initial-action designate the
10299 look-ahead.
10300 Push them in the stacks.
10301 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
10302
10303 2004-09-20 Akim Demaille <akim@epita.fr>
10304
10305 * doc/bison.texinfo (Initial Action Decl): New.
10306
10307 2004-09-20 Akim Demaille <akim@epita.fr>
10308
10309 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
10310 clearer criterion to define it.
10311 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
10312 When reducing on an empty RHS, use the latest stacked location as
10313 location.
10314 yylloc is not always available.
10315 * data/glr.c: Likewise.
10316 Also, honor initial-actions.
10317
10318 2004-09-20 Akim Demaille <akim@epita.fr>
10319
10320 * data/yacc.c (YY_LOCATION_PRINT): New.
10321 Define when we know YYLTYPE's structure, i.e., when the default
10322 YYLLOC_DEFAULT is used.
10323 * data/c.m4 (b4_yysymprint_generate): Use it.
10324 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
10325 value of the result.
10326 (error_start_): Replace with...
10327 (error_range_): this location array.
10328 This allows to replace code relying on the implementation of
10329 locations by portable code.
10330 * data/yacc.c (yylerrsp): Replace with...
10331 (yyerror_range): this.
10332 Every time a token is popped, update yyerror_range[0], to have an
10333 accurate location for the error token.
10334 * data/glr.c (YY_LOCATION_PRINT): New.
10335 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
10336 deference a pointer.
10337 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
10338 report the location in %printers.
10339
10340 * src/scan-skel.l: Instead of abort, report error messages to ease
10341 understanding skeleton scanning failures.
10342
10343 2004-09-16 Akim Demaille <akim@epita.fr>
10344
10345 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
10346 (iterator, const_iterator): these, to be more in the C++ spirit.
10347 Also, return reverse iterators so that when displaying the stack
10348 we display its bottom first.
10349 (Parser::stack_print_, Parser::reduce_print_): Match the messages
10350 from yacc.c.
10351 We should probably use vector here though.
10352
10353 2004-09-16 Akim Demaille <akim@epita.fr>
10354
10355 Have more complete shift traces.
10356
10357 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
10358 to report Shifts instead of ad hoc YYDPRINTF invocations,
10359 including for the error token.
10360 * data/lalr1.cc (symprint_): Output the location.
10361 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
10362 output the location within the %printer.
10363 Activate GLR tests, at least to make sure they compile properly.
10364 They still don't pass though.
10365 * tests/calc.at: Adjust expect verbose output, since now "Entering
10366 state..." is on a different line than the "Shifting" message.
10367
10368 2004-09-08 Akim Demaille <akim@epita.fr>
10369
10370 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
10371 Bison directive from the Bison file to the invocation of this
10372 macro, so that these directives are passed to
10373 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
10374 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
10375 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
10376 the extra Bison directives instead of the whole series.
10377 Change the grammar so that there are recoverable errors, and
10378 unrecoverable errors. Now we can have the parser give up before
10379 consuming the whole input. As a result we now can observe that
10380 the lookahead is freed when needed.
10381 Change the parser source to parse argv[1] instead of a hard coded
10382 string.
10383 Simplify yylex, and give a value and location to EOF.
10384 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
10385 passed directives already coded in the file.
10386 Add some tests to check the location of "error".
10387 For some tests, the C++ parser is correct, and not yacc.c.
10388 For other tests, they provide different, but unsatisfying, values,
10389 so keep the C++ value so that at least one parser is "correct"
10390 according to the test suite.
10391 (Actions after errors): Remove, this is subsumed by the
10392 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
10393
10394 2004-09-06 Akim Demaille <akim@epita.fr>
10395
10396 * data/lalr1.cc: Adjust the indentation of the labels.
10397 (Parser::pop): New.
10398 Use it.
10399
10400 2004-09-06 Akim Demaille <akim@epita.fr>
10401
10402 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
10403 argument, an informative message.
10404 Call YY_SYMBOL_PRINT.
10405 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
10406 * data/lalr1.cc (destruct_): Likewise.
10407 In addition, no longer depend on b4_yysymprint_generate and
10408 b4_yydestruct_generate to generate these functions, do it "by
10409 hand".
10410
10411 2004-09-03 Akim Demaille <akim@epita.fr>
10412
10413 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
10414 invoked, yydestruct the lookahead.
10415 * tests/calc.at (Calculator $1): Update the expected lengths of
10416 traces: there is an added line for the discarded lookahead.
10417 * doc/bison.texinfo (Destructor Decl): Some rewording.
10418 Define "discarded" symbols.
10419
10420 2004-09-02 Akim Demaille <akim@epita.fr>
10421
10422 * data/lalr1.cc (translate_, destruct_): No reason to be static.
10423
10424 2004-09-02 Akim Demaille <akim@epita.fr>
10425
10426 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
10427 (YYDSYMPRINTF): Rename as...
10428 (YY_SYMBOL_PRINT): this.
10429 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
10430 two.
10431 Use it instead of direct symprint_ calls.
10432 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
10433 one.
10434
10435 2004-09-02 Akim Demaille <akim@epita.fr>
10436
10437 * data/lalr1.cc (b4_yysymprint_generate): New.
10438 (symprint_): New member function, defined when YYDEBUG.
10439 Use it consistently instead of token/nterm debugging output by
10440 hand.
10441 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
10442 %printer calls to use cdebug_ when using lalr1.cc.
10443
10444 2004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
10445
10446 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
10447 with #ifdef YYDEBUG.
10448
10449 2004-08-26 Akim Demaille <akim@epita.fr>
10450
10451 * doc/bison.texinfo (Implementing Loops): Rename as...
10452 (Implementing Gotos/Loops): this.
10453
10454 2004-08-13 Paul Eggert <eggert@cs.ucla.edu>
10455
10456 Adjust to latest gnulib.
10457 * bootstrap (gnulib_modules): Add xalloc-die.
10458 Set LC_ALL=C so that file names sort consistently.
10459 Prefer the gnulib copies of gettext.m4, glibc21.m4,
10460 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
10461 uintmax_t.m4, ulonglong.m4.
10462 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
10463 po.m4 since we are now using _gl.m4 instead.
10464
10465 2004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
10466
10467 * src/scan-action.l: Remove. Scanning of semantic actions is
10468 handled in scan-gram.l.
10469
10470 2004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
10471
10472 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
10473
10474 * src/location.h (struct): The file member is a uniqstr.
10475 (equal_boundaries): Use UNIQSTR_EQ for comparison.
10476
10477 2004-07-22 Paul Eggert <eggert@cs.ucla.edu>
10478
10479 Fix bug with non-%union parsers that have printers or destructors,
10480 which led to a Bison core dump. Reported by Peter Fales in
10481 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
10482
10483 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
10484 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
10485 not to our own type.
10486 * src/output.c (symbol_destructors_output, symbol_printers_output):
10487 Don't assume %union.
10488 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
10489 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
10490 UNION-FLAG. All callers changed.
10491 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
10492 Use type char, not unsigned int, when declaring an array of char;
10493 this lets us remove a cast.
10494 (Printers and Destructors): Add non-%union test cases.
10495
10496 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
10497
10498 * doc/bison.texinfo: Minor editorial changes, mostly to the new
10499 GLR writeups. E.g., avoid frenchspacing and the future tense,
10500 change "lookahead" to "look-ahead", and change "wrt" to "with
10501 respect to".
10502
10503 2004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10504
10505 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
10506 New sections, split off from the GLR Parsers section. Put the new
10507 Simple GLR Parser near the start of the GLR section, for clarity.
10508 Rewrite connective text.
10509
10510 2004-06-21 Frank Heckenbach <frank@g-n-u.de>
10511
10512 * doc/bison.texinfo (Simple GLR Parsers): New section.
10513
10514 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
10515
10516 * NEWS, TODO, doc/bison.texinfo:
10517 Use "look-ahead" instead of "lookahead", to be consistent.
10518 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
10519 while we're fixing "look-ahead".
10520 * src/conflicts.c (shift_set): Renamed from shiftset.
10521 (look_ahead_set): Renamed from lookaheadset.
10522 * src/print.c: Likewise.
10523 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
10524 name for "lookahead".
10525 (report_types, usage): Likewise.
10526 * src/getargs.h (report_look_ahead_tokens): Renamed from
10527 report_lookaheads.
10528 * src/lalr.c (compute_look_ahead_tokens): Renamed from
10529 compute_lookaheads.
10530 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
10531 (look_ahead_tokens_print): Renamed from lookaheads_print.
10532 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
10533 state_rule_lookaheads_print.
10534 * src/state.h: Likewise.
10535 (reductions.look_ahead_tokens): Renamed from lookaheads.
10536 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
10537 AT_DATA_LOOKAHEADS_GRAMMAR.
10538
10539 2004-06-03 Paul Eggert <eggert@cs.ucla.edu>
10540
10541 * README: Update location of patched M4 distribution.
10542
10543 2004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
10544
10545 Don't assume the C++ compiler takes the same arguments as the C compiler
10546 (trivial change).
10547 * configure.ac (O0CXXFLAGS): New var.
10548 * tests/atlocal.in (CXXFLAGS): Use it.
10549
10550 2004-05-29 Paul Eggert <eggert@cs.ucla.edu>
10551
10552 Fix some "make check" problems with C++ reported by
10553 Albert Chin-A-Young for Tru64 C++ in this thread:
10554 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
10555
10556 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
10557 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
10558 Output to a .cc file for C++, not to a .c file.
10559 * tests/calc.at (AT_CHECK_CALC): Likewise.
10560 * tests/regression.at (AT_CHECK_DANCER): Likewise.
10561 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
10562
10563 2004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
10564
10565 * tests/calc.at, tests/actions.at: Workaround for SGI
10566 C++ compiler. (trivial change)
10567
10568 2004-05-27 Paul Eggert <eggert@cs.ucla.edu>
10569
10570 Spent a few hours checking out which prerequisite versions the
10571 current sources actually require. I went all the way back to
10572 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
10573 a seemingly endless set of combinations of versions more recent
10574 than that. The bottom line is that the current sources require
10575 fairly recent versions of the build tools, and it'll be some work
10576 to change this.
10577 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
10578 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
10579 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
10580 Add comments explaining why those particular versions are
10581 currently needed.
10582
10583 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
10584 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
10585 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
10586
10587 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
10588 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
10589
10590 2004-05-26 Paul Eggert <eggert@cs.ucla.edu>
10591
10592 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
10593 0.11.5. Suggested by Bruno Haible.
10594 * bootstrap: Remove gettext version checking.
10595
10596 * doc/bison.texinfo (Decl Summary): Also mention that %union
10597 can depend on prerequisite types. Problem reported by Tim
10598 Van Holder.
10599
10600 2004-05-25 Paul Eggert <eggert@cs.ucla.edu>
10601
10602 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
10603 * README-alpha: Don't tell people not to package this.
10604
10605 * bootstrap: Don't assume $(...) works; use `...` instead.
10606 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
10607 gettext better.
10608
10609 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
10610 put into the -d output file, and mention what to do if YYSTYPE is
10611 defined as a macro.
10612
10613 2004-05-24 Paul Eggert <eggert@cs.ucla.edu>
10614
10615 Undo change made earlier today: it caused autopoint to not bring
10616 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
10617 autopoint's.
10618
10619 * bootstrap: Check that gettext version matches what's in
10620 configure.ac. Warn users to ignore robots.txt ERROR 404.
10621 * bootstrap: Undo today's earlier change (logged below).
10622 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
10623
10624 The gettext version checking is causing more trouble than it's
10625 curing; remove it. Problem reported by Paul Hilfinger.
10626
10627 * bootstrap: Issue a warning that one can expect a message
10628 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
10629 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
10630
10631 2004-05-23 Paul Eggert <eggert@cs.ucla.edu>
10632
10633 Ensure that the C++ compiler used for testing actually works on a
10634 simple test program; if not, skip the C++-related tests. Problem
10635 reported by Vin Shelton in:
10636 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
10637
10638 * m4/cxx.m4: New file.
10639 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
10640 * tests/atlocal.in (BISON_CXX_WORKS): Add.
10641 * tests/local.at (AT_COMPILE_CXX): Use it.
10642
10643 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
10644
10645 * data/glr.c (yylloc): Output this macro even if locations are not
10646 being generated, as the GLR parser needs it even in that case.
10647 Problem reported by Troy A. Johnson
10648 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
10649
10650 * configure.ac (AC_INIT): Update to 1.875e.
10651
10652 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
10653
10654 * NEWS: Version 1.875d.
10655 * configure.ac (AC_INIT): Likewise.
10656 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
10657
10658 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
10659 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
10660 lalr1.cc runs afoul of the first, and the last two are no longer
10661 supported by GCC 3.4.0.
10662 * README: Mention GNU m4 1.4 or later; mention m4 patches.
10663 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
10664
10665 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
10666
10667 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
10668 unsigned int, for compatibility with latest gnulib hash module.
10669 * src/state.c (state_hash, state_hasher): Likewise.
10670 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
10671 * src/uniqstr.c (hash_uniqstr): Likewise.
10672
10673 2004-05-03 Paul Eggert <eggert@cs.ucla.edu>
10674
10675 * NEWS: Unescaped newlines are no longer allowed in char & strings.
10676
10677 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
10678 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
10679 character and string literals.
10680 (unexpected_end): New function.
10681 (unexpected_eof): Use it.
10682 (unexpected_newline): New function.
10683 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
10684 actions.
10685
10686 * NEWS: Document %expect-rr.
10687
10688 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
10689 Fix typo by replacing $1 with $option.
10690 Remove more 'intl'-related files.
10691 Don't DEFUN AM_INTL_SUBDIR twice.
10692
10693 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
10694 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
10695 strtoul.c.
10696 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
10697 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
10698 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
10699 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
10700 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
10701 * src/.cvsignore: Add *.output.
10702
10703 * src/parse-gram.y: Put copyright notice inside %{ %} so it
10704 gets copied to the output file.
10705
10706 2004-04-28 Paul Eggert <eggert@twinsun.com>
10707
10708 Get files from the gnulib and po repositories, instead of relying
10709 on them being in our CVS. Upgrade to latest versions of gnulib
10710 and Automake.
10711
10712 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
10713 * bootstrap: Bootstrap from gnulib and po repositories.
10714 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
10715 * README-cvs: Document these changes. Remove version numbers from
10716 mentions of build tools, since they change so often. Mention Flex.
10717
10718 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
10719 (gl_USE_SYSTEM_EXTENSIONS): Add.
10720 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
10721 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
10722 does this for us.
10723 (AC_ISC_POSIX): Remove; we no longer support this
10724 ancient OS, as it gets in the way of latest Autoconf & gnulib.
10725 (AC_HEADER_STDC): Remove: we now assume C89 or better.
10726 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
10727 Do not check for C89 headers, except for locale.h which is used
10728 by the Yacc library and must port to K&R hosts.
10729 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
10730 Do not check for C89 functions, except for setlocale which is
10731 used by the Yacc library.
10732 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
10733 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
10734 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
10735 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
10736 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
10737 AM_GNU_GETTEXT): Remove; now done by:
10738 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
10739 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
10740 for us.
10741
10742 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
10743 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
10744 Define to empty, as gnulib.mk will do the rest for us.
10745 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
10746 for us.
10747 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
10748 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
10749
10750 * src/files.c: Include gnulib's xstrndup.h.
10751
10752 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
10753 (REALLOC): Use xnrealloc, for likewise.
10754 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
10755 (strnlen, memrchr): Remove decls; functions no longer used.
10756 Include <stpcpy.h>.
10757
10758 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
10759 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
10760 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
10761 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
10762 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
10763 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
10764 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
10765 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
10766 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
10767 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
10768 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
10769 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
10770 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
10771 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
10772 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
10773 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
10774 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
10775 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
10776 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
10777 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
10778 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
10779 Remove, as these files are now generated automatically
10780 by bootstrap or automake.
10781
10782 * po/ChangeLog: Remove: all but one entry was a duplicate
10783 of this file, and I moved that 2000-11-02 entry here.
10784
10785 * config/.cvsignore: Add Makefile, depcomp, install-sh.
10786 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
10787 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
10788 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
10789 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
10790 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
10791 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
10792 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
10793 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
10794 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
10795 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
10796 xstrndup.h.
10797 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
10798 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
10799 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
10800 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
10801 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
10802 * src/.cvsignore: Remove *_.c.
10803
10804
10805 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
10806 support it. (The latest stable gzip doesn't.)
10807
10808 2004-04-27 Paul Eggert <eggert@twinsun.com>
10809
10810 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
10811 case, as stos_ is now used by destructors due to the 2004-02-09
10812 change.
10813
10814 Remove more K&R C support.
10815 * lib/libiberty.y (PARAMS): Remove. All uses removed.
10816 * lib/subpipe.c (errno): Remove decl.
10817 Include <stdlib.h> unconditionally.
10818 (EXIT_FAILURE): Remove macro.
10819 * src/complain.c (vfprintf, strerror): Remove.
10820 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
10821 unconditionally.
10822 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
10823 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
10824 (strchr, strspn, memchr): Remove decls.
10825 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
10826 unconditionally. Do not declare perror.
10827 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
10828 unconditionally.
10829
10830 * src/complain.c (_): Remove useless defn, as system.h defines this.
10831
10832 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
10833 with latest obstack.h.
10834 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
10835 to procedure types, as obstack.h now does that for us.
10836 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
10837
10838 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
10839 so that this include file can stand alone.
10840 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
10841 does this now. Include subpipe.h first after config.h, to
10842 test whether it can stand alone.
10843
10844 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
10845 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
10846 unused declaration.
10847
10848 * tests/synclines.at (%union synch line): Put a dummy member in
10849 the union, because empty unions aren't allowed in C. Caught
10850 by GCC 3.4.0.
10851
10852 2004-04-13 Jim Meyering <jim@meyering.net>
10853
10854 * src/conflicts.c (conflicts_print): Correct format string typo:
10855 use `%%' to produce literal `%'. (trivial change)
10856
10857 2004-03-30 Paul Eggert <eggert@twinsun.com>
10858
10859 * src/getargs.c (version): Update copyright year to 2004.
10860
10861 * data/c.m4 (b4_int_type): Use 'short int' rather than
10862 'short', and similarly for 'long', 'unsigned', etc.
10863 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
10864 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
10865 yy_yypstack, yydumpstack): Likewise.
10866 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
10867 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
10868 Likewise.
10869 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
10870 yy_stack_print, yyparse): Likewise.
10871 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
10872 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
10873 * lib/bitset.c (bitset_print): Likewise.
10874 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
10875 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
10876 * lib/bitsetv.c (bitsetv_dump): Likewise.
10877 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
10878 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
10879 Likewise.
10880 * src/LR0.c (allocate_itemsets): Likewise.
10881 * src/gram.h (rule_number, rule): Likewise.
10882 * src/lalr.h (goto_number): Likewise.
10883 * src/nullable.c (nullable_compute): Likewise.
10884 * src/output.c (prepare_rules): Likewise.
10885 * src/relation.c (relation_print, relation_digraph): Likewise.
10886 * src/relation.h (relation_node): Likewise.
10887 * src/state.h (state_number, transitions, errs, reductions,
10888 struct state): Likewise.
10889 * src/symtab.h (symbol_number, struct symbol): Likewise.
10890 * src/tables.c (vector_number, tally, action_number,
10891 default_goto, goto_actions): Likewise.
10892 * tests/existing.at (GNU Cim Grammar): Likewise.
10893 * tests/regression.at (Web2c Actions): Likewise.
10894
10895 * src/output.c (muscle_insert_short_int_table): Renamed from
10896 muscle_insert_short_table. All uses changed.
10897
10898 2004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10899
10900 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
10901 (declaration): Replace expected_conflicts with expected_sr_conflicts.
10902 Add %expect-rr rule.
10903
10904 * src/scan-gram.l: Recognize %expect-rr.
10905
10906 * src/conflicts.h (expected_sr_conflicts): Rename from
10907 expected_conflicts.
10908 (expected_rr_conflicts): Declare.
10909
10910 * src/conflicts.c (expected_sr_conflicts): Rename from
10911 expected_conflicts.
10912 (expected_rr_conflicts): Define.
10913 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
10914 for GLR parsers.
10915 Use expected_sr_conflicts in place of expected_conflicts.
10916 Warn if expected_rr_conflicts used in non-GLR parser.
10917
10918 * doc/bison.texinfo: Add documentation for %expect-rr.
10919
10920 2004-03-08 Paul Eggert <eggert@gnu.org>
10921
10922 Add support for hex token numbers. Suggested by Odd Arild Olsen in
10923 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
10924
10925 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
10926 in lalr1.cc.
10927 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
10928 * src/scan-gram.l (scan_integer): New function.
10929 ({int}): Use it.
10930 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
10931 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
10932 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
10933 Say "long int", not "long", for uniformity with GNU style.
10934
10935 2004-02-25 Paul Eggert <eggert@twinsun.com>
10936
10937 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
10938 compilers. This fixes a problem with Intel's C++ compiler being
10939 chatty, reported by Guido Trentalancia in
10940 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
10941
10942 2004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
10943
10944 Support %destructor and merge error locations in lalr1.cc.
10945
10946 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
10947 (Parser::stos_): Define unconditionally.
10948 (Parser::destruct_): New method. Generate its body with
10949 b4_yydestruct_generate.
10950 (Parser::error_start_): New attribute.
10951 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
10952 token which are discarded.
10953 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
10954 error_start_ when erroneous token are discarded.
10955 (Parser::parse) <yyerrlab1>: Compute the location of the error
10956 token so that it covers all the discarded tokens.
10957 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
10958 it can be called with `%skeleton "lalr1.cc"', and do that.
10959
10960 2004-02-02 Paul Eggert <eggert@twinsun.com>
10961
10962 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
10963 $(top_srcdir)/lib and ../lib. This fixes a bug reported
10964 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
10965 There's no need to mention top_builddir since Automake does that
10966 for us.
10967 (INCLUDES): Remove, as Automake says it's obsolescent.
10968 Contents migrated into AM_CPPFLAGS as described above.
10969 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
10970
10971 2004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10972
10973 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
10974 (yyreportSyntaxError): Handle case where lookahead token is
10975 YYEMPTY.
10976
10977 2004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10978
10979 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
10980 resulting parsers are compilable with C++.
10981
10982 2003-12-23 Paul Eggert <eggert@twinsun.com>
10983
10984 * config/depcomp, config/install-sh: Sync with Automake 1.8.
10985 * src/output.c (output_skeleton): Rename local var.
10986 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
10987 Bison tokens, as this runs afoul of the 2003-10-07 change that
10988 disallowed NUL bytes in character constants or string literals.
10989
10990 * tests/local.at: Require Autoconf 2.59's Autotest.
10991 * tests/testsuite.at: Don't include local.at, since we now assume
10992 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
10993 including it.
10994 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
10995 multiple inclusion warnings.
10996
10997 2003-12-02 Akim Demaille <akim@epita.fr>
10998
10999 * doc/bison.texinfo (How Can I Reset the Parser): More about start
11000 conditions.
11001 From Bruno Haible.
11002
11003 2003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
11004
11005 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
11006
11007 2003-10-07 Paul Eggert <eggert@twinsun.com>
11008
11009 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
11010 if testsuite doesn't exist.
11011
11012 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
11013 literals, unfortunately.
11014 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
11015 Complain about NUL bytes in character constants or string literals.
11016
11017 2003-10-05 Paul Eggert <eggert@twinsun.com>
11018
11019 * NEWS: Don't document %no-default-prec, as it's still
11020 too experimental.
11021 * doc/bison.texinfo: Document %no-default-prec only if
11022 the defaultprec flag is set. Normally it's not.
11023
11024 2003-10-04 Paul Eggert <eggert@twinsun.com>
11025
11026 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
11027 non-modifiable lvalue, instead of a modifiable one.
11028 * doc/bison.texinfo (Actions): Document that $$ can
11029 be assigned to. Do not claim that $$ and $N are
11030 array element references: user code should not rely on this.
11031
11032 2003-10-01 Paul Eggert <eggert@twinsun.com>
11033
11034 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
11035 (grammar_declaration): Use it.
11036 * src/scan-gram.l: New token %no-default-prec.
11037 * tests/conflicts.at: Revamp tests to use %no-default-prec.
11038 * NEWS, doc/bison.texinfo: Document the above.
11039
11040 2003-10-01 Akim Demaille <akim@epita.fr>
11041
11042 VCG no longer supports long_straight_phase.
11043
11044 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
11045 * src/print_graph.c (print_graph): Adjust.
11046
11047 2003-09-30 Frank Heckenbach <frank@g-n-u.de>
11048 and Paul Eggert <eggert@twinsun.com>
11049
11050 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
11051 Table of Symbols): Document %default-prec.
11052 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
11053 (grammar_declaration): Set default_prec on %default-prec.
11054 * src/scan-gram.l (%default-prec): New token.
11055 * src/reader.h (default_prec): New flag.
11056 * src/reader.c: Likewise.
11057 (packgram): Handle it.
11058 * tests/conflicts.at (%default-prec without %prec,
11059 %default-prec with %prec, %default-prec 1): New tests.
11060
11061 2003-09-30 Paul Eggert <eggert@twinsun.com>
11062
11063 * tests/testsuite.at: Include local.at, not input.at, fixing
11064 a typo in the 2003-08-25 patch.
11065
11066 2003-08-27 Akim Demaille <akim@epita.fr>
11067
11068 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
11069 GCC warnings.
11070
11071 2003-08-26 Akim Demaille <akim@epita.fr>
11072
11073 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
11074 "<\#" to avoid magic from Gnus when posting parts of this script.
11075
11076 2003-08-26 Akim Demaille <akim@epita.fr>
11077
11078 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
11079 (Parser::parse): here.
11080 Adjust: nerrs and errstatus is now replaced by...
11081 (Parser::nerrs_, Parser::errstatus_): New.
11082
11083 2003-08-25 Akim Demaille <akim@epita.fr>
11084
11085 * config/announce-gen, Makefile.cfg: New.
11086 * Makefile.am: Adjust.
11087 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
11088 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
11089
11090 2003-08-25 Akim Demaille <akim@epita.fr>
11091
11092 When reducing initial empty rules, Bison parser read an initial
11093 location that is not defined. This results in garbage, and that
11094 affects Bison's own parser. Therefore we need (i) to extend Bison
11095 to support a means to initialize this location, and (ii) to use
11096 this CVS Bison to fix CVS Bison's parser.
11097
11098 * src/reader.h, reader.c (epilogue_augment): Remove, replace
11099 with...
11100 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
11101 * src/parse-gram.y: Adjust.
11102 (%initial-action): New.
11103 (%error-verbose): Since we require CVS Bison, there is no reason
11104 not to use it.
11105 * src/scan-gram.l: Adjust.
11106 * src/Makefile.am (YACC): New, to make sure we use our own parser.
11107 * data/yacc.c (yyparse): Use b4_initial_action.
11108
11109 2003-08-25 Akim Demaille <akim@epita.fr>
11110
11111 * doc/bison.texinfo: Don't promote stdout for error messages.
11112
11113 2003-08-25 Akim Demaille <akim@epita.fr>
11114
11115 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
11116 From Alexandre Duret-Lutz.
11117
11118 2003-08-25 Akim Demaille <akim@epita.fr>
11119
11120 Version 1.875c.
11121
11122 2003-08-25 Akim Demaille <akim@epita.fr>
11123
11124 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
11125 Use them.
11126
11127 2003-08-25 Akim Demaille <akim@epita.fr>
11128
11129 * data/lalr1.cc (Parser::reduce_print_): New.
11130 Use it.
11131
11132 2003-08-25 Akim Demaille <akim@epita.fr>
11133
11134 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
11135 error recovery loops. This patch is based on
11136 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
11137 Also, augment the similarity between lalr1.cc and yacc.c.
11138 Note: the locations of error recovery rules are not correct yet.
11139
11140 * data/lalr1.cc: Comment changes to augment the similarity between
11141 lalr1.cc and yacc.c.
11142 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
11143 (yyerrlab1): Remove, but where it used to be (now the bottom part of
11144 yyerrlab), when hitting EOF, pop the whole stack here instead of
11145 merely falling thru the default error handling mechanism.
11146 (yyerrorlab): New label, with the old contents of YYERROR,
11147 plus the following change: pop the stack of rhs corresponding
11148 to the production that invoked YYERROR. That is how Yacc
11149 behaves (required by POSIX).
11150 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
11151 fail.
11152
11153 2003-08-25 Akim Demaille <akim@epita.fr>
11154
11155 Tune local.at so that people can "autom4te -l autotest calc.at -o
11156 calc" for instance, to extract a sub test suite.
11157
11158 * tests/testsuite.at: Move the initialization, Autotest version
11159 requirement, and AT_TESTED invocation into...
11160 * tests/local.at: here.
11161 * tests/testsuite.at: Include it for compatibility with Autoconf
11162 2.57.
11163 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
11164 be ignore.
11165
11166 2003-08-04 Paul Eggert <eggert@twinsun.com>
11167
11168 Rework code slightly to avoid gcc -Wtraditional warnings.
11169 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
11170 The returned value is now stored in *YY0. All callers changed.
11171 * src/output.c (merge_output): Adjust to the above change.
11172
11173 2003-07-26 Paul Eggert <eggert@twinsun.com>
11174
11175 * data/glr.c (YYASSERT): New macro.
11176 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
11177 yyresolveStates, yyprocessOneStack):
11178 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
11179 Derived from a suggestion by Frank Heckenbach.
11180
11181 2003-07-25 Paul Eggert <eggert@twinsun.com>
11182
11183 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
11184 for portability to K&R C (after ansi2knr, presumably). See
11185 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
11186 by Frank Heckenbach, though I have omitted the structure-initialization
11187 part of his glr-knr.diff patch since I recall that the Portable
11188 C Compiler didn't require that change.
11189
11190 Let the user specify how to allocate and free memory.
11191 Derived from a suggestion by Frank Heckenbach in
11192 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
11193 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
11194 All uses of free, malloc, realloc changed to use these macros,
11195 and unnecessary casts removed.
11196 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
11197
11198 2003-07-06 Matthias Mann <MatthiasMann@gmx.de>
11199
11200 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
11201 use s.empty() rather than s == "" to test for empty string; see
11202 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
11203 (trivial change)
11204
11205 2003-06-25 Akim Demaille <akim@epita.fr>
11206
11207 * config/depcomp, config/install-sh: Update from masters.
11208
11209 2003-06-20 Paul Eggert <eggert@twinsun.com>
11210
11211 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
11212 and return properly parenthesized result.
11213 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
11214 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
11215 Remove unnecessary parentheses from uses.
11216 * doc/bison.texinfo (Location Default Action): Describe the
11217 conventions for parentheses.
11218
11219 2003-06-19 Paul Eggert <eggert@twinsun.com>
11220
11221 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
11222 yyreportTree): Do not assume that size_t is the same width as int,
11223 when printing sizes. Print sizes using an unsigned format.
11224 Problem reported by Frank Heckenbach in
11225 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
11226
11227 Port to Forte Developer 7 C compiler.
11228 * data/glr.c (struct YYLTYPE): If locations are not being used,
11229 declare a single dummy member, as empty structs do not conform
11230 to the C standard.
11231 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
11232 the Forte Developer 7 C compiler complains that end-of-loop
11233 code is not reached.
11234
11235 2003-06-17 Paul Eggert <eggert@twinsun.com>
11236
11237 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
11238 avoid warnings from picky compilers about redefinition of PARAMS.
11239
11240 2003-06-17 Paul Eggert <eggert@twinsun.com>
11241
11242 Version 1.875b.
11243
11244 * NEWS: Document 1.875b.
11245
11246 * lib/bbitset.h: Do not include config.h; that's the includer's job.
11247 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
11248 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
11249 Don't use 'index' in comments, as it's a builtin fn on some hosts.
11250 * lib/bitset_stats.c: Include gettext.h unconditionally, as
11251 per recent gettext manual's suggestion.
11252 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
11253 Use prototypes, not old-style definitions.
11254 * lib/lbitset.c (lbitset_unused_clear): Likewise.
11255 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
11256 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
11257 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
11258 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
11259 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
11260 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
11261 vbitset_or_and_cmp, vbitset_copy): Likewise.
11262
11263 * lib/libiberty.h: Do not include config.h; that's the includer's job.
11264 Do not include <stdlib.h>.
11265 (PARAMS): Define unconditionally for C89.
11266 (ATTRIBUTE_NORETURN): Remove.
11267 (ATTRIBUTE_UNUSED): Define unconditionally.
11268
11269 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
11270 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
11271 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
11272 * lib/vbitset.c, lib/vbitset.h: New files.
11273 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
11274 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
11275 from libbitset.
11276
11277 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
11278 `How Can I Reset @code{yyparse}', since texinfo does not allow
11279 arbitrary @ in node names.
11280
11281 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
11282 shouldn't be needed according to the gettext 0.12.1 documentation
11283 but which seem to be needed anyway: codeset.m4 glibc21.m4
11284 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
11285 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
11286 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
11287
11288 * lib/.cvsignore: Add stdbool.h.
11289 * m4/.cvsignore: Add nls.m4, po.m4.
11290
11291 Upgrade to CVS gnulib.
11292 * stdbool_.h: File renamed from stdbool.h.in.
11293 * configure.ac (AM_STDBOOL_H): Invoke this instead of
11294 AC_HEADER_STDBOOL.
11295 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
11296 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
11297 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
11298 (MOSTLYCLEANFILES): New var.
11299 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
11300 (stdbool.h): New rule.
11301 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
11302 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
11303 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
11304 m4/quote.m4: Upgrade to today's gnulib.
11305
11306 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
11307 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
11308 the tests right now.
11309 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
11310 yyerror are declared before use; C99 requires this.
11311
11312 2003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11313
11314 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
11315 first.
11316 (yyrecoverSyntaxError): Correct the logic for setting and testing
11317 yyerrState.
11318 Correct comment on handling EOF.
11319 Allow states with only a default reduction, rather than failing
11320 (I can't quite reconstruct why these were not allowed before).
11321
11322 Fixes to avoid problem that $-N rules in GLR parsers can cause
11323 buffer overruns, corrupting state.
11324
11325 * src/output.c (prepare_rules): Output max_left_semantic_context
11326 definition.
11327 * src/reader.h (max_left_semantic_context): New variable declaration.
11328 * src/scan-gram.l (max_left_semantic_context): Define.
11329 (handle_action_dollar): Update max_left_semantic_context.
11330 * data/glr.c (YYMAXLEFT): New definition.
11331 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
11332 (yyresolveAction): Ditto.
11333
11334 Fixes to problems with location handling in GLR parsers reported by
11335 Frank Heckenbach (2003/06/05).
11336
11337 * data/glr.c (YYLTYPE): Make trivial if locations not used.
11338 (YYRHSLOC): Add parentheses, and define only if locations used.
11339 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
11340 locations not used.
11341 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
11342 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
11343
11344 * tests/cxx-type.at: Exercise location information; update tests
11345 to differentiate output with and without locations.
11346 Remove forward declarations of yylex and yyerror---caused errors
11347 because default YYLTYPE not yet defined.
11348 Change semantic actions to compute strings, rather than printing
11349 them directly (to test proper passing of semantics values). Change
11350 output to prefix notation and update test data and expected results.
11351 (yylex): Track locations.
11352 (stmtMerge): Return value rather than printing, and include arguments
11353 in value.
11354
11355 2003-06-03 Paul Eggert <eggert@twinsun.com>
11356
11357 Avoid warnings generated by GCC 2.95.4 when Bison is
11358 configured with --enable-gcc-warnings.
11359 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
11360 yy::]b4_parser_class_name[::translate_,
11361 yy::Stack::operator[] (unsigned),
11362 yy::Stack::operator[] (unsigned) const,
11363 yy::Slice::operator[] (unsigned),
11364 yy::Slice::operator[] (unsigned) const):
11365 Rename local vars to avoid warnings.
11366 * tests/glr-regression.at (Improper handling of embedded actions
11367 and $-N in GLR parsers): Remove unused local variable from yylex.
11368 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
11369 (void) as arg when not pure, since we now assume C89 when building
11370 Bison. Pacify GCC by using parameter.
11371
11372 2003-06-02 Paul Eggert <eggert@twinsun.com>
11373
11374 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
11375 yy::Location::lines, yy::Location::columns): Rename arguments
11376 to avoid shadowing; this removes a warning generated by GCC 3.3.
11377
11378 2003-06-01 Paul Eggert <eggert@twinsun.com>
11379
11380 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
11381 to g++, as GCC 3.3 complains if you do it.
11382 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
11383 everything that WARNING_CFLAGS has, except omit warnings
11384 not suitable for C++.
11385 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
11386 * tests/atlocal.in (CXXFLAGS): New var.
11387 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
11388
11389 Fix a GLR parser bug I reported in February; see
11390 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
11391 The problem was that GLR parsers did not conform to the C standard,
11392 because actions like { $1 = $2 + $3; } expanded to expressions
11393 that invoked YYFILL in separate subexpressions, and YYFILL assigned
11394 to a local variable. The C standard says that expressions
11395 like (var = f ()) + (var = f ()) have undefined behavior.
11396 Another problem was that GCC sometimes issues warnings that
11397 yyfill and its parameters are unused.
11398
11399 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
11400 as possibly unused.
11401 (yyfill): New function.
11402 (YYFILL): Use it.
11403 (yyuserAction): Change type of yynormal to bool, so that it matches
11404 the new yyfill signature. Mark it as possibly unused.
11405
11406
11407 Follow up on a bug I reported in February, where a Bison-generated
11408 parser can loop. Provide a test case and a fix for yacc.c. I
11409 don't have a fix for lalr1.cc or for glr.c, unfortunately.
11410 The original bug report is in:
11411 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
11412
11413 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
11414 macro's size was becoming unwieldy.
11415 (yyerrlab): Do not discard an empty lookahead symbol, as this
11416 might destroy garbage.
11417 (yyerrorlab): New label, with the old contents of YYERROR,
11418 plus the following change: pop the stack of rhs corresponding
11419 to the production that invoked YYERROR. That is how Yacc
11420 behaves, and POSIX requires this behavior.
11421 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
11422 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
11423 Define 'alarm' to do nothing if unistd.h is not available.
11424 Add a new rule "exp: '-' error;" to test the above change to
11425 data/yacc.c. Use 'alarm' to abort any test taking longer than
11426 10 seconds, as it's probably looping.
11427 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
11428 Also, the new yacc.c generates two fewer diagnostics for an
11429 existing test.
11430
11431 2003-05-24 Paul Eggert <eggert@twinsun.com>
11432
11433 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
11434 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
11435 This fixes a problem reported by John Bowman when the Compaq/HP
11436 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
11437 -ansi -Wall -gall).
11438 * data/yacc.c (union yyalloc): Likewise.
11439 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
11440
11441 Switch from 'int' to 'bool' where that makes sense.
11442
11443 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
11444 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
11445 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
11446 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
11447 Return or accept bool, not int. All callers changed.
11448 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
11449 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
11450 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
11451 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
11452 bitset_or_and_cmp_): Likewise.
11453 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
11454 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
11455 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
11456 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
11457 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
11458 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
11459 bitset_stats_or_and_cmp): Likewise.
11460 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
11461 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
11462 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
11463 ebitset_xor_cmp): Likewise.
11464 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
11465 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
11466 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
11467 lbitset_xor_cmp): Likewise.
11468 * lib/bbitset.h: Include <stdbool.h>.
11469 (struct bitset_vtable): The following members now return bool, not
11470 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
11471 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
11472 or_and_cmp).
11473 * src/conflicts.c (count_rr_conflicts): Likewise.
11474 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
11475 All uses changed.
11476 * lib/ebitset.c (ebitset_obstack_init): Likewise.
11477 * lib/lbitset.c (lbitset_obstack_init): Likewise.
11478 * src/getargs.c (debug_flag, defines_flag, locations_flag,
11479 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
11480 graph_flag): Likewise.
11481 * src/getargs.h (debug_flag, defines_flag, locations_flag,
11482 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
11483 graph_flag): Likewise.
11484 * src/output.c (error_verbose): Likewise.
11485 * src/output.h (error_verbose): Likewise.
11486 * src/reader.c (start_flag, typed): Likewise.
11487 * src/reader.h (typed): Likewise.
11488 * src/getargs.c (LOCATIONS_OPTION): New constant.
11489 (long_options, getargs): Use it.
11490 * src/lalr.c (build_relations): Use bool, not int.
11491 * src/nullable.c (nullable_compute): Likewise.
11492 * src/print.c (print_reductions): Likewise.
11493 * src/tables.c (action_row, pack_vector): Likewise.
11494 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
11495 * src/output.c (prepare): Use it.
11496 * src/output.c (token_definitions_output,
11497 symbol_destructors_output, symbol_destructors_output): Use string,
11498 not boolean integer, to keep track of whether to output separator.
11499 * src/print_graph.c (print_core): Likewise.
11500 * src/state.c (state_rule_lookaheads_print): Likewise.
11501
11502 * config/install-sh: Sync from automake 1.7.5.
11503
11504 2003-05-14 Paul Eggert <eggert@twinsun.com>
11505
11506 * src/parse-gram.y (rules_or_grammar_declaration): Require a
11507 semicolon after a grammar declaration, in the interest of possible
11508 future changes to the Bison input language.
11509 Do not allow a stray semicolon at the start of the grammar.
11510 (rhses.1): Allow one or more semicolons after any rule, including
11511 just before "|" as required by POSIX.
11512 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
11513 grammar.
11514
11515 2003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
11516
11517 %parse-param support for lalr1.cc.
11518
11519 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
11520 b4_cc_constructor_calls, b4_cc_constructor_call,
11521 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
11522 definitions.
11523 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
11524 parse-param arguments.
11525 (yy::b4_parser_class_name): Declare instance variables to
11526 hold parse-param arguments.
11527 * tests/calc.at: s/value/semantic_value/ because value clashes
11528 with a member of yy::b4_parser_class_name. Adjust C++ code
11529 to handle %parse-param. Enable %parse-param test in C++.
11530
11531 2003-05-12 Paul Eggert <eggert@twinsun.com>
11532
11533 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
11534 English a bit. Fix fclose typo. Change "const char" to "char
11535 const", and use ANSI C rather than K&R for "main". Suggest
11536 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
11537 and suggest yy_switch_to_buffer.
11538
11539 2003-05-05 Paul Eggert <eggert@twinsun.com>
11540
11541 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
11542 C89. This avoids a diagnostic on compilers that define __STDC__
11543 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
11544 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
11545
11546 2003-05-03 Paul Eggert <eggert@twinsun.com>
11547
11548 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
11549 Do not overrun array bounds.
11550 This should fix a bug reported today by Olatunji Oluwabukunmi in
11551 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
11552
11553 2003-04-29 Akim Demaille <akim@epita.fr>
11554
11555 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
11556 * src/getargs.c, src/getargs.h: here, as bool, not int.
11557 (nondeterministic_parser): New.
11558 * src/parse-gram.y, src/scan-gram.l: Support
11559 %nondeterministic-parser.
11560 * src/output.c (prepare): Use nondeterministic_parser instead
11561 of glr_parser where appropriate.
11562 * src/tables.c (conflict_row, action_row, save_row)
11563 (token_actions, token_actions, pack_vector): Ditto.
11564
11565 2003-04-29 Akim Demaille <akim@epita.fr>
11566
11567 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
11568
11569 2003-04-29 Akim Demaille <akim@epita.fr>
11570
11571 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
11572 with %pure-parser and %locations to exercise the patch from Yakov
11573 Markovitch below.
11574
11575 2003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
11576
11577 * data/yacc.c: (b4_lex_param): Corrected for the case where
11578 %lex-param is provided and %pure-parser isn't.
11579
11580 2003-04-27 Paul Eggert <eggert@twinsun.com>
11581
11582 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
11583 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
11584 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
11585 if it is not defined.
11586 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
11587
11588 2003-04-26 Paul Eggert <eggert@twinsun.com>
11589
11590 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
11591 Declare to be of type suitable for the ninf value itself, not of
11592 type suitable for the corresponding table, since the latter might
11593 be unsigned but the ninf value might be negative. This fixes a
11594 bug reported by Alexandre Duret-Lutz in
11595 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
11596
11597 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
11598 invokes it. We shouldn't invoke it twice because it will attempt
11599 to put error.o in the archive twice. This fixes a glitch reported
11600 by Martin Mokrejs in
11601 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
11602
11603 2003-04-21 Paul Eggert <eggert@twinsun.com>
11604
11605 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
11606 to gnulib.
11607
11608 2003-04-21 Yakov Markovitch <Markovitch@iso.ru>
11609
11610 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
11611 Fix obvious typo that results in uncompilable GLR parsers
11612 when both %pure-parser and %locations are used. (trivial change)
11613
11614 2003-04-17 Paul Eggert <eggert@twinsun.com>
11615
11616 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
11617 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
11618 Do not insert the expected token via unput, as this runs afoul
11619 of a POSIX-compatibility bug in flex 2.5.31.
11620 All uses changed to BEGIN the parent state,
11621 since we no longer insert the expected token via unput.
11622 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
11623 that is no longer emitted after the above change.
11624
11625 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
11626 the first one. This change is from Paul Hilfinger, and it fixes
11627 regression reported by Werner Lemberg in
11628 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
11629
11630 (resolve_sr_conflict): Don't invoke state_errs_set
11631 unless one or more tokens have been explicitly made errors.
11632 Otherwise, the above change causes Bison to abort.
11633
11634 * tests/existing.at (GNU pic Grammar): New test case, taken from
11635 Lemberg's email.
11636
11637 2003-03-31 Akim Demaille <akim@epita.fr>
11638
11639 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
11640
11641 2003-03-31 Akim Demaille <akim@epita.fr>
11642
11643 * src/output.c (prepare_symbols): Avoid trailing spaces in the
11644 output.
11645
11646 2003-03-31 Akim Demaille <akim@epita.fr>
11647
11648 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
11649 From Paul Hilfinger.
11650
11651 2003-03-29 Akim Demaille <akim@epita.fr>
11652
11653 * m4/error.m4: Do not put under dynamic conditions some code which
11654 expansion is under static control.
11655
11656 2003-03-29 Akim Demaille <akim@epita.fr>
11657
11658 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
11659
11660 2003-03-29 Akim Demaille <akim@epita.fr>
11661
11662 * doc/bison.texinfo (Strings are Destroyed): New.
11663
11664 2003-03-13 Paul Eggert <eggert@twinsun.com>
11665
11666 * .cvsignore: Add configure.lineno.
11667 * src/.cvsignore: Add yacc.
11668 * tests/.cvsignore: Add testsuite.log.
11669 * doc/fdl.texi: Sync with latest FSF version.
11670
11671 2003-03-12 Paul Eggert <eggert@twinsun.com>
11672
11673 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
11674 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
11675 cursor, instead of leaving it undefined. This fixes a bug
11676 reported by Tim Van Holder in
11677 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
11678 * tests/input.at (Torturing the Scanner): Test the scanner on
11679 an empty input file, which was Tim Van Holder's test case.
11680
11681 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
11682 <sys/resource.h> can be included, include sys/time.h and
11683 sys/times.h first, if available. This works around the SunOS
11684 4.1.4 porting bug reported by Bruce Becker in
11685 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
11686
11687 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
11688 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
11689 AC_HEADER_SYS_WAIT.
11690
11691 Merge changes from gnulib. This was prompted because the CVS
11692 snapshot didn't build on Solaris 7 due to strnlen problems.
11693
11694 These changes need to be merged back into gnulib:
11695 * lib/hash.c: Include <stdbool.h> unconditionally.
11696 * m4/onceonly.m4 (m4_quote): New macro.
11697 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
11698 Quote AC_FOREACH variable-expansions properly.
11699 The 2003-01-03 obstack.h change also needs merging.
11700 {end of changes requiring merging}
11701
11702 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
11703 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
11704 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
11705 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
11706 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
11707 New files, imported from gnulib.
11708 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
11709 above.
11710
11711 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
11712 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
11713 gnulib sources.
11714
11715 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
11716 Add.
11717 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
11718 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
11719 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
11720 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
11721 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
11722 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
11723 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
11724 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
11725 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
11726 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
11727 (jm_PREREQ_ARGMATCH): Remove.
11728 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
11729 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
11730
11731 * src/system.h: Include <stdbool.h> unconditionally.
11732
11733 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
11734 assuming at least C89 in the bitset code for some time now.
11735
11736 2003-03-03 Akim Demaille <akim@epita.fr>
11737
11738 * ro.po: New.
11739
11740 2003-03-02 Akim Demaille <akim@epita.fr>
11741
11742 * doc/bison.texinfo (Table of Symbols): Reactivate the
11743 documentation for %lex-param, and %parse-param.
11744
11745 2003-03-02 Akim Demaille <akim@epita.fr>
11746
11747 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
11748 generate verbose error messages.
11749 Use the number of tokens as an upper bound in yytname, as it
11750 cannot be a non terminal.
11751
11752 2003-03-02 Akim Demaille <akim@epita.fr>
11753
11754 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
11755 message.
11756
11757 2003-03-02 Akim Demaille <akim@epita.fr>
11758
11759 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
11760 Use them to exercise yycheck overrun.
11761 Based on Andrew Suffield's grammar.
11762
11763 2003-03-02 Akim Demaille <akim@epita.fr>
11764
11765 Create tests/local.at for Bison generic testing macros.
11766
11767 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
11768 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
11769 This new file.
11770 * tests/calc.at (AT_CHECK_CALC): Adjust.
11771 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
11772 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
11773 * tests/local.at: here.
11774 (AT_COMPILE_CXX): Tags the tests using it as c++.
11775 Ignore the test if CXX is not functional.
11776
11777 2003-03-01 Paul Eggert <eggert@twinsun.com>
11778
11779 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
11780 not loc->end, since loc->end might contain garbage and this leads
11781 to undefined behavior on some platforms.
11782 (id_loc, token_start): Use (IF_LINTed) initial values that do not
11783 depend on *loc, so that the reader doesn't give the the false
11784 impression that *loc is initialized.
11785 (<INITIAL>"%%"): Do not bother setting code_start, since its value
11786 does not survive the return.
11787
11788 2003-03-01 Akim Demaille <akim@epita.fr>
11789
11790 * src/scan-gram.l (code_start): Always initialize it when entering
11791 into yylex, as SC_EPILOGUE is activated *before* the corresponding
11792 yylex invocation. An alternative would be making it static, but
11793 then it starts with the second %%'s beginning, instead of its end.
11794
11795 2003-02-28 Paul Eggert <eggert@twinsun.com>
11796
11797 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
11798 around a UnixWare 7.1.1 porting bug reported by John Hughes in
11799 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
11800
11801 2003-02-26 Paul Eggert <eggert@twinsun.com>
11802
11803 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
11804 Remove Sequent/Pyramid discussion (nobody uses them any more).
11805 Merge VMS and MS-DOS discussion; these ports may well be dead
11806 but let's keep mentioning them for now. Put <> around email
11807 addresses. Add copyright notice.
11808
11809 2003-02-24 Paul Eggert <eggert@twinsun.com>
11810
11811 * data/glr.c (yy_reduce_print): yylineno -> yylno,
11812 to avoid collision with flex use of yylineno.
11813 Problem reported by Bruce Lilly in
11814 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
11815 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
11816 * data/yacc.c (yy_reduce_print): Likewise.
11817
11818 * config/depcomp: Sync with Automake 1.7.3.
11819
11820 2003-02-21 Akim Demaille <akim@epita.fr>
11821
11822 * data/lalr1.cc: Use temporary variables instead of casts to
11823 change integer types.
11824 Suggested by Paul Eggert.
11825
11826 2003-02-21 Akim Demaille <akim@epita.fr>
11827
11828 * doc/bison.texinfo: Use "location" consistently to refer to @n,
11829 to avoid confusions with lalr1.cc's notion of Position.
11830 Suggested by Paul Eggert.
11831
11832 2003-02-20 Akim Demaille <akim@epita.fr>
11833
11834 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
11835 before initial_columns.
11836 (location.hh): Use consistent variable names when defining the
11837 operator<<.
11838 Use "last" so that we subtract from Positions, not from unsigned.
11839
11840 2003-02-20 Akim Demaille <akim@epita.fr>
11841
11842 * data/lalr1.cc (position.hh): New subfile, including the extended
11843 and Doxygen'ed documentation of class Position.
11844 (location.hh): Use it.
11845 Document a` la Doxygen.
11846 With the help of Benoit Perrot.
11847
11848 2003-02-20 Akim Demaille <akim@epita.fr>
11849
11850 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
11851 AT_YACC_IF.
11852 Redefine AT_YYERROR_SEES_LOC_IF using it.
11853 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
11854 not defined.
11855 Don't use the location in yy::Parser::error_ and
11856 yy::Parser::print_ when not %locations.
11857 Activate more lalr1.cc tests.
11858
11859 2003-02-19 Akim Demaille <akim@epita.fr>
11860
11861 * data/lalr1.cc: When displaying a line number, be sure to make it
11862 an int.
11863
11864 2003-02-19 Akim Demaille <akim@epita.fr>
11865
11866 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
11867 Remove, useless.
11868 (YYABORT, YYACCEPT, YYERROR): New.
11869 * tests/calc.at: Renable the lalr1.cc test.
11870
11871 2003-02-19 Akim Demaille <akim@epita.fr>
11872
11873 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
11874 error recovery, mixing with/without pops and discarding of the
11875 lookahead.
11876 Exercise YYERROR.
11877 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
11878
11879 2003-02-17 Paul Eggert <eggert@twinsun.com>
11880
11881 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
11882 * tests/testsuite.at (AT_COMPILE): Use them.
11883 This fixes the testsuite problem reported by Robert Lentz in
11884 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
11885
11886 2003-02-12 Paul Eggert <eggert@twinsun.com>
11887
11888 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
11889 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
11890 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
11891 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
11892 Check for malloc failure, for consistency with yacc.c.
11893 (yytname_size): Remove, for consistency with yacc.c.
11894
11895 The bug still remains in data/lalr1.cc, as I didn't have time
11896 to fix it there.
11897
11898 2003-02-06 Akim Demaille <akim@epita.fr>
11899
11900 * configure.ac (GXX): Rename as...
11901 (CXX): this, to keep the original Autoconf semantics.
11902 Require 2.57.
11903 * data/lalr1.cc: Fix b4_copyright invocations.
11904 If YYDEBUG is not defined, don't depend upon name_ being defined.
11905 (location.hh): Include string and iostream.
11906 (Position::filename): New member.
11907 (Position::Position ()): New.
11908 (operator<< (Position)): New.
11909 (operator- (Position, int)): New.
11910 (Location::first, Location::last): Rename as...
11911 (Location::begin, Location::end): these, to mock the conventional
11912 iterator names.
11913 (operator<< (Location)): New.
11914 * tests/atlocal.in (CXX): New.
11915 * tests/testsuite.at (AT_COMPILE_CXX): New.
11916 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
11917 locations in a more synthetic way.
11918 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
11919 lalr1.cc is used.
11920 Adjust the C locations to match those from Emacs: first column is
11921 column 0.
11922 Change all the expected results.
11923 Conform to the GCS: simplify the locations when applicable.
11924 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
11925 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
11926 these CPP macros with the m4 macros new defined by...
11927 (AT_CHECK_PUSHDEFS): this, i.e.:
11928 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
11929 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
11930 New macros.
11931 (AT_CHECK_POPDEFS): Undefine them.
11932 (AT_CHECK_CALC_LALR1_CC): New.
11933 Use it for the first lalr1.cc test.
11934
11935 2003-02-04 Akim Demaille <akim@epita.fr>
11936
11937 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
11938 Location as is defined.
11939
11940 2003-02-04 Akim Demaille <akim@epita.fr>
11941
11942 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
11943 name_ being defined.
11944
11945 2003-02-03 Paul Eggert <eggert@twinsun.com>
11946
11947 * src/gram.h (start_symbol): Remove unused decl.
11948
11949 Use more-consistent naming conventions for local vars.
11950
11951 * src/derives.c (derives_compute): Change type of local var from
11952 int to rule_number.
11953 * src/gram.c (grammar_rules_partial_print): Likewise.
11954 * src/print.c (print_core): Likewise.
11955 * src/reduce.c (reduce_grammar_tables): Likewise.
11956
11957 * src/gram.c (grammar_dump): Change name of item_number *
11958 local var from r to rp.
11959 * src/nullable.c (nullable_compute): Likewise.
11960
11961 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
11962
11963 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
11964 for symbol or symbol_number var.
11965 * src/reader.c (grammar_start_symbol_set): Likewise.
11966 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
11967 Likewise.
11968 * src/state.c (transitions_to): Likewise.
11969 * src/state.h: Likewise.
11970 * src/tables.c (symbol_number_to_vector_number): Likewise.
11971
11972 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
11973 char * var.
11974
11975 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
11976 var.
11977
11978 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
11979 var.
11980
11981 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
11982 Use str, not s, for char * var. Use ch, not c, for character var.
11983 Use size for size var.
11984
11985 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
11986 char * var.
11987 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
11988 uniqstr var.
11989 * src/uniqstr.h: Likewise.
11990
11991 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
11992 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
11993 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
11994 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
11995 param to have same name as that of enum, so that we don't use
11996 "s" to stand for a non-state.
11997
11998 2003-02-02 Akim Demaille <akim@epita.fr>
11999
12000 * src/scan-skel.l: Scan more than one inert character per yylex
12001 invocation.
12002
12003 2003-02-01 Paul Eggert <eggert@twinsun.com>
12004
12005 Version 1.875a.
12006
12007 * po/LINGUAS: Add ms.
12008
12009 2003-01-30 Akim Demaille <akim@epita.fr>
12010
12011 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
12012
12013 2003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12014
12015 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
12016 of $1.
12017
12018 Changes in response to error report by S. Eken: GLR mode does not
12019 handle negative $ indices or $ indices in embedded rules correctly.
12020 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
12021
12022 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
12023 (b4_rhs_location): Ditto.
12024 (yyfill): New function to copy from stack tree into array
12025 incrementally.
12026 (yyuserAction): Modify to allow incremental move of semantic values
12027 to rhs array when in GLR mode.
12028 Define YYFILL to use in user-defined actions to fill semantic array
12029 as needed.
12030 Remove dummy use of yystack, as there is now a guaranteed use.
12031 (yydoAction): Modify to allow incremental move of semantic values
12032 to rhs array when in GLR mode.
12033 (yyresolveAction): Ditto.
12034 (yyglrShiftDefer): Update comment.
12035 (yyresolveStates): Use X == NULL for pointers, not !X.
12036 (yyglrReduce): Ditto.
12037 (yydoAction): Ditto
12038
12039 * tests/glr-regr1.at: Rename to ...
12040 * tests/glr-regression.at: Add new regression test for the problems
12041 described above (adapted from S. Eken).
12042 Update copyright notice.
12043 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
12044 * tests/Makefile.am: Ditto.
12045
12046 2003-01-28 Paul Eggert <eggert@twinsun.com>
12047
12048 * data/lalr1.cc: Do not use @output_header_name@ unless
12049 b4_defines_flag is set. This fixes two bugs reported by
12050 Tim Van Holder in
12051 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
12052 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
12053
12054 2003-01-21 Paul Eggert <eggert@twinsun.com>
12055
12056 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
12057 we don't need to worry about yyerrlab1 being reported as an
12058 "unused label" by non-GCC C compilers. The downside is that if
12059 locations are used then a couple of statements are duplicated each
12060 time YYERROR is invoked, but the upside is that the warnings
12061 should vanish.
12062 (yyerrlab1): Move code to YERROR.
12063 (yyerrlab2): Remove. Change uses back to yyerrlab1.
12064 This reverts some of the 2002-12-27 change.
12065
12066 2003-01-17 Paul Eggert <eggert@twinsun.com>
12067
12068 * src/output.c (symbol_printers_output): Fix typo that led
12069 to core dump. Problem reported by Antonio Rus in
12070 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
12071
12072 2003-01-13 Akim Demaille <akim@epita.fr>,
12073 Quoc Peyrot <chojin@lrde.epita.fr>,
12074 Robert Anisko <anisko_r@lrde.epita.fr>
12075
12076 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
12077 when the stacks contain one element, as the loop would otherwise
12078 free the last state, and then use the top state (the one we just
12079 popped). This means that the initial elements will not be freed
12080 explicitly, as is the case in yacc.c; it is not a problem, as
12081 these elements have fake values.
12082
12083 2003-01-11 Paul Eggert <eggert@twinsun.com>
12084
12085 * NEWS: %expect-violations are now just warnings, reverting
12086 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
12087 bootstrapping problem reported by Matthias Klose; see
12088 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
12089 * src/conflicts.c (conflicts_print): Likewise.
12090 * tests/conflicts.at (%expect not enough, %expect too much,
12091 %expect with reduce conflicts): Likewise.
12092 * doc/bison.texinfo (Expect Decl): Document this. Also mention
12093 that the warning is enabled if the number of conflicts changes
12094 (not necessarily increases).
12095
12096 * src/getargs.c (version): Update copyright year.
12097
12098 2003-01-09 Akim Demaille <akim@epita.fr>
12099
12100 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
12101
12102 2003-01-08 Paul Eggert <eggert@twinsun.com>
12103
12104 * Makefile.maint (WGETFLAGS):
12105 New macro, containing "-C off" to disable proxy caches.
12106 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
12107 (rel-check): Use $(WGET) instead of wget.
12108
12109 2003-01-06 Paul Eggert <eggert@twinsun.com>
12110
12111 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
12112 the GLR paper of Scott, Johnstone and Hussain.
12113
12114 2003-01-04 Paul Eggert <eggert@twinsun.com>
12115
12116 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
12117 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
12118 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
12119 (EXTRA_LIBRARIES): New var, for liby.a.
12120 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
12121 (EXTRA_SCRIPTS): New var, for yacc.
12122
12123 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
12124 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
12125 Problem reported by Nelson H. F. Beebe.
12126
12127 2003-01-03 Paul Eggert <eggert@twinsun.com>
12128
12129 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
12130 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
12131 when compiling Bison 1.875's `bitset bset = obstack_alloc
12132 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
12133
12134 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
12135 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
12136 grow to a huge size with typical invocation.
12137
12138 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
12139 Use the pattern recommended by Autoconf 2.57, except also protect
12140 against double-definition.
12141 * src/system.h: Likewise.
12142 Portability issues reported by Nelson H. F. Beebe.
12143
12144 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
12145 All uses changed. Provide a definition in both C and C++.
12146 (yytrue, yyfalse): Define even if defined (__cplusplus).
12147
12148 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
12149 Reported by Nelson H. F. Beebe.
12150
12151 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
12152
12153 2003-01-02 Paul Eggert <eggert@twinsun.com>
12154
12155 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
12156 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
12157 Bug reported by Nelson H. F. Beebe.
12158
12159 2003-01-01 Paul Eggert <eggert@twinsun.com>
12160
12161 * Version 1.875.
12162
12163 2002-12-30 Paul Eggert <eggert@twinsun.com>
12164
12165 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
12166 Moved here from...
12167 (<INITIAL>","): Here. This causes stray "," to be treated
12168 more uniformly.
12169
12170 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
12171 last brace in braced code when not in Yacc mode, for compatibility
12172 with Bison 1.35. This resurrects the 2001-12-15 patch to
12173 src/reader.c.
12174
12175 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
12176 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
12177
12178 2002-12-28 Paul Eggert <eggert@twinsun.com>
12179
12180 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
12181 that of SYM's type. This fixes Debian bug 168069, reported by
12182 Thomas Olsson.
12183
12184 2002-12-28 Paul Eggert <eggert@twinsun.com>
12185
12186 Version 1.75f.
12187
12188 Switch back to the Yacc style of conflict reports, undoing some
12189 of the 2002-07-30 change.
12190 * doc/bison.texinfo (Understanding): Use Yacc style for
12191 conflict reports. Also, use new way of locating rules.
12192 * src/conflicts.c (conflict_report):
12193 Renamed from conflict_report_yacc, removing the old
12194 'conflict_report'. Translate the entire conflict report at once,
12195 so that we don't assume that "," has the same interpretation in
12196 all languages.
12197 (conflicts_output): Use Yacc-style conflict report for each state,
12198 instead of our more-complicated style.
12199 (conflicts_print): Use Yacc-style conflict report, except print
12200 the input file name when not emulating Yacc.
12201 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
12202 Conflicted Reduction, %expect not enough, %expect too much,
12203 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
12204 * tests/existing.at (GNU Cim Grammar): Likewise.
12205 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
12206
12207 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
12208 fatal): Don't invoke fflush; it's not needed and it might even be
12209 harmful for stdout, as stdout might not be open.
12210 * src/reduce.c (reduce_print): Likewise.
12211
12212 2002-12-27 Paul Eggert <eggert@twinsun.com>
12213
12214 Fix a bug where error locations were not being recorded correctly.
12215 This problem was originally reported by Paul Hilfinger in
12216 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
12217
12218 * data/yacc.c (yyparse): New local var yylerrsp, to record the
12219 top of the location stack's error locations.
12220 (yyerrlab): Set it. When discarding a token, push its location
12221 onto yylerrsp so that we don't lose track of the error's end.
12222 (yyerrlab1): Now is only the target of YYERROR, so that we can
12223 properly record the location of the action that failed. For GCC
12224 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
12225 GCC warning about yyerrlab1 being unused if YYERROR is unused.
12226 (yyerrlab2): New label, which yyerrlab now falls through to.
12227 Compute the error's location by applying YYLLOC_DEFAULT to
12228 the locations of all the symbols that went into the error.
12229 * doc/bison.texinfo (Location Default Action): Mention that
12230 YYLLOC_DEFAULT is also invoked for syntax errors.
12231 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
12232 Error locations include the locations of all the tokens that were
12233 discarded, not just the last token.
12234
12235 2002-12-26 Paul Eggert <eggert@twinsun.com>
12236
12237 * src/files.c: Include quote.h.
12238 (compute_output_file_names): Warn if we detect conflicting
12239 outputs to the same file. This should catch the misunderstanding
12240 exemplified by Debian Bug 165349, reported by Bruce Stephens..
12241
12242 * src/conflicts.c (conflicts_print): If the user specifies
12243 "%expect N", report an error if there are any reduce/reduce
12244 conflicts. This is what the manual says should happen.
12245 This fixes Debian bug 130890, reported by Anthony DeRobertis.
12246 * tests/conflicts.at (%expect with reduce conflicts): New test.
12247
12248 Don't use m4_include on relative file names, as it doesn't work as
12249 desired if there happens to be a file with that name under ".".
12250
12251 * m4sugar/version.m4: Remove; it was included but it wasn't used.
12252 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
12253 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
12254 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
12255 * src/output.c (output_skeleton): Use full path names when
12256 specifying a file to include; don't rely on include path, as
12257 it's unreliable when the working file contains a file with
12258 that name.
12259
12260 2002-12-25 Paul Eggert <eggert@twinsun.com>
12261
12262 Remove obsolete references to bison.simple and bison.hairy.
12263 Problem mentioned by Aubin Mahe in
12264 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
12265 * data/glr.c: Comment fix.
12266 * doc/bison.1: Remove references. Also, mention "yacc".
12267
12268 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
12269 with -g option.
12270
12271 * src/parse-gram.y (declaration): Use enum "report_states" rather
12272 than its numeric value 1.
12273
12274 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
12275 opening a new one. This fixes Debian bug 165349, reported by
12276 Bruce Stephens.
12277
12278 2002-12-24 Paul Eggert <eggert@twinsun.com>
12279
12280 Version 1.75e.
12281
12282 * Makefile.maint (cvs-update): Don't assume that the shell
12283 supports $(...), as Solaris sh doesn't.
12284
12285 * src/parse-gram.y (lloc_default): Remove test for empty
12286 nonterminals at the end, since it didn't change the result.
12287
12288 2002-12-24 Paul Eggert <eggert@twinsun.com>
12289
12290 If the user does not define YYSTYPE as a macro, Bison now declares it
12291 using typedef instead of defining it as a macro. POSIX requires this.
12292 For consistency, YYLTYPE is also declared instead of defined.
12293
12294 %union directives can now have a tag before the `{', e.g., the
12295 directive `%union foo {...}' now generates the C code
12296 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
12297 The default union tag is `YYSTYPE', for compatibility with Solaris 9
12298 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
12299 instead of `yyltype'.
12300
12301 `yystype' and `yyltype' are now obsolescent macros instead of being
12302 typedefs or tags; they are no longer documented and will be
12303 withdrawn in a future release.
12304
12305 * data/glr.c (b4_location_type): Remove.
12306 (YYSTYPE): Renamed from yystype.
12307 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
12308 (struct YYLTYPE): Renamed from struct yyltype.
12309 (YYLTYPE): Renamed from yyltype.
12310 (yyltype, yystype): New (and obsolescent) macros,
12311 for backward compatibility.
12312 * data/yacc.c: Likewise.
12313
12314 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
12315 does not specify a union tag. This is for compatibility with
12316 Solaris 9 yacc.
12317
12318 * src/parse-gram.y (add_param): 2nd arg is now char * not char
12319 const *, since it is now modified by stripping surrounding { }.
12320 (current_braced_code): Remove.
12321 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
12322 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
12323 trailing " {...}". Now of type <chars>.
12324 (grammar_declaration): Adjust to bundled tokens.
12325 (code_content): Remove; stripping is now done by add_param.
12326 (print_token_value): Print contents of bundled tokens.
12327 (token_name): New function.
12328
12329 * src/reader.h (braced_code, current_braced_code): Remove.
12330 (token_name): New decl.
12331
12332 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
12333 token_type, not braced_code code_kind. All uses changed.
12334 (SC_PRE_CODE): New state, for scanning after a keyword that
12335 has (or usually has) an immediately-following braced code.
12336 (token_type): New local var, to keep track of which token type
12337 to return when scanning braced code.
12338 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
12339 <INITIAL>"%parse-param", <INITIAL>"%printer",
12340 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
12341 instead of returning a token type immediately.
12342 (<INITIAL>"{"): Set token type.
12343 (<SC_BRACED_CODE>"}"): Use it.
12344 (handle_action_dollar, handle_action_at): Now returns bool
12345 indicating success. Fail if ! current_rule; this prevents a core dump.
12346 (handle_symbol_code_dollar, handle_symbol_code_at):
12347 Remove; merge body into caller.
12348 (handle_dollar, handle_at): Complain in invalid contexts.
12349
12350 * NEWS, doc/bison.texinfo: Document the above.
12351 * NEWS: Fix years and program names in copyright notice.
12352
12353 2002-12-17 Paul Eggert <eggert@twinsun.com>
12354
12355 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
12356 Reporting, Table of Symbols): Omit mentions of %lex-param and
12357 %parse-param from the documentation for now.
12358
12359 2002-12-15 Paul Eggert <eggert@twinsun.com>
12360
12361 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
12362 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
12363 lookahead symbol, and which sets yychar in parser actions) and it
12364 disagreed with the Bison documentation. Bug
12365 reported by Andrew Walrond.
12366
12367 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
12368 as the caller now does that.
12369 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
12370 (YYEMPTY): Parenthesize right hand side, since others use it.
12371 (yyparse): Don't assume that our generated code is the only code
12372 that sets yychar.
12373
12374 2002-12-13 Paul Eggert <eggert@twinsun.com>
12375
12376 Version 1.75d.
12377
12378 POSIX requires a "yacc" command.
12379 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
12380 (MOSTLYCLEANFILES): Add yacc.
12381 (yacc): New rule.
12382 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
12383 as an alias for bison y.
12384
12385 * po/LINGUAS: Add da.
12386
12387 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
12388 problem with latest <getopt.h>.
12389 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
12390
12391 * doc/fdl.texi: Upgrade to 1.2.
12392 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
12393 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
12394 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
12395 gnulib.
12396 * config/install-sh: Sync with autotools.
12397
12398 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
12399 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
12400 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
12401 locations are requested.
12402 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
12403 locations are requested.
12404
12405 2002-12-12 Paul Eggert <eggert@twinsun.com>
12406
12407 Remove unportable casts and storage allocation tricks.
12408 While we're at it, remove almost all casts, since they
12409 usually aren't needed and are a sign of trouble.
12410
12411 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
12412
12413 * src/derives.c (derives_compute): Do not subtract NTOKENS from
12414 the pointer DSET returned by malloc; this isn't portable.
12415 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
12416 Similarly for DERIVES.
12417 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
12418 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
12419 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
12420
12421 * src/derives.c (derives_compute): Do not bother invoking
12422 int_of_rule_number, since rule numbers are integers.
12423
12424 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
12425 rather than XMALLOC (char, N).
12426
12427 * src/files.c (filename_split): Rewrite to avoid cast.
12428
12429 * src/gram.h (symbol_number_as_item_number,
12430 item_number_as_symbol_number, rule_number_as_item_number,
12431 item_number_as_rule_number):
12432 Now inline functions rather than macros, to avoid casts.
12433 * src/state.h (state_number_as_int): Likewise.
12434 * src/tables.c (state_number_to_vector_number,
12435 symbol_number_to_vector_number): Likewise.
12436
12437 * src/gram.h (int_of_rule_number): Remove; no longer used.
12438
12439 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
12440 since the resulting storage is always stored into.
12441
12442 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
12443 where it's needed.
12444
12445 * src/muscle_tab.c (muscle_m4_output):
12446 Now inline. Return bool, not int.
12447 * src/state.c (state_compare): Likewise.
12448 * src/symtab.c (symbol_check_defined,
12449 symbol_check_alias_consistency, symbol_pack, symbol_translation,
12450 hash_compare_symbol, hash_symbol):
12451 Likewise.
12452 * src/uniqstr.c (uniqstr_print): Likewise.
12453 * src/muscle_tab.c (muscle_m4_output_processor):
12454 New function, to avoid casts.
12455 * src/state.c (state_comparator, stage_hasher): Likewise.
12456 * src/symtab.c (symbol_check_defined_processor,
12457 symbol_check_alias_consistency_processor, symbol_pack_processor,
12458 symbol_translation_processor, hash_symbol_comparator,
12459 hash_symbol_hasher): Likewise.
12460 * src/uniqstr.c (uniqstr_print_processor): Likewise.
12461 * src/muscle_tab.c (muscles_m4_output):
12462 Use new functions instead of casting old functions unportably.
12463 * src/state.c (state_hash_new): Likewise.
12464 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
12465 symbols_token_translations_init):
12466 Likewise.
12467 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
12468
12469 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
12470 var instead of casting to long, to avoid casts.
12471 (prepare_states): Use MALLOC rather than alloca, so that we don't
12472 have to worry about alloca.
12473 * src/state.c (state_hash_lookup): Likewise.
12474
12475 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
12476 local var instead of casting to unsigned char, to avoid casts.
12477
12478 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
12479 STATE_ALLOC): Remove.
12480 (transitions_new, errs_new, reductions_new, state_new): Use malloc
12481 rather than calloc, and use offsetof to avoid allocating slightly
12482 too much storage.
12483 (state_new): Initialize all members.
12484
12485 * src/state.c (state_hash): Use unsigned accumulator, not signed.
12486
12487 * src/symtab.c (symbol_free): Remove; unused.
12488 (symbol_get): Remove cast in lhs of assignment.
12489 (symbols_do): Now static. Accept generic arguments, not
12490 hashing-related ones.
12491
12492 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
12493 (symbol_processor): Remove.
12494 (symbols_do): Remove decl; now static.
12495
12496 * src/system.h (alloca): Remove; decl no longer needed.
12497 (<stddef.h>): Include, for offsetof.
12498 (<inttypes.>, <stdint.h>): Include if available.
12499 (uintptr_t): New type, if system lacks it.
12500 (CALLOC, MALLOC, REALLOC): New macros.
12501 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
12502 new macros.
12503
12504 * src/tables.c (table_size): Now int, to pacify GCC.
12505 (table_grow, table_ninf_remap): Use signed table size.
12506 (save_row): Don't bother initializing locals when not needed.
12507 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
12508 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
12509
12510 * src/vcg.h: Correct misspellings.
12511
12512 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
12513
12514
12515 * src/getargs.c (getargs): Don't assume EOF == -1.
12516
12517 2002-12-09 Paul Eggert <eggert@twinsun.com>
12518
12519 Change identifier spellings to avoid collisions with names
12520 that are reserved by POSIX.
12521
12522 Don't use names ending in _t, since POSIX reserves them.
12523 For consistency, remove _e and _s endings -- they're weren't
12524 needed to remove ambiguity. All uses changed.
12525 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
12526 turn was just renamed from struniq_t.
12527 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
12528 which in turn was just renamed from struniq_processor_t.
12529 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
12530 in turn was renamed from hash_compare_struniq_t.
12531 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
12532 (state_list): Renamed from state_list_t.
12533 * src/assoc.h (assoc): Renamed from assoc_t.
12534 * src/conflicts.c (enum conflict_resolution): Renamed from
12535 enum conflict_resolution_e.
12536 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
12537 (rule_list): Renamed from rule_list_t.
12538 * src/getargs.h (enum trace): Renamed from enum trace_e.
12539 (enum report): Renamed from enum report_e.
12540 * src/gram.h (item_number): Renamed from item_number_t.
12541 (rule_number): Renamed from rule_number_t.
12542 (struct rule_s): Remove the "rule_s" part; not used.
12543 (rule): Renamed from rule_t.
12544 (rule_filter): Renamed from rule_filter_t.
12545 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
12546 (goto_list): Renamed from goto_list_t.
12547 * src/lalr.h (goto_number): Renamed from goto_number_t.
12548 * src/location.h (location): Renamed from location_t.
12549 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
12550 and moved here from:
12551 * src/muscle_tab.h (muscle_entry_t): here.
12552 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
12553 (rule_list): Renamed from rule_list_t.
12554 * src/print_graph.c (static_graph): Renamed from graph.
12555 * src/reader.h (braced_code): Renamed from braced_code_t.
12556 Remove brace_code_e tag.
12557 * src/relation.h (relation_node): Renamed from relation_node_t.
12558 (relation_nodes): Renamed from relation_nodes_t.
12559 (relation): Renamed from relation_t.
12560 * src/state.h (state_number): Renamed from state_number_t.
12561 (struct state): Renamed from struct state_s.
12562 (state): Renamed from state_t.
12563 (transitions): Renamed from transitions_t. Unused (and
12564 misspelled) transtion_s tag removed.
12565 (errs): Renamed from errs_t. Unused errs_s tag removed.
12566 (reductions): Renamed from reductions_t. Unused tag
12567 reductions_s removed.
12568 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
12569 (struct symbol_list): Renamed from struct symbol_list_s.
12570 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
12571 (struct symbol): Renamed from struct symbol_s.
12572 (symbol): Renamed from symbol_t.
12573 * src/tables.c (vector_number): Renamed from vector_number_t.
12574 (action_number): Renamed from action_t.
12575 * src/tables.h (base_number): Renamed from base_t.
12576 * src/vcg.h (enum color): Renamed from enum color_e.
12577 (enum textmode): Renamed from enum textmode_e.
12578 (enum shape): Renamed from enum shape_e.
12579 (struct colorentry): Renamed from struct colorentry_s.
12580 (struct classname): Renamed from struct classname_s.
12581 (struct infoname): Renamed from struct infoname_s.
12582 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
12583 (enum decision): Renamed from enum decision_e.
12584 (enum orientation): Renamed from enum orientation_e.
12585 (enum alignment): Renamed from enum alignment_e.
12586 (enum arrow_mode): Renamed from enum arrow_mode_e.
12587 (enum crossing_type): Renamed from enum crossing_type_e.
12588 (enum view): Renamed from enum view_e.
12589 (struct node): Renamed from struct node_s.
12590 (node): Renamed from node_t.
12591 (enum linestyle): Renamed from enum linestyle_e.
12592 (enum arrowstyle): Renamed from enum arrowstyle_e.
12593 (struct edge): Renamed from struct edge.
12594 (edge): Renamed from edge_t.
12595 (struct graph): Renamed from struct graph_s.
12596 (graph): Renamed from graph_t.
12597 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
12598 Rename value_t -> value.
12599 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
12600 value_t_as_yystype -> value_as_yystype.
12601
12602 Don't include <errno.h> in the mainstream code, since it
12603 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
12604 * lib/get-errno.c, lib/get-errno.h: New files.
12605 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
12606 get-errno.c.
12607 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
12608 * src/output.c (output_skeleton): Likewise.
12609 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
12610 instead of errno.
12611 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
12612 Likewise.
12613 (handle_action_dollar, handle_action_at): Likewise.
12614 * src/system.h: Do not include <errno.h>.
12615 (TAB_EXT): Renamed from EXT_TAB.
12616 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
12617
12618 Avoid str[a-z]*, since <string.h> reserves that name space.
12619 Change all instances of "struniq" in names to "uniqstr", and
12620 likewise for "STRUNIQ" and "UNIQSTR".
12621 * src/uniqstr.c: Renamed from src/struniq.c.
12622 * src/uniqstr.h: Renamed from src/struniq.h.
12623 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
12624 * src/files.c (strsuffix): Remove; unused.
12625 (concat2): Renamed from stringappend. Now static.
12626 * src/files.h (strsuffix, stringappend): Remove; unused.
12627 * src/parse-gram.y (<chars>): Renamed from <string>.
12628 (<uniqstr>): Renamed from <struniq>.
12629 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
12630 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
12631 (struct graph_s.expand): Renamed from struct graph_s.stretch.
12632 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
12633 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
12634 (N_EXPAND): Renamed from N_STRETCH.
12635
12636 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
12637 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
12638 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
12639 Remove; unused.
12640 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
12641 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
12642 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
12643 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
12644 (BASE_MAXIMUM): Renamed from BASE_MAX.
12645 (BASE_MINIMUM): Renamed from BASE_MIN.
12646 (ACTION_MAX): Remove; unused.
12647 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
12648 Unnecessary casts removed from above defines.
12649
12650
12651 Fix misspelling in names.
12652 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
12653 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
12654 G_NODE_ALIGNEMENT.
12655
12656
12657 * lib/timevar.c (timevar_report): Renamed from time_report,
12658 for consistency with other names.
12659 * lib/timevar.h (timevar_report): New decl.
12660 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
12661
12662
12663 Sort include-file uses.
12664
12665 Reorder all include files under src to be in the order "system.h".
12666 then the ../lib include files in angle brackets (alphabetized),
12667 then the . include files in double-quotes (alphabetized). Fix
12668 dependency breakages encountered in this process, as follows:
12669 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
12670 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
12671 * src/state.h: Include "symtab.h".
12672
12673 2002-12-08 Paul Eggert <eggert@twinsun.com>
12674
12675 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
12676 since this causes problems when __file__ contains character
12677 sequences like "@" that are treated specially by src/scan-skel.l.
12678 Instead, just use the file's basename. This fixes the bug
12679 reported by Martin Mokrejs in
12680 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
12681
12682 2002-12-06 Paul Eggert <eggert@twinsun.com>
12683
12684 Add support for rules that do not have trailing semicolons, as
12685 POSIX requires. Improve the quality of locations in Bison
12686 diagnostics.
12687
12688 * src/location.c: Include <quotearg.h>.
12689 (empty_location): Now const.
12690 (location_print): New function. Follow the recommendation of the
12691 GNU Coding Standards for locations that span file boundaries.
12692 * src/location.h: Do not include <quotearg.h>; no longer needed.
12693 (boundary): New type.
12694 (location_t): Use it. This allows locations to span file boundaries.
12695 All member uses changed: file -> start.file or end.file (as needed),
12696 first_line -> start.line, first_column -> start.column,
12697 last_line -> end.line, last_column -> end.column.
12698 (equal_boundaries): New function.
12699 (LOCATION_RESET, LOCATION_STEP): Remove.
12700 (LOCATION_PRINT): Remove. All callers changed to use location_print.
12701 (empty_location): Now const.
12702 (location_print): New decl.
12703 * src/parse-gram.y (lloc_default): New function, which handles
12704 empty locations more accurately.
12705 (YYLLOC_DEFAULT): Use it.
12706 (%token COLON): Remove.
12707 (%token ID_COLON): New token.
12708 (rules): Use it.
12709 (declarations, rules): Remove trailing semicolon.
12710 (declaration, rules_or_grammar_declaration):
12711 Allow empty (";") declaration.
12712 (symbol_def): Remove empty actions; no longer needed.
12713 (rules_or_grammar_declaration): Remove trailing semicolon.
12714 (semi_colon.opt): Remove.
12715 * src/reader.h: Include location.h.
12716 (scanner_cursor): New decl.
12717 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
12718 rolling our own.
12719 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
12720 of *loc.
12721 (STEP): Remove. No longer needed, now that adjust_location does
12722 the work. All uses removed.
12723 (scanner_cursor): New var.
12724 (adjust_location): Renamed from extend_location. It now sets
12725 *loc and adjusts the scanner cursor. All uses changed.
12726 Don't bother testing for CR.
12727 (handle_syncline): Remove location arg; now updates scanner cursor.
12728 All callers changed.
12729 (unexpected_end_of_file): Now accepts start boundary of token or
12730 comment, not location. All callers changed. Update scanner cursor,
12731 not the location.
12732 (SC_AFTER_IDENTIFIER): New state.
12733 (context_state): Renamed from c_context. All uses changed.
12734 (id_loc, code_start, token_start): New local vars.
12735 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
12736 processing of Yacc white space and equivalents here.
12737 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
12738 instead of returning ID immediately, since we need to search for
12739 a subsequent colon.
12740 (<INITIAL>"'", "\""): Save token_start.
12741 (<INITIAL>"%{", "{", "%%"): Save code_start.
12742 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
12743 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
12744 BEGIN context_state at end, not INITIAL.
12745 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
12746 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
12747 Return correct token start.
12748 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
12749 the start of a character, string or multiline comment is found.
12750 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
12751 Reduction): Adjust reported locations to match the more-precise
12752 results now expected.
12753 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
12754 * tests/reduce.at (Useless Rules, Reduced Automaton,
12755 Underivable Rules): Likewise.
12756 * tests/regression.at (Invalid inputs): No longer `expecting ";"
12757 or "|"' now that so many other tokens are allowed by the new grammar.
12758
12759 * src/complain.h (current_file): Remove duplicate decl;
12760 current_file is now owned by files.h.
12761 * src/complain.c, src/scan-gram.l: Include files.h.
12762
12763 2002-12-06 Paul Eggert <eggert@twinsun.com>
12764
12765 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
12766 promotes to int; it might be unsigned int.
12767 * data/yacc.c (yy_reduce_print): Likewise.
12768
12769 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
12770 be #defined in the prologue, not in the Bison declarations.
12771 This fixes Debian Bug 102878, reported by Shaul Karl.
12772
12773 2002-12-02 Paul Eggert <eggert@twinsun.com>
12774
12775 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
12776 * lib/strtoul.c: New file, from gnulib.
12777 This fixes a porting bug reported by Peter Klein in
12778 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
12779
12780 2002-11-30 Paul Eggert <eggert@twinsun.com>
12781
12782 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
12783 and put only a forward declaration in the prologue. This is for
12784 consistency with the other scanner helper functions.
12785
12786 Type clashes now generate warnings, not errors, since it
12787 appears that POSIX may allow some grammars with type clashes.
12788 * src/reader.c (grammar_current_rule_check): Warn about
12789 type clashes instead of complaining.
12790 * tests/input.at (Type Clashes): Expect warnings, not complaints.
12791
12792 Add Yacc library, since POSIX requires it.
12793 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
12794 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
12795 * lib/main.c, lib/yyerror.c: New files.
12796
12797 gram_error can be static; it need not be extern.
12798 * src/reader.h (gram_error): Remove decl.
12799 * src/parse-gram.y (gram_error): Now static. Add static decl.
12800 (print_token_value): Omit parameter names from forward decl,
12801 for consistency.
12802
12803 2002-11-29 Paul Eggert <eggert@twinsun.com>
12804
12805 * doc/bison.texinfo: Emphasize that yylex and yyerror must
12806 be declared before being used. E.g., one should typically
12807 declare them in the prologue. Use GNU coding style in examples.
12808 Put "const" consistently after the type it modifies. Mention
12809 that C99 supports "inline". Mention that yyerror traditionally
12810 returns "int".
12811
12812 %parse-param and %lex-param now take just one argument, the
12813 declaration; the argument name is deduced from the declaration.
12814
12815 * doc/bison.texinfo (Parser Function, Pure Calling, Error
12816 Reporting, Table of Symbols): Document this.
12817 * src/parse-gram.y (add_param): New function.
12818 (COMMA): Remove.
12819 (declaration): Implement new rule for %parse-param and %lex-param.
12820 * src/scan-gram.l: "," now elicits a warning, rather than being
12821 a token; this is more compatible with byacc.
12822 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
12823
12824 2002-11-27 Paul Eggert <eggert@twinsun.com>
12825
12826 Rename identifiers to avoid real and potential collisions.
12827
12828 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
12829 to avoid collision with lex macro described by Bruce Lilly in
12830 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
12831 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
12832 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
12833 * src/parse-gram.y (print_token_value): Renamed from yyprint.
12834 All uses changed.
12835 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
12836 The name "yycontrol" violates the name space rules, and this stuff
12837 wasn't being used anyway.
12838 (input): Remove action; this stuff wasn't being used.
12839 (gram_error): Rename local variable yylloc -> loc.
12840 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
12841 (YY_DECL): Don't use "yy" at start of local variables.
12842 All uses changed, e.g., yylloc -> loc.
12843 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
12844 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
12845 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
12846 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
12847
12848 * src/parse-gram.y (gram_error): loc is now const *.
12849 * src/reader.h (gram_error): Likewise.
12850
12851 2002-11-24 Paul Eggert <eggert@twinsun.com>
12852
12853 Version 1.75c.
12854
12855 * tests/actions.at (Actions after errors): Use an output format
12856 more similar to that of the Printers and Destructors test.
12857 Test the position of the ';' token too.
12858 (Printers and Destructors): Likewise.
12859 (Printers and Destructors: %glr-parser): Remove for now, to avoid
12860 unnecessarily alarming people when the test fails.
12861
12862 * data/yacc.c (yyerrlab1): Move this label down, so that the
12863 parser does not discard the lookahead token if the user code
12864 invokes YYERROR. This change is required for POSIX conformance.
12865
12866 * lib/error.c: Sync with gnulib.
12867
12868 2002-11-22 Paul Eggert <eggert@twinsun.com>
12869
12870 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
12871 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
12872 * lib/xmalloc.c: Likewise.
12873
12874 2002-11-20 Paul Eggert <eggert@twinsun.com>
12875
12876 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
12877
12878 2002-11-20 Paul Eggert <eggert@twinsun.com>
12879
12880 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
12881 should use `if (! x) abort ();' rather than `assert (x);', and
12882 anyway it's one less thing to worry about configuring.
12883
12884 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
12885 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
12886 and replace all instances of assert with abort.
12887 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
12888 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
12889
12890 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
12891 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
12892 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
12893 hash_find_entry, hash_rehash, hash_insert): Likewise.
12894 * src/conflicts.c (resolve_sr_conflict): Likewise.
12895 * src/lalr.c (set_goto_map, map_goto): Likewise.
12896 * src/nullable.c (nullable_compute): Likewise.
12897 * src/output.c (prepare_rules, token_definitions_output): Likewise.
12898 * src/reader.c (packgram, reader): Likewise.
12899 * src/state.c (state_new, state_free, state_transitions_set,
12900 state_reduction_find): Likewise.
12901 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
12902 symbol_pack): Likewise.
12903 * src/tables.c (conflict_row, pack_vector): Likewise.
12904 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
12905 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
12906 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
12907 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
12908
12909 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
12910 (ARGMATCH_CONSTRAINT): New macro.
12911 (ARGMATCH_ASSERT): Use it.
12912
12913 * src/system.h (verify): New macro.
12914 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
12915 rather than assert.
12916 * src/tables.c (tables_generate): Likewise.
12917
12918 * src/struniq.c (struniq_assert): Now returns void, and aborts
12919 if the assertion is false.
12920 (struniq_assert_p): Remove.
12921 * src/struniq.h: Likewise.
12922
12923 2002-11-18 Paul Eggert <eggert@twinsun.com>
12924
12925 * data/glr.c (yygetLRActions): Replace `yyindex' with
12926 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
12927 This fixes the regression with Sun ONE Studio 7 cc that I reported in
12928 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
12929
12930 2002-11-18 Akim Demaille <akim@epita.fr>
12931
12932 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
12933 space.
12934 From Tim Van Holder.
12935
12936 2002-11-17 Paul Eggert <eggert@twinsun.com>
12937
12938 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
12939 to "SyntaxError" for consistency with my 2002-11-15 change.
12940
12941 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
12942 not define to {}, since this breaks the common use of `YYDPRINTF
12943 ((...));' if a single statement is desired (e.g. before `else').
12944 Work around GCC warnings by surrounding corresponding calls with
12945 {} if needed.
12946 (yyhasResolvedValue): Remove unused function.
12947 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
12948 loop body.
12949 (yyreportSyntaxError): Renamed from yyreportParseError.
12950 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
12951 All uses changed.
12952 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
12953 extern when possible. Remove unused initializations.
12954
12955 2002-11-16 Akim Demaille <akim@epita.fr>
12956
12957 Augment the similarity between GLR and LALR traces.
12958
12959 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
12960 (YY_REDUCE_PRINT): New.
12961 (yyparse): Use them.
12962 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
12963 YYDPRINT here.
12964 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
12965 state reached after the reduction/recovery, since...
12966 (yyparse, yyprocessOneStack): Report the state we are entering in.
12967
12968 2002-11-16 Akim Demaille <akim@epita.fr>
12969
12970 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
12971 Add support for --trace=skeleton.
12972 * src/scan-skel.l: %option debug.
12973 Scan strings of non-@ or \n instead of character by character.
12974 (scan_skel): Handle trace_skeleton.
12975 (QPUTS): New.
12976 (@output_parser_name@, @output_header_name@): ``Restore'' their
12977 support (used to be M4 macros).
12978 * data/yacc.c: Quote larger chunks, a la glr.c.
12979 * data/lalr1.cc: Likewise.
12980 The header guards are no longer available, so use some other
12981 string than `YYLSP_NEEDED'.
12982
12983 2002-11-16 Akim Demaille <akim@epita.fr>
12984
12985 Make the ``Printers and Destructors'' test more verbose, taking
12986 `yacc.c''s behavior as (possibly wrong) reference.
12987
12988 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
12989 instead of fprint on stdout.
12990 Set and report the last_line of the symbols.
12991 Consistently display values and locations.
12992
12993 2002-11-16 Paul Eggert <eggert@twinsun.com>
12994
12995 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
12996
12997 2002-11-15 Paul Eggert <eggert@twinsun.com>
12998
12999 * tests/actions.at (Actions after errors): New test case.
13000
13001 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
13002 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
13003 tests/action.at, tests/calc.at, tests/conflicts.at,
13004 tests/cxx-type.at, tests/regression.at:
13005 "parse error" -> "syntax error" for POSIX compatibility.
13006 "parsing stack overflow..." -> "parser stack overflow" so
13007 that code matches Bison documentation.
13008
13009 2002-11-15 Akim Demaille <akim@epita.fr>
13010
13011 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
13012 take two BRACED_CODE, not two string_content.
13013 Free the scanner's obstack when we are done.
13014 (code_content): New.
13015 * tests/calc.at: Adjust.
13016 * doc/bison.texinfo: Adjust.
13017 Also, make sure to include the `,' for these declarations.
13018
13019 2002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
13020
13021 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
13022 definition; avoids potential autoreconf problems.
13023
13024 2002-11-15 Akim Demaille <akim@epita.fr>
13025
13026 Always check the value returned by yyparse.
13027
13028 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
13029 returned by yyparse.
13030 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
13031 Adjust calls.
13032 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
13033 returned by yyparse.
13034
13035 2002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13036
13037 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
13038 on input.at test.
13039
13040 2002-11-14 Paul Eggert <eggert@twinsun.com>
13041
13042 * src/output.c (output_skeleton): Call xfopen instead of
13043 duplicating xfopen's body.
13044
13045 Fix bugs reported by Nelson H. F. Beebe in
13046 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
13047
13048 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
13049 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
13050 Group compiler. Instead, use "$CC -E bar.c". Include the .h
13051 file twice in the grammar, as an extra check.
13052
13053 * tests/input.at (Torturing the Scanner): Surround the
13054 backslash-newline tests with "#if 0", to make it less likely that
13055 we'll run into compiler bugs. Bring back solitary \ inside
13056 comment, but add a closing comment to work around HP C bug. Don't
13057 test backslash-newline in C character constant.
13058
13059 2002-11-14 Akim Demaille <akim@epita.fr>
13060
13061 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
13062 status of the compiler.
13063 Calling `exit 1' is no longer needed.
13064 Reported by Nelson H. F. Beebe.
13065
13066 2002-11-14 Akim Demaille <akim@epita.fr>
13067
13068 * tests/atlocal.in (CPPFLAGS): We have config.h.
13069 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
13070 New.
13071 * tests/actions.at, tests/calc.at, tests/conflicts.at,
13072 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
13073 * tests/regression.at, tests/torture.at: Use them for all the
13074 grammars that are to be compiled.
13075 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
13076 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
13077 * doc/bison.texinfo (GLR Parsers): Document `inline'.
13078
13079 2002-11-14 Akim Demaille <akim@epita.fr>
13080
13081 * doc/bison.texinfo: Various formatting changes (alignments in
13082 samples, additional @group/@end group, GCS in samples.
13083 Use @deffn instead of simple @table to define the directives,
13084 macros, variables etc.
13085
13086 2002-11-13 Paul Eggert <eggert@twinsun.com>
13087
13088 Fix some bugs reported by Albert Chin-A-Young in
13089 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
13090
13091 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
13092 -o c"; the HP C compiler chatters during compilation.
13093 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
13094 * tests/headers.at (export YYLTYPE): Likewise.
13095
13096 * tests/input.at (Torturing the Scanner): Remove lines containing
13097 solitary backslashes, as they tickle a bug in the HP C compiler.
13098
13099 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
13100 comments, since they're not portable. Use GNU coding style.
13101
13102 2002-11-13 Akim Demaille <akim@epita.fr>
13103
13104 * data/yacc.c: Leave bigger chunks of quoted text.
13105 (YYDSYMPRINTF): New.
13106 Use it to report symbol activities.
13107 * data/glr.c (YYDSYMPRINTF): New.
13108 Use it.
13109
13110 2002-11-12 Paul Eggert <eggert@twinsun.com>
13111
13112 Version 1.75b.
13113
13114 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
13115 (yyglrReduce): Return yyok, not 0.
13116 This should avoid the enumerated-type warnings reported
13117 by Nelson H. F. Beebe in
13118 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
13119
13120 * lib/bbitset.h (BITSET_INLINE): Remove.
13121 * lib/bitset.h [! BITSET_INLINE]: Remove.
13122 (bitset_set, bitset_reset, bitset_test): Rename local vars
13123 to avoid shadowing warnings by GCC.
13124
13125 * data/glr.c (inline): Remove #define. It's the user's
13126 responsibility to #define it away, just like 'const'.
13127 This fixes one of the bugs reported by Nelson H. F. Beebe in
13128 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
13129
13130 * Makefile.maint (po-check): Scan .l and .y files instead of the
13131 .c and the .h files that they generate. This fixes the bug
13132 reported by Tim Van Holder in:
13133 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
13134 Look for N_ as well as for _. Try to avoid matching #define for
13135 N_ and _.
13136 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
13137 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
13138 * src/scan-gram.l: Revamp regular expressions so that " and '
13139 do not confuse xgettext.
13140
13141 * src/struniq.h (struniq_new): Do not declare the return type
13142 to be 'const'; this violates the C standard.
13143 * src/struniq.c (struniq_new): Likewise.
13144
13145 2002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
13146
13147 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
13148 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
13149 linker.
13150
13151 2002-11-12 Akim Demaille <akim@epita.fr>
13152
13153 * Makefile.maint: Sync with Autoconf:
13154 (local_updates): New.
13155
13156 2002-11-12 Akim Demaille <akim@epita.fr>
13157
13158 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
13159
13160 2002-11-12 Akim Demaille <akim@epita.fr>
13161
13162 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
13163 locations.
13164
13165 2002-11-12 Akim Demaille <akim@epita.fr>
13166
13167 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
13168 not yyvalue.
13169
13170 2002-11-12 Akim Demaille <akim@epita.fr>
13171
13172 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
13173 Use it to test the GLR parser.
13174
13175 2002-11-12 Akim Demaille <akim@epita.fr>
13176
13177 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
13178 defines it.
13179 * data/glr.c (yystos): New.
13180 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
13181 (YYDSYMPRINT): New.
13182 (yyval): Don't define it, it is handled via M4.
13183 (yyrecoverParseError): Free verbosely the discarded symbols.
13184 * data/yacc.c (yysymprint): Remove, rather...
13185 (b4_yysymprint_generate): invoke.
13186 * data/c.m4 (b4_yysymprint_generate): New.
13187 Accept pointers as arguments, as opposed to the version from
13188 yacc.c.
13189 (b4_yydestruct_generate): Likewise.
13190 * tests/cations.at (Printers and Destructors): Use Bison directives
13191 instead of CPP macros.
13192 Don't rely on internal details.
13193
13194 2002-11-12 Akim Demaille <akim@epita.fr>
13195
13196 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
13197 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
13198 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
13199 it against YYEMPTY and so forth), work on yytoken (i.e., set
13200 it to YYEMPTY etc.).
13201 (yydestruct): Replace with a b4_yydestruct_generate invocation.
13202 (b4_symbol_actions): Remove.
13203 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
13204 for 0, end-of-input.
13205
13206 2002-11-12 Akim Demaille <akim@epita.fr>
13207
13208 * doc/bison.texinfo (Destructor Decl): New.
13209
13210 2002-11-12 Akim Demaille <akim@epita.fr>
13211
13212 * src/tables.c (tables_generate): Use free for pointers that
13213 cannot be NULL, not XFREE.
13214 (pack_vector): Use assert, not fatal, for bound violations.
13215 * src/state.c (state_new): Likewise.
13216 * src/reader.c (reader): Likewise.
13217 * src/lalr.c (set_goto_map): Likewise.
13218 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
13219 the file name.
13220
13221 2002-11-12 Akim Demaille <akim@epita.fr>
13222
13223 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
13224 Restore.
13225 * src/scan-gram.l (last_string): Is global to the file, not to
13226 yylex.
13227 * src/parse-gram.y (input): Don't append the epilogue here,
13228 (epilogue.opt): do it here, and free the scanner's obstack.
13229 * src/reader.c (epilogue_set): Rename as...
13230 (epilogue_augment): this.
13231 * data/c.m4 (b4_epilogue): Defaults to empty.
13232
13233 2002-11-12 Akim Demaille <akim@epita.fr>
13234
13235 * src/getargs.c (long_options): Remove duplicates.
13236 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
13237 Remove.
13238 * doc/bison.rnh: Remove.
13239 * doc/bison.texinfo (VMS Invocation): Remove.
13240
13241 2002-11-12 Akim Demaille <akim@epita.fr>
13242
13243 * src/struniq.h, src/struniq.c (struniq_t): Is const.
13244 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
13245
13246 Use struniq for symbols.
13247
13248 * src/symtab.h (symbol_t): The tag member is a struniq.
13249 (symbol_type_set): Adjust.
13250 * src/symtab.c (symbol_new): Takes a struniq.
13251 (symbol_free): Don't free the tag member.
13252 (hash_compare_symbol_t, hash_symbol_t): Rename as...
13253 (hash_compare_symbol, hash_symbol): these.
13254 Use the fact that tags as struniqs.
13255 (symbol_get): Use struniq_new.
13256 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
13257 Returns a strniq.
13258 * src/reader.h (merger_list, grammar_currentmerge_set): The name
13259 and type members are struniqs.
13260 * src/reader.c (get_merge_function)
13261 (grammar_current_rule_merge_set): Adjust.
13262 (TYPE, current_type): Are struniq.
13263
13264 Use struniq for file names.
13265
13266 * src/files.h, src/files.c (infile): Split into...
13267 (grammar_file, current_file): these.
13268 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
13269 * src/reduce.c (reduce_print): Likewise.
13270 * src/getargs.c (getargs): Likewise.
13271 * src/complain.h, src/complain.c: Likewise.
13272 * src/main.c (main): Call struniqs_new early enough to use it for
13273 file names.
13274 Don't free the input file name.
13275
13276 2002-11-12 Akim Demaille <akim@epita.fr>
13277
13278 * src/symtab.c (symbol_free): Remove dead deactivated code:
13279 type_name are properly removed.
13280 Don't use XFREE to free items that cannot be NULL.
13281 * src/struniq.h, src/struniq.c: New.
13282 * src/main.c (main): Initialize/free struniqs.
13283 * src/parse-gram.y (%union): Add astruniq member.
13284 (yyprint): Adjust.
13285 * src/scan-gram.l (<{tag}>): Return a struniq.
13286 Free the obstack bit that used to store it.
13287 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
13288
13289 2002-11-11 Paul Eggert <eggert@twinsun.com>
13290
13291 Revamp to fix many (but not all) of the C- and M4-related quoting
13292 problems. Among other things, this fixes the Bison bug reported
13293 by Jan Hubicka when processing the Bash grammar; see:
13294 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
13295
13296 Use new @ escapes consistently. Represent brackets with @{ and @}
13297 rather than @<:@ and @:>@, since this works a bit better with dumb
13298 editors like vi. Represent @ with @@, since @ is now consistently
13299 an escape. Use @oline@ and @ofile@ rather than __oline__ and
13300 __ofile__, to avoid unexpected expansions. Similarly, use @output
13301 rather than #output.
13302
13303 * data/c.m4 (b4_copyright): Omit file name from comment, since
13304 the file name could contain "*/".
13305 (b4_synclines_flag): Don't quote the 2nd argument; it should already
13306 be quoted. All uses changed.
13307
13308 * data/glr.c: Use new @ escapes consistently.
13309 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
13310 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
13311 Remove, since they couldn't handle arbitrary characters in file
13312 names.
13313 * data/lalr1.cc: Likewise.
13314 * data/yacc.c: Likewise.
13315
13316 * src/files.c (output_infix): Remove; all uses removed.
13317 * src/files.h: Likewise.
13318
13319 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
13320 mishandled funny characters in file names, and anyway it isn't
13321 needed any more.
13322 * data/yacc.c: Likewise.
13323 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
13324
13325 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
13326 * data/yacc.c: Likewise.
13327
13328 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
13329 strings now.
13330 (muscle_init): Quote filename as a C string.
13331 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
13332 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
13333 * src/output.c (escaped_file_name_output): New function.
13334 (prepare_symbols): Quote tokens for M4.
13335 (prepare): Don't insert output_infix, output_prefix,
13336 output_parser_name, output_header_name; this is now down by scan-skel.
13337 Insert skeleton as a C string.
13338
13339 * src/output.c (user_actions_output, symbol_destructors_output,
13340 symbol_printers_output): Quote filenames for C and M4.
13341 * src/reader.c (prologue_augment, epilogue_set): Likewise.
13342
13343 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
13344 escapes other than \\ and \'; this simplifies the code.
13345 (<SC_STRING>): Likewise, for \\ and \".
13346 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
13347 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
13348 Use new escapes @{ and @} for [ and ].
13349
13350 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
13351 them with auto vars.
13352 Switch to new escape scheme, where @ is the escape character uniformly.
13353 Abort if a stray escape character is found. Avoid unbounded input
13354 buffer when parsing non-escaped text.
13355
13356 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
13357 __oline__, #output, $@, and @{ do not have unintended meanings.
13358
13359 2002-11-09 Paul Eggert <eggert@twinsun.com>
13360
13361 Fix the test failure due to GCC warnings described in
13362 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
13363 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
13364 evaluate to 0 if it's impossible for NINF to be in the respective
13365 table.
13366 (yygetLRActions, yyrecoverParseError): Use them.
13367
13368 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
13369 counted in the token inserted at end of file. Now takes
13370 location_t *, not location_t, so that the location can be
13371 adjusted. All uses changed.
13372
13373 * tests/regression.at (Invalid inputs): Adjust wording in
13374 diagnostic to match the new behavior.
13375
13376 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
13377 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
13378 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
13379 abort ();'. This reduces the runtime of the "Many lookaheads"
13380 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
13381 GCC 3.2.
13382
13383 2002-11-07 Paul Eggert <eggert@twinsun.com>
13384
13385 * src/parse-gram.y (CHARACTER): Remove unused token.
13386 All uses removed.
13387
13388 * src/scan-gram.l: Remove stack option. We no longer use the
13389 stack, since the stack was never deeper than 1; instead, use the
13390 new auto var c_context to record the stacked value.
13391
13392 Remove nounput option. At an unexpected end of file, we now unput
13393 the minimal input necessary to end cleanly; this simplifies the
13394 code.
13395
13396 Avoid unbounded token sizes where this is easy.
13397
13398 (unexpected_end_of_file): New function.
13399 Use it to systematize the error message on unexpected EOF.
13400 (last-string): Now auto, not static.
13401 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
13402 (scanner_last_string_free): Remove; not used.
13403 (percent_percent_count): Move decl to just before use.
13404 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
13405 not the (never otherwised-used) CHARACTER.
13406
13407 2002-11-07 Akim Demaille <akim@epita.fr>
13408
13409 Let yyerror always receive the msg as last argument, so that
13410 yyerror can be variadic.
13411
13412 * data/yacc.c (b4_yyerror_args): New.
13413 Use it when calling yyerror.
13414 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
13415 Use it when calling yyerror.
13416 * doc/bison.texinfo (Error Reporting): Adjust.
13417 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
13418 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
13419
13420 2002-11-06 Akim Demaille <akim@epita.fr>
13421
13422 #line should have quoted strings.
13423 Ideally, this should be done by m4_quotearg.
13424
13425 * src/scan-skel.l: Include quotearg.h.
13426 Quote __ofile__.
13427 * src/output.c (symbol_printers_output)
13428 (symbol_destructors_output): Quote the file name.
13429
13430 2002-11-06 Akim Demaille <akim@epita.fr>
13431
13432 * tests/regression.at (Invalid inputs): Adjust to the recent
13433 messages.
13434
13435 2002-11-06 Akim Demaille <akim@epita.fr>
13436
13437 Restore --no-lines.
13438 Reported by Jim Kent.
13439
13440 * data/c.m4 (b4_syncline): New.
13441 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
13442 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
13443 * src/output.c (user_actions_output): Likewise.
13444 (prepare): Define 'b4_synclines_flag'.
13445 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
13446
13447 2002-11-06 Akim Demaille <akim@epita.fr>
13448
13449 * src/main.c (main): Free `infile'.
13450 * src/scan-gram.l (handle_syncline): New.
13451 Recognize `#line'.
13452 * src/output.c (user_actions_output, symbol_destructors_output)
13453 (symbol_printers_output): Use the location's file name, not
13454 infile.
13455 * src/reader.c (prologue_augment, epilogue_set): Likewise.
13456
13457 2002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13458
13459 * src/tables.c (matching_state): Don't allow states to match if
13460 either has GLR conflict entries.
13461
13462 2002-11-05 Paul Eggert <eggert@twinsun.com>
13463
13464 * src/scan-gram.l: Use more accurate diagnostics, e.g.
13465 "integer out of range" rather than "invalid value".
13466 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
13467 accordingly.
13468
13469 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
13470 Also, remove one static variable in the scanner.
13471
13472 * src/scan-gram.l (braces_level): Now auto, not static.
13473 Initialize to zero if the compiler is being picky.
13474 (INITIAL): Clear braces_level instead of incrementing it.
13475 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
13476 as POSIX 1003.1-2001 requires.
13477 * src/system.h (IF_LINT): New macro, taken from coreutils.
13478 * configure.ac: Define "lint" if --enable-gcc-warnings.
13479
13480 2002-11-05 Akim Demaille <akim@epita.fr>
13481
13482 * src/scan-gram.l: When it starts with `%', complain about the
13483 whole directive, not just that `invalid character: %'.
13484
13485 2002-11-04 Akim Demaille <akim@epita.fr>
13486
13487 * Makefile.maint: Update from Autoconf.
13488 (update, cvs-update, po-update, do-po-update): New.
13489
13490 2002-11-04 Akim Demaille <akim@epita.fr>
13491
13492 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
13493 and yyerror.
13494 Have yyerror `use' its arguments.
13495 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
13496 returns true when location & yacc & pure & parse-param.
13497 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
13498
13499 2002-11-04 Akim Demaille <akim@epita.fr>
13500
13501 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
13502 clashes.
13503 * src/scan-gram.l: Use [\'] instead of ['] to pacify
13504 font-lock-mode.
13505 Use complain_at.
13506 Use quote, not quote_n since LOCATION_PRINT no longer uses the
13507 slot 0.
13508
13509 2002-11-03 Paul Eggert <eggert@twinsun.com>
13510
13511 * src/reader.c (get_merge_function, grammar_current_rule_check):
13512 Use consistent diagnostics for reporting type name clashes.
13513 Quote the types with <>, for consistency with Yacc.
13514 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
13515
13516 2002-11-03 Akim Demaille <akim@epita.fr>
13517
13518 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
13519 New.
13520 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
13521 (b4_parse_param): Remove.
13522 Use b4_identification.
13523 Propagate b4_pure_args where needed to pass them to yyerror.
13524 * data/glr.m4 (b4_parse_param): Remove.
13525 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
13526 (b4_lpure_formals): New.
13527 Use b4_identification.
13528 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
13529 b4_user_formals and b4_user_args.
13530 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
13531 (yyreportAmbiguity): When using a pure parser, also need
13532 the location, and the parse-params.
13533 Adjust callers.
13534 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
13535 When using a pure parser, also need the parse-params.
13536 Adjust callers.
13537 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
13538 (%pure-parser + %parse-param) LALR and GLR parsers.
13539 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
13540 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
13541 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
13542 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
13543 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
13544 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
13545 * doc/bison.texinfo: Untabify the whole file.
13546 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
13547 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
13548 (Error Reporting): Adjust to these new directives.
13549 Document %error-verbose, deprecate YYERROR_VERBOSE.
13550
13551 2002-11-03 Akim Demaille <akim@epita.fr>
13552
13553 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
13554 AT_CHECK_CALC_GLR invocations to use % directives, instead of
13555 command line options.
13556 * tests/cxx-type.at: Formatting changes.
13557
13558 2002-11-03 Paul Eggert <eggert@twinsun.com>
13559
13560 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
13561 to count columns correctly, and to check for invalid inputs.
13562
13563 Use mbsnwidth to count columns correctly. Account for tabs, too.
13564 Include mbswidth.h.
13565 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
13566 (extend_location): New function.
13567 (YY_LINES): Remove.
13568
13569 Handle CRLF in C code rather than in Lex code.
13570 (YY_INPUT): New macro.
13571 (no_cr_read): New function.
13572
13573 Scan UCNs, even though we don't fully handle them yet.
13574 (convert_ucn_to_byte): New function.
13575
13576 Handle backslash-newline correctly in C code.
13577 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
13578 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
13579 all uses changed.
13580 (tag, splice): New EREs. Do not allow NUL or newline in tags.
13581 Use {splice} wherever C allows backslash-newline.
13582 YY_STEP after space, newline, vertical-tab.
13583 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
13584
13585 (letter, id): Don't assume ASCII; e.g., spell out a-z.
13586
13587 ({int}, handle_action_dollar, handle_action_at): Check for integer
13588 overflow.
13589
13590 (YY_STEP): Omit trailing semicolon, so that it's more like C.
13591
13592 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
13593 as well as \000. Check for UCHAR_MAX, not 255.
13594 Allow \x with an arbitrary positive number of digits, as in C.
13595 Check for overflow here.
13596 Allow \? and UCNs, for compatibility with C.
13597
13598 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
13599 with quote slot used by complain_at.
13600
13601 * tests/input.at: Add tests for backslash-newline, m4 quotes
13602 in symbols, long literals, and funny escapes in strings.
13603
13604 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
13605 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
13606 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
13607 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
13608 * m4/mbswidth.m4: New file, from GNU coreutils.
13609
13610 * doc/bison.texinfo (Grammar Outline): Document // comments.
13611 (Symbols): Document that trigraphs have no special meaning in Bison,
13612 nor is backslash-newline allowed.
13613 (Actions): Document that trigraphs have no special meaning.
13614
13615 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
13616 no longer used.
13617
13618 2002-11-02 Paul Eggert <eggert@twinsun.com>
13619
13620 * src/reader.c: Don't include quote.h; not needed.
13621 (get_merge_function): Reword warning to be consistent with
13622 type clash diagnostic in grammar_current_rule_check.
13623
13624 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
13625 bug in trigraph handling.
13626
13627 * src/output.c (prepare_symbols): When printing token names,
13628 escape "[" as "@<:@" and likewise for "]".
13629
13630 * src/system.h (errno): Remove declaration, as we are now
13631 assuming C89 or better, and C89 guarantees errno.
13632
13633 2002-10-30 Paul Eggert <eggert@twinsun.com>
13634
13635 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
13636 Check for close failures.
13637 * src/files.h (xfclose): Return void, not int, since it always
13638 returned zero.
13639 * src/files.c (xfclose): Likewise. Report I/O error if ferror
13640 indicates one.
13641 * src/output.c (output_skeleton): Use xfclose rather than fclose
13642 and ferror. xfclose now checks ferror.
13643
13644 * data/glr.c (YYLEFTMOST_STATE): Remove.
13645 (yyreportTree): Use a stack-based leftmost state. This avoids
13646 our continuing battles with bogus warnings about initializers.
13647
13648 2002-10-30 Akim Demaille <akim@epita.fr>
13649
13650 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
13651 #if.
13652
13653 2002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13654
13655 * tests/glr-regr1.at: New test for reported regressions.
13656 * tests/testsuite.at: Add glr-regr1.at test.
13657 * tests/Makefile.am: Add glr-regr1.at test.
13658
13659 2002-10-24 Paul Eggert <eggert@twinsun.com>
13660
13661 Version 1.75a.
13662
13663 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
13664 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
13665 we use malloc. Don't assume 'A' through 'Z' are contiguous.
13666 Don't assume strdup exists; POSIX says its an XSI extension.
13667 Check for buffer overflow on input.
13668
13669 2002-10-24 Akim Demaille <akim@epita.fr>
13670
13671 * src/output.c (output_skeleton): Don't disable M4sugar comments
13672 too soon: it results in comments being expanded.
13673 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
13674 first output.
13675
13676 2002-10-24 Akim Demaille <akim@epita.fr>
13677
13678 * data/yacc.c (m4_int_type): New.
13679 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
13680 char' as only yacc.c wants K&R portability.
13681 * data/glr.c (yysigned_char): Remove.
13682 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
13683 Reported by Quoc Peyrot.
13684
13685 2002-10-23 Paul Eggert <eggert@twinsun.com>
13686
13687 * src/main.c (main): With --trace=time, report times even if a
13688 non-fatal error occurs. Formerly, the times were reported in some
13689 such cases but not in others.
13690 * src/reader.c (reader): Just return if a complaint has been issued,
13691 instead of exiting, so that 'main' can report times.
13692
13693 2002-10-22 Akim Demaille <akim@epita.fr>
13694
13695 * src/system.h: Include sys/types.
13696 Reported by Bert Deknuydt.
13697
13698 2002-10-23 Paul Eggert <eggert@twinsun.com>
13699
13700 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
13701 Suggested by Art Haas.
13702
13703 2002-10-22 Paul Eggert <eggert@twinsun.com>
13704
13705 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
13706 decl; not needed any more.
13707 * src/main.c (main): Use return to exit, undoing yesterday's change.
13708 The last OS that we could find where this wouldn't work is
13709 SunOS 3.5, and that's too old to worry about now.
13710
13711 * data/glr.c (struct yyltype): Define members even when not
13712 doing locations. This is more consistent with yacc.c, and it
13713 works around the following bug reports:
13714 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
13715 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
13716
13717 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
13718 @acronym consistently. Standardize on "Yacc" instead of "YACC",
13719 "Algol" instead of "ALGOL". Give a bit more history about BNF.
13720
13721 2002-10-22 Akim Demaille <akim@epita.fr>
13722
13723 * data/README: New.
13724
13725 2002-10-21 Paul Eggert <eggert@twinsun.com>
13726
13727 Be consistent about 'bool'; the old code used an enum in one
13728 module and an int in another, and this violates the C standard.
13729 * m4/stdbool.m4: New file, from coreutils 4.5.3.
13730 * configure.ac (AC_HEADER_STDBOOL): Add.
13731 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
13732 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
13733 * src/symtab.c (hash_compare_symbol_t): Likewise.
13734 * src/system.h (bool, false, true): Use a definition consistent
13735 with ../lib/hash.c. All uses changed.
13736
13737 * src/complain.c (warning_issued): Renamed from warn_message_count,
13738 so that we needn't worry about integer overflow (!).
13739 Now of type bool. All uses changed.
13740 (complaint_issued): Renamed from complain_message_count; likewise.
13741
13742 * src/main.c (main): Use exit to exit with failure.
13743
13744 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
13745 rather than 1 and 0.
13746 * src/main.c (main): Likewise.
13747 * src/getargs.c (getargs): Likewise.
13748 * src/reader.c (reader): Likewise.
13749
13750 * src/getarg.c (getargs): Remove duplicate code for
13751 "Try `bison --help'".
13752
13753 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
13754 What was that "2" for?
13755
13756 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
13757 * src/getargs.c (usage): Likewise.
13758
13759 * src/getargs.c (getargs): When there are too few operands, report
13760 the last one. When there are too many, report the first extra
13761 one. This is how diffutils does it.
13762
13763 2002-10-20 Paul Eggert <eggert@twinsun.com>
13764
13765 Remove K&R vestiges.
13766 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
13767 * src/complain.c (VA_START): Remove. Assume prototypes.
13768 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
13769 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
13770 fatal): Assume prototypes.
13771 * src/complain.h: Assume prototypes.
13772 * src/system.h (PARAMS): Remove.
13773 Include <limits.h> unconditionally, since it's guaranteeed even
13774 for a freestanding C89 compiler.
13775 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
13776 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
13777
13778 2002-10-20 Akim Demaille <akim@epita.fr>
13779
13780 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
13781 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
13782 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
13783 (yyresolveStates, yyresolveAction, yyresolveStack)
13784 (yyprocessOneStack): Use them.
13785 (yy_reduce_print): New.
13786 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
13787
13788 2002-10-20 Akim Demaille <akim@epita.fr>
13789
13790 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
13791 arguments and output `void'.
13792 (b4_c_function): Rename as...
13793 (b4_c_function_def): this.
13794 (b4_c_function_decl, b4_c_ansi_function_def)
13795 (b4_c_ansi_function_decl): New.
13796 Change the interpretation of the arguments: before `int, foo', now
13797 `int foo, foo'.
13798 * data/yacc.c (yyparse): Prototype and define thanks to these.
13799 Adjust b4_c_function_def uses.
13800 * data/glr.c (yyparse): Likewise, but ANSI only.
13801
13802 2002-10-20 Akim Demaille <akim@epita.fr>
13803
13804 * src/output.c (prepare): Move the definition of `tokens_number',
13805 `nterms_number', `undef_token_number', `user_token_number_max'
13806 to...
13807 (prepare_tokens): Here.
13808 (prepare_tokens): Rename as...
13809 (prepare_symbols): this.
13810 (prepare): Move the definition of `rules_number' to...
13811 (prepare_rules): here.
13812 (prepare): Move the definition of `last', `final_state_number',
13813 `states_number' to...
13814 (prepare_states): here.
13815 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
13816
13817 2002-10-20 Akim Demaille <akim@epita.fr>
13818
13819 * src/tables.h, src/tables.c, src/output.c: Comment changes.
13820
13821 2002-10-20 Akim Demaille <akim@epita.fr>
13822
13823 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
13824 * data/c.m4: here.
13825
13826 2002-10-20 Akim Demaille <akim@epita.fr>
13827
13828 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
13829 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
13830 `pair'.
13831 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
13832 `name' to...
13833 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
13834 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
13835 These.
13836
13837 2002-10-19 Paul Eggert <eggert@twinsun.com>
13838
13839 Do not create a temporary file, as that involves security and
13840 cleanup headaches. Instead, use a pair of pipes.
13841 Derived from a suggestion by Florian Krohm.
13842 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
13843 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
13844 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
13845 (BISON_PREREQ_SUBPIPE): Add.
13846 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
13847 Add subpipe.h, subpipe.c.
13848 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
13849 * po/POTFILES.in: Add lib/subpipe.c.
13850 * src/output.c: Include "subpipe.h".
13851 (m4_invoke): Remove decl.
13852 (scan_skel): New decl.
13853 (output_skeleton): Use pipe rather than temporary file for m4 input.
13854 Check that m4sugar.m4 is readable, to avoid deadlock.
13855 Check for pipe I/O error.
13856 * src/scan-skel.l (readpipe): Remove decl.
13857 (scan_skel): New function, to be used in place of m4_invoke.
13858 Read from stream rather than file.
13859
13860 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
13861 float, as this generates a warning on Solaris 8 + GCC 3.2 with
13862 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
13863 this generates a more-accurate value anyway.
13864
13865 * lib/timevar.c (timervar_accumulate): Rename locals to
13866 avoid confusion with similarly-named more-global.
13867 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
13868
13869 * src/output.c (prepare): Use xstrdup to convert char const *
13870 to char *, to avoid GCC warning.
13871
13872 2002-10-19 Akim Demaille <akim@epita.fr>
13873
13874 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
13875 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
13876 Use them to have `calc.y' ready for %pure-parser.
13877 * data/yacc.c (YYLEX): Pass a yylex return type to
13878 b4_c_function_call.
13879
13880 2002-10-19 Akim Demaille <akim@epita.fr>
13881
13882 Prototype support of %lex-param and %parse-param.
13883
13884 * src/parse-gram.y: Add the definition of the %lex-param and
13885 %parse-param tokens, plus their rules.
13886 Drop the `_' version of %glr-parser.
13887 Add the "," token.
13888 * src/scan-gram.l (INITIAL): Scan them.
13889 * src/muscle_tab.c: Comment changes.
13890 (muscle_insert, muscle_find): Rename `pair' as `probe'.
13891 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
13892 (muscle_entry_s): The `value' member is no longer const.
13893 Adjust all dependencies.
13894 * src/muscle_tab.c (muscle_init): Adjust: use
13895 MUSCLE_INSERT_STRING.
13896 Initialize the obstack earlier.
13897 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
13898 (muscle_pair_list_grow): New.
13899 * data/c.m4 (b4_c_function_call, b4_c_args): New.
13900 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
13901 * tests/calc.at: Use %locations, not --locations.
13902 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
13903
13904 2002-10-19 Akim Demaille <akim@epita.fr>
13905
13906 * src/getargs.c (usage): Take status as argument and exit
13907 accordingly.
13908 Report the traditional `Try ... --help' message when status != 0.
13909 (usage, version): Don't take a FILE * as arg, it is pointless.
13910 (getargs): When there is an incorrect number of arguments, make it
13911 an error, and report it GNUlically thanks to `usage ()'.
13912
13913 2002-10-18 Paul Eggert <eggert@twinsun.com>
13914
13915 * data/glr.c (yyreportParseError): Don't assume that sprintf
13916 yields the length of the printed string, as this is not true
13917 on SunOS 4.1.4. Reported by Peter Klein.
13918
13919 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
13920 * tests/conflicts.at (%nonassoc and eof): Likewise.
13921 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
13922
13923 2002-10-17 Akim Demaille <akim@epita.fr>
13924
13925 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
13926 * src/getargs.c (trace_types, trace_args): Adjust.
13927 * src/reader.c (grammar_current_rule_prec_set)
13928 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
13929 Standardize error messages.
13930 And s/@prec/%prec/!
13931 (reader): Use trace_flag to enable scanner/parser debugging,
13932 instead of an adhoc scheme.
13933 * src/scan-gram.l: Remove trailing debugging code.
13934
13935 2002-10-16 Paul Eggert <eggert@twinsun.com>
13936
13937 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
13938 MUSCLE_TAB_H.
13939
13940 * NEWS: Officially drop support for building Bison with K&R C,
13941 since it didn't work anyway and it's not worth worrying about.
13942 * Makefile.maint (wget_files): Remove ansi2knr.c.
13943 (ansi2knr.c-url_prefix): Remove.
13944 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
13945 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
13946 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
13947
13948 2002-10-15 Paul Eggert <eggert@twinsun.com>
13949
13950 Stop using the "enum_" trick for K&R-style function definitions;
13951 it confused me, and I was the author! Instead, assume that people
13952 who want to use K&R C compilers (when using these modules in GCC,
13953 perhaps?) will run ansi2knr.
13954
13955 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
13956 All uses of "enum_" changed to "enum ".
13957 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
13958 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
13959
13960 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
13961 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
13962 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
13963 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
13964 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
13965 abitset_not, abitset_ones, abitset_or, abitset_or_and,
13966 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
13967 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
13968 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
13969 Use function prototypes; this removes the need for declaring
13970 static functions simply to provide their prototypes.
13971 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
13972 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
13973 bitset_count_, bitset_create, bitset_dump, bitset_first,
13974 bitset_free, bitset_init, bitset_last, bitset_next,
13975 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
13976 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
13977 bitset_print, bitset_release_memory, bitset_toggle_,
13978 bitset_type_choose, bitset_type_get, bitset_type_name_get,
13979 debug_bitset): Likewise.
13980 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
13981 * lib/bitset_stats.c (bitset_log_histogram_print,
13982 bitset_percent_histogram_print, bitset_stats_and,
13983 bitset_stats_and_cmp, bitset_stats_and_or,
13984 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
13985 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
13986 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
13987 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
13988 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
13989 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
13990 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
13991 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
13992 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
13993 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
13994 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
13995 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
13996 bitset_stats_zero): Likewise.
13997 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
13998 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
13999 bitsetv_dump, debug_bitsetv): Likewise.
14000 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
14001 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
14002 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
14003 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
14004 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
14005 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
14006 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
14007 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
14008 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
14009 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
14010 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
14011 Likewise.
14012 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
14013 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
14014 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
14015 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
14016 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
14017 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
14018 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
14019 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
14020 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
14021 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
14022 lbitset_xor_cmp, lbitset_zero): Likewise.
14023
14024 2002-10-14 Akim Demaille <akim@epita.fr>
14025
14026 Version 1.75.
14027
14028 2002-10-14 Akim Demaille <akim@epita.fr>
14029
14030 * tests/Makefile.am (maintainer-check-posix): New.
14031
14032 2002-10-14 Akim Demaille <akim@epita.fr>
14033
14034 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
14035 member.
14036
14037 2002-10-14 Akim Demaille <akim@epita.fr>
14038
14039 * src/tables.c (table_ninf_remap): base -> tab.
14040 Reported by Matt Rosing.
14041
14042 2002-10-14 Paul Eggert <eggert@twinsun.com>
14043
14044 * tests/action.at, tests/calc.at, tests/conflicts.at,
14045 tests/cxx-type.at, tests/headers.at, tests/input.at,
14046 tests/regression.at, tests/synclines.at, tests/torture.at:
14047 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
14048 so that the tests still work even if POSIXLY_CORRECT is set.
14049 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
14050
14051 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
14052 for portability to K&R hosts. Fix typo: signed char is guaranteed
14053 only to 127, not to 128.
14054 * data/glr.c (yysigned_char): New type.
14055 * data/yacc.c (yysigned_char): Likewise.
14056 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
14057
14058 2002-10-13 Paul Eggert <eggert@twinsun.com>
14059
14060 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
14061 true due to limited range of data type" warning from GCC.
14062
14063 * data/c.m4 (b4_token_defines): Protect against double-inclusion
14064 by wrapping enum yytokentype's definition inside #ifndef
14065 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
14066
14067 2002-10-13 Akim Demaille <akim@epita.fr>
14068
14069 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
14070 Un yy- yyrhs to avoid the name clash with the global YYRHS.
14071
14072 2002-10-13 Akim Demaille <akim@epita.fr>
14073
14074 * Makefile.maint: Update from Autoconf 2.54.
14075 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
14076
14077 2002-10-13 Akim Demaille <akim@epita.fr>
14078
14079 * src/print.c (print_state): Separate the list of solved conflicts
14080 from the other items.
14081 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
14082
14083 2002-10-13 Akim Demaille <akim@epita.fr>
14084
14085 Let nondeterministic skeletons be usable with deterministic
14086 tables.
14087
14088 With the patch, GAWK compiled by GCC without -O2 passes its test
14089 suite using a GLR parser driven by LALR tables. It fails with -O2
14090 because `struct stat' gives two different answers on my machine:
14091 88 (definition of an auto var) and later 96 (memset on this var).
14092 Hence the stack is badly corrumpted. The headers inclusion is to
14093 blame: if I move the awk.h inclusion before GLR's system header
14094 inclusion, the two struct stat have the same size.
14095
14096 * src/tables.c (pack_table): Always create conflict_table.
14097 (token_actions): Always create conflict_list.
14098 * data/glr.c (YYFLAG): Remove, unused.
14099
14100 2002-10-13 Akim Demaille <akim@epita.fr>
14101
14102 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
14103 (O0FLAGS): New.
14104 (VALGRIND, GXX): New.
14105 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
14106 * tests/bison.in: Run $PREBISON a pre-command.
14107 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
14108 (maintainer-check-g++): New.
14109 * Makefile.am (maintainer-check): New.
14110
14111 2002-10-13 Akim Demaille <akim@epita.fr>
14112
14113 * data/glr.c: Formatting changes.
14114 Tweak some trace messages to match yacc.c's.
14115
14116 2002-10-13 Akim Demaille <akim@epita.fr>
14117
14118 GLR parsers sometimes raise parse errors instead of performing the
14119 default reduction.
14120 Reported by Charles-Henry de Boysson.
14121
14122 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
14123 check the length of the traces when %glr.
14124 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
14125 GLR's traces.
14126 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
14127 Test GLR parsers.
14128 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
14129 (yyltype): Remove the yy prefix from the member names.
14130 (yytable): Complete its comment.
14131 (yygetLRActions): Map error action number from YYTABLE from
14132 YYTABLE_NINF to 0.
14133 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
14134 (which was a bug: it should have been YYTABEL_NINF, and yet it was
14135 not satisfying as we could compare an YYACTION computed from
14136 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
14137 only value for error actions.
14138 (yyreportParseError): In verbose parse error messages, don't issue
14139 `error' in the list of expected tokens.
14140 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
14141 next action to perform to match glr.c's decoding.
14142 (yytable): Complete its comment.
14143
14144 2002-10-13 Paul Eggert <eggert@twinsun.com>
14145
14146 Fix problem reported by Henrik Grubbstroem in
14147 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
14148 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
14149 because the Bison parser reads the second action before reducing
14150 the first one.
14151 * src/scan-gram.l (rule_length): New static var.
14152 Use it to keep track of the rule length in the scanner, since
14153 we can't expect the parser to be in lock-step sync with the scanner.
14154 (handle_action_dollar, handle_action_at): Use this var.
14155 * tests/actions.at (Exotic Dollars): Test for the problem.
14156
14157 2002-10-12 Paul Eggert <eggert@twinsun.com>
14158
14159 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
14160 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
14161 Include <sys/time.h> when checking for clock_t and struct tms.
14162 Use same include order as source.
14163 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
14164 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
14165
14166 * lib/timevar.c: Update copyright date and clarify comments.
14167 (get_time) [IN_GCC]: Keep the GCC version for reference.
14168
14169 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
14170 GCC version as of today, then merge Bison's changes.
14171 Change "GCC" to "Bison" in copyright notice. timevar.def's
14172 author is Akim, so change that too.
14173
14174 * src/reader.c (grammar_current_rule_check):
14175 Don't worry about the default action if $$ is untyped.
14176 Prevents bogus warnings reported by Jim Gifford in
14177 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
14178
14179 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
14180 * data/glr.c, data/lalr1.cc, data/yacc.c:
14181 Output token definitions before the first part of user declarations.
14182 Fixes compatibility problem reported by Jim Gifford for kbd in
14183 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14184
14185 2002-10-11 Paul Eggert <eggert@twinsun.com>
14186
14187 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
14188 (yyparse): here. This undoes some of the 2002-07-25 change.
14189 Compatibility problem reported by Ralf S. Engelschall with
14190 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
14191
14192 2002-10-11 Akim Demaille <akim@epita.fr>
14193
14194 * tests/regression.at Characters Escapes): New.
14195 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
14196 characters.
14197 Reported by Jan Nieuwenhuizen.
14198
14199 2002-10-11 Akim Demaille <akim@epita.fr>
14200
14201 * po/id.po: New.
14202
14203 2002-10-10 Paul Eggert <eggert@twinsun.com>
14204
14205 Portability fixes for bitsets; this also avoids several GCC
14206 warnings.
14207
14208 * lib/abitset.c: Include <stddef.h>, for offsetof.
14209 * lib/lbitset.c: Likewise.
14210
14211 * lib/abitset.c (abitset_bytes): Return a size that is aligned
14212 properly for vectors of objects. Do not assume that adding a
14213 header size to a multiple of a word size yields a value that is
14214 properly aligned for the whole union.
14215 * lib/bitsetv.c (bitsetv_alloc): Likewise.
14216
14217 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
14218 unique names for structures.
14219 * lib/ebitset.c (ebitset_bytes): Likewise.
14220 * lib/lbitset.c (lbitset_bytes): Likewise.
14221
14222 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
14223 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
14224 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
14225 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
14226 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
14227 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
14228 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
14229 to improve the type-checking that GCC can do.
14230 * lib/bitset.c (bitset_op4_cmp): Likewise.
14231 * lib/bitset_stats.c (bitset_stats_count,
14232 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
14233 bitset_stats_copy, bitset_stats_disjoint_p,
14234 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
14235 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
14236 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
14237 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
14238 bitset_stats_and_or_cmp, bitset_stats_andn_or,
14239 bitset_stats_andn_or_cmp, bitset_stats_or_and,
14240 bitset_stats_or_and_cmp): Likewise.
14241 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
14242 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
14243 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
14244 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
14245
14246 * lib/abitset.h: Include bitset.h, not bbitset.h.
14247 * lib/ebitset.h: Likewise.
14248 * lib/lbitset.h: Likewise.
14249
14250 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
14251 All instances of parameters of type enum bitset_opts are now of
14252 type enum_bitset_opts, to conform to the C Standard, and similarly
14253 for enum_bitset_type.
14254 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
14255 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
14256
14257 Do not use "struct bitset_struct" to mean different things in
14258 different modules. Not only is this confusing, it violates
14259 the C Standard, which requires that structure types in different
14260 modules must be compatible if one is to be passed to the other.
14261 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
14262 All instances of "struct bitset_struct *" replaced with "bitset".
14263 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
14264 (union bitset_union, struct abitset_struct, struct ebitset_struct,
14265 struct lbitset_struct, struct bitset_stats_struct): New types.
14266 All uses of struct bitset_struct changed to union bitset_union,
14267 etc.
14268 * lib/abitset.c (struct abitset_struct, abitset,
14269 struct bitset_struct): Remove.
14270 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
14271 struct bitset_struct): Remove.
14272 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
14273 bitset_struct): Remove.
14274 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
14275 Likewise.
14276
14277 Do not call a function of type T using a call that assumes the
14278 function is of a different type U. Standard C requires that a
14279 function must be called with a type that is compatible with its
14280 definition.
14281 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
14282 New decls.
14283 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
14284 New functions.
14285 * lib/ebitset.c (PFV): Remove.
14286 * lib/lbitset.c (PFV): Likewise.
14287 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
14288 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
14289 decls.
14290 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
14291 (ebitset_vtable): Use them.
14292 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
14293 lbitset_xor): New functions.
14294 (lbitset_vtable): Use them.
14295
14296 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
14297 Declare.
14298
14299 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
14300 GCC warning.
14301 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
14302 Use offsetof, for simplicity.
14303
14304 2002-10-06 Paul Eggert <eggert@twinsun.com>
14305
14306 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
14307 the same width as int. This reapplies a hunk of the 2002-08-12 patch
14308 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
14309 which was inadvertently undone by the 2002-09-30 patch.
14310 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
14311 the same width as int.
14312
14313 2002-10-04 Paul Eggert <eggert@twinsun.com>
14314
14315 Version 1.50.
14316
14317 * configure.ac (AC_INIT), NEWS: Increment version number.
14318
14319 * doc/bison.texinfo: Minor spelling, grammar, and white space
14320 fixes.
14321 (Symbols): Mention that any negative value returned from yylex
14322 signifies end-of-input. Warn about negative chars. Mention
14323 the portable Standard C character set.
14324
14325 The GNU coding standard says CFLAGS and YFLAGS are reserved
14326 for the installer to set.
14327 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
14328 * src/Makefile.am (AM_CFLAGS): Likewise.
14329 (AM_YFLAGS): Renamed from YFLAGS.
14330
14331 Fix some MAX and MIN problems.
14332 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
14333 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
14334 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
14335 * src/reader.c (reader): Use it.
14336
14337 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
14338 POSIX 1003.1-2001 has removed fgrep.
14339
14340 2002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
14341
14342 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
14343 interpreted as signed.
14344 * lib/ebitset.c (ebitset_list): Fix bug.
14345
14346 2002-10-01 Paul Eggert <eggert@twinsun.com>
14347
14348 More fixes for 64-bit hosts and large bitsets.
14349
14350 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
14351 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
14352 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
14353 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
14354 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
14355 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
14356 bitset_count_): Likewise.
14357 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
14358 bitset_first, bitset_last): Likewise.
14359 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
14360 bitset_stats_list_reverse, bitset_stats_size,
14361 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
14362 Likewise.
14363 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
14364 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
14365 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
14366 bitsetv_reflexive_transitive_closure): Likewise.
14367 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
14368 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
14369 Likewise.
14370 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
14371 Likewise.
14372
14373 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
14374 Use size_t, not unsigned int, to count bytes.
14375 * lib/abitset.h (abitset_bytes): Likewise.
14376 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
14377 Likewise.
14378 * lib/bitset.h (bitset_bytes): Likewise.
14379 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
14380 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
14381 * lib/bitsetv.c (bitsetv_alloc): Likewise.
14382 * lib/ebitset.c (ebitset_bytes): Likewise.
14383 * lib/ebitset.h (ebitset_bytes): Likewise.
14384 * lib/lbitset.c (lbitset_bytes): Likewise.
14385 * lib/lbitset.h (lbitset_bytes): Likewise.
14386
14387 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
14388 abitset_subset_p, abitset_disjoint_p, abitset_and,
14389 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
14390 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
14391 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
14392 abitset_or_and, abitset_or_and_cmp):
14393 Use bitset_windex instead of unsigned int.
14394 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
14395 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
14396 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
14397 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
14398 Likewise.
14399 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
14400
14401 * lib/bitset.c (bitset_print):
14402 Use proper printf formats for widths of integer types.
14403 * lib/bitset_stats.c (bitset_percent_histogram_print,
14404 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
14405 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
14406 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
14407 * lib/lbitset.c (lbitset_bytes): Likewise.
14408
14409 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
14410 BITSET_SIZE_MAX): New macros.
14411 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
14412 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
14413 to BITSET_WINDEX_MAX.
14414
14415 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
14416 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
14417 since we now return the bitset_bindex type (not int).
14418
14419 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
14420 when computing sizes.
14421 * lib/ebitset.c (ebitset_elts_grow): Likewise.
14422
14423 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
14424 and avoid cast to unsigned.
14425
14426 2002-09-30 Akim Demaille <akim@epita.fr>
14427
14428 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
14429 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
14430 Updates from Michael Hayes.
14431
14432 2002-09-30 Art Haas <ahaas@neosoft.com>
14433
14434 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
14435 invocations.
14436 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
14437 defined.
14438
14439 2002-09-27 Akim Demaille <akim@epita.fr>
14440
14441 Version 1.49c.
14442
14443 2002-09-27 Akim Demaille <akim@epita.fr>
14444
14445 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
14446 (Because of AC_LIBSOURCE).
14447
14448 2002-09-27 Akim Demaille <akim@epita.fr>
14449
14450 Playing with Autoscan.
14451
14452 * configure.ac: Remove the old LIBOBJ tweaks.
14453 (AC_REPLACE_FUNCS): Add strrchr and strtol.
14454 * lib/strrchr.c: New.
14455 * lib/strtol.c: New, from the Coreutils 4.5.1.
14456
14457 2002-09-27 Akim Demaille <akim@epita.fr>
14458
14459 Playing with Autoscan.
14460
14461 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
14462 * lib/Makefile.am (libbison_a_SOURCES): No longer include
14463 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
14464 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
14465 Coreutils 4.5.1.
14466
14467 2002-09-24 Akim Demaille <akim@epita.fr>
14468
14469 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
14470 (Frequently Asked Questions, Parser Stack Overflow): New.
14471
14472 2002-09-13 Akim Demaille <akim@epita.fr>
14473
14474 Playing with autoscan.
14475
14476 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
14477 * src/files.c (skeleton_find): Remove, unused.
14478 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
14479 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
14480
14481 2002-09-13 Akim Demaille <akim@epita.fr>
14482
14483 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
14484 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
14485
14486 2002-09-13 Akim Demaille <akim@epita.fr>
14487
14488 * configure.ac: Require 2.54.
14489 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
14490 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
14491 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
14492 Remove, provided by Autoconf macros.
14493
14494 2002-09-12 Akim Demaille <akim@epita.fr>
14495
14496 * m4/prereq.m4: Update, from Coreutils 4.5.1.
14497
14498 2002-09-12 Akim Demaille <akim@epita.fr>
14499
14500 * m4/prereq.m4: Update, from Fileutils 4.1.5.
14501 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
14502 Reported by Martin Mokrejs.
14503
14504 2002-09-10 Akim Demaille <akim@epita.fr>
14505
14506 * src/parse-gram.y: Associate a human readable string to each
14507 token type.
14508 * tests/regression.at (Invalid inputs): Adjust.
14509
14510 2002-09-10 Gary V. Vaughan <gary@gnu.org>
14511
14512 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
14513 with an Autoconf-2.5x style configure.ac.
14514
14515 2002-09-06 Paul Eggert <eggert@twinsun.com>
14516
14517 * doc/bison.texinfo (Conditions): Make explicit that the GPL
14518 exception applies only to yacc.c. This is a modification of a
14519 patch originally suggested by Akim Demaille.
14520
14521 2002-09-06 Akim Demaille <akim@epita.fr>
14522
14523 * data/c.m4 (b4_copyright): Move the GPL exception comment from
14524 here to...
14525 * data/yacc.c: here.
14526
14527 * data/lalr1.cc (struct yyltype): Don't define it, since we use
14528 LocationType.
14529 (b4_ltype): Default to yy::Location from location.hh.
14530
14531 2002-09-04 Jim Meyering <jim@meyering.net>
14532
14533 * data/yacc.c: Guard the declaration of yytoknum also with
14534 `#ifdef YYPRINT', so it is declared only when used.
14535
14536 2002-09-04 Akim Demaille <akim@epita.fr>
14537
14538 * configure.in: Rename as...
14539 * configure.ac: this.
14540 Bump to 1.49c.
14541
14542 2002-09-04 Akim Demaille <akim@epita.fr>
14543
14544 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
14545 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
14546 translate maintainer only messages.
14547
14548 2002-08-12 Paul Eggert <eggert@twinsun.com>
14549
14550 Version 1.49b.
14551
14552 * Makefile.am (SUBDIRS): Remove intl.
14553 (DISTCLEANFILES): Remove.
14554 * NEWS: Mention that GNU M4 is now required. Clarify what is
14555 meant by "larger grammars". Mention the pt_BR translation.
14556 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
14557 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
14558 Bump version from 0.11.2 to 0.11.5.
14559 (BISON_PREREQ_STAGE): Remove.
14560 (AM_GNU_GETTEXT): Use external gettext.
14561 (AC_OUTPUT): Remove intl/Makefile.
14562
14563 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
14564
14565 * data/glr.c: Include string.h, for strlen.
14566 (yyreportParseError): Use size_t for yysize.
14567 (yy_yypstack): No longer nested inside yypstates, as nested
14568 functions are not portable. Do not assume size_t is the
14569 same width as int.
14570 (yypstates): Do not assume that ptrdiff_t is the same width
14571 as int, and similarly for yyposn and YYINDEX.
14572
14573 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
14574
14575 * lib/Makefile.am (INCLUDES): Do not include from the intl
14576 directory, which has been removed.
14577 * src/Makefile.am (INCLUDES): Likewise.
14578
14579 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
14580 (bitsets_sources, additional_bitsets_sources, timevars_sources):
14581 New vars.
14582
14583 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
14584 * tests/Makefile.am (EXTRA_DIST): Likewise.
14585
14586 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
14587 Do not assume that bitset_windex is the same width as unsigned.
14588
14589 * lib/abitset.c (abitset_unused_clear): Do not assume that
14590 bitset_word is the same width as int.
14591 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
14592 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
14593 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
14594 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
14595 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
14596
14597 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
14598 portability to one's complement hosts!).
14599 * lib/ebitset.c (ebitset_op1): Likewise.
14600 * lib/lbitset.c (lbitset_op1): Likewise.
14601
14602 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
14603 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
14604 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
14605 Sync with fileutils.
14606 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
14607 lib/gettext.h: Sync with diffutils.
14608
14609 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
14610 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
14611
14612 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
14613 PROTOTYPES to check for prototypes, and "defined __STDC__" to
14614 check for void *.
14615
14616 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
14617 size_t; the old version tried to do this but casted improperly.
14618 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
14619 (bitset_test): Now returns int, not unsigned long.
14620
14621 * lib/bitset_stats.c: Include "gettext.h".
14622 (_): New macro.
14623 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
14624 name locals "index", as it generates unnecessary warnings on some
14625 hosts that have an "index" function.
14626
14627 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
14628 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
14629 they need translation.
14630 * src/LR0.c (state_list_append, new_itemsets, get_state,
14631 append_states, generate_states): Likewise.
14632 * src/assoc.c (assoc_to_string): Likewise.
14633 * src/closure.c (print_closure, set_firsts, closure): Likewise.
14634 * src/gram.c (grammar_dump): Likewise.
14635 * src/injections.c (injections_compute): Likewise.
14636 * src/lalr.c (lookaheads_print): Likewise.
14637 * src/relation.c (relation_transpose): Likewise.
14638 * src/scan-gram.l: Likewise.
14639 * src/tables.c (table_grow, pack_vector): Likewise.
14640
14641 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
14642 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
14643 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
14644 * m4/mbstate_t.m4: Sync with fileutils.
14645 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
14646
14647 * po/LINGUAS: Add pt_BR.
14648 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
14649 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
14650 lib/timevar.c.
14651 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
14652 manual recommends.
14653 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
14654
14655 * src/complain.c (strerror_r): Remove decl; not needed.
14656 (strerror): Use same pattern as ../lib/error.c.
14657
14658 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
14659
14660 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
14661
14662 * src/main.c (main): Cast result of bindtextdomain and textdomain
14663 to void, to avoid a GCC warning when --disable-nls is in effect.
14664
14665 * src/scan-gram.l: Use strings rather than escapes when possible,
14666 to minimize the number of warnings from xgettext.
14667 (handle_action_dollar, handle_action_at): Don't use isdigit,
14668 as it mishandles negative chars and it may not work as expected
14669 outside the C locale.
14670
14671 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
14672 this is a GCC extension and is not portable to other compilers.
14673
14674 * src/system.h (alloca): Use same pattern as ../lib/error.c.
14675 Do not include <ctype.h>; no longer needed.
14676 Do not include <malloc.h>; no longer needed (and generates
14677 warnings on OpenBSD 3.0).
14678
14679 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
14680 it's not portable.
14681
14682 * tests/regression.at: Do not use 'cc -c input.c -o input';
14683 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
14684
14685 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
14686 exit status as failure, not just exit status 1. Sun C exits
14687 with status 2 sometimes.
14688
14689 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
14690 Use it for the two large tests.
14691
14692 2002-08-02 Akim Demaille <akim@epita.fr>
14693
14694 * src/conflicts.c (conflicts_output): Don't output rules never
14695 reduced here, since anyway that computation doesn't work.
14696 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
14697 (rule_useless_p, rule_never_reduced_p): New.
14698 (grammar_rules_partial_print): Use a filter instead of a range.
14699 Display the title only if needed.
14700 (grammar_rules_print): Adjust.
14701 (grammar_rules_never_reduced_report): New.
14702 * src/tables.c (action_row): Move the computation of rules never
14703 reduced to...
14704 (token_actions): here.
14705 * src/main.c (main): Make the parser before making the report, so
14706 that rules never reduced are computed.
14707 Call grammar_rules_never_reduced_report.
14708 * src/print.c (print_results): Report rules never reduced.
14709 * tests/conflicts.at, tests/reduce.at: Adjust.
14710
14711 2002-08-01 Akim Demaille <akim@epita.fr>
14712
14713 Instead of attaching lookaheads and duplicating the rules being
14714 reduced by a state, attach the lookaheads to the reductions.
14715
14716 * src/state.h (state_t): Remove the `lookaheads',
14717 `lookaheads_rule' member.
14718 (reductions_t): Add a `lookaheads' member.
14719 Use a regular array for the `rules'.
14720 * src/state.c (reductions_new): Initialize the lookaheads member
14721 to 0.
14722 (state_rule_lookaheads_print): Adjust.
14723 * src/state.h, src/state.c (state_reductions_find): New.
14724 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
14725 (count_rr_conflicts): Adjust.
14726 * src/lalr.c (LArule): Remove.
14727 (add_lookback_edge): Adjust.
14728 (state_lookaheads_count): New.
14729 (states_lookaheads_initialize): Merge into...
14730 (initialize_LA): this.
14731 (lalr_free): Adjust.
14732 * src/main.c (main): Don't free nullable and derives too early: it
14733 is used by --verbose.
14734 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
14735
14736 2002-08-01 Akim Demaille <akim@epita.fr>
14737
14738 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
14739 `rule_number_t**'.
14740 (set_derives, free_derives): Rename as...
14741 (derives_compute, derives_free): this.
14742 Adjust all dependencies.
14743 * src/nullable.c (set_nullable, free_nullable): Rename as...
14744 (nullable_compute, nullable_free): these.
14745 (rule_list_t): Store rule_t *, not rule_number_t.
14746 * src/state.c (state_rule_lookaheads_print): Directly compare rule
14747 pointers, instead of their numbers.
14748 * src/main.c (main): Call nullable_free, and derives_free earlier,
14749 as they were lo longer used.
14750
14751 2002-08-01 Akim Demaille <akim@epita.fr>
14752
14753 * lib/timevar.c (get_time): Include children time.
14754 * src/lalr.h (LA, LArule): Don't export them: used with the
14755 state_t.
14756 * src/lalr.c (LA, LArule): Static.
14757 * src/lalr.h, src/lalr.c (lalr_free): New.
14758 * src/main.c (main): Call it.
14759 * src/tables.c (pack_vector): Check whether loc is >= to the
14760 table_size, not >.
14761 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
14762 (tables_generate): do it, since that's also it which allocates
14763 them.
14764 Don't free LA and LArule, main does.
14765
14766 2002-07-31 Akim Demaille <akim@epita.fr>
14767
14768 Separate parser tables computation and output.
14769
14770 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
14771 (conflict_list, conflict_list_cnt, table, check, table_ninf)
14772 (yydefgoto, yydefact, high): Move to...
14773 * src/tables.h, src/tables.c: here.
14774 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
14775 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
14776 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
14777 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
14778 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
14779 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
14780 (action_row, save_row, token_actions, save_column, default_goto)
14781 (goto_actions, sort_actions, matching_state, pack_vector)
14782 (table_ninf_remap, pack_table, prepare_actions): Move to...
14783 * src/tables.c: here.
14784 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
14785 * src/output.c (token_actions, output_base, output_conflicts)
14786 (output_check): Merge into...
14787 (prepare_actions): this.
14788 (actions_output): Rename as...
14789 (user_actions_output): this.
14790 * src/main.c (main): Call tables_generate and tables_free.
14791
14792 2002-07-31 Akim Demaille <akim@epita.fr>
14793
14794 Steal GCC's --time-report support.
14795
14796 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
14797 stolen/adjusted from GCC.
14798 * m4/stage.m4: Remove time related checks.
14799 * m4/timevar.m4: New.
14800 * configure.in: Adjust.
14801 * src/system.h: Adjust to using timevar.h.
14802 * src/getargs.h, src/getargs.c: Support trace_time for
14803 --trace=time.
14804 * src/main.c (stage): Remove.
14805 (main): Replace `stage' invocations with timevar calls.
14806 * src/output.c: Insert pertinent timevar calls.
14807
14808 2002-07-31 Akim Demaille <akim@epita.fr>
14809
14810 Let --trace have arguments.
14811
14812 * src/getargs.h (enum trace_e): New.
14813 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
14814 (long_options, short_options): --trace/-T takes an optional
14815 argument.
14816 Change all the uses of trace_flag to reflect the new flags.
14817 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
14818
14819 Strengthen `stage' portability.
14820
14821 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
14822 * configure.in: Use it.
14823 Don't check for malloc.h and sys/times.h.
14824 * src/system.h: Include them when appropriate.
14825 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
14826 times and struct tms are available.
14827
14828 2002-07-30 Akim Demaille <akim@epita.fr>
14829
14830 In verbose parse error message, don't report `error' as an
14831 expected token.
14832 * tests/actions.at (Printers and Destructors): Adjust.
14833 * tests/calc.at (Calculator $1): Adjust.
14834 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
14835 error message, do not report the parser accepts the error token in
14836 that state.
14837
14838 2002-07-30 Akim Demaille <akim@epita.fr>
14839
14840 Normalize conflict related messages.
14841
14842 * src/complain.h, src/complain.c (warn, complain): New.
14843 * src/conflicts.c (conflicts_print): Use them.
14844 (conflict_report_yacc): New, extracted from...
14845 (conflicts_print): here.
14846 * tests/conflicts.at, tests/existing.at: Adjust.
14847
14848 2002-07-30 Akim Demaille <akim@epita.fr>
14849
14850 Report rules which are never reduced by the parser: those hidden
14851 by conflicts.
14852
14853 * src/LR0.c (save_reductions): Don't make the final state too
14854 different: save its reduction (accept) instead of having a state
14855 without any action (no shift or goto, no reduce).
14856 Note: the final state is now a ``regular'' state, i.e., the
14857 parsers now contain `reduce 0' as default reduction.
14858 Nevertheless, since they decide to `accept' when yystate =
14859 final_state, they still will not reduce rule 0.
14860 * src/print.c (print_actions, print_reduction): Adjust.
14861 * src/output.c (action_row): Track reduced rules.
14862 (token_actions): Report rules never reduced.
14863 * tests/conflicts.at, tests/regression.at: Adjust.
14864
14865 2002-07-30 Akim Demaille <akim@epita.fr>
14866
14867 `stage' was accidently included in a previous patch.
14868 Initiate its autoconfiscation.
14869
14870 * configure.in: Look for malloc.h and sys/times.h.
14871 * src/main.c (stage): Adjust.
14872 Report only when trace_flag.
14873
14874 2002-07-29 Akim Demaille <akim@epita.fr>
14875
14876 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
14877 state_number_t.
14878 (errs_t): symbol_t*, not symbol_number_t.
14879 (reductions_t): rule_t*, not rule_number_t.
14880 (FOR_EACH_SHIFT): New.
14881 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
14882 * src/print.c, src/print_graph.c: Adjust.
14883
14884 2002-07-29 Akim Demaille <akim@epita.fr>
14885
14886 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
14887
14888 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
14889 (endtoken, accept): these.
14890 * src/reader.c (reader): Set endtoken's default tag to "$end".
14891 Set undeftoken's tag to "$undefined" instead of "$undefined.".
14892 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
14893 Adjust.
14894
14895 2002-07-29 Akim Demaille <akim@epita.fr>
14896
14897 * src/reduce.c (reduce_grammar): When the language is empty,
14898 complain about the start symbol, not the axiom.
14899 Use its location.
14900 * tests/reduce.at (Empty Language): New.
14901
14902 2002-07-26 Akim Demaille <akim@epita.fr>
14903
14904 * src/reader.h, src/reader.c (gram_error): ... can't get
14905 yycontrol without making too strong assumptions on the parser
14906 itself.
14907 * src/output.c (prepare_tokens): Use the real 0th value of
14908 token_translations instead of `0'.
14909 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
14910 visible here.
14911 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
14912 for the time being: %locations ought to provide it to yyerror.
14913
14914 2002-07-25 Akim Demaille <akim@epita.fr>
14915
14916 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
14917 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
14918 * tests/regression.at (Web2c Actions): Adjust.
14919
14920 2002-07-25 Akim Demaille <akim@epita.fr>
14921
14922 Stop storing rules from 1 to nrules + 1.
14923
14924 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
14925 * src/nullable.c, src/output.c, src/print.c, src/reader.c
14926 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
14927 Iterate from 0 to nrules.
14928 Use rule_number_as_item_number and item_number_as_rule_number.
14929 Adjust to `derive' now containing possibly 0.
14930 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
14931 Handle the `- 1' part in rule numbers from/to item numbers.
14932 * src/conflicts.c (log_resolution): Fix the message which reversed
14933 shift and reduce.
14934 * src/output.c (action_row): Initialize default_rule to -1.
14935 (token_actions): Adjust.
14936 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
14937 expected output.
14938 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
14939
14940 2002-07-25 Akim Demaille <akim@epita.fr>
14941
14942 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
14943 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
14944 (b4_c_knr_arg_decl): New.
14945 * data/yacc.c: Use it to define yysymprint, yydestruct, and
14946 yyreport_parse_error.
14947
14948 2002-07-25 Akim Demaille <akim@epita.fr>
14949
14950 * data/yacc.c (yyreport_parse_error): New, extracted from...
14951 (yyparse): here.
14952 (yydestruct, yysymprint): Move above yyparse.
14953 Be K&R compliant.
14954
14955 2002-07-25 Akim Demaille <akim@epita.fr>
14956
14957 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
14958 replace...
14959 (b4_sint_type, b4_uint_type): these.
14960 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
14961 * tests/regression.at (Web2c Actions): Adjust.
14962
14963 2002-07-25 Akim Demaille <akim@epita.fr>
14964
14965 * src/gram.h (TIEM_NUMBER_MAX): New.
14966 (item_number_of_rule_number, rule_number_of_item_number): Rename
14967 as...
14968 (rule_number_as_item_number, item_number_as_rule_number): these.
14969 Adjust dependencies.
14970 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
14971 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
14972 (symbol_number_to_vector_number): New.
14973 (order): Of vector_number_t* type.
14974 (base_t, BASE_MAX, BASE_MIN): New.
14975 (froms, tos, width, pos, check): Of base_t type.
14976 (action_number_t, ACTION_MIN, ACTION_MAX): New.
14977 (actrow): Of action_number_t type.
14978 (conflrow): Of unsigned int type.
14979 (table_ninf, base_ninf): New.
14980 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
14981 (muscle_insert_int_table, muscle_insert_base_table)
14982 (muscle_insert_rule_number_table): New.
14983 (prepare_tokens): Output `toknum' as int_table.
14984 (action_row): Returns a rule_number_t.
14985 Use ACTION_MIN, not SHRT_MIN.
14986 (token_actions): yydefact is rule_number_t*.
14987 (table_ninf_remap): New.
14988 (pack_table): Use it for `base' and `table'.
14989 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
14990 replaced with...
14991 (YYPACT_NINF, YYTABLE_NINF): these.
14992 (yypact, yytable): Compute their types instead of hard-coded
14993 `short'.
14994 * tests/regression.at (Web2c Actions): Adjust.
14995
14996 2002-07-19 Akim Demaille <akim@epita.fr>
14997
14998 * src/scan-gram.l (id): Can start with an underscore.
14999
15000 2002-07-16 Akim Demaille <akim@epita.fr>
15001
15002 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
15003 Adjust all former `associativity' dependencies.
15004 * src/symtab.c (symbol_new): Default associativity is `undef', not
15005 `right'.
15006 (symbol_check_alias_consistence): Adjust.
15007
15008 2002-07-09 Akim Demaille <akim@epita.fr>
15009
15010 * doc/bison.texinfo: Properly set the ``header'' part.
15011 Use @dircategory ``GNU programming tools'' as per Texinfo's
15012 documentation.
15013 Use @copying.
15014
15015 2002-07-09 Akim Demaille <akim@epita.fr>
15016
15017 * lib/quotearg.h: Protect against multiple inclusions.
15018 * src/location.h (location_t): Add a `file' member.
15019 (LOCATION_RESET, LOCATION_PRINT): Adjust.
15020 * src/complain.c (warn_at, complain_at, fatal_at): Drop
15021 `error_one_per_line' support.
15022
15023 2002-07-09 Akim Demaille <akim@epita.fr>
15024
15025 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
15026 * src/reader.c (lineno): Remove.
15027 Adjust all dependencies.
15028 (get_merge_function): Take a location and use complain_at.
15029 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
15030 * tests/regression.at (Invalid inputs, Mixing %token styles):
15031 Adjust.
15032
15033 2002-07-09 Akim Demaille <akim@epita.fr>
15034
15035 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
15036 recovery rule, and forbid extensions when --yacc.
15037 (gram_error): Use complain_at.
15038 * src/reader.c (reader): Exit if there were parse errors.
15039
15040 2002-07-09 Akim Demaille <akim@epita.fr>
15041
15042 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
15043 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
15044 Reported by R Blake <blakers@mac.com>.
15045
15046 2002-07-09 Akim Demaille <akim@epita.fr>
15047
15048 * data/yacc.c: Output the copyright notive in the header.
15049
15050 2002-07-03 Akim Demaille <akim@epita.fr>
15051
15052 * src/output.c (froms, tos): Are state_number_t.
15053 (save_column): sp, sp1, and sp2 are state_number_t.
15054 (prepare): Rename `final' as `final_state_number', `nnts' as
15055 `nterms_number', `nrules' as `rules_number', `nstates' as
15056 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
15057 unused.
15058 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
15059 * data/lalr1.cc (nsym_): Remove, unused.
15060
15061 2002-07-03 Akim Demaille <akim@epita.fr>
15062
15063 * src/lalr.h, src/lalr.c (goto_number_t): New.
15064 * src/lalr.c (goto_list_t): New.
15065 Propagate them.
15066 * src/nullable.c (rule_list_t): New.
15067 Propagate.
15068 * src/types.h: Remove.
15069
15070 2002-07-03 Akim Demaille <akim@epita.fr>
15071
15072 * src/closure.c (print_fderives): Use rule_rhs_print.
15073 * src/derives.c (print_derives): Use rule_rhs_print.
15074 (rule_list_t): New, replaces `shorts'.
15075 (set_derives): Add comments.
15076 * tests/sets.at (Nullable, Firsts): Adjust.
15077
15078 2002-07-03 Akim Demaille <akim@epita.fr>
15079
15080 * src/output.c (prepare_actions): Free `tally' and `width'.
15081 (prepare_actions): Allocate and free `order'.
15082 * src/symtab.c (symbols_free): Free `symbols'.
15083 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
15084 * src/output.c (m4_invoke): Move to...
15085 * src/scan-skel.l: here.
15086 (<<EOF>>): Close yyout, and free its name.
15087
15088 2002-07-03 Akim Demaille <akim@epita.fr>
15089
15090 Fix some memory leaks, and fix a bug: state 0 was examined twice.
15091
15092 * src/LR0.c (new_state): Merge into...
15093 (state_list_append): this.
15094 (new_states): Merge into...
15095 (generate_states): here.
15096 (set_states): Don't ensure a proper `errs' state member here, do it...
15097 * src/conflicts.c (conflicts_solve): here.
15098 * src/state.h, src/state.c: Comment changes.
15099 (state_t): Rename member `shifts' as `transitions'.
15100 Adjust all dependencies.
15101 (errs_new): For consistency, also take the values as argument.
15102 (errs_dup): Remove.
15103 (state_errs_set): New.
15104 (state_reductions_set, state_transitions_set): Assert that no
15105 previous value was assigned.
15106 (state_free): New.
15107 (states_free): Use it.
15108 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
15109 temporary storage: use `errs' and `nerrs' as elsewhere.
15110 (set_conflicts): Allocate and free this `errs'.
15111
15112 2002-07-02 Akim Demaille <akim@epita.fr>
15113
15114 * lib/libiberty.h: New.
15115 * lib: Update the bitset implementation from upstream.
15116 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
15117 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
15118 * src/main.c: Adjust bitset stats calls.
15119
15120 2002-07-01 Paul Eggert <eggert@twinsun.com>
15121
15122 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
15123 char, so that negative chars don't collide with $.
15124
15125 2002-06-30 Akim Demaille <akim@epita.fr>
15126
15127 Have the GLR tests be `warning' checked, and fix the warnings.
15128
15129 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
15130 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
15131 (yyremoveDeletes): `yyi' and `yyj' are size_t.
15132 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
15133 (yyaddDeferredAction): static.
15134 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
15135 (yyreportParseError): yyprefix is const.
15136 yytokenp is used only when verbose.
15137 (yy__GNUC__): Replace with __GNUC__.
15138 (yypdumpstack): yyi is size_t.
15139 (yypreference): Un-yy local variables and arguments, to avoid
15140 clashes with `yyr1'. Anyway, we are not in the user name space.
15141 (yytname_size): be an int, as is compared with ints.
15142 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
15143 Use them.
15144 * tests/cxx-gram.at: Use quotation to protect $1.
15145 Use AT_COMPILE to enable warnings hunts.
15146 Prototype yylex and yyerror.
15147 `Use' argc.
15148 Include `string.h', not `strings.h'.
15149 Produce and prototype stmtMerge only when used.
15150 yylex takes a location.
15151
15152 2002-06-30 Akim Demaille <akim@epita.fr>
15153
15154 We spend a lot of time in quotearg, in particular when --verbose.
15155
15156 * src/symtab.c (symbol_get): Store a quoted version of the key.
15157 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
15158 Adjust all callers.
15159
15160 2002-06-30 Akim Demaille <akim@epita.fr>
15161
15162 * src/state.h (reductions_t): Rename member `nreds' as num.
15163 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
15164 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
15165
15166 2002-06-30 Akim Demaille <akim@epita.fr>
15167
15168 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
15169 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
15170 (shifts_to): Rename as...
15171 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
15172 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
15173 (TRANSITION_IS_DISABLED, transitions_to): these.
15174
15175 2002-06-30 Akim Demaille <akim@epita.fr>
15176
15177 * src/print.c (print_shifts, print_gotos): Merge into...
15178 (print_transitions): this.
15179 (print_transitions, print_errs, print_reductions): Align the
15180 lookaheads columns.
15181 (print_core, print_transitions, print_errs, print_state,
15182 print_grammar): Output empty lines separator before, not after.
15183 (state_default_rule_compute): Rename as...
15184 (state_default_rule): this.
15185 * tests/conflicts.at (Defaulted Conflicted Reduction),
15186 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
15187 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
15188
15189 2002-06-30 Akim Demaille <akim@epita.fr>
15190
15191 Display items as we display rules.
15192
15193 * src/gram.h, src/gram.c (rule_lhs_print): New.
15194 * src/gram.c (grammar_rules_partial_print): Use it.
15195 * src/print.c (print_core): Likewise.
15196 * tests/conflicts.at (Defaulted Conflicted Reduction),
15197 (Unresolved SR Conflicts): Adjust.
15198 (Unresolved SR Conflicts): Adjust and rename as...
15199 (Resolved SR Conflicts): this, as was meant.
15200 * tests/regression.at (Web2c Report): Adjust.
15201
15202 2002-06-30 Akim Demaille <akim@epita.fr>
15203
15204 * src/print.c (state_default_rule_compute): New, extracted from...
15205 (print_reductions): here.
15206 Pessimize, but clarify the code.
15207 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
15208
15209 2002-06-30 Akim Demaille <akim@epita.fr>
15210
15211 * src/output.c (action_row): Let default_rule be always a rule
15212 number.
15213
15214 2002-06-30 Akim Demaille <akim@epita.fr>
15215
15216 * src/closure.c (print_firsts, print_fderives, closure):
15217 Use BITSET_EXECUTE.
15218 * src/lalr.c (lookaheads_print): Likewise.
15219 * src/state.c (state_rule_lookaheads_print): Likewise.
15220 * src/print_graph.c (print_core): Likewise.
15221 * src/print.c (print_reductions): Likewise.
15222 * src/output.c (action_row): Likewise.
15223 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
15224
15225 2002-06-30 Akim Demaille <akim@epita.fr>
15226
15227 * src/print_graph.c: Use report_flag.
15228
15229 2002-06-30 Akim Demaille <akim@epita.fr>
15230
15231 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
15232 to...
15233 * src/relation.h, src/relation.c (traverse, relation_digraph)
15234 (relation_print, relation_transpose): New.
15235
15236 2002-06-30 Akim Demaille <akim@epita.fr>
15237
15238 * src/state.h, src/state.c (shifts_to): New.
15239 * src/lalr.c (build_relations): Use it.
15240
15241 2002-06-30 Akim Demaille <akim@epita.fr>
15242
15243 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
15244 (item_number_of_rule_number, rule_number_of_item_number): New.
15245 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
15246 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
15247 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
15248 Propagate their use.
15249 Much remains to be done, in particular wrt `shorts' from types.h.
15250
15251 2002-06-30 Akim Demaille <akim@epita.fr>
15252
15253 * src/symtab.c (symbol_new): Initialize the `printer' member.
15254
15255 2002-06-30 Akim Demaille <akim@epita.fr>
15256
15257 * src/LR0.c (save_reductions): Remove, replaced by...
15258 * src/state.h, src/state.c (state_reductions_set): New.
15259 (reductions, errs): Rename as...
15260 (reductions_t, errs_t): these.
15261 Adjust all dependencies.
15262
15263 2002-06-30 Akim Demaille <akim@epita.fr>
15264
15265 * src/LR0.c (state_list_t, state_list_append): New.
15266 (first_state, last_state): Now symbol_list_t.
15267 (this_state): Remove.
15268 (new_itemsets, append_states, save_reductions): Take a state_t as
15269 argument.
15270 (set_states, generate_states): Adjust.
15271 (save_shifts): Remove, replaced by...
15272 * src/state.h, src/state.c (state_shifts_set): New.
15273 (shifts): Rename as...
15274 (shifts_t): this.
15275 Adjust all dependencies.
15276 * src/state.h (state_t): Remove the `next' member.
15277
15278 2002-06-30 Akim Demaille <akim@epita.fr>
15279
15280 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
15281 escaped in slot 0.
15282
15283 2002-06-30 Akim Demaille <akim@epita.fr>
15284
15285 Use hash.h for the state hash table.
15286
15287 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
15288 (allocate_storage): Use state_hash_new.
15289 (free_storage): Use state_hash_free.
15290 (new_state, get_state): Adjust.
15291 * src/lalr.h, src/lalr.c (states): Move to...
15292 * src/states.h (state_t): Remove the `link' member, no longer
15293 used.
15294 * src/states.h, src/states.c: here.
15295 (state_hash_new, state_hash_free, state_hash_lookup)
15296 (state_hash_insert, states_free): New.
15297 * src/states.c (state_table, state_compare, state_hash): New.
15298 * src/output.c (output_actions): Do not free states now, since we
15299 still need to know the final_state number in `prepare', called
15300 afterwards. Do it...
15301 * src/main.c (main): here: call states_free after `output'.
15302
15303 2002-06-30 Akim Demaille <akim@epita.fr>
15304
15305 * src/state.h, src/state.c (state_new): New, extracted from...
15306 * src/LR0.c (new_state): here.
15307 * src/state.h (STATE_ALLOC): Move to...
15308 * src/state.c: here.
15309 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
15310 * src/state.h, src/state.c: here.
15311
15312 2002-06-30 Akim Demaille <akim@epita.fr>
15313
15314 * src/reader.c (gensym): Rename as...
15315 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
15316 (getsym): Rename as...
15317 (symbol_get): this.
15318
15319 2002-06-30 Akim Demaille <akim@epita.fr>
15320
15321 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
15322 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
15323 * src/output.c, src/print.c, src/print_graph.c: Propagate.
15324 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
15325
15326 2002-06-30 Akim Demaille <akim@epita.fr>
15327
15328 Make the test suite pass with warnings checked.
15329
15330 * tests/actions.at (Printers and Destructors): Improve.
15331 Avoid unsigned vs. signed issues.
15332 * tests/calc.at: Don't exercise the scanner here, do it...
15333 * tests/input.at (Torturing the Scanner): here.
15334
15335 2002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15336
15337 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
15338 reorganize first lines parallel to yacc.c.
15339
15340 2002-06-28 Akim Demaille <akim@epita.fr>
15341
15342 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
15343 (b4_token_enum, b4_token_defines): New, factored from...
15344 * data/lalr1.cc, data/yacc.c, glr.c: here.
15345
15346 2002-06-28 Akim Demaille <akim@epita.fr>
15347
15348 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
15349 unused variables.
15350 * src/output.c (merger_output): static.
15351
15352 2002-06-28 Akim Demaille <akim@epita.fr>
15353
15354 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
15355 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
15356 pacify GCC.
15357 * src/output.c (save_row): Initialize all the variables to pacify GCC.
15358
15359 2002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15360
15361 Accumulated changelog for new GLR parsing features.
15362
15363 * src/conflicts.c (count_total_conflicts): Change name to
15364 conflicts_total_count.
15365 * src/conflicts.h: Ditto.
15366 * src/output.c (token_actions): Use the new name.
15367 (output_conflicts): Change conflp => conflict_list_heads, and
15368 confl => conflict_list for better readability.
15369 * data/glr.c: Use the new names.
15370 * NEWS: Add self to GLR announcement.
15371
15372 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
15373
15374 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
15375 Akim Demaille.
15376
15377 * data/bison.glr: Change name to glr.c
15378 * data/glr.c: Renamed from bison.glr.
15379 * data/Makefile.am: Add glr.c
15380
15381 * src/getargs.c:
15382
15383 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
15384 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
15385
15386 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15387
15388 * data/bison.glr: Be sure to restore the
15389 current #line when returning to the skeleton contents after having
15390 exposed the input file's #line.
15391
15392 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15393
15394 * data/bison.glr: Bring up to date with changes to bison.simple.
15395
15396 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15397
15398 * data/bison.glr: Correct definitions that use b4_prefix.
15399 Various reformatting.
15400 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
15401 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
15402 yytokenp argument; now part of stack.
15403 (yychar): Define to behave as documented.
15404 (yyclearin): Ditto.
15405
15406 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15407
15408 * src/reader.h: Add declaration for free_merger_functions.
15409
15410 * src/reader.c (merge_functions): New variable.
15411 (get_merge_function): New function.
15412 (free_merger_functions): New function.
15413 (readgram): Check for %prec that is not followed by a symbol.
15414 Handle %dprec and %merge declarations.
15415 (packgram): Initialize dprec and merger fields in rules array.
15416
15417 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
15418 conflict_list_cnt, conflict_list_free): New variables.
15419 (table_grow): Also grow conflict_table.
15420 (prepare_rules): Output dprec and merger tables.
15421 (conflict_row): New function.
15422 (action_row): Output conflict lists for GLR parser. Don't use
15423 default reduction in conflicted states for GLR parser so that there
15424 are spaces for the conflict lists.
15425 (save_row): Also save conflict information.
15426 (token_actions): Allocate conflict list.
15427 (merger_output): New function.
15428 (pack_vector): Pack conflict table, too.
15429 (output_conflicts): New function to output yyconflp and yyconfl.
15430 (output_check): Allocate conflict_tos.
15431 (output_actions): Output conflict tables, also.
15432 (output_skeleton): Output b4_mergers definition.
15433 (prepare): Output b4_max_rhs_length definition.
15434 Use 'bison.glr' as default skeleton for GLR parsers.
15435
15436 * src/gram.c (glr_parser): New flag.
15437 (grammar_free): Call free_merger_functions.
15438
15439 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
15440 all pairs of conflicting reductions, rather than just all tokens
15441 causing conflicts. Needed to size conflict tables.
15442 (conflicts_output): Modify call to count_rr_conflicts for new
15443 interface.
15444 (conflicts_print): Ditto.
15445 (count_total_conflicts): New function.
15446
15447 * src/reader.h (merger_list): New type.
15448 (merge_functions): New variable.
15449
15450 * src/lex.h (tok_dprec, tok_merge): New token types.
15451
15452 * src/gram.h (rule_s): Add dprec and merger fields.
15453 (glr_parser): New flag.
15454
15455 * src/conflicts.h (count_total_conflicts): New function.
15456
15457 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
15458
15459 * doc/bison.texinfo (Generalized LR Parsing): New section.
15460 (GLR Parsers): New section.
15461 (Language and Grammar): Mention GLR parsing.
15462 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
15463 Correct typo ("tge" -> "the").
15464
15465 * data/bison.glr: New skeleton for GLR parsing.
15466
15467 * tests/cxx-gram.at: New tests for GLR parsing.
15468
15469 * tests/testsuite.at: Include cxx-gram.at.
15470
15471 * tests/Makefile.am: Add cxx-gram.at.
15472
15473 * src/parse-gram.y:
15474
15475 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
15476
15477 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
15478
15479 2002-06-27 Akim Demaille <akim@epita.fr>
15480
15481 * src/options.h, src/options.c: Remove.
15482 * src/getargs.c (short_options, long_options): New.
15483
15484 2002-06-27 Akim Demaille <akim@epita.fr>
15485
15486 * data/bison.simple, data/bison.c++: Rename as...
15487 * data/yacc.c, data/lalr1.cc: these.
15488 * doc/bison.texinfo (Environment Variables): Remove.
15489
15490 2002-06-25 Raja R Harinath <harinath@cs.umn.edu>
15491
15492 * src/getargs.c (report_argmatch): Initialize strtok().
15493
15494 2002-06-20 Akim Demaille <akim@epita.fr>
15495
15496 * data/bison.simple (b4_symbol_actions): New, replaces...
15497 (b4_symbol_destructor, b4_symbol_printer): these.
15498 (yysymprint): Be sure to call YYPRINT only for tokens, and using
15499 user token numbers.
15500
15501 2002-06-20 Akim Demaille <akim@epita.fr>
15502
15503 * data/bison.simple (yydestructor): Rename as...
15504 (yydestruct): this.
15505
15506 2002-06-20 Akim Demaille <akim@epita.fr>
15507
15508 * src/symtab.h, src/symtab.c (symbol_type_set)
15509 (symbol_destructor_set, symbol_precedence_set): The location is
15510 the last argument.
15511 Adjust all callers.
15512
15513 2002-06-20 Akim Demaille <akim@epita.fr>
15514
15515 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
15516 internals.
15517 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
15518 Takes a location.
15519 * src/symtab.h, src/symtab.c (symbol_class_set)
15520 (symbol_user_token_number_set): Likewise.
15521 Adjust all callers.
15522 Promote complain_at.
15523 * tests/input.at (Type Clashes): Adjust.
15524
15525 2002-06-20 Akim Demaille <akim@epita.fr>
15526
15527 * data/bison.simple (YYLEX): Fix the declaration when
15528 %pure-parser.
15529
15530 2002-06-20 Akim Demaille <akim@epita.fr>
15531
15532 * data/bison.simple (yysymprint): Don't print the token number,
15533 just its name.
15534 * tests/actions.at (Destructors): Rename as...
15535 (Printers and Destructors): this.
15536 Also exercise %printer.
15537
15538 2002-06-20 Akim Demaille <akim@epita.fr>
15539
15540 * data/bison.simple (YYDSYMPRINT): New.
15541 Use it to remove many of the #if YYDEBUG/if (yydebug).
15542
15543 2002-06-20 Akim Demaille <akim@epita.fr>
15544
15545 * src/symtab.h, src/symtab.c (symbol_t): printer and
15546 printer_location are new members.
15547 (symbol_printer_set): New.
15548 * src/parse-gram.y (PERCENT_PRINTER): New token.
15549 Handle its associated rule.
15550 * src/scan-gram.l: Adjust.
15551 (handle_destructor_at, handle_destructor_dollar): Rename as...
15552 (handle_symbol_code_at, handle_symbol_code_dollar): these.
15553 * src/output.c (symbol_printers_output): New.
15554 (output_skeleton): Call it.
15555 * data/bison.simple (yysymprint): New. Cannot be named yyprint
15556 since there are already many grammar files with a user `yyprint'.
15557 Replace the calls to YYPRINT to calls to yysymprint.
15558 * tests/calc.at: Adjust.
15559 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
15560 taking advantage of parser very internal details (stack size!).
15561
15562 2002-06-20 Akim Demaille <akim@epita.fr>
15563
15564 * src/scan-gram.l: Complete the scanner with the missing patterns
15565 to pacify Flex.
15566 Use `quote' and `symbol_tag_get' where appropriate.
15567
15568 2002-06-19 Akim Demaille <akim@epita.fr>
15569
15570 * tests/actions.at (Destructors): Augment to test locations.
15571 * data/bison.simple (yydestructor): Pass it the current location
15572 if locations are enabled.
15573 Prototype only when __STDC__ or C++.
15574 Change the argument names to move into the yy name space: there is
15575 user code here.
15576
15577 2002-06-19 Akim Demaille <akim@epita.fr>
15578
15579 * data/bison.simple (b4_pure_if): New.
15580 Use it instead of #ifdef YYPURE.
15581
15582 2002-06-19 Akim Demaille <akim@epita.fr>
15583
15584 * data/bison.simple (b4_location_if): New.
15585 Use it instead of #ifdef YYLSP_NEEDED.
15586
15587 2002-06-19 Akim Demaille <akim@epita.fr>
15588
15589 Prepare @$ in %destructor, but currently don't bind it in the
15590 skeleton, as %location use is not cleaned up yet.
15591
15592 * src/scan-gram.l (handle_dollar, handle_destructor_at)
15593 (handle_action_at): New.
15594 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
15595 a braced_code_t and a location as additional arguments.
15596 (handle_destructor_dollar): Instead of requiring `b4_eval', just
15597 unquote one when outputting `b4_dollar_dollar'.
15598 Adjust callers.
15599 * data/bison.simple (b4_eval): Remove.
15600 (b4_symbol_destructor): Adjust.
15601 * tests/input.at (Invalid @n): Adjust.
15602
15603 2002-06-19 Zack Weinberg <zack@codesourcery.com>
15604
15605 * doc/bison.texinfo: Document ability to have multiple
15606 prologue sections.
15607
15608 2002-06-18 Akim Demaille <akim@epita.fr>
15609
15610 * src/files.c (compute_base_names): When computing the output file
15611 names from the input file name, strip the directory part.
15612
15613 2002-06-18 Akim Demaille <akim@epita.fr>
15614
15615 * data/bison.simple.new: Comment changes.
15616 Reported by Andreas Schwab.
15617
15618 2002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
15619
15620 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
15621 there are no `label `yyoverflowlab' defined but not used' warnings
15622 when yyoverflow is defined.
15623
15624 2002-06-18 Akim Demaille <akim@epita.fr>
15625
15626 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
15627 new member.
15628 (symbol_destructor_set): Adjust.
15629 * src/output.c (symbol_destructors_output): Output the destructor
15630 locations.
15631 Output the symbol name.
15632 * data/bison.simple (b4_symbol_destructor): Adjust.
15633
15634 2002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
15635 and Akim Demaille <akim@epita.fr>
15636
15637 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
15638 what's left on the stack when the error recovery hits EOF.
15639 * tests/actions.at (Destructors): Complete to exercise this case.
15640
15641 2002-06-17 Akim Demaille <akim@epita.fr>
15642
15643 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
15644 arguments is really empty, not only equal to `[]'.
15645 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
15646 member.
15647 (symbol_destructor_set): New.
15648 * src/output.c (symbol_destructors_output): New.
15649 * src/reader.h (brace_code_t, current_braced_code): New.
15650 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
15651 (handle_dollar): Rename as...
15652 (handle_action_dollar): this.
15653 (handle_destructor_dollar): New.
15654 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
15655 (grammar_declaration): Use it.
15656 * data/bison.simple (yystos): Is always defined.
15657 (yydestructor): New.
15658 * tests/actions.at (Destructors): New.
15659 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
15660
15661 2002-06-17 Akim Demaille <akim@epita.fr>
15662
15663 * src/symlist.h, src/symlist.c (symbol_list_length): New.
15664 * src/scan-gram.l (handle_dollar, handle_at): Compute the
15665 rule_length only when needed.
15666 * src/output.c (actions_output, token_definitions_output): Output
15667 the full M4 block.
15668 * src/symtab.c: Don't access directly to the symbol tag, use
15669 symbol_tag_get.
15670 * src/parse-gram.y: Use symbol_list_free.
15671
15672 2002-06-17 Akim Demaille <akim@epita.fr>
15673
15674 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
15675 (symbol_list_prepend, get_type_name): Move to...
15676 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
15677 (symbol_list_prepend, symbol_list_n_type_name_get): here.
15678 Adjust all callers.
15679 (symbol_list_free): New.
15680 * src/scan-gram.l (handle_dollar): Takes a location.
15681 * tests/input.at (Invalid $n): Adjust.
15682
15683 2002-06-17 Akim Demaille <akim@epita.fr>
15684
15685 * src/reader.h, src/reader.c (symbol_list_new): Export it.
15686 (symbol_list_prepend): New.
15687 * src/parse-gram.y (%union): `list' is a new member.
15688 (symbols.1): New, replaces...
15689 (terms_to_prec.1, nterms_to_type.1): these.
15690 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
15691 Take a location as additional argument.
15692 Adjust all callers.
15693
15694 2002-06-15 Akim Demaille <akim@epita.fr>
15695
15696 * src/parse-gram.y: Move %token in the declaration section so that
15697 we don't depend upon CVS Bison.
15698
15699 2002-06-15 Akim Demaille <akim@epita.fr>
15700
15701 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
15702 * src/print.c (print_core): Use it.
15703
15704 2002-06-15 Akim Demaille <akim@epita.fr>
15705
15706 * src/conflicts.c (log_resolution): Accept the rule involved in
15707 the sr conflicts instead of the lookahead number that points to
15708 that rule.
15709 (flush_reduce): Accept the current lookahead vector as argument,
15710 instead of the index in LA.
15711 (resolve_sr_conflict): Accept the current number of lookahead
15712 bitset to consider for the STATE, instead of the index in LA.
15713 (set_conflicts): Adjust.
15714 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
15715
15716 2002-06-15 Akim Demaille <akim@epita.fr>
15717
15718 * src/state.h (state_t): Replace the `lookaheadsp' member, a
15719 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
15720 Adjust all dependencies.
15721 * src/lalr.c (initialize_lookaheads): Split into...
15722 (states_lookaheads_count, states_lookaheads_initialize): these.
15723 (lalr): Adjust.
15724
15725 2002-06-15 Akim Demaille <akim@epita.fr>
15726
15727 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
15728 out of...
15729 (grammar_rules_print): here.
15730 * src/reduce.c (reduce_output): Use it.
15731 * tests/reduce.at (Useless Rules, Reduced Automaton)
15732 (Underivable Rules): Adjust.
15733
15734 2002-06-15 Akim Demaille <akim@epita.fr>
15735
15736 Copy BYacc's nice way to report the grammar.
15737
15738 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
15739 New.
15740 Don't print the rules' location, it is confusing and useless.
15741 (rule_print): Use grammar_rhs_print.
15742 * src/print.c (print_grammar): Use grammar_rules_print.
15743
15744 2002-06-15 Akim Demaille <akim@epita.fr>
15745
15746 Complete and rationalize `useless thing' warnings.
15747
15748 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
15749 (symbol_tag_print): New.
15750 Use them everywhere in place of accessing directly the tag member.
15751 * src/gram.h, src/gram.c (rule_print): New.
15752 Use it where a rule used to be printed `by hand'.
15753 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
15754 (reduce_grammar_tables): Report the useless rules.
15755 (reduce_print): Useless things are a warning, not an error.
15756 Report it as such.
15757 * tests/reduce.at (Useless Nonterminals, Useless Rules):
15758 (Reduced Automaton, Underivable Rules): Adjust.
15759 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
15760 * tests/conflicts.at (Unresolved SR Conflicts)
15761 (Solved SR Conflicts): Adjust.
15762
15763 2002-06-15 Akim Demaille <akim@epita.fr>
15764
15765 Let symbols have a location.
15766
15767 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
15768 (getsym): Adjust.
15769 Adjust all callers.
15770 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
15771 Use location_t, not int.
15772 * src/symtab.c (symbol_check_defined): Take advantage of the
15773 location.
15774 * tests/regression.at (Invalid inputs): Adjust.
15775
15776 2002-06-15 Akim Demaille <akim@epita.fr>
15777
15778 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
15779 (input): Don't try to initialize yylloc here, do it in the
15780 scanner.
15781 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
15782 * src/gram.h (rule_t): Change line and action_line into location
15783 and action_location, of location_t type.
15784 Adjust all dependencies.
15785 * src/location.h, src/location.c (empty_location): New.
15786 * src/reader.h, src/reader.c (grammar_start_symbol_set)
15787 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
15788 (grammar_current_rule_symbol_append)
15789 (grammar_current_rule_action_append): Expect a location as argument.
15790 * src/reader.c (grammar_midrule_action): Adjust to attach an
15791 action's location as dummy symbol location.
15792 * src/symtab.h, src/symtab.c (startsymbol_location): New.
15793 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
15794 the line numbers.
15795
15796 2002-06-14 Akim Demaille <akim@epita.fr>
15797
15798 Grammar declarations may be found in the grammar section.
15799
15800 * src/parse-gram.y (rules_or_grammar_declaration): New.
15801 (declarations): Each declaration may end with a semicolon, not
15802 just...
15803 (grammar_declaration): `"%union"'.
15804 (grammar): Branch to rules_or_grammar_declaration.
15805
15806 2002-06-14 Akim Demaille <akim@epita.fr>
15807
15808 * src/main.c (main): Invoke scanner_free.
15809
15810 2002-06-14 Akim Demaille <akim@epita.fr>
15811
15812 * src/output.c (m4_invoke): Extracted from...
15813 (output_skeleton): here.
15814 Free tempfile.
15815
15816 2002-06-14 Akim Demaille <akim@epita.fr>
15817
15818 * src/parse-gram.y (directives, directive, gram)
15819 (grammar_directives, precedence_directives, precedence_directive):
15820 Rename as...
15821 (declarations, declaration, grammar, grammar_declaration)
15822 (precedence_declaration, precedence_declarator): these.
15823 (symbol_declaration): New.
15824
15825 2002-06-14 Akim Demaille <akim@epita.fr>
15826
15827 * src/files.c (action_obstack): Remove, unused.
15828 (output_obstack): Remove it, and all its dependencies, as it is no
15829 longer needed.
15830 * src/reader.c (epilogue_set): Build the epilogue in the
15831 muscle_obstack.
15832 * src/output.h, src/output.c (muscle_obstack): Move to...
15833 * src/muscle_tab.h, src/muscle_tab.h: here.
15834 (muscle_init): Initialize muscle_obstack.
15835 (muscle_free): New.
15836 * src/main.c (main): Call it.
15837
15838 2002-06-14 Akim Demaille <akim@epita.fr>
15839
15840 * src/location.h: New, extracted from...
15841 * src/reader.h: here.
15842 * src/Makefile.am (noinst_HEADERS): Merge into
15843 (bison_SOURCES): this.
15844 Add location.h.
15845 * src/parse-gram.y: Use location_t instead of Bison's.
15846 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
15847 Use location_t instead of ints.
15848
15849 2002-06-14 Akim Demaille <akim@epita.fr>
15850
15851 * data/bison.simple, data/bison.c++: Be sure to restore the
15852 current #line when returning to the skeleton contents after having
15853 exposed the input file's #line.
15854
15855 2002-06-12 Akim Demaille <akim@epita.fr>
15856
15857 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
15858 eager.
15859 * tests/actions.at (Exotic Dollars): New.
15860
15861 2002-06-12 Akim Demaille <akim@epita.fr>
15862
15863 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
15864 ['"/] too eagerly.
15865 * tests/input.at (Torturing the Scanner): New.
15866
15867 2002-06-11 Akim Demaille <akim@epita.fr>
15868
15869 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
15870 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
15871 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
15872 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
15873 * src/reader.c (reader): Use it.
15874
15875 2002-06-11 Akim Demaille <akim@epita.fr>
15876
15877 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
15878 Adjust all callers.
15879 (scanner_last_string_free): New.
15880
15881 2002-06-11 Akim Demaille <akim@epita.fr>
15882
15883 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
15884 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
15885 (last_string, YY_OBS_FREE): New.
15886 Use them when returning an ID.
15887
15888 2002-06-11 Akim Demaille <akim@epita.fr>
15889
15890 Have Bison grammars parsed by a Bison grammar.
15891
15892 * src/reader.c, src/reader.h (prologue_augment): New.
15893 * src/reader.c (copy_definition): Remove.
15894
15895 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
15896 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
15897 (grammar_current_rule_prec_set, grammar_current_rule_check)
15898 (grammar_current_rule_symbol_append)
15899 (grammar_current_rule_action_append): Export.
15900 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
15901 (symbol_list_action_append): Remove.
15902 Hook the routines from reader.
15903 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
15904 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
15905
15906 * src/reader.c (read_declarations): Remove, unused.
15907
15908 * src/parse-gram.y: Handle the epilogue.
15909 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
15910 (grammar_start_symbol_set): this.
15911 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
15912 * src/reader.c (readgram): Remove, unused.
15913 (reader): Adjust to insert eoftoken and axiom where appropriate.
15914
15915 * src/reader.c (copy_dollar): Replace with...
15916 * src/scan-gram.h (handle_dollar): this.
15917 * src/parse-gram.y: Remove `%thong'.
15918
15919 * src/reader.c (copy_at): Replace with...
15920 * src/scan-gram.h (handle_at): this.
15921
15922 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
15923 New.
15924
15925 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
15926 time being.
15927
15928 * src/reader.h, src/reader.c (grammar_rule_end): New.
15929
15930 * src/parse.y (current_type, current_class): New.
15931 Implement `%nterm', `%token' support.
15932 Merge `%term' into `%token'.
15933 (string_as_id): New.
15934 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
15935 type name.
15936
15937 * src/parse-gram.y: Be sure to handle properly the beginning of
15938 rules.
15939
15940 * src/parse-gram.y: Handle %type.
15941 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
15942
15943 * src/parse-gram.y: More directives support.
15944 * src/options.c: No longer handle source directives.
15945
15946 * src/parse-gram.y: Fix %output.
15947
15948 * src/parse-gram.y: Handle %union.
15949 Use the prologue locations.
15950 * src/reader.c (parse_union_decl): Remove.
15951
15952 * src/reader.h, src/reader.c (epilogue_set): New.
15953 * src/parse-gram.y: Use it.
15954
15955 * data/bison.simple, data/bison.c++: b4_stype is now either not
15956 defined, then default to int, or to the contents of %union,
15957 without `union' itself.
15958 Adjust.
15959 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
15960
15961 * src/output.c (actions_output): Don't output braces, as they are
15962 already handled by the scanner.
15963
15964 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
15965 characters to themselves.
15966
15967 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
15968 that the epilogue has a proper #line.
15969
15970 * src/parse-gram.y: Handle precedence/associativity.
15971
15972 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
15973 a terminal.
15974 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
15975 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
15976 at all to define terminals that cannot be emitted.
15977
15978 * src/scan-gram.l: Escape M4 characters.
15979
15980 * src/scan-gram.l: Working properly with escapes in user
15981 strings/characters.
15982
15983 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
15984 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
15985 grammar.
15986 Use more modest sizes, as for the time being the parser does not
15987 release memory, and therefore the process swallows a huge amount
15988 of memory.
15989
15990 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
15991 stricter %token grammar.
15992
15993 * src/symtab.h (associativity): Add `undef_assoc'.
15994 (symbol_precedence_set): Do nothing when passed an undef_assoc.
15995 * src/symtab.c (symbol_check_alias_consistence): Adjust.
15996
15997 * tests/regression.at (Invalid %directive): Remove, as it is now
15998 meaningless.
15999 (Invalid inputs): Adjust to the new error messages.
16000 (Token definitions): The new grammar doesn't allow too many
16001 eccentricities.
16002
16003 * src/lex.h, src/lex.c: Remove.
16004 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
16005 (copy_character, copy_string2, copy_string, copy_identifier)
16006 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
16007 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
16008 (parse_action): Remove.
16009 * po/POTFILES.in: Adjust.
16010
16011 2002-06-11 Akim Demaille <akim@epita.fr>
16012
16013 * src/reader.c (parse_action): Don't store directly into the
16014 rule's action member: return the action as a string.
16015 Don't require `rule_length' as an argument: compute it.
16016 (grammar_current_rule_symbol_append)
16017 (grammar_current_rule_action_append): New, eved out from
16018 (readgram): here.
16019 Remove `action_flag', `rulelength', unused now.
16020
16021 2002-06-11 Akim Demaille <akim@epita.fr>
16022
16023 * src/reader.c (grammar_current_rule_prec_set).
16024 (grammar_current_rule_check): New, eved out from...
16025 (readgram): here.
16026 Remove `xaction', `first_rhs': useless.
16027 * tests/input.at (Type clashes): New.
16028 * tests/existing.at (GNU Cim Grammar): Adjust.
16029
16030 2002-06-11 Akim Demaille <akim@epita.fr>
16031
16032 * src/reader.c (grammar_midrule_action): New, Eved out from
16033 (readgram): here.
16034
16035 2002-06-11 Akim Demaille <akim@epita.fr>
16036
16037 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
16038 New.
16039 (readgram): Use them as replacement of inlined code, crule and
16040 crule1.
16041
16042 2002-06-11 Akim Demaille <akim@epita.fr>
16043
16044 * src/reader.c (grammar_end, grammar_symbol_append): New.
16045 (readgram): Use them.
16046 Make the use of `p' as local as possible.
16047
16048 2002-06-10 Akim Demaille <akim@epita.fr>
16049
16050 GCJ's parser requires the tokens to be defined before the prologue.
16051
16052 * data/bison.simple: Output the token definition before the user's
16053 prologue.
16054 * tests/regression.at (Braces parsing, Duplicate string)
16055 (Mixing %token styles): Check the output from bison.
16056 (Early token definitions): New.
16057
16058 2002-06-10 Akim Demaille <akim@epita.fr>
16059
16060 * src/symtab.c (symbol_user_token_number_set): Don't complain when
16061 assigning twice the same user number to a token, so that we can
16062 use it in...
16063 * src/lex.c (lex): here.
16064 Also use `symbol_class_set' instead of hand written code.
16065 * src/reader.c (parse_assoc_decl): Likewise.
16066
16067 2002-06-10 Akim Demaille <akim@epita.fr>
16068
16069 * src/symtab.c, src/symtab.c (symbol_class_set)
16070 (symbol_user_token_number_set): New.
16071 * src/reader.c (parse_token_decl): Use them.
16072 Use a switch instead of ifs.
16073 Use a single argument.
16074
16075 2002-06-10 Akim Demaille <akim@epita.fr>
16076
16077 Remove `%thong' support as it is undocumented, unused, duplicates
16078 `%token's job, and creates useless e-mail traffic with people who
16079 want to know what it is, why it is undocumented, unused, and
16080 duplicates `%token's job.
16081
16082 * src/reader.c (parse_thong_decl): Remove.
16083 * src/options.c (option_table): Remove "thong".
16084 * src/lex.h (tok_thong): Remove.
16085
16086 2002-06-10 Akim Demaille <akim@epita.fr>
16087
16088 * src/symtab.c, src/symtab.c (symbol_type_set)
16089 (symbol_precedence_set): New.
16090 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
16091 (value_components_used): Remove, unused.
16092
16093 2002-06-09 Akim Demaille <akim@epita.fr>
16094
16095 Move symbols handling code out of the reader.
16096
16097 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
16098 (axiom): Move to...
16099 * src/symtab.h, src/symtab.c: here.
16100
16101 * src/gram.c (start_symbol): Remove: use startsymbol->number.
16102 * src/reader.c (startval): Rename as...
16103 * src/symtab.h, src/symtab.c (startsymbol): this.
16104 * src/reader.c: Adjust.
16105
16106 * src/reader.c (symbol_check_defined, symbol_make_alias)
16107 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
16108 (token_translations_init)
16109 Move to...
16110 * src/symtab.c: here.
16111 * src/reader.c (packsymbols): Move to...
16112 * src/symtab.h, src/symtab.c (symbols_pack): here.
16113 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
16114 argument.
16115
16116 2002-06-03 Akim Demaille <akim@epita.fr>
16117
16118 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
16119 then statements.
16120
16121 2002-06-03 Akim Demaille <akim@epita.fr>
16122
16123 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
16124 structs with non literals.
16125 * src/scan-skel.l: never-interactive.
16126 * src/conflicts.c (enum conflict_resolution_e): No trailing
16127 comma.
16128 * src/getargs.c (usage): Split long literal strings.
16129 Reported by Hans Aberg.
16130
16131 2002-05-28 Akim Demaille <akim@epita.fr>
16132
16133 * data/bison.c++: Use C++ ostreams.
16134 (cdebug_): New member.
16135
16136 2002-05-28 Akim Demaille <akim@epita.fr>
16137
16138 * src/output.c (output_skeleton): Be sure to allocate enough room
16139 for `/' _and_ for `\0' in full_skeleton.
16140
16141 2002-05-28 Akim Demaille <akim@epita.fr>
16142
16143 * data/bison.c++: Catch up with bison.simple:
16144 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16145 and Paul Eggert <eggert@twinsun.com>: `error' handing.
16146 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
16147 and popping traces.
16148
16149 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16150
16151 * src/output.c (output_skeleton): Put an explicit path in front of
16152 the skeleton file name, rather than relying on the -I directory,
16153 to partially alleviate effects of having a skeleton file lying around
16154 in the current directory.
16155
16156 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16157
16158 * src/conflicts.c (log_resolution): Correct typo:
16159 obstack_printf should be obstack_fgrow1.
16160
16161 2002-05-26 Akim Demaille <akim@epita.fr>
16162
16163 * src/state.h (state_t): `solved_conflicts' is a new member.
16164 * src/LR0.c (new_state): Set it to 0.
16165 * src/conflicts.h, src/conflicts.c (print_conflicts)
16166 (free_conflicts, solve_conflicts): Rename as...
16167 (conflicts_print, conflicts_free, conflicts_solve): these.
16168 Adjust callers.
16169 * src/conflicts.c (enum conflict_resolution_e)
16170 (solved_conflicts_obstack): New, used by...
16171 (log_resolution): this.
16172 Adjust to attach the conflict resolution to each state.
16173 Complete the description with the precedence/associativity
16174 information.
16175 (resolve_sr_conflict): Adjust.
16176 * src/print.c (print_state): Output its solved_conflicts.
16177 * tests/conflicts.at (Unresolved SR Conflicts)
16178 (Solved SR Conflicts): Exercise --report=all.
16179
16180 2002-05-26 Akim Demaille <akim@epita.fr>
16181
16182 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
16183 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
16184 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
16185 (token_number_t, item_number_as_token_number)
16186 (token_number_as_item_number, muscle_insert_token_number_table):
16187 Rename as...
16188 (symbol_number_t, item_number_as_symbol_number)
16189 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
16190 these, since it is more appropriate.
16191
16192 2002-05-26 Akim Demaille <akim@epita.fr>
16193
16194 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
16195 `Error:' lines.
16196 * data/bison.simple (yystos) [YYDEBUG]: New.
16197 (yyparse) [YYDEBUG]: Display the symbols which are popped during
16198 error recovery.
16199 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
16200
16201 2002-05-25 Akim Demaille <akim@epita.fr>
16202
16203 * doc/bison.texinfo (Debugging): Split into...
16204 (Tracing): this new section, its former contents, and...
16205 (Understanding): this new section.
16206 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
16207 by...
16208 (report_flag): this.
16209 Adjust all dependencies.
16210 (report_args, report_types, report_argmatch): New.
16211 (usage, getargs): Report/support -r, --report.
16212 * src/options.h
16213 (struct option_table_struct): Rename as..,
16214 (struct option_table_s): this.
16215 Rename the `set_flag' member to `flag' to match with getopt_long's
16216 struct.
16217 * src/options.c (option_table): Split verbose into an entry for
16218 %verbose, and another for --verbose.
16219 Support --report/-r, so remove -r from the obsolete --raw.
16220 * src/print.c: Attach full item sets and lookaheads reports to
16221 report_flag instead of trace_flag.
16222 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
16223
16224 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16225 and Paul Eggert <eggert@twinsun.com>
16226
16227 * data/bison.simple (yyparse): Correct error handling to conform to
16228 POSIX and yacc. Specifically, after syntax error is discovered,
16229 do not reduce further before shifting the error token.
16230 Clean up the code a bit by removing the labels yyerrdefault,
16231 yyerrhandle, yyerrpop.
16232 * NEWS: Document the above.
16233
16234 2002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16235
16236 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
16237 type; it isn't always big enough, since it doesn't necessarily
16238 include non-terminals.
16239 (yytranslate): Expand definition of yy_token_number_type, so that
16240 the latter can be removed.
16241 (yy_token_number_type): Remove, only one use.
16242 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
16243 don't use TokenNumberType as element type.
16244
16245 * tests/regression.at: Modify expected output to agree with change
16246 to yyr1 and yytranslate.
16247
16248 2002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
16249
16250 * src/reader.c (parse_action): Use copy_character instead of
16251 obstack_1grow.
16252
16253 2002-05-13 Akim Demaille <akim@epita.fr>
16254
16255 * tests/regression.at (Token definitions): Prototype yylex and
16256 yyerror.
16257
16258 2002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16259
16260 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
16261 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
16262 32-bit arithmetic.
16263 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
16264
16265 2002-05-07 Akim Demaille <akim@epita.fr>
16266
16267 * tests/synclines.at: Be sure to prototype yylex and yyerror to
16268 avoid GCC warnings.
16269
16270 2002-05-07 Akim Demaille <akim@epita.fr>
16271
16272 Kill GCC warnings.
16273
16274 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
16275 over the RHS of each rule.
16276 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
16277 * src/state.h (state_t): Member `nitems' is unsigned short.
16278 * src/LR0.c (get_state): Adjust.
16279 * src/reader.c (packgram): Likewise.
16280 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
16281 `Type'.
16282 (muscle_insert_int_table): Remove, unused.
16283 (prepare_rules): Remove `max'.
16284
16285 2002-05-06 Akim Demaille <akim@epita.fr>
16286
16287 * src/closure.c (print_firsts): Display of the symbol tags.
16288 (bitmatrix_print): Move to...
16289 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
16290 here.
16291 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
16292
16293 2002-05-06 Akim Demaille <akim@epita.fr>
16294
16295 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
16296 hash_do_for_each.
16297
16298 2002-05-06 Akim Demaille <akim@epita.fr>
16299
16300 * src/LR0.c (new_state, get_state): Instead of using the global
16301 `kernel_size' and `kernel_base', have two new arguments:
16302 `core_size' and `core'.
16303 Adjust callers.
16304
16305 2002-05-06 Akim Demaille <akim@epita.fr>
16306
16307 * src/reader.c (packgram): No longer end `ritem' with a 0
16308 sentinel: it is not used.
16309
16310 2002-05-05 Akim Demaille <akim@epita.fr>
16311
16312 New experimental feature: display the lookaheads in the report and
16313 graph.
16314
16315 * src/print (print_core): When --trace-flag, display the rules
16316 lookaheads.
16317 * src/print_graph.c (print_core): Likewise.
16318 Swap the arguments.
16319 Adjust caller.
16320
16321 2002-05-05 Akim Demaille <akim@epita.fr>
16322
16323 * tests/torture.at (Many lookaheads): New test.
16324
16325 2002-05-05 Akim Demaille <akim@epita.fr>
16326
16327 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
16328 (GENERATE_MUSCLE_INSERT_TABLE): this.
16329 (output_int_table, output_unsigned_int_table, output_short_table)
16330 (output_token_number_table, output_item_number_table): Replace with...
16331 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
16332 (muscle_insert_short_table, muscle_insert_token_number_table)
16333 (muscle_insert_item_number_table): these.
16334 Adjust all callers.
16335 (prepare_tokens): Don't free `translations', since...
16336 * src/reader.h, src/reader.c (grammar_free): do it.
16337 Move to...
16338 * src/gram.h, src/gram.c (grammar_free): here.
16339 * data/bison.simple, data/bison.c++: b4_token_number_max is now
16340 b4_translate_max.
16341
16342 2002-05-05 Akim Demaille <akim@epita.fr>
16343
16344 * src/output.c (output_unsigned_int_table): New.
16345 (prepare_rules): `i' is unsigned.
16346 `prhs', `rline', `r2' are unsigned int.
16347 Rename muscle `rhs_number_max' as `rhs_max'.
16348 Output muscles `prhs_max', `rline_max', and `r2_max'.
16349 Free rline and r1.
16350 * data/bison.simple, data/bison.c++: Adjust to use these muscles
16351 to compute types instead of constant types.
16352 * tests/regression.at (Web2c Actions): Adjust.
16353
16354 2002-05-04 Akim Demaille <akim@epita.fr>
16355
16356 * src/symtab.h (SALIAS, SUNDEF): Rename as...
16357 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
16358 Adjust dependencies.
16359 * src/output.c (token_definitions_output): Be sure not to output a
16360 `#define 'a'' when fed with `%token 'a' "a"'.
16361 * tests/regression.at (Token definitions): New.
16362
16363 2002-05-03 Paul Eggert <eggert@twinsun.com>
16364
16365 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
16366 for K&R C.
16367
16368 2002-05-03 gettextize <bug-gnu-gettext@gnu.org>
16369
16370 * Makefile.am (SUBDIRS): Remove intl.
16371 (EXTRA_DIST): Add config/config.rpath.
16372
16373 2002-05-03 Akim Demaille <akim@epita.fr>
16374
16375 * data/bison.simple (m4_if): Don't output empty enums.
16376 And actually, output valid enum definitions :(.
16377
16378 2002-05-03 Akim Demaille <akim@epita.fr>
16379
16380 * configure.bat: Remove, completely obsolete.
16381 * Makefile.am (EXTRA_DIST): Adjust.
16382 Don't distribute config.rpath...
16383 * config/Makefile.am (EXTRA_DIST): Do it.
16384
16385 2002-05-03 Akim Demaille <akim@epita.fr>
16386
16387 * configure.in (GETTEXT_VERSION): New.
16388 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
16389
16390 2002-05-03 Akim Demaille <akim@epita.fr>
16391
16392 * data/bison.simple (b4_token_enum): New.
16393 (b4_token_defines): Use it to output tokens both as #define and
16394 enums.
16395 Suggested by Paul Eggert.
16396 * src/output.c (token_definitions_output): Don't output spurious
16397 white spaces.
16398
16399 2002-05-03 Akim Demaille <akim@epita.fr>
16400
16401 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
16402
16403 2002-05-02 Robert Anisko <robert@lrde.epita.fr>
16404
16405 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
16406 Update the stack class, give a try to deque as the default container.
16407
16408 2002-05-02 Akim Demaille <akim@epita.fr>
16409
16410 * data/bison.simple (yyparse): Do not implement @$ = @1.
16411 (YYLLOC_DEFAULT): Adjust to do it.
16412 * doc/bison.texinfo (Location Default Action): Fix.
16413
16414 2002-05-02 Akim Demaille <akim@epita.fr>
16415
16416 * src/reader.c (parse_braces): Merge into...
16417 (parse_action): this.
16418
16419 2002-05-02 Akim Demaille <akim@epita.fr>
16420
16421 * configure.in (ALL_LINGUAS): Remove.
16422 * po/LINGUAS, hr.po: New.
16423
16424 2002-05-02 Akim Demaille <akim@epita.fr>
16425
16426 Remove the so called hairy (semantic) parsers.
16427
16428 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
16429 * src/gram.h, src/gram.c (semantic_parser): Remove.
16430 (rule_t): Remove the guard and guard_line members.
16431 * src/lex.h (token_t): remove tok_guard.
16432 * src/options.c (option_table): Remove %guard and %semantic_parser
16433 support.
16434 * src/output.c, src/output.h (guards_output): Remove.
16435 (prepare): Adjust.
16436 (token_definitions_output): Don't output the `T'
16437 tokens (???).
16438 (output_skeleton): Don't output the guards.
16439 * src/files.c, src/files.c (attrsfile): Remove.
16440 * src/reader.c (symbol_list): Remove the guard and guard_line
16441 members.
16442 Adjust dependencies.
16443 (parse_guard): Remove.
16444 * data/bison.hairy: Remove.
16445 * doc/bison.texinfo (Environment Variables): Remove occurrences of
16446 BISON_HAIRY.
16447
16448 2002-05-02 Akim Demaille <akim@epita.fr>
16449
16450 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
16451 (parse_guard): Rename the formal argument `stack_offset' as
16452 `rule_length', which is more readable.
16453 Adjust callers.
16454 (copy_at, copy_dollar): Instead of outputting the hard coded
16455 values of $$, $n and so forth, output invocation to b4_lhs_value,
16456 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
16457 Note: this patch partially drops `semantic-parser' support: it
16458 always does `rule_length - n', where semantic parsers ought to
16459 always use `-n'.
16460 * data/bison.simple, data/bison.c++ (b4_lhs_value)
16461 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
16462
16463 2002-05-02 Akim Demaille <akim@epita.fr>
16464
16465 * configure.in (AC_INIT): Bump to 1.49b.
16466 (AM_INIT_AUTOMAKE): Short invocation.
16467
16468 2002-05-02 Akim Demaille <akim@epita.fr>
16469
16470 Version 1.49a.
16471
16472 2002-05-01 Akim Demaille <akim@epita.fr>
16473
16474 * src/skeleton.h: Remove.
16475
16476 2002-05-01 Akim Demaille <akim@epita.fr>
16477
16478 * src/skeleton.h: Fix the #endif.
16479 Reported by Magnus Fromreide.
16480
16481 2002-04-26 Paul Eggert <eggert@twinsun.com>
16482
16483 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
16484 Define if we define YYSTYPE and YYLTYPE, respectively.
16485 (YYCOPY): Fix [] quoting problem in the non-GCC case.
16486
16487 2002-04-25 Robert Anisko <robert@lrde.epita.fr>
16488
16489 * src/scan-skel.l: Postprocess quadrigraphs.
16490
16491 * src/reader.c (copy_character): New function, used to output
16492 single characters while replacing `[' and `]' with quadrigraphs, to
16493 avoid troubles with M4 quotes.
16494 (copy_comment): Output characters with copy_character.
16495 (read_additionnal_code): Likewise.
16496 (copy_string2): Likewise.
16497 (copy_definition): Likewise.
16498
16499 * tests/calc.at: Exercise M4 quoting.
16500
16501 2002-04-25 Akim Demaille <akim@epita.fr>
16502
16503 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
16504 between `!' and the command.
16505 Reported by Paul Eggert.
16506
16507 2002-04-24 Robert Anisko <robert@lrde.epita.fr>
16508
16509 * tests/calc.at: Exercise prologue splitting.
16510
16511 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
16512 `b4_post_prologue' instead of `b4_prologue'.
16513
16514 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
16515 muscles.
16516 (output): Free pre_prologue_obstack and post_prologue_obstack.
16517 * src/files.h, src/files.c (attrs_obstack): Remove.
16518 (pre_prologue_obstack, post_prologue_obstack): New.
16519 * src/reader.c (copy_definition): Add a parameter to specify the
16520 obstack to fill, instead of using attrs_obstack unconditionally.
16521 (read_declarations): Pass pre_prologue_obstack to copy_definition if
16522 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
16523
16524 2002-04-23 Paul Eggert <eggert@twinsun.com>
16525
16526 * data/bison.simple: Remove unnecessary commentary and white
16527 space differences from 1_29-branch.
16528 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
16529
16530 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
16531 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
16532 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
16533 constructors or destructors.
16534
16535 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
16536
16537 2002-04-23 Akim Demaille <akim@epita.fr>
16538
16539 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
16540 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
16541 location with columns.
16542 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
16543 All reported by Paul Eggert.
16544
16545 2002-04-22 Akim Demaille <akim@epita.fr>
16546
16547 * src/reduce.c (dump_grammar): Move to...
16548 * src/gram.h, src/gram.c (grammar_dump): here.
16549 Be sure to separate long item numbers.
16550 Don't read the members of a rule's prec if its nil.
16551
16552 2002-04-22 Akim Demaille <akim@epita.fr>
16553
16554 * src/output.c (table_size, table_grow): New.
16555 (MAXTABLE): Remove, replace uses with table_size.
16556 (pack_vector): Instead of dying when the table is too big, grow it.
16557
16558 2002-04-22 Akim Demaille <akim@epita.fr>
16559
16560 * data/bison.simple (yyr1): Its type is that of a token number.
16561 * data/bison.c++ (r1_): Likewise.
16562 * tests/regression.at (Web2c Actions): Adjust.
16563
16564 2002-04-22 Akim Demaille <akim@epita.fr>
16565
16566 * src/reader.c (token_translations_init): 256 is now the default
16567 value for the error token, i.e., it will be assigned another
16568 number if the user assigned 256 to one of her tokens.
16569 (reader): Don't force 256 to error.
16570 * doc/bison.texinfo (Symbols): Adjust.
16571 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
16572 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
16573 etc. instead of 10, 20, 30 (which was used to `jump' over error
16574 (256) and undefined (2)).
16575
16576 2002-04-22 Akim Demaille <akim@epita.fr>
16577
16578 Propagate more token_number_t.
16579
16580 * src/gram.h (token_number_as_item_number)
16581 (item_number_as_token_number): New.
16582 * src/output.c (GENERATE_OUTPUT_TABLE): New.
16583 Use it to create output_item_number_table and
16584 output_token_number_table.
16585 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
16586 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
16587 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
16588 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
16589
16590 2002-04-22 Akim Demaille <akim@epita.fr>
16591
16592 * src/output.h, src/output.c (get_lines_number): Remove.
16593
16594 2002-04-19 Akim Demaille <akim@epita.fr>
16595
16596 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
16597 as Lex/Flex'.
16598 (Debugging): More details about enabling the debugging features.
16599 (Table of Symbols): Describe $$, $n, @$, and @n.
16600 Suggested by Tim Josling.
16601
16602 2002-04-19 Akim Demaille <akim@epita.fr>
16603
16604 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
16605
16606 2002-04-10 Akim Demaille <akim@epita.fr>
16607
16608 * src/system.h: Rely on HAVE_LIMITS_H.
16609 Suggested by Paul Eggert.
16610
16611 2002-04-09 Akim Demaille <akim@epita.fr>
16612
16613 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
16614 full stderr, and strip it according to the bison options, instead
16615 of composing the error message from different bits.
16616 This makes it easier to check for several error messages.
16617 Adjust all the invocations.
16618 Add an invocation exercising the error token.
16619 Add an invocation demonstrating a stupid error message.
16620 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
16621 Adjust the tests.
16622 Error message are for stderr, not stdout.
16623
16624 2002-04-09 Akim Demaille <akim@epita.fr>
16625
16626 * src/gram.h, src/gram.c (error_token_number): Remove, use
16627 errtoken->number.
16628 * src/reader.c (reader): Don't specify the user token number (2)
16629 for $undefined, as it uselessly prevents using it.
16630 * src/gram.h (token_number_t): Move to...
16631 * src/symtab.h: here.
16632 (state_t.number): Is a token_number_t.
16633 * src/print.c, src/reader.c: Use undeftoken->number instead of
16634 hard coded 2.
16635 (Even though this 2 is not the same as above: the number of the
16636 undeftoken remains being 2, it is its user token number which
16637 might not be 2).
16638 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
16639 `user_token_number_max'.
16640 Output `undef_token_number'.
16641 * data/bison.simple, data/bison.c++: Use them.
16642 Be sure to map invalid yylex return values to
16643 `undef_token_number'. This saves us from gratuitous SEGV.
16644
16645 * tests/conflicts.at (Solved SR Conflicts)
16646 (Unresolved SR Conflicts): Adjust.
16647 * tests/regression.at (Web2c Actions): Adjust.
16648
16649 2002-04-08 Akim Demaille <akim@epita.fr>
16650
16651 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
16652 Adding #line.
16653 Remove the duplicate `typedefs'.
16654 (RhsNumberType): Fix the declaration and various other typos.
16655 Use __ofile__.
16656 * data/bison.simple: Use __ofile__.
16657 * src/scan-skel.l: Handle __ofile__.
16658
16659 2002-04-08 Akim Demaille <akim@epita.fr>
16660
16661 * src/gram.h (item_number_t): New, the type of item numbers in
16662 RITEM. Note that it must be able to code symbol numbers as
16663 positive number, and the negation of rule numbers as negative
16664 numbers.
16665 Adjust all dependencies (pretty many).
16666 * src/reduce.c (rule): Remove this `short *' pointer: use
16667 item_number_t.
16668 * src/system.h (MINSHORT, MAXSHORT): Remove.
16669 Include `limits.h'.
16670 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
16671 (shortcpy): Remove.
16672 (MAXTABLE): Move to...
16673 * src/output.c (MAXTABLE): here.
16674 (prepare_rules): Use output_int_table to output rhs.
16675 * data/bison.simple, data/bison.c++: Adjust.
16676 * tests/torture.at (Big triangle): Move the limit from 254 to
16677 500.
16678 * tests/regression.at (Web2c Actions): Ajust.
16679
16680 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
16681 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
16682 passes, but produces negative #line number, once fixed, GCC is
16683 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
16684 C), it passes.
16685 * src/state.h (state_h): Code input lines on ints, not shorts.
16686
16687 2002-04-08 Akim Demaille <akim@epita.fr>
16688
16689 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
16690 and then the grammar.
16691
16692 2002-04-08 Akim Demaille <akim@epita.fr>
16693
16694 * src/system.h: No longer using strndup.
16695
16696 2002-04-07 Akim Demaille <akim@epita.fr>
16697
16698 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
16699 * src/output.c (output_table_data): Return the longest number.
16700 (prepare_tokens): Output `token_number_max').
16701 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
16702 New.
16703 Use them to define yy_token_number_type/TokenNumberType.
16704 Use this type for yytranslate.
16705 * tests/torture.at (Big triangle): Push the limit from 124 to
16706 253.
16707 * tests/regression.at (Web2c Actions): Adjust.
16708
16709 2002-04-07 Akim Demaille <akim@epita.fr>
16710
16711 * tests/torture.at (Big triangle): New.
16712 (GNU AWK Grammar, GNU Cim Grammar): Move to...
16713 * tests/existing.at: here.
16714
16715 2002-04-07 Akim Demaille <akim@epita.fr>
16716
16717 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
16718 nritems.
16719 Adjust dependencies.
16720
16721 2002-04-07 Akim Demaille <akim@epita.fr>
16722
16723 * src/reader.c: Normalize increments to prefix form.
16724
16725 2002-04-07 Akim Demaille <akim@epita.fr>
16726
16727 * src/reader.c, symtab.c: Remove debugging code.
16728
16729 2002-04-07 Akim Demaille <akim@epita.fr>
16730
16731 Rename all the `bucket's as `symbol_t'.
16732
16733 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
16734 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
16735 * src/symtab.c, src/symtab.h (bucket): Rename as...
16736 (symbol_t): this.
16737 (symbol_list_new, bucket_check_defined, bucket_make_alias)
16738 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
16739 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
16740 (buckets_new, buckets_free, buckets_do): Rename as...
16741 (symbol_list_new, symbol_check_defined, symbol_make_alias)
16742 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
16743 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
16744 (symbols_new, symbols_free, symbols_do): these.
16745
16746 2002-04-07 Akim Demaille <akim@epita.fr>
16747
16748 Use lib/hash for the symbol table.
16749
16750 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
16751 EOF.
16752 * src/lex.c (lex): Set the `number' member of new terminals.
16753 * src/reader.c (bucket_check_defined, bucket_make_alias)
16754 (bucket_check_alias_consistence, bucket_translation): New.
16755 (reader, grammar_free, readgram, token_translations_init)
16756 (packsymbols): Adjust.
16757 (reader): Number the predefined tokens.
16758 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
16759 for predefined tokens.
16760 * src/symtab.h (bucket): Remove all the hash table related
16761 members.
16762 * src/symtab.c (symtab): Replace by...
16763 (bucket_table): this.
16764 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
16765 (buckets_new, buckets_do): New.
16766
16767 2002-04-07 Akim Demaille <akim@epita.fr>
16768
16769 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
16770 (start_symbol, max_user_token_number, semantic_parser)
16771 (error_token_number): Initialize.
16772 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
16773 Initialize.
16774 (reader): Don't.
16775 (errtoken, eoftoken, undeftoken, axiom): Extern.
16776
16777 2002-04-07 Akim Demaille <akim@epita.fr>
16778
16779 * src/gram.h (rule_s): prec and precsym are now pointers
16780 to the bucket giving the priority/associativity.
16781 Member `associativity' removed: useless.
16782 * src/reduce.c, src/conflicts.c: Adjust.
16783
16784 2002-04-07 Akim Demaille <akim@epita.fr>
16785
16786 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
16787 Properly escape the symbols' TAG when outputting them.
16788
16789 2002-04-07 Akim Demaille <akim@epita.fr>
16790
16791 * src/lalr.h (LA): Is a bitsetv, not bitset*.
16792
16793 2002-04-07 Akim Demaille <akim@epita.fr>
16794
16795 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
16796 (LArule): this, which is an array to rule_t*.
16797 * src/print.c, src/conflicts.c: Adjust.
16798
16799 2002-04-07 Akim Demaille <akim@epita.fr>
16800
16801 * src/gram.h (rule_t): Rename `number' as `user_number'.
16802 `number' is a new member.
16803 Adjust dependencies.
16804 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
16805
16806 2002-04-07 Akim Demaille <akim@epita.fr>
16807
16808 As a result of the previous patch, it is no longer needed
16809 to reorder ritem itself.
16810
16811 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
16812
16813 2002-04-07 Akim Demaille <akim@epita.fr>
16814
16815 Be sure never to walk through RITEMS, but use only data related to
16816 the rules themselves. RITEMS should be banished.
16817
16818 * src/output.c (output_token_translations): Rename as...
16819 (prepare_tokens): this.
16820 In addition to `translate', prepare the muscles `tname' and
16821 `toknum', which were handled by...
16822 (output_rule_data): this.
16823 Remove, and move the remainder of its outputs into...
16824 (prepare_rules): this new routines, which also merges content from
16825 (output_gram): this.
16826 (prepare_rules): Be sure never to walk through RITEMS.
16827 (output_stos): Rename as...
16828 (prepare_stos): this.
16829 (output): Always invoke prepare_states, after all, just don't use it
16830 in the output if you don't need it.
16831
16832 2002-04-07 Akim Demaille <akim@epita.fr>
16833
16834 * src/LR0.c (new_state): Display `nstates' as the name of the
16835 newly created state.
16836 Adjust to initialize first_state and last_state if needed.
16837 Be sure to distinguish the initial from the final state.
16838 (new_states): Create the itemset of the initial state, and use
16839 new_state.
16840 * src/closure.c (closure): Now that the initial state has its
16841 items properly set, there is no need for a special case when
16842 creating `ruleset'.
16843
16844 As a result, now the rule 0, reducing to $axiom, is visible in the
16845 outputs. Adjust the test suite.
16846
16847 * tests/conflicts.at (Solved SR Conflicts)
16848 (Unresolved SR Conflicts): Adjust.
16849 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
16850 * tests/conflicts.at (S/R in initial): New.
16851
16852 2002-04-07 Akim Demaille <akim@epita.fr>
16853
16854 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
16855 the RHS of the rules.
16856 * src/output.c (output_gram): Likewise.
16857
16858 2002-04-07 Akim Demaille <akim@epita.fr>
16859
16860 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
16861 bucket.
16862 Adjust all dependencies.
16863 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
16864 `number' of the buckets too.
16865 * src/gram.h: Include `symtab.h'.
16866 (associativity): Move to...
16867 * src/symtab.h: here.
16868 No longer include `gram.h'.
16869
16870 2002-04-07 Akim Demaille <akim@epita.fr>
16871
16872 * src/gram.h, src/gram.c (rules_rhs_length): New.
16873 (ritem_longest_rhs): Use it.
16874 * src/gram.h (rule_t): `number' is a new member.
16875 * src/reader.c (packgram): Set it.
16876 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
16877 the end of `rules', and count them out of `nrules'.
16878 (reduce_output, dump_grammar): Adjust.
16879 * src/print.c (print_grammar): It is no longer needed to check for
16880 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
16881 * tests/reduce.at (Reduced Automaton): New test.
16882
16883 2002-04-07 Akim Demaille <akim@epita.fr>
16884
16885 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
16886 lacking `+ 1' to nrules, Bison reported as useless a token if it
16887 was used solely to set the precedence of the last rule...
16888
16889 2002-04-07 Akim Demaille <akim@epita.fr>
16890
16891 * data/bison.c++, data/bison.simple: Don't output the current file
16892 name in #line, to avoid useless diffs between two identical
16893 outputs under different names.
16894
16895 2002-04-07 Akim Demaille <akim@epita.fr>
16896
16897 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
16898 Normalize loops to using `< nrules + 1', not `<= nrules'.
16899
16900 2002-04-07 Akim Demaille <akim@epita.fr>
16901
16902 * TODO: Update.
16903
16904 2002-04-07 Akim Demaille <akim@epita.fr>
16905
16906 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
16907 bucket.value as bucket.number.
16908
16909 2002-04-07 Akim Demaille <akim@epita.fr>
16910
16911 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
16912 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
16913 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
16914 RHS, instead of being an index in RITEMS.
16915
16916 2002-04-04 Paul Eggert <eggert@twinsun.com>
16917
16918 * doc/bison.texinfo: Update copyright date.
16919 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
16920 (Symbols): Warn about running Bison in one character set,
16921 but compiling and/or running in an incompatible one.
16922 Warn about character code 256, too.
16923
16924 2002-04-03 Paul Eggert <eggert@twinsun.com>
16925
16926 * src/bison.data (YYSTACK_ALLOC): Depend on whether
16927 YYERROR_VERBOSE is nonzero, not whether it is defined.
16928
16929 Merge changes from bison-1_29-branch.
16930
16931 2002-03-20 Paul Eggert <eggert@twinsun.com>
16932
16933 Merge fixes from Debian bison_1.34-1.diff.
16934
16935 * configure.in (AC_PREREQ): 2.53.
16936
16937 2002-03-20 Akim Demaille <akim@epita.fr>
16938
16939 * src/conflicts.c (log_resolution): Argument `resolution' is const.
16940
16941 2002-03-19 Paul Eggert <eggert@twinsun.com>
16942
16943 * src/bison.simple (YYCOPY): New macro.
16944 (YYSTACK_RELOCATE): Use it.
16945 Remove Type arg; no longer needed. All callers changed.
16946 (yymemcpy): Remove; no longer needed.
16947
16948 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
16949 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
16950
16951 2002-03-19 Akim Demaille <akim@epita.fr>
16952
16953 Test and fix the #line outputs.
16954
16955 * tests/atlocal.at (GCC): New.
16956 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
16957 (Prologue synch line, %union synch line, Postprologue synch line)
16958 (Action synch line, Epilogue synch line): New tests.
16959 * src/reader.c (parse_union_decl): Define the muscle stype_line.
16960 * data/bison.simple, data/bison.c++: Use it.
16961
16962 2002-03-19 Akim Demaille <akim@epita.fr>
16963
16964 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
16965 (Solved SR Conflicts, %expect not enough, %expect right)
16966 (%expect too much): Move to...
16967 * tests/conflicts.at: this new file.
16968
16969 2002-03-19 Akim Demaille <akim@epita.fr>
16970
16971 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
16972 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
16973 that we can move to enums for instance.
16974 * src/output.c (token_definitions_output): Output a list of
16975 `token-name, token-number' instead of the #define.
16976 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
16977
16978 2002-03-14 Akim Demaille <akim@epita.fr>
16979
16980 Use Gettext 0.11.1.
16981
16982 2002-03-09 Robert Anisko <robert@lrde.epita.fr>
16983
16984 * data/bison.c++: Make the user able to add members to the generated
16985 parser by subclassing.
16986
16987 2002-03-05 Robert Anisko <robert@lrde.epita.fr>
16988
16989 * src/reader.c (read_additionnal_code): `c' should be an integer, not
16990 a character.
16991 Reported by Nicolas Tisserand and Nicolas Burrus.
16992
16993 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
16994
16995 * src/reader.c: Warn about lacking semi-colons, do not complain.
16996
16997 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
16998
16999 * data/bison.c++: Remove a debug line.
17000
17001 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
17002
17003 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
17004 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
17005 provide a default implementation.
17006
17007 2002-03-04 Akim Demaille <akim@epita.fr>
17008
17009 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
17010 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
17011 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
17012 * tests/semantic.at (Parsing Guards): Similarly.
17013 * src/reader.at (readgram): Complain if the last rule is not ended
17014 with a semi-colon.
17015
17016 2002-03-04 Akim Demaille <akim@epita.fr>
17017
17018 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
17019 * src/closure.c: here.
17020 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
17021 RTC.
17022 * src/warshall.h, src/warshall.c: Remove.
17023 * tests/sets.at (Broken Closure): Adjust.
17024
17025 2002-03-04 Akim Demaille <akim@epita.fr>
17026
17027 * src/output.c (output_skeleton): tempdir is const.
17028 bytes_read is unused.
17029
17030 2002-03-04 Akim Demaille <akim@epita.fr>
17031
17032 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
17033 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
17034 Update.
17035 From Michael Hayes.
17036
17037 2002-03-04 Akim Demaille <akim@epita.fr>
17038
17039 * src/closure.c (closure): `r' is unused.
17040
17041 2002-03-04 Akim Demaille <akim@epita.fr>
17042
17043 * tests/sets.at (Broken Closure): Add the ending `;'.
17044 * src/reader.at (readgram): Complain if a rule is not ended with a
17045 semi-colon.
17046
17047 2002-03-04 Akim Demaille <akim@epita.fr>
17048
17049 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
17050 (count_sr_conflicts): Use bitset_count.
17051 * src/reduce.c (inaccessable_symbols): Ditto.
17052 (bits_size): Remove.
17053 * src/warshall.h, src/warshall.c: Convert to bitsetv.
17054
17055 2002-03-04 Akim Demaille <akim@epita.fr>
17056
17057 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
17058 * src/reduce.c: Remove the `bitset_zero's following the
17059 `bitset_create's, as now it is performed by the latter.
17060
17061 2002-03-04 Akim Demaille <akim@epita.fr>
17062
17063 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
17064 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
17065 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
17066 latest sources from Michael.
17067
17068 2002-03-04 Akim Demaille <akim@epita.fr>
17069
17070 * src/output.c (output): Don't free the grammar.
17071 * src/reader.c (grammar_free): New.
17072 * src/main.c (main): Call it and don't free symtab here.
17073
17074 2002-03-04 Akim Demaille <akim@epita.fr>
17075
17076 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
17077 before returning.
17078 Reported by Benoit Perrot.
17079
17080 2002-03-04 Akim Demaille <akim@epita.fr>
17081
17082 Use bitset operations when possible, not loops over bits.
17083
17084 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
17085 bitset_or.
17086 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
17087 * src/reduce.c (useless_nonterminals): Formatting changes.
17088 * src/warshall.c (TC): Use bitset_or.
17089
17090 2002-03-04 Akim Demaille <akim@epita.fr>
17091
17092 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
17093 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
17094 Ditto.
17095
17096 2002-03-04 Akim Demaille <akim@epita.fr>
17097
17098 * src/lalr.c (F): Now a bitset*.
17099 Adjust all dependencies.
17100
17101 2002-03-04 Akim Demaille <akim@epita.fr>
17102
17103 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
17104 Adjust all dependencies.
17105
17106 2002-03-04 Akim Demaille <akim@epita.fr>
17107
17108 * src/L0.c, src/LR0.h (nstates): Be size_t.
17109 Adjust comparisons (signed vs unsigned).
17110 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
17111 bitset*.
17112 Adjust all dependencies.
17113
17114 2002-03-04 Akim Demaille <akim@epita.fr>
17115
17116 * src/closure.c (firsts): Now, also a bitset.
17117 Adjust all dependencies.
17118 (varsetsize): Remove, now unused.
17119 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
17120
17121 2002-03-04 Akim Demaille <akim@epita.fr>
17122
17123 * src/print.c: Convert to use bitset.h, not hand coded iterations
17124 over ints.
17125
17126 2002-03-04 Akim Demaille <akim@epita.fr>
17127
17128 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
17129
17130 2002-03-04 Akim Demaille <akim@epita.fr>
17131
17132 * src/closure.c (ruleset): Be a bitset.
17133 (rulesetsize): Remove.
17134
17135 2002-03-04 Akim Demaille <akim@epita.fr>
17136
17137 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
17138 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
17139 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
17140 * src/closure.c (fderives): Be an array of bitsets.
17141
17142 2002-02-28 Robert Anisko <robert@lrde.epita.fr>
17143
17144 * data/bison.c++: Merge the two generated headers. Insert a copyright
17145 notice in each output file.
17146
17147 2002-02-28 Akim Demaille <akim@epita.fr>
17148
17149 * data/bison.c++: Copy the prologue of bison.simple to fetch
17150 useful M4 definitions, such as b4_header_guard.
17151
17152 2002-02-25 Akim Demaille <akim@epita.fr>
17153
17154 * src/getargs.c (version): Give the name of the authors, and use a
17155 translator friendly scheme for the bgr
17156 copyright notice.
17157
17158 2002-02-25 Akim Demaille <akim@epita.fr>
17159
17160 * src/output.c (header_output): Remove, now handled completely via
17161 M4.
17162
17163 2002-02-25 Akim Demaille <akim@epita.fr>
17164
17165 * m4/m4.m4: New, from CVS Autoconf.
17166 * configure.in: Invoke it.
17167 * src/output.c (output_skeleton): Use its result instead of the
17168 hard coded name.
17169
17170 2002-02-25 Akim Demaille <akim@epita.fr>
17171
17172 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
17173 Fileutils 4.1.5.
17174 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
17175 * src/output.c (output_skeleton): Use mkstemp to create a real
17176 temporary file.
17177 Move the filling of `skeleton' and its muscle to...
17178 (prepare): here.
17179 (output): Move the definition of the prologue muscle to...
17180 (prepare): here.
17181 * src/system.h (DEFAULT_TMPDIR): New.
17182
17183 2002-02-14 Paul Eggert <eggert@twinsun.com>
17184
17185 Remove the support for C++ namespace cleanliness; it was
17186 causing more problems than it was curing, since it didn't work
17187 properly on some nonstandard C++ compilers. This can wait
17188 for a proper C++ parser.
17189
17190 * NEWS: Document this.
17191 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
17192 of C++, as it's treated like C now.
17193 * src/bison.simple (YYSTD): Remove.
17194 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
17195 Treat C++ just like Standard C instead of trying to support
17196 namespace cleanliness.
17197
17198 2002-02-14 Akim Demaille <akim@epita.fr>
17199
17200 * tests/regression.at (else): Adjust to Andreas' change.
17201
17202 2002-02-14 Akim Demaille <akim@epita.fr>
17203
17204 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
17205
17206 2002-02-13 Andreas Schwab <schwab@suse.de>
17207
17208 * src/output.c (output_rule_data): Don't output NULL, it might
17209 not be defined yet.
17210
17211 2002-02-11 Robert Anisko <robert@lrde.epita.fr>
17212
17213 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
17214 (Copyright notice): Update.
17215
17216 2002-02-11 Akim Demaille <akim@epita.fr>
17217
17218 * tests/regression.at (%nonassoc and eof): Don't include
17219 nonportable headers.
17220
17221 2002-02-08 Robert Anisko <robert@lrde.epita.fr>
17222
17223 * data/bison.c++: Correct error recovery. Make the user able to
17224 initialize the starting location.
17225
17226 2002-02-07 Akim Demaille <akim@epita.fr>
17227
17228 * tests/input.at: New.
17229
17230 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
17231
17232 * data/bison.c++: Replace some direct m4 expansions by constants. Be
17233 more consistent when naming methods and variables. Put preprocessor
17234 directives around tables only needed for debugging.
17235
17236 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
17237
17238 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
17239 C++ parsers.
17240 (yy::b4_name::parse): Use print_.
17241
17242 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
17243
17244 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
17245
17246 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
17247
17248 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
17249 C++ parsers.
17250 (yy::b4_name::parse): Build verbose error messages, and use error_.
17251
17252 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
17253
17254 * data/bison.c++: Fix m4 quoting in comments.
17255
17256 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
17257
17258 * data/bison.c++: Adjust the parser code. Fix some muscles that were
17259 not expanded by m4.
17260
17261 2002-02-05 Akim Demaille <akim@epita.fr>
17262
17263 * data/bison.c++: Adjust to the M4 back end.
17264 More is certainly needed.
17265
17266 2002-02-05 Akim Demaille <akim@epita.fr>
17267
17268 Give a try to M4 as a back end.
17269
17270 * lib/readpipe.c: New, from wdiff.
17271 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
17272 BISON_HAIRY.
17273 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
17274 specific values. Now it is m4 that performs the lookup.
17275 * src/parse-skel.y: Remove.
17276 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
17277 * src/output.c (actions_output, guards_output)
17278 (token_definitions_output): No longer keeps track of the output
17279 line number, hence remove the second argument.
17280 (guards_output): Check against the guard member of a rule, not the
17281 action member.
17282 Adjust callers.
17283 (output_skeleton): Don't look for the skeleton location, let m4 do
17284 that.
17285 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
17286 file will be used.
17287 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
17288 (prepare): Given that for the time being changesyntax is not
17289 usable in M4, rename the muscles using `-' to `_'.
17290 Define `defines_flag', `output_parser_name' and `output_header_name'.
17291 * src/output.h (actions_output, guards_output)
17292 (token_definitions_output): Adjust prototypes.
17293 * src/scan-skel.l: Instead of scanning the skeletons, it now
17294 processes the output of m4: `__oline__' and `#output'.
17295 * data/bison.simple: Adjust to be used by M4(sugar).
17296 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
17297 to date.
17298 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
17299 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
17300 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
17301 shamelessly stolen from CVS Autoconf.
17302
17303 2002-02-05 Akim Demaille <akim@epita.fr>
17304
17305 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
17306 * configure.in: Check for the declarations of free and malloc.
17307 * src/muscle_tab.c: Adjust.
17308
17309 2002-02-05 Akim Demaille <akim@epita.fr>
17310
17311 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
17312 which have no values.
17313
17314 2002-02-05 Akim Demaille <akim@epita.fr>
17315
17316 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
17317 * data/: here.
17318
17319 2002-01-29 Paul Eggert <eggert@twinsun.com>
17320
17321 * src/bison.simple (YYSIZE_T): Do not define merely because
17322 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
17323 On some platforms, <alloca.h> does not declare YYSTD (size_t).
17324
17325 2002-01-27 Akim Demaille <akim@epita.fr>
17326
17327 Fix `%nonassoc and eof'.
17328
17329 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
17330 which were not properly copied! Replace
17331 memcpy (res->errs, src->errs, src->nerrs);
17332 with
17333 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
17334 !!!
17335 * tests/regression.at (%nonassoc and eof): Adjust to newest
17336 Autotest: `.' is not in the PATH.
17337
17338 2002-01-27 Akim Demaille <akim@epita.fr>
17339
17340 * tests/sets.at (AT_EXTRACT_SETS): New.
17341 (Nullable): Use it.
17342 (Firsts): New.
17343
17344 2002-01-26 Akim Demaille <akim@epita.fr>
17345
17346 * tests/actions.at, tests/calc.at, tests/headers.at,
17347 * tests/torture.at: Adjust to the newest Autotest which no longer
17348 forces `.' in the PATH.
17349
17350 2002-01-25 Akim Demaille <akim@epita.fr>
17351
17352 * tests/regression.at (%nonassoc and eof): New.
17353 Suggested by Robert Anisko.
17354
17355 2002-01-24 Akim Demaille <akim@epita.fr>
17356
17357 Bison dumps core when trying to complain about broken input files.
17358 Reported by Cris van Pelt.
17359
17360 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
17361 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
17362 into...
17363 (Invalid inputs): Strengthen: exercise parse_percent_token.
17364
17365 2002-01-24 Robert Anisko <robert.anisko@epita.fr>
17366
17367 * src/Makefile.am: Add bison.c++.
17368 * src/bison.c++: New skeleton.
17369
17370 2002-01-21 Paolo Bonzini <bonzini@gnu.org>
17371
17372 * po/it.po: New.
17373
17374 2002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
17375
17376 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
17377
17378 2002-01-20 Marc Autret <marc@gnu.org>
17379
17380 * src/files.c (compute_output_file_names): Fix
17381
17382 2002-01-20 Marc Autret <marc@gnu.org>
17383
17384 * tests/output.at: New test.
17385 * src/files.c (compute_base_names): Don't map extensions when
17386 the YACC flag is set, use defaults.
17387 Reported by Evgeny Stambulchik.
17388
17389 2002-01-20 Marc Autret <marc@gnu.org>
17390
17391 * src/system.h: Need to define __attribute__ away for non-GCC
17392 compilers as well (i.e., the vendor C compiler).
17393 Suggested by Albert Chin-A-Young.
17394
17395 2002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
17396
17397 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
17398 canonical definition.
17399 * src/system.h: Use the canonical definition for PARAMS (avoids
17400 a conflict with the macro from lib/hash.h).
17401
17402 2002-01-11 Akim Demaille <akim@epita.fr>
17403
17404 * configure.in: Use AC_FUNC_STRNLEN.
17405 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
17406
17407 2002-01-09 Akim Demaille <akim@epita.fr>
17408
17409 * src/files.c, src/files.h (output_infix): New.
17410 (tab_extension): Remove.
17411 (compute_base_names): Compute the former, drop the latter.
17412 * src/output.c (prepare): Insert the muscles `output-infix', and
17413 `output-suffix'.
17414 * src/parse-skel.y (string, string.1): New.
17415 (section.header): Use it.
17416 (section.yacc): Remove.
17417 (prefix): Remove too.
17418 * src/scan-skel.l: Adjust.
17419 * src/bison.simple, src/bison.hairy: Adjust.
17420
17421 2002-01-09 Akim Demaille <akim@epita.fr>
17422
17423 * configure.in (WERROR_CFLAGS): Compute it.
17424 * src/Makefile.am (CFLAGS): Pass it.
17425 * tests/atlocal.in (CFLAGS): Idem.
17426 * src/files.c: Fix a few warnings.
17427 (get_extension_index): Remove, unused.
17428
17429 2002-01-08 Akim Demaille <akim@epita.fr>
17430
17431 * src/getargs.c (AS_FILE_NAME): New.
17432 (getargs): Use it to convert DOSish file names.
17433 * src/files.c (base_name): Rename as full_base_name to avoid
17434 clashes with `base_name ()'.
17435 (filename_split): New.
17436 (compute_base_names): N-th rewrite, using filename_split.
17437
17438 2002-01-08 Akim Demaille <akim@epita.fr>
17439
17440 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
17441 New, stolen from the Fileutils 4.1.
17442 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
17443 * configure.in: Check for the presence of memrchr, and of its
17444 prototype.
17445
17446 2002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
17447
17448 * lib/hash.h (__P): Added definition for this macro.
17449 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
17450 BUILT_SOURCES, to ensure they are generated first.
17451 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
17452 %error-verbose to allow bootstrapping with bison 1.30x.
17453
17454 2002-01-06 Akim Demaille <akim@epita.fr>
17455
17456 * src/reader.c (parse_braces): Don't fetch the next char, the
17457 convention is to fetch on entry.
17458 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
17459 'switch' without a following semicolon.
17460 * tests/regression.at (braces parsing): New.
17461
17462 2002-01-06 Akim Demaille <akim@epita.fr>
17463
17464 Bison is dead wrong in its RR conflict reports.
17465
17466 * tests/torture.at (GNU Cim Grammar): New.
17467 * src/conflicts.c (count_rr_conflicts): Fix.
17468
17469 2002-01-06 Akim Demaille <akim@epita.fr>
17470
17471 Creating package.m4 from configure.ac causes too many problems.
17472
17473 * tests/Makefile.am (package.m4): Create it by hand,
17474 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
17475
17476 2002-01-06 Akim Demaille <akim@epita.fr>
17477
17478 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
17479 skeleton.h.
17480
17481 2002-01-04 Paul Eggert <eggert@twinsun.com>
17482
17483 * doc/bison.texinfo (Debugging):
17484 Remove YYSTDERR; it's no longer defined or used.
17485 Also, s/cstdio.h/cstdio/.
17486
17487 2002-01-03 Akim Demaille <akim@epita.fr>
17488
17489 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
17490
17491 2002-01-03 Akim Demaille <akim@epita.fr>
17492
17493 * src/parse-skel.y (process_skeleton): Don't bind the parser's
17494 tracing code to --trace, wait for a better --trace option, with
17495 args.
17496
17497 2002-01-03 Akim Demaille <akim@epita.fr>
17498
17499 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
17500 The ISO C++ standard is extremely clear about it: stderr is
17501 considered a macro, not a regular symbol (see table 94 `Header
17502 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
17503 Therefore std:: does not apply to it. It still does with fprintf.
17504 Also, s/cstdio.h/cstdio/.
17505
17506 2002-01-03 Akim Demaille <akim@epita.fr>
17507
17508 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
17509 for non system headers.
17510
17511 2002-01-02 Akim Demaille <akim@epita.fr>
17512
17513 Equip the skeleton chain with location tracking, runtime trace,
17514 pure parser and scanner.
17515
17516 * src/parse-skel.y: Request a pure parser, locations, and prefix
17517 renaming.
17518 (%union): Having several members with the same type does not help
17519 type mismatches, simplify.
17520 (YYPRINT, yyprint): New.
17521 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
17522 (skel_error): this.
17523 Handle locations.
17524 * src/scan-skel.l: Adjust to these changes.
17525 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
17526 (LOCATION_PRINT, skel_control_t): New.
17527
17528 2001-12-30 Akim Demaille <akim@epita.fr>
17529
17530 * src/parse-skel.y: Get rid of the shift/reduce conflict:
17531 replace `gb' with BLANKS.
17532 * src/scan-skel.l: Adjust.
17533
17534 2001-12-30 Akim Demaille <akim@epita.fr>
17535
17536 * src/system.h: We don't need nor want bcopy.
17537 Throw away MS-DOS crap: we don't need getpid.
17538 * configure.in: We don't need strndup. It was even causing
17539 problems: because Flex includes the headers *before* us,
17540 _GNU_SOURCE is not defined by config.h, and therefore strndup was
17541 not visible.
17542 * lib/xstrndup.c: New.
17543 * src/scan-skel.l: Use it.
17544 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
17545 * src/parse-skel.y: Use %directives instead of #defines.
17546
17547 2001-12-30 Akim Demaille <akim@epita.fr>
17548
17549 * src/skeleton.h: New.
17550 * src/output.c (output_parser, output_master_parser): Remove, dead
17551 code.
17552 * src/output.h (get_lines_number, actions_output, guards_output)
17553 (token_definitions_output): Prototype them.
17554 * src/parse-skel.y: Add the license notice.
17555 Include output.h and skeleton.h.
17556 (process_skeleton): Returns void, and takes a single parameter.
17557 * src/scan-skel.l: Add the license notice.
17558 Include skeleton.h.
17559 Don't use %option yylineno: it seems that then Flex imagines
17560 REJECT has been used, and therefore it won't reallocate its
17561 buffers (which makes no other sense to me than a bug). It results
17562 in warnings for `unused: yy_flex_realloc'.
17563
17564 2001-12-30 Robert Anisko <robert.anisko@epita.fr>
17565
17566 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
17567 (MUSCLE_INSERT_PREFIX): ...to there.
17568 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
17569 (MUSCLE_INSERT_PREFIX): Move from here...
17570
17571 * src/bison.hairy: Add a section directive. Put braces around muscle
17572 names. This parser skeleton is still broken, but Bison should not
17573 choke on a bad muscle 'syntax'.
17574 * src/bison.simple: Add a section directive. Put braces around muscle
17575 names.
17576
17577 * src/files.h (strsuffix, stringappend): Add declarations.
17578 (tab_extension): Add declaration.
17579 (short_base_name): Add declaration.
17580
17581 * src/files.c (strsuffix, stringappend): No longer static. These
17582 functions are used in the skeleton parser.
17583 (tab_extension): New.
17584 (compute_base_names): Use the computations done in this function
17585 to guess if the generated parsers should have '.tab' in their
17586 names.
17587 (short_base_name): No longer static.
17588
17589 * src/output.c (output_skeleton): New.
17590 (output): Disable call to output_master_parser, and give a try to
17591 a new skeleton handling system.
17592 (guards_output, actions_output): No longer static.
17593 (token_definitions_output, get_lines_number): No longer static.
17594
17595 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
17596
17597 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
17598 parse-skel.y.
17599
17600 * src/parse-skel.y: New file.
17601 * src/scan-skel.l: New file.
17602
17603 2001-12-29 Akim Demaille <akim@epita.fr>
17604
17605 %name-prefix is broken.
17606
17607 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
17608 Adjust all dependencies.
17609 * tests/headers.at (export YYLTYPE): Strengthen this test: use
17610 %name-prefix.
17611
17612 Renaming yylval but not yylloc is not consistent. Now we do.
17613
17614 * src/bison.simple: Prefix yylloc if used.
17615 * doc/bison.texinfo (Decl Summary): Document that.
17616
17617 2001-12-29 Akim Demaille <akim@epita.fr>
17618
17619 * doc/bison.texinfo: Promote `%long-directive' over
17620 `%long_directive'.
17621 Remove all references to fixed-output-files, yacc is enough.
17622
17623 2001-12-29 Akim Demaille <akim@epita.fr>
17624
17625 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
17626 user prologue. These are defaults.
17627 * tests/actions.at (Mid-rule actions): Make sure the user can
17628 define YYDEBUG and YYERROR_VERBOSE.
17629
17630 2001-12-29 Akim Demaille <akim@epita.fr>
17631
17632 * src/output.c (header_output): Don't forget to export YYLTYPE and
17633 yylloc.
17634 * tests/headers.at (export YYLTYPE): New, make sure it does.
17635 * tests/regression.at (%union and --defines, Invalid CPP headers):
17636 Move to...
17637 * tests/headers.at: here.
17638
17639 2001-12-29 Akim Demaille <akim@epita.fr>
17640
17641 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
17642
17643 2001-12-29 Akim Demaille <akim@epita.fr>
17644
17645 * tests/actions.at (Mid-rule actions): Output on a single line
17646 instead of several.
17647
17648 2001-12-29 Akim Demaille <akim@epita.fr>
17649
17650 * doc/bison.texinfo: Formatting changes.
17651
17652 2001-12-29 Akim Demaille <akim@epita.fr>
17653
17654 Don't store the token defs in a muscle, just be ready to output it
17655 on command. Now possible via `symbols'. Fixes a memory leak.
17656
17657 * src/output.c (token_definitions_output): New.
17658 (output_parser, header_output): Use it.
17659 * src/reader.c (symbols_save): Remove.
17660
17661 2001-12-29 Akim Demaille <akim@epita.fr>
17662
17663 * src/bison.simple: Do not provide a default for YYSTYPE and
17664 YYLTYPE before the user's prologue. Otherwise it's hardly... a
17665 default.
17666
17667 2001-12-29 Akim Demaille <akim@epita.fr>
17668
17669 Mid-rule actions are simply... ignored!
17670
17671 * src/reader.c (readgram): Be sure to attach mid-rule actions to
17672 the empty-rule associated to the dummy symbol, not to the host
17673 rule.
17674 * tests/actions.at (Mid-rule actions): New.
17675
17676 2001-12-29 Akim Demaille <akim@epita.fr>
17677
17678 Memory leak.
17679
17680 * src/reader.c (reader): Free grammar.
17681
17682 2001-12-29 Akim Demaille <akim@epita.fr>
17683
17684 Memory leak.
17685
17686 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
17687 since it allocates it for each state, although only one is needed.
17688 (allocate_storage): Do it here.
17689
17690 2001-12-29 Akim Demaille <akim@epita.fr>
17691
17692 * src/options.h, src/options.c (create_long_option_table): Rename
17693 as...
17694 (long_option_table_new): this, with a clearer prototype.
17695 (percent_table): Remove, unused,
17696 * src/getargs.c (getargs): Adjust.
17697
17698 2001-12-29 Akim Demaille <akim@epita.fr>
17699
17700 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
17701 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
17702 as states.
17703
17704 2001-12-29 Akim Demaille <akim@epita.fr>
17705
17706 * src/lalr.c (build_relations): Rename `states' as `states1'.
17707 Sorry, I don't understand exactly what it is, no better name...
17708
17709 2001-12-29 Akim Demaille <akim@epita.fr>
17710
17711 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
17712 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
17713 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
17714 as rules.
17715
17716 2001-12-29 Akim Demaille <akim@epita.fr>
17717
17718 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
17719 ago.
17720
17721 2001-12-29 Akim Demaille <akim@epita.fr>
17722
17723 * src/reader.c, src/reader.h (user_toknums): Remove.
17724 Adjust all users to use symbols[i]->user_token_number.
17725
17726 2001-12-29 Akim Demaille <akim@epita.fr>
17727
17728 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
17729 Adjust all users to use symbols[i]->prec or ->assoc.
17730
17731 2001-12-29 Akim Demaille <akim@epita.fr>
17732
17733 * src/reader.c, src/reader.h (tags): Remove.
17734 Adjust all users to use symbols[i]->tag.
17735
17736 2001-12-29 Akim Demaille <akim@epita.fr>
17737
17738 * src/gram.h, src/gram.c (symbols): New, similar to state_table
17739 and rule_table.
17740 * src/reader.c (packsymbols): Fill this table.
17741 Drop sprec.
17742 * src/conflicts.c (resolve_sr_conflict): Adjust.
17743 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
17744 single table.
17745 Use symbols[i]->tag instead of tags[i].
17746
17747 2001-12-29 Akim Demaille <akim@epita.fr>
17748
17749 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
17750 In addition, put a comment in there, to replace...
17751 * tests/regression.at (%union and C comments): Remove.
17752
17753 2001-12-29 Akim Demaille <akim@epita.fr>
17754
17755 * tests/regression.at (Web2c Actions): Blindly move the actual
17756 output as expected output. The contents *seem* right to me, but I
17757 can't pretend reading perfectly parser tables... Nonetheless, all
17758 the other tests pass correctly, the table look OK, even though the
17759 presence of `$axiom' is to be noted: AFAICS it is useless (but
17760 harmless).
17761
17762 2001-12-29 Akim Demaille <akim@epita.fr>
17763
17764 * src/reader.c (readgram): Don't add the rule 0 if there were no
17765 rules read. In other words, add it _after_ having performed
17766 grammar sanity checks.
17767 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
17768
17769 2001-12-29 Akim Demaille <akim@epita.fr>
17770
17771 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
17772 visible, and some states have now a different number.
17773
17774 2001-12-29 Akim Demaille <akim@epita.fr>
17775
17776 * src/reader.c (readgram): Bind the initial rule's lineno to that
17777 of the first rule.
17778 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
17779 (Solved SR Conflicts): Adjust rule 0's line number.
17780
17781 2001-12-29 Akim Demaille <akim@epita.fr>
17782
17783 Fix the `GAWK Grammar' failure.
17784
17785 * src/LR0.c (final_state): Initialize to -1 so that we do compute
17786 the reductions of the first state which was mistakenly confused
17787 with the final state because precisely final_state was initialized
17788 to 0.
17789 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
17790 now noticed by Bison.
17791 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
17792 have a reduction on $default.
17793
17794 2001-12-29 Akim Demaille <akim@epita.fr>
17795
17796 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
17797 rule line numbers.
17798 * src/closure.c (print_closure): Likewise.
17799 * src/derives.c (print_derives): Likewise.
17800 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
17801 now.
17802
17803 2001-12-29 Akim Demaille <akim@epita.fr>
17804
17805 * src/lalr.c (lookaheads_print): New.
17806 (lalr): Call it when --trace-flag.
17807 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
17808 are dumped.
17809
17810 2001-12-29 Akim Demaille <akim@epita.fr>
17811
17812 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
17813 when walking through ritem, even via rule->rhs.
17814 * src/reduce.c (dump_grammar, useful_production, reduce_output)
17815 (useful_production, useless_nonterminals): Likewise.
17816 (reduce_grammar_tables): Likewise, plus update nritems.
17817 * src/nullable.c (set_nullable): Likewise.
17818 * src/lalr.c (build_relations): Likewise.
17819 * tests/sets.at (Nullable): Adjust.
17820 Fortunately, now, the $axiom is no longer nullable.
17821
17822 2001-12-29 Akim Demaille <akim@epita.fr>
17823
17824 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
17825 the 0-sentinel.
17826 * src/gram.c (ritem_longest_rhs): Likewise.
17827 * src/reduce.c (nonterminals_reduce): Likewise.
17828 * src/print_graph.c (print_graph): Likewise.
17829 * src/output.c (output_rule_data): Likewise.
17830 * src/nullable.c (set_nullable): Likewise.
17831
17832 2001-12-29 Akim Demaille <akim@epita.fr>
17833
17834 * src/output.c: Comment changes.
17835
17836 2001-12-27 Paul Eggert <eggert@twinsun.com>
17837
17838 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
17839 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
17840 Sparc, as they were causing more porting problems than the
17841 (minor) performance improvement was worth.
17842
17843 Also, catch up with 1.31's YYSTD.
17844
17845 2001-12-27 Akim Demaille <akim@epita.fr>
17846
17847 * src/output.c (output_gram): Rely on nritems, not the
17848 0-sentinel. See below.
17849 Use -1 as separator, not 0.
17850 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
17851 Rely on -1 as separator in yyrhs, instead of 0.
17852 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
17853 twice `Now at end of input', therefore there are two lines less to
17854 expect.
17855
17856 2001-12-27 Akim Demaille <akim@epita.fr>
17857
17858 * tests/regression.at (Unresolved SR Conflicts):
17859 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
17860 below.
17861
17862 2001-12-27 Akim Demaille <akim@epita.fr>
17863
17864 * src/LR0.c (new_state): Recognize the final state by the fact it
17865 is reached by eoftoken.
17866 (insert_start_shifting_state, insert_eof_shifting_state)
17867 (insert_accepting_state, augment_automaton): Remove, since now
17868 these states are automatically computed from the initial state.
17869 (generate_states): Adjust.
17870 * src/print.c: When reporting a rule number to the user, substract
17871 1, so that the axiom rule is rule 0, and the first user rule is 1.
17872 * src/reduce.c: Likewise.
17873 * src/print_graph.c (print_core): For the time being, just as for
17874 the report, depend upon --trace-flags to dump the full set of
17875 items.
17876 * src/reader.c (readgram): Once the grammar read, insert the rule
17877 0: `$axiom: START-SYMBOL $'.
17878 * tests/set.at: Adjust: rule 0 is now displayed, and since the
17879 number of the states has changed (the final state is no longer
17880 necessarily the last), catch up.
17881
17882 2001-12-27 Akim Demaille <akim@epita.fr>
17883
17884 Try to make the use of the eoftoken valid. Given that its value
17885 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
17886 is used instead of > 0 where appropriate, (ii), depend upon nritems
17887 instead of the 0-sentinel.
17888
17889 * src/gram.h, src/gram.c (nritems): New.
17890 Expected to be duplication of nitems, but for the time being...
17891 * src/reader.c (packgram): Assert nritems and nitems are equal.
17892 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
17893 * src/closure.c (print_closure, print_fderives): Likewise.
17894 * src/gram.c (ritem_print): Likewise.
17895 * src/print.c (print_core, print_grammar): Likewise.
17896 * src/print_graph.c: Likewise.
17897
17898 2001-12-27 Akim Demaille <akim@epita.fr>
17899
17900 * src/main.c (main): If there are complains after grammar
17901 reductions, then output the report anyway if requested, then die.
17902 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
17903 * src/reader.c (eoftoken): New.
17904 (parse_token_decl): If the token being defined has value `0', it
17905 is the eoftoken.
17906 (packsymbols): No longer hack `tags' to insert `$' by hand.
17907 Be sure to preserve the value of the eoftoken.
17908 (reader): Make sure eoftoken is defined.
17909 Initialize nsyms to 0: now eoftoken is created just like the others.
17910 * src/print.c (print_grammar): Don't special case the eof token.
17911 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
17912 lie anyway, albeit pleasant.
17913 * tests/calc.at: Exercise error messages with eoftoken.
17914 Change the grammar so that empty input is invalid.
17915 Adjust expectations.
17916 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
17917
17918 2001-12-27 Akim Demaille <akim@epita.fr>
17919
17920 * configure.in: Check the protos of strchr ans strspn.
17921 Replace strchr if needed.
17922 * src/system.h: Provide the protos of strchr, strspn and memchr if
17923 missing.
17924 * lib/strchr.c: New.
17925 * src/reader.c (symbols_save): Use strchr.
17926
17927 2001-12-27 Akim Demaille <akim@epita.fr>
17928
17929 * src/print.c, src/print_graph.c (escape): New.
17930 Use it to quote the TAGS outputs.
17931 * src/print_graph.c (print_state): Now errors are in red, and
17932 reductions in green.
17933 Prefer high to wide: output the state number on a line of its own.
17934
17935 2001-12-27 Akim Demaille <akim@epita.fr>
17936
17937 * src/state.h, src/state.c (reductions_new): New.
17938 * src/LR0.c (set_state_table): Let all the states have a
17939 `reductions', even if reduced to 0.
17940 (save_reductions): Adjust.
17941 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
17942 * src/print.c (print_reductions, print_actions): Adjust.
17943 * src/output.c (action_row): Adjust.
17944
17945 2001-12-27 Akim Demaille <akim@epita.fr>
17946
17947 * src/state.h, src/state.c (errs_new, errs_dup): New.
17948 * src/LR0.c (set_state_table): Let all the states have an errs,
17949 even if reduced to 0.
17950 * src/print.c (print_errs, print_reductions): Adjust.
17951 * src/output.c (output_actions, action_row): Adjust.
17952 * src/conflicts.c (resolve_sr_conflict): Adjust.
17953
17954 2001-12-27 Akim Demaille <akim@epita.fr>
17955
17956 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
17957
17958 2001-12-27 Akim Demaille <akim@epita.fr>
17959
17960 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
17961 * src/print.c: here.
17962 (lookaheadset, shiftset): New, used as additional storage by
17963 print_reductions.
17964 (print_results): Adjust.
17965 (print_shifts, print_gotos, print_errs): New, extracted from...
17966 (print_actions): here.
17967 * src/print_graph.c (print_actions): Remove dead code.
17968
17969 2001-12-27 Akim Demaille <akim@epita.fr>
17970
17971 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
17972 `$n' and `@n'.
17973
17974 2001-12-27 Akim Demaille <akim@epita.fr>
17975
17976 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
17977 (build_relations): Adjust.
17978
17979 2001-12-27 Akim Demaille <akim@epita.fr>
17980
17981 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
17982 duplication.
17983
17984 2001-12-27 Akim Demaille <akim@epita.fr>
17985
17986 * src/reader.c (packgram): Catch nitems overflows.
17987
17988 2001-12-27 Akim Demaille <akim@epita.fr>
17989
17990 * src/files.c, src/files.h (guard_obstack): Remove.
17991 * src/output.c (output): Adjust.
17992 * src/reader.c (parse_braces): New, factoring...
17993 (copy_action, copy_guard): these two which are renamed as...
17994 (parse_action, parse_guard): these.
17995 As a voluntary consequence, using braces around guards is now
17996 mandatory.
17997
17998 2001-12-27 Akim Demaille <akim@epita.fr>
17999
18000 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
18001 * src/reader.c (symbol_list): `guard' and `guard_line' are new
18002 members.
18003 (symbol_list_new): Adjust.
18004 (copy_action): action_line is the first line, not the last.
18005 (copy_guard): Just as for actions, store the `action' only, not
18006 the switch/case/break flesh.
18007 Don't parse the user action that might follow the guard, let...
18008 (readgram): do it, i.e., now, there can be an action after a
18009 guard.
18010 In other words the guard is just explicitly optional.
18011 (packgram): Adjust.
18012 * src/output.c (guards_output): New.
18013 (output_parser): Call it when needed.
18014 (output): Also free the guard and attrs obstacks.
18015 * src/files.c, src/files.h (obstack_save): Remove.
18016 (output_files): Remove.
18017 As a result, if one needs the former `.act' file, using an
18018 appropriate skeleton which requires actions and guards is now
18019 required.
18020 * src/main.c (main): Adjust.
18021 * tests/semantic.at: New.
18022 * tests/regression.at: Use `input.y' as input file name.
18023 Avoid 8+3 problems by requiring input.c when the test needs the
18024 parser.
18025
18026 2001-12-27 Akim Demaille <akim@epita.fr>
18027
18028 * src/reader.c (symbol_list_new): Be sure to initialize all the
18029 fields.
18030
18031 2001-12-27 Akim Demaille <akim@epita.fr>
18032
18033 All the hacks using a final pseudo state are now useless.
18034
18035 * src/LR0.c (set_state_table): state_table holds exactly nstates.
18036 * src/lalr.c (nLA): New.
18037 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
18038 instead of lookaheadsp from the pseudo state (nstate + 1).
18039
18040 2001-12-27 Akim Demaille <akim@epita.fr>
18041
18042 * src/output.c (action_row, token_actions): Use a state_t instead
18043 of a integer, and nlookaheads instead of the following state's
18044 lookaheadsp.
18045
18046 2001-12-27 Akim Demaille <akim@epita.fr>
18047
18048 * src/conflicts.c (log_resolution, flush_shift)
18049 (resolve_sr_conflict, set_conflicts, solve_conflicts)
18050 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
18051 (conflicts_print, print_reductions): Use a state_t instead of an
18052 integer when referring to a state.
18053 As much as possible, depend upon nlookaheads, instead of the
18054 `lookaheadsp' member of the following state (since lookaheads of
18055 successive states are successive, the difference between state n + 1
18056 and n served as the number of lookaheads for state n).
18057 * src/lalr.c (add_lookback_edge): Likewise.
18058 * src/print.c (print_core, print_actions, print_state)
18059 (print_results): Likewise.
18060 * src/print_graph.c (print_core, print_actions, print_state)
18061 (print_graph): Likewise.
18062 * src/conflicts.h: Adjust.
18063
18064 2001-12-27 Akim Demaille <akim@epita.fr>
18065
18066 * src/bison.hairy: Formatting/comment changes.
18067 ANSIfy.
18068 Remove `register' indications.
18069 Add plenty of `static'.
18070
18071 2001-12-27 Akim Demaille <akim@epita.fr>
18072
18073 * src/output.c (prepare): Drop the muscle `ntbase' which
18074 duplicates ntokens.
18075 * src/bison.simple: Formatting/comment changes.
18076 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
18077 is an undocumented synonym.
18078
18079 2001-12-22 Akim Demaille <akim@epita.fr>
18080
18081 * src/output.c (output_table_data): Change the prototype to use
18082 `int' for array ranges: some invocations do pass an int, not a
18083 short.
18084 Reported by Wayne Green.
18085
18086 2001-12-22 Akim Demaille <akim@epita.fr>
18087
18088 Some actions of web2c.y are improperly triggered.
18089 Reported by Mike Castle.
18090
18091 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
18092 * tests/regression.at (Web2c): Rename as...
18093 (Web2c Report): this.
18094 (Web2c Actions): New.
18095
18096 2001-12-22 Akim Demaille <akim@epita.fr>
18097
18098 Reductions in web2c.y are improperly reported.
18099 Reported by Mike Castle.
18100
18101 * src/conflicts.c (print_reductions): Fix.
18102 * tests/regression.at (Web2c): New.
18103
18104 2001-12-18 Akim Demaille <akim@epita.fr>
18105
18106 Some host fail on `assert (!"foo")', which expands to
18107 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
18108 Reported by Nelson Beebee.
18109
18110 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
18111 `#define it_succeeded 0' and `assert (it_succeeded)'.
18112
18113 2001-12-17 Marc Autret <autret_m@epita.fr>
18114
18115 * src/bison.simple: Don't hard code the skeleton line and filename.
18116 * src/output.c (output_parser): Rename 'line' as 'output_line'.
18117 New line counter 'skeleton_line' (skeleton-line muscle).
18118
18119 2001-12-17 Paul Eggert <eggert@twinsun.com>
18120
18121 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
18122 YYDEBUG must be defined to a nonzero value.
18123
18124 * src/bison.simple (yytname): Do not assume that the user defines
18125 YYDEBUG to a properly parenthesized expression.
18126
18127 2001-12-17 Akim Demaille <akim@epita.fr>
18128
18129 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
18130 nlookaheads is a new member.
18131 Adjust all users.
18132 * src/lalr.h (nlookaheads): Remove this orphan declaration.
18133 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
18134 state.
18135
18136 2001-12-17 Akim Demaille <akim@epita.fr>
18137
18138 * src/files.h, src/files.c (open_files, close_files): Remove.
18139 * src/main.c (main): Don't open/close files, nor invoke lex_free,
18140 let...
18141 * src/reader.c (reader): Do it.
18142
18143 2001-12-17 Akim Demaille <akim@epita.fr>
18144
18145 * src/conflicts.c (print_reductions): Formatting changes.
18146
18147 2001-12-17 Akim Demaille <akim@epita.fr>
18148
18149 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
18150 (flush_reduce): New.
18151 (resolve_sr_conflict): Adjust.
18152
18153 2001-12-17 Akim Demaille <akim@epita.fr>
18154
18155 * src/output.c (output_obstack): Be static and rename as...
18156 (format_obstack): this, to avoid any confusion with files.c's
18157 output_obstack.
18158 * src/reader.h (muscle_obstack): Move to...
18159 * src/output.h: here, since it's defined in output.c.
18160
18161 2001-12-17 Akim Demaille <akim@epita.fr>
18162
18163 * src/output.c (action_row, save_column, default_goto)
18164 (sort_actions, matching_state, pack_vector): Better variable
18165 locality.
18166
18167 2001-12-17 Akim Demaille <akim@epita.fr>
18168
18169 * src/output.c: Various formatting changes.
18170
18171 2001-12-17 Akim Demaille <akim@epita.fr>
18172
18173 * src/files.c (output_files): Free the output_obstack.
18174 * src/main.c (main): Call print and print_graph conditionally.
18175 * src/print.c (print): Work unconditionally.
18176 * src/print_graph.c (print_graph): Work unconditionally.
18177 * src/conflicts.c (log_resolution): Output only if verbose_flag.
18178
18179 2001-12-16 Marc Autret <autret_m@epita.fr>
18180
18181 * src/output.c (actions_output): Fix. When we use %no-lines,
18182 there is one less line per action.
18183
18184 2001-12-16 Marc Autret <autret_m@epita.fr>
18185
18186 * src/bison.simple: Remove a useless #line directive.
18187 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
18188 * src/output.c (get_lines_number): New.
18189 (output_parser): Adjust, now takes care about the lines of a
18190 output muscles.
18191 Fix line numbering.
18192 (actions_output): Computes the number of lines taken by actions.
18193 (output_master_parser): Insert new skeleton which is the name of
18194 the output parser file name.
18195
18196 2001-12-15 Marc Autret <autret_m@epita.fr>
18197
18198 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
18199
18200 2001-12-15 Marc Autret <autret_m@epita.fr>
18201
18202 * src/output.c (output_gram): Keep track of the hairy one.
18203
18204 2001-12-15 Akim Demaille <akim@epita.fr>
18205
18206 Make `make distcheck' work.
18207
18208 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
18209 system.h which uses libgettext.h.
18210
18211 2001-12-15 Akim Demaille <akim@epita.fr>
18212
18213 * src/nullable.c (set_nullable): Useless rules must be skipped,
18214 otherwise, since we range over their symbols, we might look at a
18215 nonterminal which no longer ``exists'', i.e., it is not counted in
18216 `nvars', hence we overflow our arrays.
18217
18218 2001-12-15 Akim Demaille <akim@epita.fr>
18219
18220 The header can also be produced directly, without any obstack!
18221 Yahoo!
18222
18223 * src/files.c, src/files.h (defines_obstack): Remove.
18224 (compute_header_macro): Global.
18225 (defines_obstack_save): Remove.
18226 * src/reader.c (parse_union_decl): No longer output to
18227 defines_obstack: its content can be found in the `stype' muscle
18228 anyway.
18229 (output_token_translations): Merge into...
18230 (symbols_output): this.
18231 Rename as...
18232 (symbols_save): this.
18233 (reader): Adjust.
18234 * src/output.c (header_output): New.
18235 (output): Call it.
18236
18237 2001-12-15 Akim Demaille <akim@epita.fr>
18238
18239 * src/reader.c (parse_union_decl): Instead of handling two obstack
18240 simultaneously, use one to define the `stype' muscle, and use the
18241 value of the latter to fill defines_obstack.
18242 (copy_comment): Remove.
18243 (copy_comment2): Work for a single obstack.
18244 Rename as...
18245 (copy_comment): this.
18246
18247 2001-12-15 Akim Demaille <akim@epita.fr>
18248
18249 * src/lex.c, src/lex.h (xgetc): No longer static.
18250 * src/reader.c (parse_union_decl): Revamp.
18251
18252 2001-12-15 Akim Demaille <akim@epita.fr>
18253
18254 Still making progress in separating Bison into (i) input, (ii)
18255 process, (iii) output: now we can directly output the parser file
18256 without using table_obstack at all.
18257
18258 * src/files.c, src/files.h (table_obstack): Bye bye.
18259 (parser_file_name): New.
18260 * src/files.c (compute_output_file_names): Compute it.
18261 * src/output.c (actions_output, output_parser)
18262 (output_master_parser): To a file instead of an obstack.
18263
18264 2001-12-15 Akim Demaille <akim@epita.fr>
18265
18266 Attach actions to rules, instead of pre-outputting them to
18267 actions_obstack.
18268
18269 * src/gram.h (rule_t): action and action_line are new members.
18270 * src/reader.c (symbol_list): Likewise.
18271 (copy_action): Save the actions within the rule.
18272 (packgram): Save them in rule_table.
18273 * src/output.c (actions_output): New.
18274 (output_parser): Use it on `%%actions'.
18275 (output_rule_data): Don't free rule_table.
18276 (output): Do it.
18277 (prepare): Don't save the `action' muscle.
18278 * src/bison.simple: s/%%action/%%actions/.
18279
18280 2001-12-15 Akim Demaille <akim@epita.fr>
18281
18282 * src/reader.c (copy_action): When --yacc, don't append a `;'
18283 to the user action: let it fail if lacking.
18284 Suggested by Arnold Robbins and Tom Tromey.
18285
18286 2001-12-14 Akim Demaille <akim@epita.fr>
18287
18288 * src/lex.c (literalchar): Simply return the char you decoded, non
18289 longer mess around with obstacks and int pointers.
18290 Adjust all callers.
18291
18292 2001-12-14 Akim Demaille <akim@epita.fr>
18293
18294 * src/lex.c (literalchar): Don't escape the special characters,
18295 just decode them, and keep them as char (before, eol was output as
18296 the 2 char string `\n' etc.).
18297 * src/output.c (output_rule_data): Use quotearg to output the
18298 token strings.
18299
18300 2001-12-13 Paul Eggert <eggert@twinsun.com>
18301
18302 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
18303 Do not infringe on the global user namespace when using C++.
18304 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
18305 All uses of `fprintf' and `stderr' changed.
18306
18307 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
18308
18309 2001-12-13 Akim Demaille <akim@epita.fr>
18310
18311 The computation of nullable is broken: it doesn't handle empty
18312 RHS's properly.
18313
18314 * tests/torture.at (GNU AWK Grammar): New.
18315 * tests/sets.at (Nullable): New.
18316 * src/nullable.c (set_nullable): Instead of blindly looping over
18317 `ritems', loop over the rules, and then over their rhs's.
18318
18319 Work around Autotest bugs.
18320
18321 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
18322 frame, because Autotest understand lines starting with a `+' as
18323 traces from the shell. Then, they are not processed properly.
18324 Admittedly an Autotest bug, but we don't have time to wait for
18325 Autotest to catch up.
18326 * tests/regression.at (Broken Closure): Adjust to the new table
18327 frames.
18328 Move to...
18329 * tests/sets.at: here.
18330
18331 2001-12-13 Akim Demaille <akim@epita.fr>
18332
18333 * src/closure.c (closure): Use nrules instead of playing tricks
18334 with BITS_PER_WORD.
18335
18336 2001-12-13 Akim Demaille <akim@epita.fr>
18337
18338 * src/print.c (print_actions): Output the handling of `$' as the
18339 traces do: shifting the token EOF. Before EOF was treated as a
18340 nonterminal.
18341 * tests/regression.at: Adjust some tests.
18342 * src/print_graph.c (print_core): Complete the set of items via
18343 closure. The next-to-final and final states are still unsatisfying,
18344 but that's to be addressed elsewhere.
18345 No longer output the rule numbers, but do output the state number.
18346 A single loop for the shifts + gotos is enough, but picked a
18347 distinct color for each.
18348 (print_graph): Initialize and finalize closure.
18349
18350 2001-12-13 Akim Demaille <akim@epita.fr>
18351
18352 * src/reader.c (readgram): Remove dead code, an strip useless
18353 braces.
18354 (get_type): Remove, unused.
18355
18356 2001-12-12 Akim Demaille <akim@epita.fr>
18357
18358 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
18359 on that of lib/error.c.
18360
18361 2001-12-12 Akim Demaille <akim@epita.fr>
18362
18363 Some hosts don't like `/' in includes.
18364
18365 * src/system.h: Include libgettext.h without qualifying the path.
18366 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
18367 $(top_srcdir).
18368
18369 2001-12-11 Marc Autret <autret_m@epita.fr>
18370
18371 * src/output.c (output_parser): Remove useless muscle.
18372
18373 2001-12-11 Marc Autret <autret_m@epita.fr>
18374
18375 * src/bison.simple: Remove #line just before %%epilogue. It
18376 is now handled in ...
18377 * src/reader.c (read_additionnal_code): Add the output of a
18378 #line for the epilogue.
18379
18380 2001-12-10 Marc Autret <autret_m@epita.fr>
18381
18382 * src/reader.c (copy_definition): Re-use CPP-outed code which
18383 replace precedent remove.
18384 * src/bison.simple: Remove #line before %%prologue because
18385 %%input-line is wrong at this time.
18386
18387 2001-12-10 Marc Autret <autret_m@epita.fr>
18388
18389 * src/reader.c (symbols_output): Clean up.
18390 * src/output.c (output_gram, output): Clean up.
18391
18392 2001-12-10 Akim Demaille <akim@epita.fr>
18393
18394 * src/lalr.c (initialize_lookaheads): New. Extracted from...
18395 * src/LR0.c (set_state_table): here.
18396 * src/lalr.c (lalr): Call it.
18397
18398 2001-12-10 Akim Demaille <akim@epita.fr>
18399
18400 * src/state.h (shifts): Remove the `number' member: shifts are
18401 attached to state, hence no longer need to be labelled with a
18402 state number.
18403
18404 2001-12-10 Akim Demaille <akim@epita.fr>
18405
18406 Now that states have a complete set of members, the linked list of
18407 shifts is useless: just fill directly the state's shifts member.
18408
18409 * src/state.h (shifts): Remove the `next' member.
18410 * src/LR0.c (first_state, last_state): Remove.
18411 Adjust the callers.
18412 (augment_automaton): Don't look for the shifts that must be added
18413 a shift on EOF: it is those of the state we looked for! But now,
18414 since shifts are attached, it is no longer needed to looking
18415 merely by its id: its number.
18416
18417 2001-12-10 Akim Demaille <akim@epita.fr>
18418
18419 * src/LR0.c (augment_automaton): Better variable locality.
18420 Remove an impossible branch: if there is a state corresponding to
18421 the start symbol being shifted, then there is shift for the start
18422 symbol from the initial state.
18423
18424 2001-12-10 Akim Demaille <akim@epita.fr>
18425
18426 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
18427 only when appropriate: when insert_start_shifting_state' is not
18428 invoked.
18429 * tests/regression.at (Rule Line Numbers): Adjust.
18430
18431 2001-12-10 Akim Demaille <akim@epita.fr>
18432
18433 * src/LR0.c (augment_automaton): Now that all states have shifts,
18434 merge the two cases addition shifts to the initial state.
18435
18436 2001-12-10 Akim Demaille <akim@epita.fr>
18437
18438 * src/lalr.c (set_state_table): Move to...
18439 * src/LR0.c: here.
18440 * src/lalr.c (lalr): Don't call it...
18441 * src/LR0.c (generate_states): do it.
18442 * src/LR0.h (first_state): Remove, only the table is used.
18443
18444 2001-12-10 Akim Demaille <akim@epita.fr>
18445
18446 * src/LR0.h (first_shift, first_reduction): Remove.
18447 * src/lalr.c: Don't use first_shift: find shifts through the
18448 states.
18449
18450 2001-12-10 Akim Demaille <akim@epita.fr>
18451
18452 * src/LR0.c: Attach shifts to states as soon as they are
18453 computed.
18454 * src/lalr.c (set_state_table): Instead of assigning shifts to
18455 state, just assert that the mapping was properly done.
18456
18457 2001-12-10 Akim Demaille <akim@epita.fr>
18458
18459 * src/LR0.c (insert_start_shift): Rename as...
18460 (insert_start_shifting_state): this.
18461 (insert_eof_shifting_state, insert_accepting_state): New.
18462 (augment_automaton): Adjust.
18463 Better locality of the variables.
18464 When looking if the start_symbol is shifted from the initial
18465 state, using `while (... symbol != start_symbol ...)' sounds
18466 better than `while (... symbol < start_symbol ...)': If fail
18467 to see how the order between symbols could be relevant!
18468
18469 2001-12-10 Akim Demaille <akim@epita.fr>
18470
18471 * src/getargs.h: Don't declare `spec_name_prefix' and
18472 `spec_file_prefix', declared by src/files.h.
18473 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
18474 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
18475 * src/output.c (prepare): Adjust.
18476 * src/reader.c (symbols_output): Likewise.
18477 * src/vmsgetargs.c: Vaguely adjust, but who cares?
18478
18479 2001-12-10 Akim Demaille <akim@epita.fr>
18480
18481 * src/muscle_tab.c (muscle_init): NULL is a better default than
18482 `"0"'.
18483
18484 2001-12-10 Akim Demaille <akim@epita.fr>
18485
18486 * src/reader.c (reader): Calling symbols_output once is enough.
18487
18488 2001-12-10 Akim Demaille <akim@epita.fr>
18489
18490 Now that states have a complete set of members, the linked list of
18491 reductions is useless: just fill directly the state's reductions
18492 member.
18493
18494 * src/state.h (struct reductions): Remove member `number' and
18495 `next'.
18496 * src/LR0.c (first_reduction, last_reduction): Remove.
18497 (save_reductions): Don't link the new reductions, store them in
18498 this_state.
18499 * src/lalr.c (set_state_table): No need to attach reductions to
18500 states, it's already done.
18501 * src/output.c (output_actions): No longer free the shifts, then
18502 the reductions, then the states: free all the states and their
18503 members.
18504
18505 2001-12-10 Akim Demaille <akim@epita.fr>
18506
18507 * src/options.c (OPTN, DRTV, BOTH): New.
18508 (option_table): Use them.
18509
18510 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
18511 the job of system.h.
18512 * src/options.c: Don't include stdio.h and xalloc.h for the same
18513 reasons.
18514
18515 2001-12-10 Akim Demaille <akim@epita.fr>
18516
18517 * src/output.c (output, prepare): Make sure the values of the
18518 muscles `action' and `prologue' are 0-terminated.
18519
18520 2001-12-10 Akim Demaille <akim@epita.fr>
18521
18522 Clean up GCC warnings.
18523
18524 * src/reader.c (copy_action): `buf' is not used.
18525 (parse_skel_decl): Be static.
18526 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
18527 * src/options.h (create_long_option_table): Have a real prototype.
18528 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
18529 (hash_delete_at): Return const void *.
18530 Adjust casts to preserve the const.
18531
18532 2001-12-10 Akim Demaille <akim@epita.fr>
18533
18534 * configure.in: Require 2.52g.
18535 M4 is not needed, but AUTOM4TE is.
18536 * m4/m4.m4: Remove.
18537 * tests/Makefile.am: Adjust.
18538
18539 2001-12-10 Akim Demaille <akim@epita.fr>
18540
18541 One structure for states is enough, even though theoretically
18542 there are LR(0) states and LALR(1) states.
18543
18544 * src/lalr.h (state_t): Remove.
18545 (state_table): Be state_t **, not state_t *.
18546 * src/state.h (core, CORE_ALLOC): Rename as...
18547 (state_t, STATE_ALLOC): this.
18548 Add the LALR(1) members: shifts, reductions, errs.
18549 * src/LR0.c (state_table): Rename as...
18550 (state_hash): this, to avoid name clashes with the global
18551 `state_table'.
18552 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
18553 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
18554
18555 2001-12-10 Akim Demaille <akim@epita.fr>
18556
18557 Bison dumps core on bash.y.
18558 Reported by Pascal Bart.
18559
18560 * src/warshall.c (bitmatrix_print): New.
18561 (TC): Use it.
18562 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
18563 j must be the outer loop.
18564 * tests/regression.at (Broken Closure): New.
18565
18566 2001-12-05 Akim Demaille <akim@epita.fr>
18567
18568 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
18569 its argument.
18570 Reported by Peter Hamorsky.
18571
18572 2001-12-05 Akim Demaille <akim@epita.fr>
18573
18574 * src/conflicts.c (err_table): Remove.
18575 (resolve_sr_conflict): Adjust.
18576 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
18577 Rename as...
18578 (state_t.reductions, state_t.shifts): this.
18579
18580 2001-12-05 Akim Demaille <akim@epita.fr>
18581
18582 * src/reduce.c (reduce_grammar_tables): No longer disable the
18583 removal of useless rules via CPP but via `if (0)', so that the
18584 compiler still check the code is valid.
18585 For instance, it should have noticed `rline' no longer exists: use
18586 the `line' member of rule_t.
18587 * src/gram.c (dummy, rline): Remove, unused.
18588
18589 2001-12-05 Akim Demaille <akim@epita.fr>
18590
18591 * src/output.c (pack_vector): Use assert, not berror.
18592 * src/main.c (berror): Remove, unused.
18593
18594 2001-12-05 Akim Demaille <akim@epita.fr>
18595
18596 New experimental feature: if --verbose --trace output all the
18597 items of a state, not only its kernel.
18598
18599 * src/print.c (print_core): If `trace_flag', then invoke closure
18600 before outputting the items of the state (print_core is no longer
18601 a correct name them).
18602 (print_results): Invoke new_closure/free_closure if needed.
18603
18604 2001-12-05 Akim Demaille <akim@epita.fr>
18605
18606 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
18607 * src/closure.c, src/closure.h (itemsetsize): Rename as...
18608 (nitemset): for consistency with the rest of the project.
18609
18610 2001-12-05 Akim Demaille <akim@epita.fr>
18611
18612 * src/closure.c (print_closure): Improve.
18613 (closure): Use it for printing input and output.
18614
18615 2001-12-05 Akim Demaille <akim@epita.fr>
18616
18617 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
18618 indexed by nonterminals.
18619
18620 2001-12-05 Akim Demaille <akim@epita.fr>
18621
18622 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
18623 what it was!).
18624 * src/warshall.h: Remove accidental duplication of the content.
18625
18626 2001-12-05 Akim Demaille <akim@epita.fr>
18627
18628 * src/closure.c (set_fderives): De-obfuscate.
18629
18630 2001-12-05 Akim Demaille <akim@epita.fr>
18631
18632 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
18633
18634 2001-12-05 Akim Demaille <akim@epita.fr>
18635
18636 * src/closure.c (set_firsts): De-obfuscate.
18637
18638 2001-12-05 Akim Demaille <akim@epita.fr>
18639
18640 * src/output.c (action_row): De-obfuscate
18641 using the good o' techniques: arrays not pointers, variable
18642 locality, BITISSET, RESETBIT etc.
18643
18644 2001-12-05 Akim Demaille <akim@epita.fr>
18645
18646 Pessimize the code to simplify it: from now on, all the states
18647 have a valid SHIFTS, which NSHIFTS is possibly 0.
18648
18649 * src/LR0.c (shifts_new): Be global and move to..
18650 * src/state.c, src/state.h: here.
18651 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
18652 * src/print_graph: Adjust.
18653
18654 2001-12-05 Akim Demaille <akim@epita.fr>
18655
18656 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
18657 * src/conflicts.c: Use it.
18658 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
18659 incorrectly ``simplified''.
18660
18661 2001-12-05 Akim Demaille <akim@epita.fr>
18662
18663 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
18664 using the good o' techniques: arrays not pointers, variable
18665 locality, BITISSET, RESETBIT etc.
18666
18667 2001-12-05 Akim Demaille <akim@epita.fr>
18668
18669 * src/state.h (SHIFT_SYMBOL): New.
18670 * src/conflicts.c: Use it to deobfuscate.
18671
18672 2001-12-05 Akim Demaille <akim@epita.fr>
18673
18674 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
18675 (print_reductions): De-obfuscate using the good o' techniques:
18676 arrays not pointers, variable locality, BITISSET.
18677
18678 2001-12-05 Akim Demaille <akim@epita.fr>
18679
18680 * src/conflicts.c (print_reductions): Arrays, not pointers.
18681 Use BITISSET.
18682
18683 2001-12-05 Akim Demaille <akim@epita.fr>
18684
18685 * src/conflicts.c (print_reductions): Pessimize, but clarify.
18686
18687 2001-12-05 Akim Demaille <akim@epita.fr>
18688
18689 * src/conflicts.c (print_reductions): Improve variable locality.
18690
18691 2001-12-05 Akim Demaille <akim@epita.fr>
18692
18693 * src/conflicts.c (print_reductions): Pessimize, but clarify.
18694
18695 2001-12-05 Akim Demaille <akim@epita.fr>
18696
18697 * src/conflicts.c (print_reductions): Improve variable locality.
18698
18699 2001-12-05 Akim Demaille <akim@epita.fr>
18700
18701 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
18702 * src/lalr.c: Use them.
18703
18704 2001-12-05 Akim Demaille <akim@epita.fr>
18705
18706 * src/LR0.c (augment_automaton): Formatting changes.
18707 Better variable locality.
18708
18709 2001-12-05 Akim Demaille <akim@epita.fr>
18710
18711 * src/lalr.c (matrix_print): New.
18712 (transpose): Use it.
18713 Use arrays instead of pointers.
18714
18715 2001-12-05 Akim Demaille <akim@epita.fr>
18716
18717 * src/lalr.c (maxrhs): Move to...
18718 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
18719 * src/lalr.c (build_relations): Adjust.
18720
18721 2001-12-05 Akim Demaille <akim@epita.fr>
18722
18723 * src/lalr.c (transpose): Free the memory allocated to the
18724 argument, as it is replaced by the results by the unique caller.
18725 (build_relations): Merely invoke transpose: it handles the memory
18726 deallocation.
18727 Improve variable locality.
18728 Avoid variables used as mere abbreviations.
18729 (compute_lookaheads): Use arrays instead of pointers.
18730
18731 2001-12-05 Akim Demaille <akim@epita.fr>
18732
18733 * src/lalr.c (initialize_F): Improve variable locality.
18734 Avoid variables used as mere abbreviations.
18735
18736 2001-12-05 Akim Demaille <akim@epita.fr>
18737
18738 * src/derives.c (print_derives): Display the ruleno.
18739 * src/lalr.c (initialize_F, transpose): Better variable locality
18740 to improve readability.
18741 Avoid variables used as mere abbreviations.
18742
18743 2001-12-05 Akim Demaille <akim@epita.fr>
18744
18745 * src/lalr.c (traverse): Use arrays instead of pointers.
18746
18747 2001-12-05 Akim Demaille <akim@epita.fr>
18748
18749 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
18750 the handling of squeue.
18751 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
18752
18753 2001-12-05 Akim Demaille <akim@epita.fr>
18754
18755 Because useless nonterminals are now kept alive (instead of being
18756 `destroyed'), we now sometimes examine them, and store information
18757 related to them. Hence we need to know their number, and adjust
18758 memory allocations.
18759
18760 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
18761 static.
18762 * src/LR0.c (allocate_itemsets): The memory allocated to
18763 `symbol_count' was used for two different purpose: once to count
18764 the number of occurrences of each symbol, and later reassigned to
18765 `shift_symbol', containing the symbol that can be shifted from a
18766 given state.
18767 Deobfuscate, i.e., allocate, use and free `symbol_count' here
18768 only, and...
18769 (new_itemsets): Allocate `shift_symbol' here.
18770 (allocate_itemsets): symbol_count includes useless nonterminals.
18771 Make room for them.
18772 (free_storage): Use `free', not `XFREE', for pointers that cannot
18773 be null.
18774
18775 2001-12-05 Akim Demaille <akim@epita.fr>
18776
18777 * src/nullable.c (set_nullable): Deobfuscate the handling of
18778 ritem.
18779 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
18780
18781 2001-12-05 Akim Demaille <akim@epita.fr>
18782
18783 * src/gram.c, src/gram.h (ritem_print): New.
18784 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
18785 (This useless function was defined only to work around VMS linkers
18786 that can't handle compilation units with variables only).
18787 * src/reduce.c (dump_grammar): Use it to trace the construction of
18788 ritem.
18789
18790 2001-12-04 Paul Eggert <eggert@twinsun.com>
18791
18792 * src/bison.simple (union yyalloc): Change member names
18793 to be the same as the stack names.
18794 (yyparse): yyptr is now union yyalloc *, not char *.
18795 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
18796 and may generate better code on some machines.
18797 (yystpcpy): Use prototype if __STDC__ is defined, not just
18798 if __cplusplus is defined.
18799
18800 2001-11-30 Akim Demaille <akim@epita.fr>
18801
18802 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
18803 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
18804 Gettext doesn't compile cleanly, and dies with -Werror.
18805 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
18806 Include WARNING_CFLAGS here.
18807 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
18808 before being defined.
18809
18810 2001-11-27 Paul Eggert <eggert@twinsun.com>
18811
18812 * lib/quotearg.h (quotearg_n, quotearg_n_style):
18813 First arg is int, not unsigned.
18814 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
18815 (SIZE_MAX, UINT_MAX): New macros.
18816 (quotearg_n_options): Abort if N is negative.
18817 Avoid overflow check on hosts where size_t is 64 bits and int
18818 is 32 bits, as overflow is impossible there.
18819 Fix off-by-one typo that caused unnecessary reallocation.
18820
18821 2001-11-29 Paul Eggert <eggert@twinsun.com>
18822
18823 Name space cleanup in generated parser.
18824
18825 * doc/bison.texinfo (Bison Parser): Discuss system headers
18826 and their effect on the user name space.
18827
18828 * src/bison.simple:
18829 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
18830 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
18831 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
18832
18833 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
18834 on user names when possible.
18835
18836 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
18837 Simplify test for whather <alloca.h> exists.
18838
18839 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
18840
18841 (<stdio.h>): Include if YYDEBUG.
18842
18843 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
18844 ! defined (yyoverflow) && ! defined (yymemcpy).
18845
18846 (yymemcpy, yyparse): Rename local variables as needed so that
18847 they all begin with 'yy'.
18848
18849 (yystrlen, yystpcpy): New functions.
18850
18851 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
18852 All uses changed.
18853
18854 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
18855 instead of relying on string.h functions. Use YYSTACK_ALLOC
18856 and YYSTACK_FREE instead of malloc and free.
18857
18858 2001-11-30 Akim Demaille <akim@epita.fr>
18859
18860 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
18861 before their first uses.
18862 (YYBISON, YYPURE): Move to the top of the output.
18863
18864 2001-11-30 Akim Demaille <akim@epita.fr>
18865
18866 * tests/reduce.at (Useless Nonterminals): Fix.
18867
18868 2001-11-30 Akim Demaille <akim@epita.fr>
18869
18870 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
18871 if body instead of `;' to pacify GCC's warnings.
18872
18873 2001-11-30 Akim Demaille <akim@epita.fr>
18874
18875 Instead of mapping the LHS of unused rules to -1, keep the LHS
18876 valid, but flag the rules as invalid.
18877
18878 * src/gram.h (rule_t): `useful' is a new member.
18879 * src/print.c (print_grammar): Adjust.
18880 * src/derives.c (set_derives): Likewise.
18881 * src/reader.c (packgram, reduce_output): Likewise.
18882 * src/reduce.c (reduce_grammar_tables): Likewise.
18883 * tests/reduce.at (Underivable Rules, Useless Rules): New.
18884
18885 2001-11-30 Akim Demaille <akim@epita.fr>
18886
18887 * src/reduce.c (reduce_output): Formatting changes.
18888 * src/print.c (print_results, print_grammar): Likewise.
18889 * tests/regression.at (Rule Line Numbers)
18890 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
18891
18892 2001-11-30 Akim Demaille <akim@epita.fr>
18893
18894 * src/reduce.c (nonterminals_reduce): Instead of throwing away
18895 useless nonterminals, move them at the end of the symbol arrays.
18896 (reduce_output): Adjust.
18897 * tests/reduce.at (Useless Nonterminals): Adjust.
18898
18899 2001-11-30 Akim Demaille <akim@epita.fr>
18900
18901 * src/reduce.c: Various comment/formatting changes.
18902 (nonterminals_reduce): New, extracted from...
18903 (reduce_grammar_tables): here.
18904 (reduce_grammar): Call nonterminals_reduce.
18905
18906 2001-11-29 Paul Eggert <eggert@twinsun.com>
18907
18908 * src/bison.simple (YYSTACK_REALLOC): Remove.
18909 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
18910 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
18911 New macros.
18912 (union yyalloc): New type.
18913 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
18914 an arbitrary restriction on hosts where size_t is wider than int.
18915
18916 (yyparse): Don't dump core if alloca or malloc fails; instead, report
18917 a parser stack overflow. Allocate just one block of memory for all
18918 three stacks, instead of allocating three blocks; this typically is
18919 faster and reduces fragmentation.
18920
18921 Do not limit the number of items in the stack to a value that fits
18922 in 'int', as this is an arbitrary limit on hosts with 64-bit
18923 size_t and 32-bit int.
18924
18925 2001-11-29 Marc Autret <autret_m@epita.fr>
18926
18927 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
18928 of defining YYERROR_VERBOSE.
18929 [AT_DATA]: $4 is now out of C declarations in the prologue.
18930
18931 2001-11-28 Marc Autret <autret_m@epita.fr>
18932
18933 * src/reader.c (parse_dquoted_param): New.
18934 (parse_skel_decl): Use it.
18935 * src/lex.h: Add its prototype.
18936 * src/lex.c (literalchar): Become not static.
18937
18938 2001-11-28 Marc Autret <autret_m@epita.fr>
18939
18940 * src/output.h: And put its extern declaration here.
18941 * src/output.c (error_verbose): Define here.
18942 (prepare): Echo name modification.
18943 * src/getargs.h: Clean its extern declaration.
18944 * src/getargs.c (error_verbose_flag): Remove.
18945 (getargs): Remove case 'e'.
18946 * src/options.c (option_table): 'error-verbose' is now seen as simple
18947 percent option.
18948 Include output.h.
18949
18950 * src/reader.c (read_declarations): Remove case tok_include.
18951 (parse_include_decl): Remove.
18952 * src/lex.h (token_t): Remove tok_include.
18953 * src/options.c (option_table): 'include' is now a simple command line
18954 option.
18955
18956 2001-11-28 Marc Autret <autret_m@epita.fr>
18957
18958 * src/bison.simple: Adjust muscle names.
18959 * src/muscle_tab.c (muscle_init): Also rename the muscles.
18960 * src/output.c (prepare): s/_/-/ for the muscles names.
18961 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
18962
18963 2001-11-28 Marc Autret <autret_m@epita.fr>
18964
18965 * src/bison.simple: Fix debug.
18966 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
18967
18968 2001-11-28 Akim Demaille <akim@epita.fr>
18969
18970 * src/LR0.c (shifts_new): New.
18971 (save_shifts, insert_start_shift, augment_automaton): Use it.
18972
18973 2001-11-28 Akim Demaille <akim@epita.fr>
18974
18975 * src/closure.c (closure): `b' and `ruleno' denote the same value:
18976 keep ruleno only.
18977
18978 2001-11-28 Akim Demaille <akim@epita.fr>
18979
18980 * src/closure.c (closure): Instead of looping over word in array
18981 then bits in words, loop over bits in array.
18982
18983 2001-11-28 Akim Demaille <akim@epita.fr>
18984
18985 * src/closure.c (closure): No longer optimize the special case
18986 where all the bits of `ruleset[r]' are set to 0, to make the code
18987 clearer.
18988
18989 2001-11-28 Akim Demaille <akim@epita.fr>
18990
18991 * src/closure.c (closure): `r' and `c' are new variables, used to
18992 de-obfuscate accesses to RULESET and CORE.
18993
18994 2001-11-28 Akim Demaille <akim@epita.fr>
18995
18996 * src/reduce.c (reduce_print): Use ngettext.
18997 (dump_grammar): Improve the trace accuracy.
18998
18999 2001-11-28 Akim Demaille <akim@epita.fr>
19000
19001 * src/reduce.c (dump_grammar): Don't translate trace messages.
19002
19003 2001-11-28 Akim Demaille <akim@epita.fr>
19004
19005 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
19006 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
19007 as all tags are free'ed afterwards.
19008 From Enrico Scholz.
19009
19010 2001-11-27 Paul Eggert <eggert@twinsun.com>
19011
19012 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
19013 use alloca when we didn't want to, and vice versa.
19014
19015 2001-11-27 Marc Autret <autret_m@epita.fr>
19016
19017 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
19018 initialization.
19019 * src/output.c (prepare): Remove its update.
19020
19021 2001-11-27 Marc Autret <autret_m@epita.fr>
19022
19023 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
19024 Use %error-verbose.
19025
19026 2001-11-27 Marc Autret <autret_m@epita.fr>
19027
19028 * src/bison.simple: Remove YYERROR_VERBOSE using.
19029 Use %%error_verbose.
19030 (yyparse): Likewise.
19031 * src/output.c (prepare): Give its final value.
19032 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
19033 * src/getargs.h: Add its extern declaration.
19034 * src/getargs.c (error_verbose_flag): New int.
19035 (getargs): Update to catch new case.
19036 * src/options.c (option_table): 'error-verbose' is a new option.
19037 (shortopts): Update.
19038
19039 2001-11-27 Akim Demaille <akim@epita.fr>
19040
19041 * src/system.h: Use intl/libgettext.h.
19042 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
19043
19044 2001-11-27 Akim Demaille <akim@epita.fr>
19045
19046 * tests/torture.at (Exploding the Stack Size with Malloc):
19047 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
19048
19049 2001-11-27 Akim Demaille <akim@epita.fr>
19050
19051 * src/files.c: Include error.h.
19052 Reported by Hans Aberg.
19053
19054 2001-11-26 Marc Autret <autret_m@epita.fr>
19055
19056 * src/reader.c (parse_include_decl): New, not yet implemented.
19057 (read_declarations): Add case tok_include.
19058 * src/getargs.h (include): Add its extern definition.
19059 * src/getargs.c (include): New const char *.
19060 (getargs): Add case '-I'.
19061 * src/options.c (option_table): Add include as command line and
19062 percent option.
19063 * src/lex.h (token_t): Add tok_include.
19064
19065 2001-11-26 Akim Demaille <akim@epita.fr>
19066
19067 * src/reader.c (readgram): Make sure rules for mid-rule actions
19068 have a lineno equal to that of their host rule.
19069 Reported by Hans Aberg.
19070 * tests/regression.at (Rule Line Numbers): New.
19071
19072 2001-11-26 Akim Demaille <akim@epita.fr>
19073
19074 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
19075 size_ts.
19076
19077 2001-11-26 Akim Demaille <akim@epita.fr>
19078
19079 * src/complain.c, src/complain.h (error): Remove, provided by
19080 lib/error.[ch].
19081
19082 2001-11-26 Akim Demaille <akim@epita.fr>
19083
19084 * src/reader.c (read_declarations): Don't abort on tok_illegal,
19085 issue an error message.
19086 * tests/regression.at (Invalid %directive): New.
19087 Reported by Hans Aberg.
19088
19089 2001-11-26 Akim Demaille <akim@epita.fr>
19090
19091 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
19092 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
19093
19094 2001-11-26 Akim Demaille <akim@epita.fr>
19095
19096 * src/conflicts.c (conflicts_print): Don't complain at all when
19097 there are no reduce/reduce conflicts, and as many shift/reduce
19098 conflicts as expected.
19099 * tests/regression.at (%expect right): Adjust.
19100
19101 2001-11-23 Akim Demaille <akim@epita.fr>
19102
19103 * lib/alloca.c: Update, from fileutils.
19104
19105 2001-11-23 Akim Demaille <akim@epita.fr>
19106
19107 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
19108
19109 2001-11-23 Akim Demaille <akim@epita.fr>
19110
19111 * src/system.h: Include alloca.h.
19112 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
19113
19114 2001-11-23 Akim Demaille <akim@epita.fr>
19115
19116 * src/print_graph.c (print_actions): Remove `rule', unused.
19117 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
19118 pacify GCC's signed < unsigned warnings.
19119 * src/closure.c (itemsetsize): Likewise.
19120 * src/reader.c (symbol_list_new): Static.
19121
19122 2001-11-23 Akim Demaille <akim@epita.fr>
19123
19124 Attaching lineno to buckets is stupid, since only one copy of each
19125 symbol is kept, only the line of the first occurrence is kept too.
19126
19127 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
19128 * src/reader.c (rline_allocated): Remove, unused.
19129 (symbol_list): Have a `line' member.
19130 (symbol_list_new): New.
19131 (readgram): Use it.
19132 * src/print.c (print_grammar): Output the rule line numbers.
19133 * tests/regression.at (Solved SR Conflicts)
19134 (Unresolved SR Conflicts): Adjust.
19135 Reported by Hans Aberg.
19136
19137 2001-11-22 Marc Autret <autret_m@epita.fr>
19138
19139 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
19140
19141 2001-11-22 Marc Autret <autret_m@epita.fr>
19142
19143 * src/muscle_tab.c (muscle_init): Remove initialization of
19144 skeleton muscle.
19145 * src/output.c (output_master_parser): Do it here.
19146
19147 2001-11-20 Akim Demaille <akim@epita.fr>
19148
19149 * po/sv.po: New.
19150 * configure.in (ALL_LINGUAS): Adjust.
19151 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
19152 longer contains strings to translate.
19153
19154 2001-11-19 Akim Demaille <akim@epita.fr>
19155
19156 * src/conflicts.c (conflicts_print): Add a missing \n.
19157
19158 2001-11-19 Akim Demaille <akim@epita.fr>
19159
19160 * src/nullable.c (nullable_print): New.
19161 (set_nullable): Call it when tracing.
19162 Better locality of variables.
19163
19164 2001-11-19 Akim Demaille <akim@epita.fr>
19165
19166 * src/print.c (print_actions): Better locality of variables.
19167
19168 2001-11-19 Akim Demaille <akim@epita.fr>
19169
19170 * src/derives.c (print_derives): Fix and enrich.
19171 * src/closure.c (print_fderives): Likewise.
19172
19173 2001-11-19 Akim Demaille <akim@epita.fr>
19174
19175 * src/closure.c (itemsetend): Remove, replaced with...
19176 (itemsetsize): new.
19177
19178 2001-11-19 Akim Demaille <akim@epita.fr>
19179
19180 * src/LR0.c (kernel_end): Remove, replaced with...
19181 (kernel_size): new.
19182
19183 2001-11-19 Akim Demaille <akim@epita.fr>
19184
19185 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
19186 to clarify.
19187
19188 2001-11-19 Akim Demaille <akim@epita.fr>
19189
19190 * src/closure.c (closure): Use arrays instead of pointers to clarify.
19191
19192 2001-11-19 Akim Demaille <akim@epita.fr>
19193
19194 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
19195 trace messages.
19196 * src/LR0.c: Likewise.
19197 (allocate_itemsets): Use arrays instead of pointers to clarify.
19198
19199 2001-11-19 Akim Demaille <akim@epita.fr>
19200
19201 * src/getargs.c (statistics_flag): Replace with...
19202 (trace_flag): New.
19203 (longopts): Accept --trace instead of --statistics.
19204 * src/getargs.h, src/options.c: Adjust.
19205 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
19206 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
19207
19208 2001-11-19 Akim Demaille <akim@epita.fr>
19209
19210 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
19211 pointers to clarify the code.
19212 (save_reductions, save_shifts): Factor common parts of alternatives.
19213
19214 2001-11-19 Akim Demaille <akim@epita.fr>
19215
19216 * src/LR0.c (new_state, get_state): Complete TRACE code.
19217 * src/closure.c: Include `reader.h' to get `tags', needed by the
19218 trace code.
19219 Rename the conditional DEBUG as TRACE.
19220 Output consistently TRACEs to stderr, not stdout.
19221 * src/derives.c: Likewise.
19222 * src/reduce.c: (inaccessable_symbols): Using if is better style
19223 than goto.
19224 Use `#if TRACE' instead of `#if 0' for tracing code.
19225
19226 2001-11-19 Akim Demaille <akim@epita.fr>
19227
19228 * src/system.h (LIST_FREE, shortcpy): New.
19229 * src/LR0.c: Use them.
19230 * src/output.c (free_itemsets, free_reductions, free_shifts):
19231 Remove, replaced by LIST_FREE.
19232
19233 2001-11-19 Akim Demaille <akim@epita.fr>
19234
19235 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
19236 (REDUCTIONS_ALLOC): New.
19237 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
19238 allocation.
19239
19240 2001-11-19 Akim Demaille <akim@epita.fr>
19241
19242 * src/LR0.c (new_state): Complete trace code.
19243 * src/nullable.c (set_nullable): Don't translate traces.
19244
19245 2001-11-19 Akim Demaille <akim@epita.fr>
19246
19247 * src/print_graph.c (print_core): Better locality of variables.
19248 * src/print.c (print_core): Likewise.
19249
19250 2001-11-19 Akim Demaille <akim@epita.fr>
19251
19252 * src/vcg.c: You do the output, so you are responsible of the
19253 handling of VCG syntax, in particular: use quotearg.
19254 * src/print_graph.c: Don't.
19255 (print_actions): Don't output the actions as part of the nodes,
19256 since that's the job of the edges.
19257 (print_state): Don't output by hand: fill the node description,
19258 and ask for its output.
19259
19260 2001-11-19 Akim Demaille <akim@epita.fr>
19261
19262 * src/bison.simple (yyparse): When verbosely reporting an error,
19263 no longer put additional quotes around token names.
19264 * tests/calc.at: Adjust.
19265
19266 2001-11-19 Akim Demaille <akim@epita.fr>
19267
19268 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
19269 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
19270 * src/output.c: Adjust.
19271
19272 2001-11-19 Akim Demaille <akim@epita.fr>
19273
19274 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
19275 (rule_t): this.
19276 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
19277
19278 2001-11-19 Akim Demaille <akim@epita.fr>
19279
19280 * src/gram.h (rule_t): New.
19281 (rule_table): New.
19282 (rrhs, rlhs): Remove, part of state_t.
19283 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
19284 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
19285 * src/reader.c, src/reduce.c: Adjust.
19286
19287 2001-11-19 Akim Demaille <akim@epita.fr>
19288
19289 * src/reader.c (symbols_output): New, extracted from...
19290 (packsymbols): Here.
19291 (reader): Call it.
19292
19293 2001-11-19 Akim Demaille <akim@epita.fr>
19294
19295 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
19296 (maxrhs): this new function.
19297
19298 2001-11-19 Akim Demaille <akim@epita.fr>
19299
19300 * src/lalr.c (F): New macro to access the variable F.
19301 Adjust.
19302
19303 2001-11-19 Akim Demaille <akim@epita.fr>
19304
19305 * src/lalr.h (LA): New macro to access the variable LA.
19306 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
19307 * src/lalr.c: Adjust.
19308
19309 2001-11-19 Akim Demaille <akim@epita.fr>
19310
19311 * src/lalr.c (initialize_LA): Only initialize LA. Let...
19312 (set_state_table): handle the `lookaheads' members.
19313
19314 2001-11-19 Akim Demaille <akim@epita.fr>
19315
19316 * src/lalr.h (lookaheads): Removed array, whose contents is now
19317 a member of...
19318 (state_t): this structure.
19319 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
19320 Adjust.
19321
19322 2001-11-19 Akim Demaille <akim@epita.fr>
19323
19324 * src/lalr.h (consistent): Removed array, whose contents is now
19325 a member of...
19326 (state_t): this structure.
19327 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
19328 Adjust.
19329
19330 2001-11-19 Akim Demaille <akim@epita.fr>
19331
19332 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
19333 contents are now members of...
19334 (state_t): this structure.
19335 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
19336 Adjust.
19337
19338 2001-11-19 Akim Demaille <akim@epita.fr>
19339
19340 * src/lalr.h (state_t): New.
19341 (state_table): Be a state_t * instead of a core **.
19342 (accessing_symbol): Remove, part of state_t.
19343 * src/lalr.c: Adjust.
19344 (set_accessing_symbol): Merge into...
19345 (set_state_table): this.
19346 * src/print_graph.c, src/conflicts.c: Adjust.
19347
19348 2001-11-14 Akim Demaille <akim@epita.fr>
19349
19350 * tests/calc.at, tests/output.at, tests/regression.at,
19351 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
19352 now the tests are run in private dirs, therefore AC_CLEANUP and
19353 family can be simplified to 0-ary.
19354 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
19355 use abs. path to find config.h.
19356 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
19357 stderr, there can be way too much random noise.
19358 Instead pass -Werror to GCC and rely on the exit status.
19359 Reported by Wolfram Wagner.
19360
19361 2001-11-14 Akim Demaille <akim@epita.fr>
19362
19363 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
19364 defined only if yyoverflow is defined, to avoid `warning: unused
19365 variable `yyvs1''.
19366 Reported by The Test Suite.
19367
19368 2001-11-14 Akim Demaille <akim@epita.fr>
19369
19370 * src/print.c: Include reduce.h.
19371 Reported by Hans Aberg.
19372
19373 2001-11-14 Akim Demaille <akim@epita.fr>
19374
19375 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
19376 Revert a previous patch: these are really const.
19377 * src/conflicts.c (conflict_report): Additional useless pair of
19378 braces to pacify GCC's warnings for `if () if () {} else {}'.
19379 * src/lex.c (parse_percent_token): Replace equal_offset with
19380 arg_offset.
19381 arg is const.
19382 Be sure to strdup `arg' when used, since there is no reason for
19383 token_buffer not to change.
19384
19385 2001-11-14 Akim Demaille <akim@epita.fr>
19386
19387 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
19388 definition.
19389 * src/main.c (main): Use them.
19390 Suggested by Hans Aberg.
19391
19392 2001-11-12 Akim Demaille <akim@epita.fr>
19393
19394 * src/system.h (ngettext): Now that we use ngettext, be sure to
19395 provide a default definition when NLS are not used.
19396
19397 2001-11-12 Akim Demaille <akim@epita.fr>
19398
19399 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
19400 Use @kbd to denote user input.
19401 (Language and Grammar): ANSIfy the example.
19402 Adjust its layout for info/notinfo.
19403 (Location Tracking Calc): Output error messages to stderr.
19404 Output locations in a more GNUtically correct way.
19405 Fix a couple of Englishos.
19406 Adjust @group/@end group pairs.
19407
19408 2001-11-12 Akim Demaille <akim@epita.fr>
19409
19410 %expect was not functioning at all.
19411
19412 * src/conflicts.c (expected_conflicts): Set to -1.
19413 (conflict_report): Use ngettext.
19414 (conflicts_print): Check %expect and make its violation an error.
19415 * doc/bison.texinfo (Expect Decl): Adjust.
19416 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
19417 * tests/regression.at (%expect not enough, %expect right)
19418 (%expect too much): New.
19419
19420 2001-11-12 Akim Demaille <akim@epita.fr>
19421
19422 * tests/regression.at (Conflicts): Rename as...
19423 (Unresolved SR Conflicts): this.
19424 (Solved SR Conflicts): New.
19425
19426 2001-11-12 Akim Demaille <akim@epita.fr>
19427
19428 * src/reduce.c (print_results): Rename as...
19429 (reduce_output): This.
19430 Output to OUT, passed as argument, instead of output_obstack.
19431 (dump_grammar): Likewise.
19432 (reduce_free): New.
19433 Also free V1.
19434 (reduce_grammar): No longer call reduce_output, since...
19435 * src/print.c (print_results): do it.
19436 * src/main.c (main): Call reduce_free;
19437
19438 2001-11-12 Akim Demaille <akim@epita.fr>
19439
19440 * src/conflicts.c (print_reductions): Accept OUT as argument.
19441 Output to it, not to output_obstack.
19442 * src/print.c (print_actions): Adjust.
19443
19444 2001-11-12 Akim Demaille <akim@epita.fr>
19445
19446 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
19447 the result instead of using...
19448 (src_total, rrc_total, src_count, rrc_count): Remove.
19449 (any_conflicts): Remove.
19450 (print_conflicts): Split into...
19451 (conflicts_print, conflicts_output): New.
19452 * src/conflicts.h: Adjust.
19453 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
19454 * src/print.c (print_grammar): Issue `\n' between two rules.
19455 * tests/regression.at (Conflicts): New.
19456 Reported by Tom Lane.
19457
19458 2001-11-12 Akim Demaille <akim@epita.fr>
19459
19460 * tests/regression.at (Invalid input): Remove, duplicate with
19461 ``Invalid input: 1''.
19462
19463 2001-11-12 Akim Demaille <akim@epita.fr>
19464
19465 * tests/torture.at (AT_DATA_STACK_TORTURE)
19466 (Exploding the Stack Size with Alloca)
19467 (Exploding the Stack Size with Malloc): New.
19468
19469 2001-11-12 Akim Demaille <akim@epita.fr>
19470
19471 * src/bison.simple (YYSTACK_REALLOC): New.
19472 (yyparse) [!yyoverflow]: Use it and free the old stack.
19473 Reported by Per Allansson.
19474
19475 2001-11-12 Pascal Bart <pascal.bart@epita.fr>
19476
19477 * src/bison.simple: Define type yystype instead of YYSTYPE, and
19478 define CPP macro, which substitute YYSTYPE by yystype.
19479 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
19480 with yyltype/YYLTYPE. This allows inclusion of the generated
19481 header within the parser if the compiler, such as GGC, accepts
19482 multiple equivalent #defines.
19483 From Akim.
19484
19485 2001-11-05 Akim Demaille <akim@epita.fr>
19486
19487 * src/reader.c (symbols_output): New, extracted from...
19488 (packsymbols): here.
19489 (reader): Adjust.
19490
19491 2001-11-05 Akim Demaille <akim@epita.fr>
19492
19493 * src/lex.c (parse_percent_token): s/quotearg/quote/.
19494
19495 2001-11-05 Akim Demaille <akim@epita.fr>
19496
19497 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
19498 pattern.
19499
19500 2001-11-05 Akim Demaille <akim@epita.fr>
19501
19502 * src/options.h (struct option_table_struct): set_flags is void*.
19503 * src/options.c (longopts): Support `--output' and `%output'.
19504 (usage): Adjust.
19505 * src/lex.h (tok_setopt): Remove, replaced with...
19506 (tok_intopt, tok_stropt): these new guys.
19507 * src/lex.c (getopt.h): Not needed.
19508 (token_buffer, unlexed_token_buffer): Not const.
19509 (percent_table): Promote `-' over `_' in directive names.
19510 Active `%name-prefix', `file-prefix', and `output'.
19511 (parse_percent_token): Accept possible arguments to directives.
19512 Promote `-' over `_' in directive names.
19513
19514 2001-11-04 Akim Demaille <akim@epita.fr>
19515
19516 * doc/bison.texinfo (Decl Summary): Split the list into
19517 `directives for grammars' and `directives for bison'.
19518 Sort'em.
19519 Add description of `%name-prefix', `file-prefix', and `output'.
19520 Promote `-' over `_' in directive names.
19521 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
19522 Simplify the description of `--name-prefix'.
19523 Promote `-' over `_' in directive names.
19524 Promote `--output' over `--output-file'.
19525 Fix the description of `--defines'.
19526 * tests/output.at: Exercise %file-prefix and %output.
19527
19528 2001-11-02 Akim Demaille <akim@epita.fr>
19529
19530 * doc/refcard.tex: Update.
19531
19532 2001-11-02 Akim Demaille <akim@epita.fr>
19533
19534 * src/symtab.h (SUNDEF): New.
19535 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
19536 stand for `uninitialized', instead of 0.
19537 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
19538 * src/lex.c (lex): Adjust.
19539
19540 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
19541 Number it 0.
19542 Let yylex return it instead of a plain 0.
19543 Reported by Dick Streefland.
19544
19545 2001-11-02 Akim Demaille <akim@epita.fr>
19546
19547 * tests/regression.at (Mixing %token styles): New test.
19548
19549 2001-11-02 Akim Demaille <akim@epita.fr>
19550
19551 * src/reader.c (parse_thong_decl): Formatting changes.
19552 (token_translations_init): New, extracted from...
19553 (packsymbols): Here.
19554 Adjust.
19555
19556 2001-11-01 Akim Demaille <akim@epita.fr>
19557
19558 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
19559 Check that `9foo.y' produces correct cpp guards.
19560 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
19561 guards.
19562 Reported by Wwp.
19563
19564 2001-11-01 Akim Demaille <akim@epita.fr>
19565
19566 * tests/regression.at (Invalid input: 2): New.
19567 * src/lex.c (unlexed_token_buffer): New.
19568 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
19569 too.
19570 Reported by Wwp.
19571
19572 2001-11-01 Akim Demaille <akim@epita.fr>
19573
19574 * tests/calc.at: Catch up with 1.30.
19575 * configure.in: Bump to 1.49a.
19576 Adjust to newer Autotest.
19577
19578 2001-10-19 Pascal Bart <pascal.bart@epita.fr>
19579
19580 * src/conflicts.c: Move global variables rrc_total and src_total ...
19581 (print_conflicts): here.
19582 * src/output.c (output): Free global variable user_toknums.
19583 * src/lex.c (token_obstack): Become static.
19584
19585 2001-10-18 Akim Demaille <akim@epita.fr>
19586
19587 * tests/atlocal.in (GCC): Add.
19588 * tests/calc.at: s/m4_match/m4_bmatch/.
19589 s/m4_patsubst/m4_bpatsubst/.
19590 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
19591 * configure.in: AC_SUBST(GCC).
19592
19593 2001-10-14 Marc Autret <autret_m@epita.fr>
19594
19595 * src/options.c (create_long_option_table): Fix.
19596
19597 2001-10-10 Akim Demaille <akim@epita.fr>
19598
19599 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
19600
19601 2001-10-04 Akim Demaille <akim@epita.fr>
19602
19603 * src/reader.c (parse_union_decl): Push the caracters in
19604 union_obstack, not attrs_obstack.
19605
19606 2001-10-04 Akim Demaille <akim@epita.fr>
19607
19608 Merge in the branch 1.29.
19609
19610 * src/reader.c (packsymbols): Use a temporary obstack for
19611 `%%tokendef', since output_stack is already used elsewhere.
19612
19613 2001-10-02 Akim Demaille <akim@epita.fr>
19614
19615 Bump 1.29d.
19616
19617 2001-10-02 Akim Demaille <akim@epita.fr>
19618
19619 Version 1.29c.
19620
19621 2001-10-02 Akim Demaille <akim@epita.fr>
19622
19623 * tests/regression.at (Invalid CPP headers): New.
19624 From Alexander Belopolsky.
19625 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
19626
19627 2001-10-02 Akim Demaille <akim@epita.fr>
19628
19629 * tests/regression.at (Invalid input): New.
19630 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
19631 Reported by Shura.
19632
19633 2001-10-02 Akim Demaille <akim@epita.fr>
19634
19635 * tests/calc.at: Now that --debug works, the tests must be adjusted.
19636
19637 2001-10-02 Akim Demaille <akim@epita.fr>
19638
19639 * src/output.c (output_parser): Assert `skeleton'.
19640 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
19641 systems.
19642 From Shura.
19643
19644 2001-10-01 Marc Autret <autret_m@epita.fr>
19645
19646 * src/lex.h: Echo modifications.
19647 * src/lex.c (unlex): Parameter is now token_t.
19648 From Hans Aberg.
19649
19650 2001-10-01 Marc Autret <autret_m@epita.fr>
19651
19652 * src/main.c: Include lex.h.
19653 From Hans Aberg.
19654
19655 2001-09-29 Akim Demaille <akim@epita.fr>
19656
19657 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
19658
19659 2001-09-28 Akim Demaille <akim@epita.fr>
19660
19661 * tests/testsuite.at: Update to newer Autotest.
19662 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
19663
19664 2001-09-27 Akim Demaille <akim@epita.fr>
19665
19666 Position independent wrapper.
19667
19668 * tests/bison: Remove.
19669 * tests/bison.in: New.
19670 * configure.in: Adjust.
19671
19672 2001-09-27 Paul Eggert <eggert@twinsun.com>
19673
19674 Port quotearg fixes from tar 1.13.24.
19675
19676 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
19677 tm to be declared.
19678 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
19679 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
19680
19681 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
19682 * m4/mbrtowc.m4: New file.
19683 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
19684 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
19685
19686 2001-09-27 Akim Demaille <akim@epita.fr>
19687
19688 Bump to 1.29c.
19689
19690 2001-09-27 Akim Demaille <akim@epita.fr>
19691
19692 Version 1.29b.
19693
19694 2001-09-25 Akim Demaille <akim@epita.fr>
19695
19696 * src/system.h: Include `xalloc.h'.
19697 Remove it from the C files.
19698 * src/files.c (output_files): Free the obstacks.
19699 * src/lex.c (init_lex): Rename as...
19700 (lex_init): this.
19701 (lex_free): New.
19702 * src/main.c (main): Use it.
19703
19704 2001-09-24 Marc Autret <autret_m@epita.fr>
19705
19706 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
19707 to output informations in fout (FILE*).
19708 (open_graph, close_graph): Likewise.
19709 (output_graph, output_edge, output_node): Likewise.
19710 * src/vcg.h: Update function prototypes.
19711 * src/print_graph.c (print_graph): Open output graph file.
19712 (print_actions): Adjust.
19713 * src/files.h: Remove extern declaration.
19714 * src/files.c: Remove graph_obstack declaration.
19715 (open_files): Remove graph_obstack initialization.
19716 (output_files): Remove graph_obstack saving.
19717
19718 2001-09-24 Marc Autret <autret_m@epita.fr>
19719
19720 * src/files.c (compute_output_file_names): Fix.
19721
19722 2001-09-24 Marc Autret <autret_m@epita.fr>,
19723 Akim Demaille <akim@epita.fr>
19724
19725 * src/reader.c (reader): Remove call to free_symtab ().
19726 * src/main.c (main): Call it here.
19727 Include symtab.h.
19728 * src/conflicts.c (initialize_conflicts): Rename as...
19729 (solve_conflicts): this.
19730 * src/print.c (print_core, print_actions, print_state)
19731 (print_grammar): Dump to a file instead a `output_obstack'.
19732 (print_results): Dump `output_obstack', and then proceed with the
19733 FILE *.
19734 * src/files.c (compute_output_file_names, close_files): New.
19735 (output_files): Adjust.
19736 * src/main.c (main): Adjust.
19737
19738 2001-09-23 Marc Autret <autret_m@epita.fr>
19739
19740 * src/files.c (compute_header_macro): Computes header macro name
19741 from spec_defines_file when given.
19742
19743 2001-09-23 Marc Autret <autret_m@epita.fr>
19744
19745 * src/files.c (output_files): Add default extensions.
19746
19747 2001-09-22 Akim Demaille <akim@epita.fr>
19748
19749 * src/conflicts.c (finalize_conflicts): Rename as...
19750 (free_conflicts): this.
19751
19752 2001-09-22 Akim Demaille <akim@epita.fr>
19753
19754 * src/gram.c (gram_free): Rename back as...
19755 (dummy): this.
19756 (output_token_translations): Free `token_translations'.
19757 * src/symtab.c (free_symtab): Free the tag field.
19758
19759 2001-09-22 Akim Demaille <akim@epita.fr>
19760
19761 Remove `translations' as it is always set to true.
19762
19763 * src/gram.h: Adjust.
19764 * src/reader.c (packsymbols, parse_token_decl): Adjust
19765 * src/print.c (print_grammar): Adjust.
19766 * src/output.c (output_token_translations): Adjust.
19767 * src/lex.c (lex): Adjust.
19768 * src/gram.c: Be sure the set pointers to NULL.
19769 (dummy): Rename as...
19770 (gram_free): this.
19771
19772 2001-09-22 Akim Demaille <akim@epita.fr>
19773
19774 * configure.in: Invoke AM_LIB_DMALLOC.
19775 * src/system.h: Use dmalloc.
19776 * src/LR0.c: Be sure to have pointers initialized to NULL.
19777 (allocate_itemsets): Allocate kernel_items only if needed.
19778
19779 2001-09-22 Akim Demaille <akim@epita.fr>
19780
19781 * configure.in: Bump to 1.29b.
19782 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
19783 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
19784 need xmalloc.c in calc.y.
19785 From Pascal Bart.
19786
19787 2001-09-21 Akim Demaille <akim@epita.fr>
19788
19789 Version 1.29a.
19790 * Makefile.maint, config/config.guess, config/config.sub,
19791 * config/missing: Update from masters.
19792 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
19793 upon package.m4.
19794 * configure.in (ALL_LINGUAS): Add `tr'.
19795
19796 2001-09-21 Akim Demaille <akim@epita.fr>
19797
19798 * tests/Makefile.am (package.m4): Move to...
19799 ($(srcdir)/$(TESTSUITE)): here.
19800
19801 2001-09-20 Akim Demaille <akim@epita.fr>
19802
19803 * src/complain.c: No longer try to be standalone: use system.h.
19804 Don't assume __STDC__ is defined to 1. Just test if it is defined.
19805 * src/complain.h: Likewise.
19806 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
19807 Remove the unused variable `n'.
19808 From Albert Chin-A-Young.
19809
19810 2001-09-18 Marc Autret <autret_m@epita.fr>
19811
19812 * doc/bison.1: Update.
19813 * doc/bison.texinfo (Bison Options): Update --defines and --graph
19814 descriptions.
19815 (Option Cross Key): Update.
19816 Add --graph.
19817
19818 2001-09-18 Marc Autret <autret_m@epita.fr>
19819
19820 * tests/regression.at: New test (comment in %union).
19821
19822 2001-09-18 Marc Autret <autret_m@epita.fr>
19823
19824 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
19825 do that.
19826 Reported by Keith Browne.
19827
19828 2001-09-18 Marc Autret <autret_m@epita.fr>
19829
19830 * tests/output.at: Add tests for --defines and --graph.
19831
19832 2001-09-18 Marc Autret <autret_m@epita.fr>
19833
19834 * tests/output.at: Removes tests of %{header,src}_extension features.
19835
19836 2001-09-18 Akim Demaille <akim@epita.fr>
19837
19838 * tests/Makefile.am (package.m4): New.
19839 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
19840 (_AT_CHECK_CALC_ERROR): Likewise.
19841 Factor the `, ' part of verbose error messages.
19842
19843 2001-09-18 Marc Autret <autret_m@epita.fr>
19844
19845 * src/getargs.c (longopts): Declare --defines and --graph as options
19846 with optional arguments.
19847 * src/files.h: Add extern declarations.
19848 * src/files.c (spec_graph_file, spec_defines_file): New.
19849 (output_files): Update.
19850 Remove CPP-outed code.
19851
19852 2001-09-18 Marc Autret <autret_m@epita.fr>
19853
19854 Turn off %{source,header}_extension feature.
19855
19856 * src/files.c (compute_exts_from_gf): Update.
19857 (compute_exts_from_src): Update.
19858 (output_files): CPP-out useless code.
19859 * src/files.h: Remove {header,source}_extension extern declarations.
19860 * src/reader.c (parse_dquoted_param): CPP-out.
19861 (parse_header_extension_decl): Remove.
19862 (parse_source_extension_decl): Remove.
19863 (read_declarations): Remove cases tok_{hdrext,srcext}.
19864 * src/lex.c (percent_table): Remove {header,source}_extension entries.
19865 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
19866
19867 2001-09-10 Akim Demaille <akim@epita.fr>
19868
19869 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
19870 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
19871 (AT_CHECK_OUTPUT): this.
19872 Merely check ls' exit status, its output is useless.
19873
19874 2001-09-10 Akim Demaille <akim@epita.fr>
19875
19876 * tests/calc.at: Use m4_match.
19877 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
19878
19879 2001-09-10 Marc Autret <autret_m@epita.fr>,
19880 Akim Demaille <akim@epita.fr>
19881
19882 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
19883 enum color_e.
19884 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
19885 to `normal'.
19886 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
19887 * src/lex.h: Adjust prototype.
19888 (token_t): Add `tok_undef'.
19889 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
19890 (parse_percent_token): Now returns token_t.
19891 Add default statement in switch.
19892 (lex): Separate `c' as an input variable, from the token_t result
19893 part.
19894 (unlexed): Is a token_t.
19895
19896 2001-09-10 Akim Demaille <akim@epita.fr>
19897
19898 * configure.in: Bump to 1.29a.
19899
19900 2001-09-07 Akim Demaille <akim@epita.fr>
19901
19902 Version 1.29.
19903
19904 2001-08-30 Akim Demaille <akim@epita.fr>
19905
19906 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
19907 * m4/atconfig.m4: Remove.
19908 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
19909 * tests/bison: New.
19910 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
19911 m4_if, m4_patsubst, and m4_regexp.
19912 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
19913 `input' file instead of echo.
19914
19915 2001-08-29 Akim Demaille <akim@epita.fr>
19916
19917 Bump to 1.28e.
19918
19919 2001-08-29 Akim Demaille <akim@epita.fr>
19920
19921 Version 1.28d.
19922
19923 2001-08-29 Paul Eggert <eggert@twinsun.com>
19924
19925 * src/bison.simple (yyparse): Don't take the address of an
19926 item before the start of an array, as that doesn't conform to
19927 the C Standard.
19928
19929 2001-08-29 Robert Anisko <anisko_r@epita.fr>
19930
19931 * doc/bison.texinfo (Location Tracking Calc): New node.
19932
19933 2001-08-29 Paul Eggert <eggert@twinsun.com>
19934
19935 * src/output.c (output): Do not define const, as this now
19936 causes more problems than it cures.
19937
19938 2001-08-29 Akim Demaille <akim@epita.fr>
19939
19940 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
19941 the nodes.
19942 Be sure to tag the `detailmenu'.
19943
19944 2001-08-29 Akim Demaille <akim@epita.fr>
19945
19946 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
19947 download in a tmp dir.
19948
19949 2001-08-28 Marc Autret <autret_m@epita.fr>
19950
19951 * config/depcomp: New file.
19952
19953 2001-08-28 Marc Autret <autret_m@epita.fr>
19954
19955 * doc/bison.1 (mandoc): Adjust.
19956 From Juan Manuel Guerrero.
19957
19958 2001-08-28 Marc Autret <autret_m@epita.fr>
19959
19960 * src/print_graph.c (print_state): Fix.
19961
19962 2001-08-27 Marc Autret <autret_m@epita.fr>
19963
19964 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
19965 char * members.
19966 Echo modifications to the functions prototypes.
19967 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
19968
19969 2001-08-27 Marc Autret <autret_m@epita.fr>
19970
19971 * src/vcg.c: Include `xalloc.h'.
19972 (add_colorentry): New.
19973 (add_classname): New.
19974 (add_infoname): New.
19975 * src/vcg.h: Add new prototypes.
19976
19977 2001-08-27 Akim Demaille <akim@epita.fr>
19978
19979 * Makefile.maint: Sync. again with CVS Autoconf.
19980
19981 2001-08-27 Akim Demaille <akim@epita.fr>
19982
19983 * Makefile.maint: Formatting changes.
19984 (po-update, cvs-update, update): New targets.
19985 (AMTAR): Remove.
19986
19987 2001-08-27 Akim Demaille <akim@epita.fr>
19988
19989 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
19990 * Makefile.maint: Sync. with CVS Autoconf.
19991
19992 2001-08-27 Marc Autret <autret_m@epita.fr>
19993
19994 * src/vcg.h (struct infoname_s): New.
19995 (struct colorentry_s): New.
19996 (graph_s): New fields {vertical,horizontal}_order in structure.
19997 Add `infoname' field.
19998 Add `colorentry' field;
19999 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
20000 (G_HORIZONTAL_ORDER): New.
20001 (G_INFONAME): New.
20002 (G_COLORENTRY): New.
20003 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
20004 Add output of `infoname'.
20005 Add output of `colorentry'.
20006
20007 2001-08-27 Marc Autret <autret_m@epita.fr>
20008
20009 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
20010 This one shadowed a global parameter.
20011
20012 2001-08-24 Marc Autret <autret_m@epita.fr>
20013
20014 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
20015 instead of `unsigned'.
20016 (print_state): Do not call obstack_object_size () in obstack_grow ()
20017 to avoid macro variables shadowing.
20018
20019 2001-08-23 Marc Autret <autret_m@epita.fr>
20020
20021 * src/lex.c (percent_table): Typo: s/naem/name/.
20022 Add graph option.
20023 Normalize new options declarations.
20024
20025 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
20026
20027 * tests/suite.at: Exercise %header_extension and %source_extension.
20028
20029 2001-08-16 Marc Autret <autret_m@epita.fr>
20030
20031 * src/reader.c (parse_dquoted_param): New.
20032 (parse_header_extension_decl): Use it.
20033 (parse_source_extension_decl): Likewise.
20034
20035 2001-08-16 Marc Autret <autret_m@epita.fr>
20036
20037 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
20038 (get_xxxx_str): Use assert () instead of complain ().
20039 Remove return invokations in default cases.
20040 (get_decision_str): Modify default behaviour. Remove second argument.
20041 Echo modifications on calls.
20042 (output_graph): Fix.
20043
20044 2001-08-16 Marc Autret <autret_m@epita.fr>
20045
20046 * src/getargs.c (usage): Update with ``-g, --graph''.
20047
20048 2001-08-16 Marc Autret <autret_m@epita.fr>
20049
20050 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
20051 (Option Cross Key): Likewise.
20052 * doc/bison.1: Update.
20053
20054 2001-09-25 Pascal Bart <pascal.bart@epita.fr>
20055
20056 * src/output.c (output_master_parser): Don't finish action_obstack.
20057 (output_parser): Don't care about the muscle action, here.
20058 (prepare): Copy the action_obstack in the action muscle.
20059 (output): Free action_obstack.
20060
20061 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
20062
20063 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
20064 will contain `%union' declaration.
20065 (parse_union_decl): Delete #line directive output.
20066 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
20067 informations about %union.
20068 (parse_union_decl): Copy the union_obstack in the muscle stype.
20069 * src/bison.simple: Add new #line directive.
20070 Add typdef %%stype YYSTYPE.
20071
20072 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
20073
20074 * src/bison.simple: Add new `#line' directive.
20075
20076 2001-09-22 Pascal Bart <pascal.bart@epita.fr>
20077
20078 * src/bison.simple: New `#line' directive.
20079 * src/output.c (output_parser): Support new dynamic muscle input_line.
20080
20081 2001-09-22 Marc Autret <autret_m@epita.fr>
20082
20083 * src/output.c (output_master_parser): New.
20084 (output_parser): Be more re-entrant.
20085
20086 2001-09-21 Marc Autret <autret_m@epita.fr>
20087
20088 * src/reader.c (copy_definition, parse_union_decl): Update and use
20089 `linef' muscle.
20090 (copy_action): Likewise.
20091 Use obstack_1grow ().
20092 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
20093
20094 2001-09-21 Marc Autret <autret_m@epita.fr>
20095
20096 * src/options.c (option_table): Adjust.
20097 * src/lex.c (parse_percent_token): Fix.
20098
20099 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
20100
20101 * src/options.c (symtab.h): Include it, need by lex.h.
20102
20103 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
20104
20105 * src/lex.c (parse_percent_token): Change type of variable `tx', which
20106 is now an option_table_struct*.
20107 (option_strcmp): New function option_strcmp.
20108 (parse_percent_token): Call option_strcmp.
20109 * src/getargs.c (xalloc.h, options.h): Include it.
20110 (getargs): Call create_long_option_table.
20111 (getargs): Free longopts at the end of the function.
20112 (shortopts): Move in options.c.
20113 * src/options.c (create_long_option_table): New function. Convert
20114 information from option_table to option structure.
20115 * src/reader.c (options.h): Include it.
20116
20117 * src/Makefile.am: Adjust.
20118 * src/options.c (option_table): Create from longopts and percent_table.
20119 * src/getargs.c (longopts): Delete.
20120 * src/lex.c (struct percent_table_struct): Delete.
20121 (percent_table): Delete.
20122 (options.h): Include it.
20123 * src/options.c: Create.
20124 * src/options.h: Create.
20125 Declare enum opt_access_e.
20126 Define struct option_table_struct.
20127
20128 2001-09-20 Marc Autret <autret_m@epita.fr>
20129
20130 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
20131 sections of Bison.
20132
20133 2001-09-19 Pascal Bart <pascal.bart@epita.fr>
20134
20135 * src/bison.simple: s/%%filename/%%skeleton.
20136 * src/muscle_tab.c (getargs.h): Include it.
20137 (muscle_init): Insert new muscle skeleton.
20138
20139 2001-09-18 Pascal Bart <pascal.bart@epita.fr>
20140
20141 * src/output.c (output_parser): Delete unused variable actions_dumped.
20142
20143 2001-09-07 Pascal Bart <pascal.bart@epita.fr>
20144
20145 * src/output.c (output): Delete call to reader_output_yylsp.
20146 * src/reader.c (reader): Likewise.
20147 * src/reader.h: Delete declaration of reader_output_yylsp.
20148
20149 2001-09-02 Marc Autret <autret_m@epita.fr>
20150
20151 * src/reader.c: Include muscle_tab.h.
20152 (parse_union_decl): Update.
20153 (parse_macro_decl): Rename parse_muscle_decl.
20154 Update to use renamed functions and variable.
20155 (read_declarations, copy_action, read_additionnal_code, : Updated
20156 with correct variables and functions names.
20157 (packsymbols, reader): Likewise.
20158
20159 * src/reader.h (muscle_obstack): Extern declaration update.
20160
20161 * src/output.c: Include muscle_tab.h
20162 In all functions using macro_insert, change by using muscle_insert ().
20163 (macro_obstack): Rename muscle_obstack.
20164 Echo modifications in the whole file.
20165 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
20166 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
20167 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
20168
20169 * src/muscle_tab.h: Update double inclusion macros.
20170 (macro_entry_s): Rename muscle_entry_s.
20171 Update prototypes.
20172
20173 * src/muscle_tab.c: Include muscle_tab.h.
20174 Rename macro_tabble to muscle_table.
20175 (mhash1, mhash2, mcmp): Use muscle_entry.
20176 (macro_init): Rename muscle_init. Update.
20177 (macro_insert): Rename muscle_insert. Update.
20178 (macro_find): Rename muscle_find. Update.
20179
20180 * src/main.c: Include muscle_tab.h.
20181 (main): Call muscle_init ().
20182 * src/Makefile.am (bison_SOURCES): Echo modifications.
20183
20184 2001-09-02 Marc Autret <autret_m@epita.fr>
20185
20186 Now the files macro_tab.[ch] are named muscle_tab.[ch].
20187
20188 * src/muscle_tab.c, src/muscle_tab.h: Add files.
20189
20190 2001-09-02 Marc Autret <autret_m@epita.fr>
20191
20192 * src/macrotab.c, src/macrotab.h: Remove.
20193
20194 2001-09-01 Pascal Bart <pascal.bart@epita.fr>
20195
20196 * src/reader.c (copy_guard): Use muscle to specify the `#line'
20197 filename.
20198
20199 2001-09-01 Marc Autret <autret_m@epita.fr>
20200
20201 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
20202 to an explicit value to activate the feature. We do it here.
20203
20204 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
20205
20206 * src/output.c (prepare): Delete the `filename' muscule insertion.
20207 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
20208 (parse_union_decl): Likewise.
20209 * src/macrotab.c (macro_init): Initialize filename by infile.
20210
20211 2001-08-31 Marc Autret <autret_m@epita.fr>
20212
20213 * src/bison.simple (YYLSP_NEEDED): New definition.
20214 * src/output.c (prepare): Add macro insertion of `locations_flag'
20215
20216 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
20217
20218 * src/output.c (prepare): Delete insertion of previous muscles,
20219 and insert the `prefix' muscles.
20220 * src/macrotab.c (macro_init): Likewise.
20221 (macro_init): Initialization prefix directive by `yy'.
20222 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
20223 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
20224 yylval, yydebug, yyerror, yynerrs and yyparse.
20225 New directive `#define' to substitute yydebug, ... with option
20226 name_prefix.
20227
20228 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
20229
20230 * src/main.c (main): Standardize.
20231 * src/output.c (output_table_data, output_parser): Likewise.
20232 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
20233
20234 2001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
20235
20236 * src/reader.c (read_additionnal_code): Rename %%user_code to
20237 %%epilogue.
20238 * src/output.c (output): Rename %%declarations to %%prologue.
20239 * src/bison.simple: Echo modifications.
20240
20241 2001-08-31 Marc Autret <autret_m@epita.fr>
20242
20243 * src/reader.c (readgram): CleanUp.
20244 (output_token_defines): Likewise.
20245 (packsymbols): Likewise.
20246 (reader): Likewise.
20247 * src/output.c (output): CPP-out useless code.
20248
20249 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
20250
20251 * src/reader.c (reader): Delete obsolete call to function
20252 output_trailers and output_headers.
20253 * src/output.h: Remove obsolete functions prototypes of output_headers
20254 and output_trailers.
20255
20256 2001-08-30 Pascal Bart <pascal.bart@epita.fr>
20257
20258 * src/main.c: Include macrotab.h.
20259 * src/macrotab.h (macro_entry_s): Constify fields.
20260 Adjust functions prototypes.
20261 * src/macrotab.c (macro_insert): Constify key and value.
20262 (macro_find): Constify key.
20263 (macro_insert): Include 'xalloc.h'
20264 (macro_insert): Use XMALLOC.
20265 (macro_find): Constify return value.
20266 * src/output.c (output_table_data): Rename table to table_data.
20267 (output_parser): Constify macro_key, macro_value.
20268
20269 2001-08-30 Marc Autret <autret_m@epita.fr>
20270
20271 * src/reader.c (parse_skel_decl): New.
20272 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
20273 * src/lex.h (token_t): New token `tok_skel'.
20274 * src/lex.c (percent_table): Add skeleton option entry.
20275 Standardize.
20276
20277 2001-08-29 Marc Autret <autret_m@epita.fr>
20278
20279 * src/bison.simple: Add %%user_code directive at the end.
20280 * src/reader.c (read_additionnal_code): New.
20281 (reader): Use it.
20282 * src/output.c (output_program): Remove.
20283 (output): Update.
20284
20285 2001-08-28 Marc Autret <autret_m@epita.fr>
20286
20287 * src/output.c (output_actions): Clean up.
20288 (output_gram): CPP-out useless code.
20289 * src/reader.c (reader): Clean up, CPP-out useless code.
20290
20291 2001-08-28 Pascal Bart <pascal.bart@epita.fr>
20292
20293 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
20294 directive.
20295 * src/bison.simple: Add `%%definitions'.
20296
20297 2001-08-28 Marc Autret <autret_m@epita.fr>
20298
20299 * config/depcomp: New file.
20300
20301 2001-08-27 Paul Eggert <eggert@twinsun.com>
20302
20303 * src/bison.simple (yyparse): Don't take the address of an
20304 item before the start of an array, as that doesn't conform to
20305 the C Standard.
20306
20307 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
20308
20309 * src/output.c (output): Remove the initialization of the macro
20310 obstack. It was done too late here.
20311
20312 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
20313 completely wrong.
20314 (reader): Initialize the macro obstack here, since we need it to grow
20315 '%define' directives.
20316
20317 * src/reader.h: Declare the macro obstack as extern.
20318
20319 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
20320
20321 * src/output.c (output_parser): Fix. Store single '%' characters in
20322 the output obstack instead of throwing them away.
20323
20324 2001-08-27 Akim Demaille <akim@epita.fr>
20325
20326 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
20327
20328 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20329
20330 * lib/Makefile.am: Adjust.
20331
20332 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20333
20334 * src/bison.simple: Update and add '%%' directives.
20335
20336 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20337
20338 * src/reader.c (reader): Remove calls to 'output_headers' and
20339 'output_trailers'. Remove some C output.
20340 (readgram): Disable a piece of code that was writing a default
20341 definition for 'YYSTYPE'.
20342 (reader_output_yylsp): Remove.
20343 (packsymbols): Output token defintions to a macro.
20344 (copy_definition): Disable C output.
20345
20346 * src/reader.c (parse_macro_decl): New function used to parse macro
20347 declarations.
20348 (copy_string2): Put the body of copy_string into this new function.
20349 Add a parameter to let the caller choose whether he wants to copy the
20350 string delimiters or not.
20351 (copy_string): Be a simple call to copy_string2 with the last argument
20352 bound to true.
20353 (read_declarations): Add case for macro definition.
20354 (copy_identifier): New.
20355 (parse_macro_decl): Read macro identifiers using copy_identifier
20356 rather than lex.
20357
20358 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20359
20360 * src/output.c (prepare): Add prefixed names.
20361 (output_parser): Output semantic actions.
20362 (output_parser): Fix bug on '%%line' directives.
20363
20364 * src/output.c (output_headers): Remove. The C code printed by this
20365 function should now be in the skeletons.
20366 (output_trailers): Remove.
20367 (output): Disable call to 'reader_output_yylsp'.
20368 (output_rule_data): Do not output tables to the table obstack.
20369
20370 * src/output.c: Remove some C dedicated output.
20371 Improve the use of macro and output obstacks.
20372 (output_defines): Remove.
20373
20374 * src/output.c (output_token_translations): Associate 'translate'
20375 table with a macro. No output to the table obstack.
20376 (output_gram): Same for 'rhs' and 'prhs'.
20377 (output_stos): Same for 'stos'.
20378 (output_rule_data): Same for 'r1' and 'r2'.
20379 (token_actions): Same for 'defact'.
20380 (goto_actions): Same for 'defgoto'.
20381 (output_base): Same for 'pact' and 'pgoto'.
20382 (output_table): Same for 'table'.
20383 (output_check): Same for 'check'.
20384
20385 * src/output.c (output_table_data): New function.
20386 (output_short_table): Remove.
20387 (output_short_or_char_table): Remove.
20388
20389 * src/output.c (output_parser): Replace most of the skeleton copy code
20390 with something new. Skeletons are now processed character by character
20391 rather than line by line, and Bison looks for '%%' macros. This is the
20392 first step in making Bison's output process (a lot) more flexible.
20393 (output_parser): Use the macro table.
20394
20395 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20396
20397 * src/main.c (main): Initialize the macro table.
20398
20399 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20400
20401 * src/lex.c (percent_table): Add tok_define.
20402 * src/lex.h: Add tok_define.
20403
20404 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20405
20406 * src/macrotab.c: New file.
20407 * src/macrotab.h: New file.
20408 * src/Makefile.am: Update.
20409
20410 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20411
20412 * lib/hash.c: New file.
20413 * lib/hash.h: New file.
20414 * lib/Makefile.am: Update.
20415
20416 2001-08-15 Akim Demaille <akim@epita.fr>
20417
20418 Version 1.28c.
20419
20420 2001-08-15 Marc Autret <autret_m@epita.fr>
20421
20422 * src/reader.c (readgram): Indent output macro YYSTYPE.
20423 (packsymbols): Likewise.
20424 (output_token_defines): Likewise.
20425 * src/files.c: Standardize.
20426 (compute_header_macro): New.
20427 (defines_obstack_save): New. Use compute_header_macro.
20428 (output_files): Update. Use defines_obstack_save.
20429
20430 2001-08-15 Akim Demaille <akim@epita.fr>
20431
20432 * doc/bison.texinfo (Table of Symbols): Document
20433 YYSTACK_USE_ALLOCA.
20434
20435 2001-08-15 Akim Demaille <akim@epita.fr>
20436
20437 * missing: Update from CVS Automake.
20438 * config/config.guess, config/config.sub, config/texinfo.tex:
20439 Update from gnu.org.
20440
20441 2001-08-15 Akim Demaille <akim@epita.fr>
20442
20443 * Makefile.maint: Sync with CVS Autoconf.
20444
20445 2001-08-14 Pascal Bart <pascal.bart@epita.fr>
20446
20447 * doc/bison.texinfo: Include GNU Free Documentation License from
20448 `fdl.texi'.
20449 * doc/fdl.texi: Add to package.
20450
20451 2001-08-14 Marc Autret <autret_m@epita.fr>
20452
20453 Turn on %{source,header}_extension features.
20454
20455 * src/lex.c (percent_table): Un-CPP out header_extension and
20456 source_extension.
20457 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
20458 (compute_exts_from_src): Remove conditions. It restores priorities
20459 between options.
20460
20461 2001-08-14 Marc Autret <autret_m@epita.fr>
20462
20463 * src/files.c (compute_base_names): Add extensions computing when
20464 `--file-prefix' used.
20465 Standardize function calls.
20466
20467 2001-08-13 Marc Autret <autret_m@epita.fr>
20468
20469 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
20470 defining it (defined but null disables alloca).
20471
20472 2001-08-13 Marc Autret <autret_m@epita.fr>
20473
20474 * src/bison.simple (_yy_memcpy): CPP reformat.
20475
20476 2001-08-13 Pascal Bart <pascal.bart@epita.fr>
20477
20478 * tests/atconfig.in (CPPFLAGS): Fix.
20479
20480 2001-08-10 Pascal Bart <pascal.bart@epita.fr>
20481
20482 * doc/bison.texinfo: Include GNU General Public License from
20483 `gpl.texi'.
20484 * doc/gpl.texi: Add to package.
20485
20486 2001-08-10 Marc Autret <autret_m@epita.fr>
20487
20488 * src/print_graph.h: Fix.
20489 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
20490
20491 2001-08-10 Akim Demaille <akim@epita.fr>
20492
20493 * src/system.h: Provide default declarations for stpcpy, strndup,
20494 and strnlen.
20495
20496 2001-08-10 Robert Anisko <anisko_r@epita.fr>
20497
20498 * doc/bison.texinfo (Locations): Update @$ stuff.
20499
20500 2001-08-09 Robert Anisko <anisko_r@epita.fr>
20501
20502 * src/bison.simple (YYLLOC_DEFAULT): Update.
20503 (yyparse): Adjust.
20504
20505 2001-08-08 Marc Autret <autret_m@epita.fr>
20506
20507 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
20508 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
20509 Reported by Fabrice Bauzac.
20510
20511 2001-08-08 Marc Autret <autret_m@epita.fr>
20512
20513 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
20514 * src/vcg.c (output_node): Fix.
20515 * src/vcg.h: Cleanup.
20516 * src/print_graph.c: Add comments.
20517 (node_output_size): New global variable. Simplify the formatting of
20518 the VCG graph output.
20519 (print_actions): Unused code is now used. It notifies the final state
20520 and no action states in the VCG graph. It also give the reduce actions.
20521 The `shift and goto' edges are red and the `go to state' edges are
20522 blue.
20523 Get the current node name and node_obstack by argument.
20524 (node_obstack): New variable.
20525 (print_state): Manage node_obstack.
20526 (print_core): Use node_obstack given by argument.
20527 A node is not only computed here but in print_actions also.
20528 (print_graph): CPP out useless code instead of commenting it.
20529
20530 2001-08-07 Pascal Bart <pascal.bart@epita.fr>
20531
20532 * tests/atconfig.in (CPPFLAGS): Fix.
20533
20534 2001-08-07 Akim Demaille <akim@epita.fr>
20535
20536 * src/print_graph.c (quote): New.
20537 (print_core): Use it.
20538
20539 2001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
20540
20541 * src/vcg.c (complain.h): Include it.
20542 Unepitaize `return' invocations.
20543 [NDEBUG] (main): Remove.
20544 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
20545 * src/files.c (open_files): Initialize graph_obstack.
20546 * src/print_graph.c (print_actions): CPP out useless code.
20547 (print_core): Don't output the last `\n' in labels.
20548 Use `quote'.
20549 * src/files.c (output_files): Output the VCG file.
20550 * src/main.c (main): Invoke print_graph ();
20551
20552 2001-08-06 Marc Autret <autret_m@epita.fr>
20553
20554 Automaton VCG graph output.
20555 Using option ``-g'' or long option ``--graph'', you can generate
20556 a gram_filename.vcg file containing a VCG description of the LALR (1)
20557 automaton of your grammar.
20558
20559 * src/main.c: Call to print_graph() function.
20560 * src/getargs.h: Update.
20561 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
20562 (graph_flag): New flag.
20563 (longopts): Update.
20564 (getargs): Add case `g'.
20565 * src/files.c (graph_obstack): New obstack struct.
20566 (open_files): Initialize new obstack.
20567 (output_files): Saves graph_obstack if required.
20568 * src/files.h (graph_obstack): New extern declaration.
20569 * src/Makefile.am: Add new source files.
20570
20571 2001-08-06 Marc Autret <autret_m@epita.fr>
20572
20573 * src/print_graph.c, src/print_graph.h (graph): New.
20574 * src/vcg.h: New file.
20575 * src/vcg.c: New file, VCG graph handling.
20576
20577 2001-08-06 Marc Autret <autret_m@epita.fr>
20578
20579 Add of %source_extension and %header_extension which specify
20580 the source or/and the header output file extension.
20581
20582 * src/files.c (compute_base_names): Remove initialisation of
20583 src_extension and header_extension.
20584 (compute_exts_from_gf): Update.
20585 (compute_exts_from_src): Update.
20586 (output_files): Update.
20587 * src/reader.c (parse_header_extension_decl): New.
20588 (parse_source_extension_decl): New.
20589 (read_declarations): New case statements for the new tokens.
20590 * src/lex.c (percent_table): Add entries for %source_extension
20591 and %header_extension.
20592 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
20593
20594 2001-08-06 Marc Autret <autret_m@epita.fr>
20595
20596 * configure.in: Bump to 1.28c.
20597 * doc/bison.texinfo: Texinfo thingies.
20598
20599 2001-08-04 Pascal Bart <pascal.bart@epita.fr>
20600
20601 * tests/atconfig.in (CPPFLAGS): Add.
20602 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
20603
20604 2001-08-03 Akim Demaille <akim@epita.fr>
20605
20606 Version 1.28b.
20607
20608 2001-08-03 Akim Demaille <akim@epita.fr>
20609
20610 * tests/Makefile.am (check-local): Ship testsuite.
20611 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
20612 Include `string.h'.
20613
20614 2001-08-03 Akim Demaille <akim@epita.fr>
20615
20616 * configure.in: Try using -Wformat when compiling.
20617
20618 2001-08-03 Akim Demaille <akim@epita.fr>
20619
20620 * configure.in: Bump to 1.28b.
20621
20622 2001-08-03 Akim Demaille <akim@epita.fr>
20623
20624 * src/complain.c: Adjust strerror_r portability issues.
20625
20626 2001-08-03 Akim Demaille <akim@epita.fr>
20627
20628 Version 1.28a.
20629
20630 2001-08-03 Akim Demaille <akim@epita.fr>
20631
20632 * src/getargs.c, src/getarg.h (skeleton)): Constify.
20633 * src/lex.c (literalchar): Avoid name clashes on `buf'.
20634 * src/getargs.c: Include complain.h.
20635 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
20636 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
20637
20638 2001-08-03 Akim Demaille <akim@epita.fr>
20639
20640 * src/reader.c (readgram): Display hidden chars in error messages.
20641
20642 2001-08-03 Akim Demaille <akim@epita.fr>
20643
20644 Update to gettext 0.10.39.
20645
20646 2001-08-03 Akim Demaille <akim@epita.fr>
20647
20648 * lib/strspn.c: New.
20649
20650 2001-08-01 Marc Autret <autret_m@epita.fr>
20651
20652 * doc/bison.texinfo: Update.
20653 * doc/bison.1 (mandoc): Update.
20654 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
20655 * src/files.c: Support output files extensions computing.
20656 (src_extension): New static variable.
20657 (header_extension): New static variable.
20658 (tr): New function.
20659 (get_extension_index): New function, gets the index of an extension
20660 filename in a string.
20661 (compute_exts_from_gf): New function, computes extensions from the
20662 grammar file extension.
20663 (compute_exts_from_src): New functions, computes extensions from the
20664 C source file extension, file given by ``-o'' option.
20665 (compute_base_names): Update.
20666 (output_files): Update.
20667
20668 2001-08-01 Robert Anisko <anisko_r@epita.fr>
20669
20670 * doc/bison.texi: Document @$.
20671 (Locations): New section.
20672
20673 2001-07-18 Akim Demaille <akim@epita.fr>
20674
20675 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
20676 * config/prev-version.txt, config/move-if-change: New.
20677 * Makefile.am: Adjust.
20678
20679 2001-07-08 Pascal Bart <pascal.bart@epita.fr>
20680
20681 * src/bison.simple (yyparse): Suppress warning `comparaison
20682 between signed and unsigned'.
20683
20684 2001-07-05 Pascal Bart <pascal.bart@epita.fr>
20685
20686 * src/getargs.h (raw_flag): Remove.
20687 * src/getargs.c: Die on `-r'/`--raw'.
20688 * src/lex.c (parse_percent_token): Die on `%raw'.
20689 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
20690 * tests/calc.at: Suppress test with option `--raw'.
20691
20692 2001-07-14 Akim Demaille <akim@epita.fr>
20693
20694 * config/: New.
20695 * configure.in: Require Autoconf 2.50.
20696 Update to gettext 0.10.38.
20697
20698 2001-03-16 Akim Demaille <akim@epita.fr>
20699
20700 * doc/bison.texinfo: ANSIfy the examples.
20701
20702 2001-03-16 Akim Demaille <akim@epita.fr>
20703
20704 * getargs.c (skeleton): New variable.
20705 (longopts): --skeleton is a new option.
20706 (shortopts, getargs): -S is a new option.
20707 * getargs.h: Declare skeleton.
20708 * output.c (output_parser): Use it.
20709
20710 2001-03-16 Akim Demaille <akim@epita.fr>
20711
20712 * m4/strerror_r.m4: New.
20713 * m4/error.m4: Run AC_FUNC_STRERROR_R.
20714 * lib/error.h, lib/error.c: Update.
20715
20716 2001-03-16 Akim Demaille <akim@epita.fr>
20717
20718 * src/getargs.c (longopts): Clean up.
20719
20720 2001-02-21 Akim Demaille <akim@epita.fr>
20721
20722 * src/reader.c (gensym): `gensym_count' is your own.
20723 Use a static buf to create the symbol name, as token_buffer is no
20724 longer a buffer.
20725
20726 2001-02-08 Akim Demaille <akim@epita.fr>
20727
20728 * src/conflicts.c (conflict_report): Be sure not to append to res
20729 between two calls, which could happen if both first sprintf were
20730 skipped, but not the first cp += strlen.
20731
20732 2001-02-08 Akim Demaille <akim@epita.fr>
20733
20734 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
20735 New, from fileutils 4.0.37.
20736 * configure.in: Require Autoconf 2.49c. I took some time before
20737 making this decision. This is the only way out for portability
20738 issues in Bison, it would mean way too much duplicate effort to
20739 import in Bison features implemented in 2.49c since 2.13.
20740 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
20741
20742 2001-02-02 Akim Demaille <akim@epita.fr>
20743
20744 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
20745 * lib/xalloc.h, lib/xmalloc.c: Update.
20746
20747 2001-01-19 Akim Demaille <akim@epita.fr>
20748
20749 Get rid of the ad hoc handling of token_buffer in the scanner: use
20750 the obstacks.
20751
20752 * src/lex.c (token_obstack): New.
20753 (init_lex): Initialize it. No longer call...
20754 (grow_token_buffer): this. Remove it.
20755 Adjust all the places which used it to use the obstack.
20756
20757 2001-01-19 Akim Demaille <akim@epita.fr>
20758
20759 * src/lex.h: Rename all the tokens:
20760 s/\bENDFILE\b/tok_eof/g;
20761 s/\bIDENTIFIER\b/tok_identifier/g;
20762 etc.
20763 Let them be enums, not #define, to ease debugging.
20764 Adjust all the code.
20765
20766 2001-01-18 Akim Demaille <akim@epita.fr>
20767
20768 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
20769 * src/lex.c (maxtoken, grow_token_buffer): Static.
20770
20771 2001-01-18 Akim Demaille <akim@epita.fr>
20772
20773 Since we now use obstacks, more % directives can be enabled.
20774
20775 * src/lex.c (percent_table): Also accept `%yacc',
20776 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
20777 `%debug'.
20778 Handle the actions for `%semantic_parser' and `%pure_parser' here,
20779 instead of returning a token.
20780 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
20781 * src/reader.c (read_declarations): Adjust.
20782 * src/files.c (open_files): Don't call `compute_base_names', don't
20783 compute `attrsfile' since they depend upon data which might be
20784 *in* the input file now.
20785 (output_files): Do it here.
20786 * src/output.c (output_headers): Document the fact that this patch
20787 introduces a guaranteed SEGV for semantic parsers.
20788 * doc/bison.texinfo: Document them.
20789 * tests/suite.at: Exercise these %options.
20790
20791 2000-12-20 Akim Demaille <akim@epita.fr>
20792
20793 Also handle the output file (--verbose) with obstacks.
20794
20795 * files.c (foutput): Remove.
20796 (output_obstack): New.
20797 Adjust all dependencies.
20798 * src/conflicts.c: Return a string.
20799 * src/system.h (obstack_grow_string): Rename as...
20800 (obstack_sgrow): this. Be ready to work with non literals.
20801 (obstack_fgrow4): New.
20802
20803 2000-12-20 Akim Demaille <akim@epita.fr>
20804
20805 * src/files.c (open_files): Fix the computation of short_base_name
20806 in the case of `-o foo.tab.c'.
20807
20808 2000-12-20 Akim Demaille <akim@epita.fr>
20809
20810 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
20811 (copy_dollar): Now that everything uses obstacks, get rid of the
20812 FILE * parameters.
20813
20814 2000-12-20 Akim Demaille <akim@epita.fr>
20815
20816 * src/files.c (open_files): Actually the `.output' file is based
20817 on the short_base_name, not base_name.
20818 * tests/suite.at (Checking output file names): Adjust.
20819
20820 2000-12-20 Akim Demaille <akim@epita.fr>
20821
20822 * src/bison.s1: Remove, we now use directly...
20823 * src/bison.simple: this.
20824 * src/Makefile.am: Use pkgdata instead of data.
20825
20826 2000-12-20 Akim Demaille <akim@epita.fr>
20827
20828 * src/files.c (guard_obstack): New.
20829 (open_files): Initialize it.
20830 (output_files): Dump it...
20831 * src/files.h: Export it.
20832 * src/reader.c (copy_guard): Use it.
20833
20834 2000-12-19 Akim Demaille <akim@epita.fr>
20835
20836 * src/files.c (outfile, defsfile, actfile): Removed as global
20837 vars.
20838 (open_files): Don't compute them.
20839 (output_files): Adjust.
20840 (base_name, short_base_name): Be global.
20841 Adjust dependencies.
20842
20843 2000-12-19 Akim Demaille <akim@epita.fr>
20844
20845 * src/files.c (strsuffix): New.
20846 (stringappend): Be just like strcat but allocate.
20847 (base_names): Eve out from open_files.
20848 Try to simplify the rather hairy computation of base_name and
20849 short_base_name.
20850 (open_files): Use it.
20851 * tests/suite.at (Checking output file names): New test.
20852
20853 2000-12-19 Akim Demaille <akim@epita.fr>
20854
20855 * src/system.h (obstack_grow_literal_string): Rename as...
20856 (obstack_grow_string): this.
20857 * src/output.c (output_parser): Recognize `%% actions' instead of
20858 `$'.
20859 * src/bison.s1: s/$/%% actions/.
20860 * src/bison.hairy: Likewise.
20861
20862 2000-12-19 Akim Demaille <akim@epita.fr>
20863
20864 * src/output.c (output_parser): Compute the `#line' lines when
20865 there are.
20866 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
20867 Suggested by Hans Aberg.
20868
20869 2000-12-19 Akim Demaille <akim@epita.fr>
20870
20871 Let the handling of the skeleton files be local to the procedures
20872 that use it.
20873
20874 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
20875 longer static.
20876 (fparser, open_extra_files): Remove.
20877 (open_files, output_files): Don't take care of fparser.
20878 * src/files.h: Adjust.
20879 * src/output.c (output_parser): Open and close the file to the
20880 skeleton.
20881 * src/reader.c (read_declarations): When %semantic_parser, open
20882 fguard.
20883
20884 2000-12-19 Akim Demaille <akim@epita.fr>
20885
20886 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
20887 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
20888
20889 2000-12-19 Akim Demaille <akim@epita.fr>
20890
20891 * src/files.c (open_files): Yipee! We no longer need all the code
20892 looking for `/tmp' since we have no tmp file.
20893
20894 2000-12-19 Akim Demaille <akim@epita.fr>
20895
20896 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
20897 New macros.
20898 * src/files.c (open_files): Less dependency on MSDOS etc.
20899
20900 2000-12-14 Akim Demaille <akim@epita.fr>
20901
20902 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
20903 Provide a default definition.
20904 Use it when executing the default @ action.
20905 * src/reader.c (reader_output_yylsp): No longer include
20906 `timestamp' and `text' in the default YYLTYPE.
20907
20908 2000-12-12 Akim Demaille <akim@epita.fr>
20909
20910 * src/reader.c (copy_definition, parse_union_decl, copy_action)
20911 (copy_guard): Quote the file names.
20912 Reported by Laurent Mascherpa.
20913
20914 2000-12-12 Akim Demaille <akim@epita.fr>
20915
20916 * src/output.c (output_headers, output_program, output): Be sure
20917 to escape special characters when outputting filenames.
20918 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
20919 (output_headers): Don't depend on them, Use ACTSTR.
20920
20921 2000-11-17 Akim Demaille <akim@epita.fr>
20922
20923 * lib/obstack.h: Formatting changes.
20924 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
20925 prevents type checking.
20926 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
20927 cast the value to (void *): assigning a `foo *' to a `void *'
20928 variable is valid.
20929 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
20930 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
20931 append characters.
20932
20933 2000-11-17 Akim Demaille <akim@epita.fr>
20934
20935 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
20936 as...
20937 (suite.m4, regression.m4, calc.m4): these.
20938 * tests/atgeneral.m4: Update from CVS Autoconf.
20939
20940 2000-11-17 Akim Demaille <akim@epita.fr>
20941
20942 * tests/regression.m4 (%union and --defines): New test,
20943 demonstrating a current bug in the obstack implementation.
20944
20945 2000-11-17 Akim Demaille <akim@epita.fr>
20946
20947 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
20948 macros.
20949 Use them to declare the variables which are global or local to
20950 `yyparse'.
20951
20952 2000-11-17 Akim Demaille <akim@epita.fr>
20953
20954 * acconfig.h: Remove, no longer used.
20955
20956 2000-11-07 Akim Demaille <akim@epita.fr>
20957
20958 * src: s/Copyright (C)/Copyright/g.
20959
20960 2000-11-07 Akim Demaille <akim@epita.fr>
20961
20962 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
20963 defining.
20964 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
20965
20966 2000-11-07 Akim Demaille <akim@epita.fr>
20967
20968 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
20969 Merge in a single CPP if/else.
20970
20971 2000-11-07 Akim Demaille <akim@epita.fr>
20972
20973 * src/output.c (output): Remove useless variables.
20974 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
20975 argument `data' for consistency with the prototypes.
20976 Qualify it `const'.
20977 (obstack_copy, obstack_copy0): Rename the second argument as
20978 `address' for consistency. Qualify it `const'.
20979 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
20980 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
20981 `const' their input argument (`data' or `address').
20982 Adjust the corresponding macros to include `const' in casts.
20983
20984 2000-11-03 Akim Demaille <akim@epita.fr>
20985
20986 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
20987 s/PFILE1/BISON_HAIRY/.
20988 Adjust dependencies.
20989
20990 2000-11-03 Akim Demaille <akim@epita.fr>
20991
20992 For some reason, this was not applied.
20993
20994 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
20995 `unlink': it's no longer used.
20996
20997 2000-11-03 Akim Demaille <akim@epita.fr>
20998
20999 * src/files.c (skeleton_find): New function, eved out of...
21000 (open_files, open_extra_files): here.
21001
21002 2000-11-03 Akim Demaille <akim@epita.fr>
21003
21004 Don't use `atexit'.
21005
21006 * src/files.c (obstack_save): New function.
21007 (done): Rename as...
21008 (output_files): this.
21009 Use `obstack_save'.
21010 * src/main.c (main): Don't use `atexit' to register `done', since
21011 it no longer has to remove tmp files, just call `output_files'
21012 when there are no errors.
21013
21014 2000-11-02 Akim Demaille <akim@epita.fr>
21015
21016 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
21017 `unlink': it's no longer used.
21018 * src/files.h: Formatting changes.
21019
21020 2000-11-02 Akim Demaille <akim@epita.fr>
21021
21022 Remove the last uses of mktemp and unlink/delete.
21023
21024 * src/files.c (fdefines, ftable): Removed.
21025 (defines_ostack, table_obstack): New.
21026 Adjust dependencies of the former into uses of the latter.
21027 * src/output.c (output_short_or_char_table, output_short_table):
21028 Convert to using obstacks.
21029 * src/reader.c (copy_comment2): Accept one FILE * and two
21030 obstacks.
21031 (output_token_defines, reader_output_yylsp): Use obstacks.
21032 * src/system.h (obstack_fgrow3): New.
21033 * po/POTFILES.in: Adjust.
21034
21035 2000-11-01 Akim Demaille <akim@epita.fr>
21036
21037 Change each use of `fattrs' into a use of `attrs_obstack'.
21038
21039 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
21040 * src/files.c (fattrs): Remove.
21041 (attrs_obstack): New.
21042 Adjust all dependencies.
21043 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
21044
21045 2000-11-01 Akim Demaille <akim@epita.fr>
21046
21047 Introduce obstacks.
21048 Change each use of `faction' into a use of `action_obstack'.
21049
21050 * lib/obstack.h, lib/obstack.c: New files.
21051 * src/files.c (faction): Remove.
21052 (action_obstack): New.
21053 Adjust all dependencies.
21054
21055 2000-10-20 Akim Demaille <akim@epita.fr>
21056
21057 * lib/quote.h (PARAMS): New macro. Use it.
21058
21059 2000-10-16 Akim Demaille <akim@epita.fr>
21060
21061 * src/output.c (output_short_or_char_table): New function.
21062 (output_short_table, output_token_translations): Use it.
21063 (goto_actions): Use output_short_table.
21064
21065 2000-10-16 Akim Demaille <akim@epita.fr>
21066
21067 * src/symtab.c (bucket_new): New function.
21068 (getsym): Use it.
21069
21070 * src/output.c (output_short_table): New argument to display the
21071 comment associated with the table.
21072 Adjust dependencies.
21073 (output_gram): Use it.
21074 (output_rule_data): Nicer output layout for YYTNAME.
21075
21076 2000-10-16 Akim Demaille <akim@epita.fr>
21077
21078 * src/lex.c (read_typename): New function.
21079 (lex): Use it.
21080 * src/reader.c (copy_dollar): Likewise.
21081
21082 2000-10-16 Akim Demaille <akim@epita.fr>
21083
21084 * src/reader.c (copy_comment2): Expect the input stream to be on
21085 the `/' which is suspected to open a comment, instead of being
21086 called after `//' or `/*' was read.
21087 (copy_comment, copy_definition, parse_union_decl, copy_action)
21088 (copy_guard): Adjust.
21089
21090 2000-10-16 Akim Demaille <akim@epita.fr>
21091
21092 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
21093 `read_signed_integer'.
21094
21095 2000-10-16 Akim Demaille <akim@epita.fr>
21096
21097 * src/reader.c (copy_dollar): New function.
21098 (copy_guard, copy_action): Use it.
21099
21100 2000-10-16 Akim Demaille <akim@epita.fr>
21101
21102 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
21103 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
21104 New files, from Fileutils 4.0.27.
21105 * src/main.c (printable_version): Remove.
21106 * src/lex.c, src/reader.c: Use `quote'.
21107
21108 2000-10-04 Akim Demaille <akim@epita.fr>
21109
21110 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
21111
21112 2000-10-04 Akim Demaille <akim@epita.fr>
21113
21114 * doc/bison.texinfo: Various typos spotted by Neil Booth.
21115
21116 2000-10-04 Akim Demaille <akim@epita.fr>
21117
21118 When a literal string is used to define two different tokens,
21119 `bison -v' segfaults.
21120 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
21121
21122 * tests/regression.m4: New file.
21123 Include the core of the sample provided by Piotr Gackiewicz.
21124 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
21125 properly.
21126
21127 2000-10-04 Akim Demaille <akim@epita.fr>
21128
21129 * src/reader.c (parse_expect_decl): Keep `count' within the size
21130 of `buffer'.
21131 From Neil Booth.
21132
21133 2000-10-02 Paul Eggert <eggert@twinsun.com>
21134
21135 * bison.s1 (yyparse): Assign the default value
21136 unconditionally, to avoid a GCC warning and make the parser a
21137 tad smaller.
21138
21139 2000-10-02 Akim Demaille <akim@epita.fr>
21140
21141 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
21142 options.
21143
21144 2000-10-02 Akim Demaille <akim@epita.fr>
21145
21146 * src/derives.c, src/print.c, src/reduce.c: To ease the
21147 translation, move some `\n' out of the translated strings.
21148
21149 2000-10-02 Akim Demaille <akim@epita.fr>
21150
21151 The location tracking mechanism is precious for parse error
21152 messages. Nevertheless, it is enabled only when `@n' is used in
21153 the grammar, which is a different issue (you can use it in error
21154 message, but not in the grammar per se). Therefore, there should
21155 be another means to enable it.
21156
21157 * src/getargs.c (getargs): Support `--locations'.
21158 (usage): Report it.
21159 * src/getargs.h (locationsflag): Export it.
21160 * src/lex.c (percent_table): Support `%locations'.
21161 * src/reader.c (yylsp_needed): Remove this variable, now replaced
21162 with `locationsflag'.
21163 * doc/bison.texinfo: Document `--locations' and `%locations'.
21164 Sort the options.
21165 * tests/calc.m4: Test it.
21166
21167 For regularity of the names, replace each
21168 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
21169 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
21170 In addition replace each `flag' with `_flag'.
21171
21172 2000-10-02 Akim Demaille <akim@epita.fr>
21173
21174 Also test parse error messages, including with YYERROR_VERBOSE.
21175
21176 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
21177 associative).
21178 Use it to check the computations.
21179 Use it to check `nonassoc' is honored.
21180 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
21181 `--yyerror-verbose'.
21182 (_AT_CHECK_CALC): Adjust to this option.
21183 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
21184
21185 2000-10-02 Akim Demaille <akim@epita.fr>
21186
21187 Test also `--verbose', `--defines' and `--name-prefix'. Testing
21188 the latter demonstrates a flaw in the handling of non debugging
21189 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
21190 was used in order to simplify:
21191
21192 #if YYDEBUG
21193 if (yydebug)
21194 {
21195 ...
21196 }
21197 #endif
21198
21199 into
21200
21201 if (yydebug)
21202 {
21203 ...
21204 }
21205
21206 unfortunately this leads to a CPP conflict when
21207 `--name-prefix=foo' is used since it produces `#define yydebug
21208 foodebug'.
21209
21210 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
21211 (YYDPRINTF): New macro.
21212 Spread its use.
21213 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
21214 the bison options.
21215 Also test `--verbose', `--defines' and `--name-prefix'.
21216
21217 2000-10-02 Akim Demaille <akim@epita.fr>
21218
21219 Improve the readability of the produced parsers.
21220
21221 * src/bison.s1: Formatting changes.
21222 Improve the comment related to the `$' mark.
21223 (yydefault): Don't fall through to `yyresume': `goto' there.
21224 * src/output.c (output_parser): When the `$' is met, skip the end
21225 of its line.
21226 New variable, `number_of_dollar_signs', to check there's exactly
21227 one `$' in the parser skeleton.
21228
21229 2000-10-02 Akim Demaille <akim@epita.fr>
21230
21231 * lib/xstrdup.c: New file, from the fileutils.
21232 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
21233 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
21234 instead of strlen + xmalloc + strcpy.
21235 * src/symtab.c (copys): Remove, use xstrdup instead.
21236
21237 2000-10-02 Akim Demaille <akim@epita.fr>
21238
21239 * src/gram.h (associativity): New enum type which replaces the
21240 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
21241 `right_assoc', `left_assoc' and `non_assoc'.
21242 Adjust all dependencies.
21243 * src/reader.c: Formatting changes.
21244 (LTYPESTR): Don't define it, use it as a literal in
21245 `reader_output_yylsp'.
21246 * src/symtab.h (symbol_class): New enum type which replaces the
21247 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
21248 `sunknown', `stoken and `snterm'.
21249
21250 2000-10-02 Akim Demaille <akim@epita.fr>
21251
21252 * src/getargs.c (fixed_outfiles): Rename as...
21253 (yaccflag): for consistency and accuracy.
21254 Adjust dependencies.
21255
21256 2000-10-02 Akim Demaille <akim@epita.fr>
21257
21258 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
21259 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
21260 difficult and introduced a lot of core dump. It turns out that
21261 Bison used an implementation of `xmalloc' based on `calloc', and
21262 at various places it does depend upon the initialization to 0. I
21263 have not tried to isolate the pertinent places, and all the former
21264 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
21265 someone should address this issue.
21266
21267 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
21268 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
21269 files.
21270 Adjust dependencies.
21271 * src/warshall.h: New file.
21272 Propagate.
21273
21274 2000-10-02 Akim Demaille <akim@epita.fr>
21275
21276 Various anti-`extern in *.c' changes.
21277
21278 * src/system.h: Include `assert.h'.
21279
21280 2000-10-02 Akim Demaille <akim@epita.fr>
21281
21282 * src/state.h (nstates, final_state, first_state, first_shift)
21283 (first_reduction): Move their exportation from here...
21284 * src/LR0.h: to here.
21285 Adjust dependencies.
21286 * src/getargs.c (statisticsflag): New variable.
21287 Add support for `--statistics'.
21288 Adjust dependencies.
21289
21290 Remove a lot of now useless `extern' statements in most files.
21291
21292 2000-10-02 Akim Demaille <akim@epita.fr>
21293
21294 * src/LR0.h: New file.
21295 Propagate its use.
21296
21297 2000-10-02 Akim Demaille <akim@epita.fr>
21298
21299 * src/print.h: New file.
21300 Propagate its use.
21301 * src/print.c: Formatting and ordering changes.
21302 (verbose, terse): Replace with...
21303 (print_results): this new function.
21304 Adjust dependencies.
21305
21306 2000-10-02 Akim Demaille <akim@epita.fr>
21307
21308 * src/conflicts.c (conflict_report): New function.
21309 (conflict_log, verbose_conflict_log): Replace with...
21310 (print_conflicts): this function.
21311 Adjust dependencies.
21312 * src/conflicts.h: New file.
21313 Propagate its inclusion.
21314
21315 2000-10-02 Akim Demaille <akim@epita.fr>
21316
21317 * src/nullable.h: New file.
21318 Propagate its inclusion.
21319 * src/nullable.c: Formatting changes.
21320
21321 2000-10-02 Akim Demaille <akim@epita.fr>
21322
21323 * src/reduce.h: New file.
21324 Propagate its inclusion.
21325 * src/reduce.c: Topological sort and other formatting changes.
21326 (bool, TRUE, FALSE): Move their definition to...
21327 * src/system.h: here.
21328
21329 2000-10-02 Akim Demaille <akim@epita.fr>
21330
21331 * src/files.c: Formatting changes.
21332 (tryopen, tryclose, openfiles): Rename as...
21333 (xfopen, xfclose, open_files): this.
21334 (stringappend): static.
21335 * src/files.h: Complete the list of exported symbols.
21336 Propagate its use.
21337
21338 2000-10-02 Akim Demaille <akim@epita.fr>
21339
21340 * src/reader.h: New file.
21341 Propagate its use instead of tedious list of `extern' and
21342 prototypes.
21343 * src/reader.c: Formatting changes, topological sort,
21344 s/register//.
21345
21346 2000-10-02 Akim Demaille <akim@epita.fr>
21347
21348 * src/lex.h: Prototype `lex.c' exported functions.
21349 * src/reader.c: Adjust.
21350 * src/lex.c: Formatting changes.
21351 (safegetc): Rename as...
21352 (xgetc): this.
21353
21354 2000-10-02 Akim Demaille <akim@epita.fr>
21355
21356 * src/lalr.h: New file.
21357 Propagate its inclusion instead of prototypes and `extern'.
21358 * src/lalr.c: Formatting changes, topological sorting etc.
21359
21360 2000-10-02 Akim Demaille <akim@epita.fr>
21361
21362 * src/output.c (token_actions): Introduce a temporary array,
21363 YYDEFACT, that makes it possible for this function to use
21364 output_short_table.
21365
21366 2000-10-02 Akim Demaille <akim@epita.fr>
21367
21368 `user_toknums' is output as a `short[]' in `output.c', while it is
21369 defined as a `int[]' in `reader.c'. For consistency with the
21370 other output tables, `user_toknums' is now defined as a table of
21371 shorts.
21372
21373 * src/reader.c (user_toknums): Be a short table instead of an int
21374 table.
21375 Adjust dependencies.
21376
21377 Factor the short table outputs.
21378
21379 * src/output.c (output_short_table): New function.
21380 * src/output.c (output_gram, output_stos, output_rule_data)
21381 (output_base, output_table, output_check): Use it.
21382
21383 2000-10-02 Akim Demaille <akim@epita.fr>
21384
21385 * src/output.c (output): Topological sort of the functions, in
21386 order to get rid of the `static' prototypes.
21387 No longer use `register'.
21388 * src/output.h: New file.
21389 Propagate its inclusion in files explicitly prototyping functions
21390 from output.c.
21391
21392 2000-09-21 Akim Demaille <akim@epita.fr>
21393
21394 * src/atgeneral.m4: Update from Autoconf.
21395
21396 2000-09-21 Akim Demaille <akim@epita.fr>
21397
21398 * src/closure.h: New file.
21399 * src/closure.c: Formatting changes, topological sort over the
21400 functions, use of closure.h.
21401 (initialize_closure, finalize_closure): Rename as...
21402 (new_closure, free_closure): these. Adjust dependencies.
21403 * src/LR0.c: Formatting changes, topological sort, use of
21404 cloture.h.
21405 (initialize_states): Rename as...
21406 (new_states): this.
21407 * src/Makefile.am (noinst_HEADERS): Adjust.
21408
21409 2000-09-20 Akim Demaille <akim@epita.fr>
21410
21411 * src/acconfig.h: Don't protect config.h against multiple
21412 inclusion.
21413 Don't define PARAMS.
21414 * src/system.h: Define PARAMS.
21415 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
21416 purpose of config.h. system.h must not try to fix wrong
21417 definitions in config.h.
21418
21419 2000-09-20 Akim Demaille <akim@epita.fr>
21420
21421 * src/derives.h: New file.
21422 * src/main.c, src/derives.h: Use it.
21423 Formatting changes.
21424 * src/Makefile.am (noinst_HEADERS): Adjust.
21425
21426 2000-09-20 Akim Demaille <akim@epita.fr>
21427
21428 * tests/atgeneral.m4: Update from Autoconf.
21429 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
21430 (AT_CHECK_CALC): New macros.
21431 Use these macros to test bison with options `', `--raw',
21432 `--debug', `--yacc', `--yacc --debug'.
21433
21434 2000-09-19 Akim Demaille <akim@epita.fr>
21435
21436 * src/output.c: Formatting changes.
21437 * src/machine.h: Remove, leaving its contents in...
21438 * src/system.h: here.
21439 Include stdio.h.
21440 Adjust all dependencies on stdio.h and machine.h.
21441 * src/getargs.h: New file.
21442 Let all `extern' declarations about getargs.c be replaced with
21443 inclusion of `getargs.h'.
21444 * src/Makefile.am (noinst_HEADERS): Adjust.
21445
21446 * tests/calc.m4 (yyin): Be initialized in main, not on the global
21447 scope.
21448 (yyerror): Returns void, not int.
21449 * doc/bison.texinfo: Formatting changes.
21450
21451 2000-09-19 Akim Demaille <akim@epita.fr>
21452
21453 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
21454 portable.
21455
21456 2000-09-18 Akim Demaille <akim@epita.fr>
21457
21458 * configure.in: Append WARNING_CFLAGS to CFLAGS.
21459 * src/Makefile.am (INCLUDES): Don't.
21460 Be ready to fetch headers in lib/.
21461
21462 2000-09-18 Akim Demaille <akim@epita.fr>
21463
21464 * doc/bison.texinfo: Update the copyright.
21465 ANSIfy and GNUify the examples.
21466 Remove the old menu.
21467
21468 2000-09-18 Akim Demaille <akim@epita.fr>
21469
21470 First set of tests: use the `calc' example from the documentation.
21471
21472 * src/bison.s1 (yyparse): Condition the code using `yytname' which
21473 is defined only when YYDEBUG is.
21474 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
21475 * src/files.c (tryopen, tryclose): Formatting changes.
21476 Move to the top and be static.
21477 * src/reader.c (read_signed_integer): Likewise.
21478 * tests/calc.m4: New file.
21479 * Makefile.am, suite.m4: Adjust.
21480 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
21481
21482 2000-09-18 Akim Demaille <akim@epita.fr>
21483
21484 Add support for an Autotest test suite for Bison.
21485
21486 * m4/m4.m4, m4/atconfig.m4: New files.
21487 * m4/Makefile.am (EXTRA_DIST): Adjust.
21488 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
21489 files.
21490 * src/getargs.c: Display a more standard --version message.
21491 * src/reader.c (reader): Formatting changes.
21492 No longer depend upon VERSION_STRING.
21493 * configure.in: No longer use `dnl'.
21494 Set up the test suite and the new directory `tests/.
21495 (VERSION_STRING): Remove.
21496
21497 2000-04-14 Akim Demaille <akim@epita.fr>
21498
21499 * src/reader.c (copy_comment2): New function, same as former
21500 `copy_comment', but outputs into two FILE *.
21501 (copy_comment): Use it.
21502 (parse_union_decl): Use it.
21503 (get_type, parse_start_decl): Use the same `invalid' message.
21504 (parse_start_decl, parse_union_decl): Use the same `multiple'
21505 message.
21506 (parse_union_decl, copy_guard, copy_action): Use the same
21507 `unmatched' message.
21508 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
21509
21510 2000-03-31 Akim Demaille <akim@epita.fr>
21511
21512 * src/files.c (tryopen, tryclose): Move to the top.
21513 Be static.
21514
21515 2000-03-31 Akim Demaille <akim@epita.fr>
21516
21517 * src/main.c (main): Don't call `done', exit does it.
21518
21519 2000-03-31 Akim Demaille <akim@epita.fr>
21520
21521 * allocate.c: s/return (foo)/return foo/.
21522 * lalr.c: Likewise.
21523 * LR0.c: Likewise.
21524 * output.c: Likewise.
21525 * reader.c: Likewise.
21526 * symtab.c: Likewise.
21527 * vmsgetargs.c: Likewise.
21528
21529 2000-03-31 Akim Demaille <akim@epita.fr>
21530
21531 Clean up the error reporting functions.
21532
21533 * src/report.c: New file.
21534 * src/report.h: Likewise.
21535 * src/Makefile.am: Adjust.
21536 * m4/error.m4: New file.
21537 * m4/Makefile.am: Adjust.
21538 * configure.in (jm_PREREQ_ERROR): Call it.
21539 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
21540 Remove.
21541 (fatal, fatals): Remove. All callers use complain.c::fatal.
21542 (warn, warni, warns, warnss, warnss): Remove. All callers use
21543 complain.c::complain.
21544 (toomany): Remove, use fatal instead.
21545 * src/files.c (done): No argument, use complain_message_count.
21546 * src/main.c (main): Register `done' to `atexit'.
21547
21548 * src/getargs.c (usage): More `fputs', less `fprintf'.
21549
21550 2000-03-28 Akim Demaille <akim@epita.fr>
21551
21552 * lib/: New directory.
21553 * Makefile.am (SUBDIRS): Adjust.
21554 * configure.in: Adjust.
21555 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
21556 useless.
21557 * src/alloca.c: Moved to lib/.
21558 * src/getopt.c: Likewise.
21559 * src/getopt1.c: Likewise.
21560 * src/getopt.h: Likewise.
21561 * src/ansi2knr.c: Likewise.
21562 * src/ansi2knr.1: Likewise.
21563 * src/Makefile.am: Adjust.
21564 * lib/Makefile.am: New file.
21565
21566 2000-03-28 Akim Demaille <akim@epita.fr>
21567
21568 * src/getargs.c (usage): Refresh the help message.
21569
21570 2000-03-17 Akim Demaille <akim@epita.fr>
21571
21572 * src/getopt1.c: Updated from textutils 2.0e
21573 * src/getopt.c: Likewise.
21574 * src/getopt.h: Likewise.
21575
21576 2000-03-17 Akim Demaille <akim@epita.fr>
21577
21578 * src/Makefile.am (bison.simple): Fix the awk program: quote only
21579 the file name, not the whole `#line LINE FILE'.
21580
21581 2000-03-17 Akim Demaille <akim@epita.fr>
21582
21583 On syntax errors, report the token on which we choked.
21584
21585 * src/bison.s1 (yyparse): In the label yyerrlab, when
21586 YYERROR_VERBOSE, add yychar in msg.
21587
21588 2000-03-17 Akim Demaille <akim@epita.fr>
21589
21590 * src/reader.c (copy_at): New function.
21591 (copy_guard): Use it.
21592 (copy_action): Use it.
21593
21594 2000-03-17 Akim Demaille <akim@epita.fr>
21595
21596 Be kind to translators, save some useless translations.
21597
21598 * src/main.c (banner): New function.
21599 (fatal_banner): Use it.
21600 (warn_banner): Use it.
21601
21602 2000-03-17 Akim Demaille <akim@epita.fr>
21603
21604 * src/reader.c (copy_definition): Use copy_string and
21605 copy_comment. Removed now unused `match', `ended',
21606 `cplus_comment'.
21607 (copy_comment, copy_string): Moved, to be visible from
21608 copy_definition.
21609
21610 2000-03-17 Akim Demaille <akim@epita.fr>
21611
21612 * src/reader.c (copy_string): Declare `static inline'. No
21613 problems with inline, since it is checked by configure.
21614 (copy_comment): Likewise.
21615
21616 2000-03-17 Akim Demaille <akim@epita.fr>
21617
21618 * src/reader.c (packsymbols): Formatting changes.
21619
21620 2000-03-17 Akim Demaille <akim@epita.fr>
21621
21622 * src/reader.c (copy_comment): New function, factored out from:
21623 (copy_action): Use it. Removed now unused `match', `ended',
21624 `cplus_comment'.
21625 (copy_guard): Likewise.
21626
21627 2000-03-17 Akim Demaille <akim@epita.fr>
21628
21629 * src/reader.c (copy_string): New function, factored out from:
21630 (copy_action): Use it.
21631 (copy_guard): Likewise.
21632
21633 2000-03-17 Akim Demaille <akim@epita.fr>
21634
21635 Change the handling of @s so that they behave exactly like $s.
21636 There is now a pseudo variable @$ (readble and writable), location
21637 of the lhs of the rule (by default ranging from the location of
21638 the first symbol of the rhs, to the location of the last symbol,
21639 or, if the rhs is empty, YYLLOC).
21640
21641 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
21642 yyval.
21643 (yyparse): When providing a default semantic action, provide a
21644 default location action.
21645 (after the $): No longer change `*YYLSP', just stack YYLOC the
21646 same way you stack YYVAL.
21647 * src/reader.c (read_declarations): Use warns.
21648 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
21649 (copy_action, case '@'): Likewise.
21650 Use a standard error message, to save useless work from
21651 translators.
21652
21653 2000-03-17 Akim Demaille <akim@epita.fr>
21654
21655 * src/bison.s1: Formatting and cosmetics changes.
21656 * src/reader.c: Likewise.
21657 Update the Copyright notice.
21658
21659 2000-03-17 Akim Demaille <akim@epita.fr>
21660
21661 * src/bison.s1 (#line): All set to `#line' only, since the
21662 Makefile now handles them.
21663
21664 2000-03-16 Akim Demaille <akim@epita.fr>
21665
21666 * src/output.c (output_rule_data): Output the documentation of
21667 some of the tables.
21668 (Copyright notice): Update.
21669 Formatting changes.
21670
21671 2000-03-16 Akim Demaille <akim@epita.fr>
21672
21673 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
21674 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
21675 One `#if YYDEBUG' remains, since it uses variables which are
21676 defined only if `YYDEBUG != 0'.
21677
21678 2000-03-16 Akim Demaille <akim@epita.fr>
21679
21680 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
21681 and related variables so that the similarities are highlighted.
21682
21683 2000-03-16 Akim Demaille <akim@epita.fr>
21684
21685 * src/bison.s1: Properly indent CPP directives.
21686
21687 2000-03-16 Akim Demaille <akim@epita.fr>
21688
21689 * src/bison.s1: Properly indent the `alloca' CPP section.
21690
21691 2000-03-16 Akim Demaille <akim@epita.fr>
21692
21693 Do not hard code values of directories in `configure.in'.
21694 Update the `configure' tool chain.
21695
21696 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
21697 src/makefile.am.
21698 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
21699 (AC_OUTPUT): Add m4/Makefile.
21700 Bump to bison 1.28a, 1.29 has never been released.
21701 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
21702 handled via src/Makefile.am.
21703 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
21704 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
21705 autoheader.
21706 * Makefile.am (SUBDIRS): Add m4.
21707 (ACLOCAL_AM_FLAGS): New variable.
21708 (AUTOMAKE_OPTIONS): Add check-news.
21709 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
21710 the proper line number and file name.
21711 (DEFS): Propagate the location of bison library files and of the
21712 locale files.
21713 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
21714 builddir.
21715 * acinclude.m4: Remove, replaced by the directory m4.
21716 * m4/Makefile.am (EXTRA_DIST): New variable.
21717 * m4/gettext.m4: New file, from the fileutils.
21718 * m4/lcmessage.m4: Likewise
21719 * m4/progtest.m4: Likewise.
21720 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
21721
21722 2000-03-10 Akim Demaille <akim@epita.fr>
21723
21724 * src/closure.c:
21725 Formatting changes of various comments.
21726 Respect the GNU coding standards at various places.
21727 Don't use `_()' when no translation is needed.
21728
21729 1999-12-13 Jesse Thilo <jthilo@gnu.org>
21730
21731 * src/files.c:
21732 OS/2 honors TMPDIR environment variable.
21733
21734 1999-12-13 Jesse Thilo <jthilo@gnu.org>
21735
21736 * doc/bison.texinfo: Tweaked spelling and grammar.
21737 Updated ISBN.
21738 Removed reference to price of printed copy.
21739 Mention BISON_SIMPLE and BISON_HAIRY.
21740
21741 1999-12-13 Jesse Thilo <jthilo@gnu.org>
21742
21743 * configure.in, NEWS:
21744 Bison 1.29 released.
21745
21746 1999-10-27 Jesse Thilo <jthilo@gnu.org>
21747
21748 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
21749 Added reference card.
21750
21751 1999-07-26 Jesse Thilo <jthilo@gnu.org>
21752
21753 * po/ru.po: Added Russian translation.
21754
21755 1999-07-26 Jesse Thilo <jthilo@gnu.org>
21756
21757 * configure.in: Added Russian translation.
21758
21759 1999-07-06 Jesse Thilo <jthilo@gnu.org>
21760
21761 * configure.in, NEWS, README:
21762 Released version 1.28.
21763
21764 1999-06-14 Jesse Thilo <jthilo@gnu.org>
21765
21766 * src/system.h:
21767 Squashed redefinition warning on some systems.
21768
21769 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
21770 Have configure build version string instead of relying on ANSI string
21771 concatentation.
21772
21773 1999-06-14 Jesse Thilo <jthilo@gnu.org>
21774
21775 * po/POTFILES.in: Got rid of version.c.
21776
21777 1999-06-14 Jesse Thilo <jthilo@gnu.org>
21778
21779 * acconfig.h, configure.in:
21780 Have configure build version string instead of relying on ANSI string
21781 concatentation.
21782
21783 1999-06-08 Jesse Thilo <jthilo@gnu.org>
21784
21785 * doc/bison.1:
21786 Dropped mention of `+' for long-named options.
21787
21788 1999-05-30 Jesse Thilo <jthilo@gnu.org>
21789
21790 * src/files.c: Added <unistd.h> for unlink().
21791
21792 * src/Makefile.am, src/system.h:
21793 I18n fixes.
21794
21795 1999-05-30 Jesse Thilo <jthilo@gnu.org>
21796
21797 * README: Added a FAQ list.
21798
21799 * configure.in, acconfig.h:
21800 I18n fixes.
21801
21802 1999-05-30 Jesse Thilo <jthilo@gnu.org>
21803
21804 * doc/FAQ, doc/Makefile.am:
21805 Added a FAQ list.
21806
21807 1999-05-19 Jesse Thilo <jthilo@gnu.org>
21808
21809 * src/alloc.h, src/symtab.h, src/version.c:
21810 Protected inclusion of "config.h" with HAVE_CONFIG_H.
21811
21812 1999-04-18 Jesse Thilo <jthilo@gnu.org>
21813
21814 * src/.cvsignore, src/Makefile.am:
21815 Reorganized: sources in `src', documentation in `doc'.
21816
21817 * src/lex.c (literalchar):
21818 fixed the code for escaping double quotes (thanks
21819 Jonathan Czisny.)
21820
21821 1999-04-18 Jesse Thilo <jthilo@gnu.org>
21822
21823 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
21824 Adjusted paths to reflect directory reorganization.
21825
21826 1999-04-18 Jesse Thilo <jthilo@gnu.org>
21827
21828 * doc/.cvsignore, doc/Makefile.am:
21829 Reorganized: sources in `src', documentation in `doc'.
21830
21831 1999-04-18 Jesse Thilo <jthilo@gnu.org>
21832
21833 * configure.in:
21834 Updated AC_INIT file to reflect directory reorganization.
21835
21836 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
21837 Reorganized: sources in `src', documentation in `doc'.
21838
21839 1999-04-13 Jesse Thilo <jthilo@gnu.org>
21840
21841 * src/allocate.c:
21842 Don't declare calloc() and realloc() if not necessary.
21843
21844 1999-04-13 Jesse Thilo <jthilo@gnu.org>
21845
21846 * configure.in, acconfig.h, acinclude.m4:
21847 Don't declare calloc() and realloc() if not necessary.
21848
21849 1999-03-23 Jesse Thilo <jthilo@gnu.org>
21850
21851 * po/.cvsignore: Added i18n support.
21852
21853 1999-03-23 Jesse Thilo <jthilo@gnu.org>
21854
21855 * acconfig.h, configure.in, Makefile.am:
21856 Added i18n support.
21857
21858 1999-03-22 Jesse Thilo <jthilo@gnu.org>
21859
21860 * src/bison.s1: Fixed #line numbers.
21861
21862 1999-03-15 Jesse Thilo <jthilo@gnu.org>
21863
21864 * po/es.po, po/fr.po, po/nl.po, po/de.po:
21865 Added PO files from Translation Project.
21866
21867 1999-03-03 Jesse Thilo <jthilo@gnu.org>
21868
21869 * Makefile.am:
21870 Added support for non-ANSI compilers (ansi2knr).
21871
21872 1999-02-16 Jesse Thilo <jthilo@gnu.org>
21873
21874 * configure.in: Bumped version number to 1.27.
21875
21876 * Makefile.am:
21877 Added `bison.simple' to list of files removed by `make distclean'.
21878
21879 1999-02-12 Jesse Thilo <jthilo@gnu.org>
21880
21881 * src/files.c, src/files.h:
21882 Defined locations of parser files in config.h instead of Makefile.
21883
21884 1999-02-12 Jesse Thilo <jthilo@gnu.org>
21885
21886 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
21887 Defined locations of parser files in config.h instead of Makefile.
21888
21889 1999-02-09 Jesse Thilo <jthilo@gnu.org>
21890
21891 * Makefile.am:
21892 Removed inappropriate use of $< macro.
21893
21894 1999-02-05 Jesse Thilo <jthilo@gnu.org>
21895
21896 * po/Makefile.in.in, po/POTFILES.in:
21897 Add `po' directory skeleton.
21898
21899 1999-01-27 Jesse Thilo <jthilo@gnu.org>
21900
21901 * README: Document help-bison list.
21902
21903 * configure.in: Add check for mkstemp().
21904
21905 1999-01-20 Jesse Thilo <jthilo@gnu.org>
21906
21907 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
21908 Hush a few compiler warnings.
21909
21910 * src/files.c:
21911 Add tryclose(), which verifies that fclose was successful.
21912 Hush a couple of compiler warnings.
21913
21914 1999-01-20 Jesse Thilo <jthilo@gnu.org>
21915
21916 * Makefile.am, OChangeLog:
21917 ChangeLog is now automatically generated. Include the old version as
21918 OChangeLog.
21919
21920 1999-01-14 Jesse Thilo <jthilo@gnu.org>
21921
21922 * 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:
21923 Update FSF address.
21924
21925 1999-01-14 Jesse Thilo <jthilo@gnu.org>
21926
21927 * doc/bison.texinfo: Fix formatting glitch.
21928
21929 * doc/bison.texinfo: Update FSF address.
21930
21931 1999-01-14 Jesse Thilo <jthilo@gnu.org>
21932
21933 * acconfig.h: Update FSF address.
21934
21935 1999-01-08 Jesse Thilo <jthilo@gnu.org>
21936
21937 * src/system.h:
21938 Don't define PACKAGE here, since config.h defines it.
21939
21940 1998-12-30 Jesse Thilo <jthilo@gnu.org>
21941
21942 * src/reader.c: Update copyright date.
21943
21944 * src/main.c:
21945 Ditch sprintf to statically-sized buffers in fatal/warn functions in
21946 favor of output directly to stderr (avoids buffer overruns).
21947
21948 * src/reader.c: Some checks for premature EOF.
21949
21950 * 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:
21951 Use prototypes if the compiler understands them.
21952
21953 * src/files.c: Honor TMPDIR on Unix hosts.
21954 Use prototypes if the compiler understands them.
21955
21956 * src/reader.c:
21957 Fix a couple of buffer overrun bugs.
21958 Use prototypes if the compiler understands them.
21959
21960 * src/system.h: Include unistd.h and ctype.h.
21961 Use #ifdef instead of #if for NLS symbols.
21962
21963 1998-12-30 Jesse Thilo <jthilo@gnu.org>
21964
21965 * doc/bison.texinfo:
21966 Delete comment "consider using @set for edition number, etc..." since
21967 we now are doing so.
21968
21969 1998-12-30 Jesse Thilo <jthilo@gnu.org>
21970
21971 * configure.in:
21972 Use prototypes if the compiler understands them.
21973
21974 * NEWS: Document 1.26 highlights.
21975
21976 * Makefile.am: Require Automake 1.3 or later.
21977
21978 * acconfig.h:
21979 Use prototypes if the compiler understands them.
21980
21981 1998-12-29 Jesse Thilo <jthilo@gnu.org>
21982
21983 * src/version.c:
21984 Use VERSION symbol from automake for version number.
21985
21986 1998-12-29 Jesse Thilo <jthilo@gnu.org>
21987
21988 * acconfig.h, configure.in, version.cin:
21989 Use VERSION symbol from automake for version number.
21990
21991 1998-11-28 Jesse Thilo <jthilo@gnu.org>
21992
21993 * Makefile.am:
21994 Distribute original version of simple parser (bison.s1), not built
21995 version (bison.simple).
21996
21997 1998-11-28 Jesse Thilo <jthilo@gnu.org>
21998
21999 * doc/bison.texinfo: Add info dir entry.
22000
22001 * doc/bison.texinfo:
22002 Let automake put version number into documentation.
22003
22004 1998-11-26 Jesse Thilo <jthilo@gnu.org>
22005
22006 * src/bison.cld, src/build.com, src/vmshlp.mar:
22007 Add non-RCS files from /gd/gnu/bison.
22008
22009 1998-11-26 Jesse Thilo <jthilo@gnu.org>
22010
22011 * doc/bison.1:
22012 Document the BISON_HAIRY and BISON_SIMPLE variables.
22013
22014 1998-11-25 Jesse Thilo <jthilo@gnu.org>
22015
22016 * src/version.c: Build version.c automatically.
22017
22018 * src/reader.c:
22019 Fix token numbering (used to start at 258, not 257).
22020
22021 * src/system.h: Include config.h.
22022
22023 * src/getargs.c: Update bug report address.
22024
22025 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
22026 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
22027
22028 1998-11-25 Jesse Thilo <jthilo@gnu.org>
22029
22030 * Makefile.am:
22031 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
22032
22033 * configure.in, version.cin:
22034 Build version.c automatically.
22035
22036 * AUTHORS: Add AUTHORS file.
22037
22038 * README: Update bug report address.
22039
22040 * bison.simple:
22041 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
22042
22043 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
22044 Add automake stuff.
22045
22046 1998-11-25 Jesse Thilo <jthilo@gnu.org>
22047
22048 * doc/bison.texinfo: Clean up some formatting.
22049
22050 1998-05-05 Richard Stallman <rms@gnu.org>
22051
22052 * doc/bison.texinfo:
22053 Explain better why to make a pure parser.
22054
22055 1998-01-05 Richard Stallman <rms@gnu.org>
22056
22057 * src/files.c (openfiles):
22058 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
22059 find a temporary directory, if possible. Do not unlink files while
22060 they are open.
22061
22062 1997-08-25 Richard Stallman <rms@gnu.org>
22063
22064 * src/reader.c (stack_offset;):
22065 Change some warni to warns.
22066
22067 * src/lex.c (literalchar): Use warns, not warni.
22068
22069 1997-06-28 Richard Stallman <rms@gnu.org>
22070
22071 * src/bison.s1: Add a Bison version comment.
22072
22073 * src/main.c (fatal, warn, berror):
22074 Use program_name.
22075
22076 1997-06-28 Richard Stallman <rms@gnu.org>
22077
22078 * Makefile.in (bison_version): New variable.
22079 (dist): Use that variable.
22080 (bison.s1): Substitute the Bison version into bison.simple.
22081
22082 * bison.simple: Add a Bison version comment.
22083
22084 1997-06-18 Richard Stallman <rms@gnu.org>
22085
22086 * src/main.c (fatal, warn, berror):
22087 Make error messages standard.
22088 (toomany): Improve error message text.
22089
22090 * 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:
22091 new.h renamed to alloc.h.
22092
22093 1997-06-18 Richard Stallman <rms@gnu.org>
22094
22095 * Makefile.in: new.h renamed to alloc.h.
22096
22097 1997-05-24 Richard Stallman <rms@gnu.org>
22098
22099 * src/lex.c (literalchar):
22100 Fix the code for escaping \, " and '.
22101
22102 (lex): Avoid trouble when there are many chars
22103 to discard in a char literal with just several chars in it.
22104
22105 1997-05-17 Richard Stallman <rms@gnu.org>
22106
22107 * src/bison.s1:
22108 Use malloc, if using alloca is troublesome.
22109 (YYSTACK_USE_ALLOCA): New flag macro.
22110 Define it for some systems and compilers.
22111 (YYSTACK_ALLOC): New macro.
22112 (yyparse): Use YYSTACK_ALLOC to allocate stack.
22113 If it was malloc'd, free it.
22114
22115 1997-05-17 Richard Stallman <rms@gnu.org>
22116
22117 * bison.simple:
22118 Use malloc, if using alloca is troublesome.
22119 (YYSTACK_USE_ALLOCA): New flag macro.
22120 Define it for some systems and compilers.
22121 (YYSTACK_ALLOC): New macro.
22122 (yyparse): Use YYSTACK_ALLOC to allocate stack.
22123 If it was malloc'd, free it.
22124
22125 1997-04-23 Richard Stallman <rms@gnu.org>
22126
22127 * src/bison.s1:
22128 (alloca) [__hpux]: Always define as __builtin_alloca.
22129
22130 1997-04-23 Richard Stallman <rms@gnu.org>
22131
22132 * bison.simple:
22133 (alloca) [__hpux]: Always define as __builtin_alloca.
22134
22135 1997-04-22 Richard Stallman <rms@gnu.org>
22136
22137 * src/bison.s1:
22138 [__hpux]: Include alloca.h (right for HPUX 10)
22139 instead of declaring alloca (right for HPUX 9).
22140
22141 * src/bison.s1 (__yy_memcpy):
22142 Declare arg `count' as unsigned int.
22143 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
22144
22145 1997-04-22 Richard Stallman <rms@gnu.org>
22146
22147 * bison.simple:
22148 [__hpux]: Include alloca.h (right for HPUX 10)
22149 instead of declaring alloca (right for HPUX 9).
22150
22151 * bison.simple (__yy_memcpy):
22152 Declare arg `count' as unsigned int.
22153 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
22154
22155 1997-01-03 Richard Stallman <rms@gnu.org>
22156
22157 * src/allocate.c: [__STDC__ or _MSC_VER]:
22158 Declare calloc and realloc to return void *.
22159
22160 1997-01-02 Richard Stallman <rms@gnu.org>
22161
22162 * src/system.h:
22163 [_MSC_VER]: Include stdlib.h and process.h.
22164 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
22165
22166 * src/main.c (main): Return FAILURE as a value.
22167 (printable_version): Declare arg as int, not char.
22168
22169 1997-01-02 Richard Stallman <rms@gnu.org>
22170
22171 * Makefile.in (dist):
22172 Explicitly check for symlinks, and copy them.
22173
22174 1996-12-19 Richard Stallman <rms@gnu.org>
22175
22176 * src/files.c:
22177 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
22178
22179 1996-12-18 Paul Eggert <eggert@gnu.org>
22180
22181 * src/bison.s1 (yyparse):
22182 If __GNUC__ and YYPARSE_PARAM are both defined,
22183 declare yyparse to have a void * argument.
22184
22185 1996-12-18 Paul Eggert <eggert@gnu.org>
22186
22187 * bison.simple (yyparse):
22188 If __GNUC__ and YYPARSE_PARAM are both defined,
22189 declare yyparse to have a void * argument.
22190
22191 1996-12-17 Richard Stallman <rms@gnu.org>
22192
22193 * src/reduce.c (nbits): Add some casts.
22194
22195 1996-08-12 Richard Stallman <rms@gnu.org>
22196
22197 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
22198
22199 1996-08-12 Richard Stallman <rms@gnu.org>
22200
22201 * bison.simple: Test _MSDOS as well as _MSDOS_.
22202
22203 1996-07-31 Richard Stallman <rms@gnu.org>
22204
22205 * src/bison.s1:
22206 [__sun && __i386]: Include alloca.h.
22207
22208 1996-07-31 Richard Stallman <rms@gnu.org>
22209
22210 * bison.simple:
22211 [__sun && __i386]: Include alloca.h.
22212
22213 1996-07-30 Richard Stallman <rms@gnu.org>
22214
22215 * src/bison.s1: Comment change.
22216
22217 * src/bison.s1: Test _MSDOS_, not MSDOS.
22218
22219 1996-07-30 Richard Stallman <rms@gnu.org>
22220
22221 * bison.simple: Comment change.
22222
22223 * bison.simple: Test _MSDOS_, not MSDOS.
22224
22225 1996-06-01 Richard Stallman <rms@gnu.org>
22226
22227 * 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:
22228 Insert `_' macro around many string constants.
22229
22230 * src/main.c:
22231 Insert `_' macro around many string constants.
22232
22233 (main): Call setlocale, bindtextdomain and textdomain.
22234
22235 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
22236 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
22237 [ENABLE_NLS]: Include libintl.h.
22238 [ENABLE_NLS] (gettext): Define.
22239 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
22240 (N_, PACKAGE, LOCALEDIR): New macros.
22241
22242 1996-06-01 Richard Stallman <rms@gnu.org>
22243
22244 * POTFILES.in: New file.
22245
22246 * Makefile.in (allocate.o):
22247 Define target explicitly.
22248
22249 * Makefile.in (CFLAGS): Set to @CFLAGS@.
22250 (LDFLAGS): Set to @LDFLAGS@.
22251 (configure): Run autoconf only if preceding `cd' succeeds.
22252 (bison.s1): Redirect output to temporary file then move the
22253 temporary to the target, rather than redirecting directly to bison.s1.
22254 (clean): Remove config.status and config.log.
22255 (distclean): Don't remove config.status here.
22256
22257 1996-05-12 Richard Stallman <rms@gnu.org>
22258
22259 * src/bison.s1:
22260 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
22261
22262 1996-05-12 Richard Stallman <rms@gnu.org>
22263
22264 * bison.simple:
22265 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
22266
22267 1996-05-11 Richard Stallman <rms@gnu.org>
22268
22269 * src/bison.s1 (__yy_memcpy):
22270 Really reorder the args, as was supposedly done on Feb 14 1995.
22271 (yyparse): Calls changed accordingly.
22272
22273 1996-05-11 Richard Stallman <rms@gnu.org>
22274
22275 * Makefile.in (dist): Don't use $(srcdir).
22276
22277 * bison.simple (__yy_memcpy):
22278 Really reorder the args, as was supposedly done on Feb 14 1995.
22279 (yyparse): Calls changed accordingly.
22280
22281 1996-01-27 Richard Stallman <rms@gnu.org>
22282
22283 * src/output.c (output_rule_data):
22284 Test YYERROR_VERBOSE in the conditional
22285 around the definition of ttyname.
22286
22287 1995-12-29 Richard Stallman <rms@gnu.org>
22288
22289 * src/bison.s1:
22290 Fix line numbers in #line commands.
22291
22292 1995-12-29 Richard Stallman <rms@gnu.org>
22293
22294 * bison.simple:
22295 Fix line numbers in #line commands.
22296
22297 1995-12-27 Richard Stallman <rms@gnu.org>
22298
22299 * src/bison.s1 (YYPARSE_PARAM_DECL):
22300 In C++, make it always null.
22301 (YYPARSE_PARAM_ARG): New macro.
22302 (yyparse): Use YYPARSE_PARAM_ARG.
22303
22304 1995-12-27 Richard Stallman <rms@gnu.org>
22305
22306 * bison.simple (YYPARSE_PARAM_DECL):
22307 In C++, make it always null.
22308 (YYPARSE_PARAM_ARG): New macro.
22309 (yyparse): Use YYPARSE_PARAM_ARG.
22310
22311 1995-11-29 Richard Stallman <rms@gnu.org>
22312
22313 * doc/bison.texinfo:
22314 Describe literal string tokens, %raw, %no_lines, %token_table.
22315
22316 1995-11-29 Daniel Hagerty <hag@gnu.org>
22317
22318 * doc/bison.texinfo: Fixed update date
22319
22320 1995-10-16 Richard Stallman <rms@gnu.org>
22321
22322 * src/version.c: Version 1.25.
22323
22324 1995-10-16 Richard Stallman <rms@gnu.org>
22325
22326 * NEWS: *** empty log message ***
22327
22328 1995-10-16 Richard Stallman <rms@gnu.org>
22329
22330 * doc/bison.1, doc/bison.rnh:
22331 Add new options.
22332
22333 1995-10-15 Richard Stallman <rms@gnu.org>
22334
22335 * src/vmsgetargs.c, src/getargs.c:
22336 Added -n, -k, and -raw switches.
22337 (noparserflag, toknumflag, rawtoknumflag): New variables.
22338
22339 * src/symtab.h (SALIAS):
22340 New #define for adding aliases to %token.
22341 (struct bucket): Added `alias' field.
22342
22343 * src/reduce.c (reduce_grammar):
22344 Revise error message.
22345 (print_notices): Remove final `.' from error message.
22346
22347 * src/reader.c (reader_output_yylsp):
22348 New function.
22349 (readgram): Use `#if 0' around code that accepted %command
22350 inside grammar rules: The documentation doesn't allow it,
22351 and it will fail since the %command processors scan for the next %.
22352 (parse_token_decl): Extended the %token
22353 declaration to allow a multi-character symbol as an alias.
22354 (parse_thong_decl): New function.
22355 (read_declarations): Added %thong declarations.
22356 (read_declarations): Handle NOOP to deal with allowing
22357 % declarations as another means to specify the flags.
22358 (readgram): Allow %prec prior to semantics embedded in a rule.
22359 (skip_to_char, read_declarations, copy_definition)
22360 (parse_token_decl, parse_start_decl, parse_type_decl)
22361 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
22362 (get_type_name, copy_guard, copy_action, readgram)
22363 (get_type, packsymbols): Revised most error messages.
22364 Changed `fatal' to `warnxxx' to avoid aborting for error.
22365 Revised and use multiple warnxxx functions to avoid using VARARGS1.
22366 (read_declarations): Improve the error message for
22367 an invalid character. Do not abort.
22368 (read_declarations, copy_guard, copy_action): Use
22369 printable_version to avoid unprintable characters in printed output.
22370 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
22371 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
22372 Allow the type of a non-terminal can be given
22373 more than once, as long as all specifications give the same type.
22374
22375 * src/output.c:
22376 (output_headers, output_trailers, output, output_gram)
22377 (output_rule_data): Implement noparserflag variable.
22378 Implement toknumflag variable.
22379 (output): Call reader_output_yylsp to output LTYPESTR.
22380
22381 * src/main.c (main):
22382 If reader sees an error, don't process the grammar.
22383 (fatals): Updated to not use VARARGS1.
22384 (printable_version, int_to_string, warn, warni, warns, warnss)
22385 (warnsss): New error reporting functions. Avoid abort for error.
22386
22387 * src/lex.h:
22388 Added THONG and NOOP for alias processing.
22389 Added SETOPT for the new code that allows setting options with %flags.
22390
22391 * src/lex.c:
22392 Include getopt.h. Add some extern decls.
22393 (safegetc): New function to deal with EOF gracefully.
22394 (literalchar); new function to deal with reading \ escapes.
22395 (lex): Use literalchar.
22396 (lex): Implemented "..." tokens.
22397 (literalchar, lex, parse_percent_token): Made tokenbuffer
22398 always contain the token. This includes growing the token
22399 buffer while reading an integer.
22400 (parse_percent_token): Replaced if-else statement with percent_table.
22401 (parse_percent_token): Added % declarations as another
22402 way to specify the flags -n, -l, and -r. Also added hooks for
22403 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
22404 major changes to files.c.
22405 (lex) Retain in the incoming stream a character following
22406 an incorrect '/'.
22407 (skip_white_space, lex): Revised most error messages
22408 and changed fatal to warn to avoid aborting.
22409 (percent_table): Added %thong declarations.
22410
22411 * src/gram.h: Comment changes.
22412
22413 * src/files.c (openfiles, open_extra_files, done):
22414 Add faction flag
22415 and actfile file. Handle noparserflag. Both for -n switch.
22416
22417 * src/conflicts.c (resolve_sr_conflict):
22418 Remove use of alloca.
22419
22420 1995-06-01 Jim Meyering <meyering@gnu.org>
22421
22422 * doc/bison.texinfo: *** empty log message ***
22423
22424 1995-05-06 Richard Stallman <rms@gnu.org>
22425
22426 * src/bison.s1: Comment change.
22427
22428 1995-05-06 Richard Stallman <rms@gnu.org>
22429
22430 * bison.simple: Comment change.
22431
22432 1995-05-03 Richard Stallman <rms@gnu.org>
22433
22434 * src/version.c: Version now 1.24.
22435
22436 * src/bison.s1: Change distribution terms.
22437
22438 * src/version.c: Version now 1.23.
22439
22440 1995-05-03 Richard Stallman <rms@gnu.org>
22441
22442 * doc/bison.texinfo:
22443 Rewrite "Conditions for Using Bison".
22444 Update version to 1.24.
22445
22446 1995-05-03 Richard Stallman <rms@gnu.org>
22447
22448 * bison.simple: Change distribution terms.
22449
22450 1995-02-23 Richard Stallman <rms@gnu.org>
22451
22452 * src/files.c: Test __VMS_POSIX as well as VMS.
22453
22454 1995-02-14 Jim Meyering <meyering@gnu.org>
22455
22456 * src/bison.s1 (__yy_memcpy):
22457 Renamed from __yy_bcopy to avoid
22458 confusion. Reverse FROM and TO arguments to be consistent with
22459 those of memcpy.
22460
22461 1995-02-14 Jim Meyering <meyering@gnu.org>
22462
22463 * bison.simple (__yy_memcpy):
22464 Renamed from __yy_bcopy to avoid
22465 confusion. Reverse FROM and TO arguments to be consistent with
22466 those of memcpy.
22467
22468 1994-11-10 David J. MacKenzie <djm@gnu.org>
22469
22470 * NEWS: reformat
22471
22472 * NEWS: New file.
22473
22474 * Makefile.in (DISTFILES): Include NEWS.
22475
22476 * Makefile.in (DISTFILES):
22477 Include install-sh, not install.sh.
22478
22479 * configure.in: Update to Autoconf v2 macro names.
22480
22481 1994-10-05 David J. MacKenzie <djm@gnu.org>
22482
22483 * Makefile.in: fix typo
22484
22485 * Makefile.in (prefix, exec_prefix):
22486 Let configure set them.
22487
22488 1994-09-28 David J. MacKenzie <djm@gnu.org>
22489
22490 * Makefile.in: Set datadir to $(prefix)/share.
22491
22492 1994-09-15 Richard Stallman <rms@gnu.org>
22493
22494 * src/bison.s1:
22495 Update copyright notice and GPL version.
22496
22497 1994-09-15 Richard Stallman <rms@gnu.org>
22498
22499 * bison.simple:
22500 Update copyright notice and GPL version.
22501
22502 1994-07-12 Richard Stallman <rms@gnu.org>
22503
22504 * src/reduce.c, src/reader.c:
22505 entered into RCS
22506
22507 1994-05-05 David J. MacKenzie <djm@gnu.org>
22508
22509 * Makefile.in: entered into RCS
22510
22511 1994-03-26 Richard Stallman <rms@gnu.org>
22512
22513 * src/bison.s1: entered into RCS
22514
22515 1994-03-26 Richard Stallman <rms@gnu.org>
22516
22517 * bison.simple: entered into RCS
22518
22519 1994-03-25 Richard Stallman <rms@gnu.org>
22520
22521 * src/main.c: entered into RCS
22522
22523 1994-03-24 Richard Stallman <rms@gnu.org>
22524
22525 * src/conflicts.c: entered into RCS
22526
22527 1994-01-02 Richard Stallman <rms@gnu.org>
22528
22529 * Makefile.in: *** empty log message ***
22530
22531 1993-11-21 Richard Stallman <rms@gnu.org>
22532
22533 * src/bison.s1: *** empty log message ***
22534
22535 1993-11-21 Richard Stallman <rms@gnu.org>
22536
22537 * doc/bison.texinfo: entered into RCS
22538
22539 * doc/bison.texinfo: *** empty log message ***
22540
22541 1993-11-21 Richard Stallman <rms@gnu.org>
22542
22543 * bison.simple: *** empty log message ***
22544
22545 1993-10-25 David J. MacKenzie <djm@gnu.org>
22546
22547 * doc/bison.texinfo: *** empty log message ***
22548
22549 1993-10-19 Richard Stallman <rms@gnu.org>
22550
22551 * src/bison.s1: *** empty log message ***
22552
22553 1993-10-19 Richard Stallman <rms@gnu.org>
22554
22555 * bison.simple: *** empty log message ***
22556
22557 1993-10-14 Richard Stallman <rms@gnu.org>
22558
22559 * src/bison.s1: *** empty log message ***
22560
22561 1993-10-14 Richard Stallman <rms@gnu.org>
22562
22563 * bison.simple: *** empty log message ***
22564
22565 1993-09-14 David J. MacKenzie <djm@gnu.org>
22566
22567 * doc/bison.texinfo: *** empty log message ***
22568
22569 1993-09-13 Noah Friedman <friedman@gnu.org>
22570
22571 * Makefile.in: *** empty log message ***
22572
22573 1993-09-10 Richard Stallman <rms@gnu.org>
22574
22575 * src/conflicts.c: *** empty log message ***
22576
22577 * src/system.h: entered into RCS
22578
22579 1993-09-10 Richard Stallman <rms@gnu.org>
22580
22581 * doc/bison.1: entered into RCS
22582
22583 1993-09-06 Noah Friedman <friedman@gnu.org>
22584
22585 * src/version.c: entered into RCS
22586
22587 1993-09-06 Noah Friedman <friedman@gnu.org>
22588
22589 * Makefile.in: *** empty log message ***
22590
22591 1993-07-30 David J. MacKenzie <djm@gnu.org>
22592
22593 * Makefile.in: *** empty log message ***
22594
22595 1993-07-24 Richard Stallman <rms@gnu.org>
22596
22597 * src/bison.s1: *** empty log message ***
22598
22599 1993-07-24 Richard Stallman <rms@gnu.org>
22600
22601 * bison.simple: *** empty log message ***
22602
22603 1993-07-08 David J. MacKenzie <djm@gnu.org>
22604
22605 * Makefile.in: *** empty log message ***
22606
22607 1993-07-04 Richard Stallman <rms@gnu.org>
22608
22609 * src/bison.s1: *** empty log message ***
22610
22611 1993-07-04 Richard Stallman <rms@gnu.org>
22612
22613 * bison.simple: *** empty log message ***
22614
22615 1993-06-26 David J. MacKenzie <djm@gnu.org>
22616
22617 * src/getargs.c: entered into RCS
22618
22619 1993-06-26 David J. MacKenzie <djm@gnu.org>
22620
22621 * doc/bison.texinfo: *** empty log message ***
22622
22623 * doc/bison.1: New file.
22624
22625 1993-06-25 Richard Stallman <rms@gnu.org>
22626
22627 * src/getargs.c: New file.
22628
22629 1993-06-16 Richard Stallman <rms@gnu.org>
22630
22631 * src/bison.s1: *** empty log message ***
22632
22633 1993-06-16 Richard Stallman <rms@gnu.org>
22634
22635 * bison.simple: *** empty log message ***
22636
22637 1993-06-03 Richard Stallman <rms@gnu.org>
22638
22639 * src/bison.s1: New file.
22640
22641 1993-06-03 Richard Stallman <rms@gnu.org>
22642
22643 * doc/bison.texinfo: *** empty log message ***
22644
22645 1993-06-03 Richard Stallman <rms@gnu.org>
22646
22647 * bison.simple: New file.
22648
22649 1993-05-19 Richard Stallman <rms@gnu.org>
22650
22651 * doc/bison.texinfo: New file.
22652
22653 1993-05-07 Noah Friedman <friedman@gnu.org>
22654
22655 * Makefile.in: *** empty log message ***
22656
22657 1993-04-28 Noah Friedman <friedman@gnu.org>
22658
22659 * src/reader.c: *** empty log message ***
22660
22661 1993-04-23 Noah Friedman <friedman@gnu.org>
22662
22663 * src/alloc.h: entered into RCS
22664
22665 1993-04-20 David J. MacKenzie <djm@gnu.org>
22666
22667 * src/version.c: *** empty log message ***
22668
22669 * src/files.c, src/allocate.c:
22670 entered into RCS
22671
22672 * src/reader.c: *** empty log message ***
22673
22674 * src/lex.c: entered into RCS
22675
22676 * src/conflicts.c: New file.
22677
22678 * src/symtab.c: entered into RCS
22679
22680 * src/alloc.h: New file.
22681
22682 * src/LR0.c: entered into RCS
22683
22684 1993-04-18 Noah Friedman <friedman@gnu.org>
22685
22686 * src/reader.c: New file.
22687
22688 * src/version.c: *** empty log message ***
22689
22690 1993-04-18 Noah Friedman <friedman@gnu.org>
22691
22692 * Makefile.in: *** empty log message ***
22693
22694 1993-04-17 Noah Friedman <friedman@gnu.org>
22695
22696 * Makefile.in: *** empty log message ***
22697
22698 1993-04-15 Richard Stallman <rms@gnu.org>
22699
22700 * src/main.c, src/files.c:
22701 New file.
22702
22703 1993-04-15 Noah Friedman <friedman@gnu.org>
22704
22705 * configure.in: entered into RCS
22706
22707 * configure.in: *** empty log message ***
22708
22709 * configure.in: New file.
22710
22711 1993-04-14 Richard Stallman <rms@gnu.org>
22712
22713 * Makefile.in: New file.
22714
22715 1993-04-13 Richard Stallman <rms@gnu.org>
22716
22717 * src/version.c: New file.
22718
22719 1993-03-25 Richard Stallman <rms@gnu.org>
22720
22721 * src/output.c: entered into RCS
22722
22723 1992-09-25 Richard Stallman <rms@gnu.org>
22724
22725 * configure.bat: entered into RCS
22726
22727 1992-06-22 Richard Stallman <rms@gnu.org>
22728
22729 * src/vmsgetargs.c: entered into RCS
22730
22731 1992-06-22 Richard Stallman <rms@gnu.org>
22732
22733 * doc/bison.rnh: entered into RCS
22734
22735 1992-04-20 David J. MacKenzie <djm@gnu.org>
22736
22737 * README: entered into RCS
22738
22739 1992-01-22 Richard Stallman <rms@gnu.org>
22740
22741 * src/machine.h: entered into RCS
22742
22743 1991-12-21 Richard Stallman <rms@gnu.org>
22744
22745 * src/lalr.c, src/closure.c:
22746 entered into RCS
22747
22748 1991-12-20 Richard Stallman <rms@gnu.org>
22749
22750 * src/state.h: entered into RCS
22751
22752 1991-12-18 Richard Stallman <rms@gnu.org>
22753
22754 * src/print.c, src/nullable.c, src/derives.c:
22755 entered into RCS
22756
22757 1991-11-03 David J. MacKenzie <djm@gnu.org>
22758
22759 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
22760 entered into RCS
22761
22762 1988-09-09 Richard Stallman <rms@gnu.org>
22763
22764 * src/bison.hairy: entered into RCS
22765
22766 1987-12-16 Richard Stallman <rms@gnu.org>
22767
22768 * REFERENCES: entered into RCS
22769
22770
22771 -----
22772
22773 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
22774 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
22775 Free Software Foundation, Inc.
22776
22777 Copying and distribution of this file, with or without
22778 modification, are permitted provided the copyright notice and this
22779 notice are preserved.