]> git.saurik.com Git - bison.git/blame - ChangeLog
Factor the generation of the (integral) tables bw yacc.c and lalr1.cc.
[bison.git] / ChangeLog
CommitLineData
0991e29b
AD
12008-11-26 Akim Demaille <demaille@gostai.com>
2
3 Factor the generation of the (integral) tables bw yacc.c and lalr1.cc.
4 * data/lalr1.cc (b4_tables_map): Move to...
5 * data/bison.m4: here.
6 Update the comment for yytable during the flight.
7 (b4_tables_declare, b4_tables_define): New.
8 * data/lalr1.cc: Use them.
9 * data/c.m4 (b4_table_define): New.
10 * data/yacc.c: Use b4_tables_define instead of output the tables
11 by hand.
12 * tests/regression.at (Web2c Actions): Adjust the expected output,
13 the order of the tables changed.
14
3d3bc1fe
AD
152008-11-26 Akim Demaille <demaille@gostai.com>
16
17 Get rid of (yy)rhs and (yy)prhs.
18 These tables are no longer needed in the parsers, and they don't seem to
19 be useful. They are not documented either.
20
21 * src/output.c (prepare_rules): Get rid of rhs and prhs.
22 Adjust the computation of (yy)r2.
23
08c81469
AD
242008-11-26 Akim Demaille <demaille@gostai.com>
25
26 Rule length is unsigned.
27 * src/gram.h, src/gram.c (rule_rhs_length): Return a size_t.
28
932b0c96
AD
292008-11-26 Akim Demaille <demaille@gostai.com>
30
31 Get rid of lalr1-split.cc.
32 It was no longer maintainer.
33
34 * data/lalr1-split.cc: Remove.
35 * etc/bench.pl.in (bench_fusion_parser): Remove.
36 Adjust.
37
8452c667
AD
382008-11-26 Akim Demaille <demaille@gostai.com>
39
40 Use yy* consistently.
41 * data/glr.c: Now that yyrhs no longer exists as a global
42 variable, rename local "rhs" variables into "yyrhs" for
43 consistency.
44
783aa653
AD
452008-11-25 Akim Demaille <demaille@gostai.com>
46
47 Get rid of yyrhs and yyprhs in glr.c.
48 * data/glr.c (yyrhs, yyprhs): Remove.
49 Instead, use the state stack and yystos.
50
6130b755
AD
512008-11-25 Akim Demaille <demaille@gostai.com>
52
53 Flag glr tests.
54 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): If glr, declare it
55 as an Autotest keyword.
56
95a7b1c9
AD
572008-11-25 Akim Demaille <demaille@gostai.com>
58
59 Prefer TESTSUITE_FLAGS.
60 TESTSUITEFLAGS is barely readable.
61
62 * tests/local.mk (TESTSUITE_FLAGS): Default to $(TESTSUITEFLAGS)
63 for backward compatibility.
64 Use the former instead of the latter.
65
b4f18401
AD
662008-11-25 Akim Demaille <demaille@gostai.com>
67
68 Get rid of yyrhs and yyprhs in larl1.java.
69 * data/lalr1.java (yyrhs_, yyprhs_): Remove.
70 (yy_reduce_print): Rather, use yystos_ and the state stack.
71
c265fd6b
AD
722008-11-25 Akim Demaille <demaille@gostai.com>
73
74 Formatting changes.
75
68dbdee8
AD
762008-11-25 Akim Demaille <demaille@gostai.com>
77
78 Get rid of yyrhs and yyprhs in yacc.c.
79 They were used to get the symbol types, given a rule number, when
80 displaying the top of the stack before a reduction. But the symbol type
81 is available from the state stack. This has two be benefits: two tables
82 less in the parser (making it smaller), and a more consistent use of the
83 three stacks which will help to fuse them.
84
85 * data/yacc.c (yyprhs, yyrhs): Remove.
86 (YY_REDUCE_PRINT): Pass yyssp to yy_reduce_print.
87 (yy_reduce_print): Take yyssp as argument.
88 Use it, together with yystos, to get the symbol type.
89 * tests/regression.at (Web2c Report): Remove these tables from the
90 expected output.
91
6ab1adbe
AD
922008-11-25 Akim Demaille <demaille@gostai.com>
93
94 b4_tables_map.
95 The point is to factor the generation of the tables across skeletons.
96 This is language dependant.
97
98 * data/c.m4 (b4_comment_): New.
99 Should be usable to define how to generate tables independently of
100 the language.
101 (b4_c_comment): New.
102 (b4_comment): Bounce to b4_c_comment.
103 Now support $2 = [PREFIX] for indentation.
104 * data/lalr1.cc (b4_table_declare): Don't output a comment if
105 there is no comment.
106 Indent it properly when there is one.
107 Output the ending semicolon.
108 (b4_table_define): Space changes.
109 Output the ending semicolon.
110 (b4_tables_map): New.
111 Use it twice instead of declaring and defining the (integral)
112 tables by hand.
113
0fddb3d5
AD
1142008-11-25 Akim Demaille <demaille@gostai.com>
115
116 b4_table_declare.
117 * data/lalr1.cc (b4_table_declare): New.
118 Use it to declare the tables defined with b4_table_define.
119 (b4_table_define): Declare a third arg to match b4_table_declare
120 signature.
121 Move all the comments around invocations of b4_table_define into
122 the invocations itselves.
123 Move things around to have the order for declarations and
124 definitions.
125
c4ddc0fb
AD
1262008-11-25 Akim Demaille <demaille@gostai.com>
127
128 Formatting changes.
129 * data/lalr1.java: here.
130
e0c653e7
AD
1312008-11-25 Akim Demaille <demaille@gostai.com>
132
133 b4_args is more general than only C++.
134 * data/lalr1.cc (b4_args, _b4_args): Move to...
135 * data/bison.m4: here.
136
4182a0a1
DJ
1372008-11-21 Di-an Jan <dianj@freeshell.org>
138
139 Implement no-XXX arguments for --warnings, --report, --trace.
140 * src/getargs.c (flags_argmatch): Handles no-XXX.
141 Fix typo in doxygen comment.
142
01466c3e
AD
1432008-11-21 Akim Demaille <demaille@gostai.com>
144
145 Display the changes in cross-options.texi.
146 * build-aux/cross-options.pl ($sep): New, to separate items.
147 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Use diff to display the
148 changes.
149
a7c09cba
DJ
1502008-11-20 Di-an Jan <dianj@freeshell.org>
151
152 Improves options in the manual.
153 * doc/bison.texinfo (-g, -x): Add space before argument.
154 (Option Cross Key): Implement FIXME: listing directives also.
155 * build-aux/cross-options.pl: Read from <STDIN> rather than <>.
156 (Short Option): Special case -d. Put arguments inside @option.
157 (Bison Directive): Add column, automatically extracted from
158 src/scan-gram.l (actual name passed as the first argument)
159 with special case for %define.
160 * doc/local.mk (doc/cross-options.texi): Pass src/scan-gram.l
161 to build-aux/cross-options.pl.
162 * src/getargs.c (usage): Document limitations of cross-options.pl.
163 * src/scan-gram.l: Likewise.
164
6c88b51e
JD
1652008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
166
167 Fix unexpanded macros in GLR defines file.
168 Reported by Csaba Raduly at
169 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
170 * THANKS (Csaba Raduly): Add.
171 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
172 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
173 lexer in a separate module that includes the defines file.
174 (AT_CHECK_CALC): From AT_FULL_COMPILE, request compilation of lexer
175 source.
176 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
177 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
178 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
179 (AT_DATA_SOURCE_PROLOGUE): New.
180 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
181 (AT_DATA_SOURCE): New.
182 (AT_FULL_COMPILE): Extend to support an additional source file.
183
1e034807
AD
1842008-11-18 Akim Demaille <demaille@gostai.com>
185
186 More TODO.
187 * TODO: More short term issues.
188
e3dda35c
AD
1892008-11-18 Akim Demaille <demaille@gostai.com>
190
191 Regen.
192 * src/parse-gram.h, src/parse-gram.c: Regen.
193
bd187d7b
AD
1942008-11-18 Akim Demaille <demaille@gostai.com>
195
196 Use b4_subtract where possible.
197 * data/lalr1.cc (b4_subtract): Move to...
198 * data/bison.m4: here.
199 * data/glr.c (b4_rhs_data): Use it.
200 * data/yacc.c (b4_rhs_value, b4_rhs_location): Use it.
201
6085ab0d
AD
2022008-11-18 Akim Demaille <demaille@gostai.com>
203
204 Remove incorrect mode specification.
205 * data/glr.cc: Don't pretend it's C code.
206
9ce405ce
JD
2072008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
208
209 Simplify last patch slightly.
210 * src/getargs.c (getargs): Here.
211
a8beef7e
JD
2122008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
213
214 Fix last warning from --enable-gcc-warnings.
215 * src/getargs.c (getargs): Don't assign const address to non-const
216 pointer.
217
d50eea6d
JD
2182008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
219
220 Don't let maintainer-*-check targets force a version update.
221 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
222 handled.
223
f5f419de
DJ
2242008-11-17 Di-an Jan <dianj@freeshell.org>
225
226 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
227 Align menus. Adjust word wrapping. Use node names for menu names.
228 (Examples): Don't abbreviate node names.
229 (LocalWords): Remove abbreviations.
230 (Copying): Make description a sentence.
d50eea6d 231 (Java Action Features): Remove period to match the rest of menu.
f5f419de 232
d73e55e0
DJ
2332008-11-17 Di-an Jan <dianj@freeshell.org>
234
235 Handles several --enable-gcc-warnings.
236 * src/getargs.c (command_line_location): Set parameters to void.
237 * src/output.c (symbol_type_name_cmp): Make static.
238 (symbols_by_type_name): Set parameters to void.
239 (symbol_definitions_output): Remove unused parameter. Rename as...
240 (prepare_symbol_definitions): this.
241 (muscles_output): Move symbol_definitions_output to...
242 (output): here as prepare_symbol_definitions.
243 * tests/c++.at (AT_CHECK_VARIANTS): Remove unused parameters of main.
d50eea6d 244 (AT_CHECK_NAMESPACE): Make unused parameter lloc unnamed.
d73e55e0 245
68c989de
DJ
2462008-11-17 Di-an Jan <dianj@freeshell.org>
247
248 * tests/c++.at (AT_CHECK_VARIANTS): Fixes tests 198-202.
249 Use AT_DATA_GRAMMAR instead of AT_DATA for compiled tests.
250
23ce6f4c
AD
2512008-11-16 Akim Demaille <demaille@gostai.com>
252
253 Add missing $(EXEEXT).
254 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): The target is
255 "src/bison$(EXEEXT)".
256 Reported by Di-an Jan.
257
dd704c35
AD
2582008-11-15 Akim Demaille <demaille@gostai.com>
259
260 * TODO: Update.
261
dab244d5
AD
2622008-11-15 Akim Demaille <demaille@gostai.com>
263
264 Formatting changes.
265 * tests/input.at: here.
266
4b4da9fb
AD
2672008-11-15 Akim Demaille <demaille@gostai.com>
268
269 Remove duplicate header inclusion.
270 * src/LR0.c: here.
271
4ea3f53d
AD
2722008-11-15 Akim Demaille <demaille@gostai.com>
273
274 * src/parse-gram.h, src/parse-gram.c: Regen.
275
cb823b6f
AD
2762008-11-15 Akim Demaille <demaille@gostai.com>
277
278 Support parametric types.
b06df3c2
AD
279
280 There are two issues to handle: first scanning nested angle
281 bracket pairs to support types such as std::pair< std::string,
282 std::list<std::string> > >.
283
284 Another issue is to address idiosyncracies of C++: do not glue two
285 closing angle brackets together (otherwise it's operator>>), and
286 avoid sticking blindly a TYPE to the opening <, as it can result
287 in '<:' which is a digraph for '['.
288
cb823b6f
AD
289 * src/scan-gram.l (brace_level): Rename as...
290 (nesting): this.
291 (SC_TAG): New.
292 Implement support for complex tags.
b06df3c2 293 (tag): Accept
cb823b6f
AD
294 , but not <.
295 * data/lalr1.cc (b4_symbol_value, b4_symbol_value_template)
296 (b4_symbol_variant): Leave space around types as parameters.
297 * examples/variant.yy: Use nested template types and leading ::.
298 * src/parse-gram.y (TYPE, TYPE_TAG_ANY, TYPE_TAG_NONE, type.opt):
299 Rename as...
300 (TAG, TAG_ANY, TAG_NONE, tag.opt): these.
301 * tests/c++.at: Test parametric types.
302
7b6e6753
AD
3032008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
304
305 Test token.prefix.
306 This is not sufficient, but we test at least that the make_SYMBOL
307 interface is not affected by token.prefix. A more general test
308 will be implemented when the support of token.prefix is generalized
309 to more skeletons.
b06df3c2 310
7b6e6753
AD
311 * tests/c++.at: One more variant test, using token.prefix.
312
dddec537
AD
3132008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
314
315 Test the make_TOKEN interface.
316 * tests/c++.at (AT_CHECK_VARIANTS): Require and use locations.
317 Factor the common code in yylex.
318 Use it to test "%define lex_symbol".
319
7d3e21ba
AD
3202008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
321
322 Formatting change.
323
4fc55348
AD
3242008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
325
326 Simplify code for variants bench marks.
327 * etc/bench.pl.in (&generate_grammar_list): Define and use
328 location_type.
329 Factor the common code in yylex.
330
070e6509
AD
3312008-11-15 Akim Demaille <demaille@gostai.com>
332
333 Better error message.
334 * bootstrap (find_tool): Fix the error message.
335
0078681b
AD
3362008-11-15 Akim Demaille <demaille@gostai.com>
337
338 Update variant.yy to newest interface.
339 * examples/variant.yy: Define lex_symbol.
340 Adjust.
341
ff084799
AD
3422008-11-15 Akim Demaille <demaille@gostai.com>
343
344 Don't use locations in variant.yy.
345 * examples/variant.yy: Adjust to not using locations.
346
b0d79ec6
AD
3472008-11-15 Akim Demaille <demaille@gostai.com>
348
349 Comment changes.
350 * data/local.mk, etc/local.mk, examples/local.mk: Use Automake
351 comments for the license.
352
d4977ce3
AD
3532008-11-15 Akim Demaille <demaille@gostai.com>
354
355 Remove tests/Makefile.am.
356 * tests/Makefile.am: Rename as...
357 * tests/local.mk: this.
358 * Makefile.am, configure.ac: Adjust.
359 * Makefile.am (DISTCLEANFILES): Define.
360 (maintainer-check, maintainer-xml-check, maintainer-push-check):
361 Remove, we no longer need to bounce to the real targets.
362
87f1149a
AD
3632008-11-15 Akim Demaille <demaille@gostai.com>
364
365 Comment changes.
366
36415906
AD
3672008-11-15 Akim Demaille <demaille@gostai.com>
368
369 djgpp/local.mk.
370 * Makefile.am (EXTRA_DIST): Move djgpp related part to...
371 * djgpp/local.mk: this new file.
372
e2c2f696
AD
3732008-11-15 Akim Demaille <demaille@gostai.com>
374
375 Remove doc/Makefile.am.
376 * doc/Makefile.am: Rename as...
377 * doc/local.mk: this.
378 Adjust paths
379 * Makefile.am, configure.ac: Adjust.
380 * Makefile.am (MOSTLYCLEANFILES): New.
381 * src/local.mk: Adjust.
382
2ead32e6
AD
3832008-11-15 Akim Demaille <demaille@gostai.com>
384
385 Move sc_tight_scope into maint.mk.
b06df3c2
AD
386 It does not work, and I don't know how it was supposed to work: it
387 seems to be looking for sources in the build tree. I just moved
388 it at a better place, fixing it is still required.
389
2ead32e6
AD
390 * src/local.mk (echo): Remove.
391 (sc_tight_scope): Move to...
392 * maint.mk: here.
393
2df9ec37
AD
3942008-11-15 Akim Demaille <demaille@gostai.com>
395
396 Regen.
397 * src/parse-gram.h, src/parse-gram.h: Regen.
398
0305d25e
AD
3992008-11-15 Akim Demaille <demaille@gostai.com>
400
401 Remove src/Makefile.am.
402 * src/Makefile.am: Rename as...
403 * src/local.mk: this.
404 Prefix all the paths with src/.
405 (AUTOMAKE_OPTIONS): Build object files in the sub dirs.
406 (AM_CPPFLAGS): Find find in builddir/src.
407 (YACC): Move the flags into...
408 (AM_YFLAGS): here.
409 * maint.mk (sc_tight_scope): Disable.
410 It used to bounce to the version in src/Makefile.am which is now
411 part of this very Makefile.
412 * Makefile.am, configure.ac: Adjust.
413 * src/scan-code-c.c, src/scan-code.l: We can no longer rely on
414 include "..." to find files "here": we are no longer in src/, so
415 qualify the includes with src/.
416 * doc/Makefile.am (PREPATH): No longer include the top_builddir
417 prefix.
418 (.x.1): Adjust to be able to create src/foo from the top level
419 Makefile, instead of going bounce to src/Makefile the creation of
420 foo.
421
5277c0a3
AD
4222008-11-15 Akim Demaille <demaille@gostai.com>
423
424 Remove useless variable.
425 * doc/Makefile.am (srcsrcdir): Remove.
426
6a5aa0cd
AD
4272008-11-15 Akim Demaille <demaille@gostai.com>
428
429 Remove data/Makefile.am.
430 * data/Makefile.am: Rename as...
431 * data/local.mk: this.
432 Adjust paths.
433 * Makefile.am, configure.ac: Adjust.
434
7cb794dc
AD
4352008-11-15 Akim Demaille <demaille@gostai.com>
436
437 Remove etc/Makefile.am.
438 * etc/Makefile.am: Rename as...
439 * etc/local.mk: this.
440 Adjust.
441 * Makefile.am, configure.ac: Adjust.
442
cd409e3b
AD
4432008-11-15 Akim Demaille <demaille@gostai.com>
444
445 Remove examples/local.mk.
446 examples/calc++/Makefile.am might be interesting to keep as is, since
447 it is an example in itself.
2df9ec37 448
cd409e3b
AD
449 * examples/Makefile.am: Rename as...
450 * examples/local.mk: this.
451 Adjust.
452 * Makefile.am, configure.ac: Adjust.
453
9a1e4214
AD
4542008-11-15 Akim Demaille <demaille@gostai.com>
455
456 Remove build-aux/Makefile.am.
457 Recursive Makefiles are really way too slow, let's get rid of some of
458 them.
2df9ec37 459
9a1e4214
AD
460 * build-aux/Makefile.am: Rename as...
461 * build-aux/local.mk: this.
462 Adjust paths.
463 * Makefile.am, configure.ac: Adjust.
464
0634493c
AD
4652008-11-15 Akim Demaille <demaille@gostai.com>
466
467 Provide convenience constructors for locations and positions.
468 * data/location.cc (position::position): Accept file, line and
469 column as arguments with default values.
470 Always qualify initial line and column literals as unsigned.
471 (location::location): Provide convenience constructors.
472
fe1b448a
AD
4732008-11-15 Akim Demaille <demaille@gostai.com>
474
b06df3c2
AD
475 Instead of using make_symbol<TOK_FOO>, generate make_FOO for each
476 token type.
fe1b448a
AD
477 Using template buys us nothing, and makes it uselessly complex to
478 construct a symbol. Besides, it could not be generalized to other
479 languages, while make_FOO would work in C/Java etc.
2df9ec37 480
fe1b448a
AD
481 * data/lalr1.cc (b4_symbol_): New.
482 (b4_symbol): Use it.
483 (b4_symbol_constructor_declaration_)
484 (b4_symbol_constructor_definition_): Instead of generating
485 specializations of an overloaded template function, just generate
486 several functions whose names are forged from the token names
487 without the token.prefix.
488 (b4_symbol_constructor_declarations): Generate them for all the
489 symbols, not just by class of symbol type, now that instead of
490 specializing a function template by the token, we generate a
491 function named after the token.
492 (b4_symbol_constructor_specialization_)
493 (b4_symbol_constructor_specializations): Remove.
494 * etc/bench.pl.in: Adjust to this new API.
495
5679f311
AD
4962008-11-13 Akim Demaille <demaille@gostai.com>
497
498 %define token.prefix.
b06df3c2
AD
499 Provide a means to add a prefix to the name of the tokens as
500 output in the generated files. Because of name clashes, it is
501 good to have such a prefix such as TOK_ that protects from names
502 such as EOF, FILE etc. But it clutters the grammar itself.
2df9ec37 503
5679f311
AD
504 * data/bison.m4 (token.prefix): Empty by default.
505 * data/c.m4 (b4_token_enum, b4_token_define): Use it.
506 * data/lalr1.cc (b4_symbol): Ditto.
507
3204049e
AD
5082008-11-13 Akim Demaille <demaille@gostai.com>
509
510 Compute at M4 time some of the subtractions.
90290ce5 511 * data/lalr1.cc (b4_subtract): New.
3204049e
AD
512 (b4_rhs_data): Use it.
513
202598d3
AD
5142008-11-13 Akim Demaille <demaille@gostai.com>
515
516 symbol::token.
b06df3c2 517 This allows the user to get the type of a token returned by yylex.
2df9ec37 518
202598d3
AD
519 * data/lalr1.cc (symbol::token): New.
520 (yytoknum_): Define when %define lex_symbol, independently of
521 %debug.
522 (yytoken_number_): Move into...
523 (symbol::token): here, since that's the only use.
524 The other one is YYPRINT which was not officially supported
525 by lalr1.cc, and anyway it did not work since YYPRINT uses this
526 array under a different name (yytoknum).
527
fc2476c7
AD
5282008-11-13 Akim Demaille <demaille@gostai.com>
529
530 YYERRCODE.
531 * TODO (YYERRCODE): Mention the case of $undef.
532
865f1e9f
AD
5332008-11-13 Akim Demaille <demaille@gostai.com>
534
535 TODO: YYPRINT.
536 * TODO (YYPRINT): New.
537
cb0b136a
AD
5382008-11-13 Akim Demaille <demaille@gostai.com>
539
540 Comment changes.
541 * data/lalr1.cc, data/yacc.c: Fix the description of the
542 yytranslate and yytoknum tables.
543
2c086d29
AD
5442008-11-13 Akim Demaille <demaille@gostai.com>
545
546 Define make_symbol in the header.
b06df3c2
AD
547 To reach good performances these functions should be inlined (yet
548 this is to measure precisely). To this end they must be available
549 to the caller.
2df9ec37 550
2c086d29
AD
551 * data/lalr1.cc (b4_symbol_constructor_definition_): Qualify
552 location_type with the class name.
553 Since will now be output in the header, declare "inline".
554 No longer use b4_symbol_constructor_specializations, but
555 b4_symbol_constructor_definitions in the header.
556 Don't call it in the *.cc file.
557
1c4af381
AD
5582008-11-13 Akim Demaille <demaille@gostai.com>
559
560 Define yytranslate in the header for lex_symbol.
561 * data/lalr1.cc: Move the invocation of b4_yytranslate_definition
562 into the header file when using %define lex_symbol.
563 (yytranslate_): Declare inline.
564
e51b0a82
AD
5652008-11-13 Akim Demaille <demaille@gostai.com>
566
b06df3c2
AD
567 Define the constructors of symbol_type in
568 b4_symbol_constructor_definitions.
e51b0a82 569 The constructors are called by the make_symbol functions, which a
b06df3c2
AD
570 forthcoming patch will move elsewhere. Hence the interest of
571 putting them together.
2df9ec37 572
b06df3c2
AD
573 The stack_symbol_type does not need to be moved, it is used only
574 by the parser.
2df9ec37 575
e51b0a82
AD
576 * data/lalr1.cc: Move symbol_type and symbol_base_type
577 constructors into...
578 (b4_symbol_constructor_definitions): here.
579 Adjust.
580
78835571
AD
5812008-11-13 Akim Demaille <demaille@gostai.com>
582
583 Make it easier to move the definition of yytranslate_.
584 Forthcoming changes will make it possible to use yytranslate_
585 from outside the parser implementation file.
2df9ec37 586
78835571
AD
587 * data/lalr1.cc (b4_yytranslate_definition): New.
588 Use it.
589
c1e6c88c
AD
5902008-11-13 Akim Demaille <demaille@gostai.com>
591
592 Remove useless class specification.
593 * data/lalr1.cc (b4_symbol_constructor_specialization_): No need
594 to refer to the class name to use a type defined by the class for
595 arguments of member functions.
596
4654b0c0
AD
5972008-11-13 Akim Demaille <demaille@gostai.com>
598
599 Finer input type for yytranslate.
600 This patch is debatable: the tradition expects yylex to return an int
601 which happens to correspond to token_number (which is an enum). This
602 allows for instance to return characters (such as '*' etc.). But this
603 goes against the stronger typing I am trying to have with the new
604 lex interface which return a symbol_type. So in this case, feed
605 yytranslate_ with a token_type.
2df9ec37 606
4654b0c0
AD
607 * data/lalr1.cc (yytranslate_): When in %define lex-symbol,
608 expect a token_type.
609
dd735e4e
AD
6102008-11-13 Akim Demaille <demaille@gostai.com>
611
612 Honor lex-params in %define lex_symbol mode.
613 * data/lalr1.cc: Use b4_lex_param.
614
6659366c
AD
6152008-11-13 Akim Demaille <demaille@gostai.com>
616
617 Simplify names.
618 * src/output.c (symbol_definitions_output): Rename symbol
619 attributes type_name and has_type_name as type and has_type.
620 * data/lalr1.cc: Adjust uses.
621
e9805e57
AD
6222008-11-13 Akim Demaille <demaille@gostai.com>
623
624 Use b4_type_names for the union type.
b06df3c2
AD
625 The union used to compute the size of the variant used to iterate
626 over the type of all the symbols, with a lot of redundancy. Now
627 iterate over the lists of symbols having the same type-name.
2df9ec37 628
e9805e57
AD
629 * data/lalr1.cc (b4_char_sizeof_): New.
630 (b4_char_sizeof): Use it.
631 Adjust to be called with a list of numbers instead of a single
632 number.
633 Adjust its caller for new-line issues.
634
aea10ef4
AD
6352008-11-13 Akim Demaille <demaille@gostai.com>
636
637 Define the "identifier" of a symbol.
b06df3c2
AD
638 Symbols may have several string representations, for instance if
639 they have an alias. What I call its "id" is a string that can be
640 used as an identifier. May not exist.
2df9ec37 641
b06df3c2
AD
642 Currently the symbols which have the "tag_is_id" flag set are
643 those that don't have an alias. Look harder for the id.
2df9ec37 644
aea10ef4
AD
645 * src/output.c (is_identifier): Move to...
646 * src/symtab.c (is_identifier): here.
647 * src/symtab.h, src/symtab.c (symbol_id_get): New.
648 * src/output.c (symbol_definitions_output): Use it to define "id"
649 and "has_id".
650 Remove the definition of "tag_is_id".
651 * data/lalr1.cc: Use the "id" and "has_id" whereever "tag" and
652 "tag_is_id" were used to produce code.
653 We still use "tag" for documentation.
654
2ea7730c
AD
6552008-11-11 Akim Demaille <demaille@gostai.com>
656
657 Locations are no longer required by lalr1.cc.
658 * data/lalr1.cc (_b4_args, b4_args): New.
659 Adjust all uses of locations to make them optional.
660 * tests/c++.at (AT_CHECK_VARIANTS): No longer use the locations.
661 (AT_CHECK_NAMESPACE): Check the use of locations.
662 * tests/calc.at (_AT_DATA_CALC_Y): Adjust to be usable with or
663 without locations with lalr1.cc.
664 Test these cases.
665 * tests/output.at: Check lalr1.cc with and without location
666 support.
667 * tests/regression.at (_AT_DATA_EXPECT2_Y, _AT_DATA_DANCER_Y):
668 Don't use locations.
669
7ca2266a
AD
6702008-11-11 Akim Demaille <demaille@gostai.com>
671
672 AT_FULL_COMPILE.
673 * tests/local.at (AT_FULL_COMPILE): New.
674 * tests/actions.at, tests/calc.at, tests/regression.at: Use it.
675
1a7a65f9
AD
6762008-11-11 Akim Demaille <demaille@gostai.com>
677
678 Support parens in calc++.
679 * doc/bison.texinfo (Calc++ Scanner, Calc++ Parser): Support parens.
680 * examples/calc++/test (run): Check the expected output.
681 Adjust callers.
682 Check parens too.
683
c944f7f2
AD
6842008-11-11 Akim Demaille <demaille@gostai.com>
685
686 Simplify lalr1.cc since %defines is mandatory.
687 * data/lalr1.cc: Remove useless calls to b4_defines_if.
688
dada3cd1
AD
6892008-11-11 Akim Demaille <demaille@gostai.com>
690
691 TODO: yyfmt.
692 * TODO (yysyntax_error): New item.
693
422c18f4
AD
6942008-11-11 Akim Demaille <demaille@gostai.com>
695
696 Prefer M4 to CPP.
697 * data/lalr1.cc: Use b4_error_verbose_if instead of #if
698 YYERROR_VERBOSE.
699
a0ffc175
AD
7002008-11-11 Akim Demaille <demaille@gostai.com>
701
702 Support i18n of the parse error messages.
703 * TODO (lalr1.cc/I18n): Remove.
704 * data/lalr1.cc (yysyntax_error_): Support the translation of the
705 error messages, as done in yacc.c.
706 Stay within the yy* pseudo namespace.
707
00a8a083
AD
7082008-11-11 Akim Demaille <demaille@gostai.com>
709
710 More TODO.
711 * TODO (single stack, yysyntax_error): New.
712
09277875
AD
7132008-11-11 Akim Demaille <demaille@gostai.com>
714
715 Make it possible to return a symbol_type from yylex.
716 * data/lalr1.cc (b4_lex_symbol_if): New.
717 (parse): When lex_symbol is defined, expected yylex to return the
718 complete lookahead.
719 * etc/bench.pl.in (generate_grammar_list): Extend to support this
720 yylex interface.
721 (bench_variant_parser): Exercise it.
722
64c1b92a
AD
7232008-11-11 Akim Demaille <demaille@gostai.com>
724
725 Remove useless bench case.
726 * etc/bench.pl.in (bench_variant_parser): VARIANT_DESTROY is
727 no longer used.
728
2722aa42
AD
7292008-11-11 Akim Demaille <demaille@gostai.com>
730
731 Improve display of directives.
732 * etc/bench.pl.in (parse_term): Don't add useless eol.
733
918eb7c5
AD
7342008-11-11 Akim Demaille <demaille@gostai.com>
735
736 Use string_cast in the bench.
737 * etc/bench.pl.in (generate_grammar_list): Define and use
738 string_cast.
739
39be9022
AD
7402008-11-11 Akim Demaille <demaille@gostai.com>
741
742 Replace yychar with a Boolean.
743 * data/lalr1.cc (parse::yychar): Replace by...
744 (parse::yyempty): this.
745
a2e3fa77
AD
7462008-11-11 Akim Demaille <demaille@gostai.com>
747
748 Factor the tables.
749 * TODO: New item.
750
aba12ad1
AD
7512008-11-11 Akim Demaille <demaille@gostai.com>
752
753 Let yytranslate handle the eof case.
754 * data/lalr1.cc (yytranslate_): Handle the EOF case.
755 Adjust callers.
756 No longer expect yychar to be equal to yyeof_, rather, test the
757 lookahead's (translated) kind.
758
27cb5b59
AD
7592008-11-11 Akim Demaille <demaille@gostai.com>
760
761 yychar cannot be empty in yyerrlab.
762 * TODO (yychar == yyempty_): New.
763 * data/lalr1.cc: Remove the handling of this case.
764 This eases forthcoming changes related to yychar and yytranslate.
765
fce629c0
AD
7662008-11-11 Akim Demaille <demaille@gostai.com>
767
768 Bench: syntactic sugar for %define/#define.
769 * etc/bench.pl.in (parse_dirs): Support %d and #d with arguments.
770 (&bench_push_parser, bench_variant_parser): Use this feature.
771 (&eat): New.
772 Use it.
773
ce671960
AD
7742008-11-11 Akim Demaille <demaille@gostai.com>
775
776 Less memory pressure on the "list" bench.
777 * etc/bench.pl.in (generate_grammar_list): Do not accumulate all
778 the values, to limit memory pressure.
779
2873fdf8
AD
7802008-11-11 Akim Demaille <demaille@gostai.com>
781
782 Introduce make_symbol.
b06df3c2
AD
783 make_symbol provides a means to construct a full symbol (kind,
784 value, location) in a single shot. It is meant to be a Symbol
785 constructor, parameterized by the symbol kind so that overloading
786 would prevent incorrect kind/value pairs. Unfortunately
787 parameterized constructors do not work well in C++ (unless the
788 parameter also appears as an argument, which is not acceptable),
789 hence the use of a function instead of a constructor.
2df9ec37 790
2873fdf8
AD
791 * data/lalr1.cc (b4_symbol_constructor_declaration_)
792 (b4_symbol_constructor_declarations)
793 (b4_symbol_constructor_specialization_)
794 (b4_symbol_constructor_specializations)
795 (b4_symbol_constructor_definition_)
796 (b4_symbol_constructor_definitions): New.
797 Use them where appropriate to generate declaration, declaration of
798 the specializations, and implementations of the templated
799 overloaded function "make_symbol".
800 (variant::variant): Always define a default ctor.
801 Also provide a copy ctor.
802 (symbol_base_type, symbol_type): New ctor overloads for value-less
803 symbols.
804 (symbol_type): Now public, so that functions such as yylex can use
805 it.
806
8be046d7
AD
8072008-11-11 Akim Demaille <demaille@gostai.com>
808
809 Inform m4 whether a tag is a valid id.
810 * src/output.c (is_identifier): New.
811 (symbol_definitions_output): Use it to define tag_is_id.
812 But maybe this should be done at m4 level?
813
de62edee
AD
8142008-11-11 Akim Demaille <demaille@gostai.com>
815
816 Test 214 was failing: it greps with a pattern containing [ ]*
817 which obviously meant to catch spaces and tabs, but contained only
818 spaces. Tabulations in sources are a nuisance, so to simplify the
819 matter, get rid of all the tabulations in the Java sources. The
820 other skeletons will be treated equally later.
821
822 * data/java.m4, data/lalr1.java: Untabify.
823 * tests/java.at: Simplify AT_CHECK_JAVA_GREP invocations:
824 tabulations are no longer generated.
825
905f0697
PB
8262008-11-11 Paolo Bonzini <bonzini@gnu.org>
827
828 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
829 * configure.ac: Adjust usage.
830 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
831 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
832 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
833
09ccae9b
DJ
8342008-11-10 Di-an Jan <dianj@freeshell.org>
835
836 Workaround Java's ``code too large'' problem for parser tables
837 in most cases, by using one function per initialization.
838 * data/java.m4 (b4_typed_parser_table, b4_integral_parser_table): New.
839 * data/lalr1.java (yypact_, yydefact_, yypgoto_, yydefgoto_,
840 yytable_, yycheck_, yystos_, yytoken_number_, yyr1_, yyr2_, yyrhs_
841 yyprhs_, yyrline_, yytranslate_table_): Use b4_integral_parser_table.
842 (yytname_): Use b4_typed_parser_table.
843 * doc/bison.texinfo (Java Bison Interface): Add note on Java's
844 ``code too large'' error.
845
1979121c
DJ
8462008-11-10 Di-an Jan <dianj@freeshell.org>
847
848 * NEWS: Document them.
de62edee 849
1979121c
DJ
850 General Java skeleton improvements.
851 * configure.ac (gt_JAVACOMP): Request target of 1.4, which allows
852 using gcj < 4.3 in the testsuite, according to comments in
853 gnulib/m4/javacomp.m4.
854 * data/java.m4 (stype, parser_class_name, lex_throws, throws,
855 location_type, position_type): Remove extraneous brackets from
856 b4_percent_define_default.
857 (b4_lex_param, b4_parse_param): Remove extraneous brackets from
858 m4_define and m4_define_default.
859 * data/lalr1.java (b4_pre_prologue): Change to b4_user_post_prologue,
860 which marks the end of user code with appropriate syncline, like all
861 the other skeletons.
862 (b4_user_post_prologue): Add. Don't silently drop.
863 (yylex): Remove.
864 (parse): Inline yylex.
865 * doc/bison.texinfo (bisonVersion, bisonSkeleton): Document.
866 (%{...%}): Fix typo of %code imports.
867 * tests/java.at (AT_JAVA_COMPILE): Add "java" keyword.
868
869 Support annotations on parser class with %define annotations.
870 * data/lalr1.java (annotations): Add to parser class modifier.
871 * doc/bison.texinfo (Java Parser Interface): Document
872 %define annotations.
873 (Java Declarations Summary): Document %define annotations.
874 * tests/java.at (Java parser class modifiers): Test annotations.
875
876 Do not generate code for %error-verbose unless requested.
877 * data/lalr1.java (errorVerbose): Rename to yyErrorVerbose.
878 Make private. Make conditional on %error-verbose.
879 (getErrorVerbose, setErrorVerbose): New.
880 (yytnamerr_): Make conditional on %error-verbose.
881 (yysyntax_error): Make some code conditional on %error-verbose.
882 * doc/bison.texinfo (Java Bison Interface): Remove the parts
883 about %error-verbose having no effect.
884 (getErrorVerbose, setErrorVerbose): Document.
885
886 Move constants for token names to Lexer interface.
887 * data/lalr1.java (Lexer): Move EOF, b4_token_enums(b4_tokens) here.
888 * data/java.m4 (b4_token_enum): Indent for move to Lexer interface.
889 (parse): Qualify EOF to Lexer.EOF.
890 * doc/bison.texinfo (Java Parser Interface): Move documentation of
891 EOF and token names to Java Lexer Interface.
892 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove Calc qualifier.
893
894 Make yyerror public.
895 * data/lalr1.java (Lexer.yyerror): Use longer parameter name.
896 (yyerror): Change to public. Add Javadoc comments. Use longer
897 parameter names. Make the body rather than the declarator
898 conditional on %locations.
899 * doc/bison.texinfo (yyerror): Document. Don't mark as protected.
900
901 Allow user to add code to the constructor with %code init.
902 * data/java.m4 (b4_init_throws): New, for %define init_throws.
903 * data/lalr1.java (YYParser.YYParser): Add b4_init_throws.
904 Add %code init to the front of the constructor body.
905 * doc/bison.texinfo (YYParser.YYParser): Document %code init
906 and %define init_throws.
907 (Java Declarations Summary): Document %code init and
908 %define init_throws.
909 * tests/java.at (Java %parse-param and %lex-param): Adjust grep.
910 (Java constructor init and init_throws): Add tests.
de62edee 911
42f832d6
AD
9122008-11-10 Akim Demaille <demaille@gostai.com>
913
914 Update TODO.
915 * TODO (-D): is implemented.
916 (associativity): Same precedence must have the same associativity.
917 For instance, how can a * b / c be parsed if * is %left and / is
918 %right?
919 (YYERRORCODE, YYFAIL, YYBACKUP): New.
920
247efe34
AD
9212008-11-10 Akim Demaille <demaille@gostai.com>
922
923 Formatting changes.
924
5d731440
AD
9252008-11-10 Akim Demaille <demaille@gostai.com>
926
927 More information about the symbols.
928 * src/output.c (type_names_output): Document all the symbols,
929 including those that don't have a type-name.
930 (symbol_definitions_output): Define "is_token" and
931 "has_type_name".
932 * data/lalr1.cc (b4_type_action_): Skip symbols that have an empty
933 type-name, now that they are defined too in b4_type_names.
934
21db118b
AD
9352008-11-10 Akim Demaille <demaille@gostai.com>
936
937 Regen.
938
6ed15cde
AD
9392008-11-10 Akim Demaille <demaille@gostai.com>
940
941 Make parser::yytranslate static.
b06df3c2
AD
942 Small speedup (1%) on the list grammar. And makes yytranslate_
943 available in non member functions.
de62edee 944
6ed15cde
AD
945 * data/lalr1.cc (yytranslate_): Does not need to be a instance
946 function.
947
30bb2edc
AD
9482008-11-10 Akim Demaille <demaille@gostai.com>
949
950 Avoid trailing spaces.
951 * data/c.m4: b4_comment(TEXT): Don't indent empty lines.
952 * data/lalr1.cc: Don't indent before rule and symbol actions, as
953 they can be empty, and anyway this incorrectly indents the first
954 action.
955
b3a28fd4
AD
9562008-11-10 Akim Demaille <demaille@gostai.com>
957
958 Comment changes.
959
914202bd
AD
9602008-11-10 Akim Demaille <demaille@gostai.com>
961
962 Use "enum" for integral constants.
963 This is just nicer to read, I observed no speedup.
de62edee 964
914202bd
AD
965 * data/lalr1.cc (yyeof_, yylast_, yynnts_, yyempty_, yyfinal_)
966 (yterror_, yyerrcode_, yyntokens_): Define as members of an enum.
967 (yyuser_token_number_max_, yyundef_token_): Move into...
968 (yytranslate_): here.
969
c17f9a4a
AD
9702008-11-10 Akim Demaille <demaille@gostai.com>
971
972 Shortcuts in bench directives.
973 * etc/bench.pl.in (parse_dirs): New.
974 Use it.
975 (bench_variant_parser, bench_fusion_parser): Use %s and %d.
976 Create the benches in "benches/".
977
b9855ea5
AD
9782008-11-10 Akim Demaille <demaille@gostai.com>
979
980 Formatting changes.
981 * data/lalr1.cc: here.
982
6e097787
AD
9832008-11-10 Akim Demaille <demaille@gostai.com>
984
985 Adjust verbose message to using emacs.
986 * etc/bench.pl.in: Inform compilation-mode when we change the
987 directory.
988 (generate_grammar_list): Recognize %define "variant" in addition
989 to %define variant.
990
4c3cc7da
AD
9912008-11-10 Akim Demaille <demaille@gostai.com>
992
993 Classify symbols by type-name.
994 * src/uniqstr.h (UNIQSTR_CMP): New.
995 * src/output.c (symbol_type_name_cmp, symbols_by_type_name)
996 (type_names_output): New.
997 (muscles_output): Use it.
998 * data/lalr1.cc (b4_symbol_action_): Remove.
999 (b4_symbol_case_, b4_type_action_): New.
1000 Adjust uses of b4_symbol_action_ to use b4_type_action_.
1001
d69c9694
AD
10022008-11-10 Akim Demaille <demaille@gostai.com>
1003
1004 Change the handling of the symbols in the skeletons.
1005 Before we were using tables which lines were the symbols and which
1006 columns were things like number, tag, type-name etc. It is was
1007 difficult to extend: each time a column was added, all the numbers had
1008 to be updated (you asked for colon $2, not for "tag"). Also, it was
1009 hard to filter these tables when only a subset of the symbols (say the
1010 tokens, or the nterms, or the tokens that have and external number
1011 *and* a type-name) was of interest.
de62edee 1012
d69c9694
AD
1013 Now instead of monolithic tables, we define one macro per cell. For
1014 instance "b4_symbol(0, tag)" is a macro name which contents is
1015 self-decriptive. The macro "b4_symbol" provides easier access to
1016 these cells.
de62edee 1017
d69c9694
AD
1018 * src/output.c (type_names_output): Remove.
1019 (symbol_numbers_output, symbol_definitions_output): New.
1020 (muscles_output): Call them.
1021 (prepare_symbols): Define b4_symbols_number.
1022
5263bea9
AD
10232008-11-10 Akim Demaille <demaille@gostai.com>
1024
1025 --trace=muscles
1026 * src/getargs.h, src/getargs.c (trace_muscle): New.
1027 (trace_types, trace_args): Support it.
1028 * src/output.c (output_skeleton): Use it.
1029
4175f6bb
AD
10302008-11-10 Akim Demaille <demaille@gostai.com>
1031
1032 muscles_output.
1033 * src/output.c (muscles_output): New, extracted from...
1034 (output_skeleton): here.
1035 Adjust.
1036
1de69d6a
AD
10372008-11-10 Akim Demaille <demaille@gostai.com>
1038
1039 Formatting changes.
1040
36db78a7
AD
10412008-11-10 Akim Demaille <demaille@gostai.com>
1042
1043 Update the variant example.
1044 * examples/variant.yy: Formatting changes.
1045 One stage build.
1046
e5eb92e7
AD
10472008-11-10 Akim Demaille <demaille@gostai.com>
1048
1049 Support constructor with an argument.
1050 This improves the "list" bench by 2%.
de62edee 1051
e5eb92e7
AD
1052 * data/lalr1.cc (variant::build): Add an overloaded version with
1053 an argument.
1054 * tests/c++.at (AT_CHECK_VARIANT): Check it.
1055
76307410
AD
10562008-11-10 Akim Demaille <demaille@gostai.com>
1057
1058 Test variants.
1059 * tests/c++.at (AT_CHECK_VARIANTS): New.
1060 Use it with and without %define assert.
1061
d78f0ac9
AD
10622008-11-10 Akim Demaille <demaille@gostai.com>
1063
1064 Add %precedence support.
1065 Unfortunately it is not possible to reuse the %prec directive. This
1066 is because to please POSIX, we do not require to end the rules with a
1067 semicolon. As a result,
de62edee 1068
d78f0ac9 1069 foo: bar %prec baz
de62edee 1070
d78f0ac9
AD
1071 is ambiguous: either a rule which precedence is that of baz, or a rule,
1072 and then a declaration of the precedence of the token baz.
de62edee 1073
d78f0ac9
AD
1074 * doc/bison.texinfo: Document %precedence.
1075 (Precedence Only): New.
1076 * src/assoc.h, src/assoc.c (precedence_assoc): New.
1077 * src/conflicts.c (resolve_sr_conflict): Support it.
1078 * src/scan-gram.l, src/parse-gram.y (%precedence): New token.
1079 Parse it.
1080 * tests/calc.at: Use %precedence for NEG.
1081 * tests/conflicts.at (%precedence does not suffice)
1082 (%precedence suffices): New tests.
1083
c85be41a
AD
10842008-11-09 Akim Demaille <demaille@gostai.com>
1085
1086 Make benches in a sub dirs.
1087 * etc/bench.pl.in ($dir): New.
1088 Use it.
1089 Check the use of constructors with an argument.
1090 (bench_variant_parser): Fix.
1091
db65ca1f
AD
10922008-11-09 Akim Demaille <demaille@gostai.com>
1093
1094 fix eof condition
1095
9b0efa5b
AD
10962008-11-09 Akim Demaille <demaille@gostai.com>
1097
1098 Fix --help.
1099
432ac57a
AD
11002008-11-09 Akim Demaille <demaille@gostai.com>
1101
1102 Require the generation of parse-gram.output.
1103 * src/Makefile.am (YACC): Pass --report=all.
1104
deef2a0a
AD
11052008-11-09 Akim Demaille <demaille@gostai.com>
1106
1107 Formatting changes.
1108
df72984a
AD
11092008-11-09 Akim Demaille <demaille@gostai.com>
1110
1111 Update TODO.
1112 * TODO: Remove obsolete items.
1113 Update others.
1114
f10e19fd
AD
11152008-11-09 Akim Demaille <demaille@gostai.com>
1116
1117 Enhance bench.pl.
1118 * etc/bench.pl.in (parse, parse_expr, parse_term, parse_fact)
1119 (@token, $grammar, $bench): New.
1120 (generate_grammar_variant): Rename as...
1121 (generate_grammar_list): this.
1122 (generate_grammar): Adjust.
1123 (bench_grammar): Rename as...
1124 (bench): this.
1125 Use it in the various bench-marking routines.
1126 (-b, -g): New options.
1127
5de9c593
AD
11282008-11-09 Akim Demaille <demaille@gostai.com>
1129
1130 Use a static hierarchy for symbols in the C++ parser.
1131 * data/lalr1.cc (symbol_base_type, symbol_type)
1132 (stack_symbol_type): Make it a static hierarchy.
1133 Adjust dependencies.
1134
757f8f98
AD
11352008-11-09 Akim Demaille <demaille@gostai.com>
1136
1137 bench.pl -d, --directive.
1138 * etc/bench.pl.in (@directive): New.
1139 (&bench_grammar): Use it.
1140 (&bench_list_grammar): New, to provide access to the "variant"
1141 grammar.
1142 Use it.
1143 (getopts): Support -d, --directive.
1144
d3be4f6d
AD
11452008-11-09 Akim Demaille <demaille@gostai.com>
1146
1147 Use inline for small operations.
1148 * data/lalr1.cc (symbol_base_type, symbol_type)
1149 (stack_symbol_type): Declare constructor and other operations as
1150 inline.
1151 (yy_destroy_): Inline.
1152
1f7d007b
AD
11532008-11-09 Akim Demaille <demaille@gostai.com>
1154
1155 Introduce a hierarchy for symbols.
1156 * data/lalr1.cc (symbol_base_type, symbol_type): New.
1157 (data_type): Rename as...
1158 (stack_symbol_type): this.
1159 Derive from symbol_base_type.
1160 (yy_symbol_value_print_): Merge into...
1161 (yy_symbol_print_): this.
1162 Rename as...
1163 (yy_print_): this.
1164 (yydestruct_): Rename as...
1165 (yy_destroy_): this.
1166 (b4_symbols_actions, YY_SYMBOL_PRINT): Adjust.
1167 (parser::parse): yyla is now of symbol_type.
1168 Use its type member instead of yytoken.
1169
bc0b0477
AD
11702008-11-09 Akim Demaille <demaille@gostai.com>
1171
1172 Rename data_type and stack_symbol_type.
1173 * data/lalr1.cc (data_type): Rename as...
1174 (stack_symbol_type): this.
1175
57295d14
AD
11762008-11-09 Akim Demaille <demaille@gostai.com>
1177
1178 Handle semantic value and location together.
1179 * data/lalr1.cc (b4_symbol_actions): Bounce $$ and @$ to
1180 yydata.value and yydata.location.
1181 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_)
1182 (YY_SYMBOL_PRINT): Now take semantic value and location as a
1183 single arg.
1184 Adjust all callers.
1185 (yydestruct_): New overload for a stack symbol.
1186
e9b0834e
AD
11872008-11-09 Akim Demaille <demaille@gostai.com>
1188
1189 Push a complete symbol, not connected parts.
1190 * data/lalr1.cc (yypush_): Take a data_type&, not disconnected
1191 state, value and location.
1192 Adjust callers.
1193
6082531a
AD
11942008-11-09 Akim Demaille <demaille@gostai.com>
1195
1196 Agregate yylval and yylloc.
1197 * data/lalr1.cc (parser::yylval, parser::yylloc): Replace by...
1198 (parser::yyla): this.
1199
33c195cc
AD
12002008-11-09 Akim Demaille <demaille@gostai.com>
1201
1202 Rely on the state stack to display reduction traces.
b06df3c2
AD
1203 To display rhs symbols before a reduction, we used information
1204 about the rule reduced, which required the tables yyrhs and
1205 yyprhs. Now use rely only on the state stack to get the same
1206 information.
de62edee 1207
33c195cc
AD
1208 * data/lalr1.cc (b4_rhs_data, b4_rhs_state): New.
1209 Use them.
1210 (parser::yyrhs_, parser::yyprhs_): Remove.
1211 (parser::yy_reduce_print_): Use the state stack.
1212
e1f93869
AD
12132008-11-09 Akim Demaille <demaille@gostai.com>
1214
1215 Fuse yyval and yyloc into yylhs.
1216 * data/lalr1.cc (b4_lhs_value, b4_lhs_location): Adjust to using
1217 yylhs.
1218 (parse): Replace yyval and yyloc with yylhs.value and
1219 yylhs.location.
1220 After a user action, compute yylhs.state earlier.
1221 (yyerrlab1): Do not play tricks with yylhs.location, rather, use a
1222 fresh error_token.
1223
2935744b
DJ
12242008-11-09 Di-an Jan <dianj@freeshell.org>
1225
1226 Remove unused variable.
1227 * src/output.c (type_names_output): Remove unused variable sep.
1228
bbf9ca37
PB
12292008-11-09 Paolo Bonzini <bonzini@gnu.org>
1230
1231 Change tests/output.at quoting.
1232 * tests/output.at (AT_CHECK_OUTPUT): Use conventional m4 quoting when
1233 expanding arguments.
1234
d9a9b96b
JD
12352008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
1236
1237 Don't add a semicolon to actions for %skeleton or %language.
1238 It breaks Java test cases as reported by Akim Demaille.
1239 * src/scan-code.l: Implement.
1240
51365192
JD
12412008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
1242
1243 Clean up %skeleton and %language priority implementation.
1244 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
1245 remove static qualifier because others will soon need to see it.
1246 (language_prio): Likewise.
1247 (getargs): Use command_line_prio rather than 0.
1248 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
1249 enum fields.
1250 (skeleton_prio): Extern it.
1251 (language_prio): Extern it.
1252 * src/parse-gram.y: Use grammar_prio rather than 1.
1253
9380cfd0
AD
12542008-11-07 Akim Demaille <demaille@gostai.com>
1255
1256 Moving push traces into yypush_.
1257 * data/lalr1.cc (yypush_): Now takes a optional trace message.
1258 Adjust all uses.
1259
8901f32e
AD
12602008-11-07 Akim Demaille <demaille@gostai.com>
1261
1262 The single-stack C++ parser is now the standard one.
1263 * data/lalr1.cc: Rename as...
1264 * data/lalr1-split.cc: this.
1265 * data/lalr1-fusion.cc: Rename as...
1266 * data/lalr1.cc: this.
1267 * etc/bench.pl.in: Adjust.
1268
8cdabf02
AD
12692008-11-07 Akim Demaille <demaille@gostai.com>
1270
1271 Avoid empty-if warnings.
1272 Reported by Quentin Hocquet.
de62edee 1273
8cdabf02
AD
1274 * data/lalr1-fusion.cc (YY_SYMBOL_PRINT, YY_REDUCE_PRINT)
1275 (YY_STACK_PRINT): Provide some contents even when !YYDEBUG.
1276
5a893c2b
AD
12772008-11-07 Akim Demaille <demaille@gostai.com>
1278
1279 Pass command line location to skeleton_arg and language_argmatch.
1280 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
1281 The location argument is now mandatory.
1282 Adjust all dependencies.
1283 (getargs): Use command_line_location.
1284
58697c6d
AD
12852008-11-07 Akim Demaille <demaille@gostai.com>
1286
1287 -D, --define.
1288 * src/getargs.c (usage): Document -D.
1289 Fix help string for --locations.
1290 (command_line_location): New.
1291 (short_options, long_options, getargs): Support -D, --define.
1292 (getargs): Move -d support at the right place.
1293 * doc/bison.texinfo (Bison Options): Update.
1294 * tests/input.at (%define, --define): New.
1295
9fe5a457
AD
12962008-11-07 Akim Demaille <demaille@gostai.com>
1297
1298 Initialize the muscle table before parsing the command line.
1299 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
1300 (getargs): Define file_name.
1301 * src/main.c (main): Initialize muscle_tab before calling
1302 getargs.
1303 * src/muscle_tab.c (muscle_init): No longer define file_name, as
1304 its value is not available yet.
1305
56c5eca9
AD
13062008-11-07 Akim Demaille <demaille@gostai.com>
1307
1308 Locations without columns for command line arguments.
1309 * src/location.c (location_print): Don't display negative columns.
1310 * src/location.h: Document this.
1311
9b9e0a7d
AD
13122008-11-07 Akim Demaille <demaille@gostai.com>
1313
1314 Fix --help.
1315 * src/getargs.c (usage): Fix help string for -W.
1316
74eae918
AD
13172008-11-07 Akim Demaille <demaille@gostai.com>
1318
1319 Handle more general types of option arguments.
1320 * build-aux/cross-options.pl: The argument ends at the first
1321 space, not the first non-symbol character.
1322 Use @var for each word appearing the argument description.
1323
a3d4c6fb
AD
13242008-11-07 Akim Demaille <demaille@gostai.com>
1325
1326 Destroy the variants that remain on the stack in case of error.
1327 * data/lalr1-fusion.cc (yydestruct_): Invoke the variant's
1328 destructor.
1329 Display the value only if yymsg is nonnull.
1330 (yyreduce): Invoke yydestruct_ when popping lhs symbols.
1331
2d32fc9f
AD
13322008-11-07 Akim Demaille <demaille@gostai.com>
1333
1334 Add "%define assert" to variants.
1335 This is used to help the user catch cases where some value gets
1336 ovewritten by a new one. This should not happen, as this will
1337 probably leak.
de62edee 1338
2d32fc9f
AD
1339 Unfortunately this uncovered a bug in the C++ parser itself: the
1340 lookahead value was not destroyed between two calls to yylex. For
1341 instance if the previous lookahead was a std::string, and then an int,
1342 then the value of the std::string was correctly taken (i.e., the
1343 lookahead was now an empty string), but std::string structure itself
1344 was not reclaimed.
de62edee 1345
2d32fc9f
AD
1346 This is now done in variant::build(other&) (which is used to take the
1347 value of the lookahead): other is not only stolen from its value, it
1348 is also destroyed. This incurs a new performance penalty of a few
1349 percent, and union becomes faster again.
de62edee 1350
2d32fc9f
AD
1351 * data/lalr1-fusion.cc (variant::build(other&)): Destroy other.
1352 (b4_variant_if): New.
1353 (variant::built): New.
1354 Use it whereever the status of the variant changes.
1355 * etc/bench.pl.in: Check the penalty of %define assert.
1356
f6038cb8
AD
13572008-11-07 Akim Demaille <demaille@gostai.com>
1358
1359 Use "%define variant" in bench.pl.
1360 * etc/bench.pl.in: No longer use the pseudo directive %variants,
1361 just use %define variants.
1362
ccde1f98
AD
13632008-11-07 Akim Demaille <demaille@gostai.com>
1364
1365 Regen.
1366 * src/parse-gram.h, src/parse-gram.c: Regen.
1367
58bd33b7
JD
13682008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
1369
1370 Fix user actions without a trailing semicolon.
1371 Reported by Sergei Steshenko at
1372 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
1373 * THANKS (Sergei Steshenko): Add.
1374 * src/scan-code.l (SC_RULE_ACTION): Fix it.
1375 * tests/regression.at (Fix user actions without a trailing semicolon):
1376 New test case.
1377
639867b5
AD
13782008-11-04 Akim Demaille <demaille@gostai.com>
1379
1380 Use b4_copyright_years.
1381 * data/yacc.c (b4_copyright_years): New.
1382 Fix its value according to the comments in the file.
1383 Use it and undefine it.
1384
3c262606
AD
13852008-11-04 Akim Demaille <demaille@gostai.com>
1386
1387 Formatting changes.
1388 * data/lalr1-fusion.cc, src/parse-gram.y: here.
1389
a2b93d52
AD
13902008-11-04 Akim Demaille <demaille@gostai.com>
1391
1392 Formatting changes.
1393 * data/lalr1-fusion.cc: here.
1394
3a2803df
AD
13952008-11-04 Akim Demaille <demaille@gostai.com>
1396
1397 Use strict on bench.pl.
1398 * etc/bench.pl.in (&run, &generate_grammar): New.
1399 Rename the grammar generating functions for consistency.
1400 Change the interface so that the list of benches to run is passed
1401 as (optionless) arguments.
1402 (&compile): Use &run.
1403
a0d4650a
AD
14042008-11-04 Akim Demaille <demaille@gostai.com>
1405
1406 Remove spurious initial empty lines.
1407 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
1408 * data/yacc.c: End the @output lines with an @.
1409
cac9e09b
AD
14102008-11-04 Akim Demaille <demaille@gostai.com>
1411
1412 Improve the display of sizes.
1413 * etc/bench.p.in: Higher precision.
1414 Sort by decreasing size.
1415
4af4348a
AD
14162008-11-04 Akim Demaille <demaille@gostai.com>
1417
1418 Don't memcpy C++ structures.
1419 * data/lalr1-fusion.cc (b4_symbol_variant): Adjust additional
1420 arguments.
1421 (variant::build): New overload for
1422 copy-construction-that-destroys.
1423 (variant::swap): New.
1424 (parser::yypush_): Use it in variant mode.
1425
ef05c4d6
AD
14262008-11-04 Akim Demaille <demaille@gostai.com>
1427
1428 Better defaults for bench.pl.
1429 * etc/bench.pl.in ($verbose, $cflags, $iterations): Change the
1430 default values.
1431 Adjust &verbose uses.
1432 (-q, --quiet): New.
1433
9718cfa9
AD
14342008-11-04 Akim Demaille <demaille@gostai.com>
1435
1436 Make variant.yy more complex.
1437 std::list cannot be copied via memcpy, they are more demanding than
1438 std::string. Use one std::list to strengthen the test.
de62edee 1439
9718cfa9
AD
1440 * examples/variant.yy: Use lalr1-fusion.cc, not lalr1.cc.
1441 Adjust.
1442 Create a list of strings, instead of a single large string.
1443
a6df593d
AD
14442008-11-04 Akim Demaille <demaille@gostai.com>
1445
1446 bench.pl --bench.
1447 * etc/bench.pl.in (--bench, $bench): New.
1448
006a0303
AD
14492008-11-04 Akim Demaille <demaille@gostai.com>
1450
1451 Sort methods.
1452 * data/lalr1-fusion.cc (destroy): Use as() in its definition.
1453 Define it after as().
1454
faef3466
AD
14552008-11-04 Akim Demaille <demaille@gostai.com>
1456
1457 Useless parens.
1458 * data/lalr1-fusion.cc (b4_rhs_location): Remove useless parens.
1459
2141aded
AD
14602008-11-04 Akim Demaille <demaille@gostai.com>
1461
1462 Issue missing synclines after user actions.
1463 * data/c.m4 (b4_case): Issue synclines on the output file.
1464
e426d17b
AD
14652008-11-04 Akim Demaille <demaille@gostai.com>
1466
1467 Remove trailing empty line.
1468 * data/lalr1-fusion.cc: Don't add an empty line after the user's
1469 epilogue.
1470
a9ce3f54
AD
14712008-11-04 Akim Demaille <demaille@gostai.com>
1472
1473 Fix output of copyright years.
1474 * data/bison.m4 (b4_copyright): Fix the indentation of the
1475 copyright year paragraph.
1476 Use b4_copyright_years when no years are given.
1477 * data/lalr1.cc, data/lalr1-fusion.cc, data/location.cc
1478 (b4_copyright_years): New.
1479 Use it.
1480
59c544c2
AD
14812008-11-04 Akim Demaille <demaille@gostai.com>
1482
1483 Avoid the spurious initial empty line.
1484 * data/lalr1-fusion.cc, data/location.cc: Put a trailing "@" at
1485 the end of @output request to suppress the empty line that
1486 results.
1487
96b15448
AD
14882008-11-04 Akim Demaille <demaille@gostai.com>
1489
1490 Remove parser::rhs_number_type.
1491 * data/lalr1-fusion.cc (rhs_number_type): No longer define it.
1492 (yyrhs_): Use b4_table_define.
1493
f0633174
AD
14942008-11-04 Akim Demaille <demaille@gostai.com>
1495
1496 Fix iteration type.
1497 * data/lalr1-fusion.cc: Use an int to iterate up to an int.
1498
417b8004
AD
14992008-11-04 Akim Demaille <demaille@gostai.com>
1500
1501 Factor the declaration of the integer tables.
1502 * data/lalr1-fusion.cc (b4_table_define): New.
1503 Use it.
1504
1a5246c6
AD
15052008-11-03 Akim Demaille <demaille@gostai.com>
1506
1507 Fix indentation of tables in lalr1.cc
1508 * data/lalr1-fusion.cc: Fix the indentation.
1509
f8a95c9c
AD
15102008-11-03 Akim Demaille <demaille@gostai.com>
1511
1512 Destroy the lhs symbols after reduction.
1513 * data/lalr1-fusion.cc (parse): After the user action, when in
1514 variant mode, destroy the lhs symbols.
1515
d7f4d823
AD
15162008-11-03 Akim Demaille <demaille@gostai.com>
1517
1518 Simplify yysyntax_error_ use.
1519 * data/lalr1-fusion.cc (yysyntax_error_): Always pass it the token
1520 type, but make it unnamed in the declaration when it is not used.
1521
8b9c89fb
AD
15222008-11-03 Akim Demaille <demaille@gostai.com>
1523
1524 Let yy::variant::build return an lvalue.
1525 * data/lalr1-fusion.cc (variant::build): Return a reference to the
1526 object.
1527
83243c24
AD
15282008-11-03 Akim Demaille <demaille@gostai.com>
1529
1530 Define yy::variant only when needed.
1531 * data/lalr1-fusion.cc (yy::variant): Define only if variants are
1532 used.
1533
429b4848
AD
15342008-11-03 Akim Demaille <demaille@gostai.com>
1535
1536 Bench the three-stack lalr1.cc.
1537 * etc/bench.pl.in: Bench the three-stack lalr1.cc vs. the
1538 one-stack one.
1539
414c76a4
AD
15402008-11-03 Akim Demaille <demaille@gostai.com>
1541
1542 Fail on parse error in calc++.
1543 * doc/bison.texinfo (calc++.cc): Propagate failures to the exit
1544 status.
1545 * examples/calc++/test ($me, $number, $exit, run): New.
1546 Use them to propagate errors to the exit status.
1547
8a5783fd
AD
15482008-11-03 Akim Demaille <demaille@gostai.com>
1549
1550 Don't specify the skeleton twice in the example.
1551 * examples/calc++/Makefile.am: Don't pass -S to Bison, the grammar
1552 file does what is needed.
1553
0cc5bead
AD
15542008-11-03 Akim Demaille <demaille@gostai.com>
1555
1556 bench: Improve output.
1557 * etc/bench.pl.in (bench_grammar): Tune the printf format.
1558
5b421a4e
AD
15592008-11-03 Akim Demaille <demaille@gostai.com>
1560
1561 bench: check impact of %debug on variants.
1562 * etc/bench.pl.in (variant_grammar): Fix the computation of
1563 $variant.
1564 Generate a grammar file that can work with or without %debug.
1565 Do use the @directive.
1566 (bench_variant_parser): Check impact of %debug.
1567 (@directives): Rename all the occurrences to...
1568 (@directive): this, for consistency.
1569
d11ee647
AD
15702008-11-03 Akim Demaille <demaille@gostai.com>
1571
1572 bench: report the size too.
1573 * etc/bench.pl.in ($iterations): Defaults to -3.
1574 (&bench_grammar): Require hireswallclock.
1575 Compute and display the size of the result.
1576 More comments.
1577
e1b74b92
AD
15782008-11-03 Akim Demaille <demaille@gostai.com>
1579
1580 bench: More use of the verbosity level.
1581 * etc/bench.pl.in ($verbose, &verbose): New.
1582 Use them.
1583 More POD documentation.
1584
7e5f9c54
AD
15852008-11-03 Akim Demaille <demaille@gostai.com>
1586
1587 bench.pl: a command line interface
1588 * etc/bench.pl.in: More doc.
1589 Some fixes in the documentation.
1590 ($cflags, $iterations, &help, &getopt): New.
1591 Use them.
1592 (&variant_grammar): Let the number of stages be 10 times what is
1593 specified.
1594
7109a18d
AD
15952008-11-03 Akim Demaille <demaille@gostai.com>
1596
1597 Bench the use of Boost.Variants.
1598 * etc/bench.pl.in ($cxx, &variant_grammar, &bench_variant_parser):
1599 New.
1600 (&compile): Be ready to compile C++ parsers.
1601 (&bench_push_parser): Move debug information to the outermost
1602 level.
1603 * THANKS: Add Michiel De Wilde.
1604
922730fe
AD
16052008-11-03 Akim Demaille <demaille@gostai.com>
1606
1607 bench.pl: Pass directives as a list instead of as a string.
1608 * etc/bench.pl.in (&directives): New.
1609 (&triangular_grammar, &calc_grammar): Use it to format the Bison
1610 directives.
1611 (&triangular_grammar): Do use the directives (were ignored).
1612 (&bench_grammar, &bench_push_parser): Adjust to pass lists of
1613 directives.
1614
7484f1d4
AD
16152008-11-03 Akim Demaille <demaille@gostai.com>
1616
1617 Improve genericity of bench.pl.
1618 * etc/bench.pl.in (&bench_grammar): Take the set of benches as
1619 argument.
1620 (&bench_push_parser): New.
1621 Call it.
1622
15129f25
AD
16232008-11-03 Akim Demaille <demaille@gostai.com>
1624
1625 Add documentation to bench.pl.
1626 * etc/bench.pl.in: Comment changes.
1627
0e0ed236
AD
16282008-11-03 Akim Demaille <demaille@gostai.com>
1629
1630 Fuse the three stacks into a single one.
de62edee 1631
b06df3c2
AD
1632 In order to make it easy to perform benchmarks to ensure that
1633 there are no performance loss, lalr1.cc is forked into
1634 lalr1-fusion.cc. Eventually, lalr1-fusion.cc will replace
1635 lalr1.cc.
1636
1637 Meanwhile, to make sure that lalr1-fusion.cc is correctly
1638 exercized by the test suite, the user must install a symbolic link
1639 from lalr1.cc to it.
de62edee 1640
b06df3c2
AD
1641 Instead of having three stacks (state, value, location), use a
1642 stack of triples. This considerably simplifies the code (and it
1643 will be easier not to require locations as currently does the C++
1644 parser), and also gives a 10% speedup according to
1645 etc/bench (probably mainly since memory allocation is done once
1646 instead of three times).
de62edee 1647
0e0ed236
AD
1648 Another motivation is to make it easier to destruct properly
1649 semantic values: now that they are bound to their state (hence
1650 symbol type) it will be easier to call the appropriate destructor.
de62edee 1651
0e0ed236 1652 These changes should probably benefit the C parser too.
de62edee 1653
b06df3c2
AD
1654 * data/lalr1.cc: Copy as...
1655 * data/lalr1-fusion.cc: this new file.
0e0ed236
AD
1656 (b4_rhs_value, b4_rhs_location): New definitions overriding those
1657 from c++.m4.
1658 (state_stack_type, semantic_stack_type, location_stack_type)
1659 (yystate_stack_, yysemantic_stack_, yylocation_stack_): Remove.
1660 (data_type, stack_type, yystack_): New.
1661 (YYLLOC_DEFAULT, yypush_): Adjust.
1662 (yyerror_range): Now based on data_type, not location_type.
1663
7dedf26e
AD
16642008-11-03 Akim Demaille <demaille@gostai.com>
1665
1666 Push the state, value, and location at the same time.
1667 This is needed to prepare a forthcoming patch that fuses the three
1668 stacks into one.
de62edee 1669
7dedf26e
AD
1670 * data/lalr1.cc (parser::yypush_): New.
1671 (parser::yynewstate): Change the semantics: instead of arriving to
1672 this label when value and location have been pushed, but yystate
1673 is to be pushed on the state stack, now the three of them must
1674 have been pushed before. yystate still must be the new state.
1675 This allows to use yypush_ everywhere instead of individual
1676 handling of the stacks.
1677
c4585f1e
AD
16782008-11-03 Akim Demaille <demaille@gostai.com>
1679
1680 Prefer references to pointers.
1681 * data/lalr1.cc (b4_symbol_actions): New, overrides the default C
1682 definition to use references instead of pointers.
1683 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_):
1684 Take the value and location as references.
1685 Adjust callers.
1686
56017c17
AD
16872008-11-03 Akim Demaille <demaille@gostai.com>
1688
1689 stack::size instead of stack::height.
1690 * data/lalr1.cc (stack::height): Rename as...
1691 (stack::size): this.
1692 Fix the output type.
1693 Comment changes.
1694
5ab8c47b
AD
16952008-11-03 Akim Demaille <demaille@gostai.com>
1696
1697 Use variants to support objects as semantic values.
b06df3c2
AD
1698 This patch was inspired by work by Michiel De Wilde. But he used
1699 Boost variants which (i) requires Boost on the user side, (ii) is
1700 slow, and (iii) has useless overhead (the parser knows the type of
1701 the semantic value there is no reason to duplicate this
1702 information as Boost.Variants do).
1703
1704 This implementation reserves a buffer large enough to store the
1705 largest objects. yy::variant implements this buffer. It was
1706 implemented with Quentin Hocquet.
de62edee 1707
5ab8c47b
AD
1708 * src/output.c (type_names_output): New.
1709 (output_skeleton): Invoke it.
1710 * data/c++.m4 (b4_variant_if): New.
1711 (b4_symbol_value): If needed, provide a definition for variants.
1712 * data/lalr1.cc (b4_symbol_value, b4_symbol_action_)
1713 (b4_symbol_variant, _b4_char_sizeof_counter, _b4_char_sizeof_dummy)
1714 (b4_char_sizeof, yy::variant): New.
1715 (parser::parse): If variants are requested, define
1716 parser::union_type, parser::variant, change the definition of
1717 semantic_type, construct $$ before running the user action instead
1718 of performing a default $$ = $1.
1719 * examples/variant.yy: New.
1720 Based on an example by Michiel De Wilde.
1721
1fa5d8bb
AD
17222008-11-03 Akim Demaille <demaille@gostai.com>
1723
1724 Parameterize the extraction of semantic values.
1725 To make future changes easier, no longer rely on ".TYPE" being the
1726 way to get a semantic value.
de62edee 1727
1fa5d8bb
AD
1728 * data/c.m4 (b4_symbol_value): New.
1729 Use it.
1730 * data/c++.m4, data/yacc.c: Use it.
1731 * data/glr.c: Use b4_symbol_value.
1732 (b4_rhs_data): New.
1733 Use it.
1734
91ba8a55
AD
17352008-11-03 Akim Demaille <demaille@gostai.com>
1736
1737 Prepare easier M4 changes.
1738 * data/lalr1.cc: Use escaped [] instead of literals to prepare
1739 future changes.
1740
c9ba9e59
JD
17412008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1742
1743 Initiate further development.
1744 * NEWS: Create an empty section for new entries.
1745 * gnulib: Update submodule to HEAD.
1746
bfb40910
JD
17472008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1748
1749 * NEWS: Version 2.4.
1750
241fda7a
JD
17512008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1752
1753 Prepare for next release.
1754 * NEWS: Briefly mention changes since 2.3b.
1755 * README: Say GNU m4 1.4.6, which we've been requiring in release
1756 announcements already, not 1.4.3, which breaks the build.
1757
ed4d67dc
JD
17582008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1759
1760 Say %language is experimental.
1761 We're thinking of extending it's effect on output file naming. See the
1762 thread at
1763 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
1764 * NEWS: Say it's experimental.
1765 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
1766 recommend it over %skeleton for now.
1767 (Bison Options): Likewise.
1768 (C++ Bison Interface): Use %skeleton not %language.
1769 (Calc++ Parser): Use %skeleton not %language.
1770 * src/getargs.c (usage): Say it's experimental.
1771
e254a580
DJ
17722008-11-01 Di-an Jan <dianj@freeshell.org>
1773 Paolo Bonzini <bonzini@gnu.org>
1774
1775 Support all Java parser class modifiers.
1776 * data/java.m4 (b4_percent_define_get3): New.
1777 (b4_final_if, b4_strictfp_if): New.
1778 * data/lalr1.java (final, strictfp, extends, implements): Support.
1779 * doc/bison.texinfo (final, strictfp, extends, implements): Add
1780 documentation.
1781 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
1782 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
1783 (AT_CHECK_JAVA_GREP): New.
1784 (Java parser class modifiers): New test.
1785 (Java parser class extends and implements): New test.
1786
1787 Model exception propagation better with throws and lex_throws.
1788 * data/java.m4 (b4_list2): New.
1789 (throws): Change default.
1790 * data/lalr1.java (yyaction): Add throws.
1791 (parse): Add lex_throws in addition to throws.
1792 * doc/bison.texinfo (throws, lex_throws): Add documentation.
1793 * tests/java.at (Java throws specifications): New test.
1794
1795 Improve documentation for Java parsers.
1796 * doc/bison.texinfo (Java Parsers): Add subsections.
1797 Don't quote first argument of %define.
1798 (Java Bison Interface): Document output files. Move documentation
1799 of parser class and merge into Java Parser Interface. Document
1800 features that error out. Document directives with no effect.
1801 Move note about Javadoc higher.
1802 (Java Semantic Values): Explicitly mention stype.
1803 Document that generic types cannot be used.
1804 (Java Location Values): Use @deftypeivar. Document constructors.
1805 Correct return value for toString.
1806 (Java Parser Interface): List undocumented constants/fields.
1807 Move documentation of fields added by %parse-param closer to list
1808 of members. Document that token names are added as fields.
1809 Document constructors accurately. Remove error method.
1810 (Java Scanner Interface): Move note on %pure-parser to Java Bison
1811 Interface. Describe %code lexer and yylex accutately.
1812 Remove documentation that does not match the code.
1813 (Java Action Features): New.
1814 (Java Differences): Add reference. Add item on semantic values.
1815 Add note about @{ ... @}. Clarify %% epilogue placement.
1816 (Java Declarations Summary): New.
1817
1818 Fix Java skeleton.
1819 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
1820 (b4_remove_comma): Quote test argument.
1821 (b4_identification): Remove "bison" field.
1822 * tests/java.at (Java parser class and package names): New test.
1823 (Java %parse-param and %lex-param): New test.
1824 (Java stype, position_class and location_class): New test.
1825
f259e4e6
PB
18262008-10-31 Di-an Jan <dianj@freeshell.org>
1827
1828 * data/lalr1.jave: Update copyright years.
1829 (YYParser): Correct name of "generated from" file in Javadoc:
1830 use b4_file_name instead of @ofile@.
1831 (Location constructor): Correct Javadoc parameter name.
1832 (yylloc): Add missing opening m4 quote after b4_location_if.
1833 This removes a stray [ in the Javadoc of Lexer.getStartPos.
1834 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
1835 (YYParser constructor): Correct Javadoc parameter name.
1836
cae5057f
JD
18372008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
1838
1839 Always put auxiliary code files in the same dir as other output files.
1840 * src/files.c (compute_file_name_parts): When the user specifies
1841 --output but not --file-prefix, extract the directory prefix from the
1842 file prefix not from the grammar file name. This affects the location
1843 of files like location.hh generated by the C++ skeleton. The includes
1844 in the other output files require this fix.
1845 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
1846 for expected output files.
1847 (Output files): Add a test for the above.
1848
4af432ba
JD
18492008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
1850
1851 * gnulib: Update submodule to HEAD.
1852
e26d4e43
JD
18532008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
1854
1855 Update copyright year.
1856 * src/files.c: Here.
1857
c0ee9e21
DJ
18582008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
1859
1860 Don't overwrite the input file.
1861 * src/files.c (output_file_name_check): Fatal error if using input file
1862 for output.
1863 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
1864 argument.
1865 (Conflicting output files): Add test.
1866
482dc52f
AD
18672008-10-28 Akim Demaille <demaille@gostai.com>
1868
1869 Space changes.
1870 * data/lalr1.cc: Formatting changes.
1871
52cbbe84
AD
18722008-10-28 Akim Demaille <demaille@gostai.com>
1873
1874 Don't define debugging functions when !YYDEBUG.
1875 * data/lalr1.cc (debug_stream, set_debug_stream)
1876 (debug_level_type, debug_level, set_debug_level): Don't
1877 declare them when YYDEBUG is not defined.
1878 The implementation are already YYDEBUG-aware.
1879
0925d5bf
AD
18802008-10-28 Akim Demaille <demaille@gostai.com>
1881
1882 Prefer "continue" for empty loop bodies.
1883 * etc/bench.pl.in: Use "continue" instead of {}.
1884
cf98343c
AD
18852008-10-28 Akim Demaille <demaille@gostai.com>
1886
1887 Space and comments changes.
1888 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
1889 * data/c.m4, data/lalr1.cc: Space changes.
1890
9f467b7d
AD
18912008-10-28 Akim Demaille <demaille@gostai.com>
1892
1893 Make gnulib a submodule.
1894 * gnulib: New.
1895 * .gitmodules (gnulib): New.
1896
0f0e1ace
JD
18972008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
1898
1899 Fix yyerror_range for user-defined location type in C++. Reported by
1900 Georg Sauthoff at
1901 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
1902 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
1903 * THANKS (Georg Sauthoff): Add.
1904
548e2104
JD
19052008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
1906
1907 Update several administrative files mainly to facilitate releasing.
1908 * HACKING (Administrivia): Make the git-merge-changelog notes more
1909 helpful.
1910 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
1911 (Release Procedure): Update for git and add numerous details that were
1912 previously missing.
1913 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
1914 * maint.mk (announcement): Don't list bison as a bootstrap tool so
1915 that announcements don't claim we bootstrapped with whatever bison
1916 happened to be in PATH. Add flex as a bootstrap tool.
1917 * Makefile.maint: Remove, previously replaced by maint.mk.
1918 * Makefile.cfg: Remove, and migrate settings to...
1919 * cfg.mk: ... here for the sake of `make announcement'.
1920 * bootstrap.conf (gnulib_modules): Add announce-gen.
1921 * README: Say GNU Bison instead of just Bison. Suggested by Karl
1922 Berry.
1923
ddf17a6e
PB
19242008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
1925
1926 Small but important bugfixes for the Java skeleton.
1927 * data/lalr1.java (yyerror): Change Location to b4_location_type.
1928 (yy_symbol_print): Call toString on yyvaluep.
1929
e1145ad8
AD
19302008-08-29 Akim Demaille <demaille@gostai.com>
1931
1932 Clarify UPDATED use.
1933 * doc/bison.texinfo: It refers to the last edition of this file,
1934 not to the release date of Bison.
1935 Reported by Joel E. Denny.
1936
0df72d78
AD
19372008-08-29 Akim Demaille <demaille@gostai.com>
1938
1939 * README: Update FAQ pointer.
1940 Reported by Joel E. Denny.
1941
9a90b6bb
EB
19422008-08-27 Eric Blake <ebb9@byu.net>
1943
1944 Resync m4sugar from autoconf.
1945 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
1946 (m4_init): Adjust to latest m4.git changes.
1947 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
1948 effects.
1949 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
1950 (_m4_list_cmp): Reduce side effects.
1951
65015668
AD
19522008-08-27 Akim Demaille <demaille@gostai.com>
1953
1954 Check yyerrok in calc.at.
1955 * tests/calc.at (calc.y): Use yyerrok on "( error )".
1956 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
1957 expected.
1958
98e26a92
AD
19592008-08-27 Akim Demaille <demaille@gostai.com>
1960
1961 Support yyerrok in lalr1.cc.
1962 YYBACKUP is still to import back into lalr1.cc.
1963 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
1964
86c0e784
JD
19652008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
1966
1967 For maintainer-check*, don't recompile for a $(VERSION) update.
1968 * cfg.mk: New file.
1969 (_is-dist-target): Override the one in GNUmakefile.
1970 * Makefile.am (EXTRA_DIST): Add cfg.mk.
1971
88511166
JD
19722008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
1973
1974 Update for recent change to gnulib.
1975 * src/parse-gram.y: Don't include strverscmp.h. It comes from
1976 string.h now.
1977
6bbb2ed5
EB
19782008-08-15 Eric Blake <ebb9@byu.net>
1979
d67c52e8
EB
1980 Remaining m4sugar merge from autoconf.
1981 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
1982 * data/m4sugar/foreach.m4: New file, copied from autoconf.
1983 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
1984 * src/output.c (output_skeleton): Tell m4 how to find it.
1985
6bbb2ed5
EB
1986 Partial m4sugar merge from autoconf: m4_map.
1987 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
1988 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
1989 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
1990 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
1991 for empty list.
1992 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
1993 Likewise.
1994 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
1995 declares it.
1996
8dce3875
JD
19972008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
1998
1999 Keep .version and PACKAGE_VERSION in sync.
2000 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
2001 dependency, and add comments justifying this in more detail. Discussed
2002 starting at
2003 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
2004
882a1fbf
EB
20052008-08-06 Eric Blake <ebb9@byu.net>
2006
a3764451
EB
2007 Partial m4sugar merge from autoconf: m4_shiftn.
2008 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
2009 (m4_shift2, m4_shift3): New macros.
2010 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
2011 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
2012 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
2013 * data/java.m4 (b4_remove_comma): Likewise.
2014
882a1fbf
EB
2015 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
2016 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
2017 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
2018 (m4_init): Consolidate wrapped text into single m4_wrap.
2019 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
2020 in wrapped text.
2021
a30e920d
EB
20222008-08-05 Eric Blake <ebb9@byu.net>
2023
dfcc5959
EB
2024 Partial m4sugar merge from autoconf: builtins, version.m4.
2025 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
2026 (m4_prepend): Remove, as it is unused and inherently quadratic,
2027 whereas m4_append is linear in newer m4.
2028 (m4_mkstemp): New builtin.
2029 (m4_symbols): Make rename conditional.
2030 (m4_version_prereq): Ensure fatal error if used in bison, which
2031 intentionally lacks version.m4.
2032
a30e920d
EB
2033 Fix comments in m4sugar.
2034 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
2035
445b7470
JD
20362008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
2037
2038 Update for recent .gitignore fix in Gnulib.
2039 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
2040 anchored .gitignore entries.
2041
a1e50014
JD
20422008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
2043
2044 Set gnu or gnits strictness.
2045 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
2046 development and gnits strictness for releases. Based on Eric Blake's
2047 suggestion at
2048 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
2049
d43f77e7
PB
20502008-07-31 Paolo Bonzini <bonzini@gnu.org>
2051
2052 * NEWS: Clarify documentation of %language.
2053
fee2ed87
PB
20542008-07-31 Paolo Bonzini <bonzini@gnu.org>
2055
2056 Support usage of git-merge-changelog.
2057 * .gitattributes: New.
2058 * HACKING: Document usage of git-merge-changelog.
2059 * bootstrap: Install git-merge-changelog entries in .git/config
2060 if appropriate.
2061
78029cd5
JD
20622008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
2063
2064 Remove remaining dependence on CVS Id keyword.
2065 * ChangeLog: For the sake of people still using CVS, don't use dollars
2066 when mentioning Id.
2067 * data/xslt/bison.xsl: Remove Id from header comments, where it was
2068 unusual anyway.
2069 * data/xslt/xml2dot.xsl: Likewise.
2070 * data/xslt/xml2text.xsl: Likewise.
2071 * data/xslt/xml2xhtml.xsl: Likewise.
2072 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
2073 * doc/Makefile.am (neutralize): Remove, no longer needed.
2074 (.x.1): Don't use neutralize.
2075 (edit): Don't substitute for ID.
2076 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
2077
c53d18b1
JD
20782008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
2079
2080 Fix dependence on computed configure variables.
2081 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
2082 $(top_srcdir)/configure.ac so that changes to computed variables, such
2083 as PACKAGE_VERSION, are seen.
2084 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
2085
5523ac79
JD
20862008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
2087
2088 Update copyright dates for recent changes.
2089 * Makefile.am: Here.
2090 * src/Makefile.am: Here.
2091 * src/reduce.c: Here.
2092 * tests/reduce.at: Here.
2093
8fa36911
JD
20942008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
2095
2096 Use git-version-gen for version names between releases.
2097 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
2098 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
2099 * .prev-version: New.
2100 * .version.in: Remove.
78029cd5 2101 * ChangeLog: Remove the Id previously used for capturing the CVS
8fa36911
JD
2102 revision.
2103 * GNUmakefile: Remove, now copied from Gnulib.
2104 * Makefile.am: Add code suggested by comments in
2105 build-aux/git-version-gen.
2106 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
2107 .prev-version, and .version.
2108 * NEWS (2.3b+): Rename to...
2109 (?.?): ... this because we're dropping the "+" version naming scheme,
2110 but, in general, we still can't be sure of our next release name.
2111 * bootstrap: Add a quick hack to remove from .gitignore the
2112 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
2113 entry. This should really be fixed in gnulib instead.
2114 * bootstrap.conf (gnulib_modules): Add gnumakefile.
2115 * configure.ac (AC_INIT): Set version name by invoking
2116 build-aux/git-version-gen.
2117 (AC_CONFIG_FILES): Remove .version, now generated by
2118 build-aux/git-version-gen.
2119 * maint.mk: New, copied from coreutils.
2120 * doc/.cvsignore (bison.1): Add.
2121 * doc/.gitignore (/bison.1): Add.
2122 * doc/bison.1: Remove, generated.
2123 * src/.cvsignore (revision.c): Remove.
2124 * src/.gitignore (/revision.c): Remove.
2125 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
2126 (BUILT_SOURCES): Remove revision.c.
2127 (revision.c): Remove.
2128 * src/getargs.c (version): Don't print revision after the VERSION.
2129 * src/revision.h: Remove.
2130
bcf07cb7
JD
21312008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
2132
2133 Fix untranslatable composition of sentences. Reported by Goran
2134 Uddeborg at
2135 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
2136 * THANKS (Goran Uddeborg): Add.
2137 * src/reduce.c (reduce_print): Report the number of nonterminals and
2138 rules useless in the grammar in separate sentences.
2139 * tests/reduce.at (Useless Rules): Update output.
2140 (Reduced Automaton): Likewise.
2141 (Underivable Rules): Likewise.
2142 (Empty Language): Likewise.
2143
9aacab9a
JD
21442008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
2145
2146 Fix some .gitignore and .cvsignore problems.
2147 * bootstrap (insert_sorted_if_absent): Replace all uses with...
2148 (insert_vc_ignore): ... this new function, which prepends `/' to all
2149 .gitignore entries before passing them to insert_sorted_if_absent.
2150 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
2151 .cvsignore files are maintained even though Bison developers run
2152 bootstrap while using Git.
2153 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
2154 unneeded by Bison.
2155 (gnulib): Add.
2156 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
2157 unneeded. Reported by Eric Blake.
2158 * lib/.gitignore (/*~): Add.
2159 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
2160 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
2161 Blake.
2162 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
2163
a9fc7990
JD
21642008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
2165
2166 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
2167 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
2168 * bootstrap.conf (gnulib_modules): Add unsetenv.
2169 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
2170 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
2171 (/setenv.m4): Add.
2172 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
2173 the first argument because it may become position-dependent, and unset
2174 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
2175 Add comments explaining these issues in more detail.
2176
0f1d6f10
JD
21772008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
2178
2179 Add .gitignore everywhere based on .cvsignore.
2180 * .gitignore: New.
2181 * build-aux/.gitignore: New.
2182 * data/.gitignore: New.
2183 * doc/.gitignore: New.
2184 * etc/.gitignore: New.
2185 * examples/.gitignore: New.
2186 * examples/calc++/.gitignore: New.
2187 * lib/.gitignore: New.
2188 * m4/.gitignore: New.
2189 * po/.gitignore: New.
2190 * runtime-po/.gitignore: New.
2191 * src/.gitignore: New.
2192 * tests/.gitignore: New.
2193
7bd1665a
JD
21942008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
2195
2196 * NEWS (2.3b+): New section, empty for now.
2197 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
2198
72c5b982
JD
21992008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
2200
2201 * NEWS (2.3b): Update release date since there has been a delay in
2202 getting the announcements and tarballs out.
2203
bd02cd5d
JD
22042008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
2205
2206 * NEWS: Version 2.3b.
2207 * configure.ac (AC_INIT): Likewise.
2208 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
2209
9126263e
JD
22102008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
2211
2212 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
2213 been doing it for years.
2214 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
2215 (Release Procedure): Add FIXME about make alpha being unmaintained.
2216
fa6aa7b3
JD
22172008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
2218
2219 * data/yacc.c: Reformat m4 a little for readability.
2220 * src/lalr.c (build_relations): Correct comment.
2221
d30b312d
JMG
22222008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2223
2224 DJGPP specific issue.
2225 * djgpp/config.sed: Fixes required to run configure scripts generated
2226 by autoconf 2.62.
2227
138d4cd9
JD
22282008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
2229
2230 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
2231 coordinator@translationproject.org.
2232
8f7e2e1f
JD
22332008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
2234
2235 * THANKS: Add Eric Blake.
2236
f55efa38
JD
22372008-04-23 Eric Blake <ebb9@byu.net>
2238
2239 Revert prior patch, by working around autoconf regression.
2240 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
2241 ("Output file name: ("): Uncomment test.
2242 ("Output file name: )"): Likewise.
2243 Based on an idea from Noah Misch.
2244
096c9f9d
JD
22452008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2246
2247 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
2248 2.61. Reported by Juan Manuel Guerrero at
2249 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
2250 * tests/output.at ("Output file name: ("): Comment out test case for
2251 now.
2252 ("Output file name: )"): Likewise.
2253
0f664b89
JD
22542008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2255
2256 * GNUmakefile: Update git-version-gen invocation so make dist
2257 succeeds.
2258
1cfe6375
JD
22592008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2260
2261 Update to the current gnulib CVS repository, and fix trigraph handling
2262 in Bison.
2263 * bootstrap: Update gnulib CVS repository URL.
2264 (symlink_to_dir): Encapsulate the code that guarantees the destination
2265 directory exists into...
2266 (check_dst_dir): ... this new function, and...
2267 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
2268 fail when copying files into lib/uniwidth/.
2269 * src/output.c (prepare_symbols): When writing yytname muscles, where
2270 symbol names will be encoded in C-string literals, tell quotearg to
2271 escape trigraphs. This used to be the default in gnulib.
2272 * tests/regression.at (Token definitions): Because of the change in
2273 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
2274 escapes trigraphs in symbol names. Thus, yytname no longer has
2275 trigraphs unnecessarily doubly escaped. Update test case output.
2276 Extend test case to be sure Bison's own error messages will no longer
2277 have trigraphs in symbol names unnecessarily escaped once.
2278
74c52fc8
JD
22792008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
2280
2281 Fix make dist infinite loop reported by Juan Manuel Guerrero at
2282 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
2283 * .cvsignore: Add .version.
2284 * .version.in: New.
2285 * bootstrap.conf (gnulib_modules): Add git-version-gen.
2286 * configure.ac (AC_CONFIG_FILES): Add .version.
2287 * build-aux/.cvsignore: Add git-version-gen.
2288
8e55b3aa
JD
22892008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
2290
2291 * NEWS (2.3a+): Mention that -g now takes an argument.
2292 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
2293 consistency. Update the -g and -x entries now that they take
2294 arguments. Use brackets to indicate optional arguments.
2295 * src/getargs.c (usage): Explain the relationship between arguments of
2296 long and short options more completely. Document --defines and -d
2297 separately since the former takes an argument but, for POSIX Yacc, the
2298 latter does not.
2299 (short_options): Let -W take an optional argument like --warnings.
8452fdd9 2300 (getargs): Sort cases.
8e55b3aa 2301
59c5ac72
AD
23022008-02-28 Akim Demaille <demaille@gostai.com>
2303
2304 * doc/bison.texinfo: Fix a few typos.
2305
118d4978
AD
23062008-02-28 Akim Demaille <akim@epita.fr>
2307
2308 * doc/bison.texinfo (Bison Options): Document -W.
2309 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
2310
7020f1e9
AD
23112008-02-28 Akim Demaille <akim@epita.fr>
2312
2313 * src/getargs.c (short_options): Split and sort for readability.
2314 -g and -x take optional arguments, just like their long options.
2315 * build-aux/cross-options.pl: Use /x to make the regexp easier to
2316 understand.
2317 Fix the handling of $opt which resulted in all the argument to be
2318 considered as optional.
2319
59da312b
JD
23202008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
2321
2322 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
2323 say its interface is experimental.
2324 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
2325 Java.
2326 (Bison Options): In the -L and --language entry, mention Java.
2327 (Java Bison Interface): Say the interface is experimental.
2328 * src/getargs.c (usage): Mention -L and --language.
2329
2330 * NEWS (2.3a+): Say the push parsing interface is experimental.
2331 * doc/bison.texinfo (Push Decl): Likewise.
2332 (Decl Summary): Likewise in the "%define api.push_pull" entry.
2333 (Push Parser Function): Likewise.
2334 (Pull Parser Function): Likewise.
2335 (Parser Create Function): Likewise.
2336 (Parser Delete Function): Likewise.
2337 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
2338 yypull_parse, and yypush_parse entries.
2339
2340 * NEWS (2.3a+): Mention XML support, and say the schema is
2341 experimental.
2342 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
2343 * src/getargs.c (usage): Say the XML schema is experimental.
2344
2345 * NEWS (2.3a+): Say option instead of flag.
2346
2bb3ebec
WP
23472008-02-21 Wojciech Polak <polak@gnu.org>
2348
2349 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
2350 text.
2351
333e670c
JD
23522008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
2353
2354 Fix impure push parser compile error reported by Bob Rossi at
2355 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
2356 * data/yacc.c: Clean up whitespace in the output a little.
2357 (yypstate_allocated): Define for impure push parsers regardless of
2358 whether the pull interface is also requested.
2359 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
2360 check impure push parsers without the pull interface.
2361
2362 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
2363 yyerror takes arguments specified by %parse-param while yypstate_new
2364 does not.
2365 * doc/bison.texinfo (Parser Create Function): Document that
2366 yypstate_new returns 0 for multiple impure parser instances.
2367 * tests/push.at (Push Parsing: Multiple impure instances): Update
2368 expected stderr output.
2369
798096e1
JD
23702008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
2371
2372 * runtime-po/POTFILES.in (push.c): Remove.
2373
9ca7f077
JD
23742008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
2375
2376 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
2377 * data/push.c: Rename to...
2378 * data/yacc.c: ... this, overwriting it.
2379 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
2380 `%push-pull-parser' -> `%define api.push_pull "both"'.
2381 Remove old yacc.c tests, and update push.c tests to yacc.c.
2382
42ee26bb
JD
23832008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
2384
2385 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
2386 `"%code top" blocks' instead of `%code "top" blocks'.
2387 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
2388 Clean up whitespace in the output a little.
2389
b1cc23c4
JD
23902008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
2391
2392 Fix documentation problems reported by Tim Josling at
2393 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
2394 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
2395 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
2396 integers. Explain the effect of literal string aliases on error
2397 messages. Copy token 0 documentation from the C++ skeleton
2398 documentation.
2399
ab7f29f8
JD
24002008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
2401
2402 Accept a token number in a %left, %right, or %nonassoc for POSIX
2403 conformance. Reported by Tim Josling at
2404 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
2405 * NEWS (2.3a+): Mention.
2406 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
2407 and code numbers are treated by precedence declarations.
2408 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
2409 of symbols.1.
2410 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
2411 of symbol.
2412 (symbol.prec): New, just like symbol but allows INT.
2413 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
2414 longer holds.
2415 * tests/regression.at (Token number in precedence declaration): New
2416 test case.
2417
a924ef36
JMG
24182008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2419
2420 DJGPP specific issues.
2421 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
2422 be changed. Copyright timestamp adjusted.
2423 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
2424 be changed. Copyright timestamp adjusted.
2425 * djgpp/config.site: Copyright timestamp adjusted.
2426 * djgpp/config_h.sed: Copyright timestamp adjusted.
2427 * djgpp/djunpack.bat: Copyright timestamp adjusted.
2428 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
2429 filename translation list.
2430 * djgpp/subpipe.c (init_subpipe): Check the environment variables
2431 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
2432 files shall be created. Before trying to use the temp dir where the
2433 environment variable points to check that the dir really exists. If
2434 not default to the cwd as temp dir. Copyright timestamp adjusted.
2435 * djgpp/subpipe.h: Copyright timestamp adjusted.
2436 * djgpp/testsuite.sed: Copyright timestamp adjusted.
2437
389c8cfd
PE
24382008-01-30 Paul Eggert <eggert@cs.ucla.edu>
2439
2440 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
2441
5d1cfef4
PE
24422008-01-09 Paul Eggert <eggert@cs.ucla.edu>
2443
2444 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
2445 Problem reported by Claudio Saavedra in
2446 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
2447
e2dcf996
WP
24482008-01-05 Wojciech Polak <polak@gnu.org>
2449
2450 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
2451 document's title with the input grammar file name.
2452
da730230
JD
24532007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
2454
2455 Automate regression testing of the XML/XSLT implementation. Discussed
2456 starting at
2457 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
2458 * configure.ac (XSLTPROC): New substitution.
2459 * Makefile.am (maintainer-xml-check): New phony target invoking...
2460 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
2461 invoking make maintainer-check with BISON_TEST_XML=1.
2462 * tests/atlocal.in (XSLTPROC): New.
2463 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
2464 not to report reachable memory when Bison is expected to have a
2465 non-zero exit status and (2) to compare XML/XSLT output with --graph
2466 and --report=all output for every working grammar when
2467 BISON_TEST_XML=1.
2468 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
2469 (AT_BISON_CHECK_XML): New.
2470 (AT_QUELL_VALGRIND): New.
2471 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
2472 (AT_CHECK): ... don't redefine this since this was the old way to
2473 quell Valgrind.
2474 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
2475 AT_BISON_CHECK invocations.
2476 * tests/c++.at: Likewise.
2477 * tests/calc.at: Likewise.
2478 * tests/conflicts.at: Likewise.
2479 * tests/cxx-type.at: Likewise.
2480 * tests/existing.at: Likewise.
2481 * tests/glr-regression.at: Likewise.
2482 * tests/headers.at: Likewise.
2483 * tests/input.at: Likewise.
2484 * tests/java.at: Likewise.
2485 * tests/output.at: Likewise.
2486 * tests/push.at: Likewise.
2487 * tests/reduce.at: Likewise.
2488 * tests/regression.at: Likewise.
2489 * tests/sets.at: Likewise.
2490 * tests/skeletons.at: Likewise.
2491 * tests/synclines.at: Likewise.
2492 * tests/torture.at: Likewise.
2493 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
2494 tends to hang xsltproc.
2495 (Big horizontal): Likewise.
2496
408476bc
JD
24972007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
2498
2499 In XML output, remove redundant class attribute on symbol element.
2500 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
2501 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
2502 look up a symbol to determine whether it's a nonterminal or terminal.
2503 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
2504 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
2505
2506 Add prec/assoc information to XML output.
2507 * src/gram.c (grammar_rules_print_xml): For each rule that has a
2508 %prec, add a percent_prec attribute.
2509 * src/print-xml.c (print_grammar): For each terminal that has a
2510 precedence or associativity, add a prec or assoc attribute.
2511 (xml_indent): New.
2512 (xml_puts): Use xml_indent.
2513 (xml_printf): Use xml_indent.
2514 * src/print-xml.h (xml_indent): Prototype.
2515
2516 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
2517 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
2518
d4a26c48
JD
25192007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
2520
2521 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
2522 (bison:ruleByNumber): ... this for clarity.
2523 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
2524 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
2525 (xsl:template match="reduction"): Update.
2526 (xsl:template match="item"): Update.
2527 (xsl:template match="reduction"): Update.
2528
2529 In the XML output, don't print the list of rules where symbols appear.
2530 Compute it in XSLT instead. Discussed at
2531 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
2532 * data/xslt/bison.xsl (bison:ruleByLhs): New.
2533 (bison:ruleByRhs): New.
2534 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
2535 bison:ruleByRhs.
2536 (xsl:template match="terminal/rule"): Remove.
2537 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
2538 bison:ruleByRhs.
2539 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
2540 Remove.
2541 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
2542 bison:ruleByRhs and mode="number-link" for rule template.
2543 (xsl:template match="terminal/rule"): Remove.
2544 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
2545 bison:ruleByRhs and mode="number-link" for rule template.
2546 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
2547 Rewrite as...
2548 (xsl:template match="rule" mode="number-link"): ... this.
2549 * src/print-xml.c (print_grammar): Don't print the list of rules.
2550
ef1b4273
JD
25512007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
2552
2553 Don't let --report affect XML output; always print all information.
2554 Discussed at
2555 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
2556 * src/conflicts.c (log_resolution): Implement.
2557 * src/print-xml.c (print_core): Implement.
2558 (print_state): Implement.
2559 (print_xml): Implement.
2560
2561 * NEWS (2.3a+): Fix quotes.
2562 * src/parse-gram.y (prologue_declaration): For consistency with -v,
2563 don't let %verbose clear the list specified by --report.
2564
0f6cd9e3
AD
25652007-11-26 Akim Demaille <akim@epita.fr>
2566
2567 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
2568
d80fb37a
JD
25692007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
2570
2571 In the XML output, list useless and unused symbols and rules with the
2572 useful ones and add a "usefulness" attribute. Discussed starting at
2573 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
2574 * src/gram.c (grammar_rules_partial_print_xml): Remove.
2575 (grammar_rules_print_xml): Print all rules instead of just those
2576 useful in the grammar, and add a "usefulness" attribute.
2577 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
2578 * src/print-xml.c (print_rules_useless_in_parser): Remove.
2579 (print_grammar): Print all nonterminals instead of just useful ones,
2580 and add a "usefulness" attribute to nonterminals and terminals.
2581 (print_xml): Don't print a separate "reductions" or
2582 "rules-useless-in-parser" element.
2583 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
2584 (reduce_xml): Remove.
2585 (reduce_token_unused_in_grammar): New.
2586 (reduce_nonterminal_useless_in_grammar): New.
2587 * src/reduce.h (reduce_xml): Remove prototype.
2588 (reduce_token_unused_in_grammar): Add prototype.
2589 (reduce_nonterminal_useless_in_grammar): Add prototype.
2590 * data/xslt/xml2text.xsl: Update for XML changes.
2591 * data/xslt/xml2xhtml.xsl: Update for XML changes.
2592 * tests/reduce.at (Useless Terminals): Update output.
2593 (Useless Rules): Update output.
2594 (Reduced Automaton): Update output.
2595
2596 Say "Terminals unused in grammar" instead of "Unused terminals".
2597 * NEWS (2.3a+): Update.
2598 * doc/bison.texinfo (Understanding): Update example output.
2599 * src/reduce.c (reduce_output): Implement.
2600 * data/xslt/xml2text.xsl: Implement.
2601 * data/xslt/xml2xhtml.xsl: Implement.
2602
1bb2bd75
JD
26032007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
2604
2605 Accept --report-file=FILE to override the default `.output' filename.
2606 * NEWS (2.3a+): Mention.
2607 * doc/bison.texinfo (Bison Options): Add an entry.
2608 * src/files.c (compute_output_file_names): Don't override
2609 spec_verbose_file if already set.
2610 * src/getargs.c (usage): Document --report-file.
2611 (REPORT_FILE_OPTION): New anonymous enum member.
2612 (long_options): Add entry for it.
2613 (getargs): Add case for it setting spec_verbose_file.
2614
2615 * build-aux/cross-options.pl: Don't record a short option just because
2616 there's an arg.
2617 * doc/.cvsignore: Add yacc.1.
2618
a005a9c4
AD
26192007-11-14 Akim Demaille <akim@epita.fr>
2620
2621 * doc/yacc.1.in: New.
2622 * configure.ac, doc/Makefile.am: Adjust.
2623 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
2624 config.h symbol.
2625 Use AC_SUBST for assignments too.
2626 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
2627
cff03fb2
JD
26282007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
2629
2630 * src/gram.c: Remove comments that duplicate comments in gram.h.
2631
2632 When reporting useless rules and nonterminals, say "useless in grammar"
2633 instead of "useless", and say "useless in parser" instead of "never
2634 reduced". Discussed starting at
2635 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
2636 * NEWS (2.3a+): Mention this change.
2637 * data/xslt/xml2text.xsl: Update output text and expected input XML
2638 element names to match changes below.
2639 * data/xslt/xml2xhtml.xsl: Likewise.
2640 (xsl:template match="bison-xml-report"): Add missing entry in Table of
2641 Contents: "Rules useless in parser due to conflicts".
2642 * doc/bison.texinfo (Decl Summary): Reword a little.
2643 (Understanding): Update example output for changes below.
2644 * src/gram.c: (rule_useful_p): Rename to...
2645 (rule_useful_in_grammar_p): ... this.
2646 (rule_useless_p): Rename to...
2647 (rule_useless_in_grammar_p): ... this.
2648 (rule_never_reduced_p): Rename to...
2649 (rule_useless_in_parser_p): ... this.
2650 (grammar_rules_print): Update for renames.
2651 (grammar_rules_print_xml): Update for renames.
2652 (grammar_rules_never_reduced_report): Rename to...
2653 (grammar_rules_useless_report): ... this since it is used for either
2654 kind of useless rule.
2655 * src/gram.h: Reword comments and update function names in prototypes.
2656 * src/main.c (main): Say "rule useless in parser due to conflicts".
2657 * src/print-xml.c (print_rules_never_reduced): Rename to...
2658 (print_rules_useless_in_parser): ... this, and rename output XML
2659 element "rules-never-reduced" to "rules-useless-in-parser".
2660 (print_xml): Update for rename.
2661 * src/print.c (print_results): Say "Rules useless in parser due to
2662 conflicts".
2663 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
2664 (nonterminals_reduce): Say "nonterminal useless in grammar".
2665 (reduce_output): Say "Nonterminals useless in grammar".
2666 Say "Rules useless in grammar".
2667 (reduce_xml): Rename output XML element "useless" to
2668 "useless-in-grammar".
2669 (reduce_print): Don't report the count of grammatically useless rules
2670 as "rules never reduced" just because %yacc is specified.
2671 In the correct report of this count, say nonterminal(s) and rule(s)
2672 "useless in grammar".
2673 * tests/conflicts.at (S/R in initial): Update expected output.
2674 (Defaulted Conflicted Reduction): Likewise.
2675 (Unreachable States After Conflict Resolution): Likewise.
2676 * tests/existing.at (GNU pic Grammar): Likewise.
2677 * tests/reduce.at (Useless Nonterminals): Likewise.
2678 (Useless Rules): Likewise.
2679 (Reduced Automaton): Likewise.
2680 (Underivable Rules): Likewise.
2681 (Empty Language): Likewise.
2682
66f0441d
JD
26832007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
2684
2685 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
2686 here document and before the EOF so that BSD's implementation of Bourne
2687 shell doesn't parse the delimiter as part of the here document.
2688 * doc/.cvsignore: Add cross-options.texi.
2689 * src/getargs.c (usage): Add a blank line after the warning categories.
2690
d0ee4105
PB
26912007-11-08 Paolo Bonzini <bonzini@gnu.org>
2692
2693 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
2694
e8b1fb9b
AD
26952007-11-05 Akim Demaille <akim@epita.fr>
2696
2697 Remove Id: from bison.1.
2698 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
2699 (perl -0777 -pi -e 's/\.PP\nId): New.
2700 (.x.1): Use it to ignore the version control revision.
2701
2f7a96b5
AD
27022007-11-05 Akim Demaille <demaille@gostai.com>
2703
2704 * build-aux/Makefile.am: Ship cross-options.pl.
2705 * doc/Makefile.am: Always refer to cross-options.texi with
2706 $(srcdir).
2707 (MAINTAINERCLEANFILES): Add it.
2708
f4101aa6
AD
27092007-11-04 Akim Demaille <demaille@gostai.com>
2710
2711 Generate the long/short option cross-table.
2712 * build-aux/cross-options.pl: New.
2713 * doc/Makefile.am (cross-options.texi): New.
2714 * doc/bison.texinfo: Use it.
2715
727a1401
AD
27162007-11-04 Akim Demaille <demaille@gostai.com>
2717
2718 Generate bison.1 using help2man.
2719 * doc/common.x, doc/bison.x: New.
2720 * doc/Makefile.am (bison.1, .x.1): New.
2721 The code is taken from autoconf-2.61/man/Makefile.am.
2722 * configure.ac: Look for help2man.
2723
6aeb9c57
AD
27242007-11-04 Akim Demaille <demaille@gostai.com>
2725
2726 Complete --help.
2727 * src/getargs.c (usage): Document -W, make it clear that -d,
2728 -g and -x have optional arguments.
2729
d7be4085
AD
27302007-11-04 Akim Demaille <demaille@gostai.com>
2731
2732 Find sha1sum when named gsha1sum.
2733 * bootstrap (find_tool): New.
2734 ($SHA1SUM): New.
2735
d9df47b6
JD
27362007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
2737
2738 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
2739 at
2740 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
2741 * NEWS (2.3a+): Mention.
2742 * data/bison.m4 (b4_pure_if): Don't define it here.
2743 * data/c.m4 (b4_identification): Depend on individual skeletons to
2744 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
2745 values of the %define variables api.pure or api.push_pull. Define
2746 YYPURE, YYPUSH, and YYPULL accordingly.
2747 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
2748 glr.cc has already defined b4_pure_flag.
2749 * data/push.c: Define b4_pure_if based on `%define api.pure'.
2750 Remove YYPUSH and YYPULL since they're back in b4_identification again.
42ee26bb 2751 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
d9df47b6
JD
2752 * doc/bison.texinfo (Pure Decl): Update.
2753 (Push Decl): Update.
2754 (Decl Summary): Add api.pure to %define entry.
2755 In %pure-parser entry, say it's deprecated and reference %define.
2756 (Pure Calling): Update.
2757 (Error Reporting): Update.
2758 (C++ Scanner Interface): Update.
2759 (How Can I Reset the Parser): Update.
2760 (Table of Symbols): In %pure-parser entry, say it's deprecated and
2761 reference %define.
2762 * src/getargs.c (pure_parser): Remove global variable.
2763 * src/getargs.h (pure_parser): Remove extern.
2764 * src/output.c (prepare): Don't define pure_flag muscle.
2765 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
2766 wrapper around `%define api.pure'.
2767 * tests/calc.at (Simple LALR Calculator): Update.
2768 (Simple GLR Calculator): Update.
2769 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
2770 Update.
2771 (GLR: Resolve ambiguity, pure, locations): Update.
2772 (GLR: Merge conflicting parses, pure, no locations): Update.
2773 (GLR: Merge conflicting parses, pure, locations): Update.
2774 * tests/glr-regression.at (Uninitialized location when reporting
2775 ambiguity): Update
2776 * tests/input.at (Unused %define api.pure): New test case.
2777 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
2778 AT_PURE_IF and AT_PURE_AND_LOC_IF.
2779 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
2780
c373bf8b
JD
27812007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
2782
2783 %define push_pull -> %define api.push_pull. Discussed starting at
2784 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
2785 * data/push.c: Expect the new name.
2786 * data/yacc.c: Likewise.
2787 * doc/bison.texinfo (Push Decl): Update.
2788 (Decl Summary): Update %define entry.
2789 (Push Parser Function): Update.
2790 (Pull Parser Function): Update.
2791 (Parser Create Function): Update.
2792 (Parser Delete Function): Update.
2793 * tests/calc.at (Simple LALR Calculator): Update.
2794 * tests/input.at (%define enum variables): Update.
2795 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
2796 (Push Parsing: Multiple impure instances): Update.
2797 (Push Parsing: Unsupported Skeletons): Update.
2798 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
2799 (Exploding the Stack Size with Malloc): Update.
2800
2801 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
2802 other entries some.
2803
32f19b6b
JD
28042007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
2805
2806 For the XML output's terminal element, rename @number to @token-number,
2807 and add @symbol-number. In the nonterminal element, rename @number to
2808 @symbol-number. Discussed starting at
2809 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
2810 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
2811 renames.
2812 (xsl:template match="nonterminal"): Likewise.
2813 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
2814 (xsl:template match="nonterminal"): Likewise.
2815 * src/print-xml.c (print_grammar): Implement.
2816
255a6b90
JD
28172007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2818
2819 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
2820 2007-10-11 change, the child elements here are items not rules.
408476bc 2821 (xsl:template match="item"): New.
255a6b90
JD
2822 (xsl:template match="rule"): Update for new reduced itemset.
2823 (xsl:template match="point"): Remove.
2824 (xsl:template match="empty"): For consistency with --graph, don't
2825 output "/* empty */".
2826 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
2827 line-wrap, don't pass a negative value as first-line-length since this
2828 won't work with the following changes.
2829 (xsl:template name="line-wrap"): Simplify slightly.
2830 (xsl:template name="ws-search"): Eliminate recursion.
2831 * src/print_graph.c (print_core): Don't print a reduction's lookahead
2832 set next to an item whose dot is not at the end of the RHS even if it
2833 happens to be associated with the same rule.
2834
88c78747
JD
28352007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
2836
31984206
JD
2837 Add %define lr.keep_unreachable_states.
2838 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
2839 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
2840 * src/main.c (main): Implement it.
2841 * tests/conflicts.at (Unreachable States After Conflict Resolution):
2842 Extend to test it, and fix a typo.
2843
28442007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
2845
2846 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
88c78747
JD
2847 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
2848 the example .output text.
2849 * tests/regression.at (Extra lookahead sets in report): Improve wording
2850 of comments.
2851
b7a70162
WP
28522007-10-17 Wojciech Polak <polak@gnu.org>
2853
2854 * src/print-xml.c (print_grammar): Renamed
2855 <terminal> and <nonterminal> attributes:
2856 "type" to "number" and "symbol" to "name".
2857 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
2858 Use new attribute names.
2859 (xsl:template match="nonterminal"): Likewise.
2860 * data/xslt/xml2xhtml.xsl: Likewise.
2861
a0de5091
JD
28622007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
2863
2864 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
2865 (Option Cross Key): Likewise.
2866
2867 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
2868 next to an item whose dot is not at the end of the RHS even if it
2869 happens to be associated with the same rule.
2870 * src/print.c (print_core): Likewise.
2871 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
2872 (Resolved SR Conflicts): Update output.
2873 * tests/regression.at (Extra lookahead sets in report): New test case.
2874
4c20d18d
WP
28752007-10-11 Wojciech Polak <polak@gnu.org>
2876
2877 * src/print-xml.c (print_core): Remove item set
2878 redundancy.
2879 * data/xslt/bison.xsl (bison:ruleNumber): New key.
2880 Improve processing time. Suggested by Joel E. Denny.
2881 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
2882 Write xsl:param "required" attribute as comment.
2883 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
2884 (xsl:template match="rule"): Support new reduced itemset.
2885 (xsl:template match="point"): Remove.
2886 * data/xslt/xml2xhtml.xsl: Likewise.
2887
f506ad1c
JD
28882007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
2889
2890 * src/getargs.c (version): Update copyright year.
2891
21f1b063
JD
28922007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
2893
2894 Make xml2dot.xsl and --graph produce the same output.
2895 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
2896 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
2897 escaped later.
2898 (xsl:template name="output-node"): Use the new escape template instead
2899 of the string-replace template directly.
2900 (xsl:template name="output-edge"): Likewise.
2901 (xsl:template name="escape"): New, escapes backslashes and newlines in
2902 addition to quotation marks.
2903 * src/graphviz.c (start_graph, output_node, output_edge): Add
2904 whitespace to output for legibility.
2905
2906 Make xml2text.xsl and --report produce the same output, and remove the
2907 XML "conflicts" element since a conflict summary is easily extracted
2908 from the automaton.
2909 * data/xslt/bison.xsl: New.
2910 (xsl:template match="state" mode="bison:count-conflicts): New.
2911 * data/xslt/xml2text.xsl: Import bison.xsl.
2912 (xsl:template match="bison-xml-report"): Instead of styling the
2913 "conflicts" element, style the "automaton" element with mode
2914 "conflicts". Unlike the former, the latter lists S/R and R/R
2915 conflicts for a state on the same line.
2916 (xsl:template match="conflicts"): Remove.
2917 (xsl:template match="conflict"): Remove.
2918 (xsl:template match="terminal"): Line-wrap the list of rules in which
2919 the terminal is used.
2920 (xsl:template match="nonterminal"): Likewise for nonterminals.
2921 (xsl:template match="automaton" mode="conflicts"): New.
2922 (xsl:template match="state" mode="conflicts"): New.
2923 (xsl:template name="line-wrap"): New.
2924 (xsl:template name="ws-search"): New.
2925 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
2926 (xsl:template match="bison-xml-report"): Instead of styling the
2927 "conflicts" element, style the "automaton" element with mode
2928 "conflicts."
2929 (xsl:template match="conflicts"): Remove.
2930 (xsl:template match="conflict"): Remove.
2931 (xsl:template match="automaton" mode="conflicts"): New.
2932 (xsl:template match="state" mode="conflicts): New.
2933 * src/conflicts.c (conflicts_output_xml): Remove.
2934 * src/conflicts.h (conflicts_output_xml): Remove prototype.
2935 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
2936 * src/print.c (print_grammar): Consistently wrap at the 66th column so
2937 the corresponding XSLT is easier. Also, never wrap between a word and
2938 the comma that follows it.
2939
793fbca5
JD
29402007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
2941
2942 Improve C++ namespace support. Discussed starting at
2943 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
2944 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
2945 b4_namespace_close): New macros that interpret the %define variable
2946 "namespace" so its value can contain "::" to indicate nested
2947 namespaces.
2948 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
2949 the above macros.
2950 * data/lalr1.cc (b4_namespace): Likewise.
2951 * data/location.cc (b4_namespace): Likewise.
2952 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
2953 inside a new table in the general %define entry. Document `%define
2954 namespace' there as well. Point the %name-prefix entry to it since it
2955 explains it more completely in the case of C++.
2956 (C++ Bison Interface): Mention `%define namespace' instead of
2957 %name-prefix.
2958 (Table of Symbols): Remove the `%define push_pull' entry. The %define
2959 entry suffices.
2960 * tests/c++.at (Relative namespace references): New test case.
2961 (Absolute namespace references): New test case.
2962 (Syntactically invalid namespace references): New test case.
2963 * tests/input.at (C++ namespace reference errors): New test case.
2964
35b8730d
JD
29652007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
2966
2967 Add syncline support and location accessor to internal %define
2968 interfaces.
2969 * data/bison.m4 (b4_percent_define_get_loc): New.
2970 (b4_percent_define_get_syncline): New.
2971 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
2972 (b4_percent_define_default): Record defining location as line 1 rather
2973 than 0 for the sake of synchronizing #line's, and define
2974 b4_percent_define_syncline(VARIABLE).
2975 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
2976 * src/muscle_tab.c (muscle_syncline_grow): New.
2977 (muscle_code_grow): Use muscle_syncline_grow.
2978 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
2979 define b4_percent_define_syncline(VARIABLE).
2980 (muscle_percent_define_get_loc): New.
2981 (muscle_percent_define_get_syncline): New.
2982 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
2983 remove some unused variables.
2984 (muscle_percent_define_default): Record defining location as line 1
2985 rather than 0 for the sake of synchronizing #line's, and define
2986 b4_percent_define_syncline(VARIABLE).
2987 (muscle_percent_define_check_values): Use
2988 muscle_percent_define_get_loc.
2989 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
2990 (muscle_percent_define_get_syncline): Prototype.
2991 * tests/skeletons.at (%define Boolean variables: invalid skeleton
2992 defaults): Update output for location change.
2993 (Complaining during macro argument expansion): Extend to test
2994 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
2995
7dc4a694
JD
29962007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
2997
2998 Fix some error-reporting macro bugs.
2999 * data/bison.m4 (b4_cat): New.
3000 (b4_error, b4_error_at): Use b4_cat to send error directives directly
3001 to stdout so they don't become arguments to other macros. Update
3002 comments and add examples.
3003 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
3004 add examples.
3005 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
3006 after printing the error directive so that M4 doesn't report subsequent
3007 problems that are induced by this problem.
3008 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
3009 instead of just in them. Recognize @\n in both places. Both expand to
3010 the empty string. Needed by b4_cat.
3011 * tests/skeletons.at (Complaining during macro argument expansion):
3012 New test case.
3013 (Fatal errors make M4 exit immediately): New test case.
3014
d4bd2295
JD
30152007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
3016
3017 Implement --print-datadir.
3018 * src/getargs.c (usage): Mention.
3019 (PRINT_DATADIR_OPTION): New anonymous enum member.
3020 (long_options): Add entry for it.
3021 (getargs): Add case for it calling compute_pkgdatadir.
3022 * src/output.c (output_skeleton): Encapsulate data directory
3023 computation from here...
3024 (prepare): ... and from here...
3025 (compute_pkgdatadir): ... into this new function.
3026 * src/output.h (compute_pkgdatadir): Prototype.
3027
34cdeddf
JD
30282007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
3029
3030 * src/print-xml.c (escape_bufs): New static global variable
3031 replacing...
3032 (xml_escape_n): ... the static local variable buf here.
3033 (print_xml): Free memory for escape_bufs.
3034 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
3035
d782395d
JD
30362007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
3037
3038 Replace `%push-parser' and `%push-pull-parser' with
3039 `%define push_pull "push"' and `%define push_pull "both"'.
3040 `%define push_pull "pull"' is the default.
3041 * doc/bison.texinfo (Push Decl, Push Parser Function,
3042 Pull Parser Function, Parser Create Function, Parser Delete Function):
3043 Update declarations.
3044 (Decl Summary, Table of Symbols): Replace %push-parser and
3045 %push-pull-parser entries with a %define push_pull entry.
3046 * data/bison.m4 (b4_percent_define_check_values): New macro.
3047 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
3048 definitions...
3049 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
3050 definitions...
3051 * data/push.c: ... to here and compute them from the value of the
3052 %define variable push_pull.
3053 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
3054 parsing requests here...
3055 * data/yacc.c: ... hack this to switch to push.c any time
3056 b4_use_push_pull_flag or the %define variable push_pull is set. This
3057 will go away when we mv push.c yacc.c.
3058 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
3059 push parsing is not supported since unused %define variables are
3060 reported anyway.
3061 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
3062 * src/muscle_tab.h (muscle_percent_define_check_values): Update
3063 comments for consistency with b4_percent_define_check_values.
3064 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
3065 muscles.
3066 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
3067 Remove.
3068 (prologue_declaration): Remove %push-parser and %push-pull-parser
3069 rules.
3070 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
3071 * tests/calc.at: Update declarations.
3072 * tests/input.at (%define enum variables): New test case.
3073 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
3074 declaration.
3075 (Push Parsing: Multiple impure instances): Update declaration.
3076 (Push Parsing: Unsupported Skeletons): New test case.
3077 * tests/torture.at (Exploding the Stack Size with Alloca): Update
3078 declaration.
3079 (Exploding the Stack Size with Malloc): Update declaration.
3080
3f999f78
WP
30812007-09-24 Wojciech Polak <polak@gnu.org>
3082
3083 Add XSLT transformations.
3084
3085 * data/xslt/xml2dot.xsl: Transform XML into DOT.
3086 * data/xslt/xml2text.xsl: Transform XML into plain text.
3087 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
3088 * data/Makefile.am (xsltdir): New variable.
3089 (dist_xslt_DATA): Add xslt/*.xsl files.
3090
a4f75309
PE
30912007-09-23 Paul Eggert <eggert@cs.ucla.edu>
3092
3093 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
3094 Problem reported by Wojciech Polak.
3095 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
3096 (xml_printf): Undo change I made on 21 September; that is,
3097 indent 2 spaces, not 1.
3098
ad5feac4
JD
30992007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
3100
3101 Pacify ./configure --enable-gcc-warnings.
3102 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
3103 `char const *' instead of `char *'.
3104 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
3105 local variable `sep'.
3106
41d7a5f2
PE
31072007-09-21 Paul Eggert <eggert@cs.ucla.edu>
3108
3109 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
3110 elsewhere.
3111 * src/print-xml.c: Prefer "const" after types; that's more consistent.
3112 (xml_printf): Indent just 1 space for level.
3113 (e_char, xlate_char): Remove.
3114 (xml_escape_string): Rewrite to avoid undefined behavior (used
3115 storage that was freed from the stack).
3116 (xml_escape_n): Don't bother checking for subscript error.
3117
3f999f78
WP
31182007-09-21 Wojciech Polak <polak@gnu.org>
3119
3120 Add Bison XML Automaton Report.
41d7a5f2
PE
3121
3122 Add support for an -x option to generate an XML report.
3123 It is not documented yet.
3124 * src/print-xml.c: New file.
3125 * src/print-xml.h: Likewise.
3126 * lib/timevar.def (TV_XML): New var.
3127 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
3128 * src/conflicts.c: Include print-xml.h.
3129 (solved_conflicts_xml_obstack): New var.
3130 (log_resolution, conflicts_solve, conflicts_free):
3131 Add support for XML report.
3132 (conflicts_output_val): New function.
3133 * src/conflicts.h (conflicts_output_val): New decl.
3134 * src/files.c (spec_xml_file): New var.
3135 (compute_output_file_names, output_file_names_free): Add XML support.
3136 * src/files.h (spec_xml_file): New decl.
3137 * src/getargs.c (xml_flag): New var.
3138 (usage, short_options, long_options, getargs): Add XML support.
3139 * src/getargs.h (xml_flag): New decl.
3140 * src/gram.c: Include print-xml.h.
3141 (rule_lhs_print_xml, rule_rhs_print_xml):
3142 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
3143 New functions.
3144 * src/gram.h: Declare external ones.
3145 * src/main.c: Include print-xml.h.
3146 (main): Add XML support.
3147 * src/reduce.c: Include print-xml.h.
3148 (reduce_xml): New function.
3149 * src/reduce.h: Declare it.
3150 * src/state.c: Include print-xml.h.
3151 (state_new): Add XML support.
3152 (state_rule_lookahead_tokens_print_xml): New function.
3153 * src/state.h: Declare it.
3154 (struct state): New member solved_conflicts_xml.
3155 * src/symtab.c (symbol_class_get_string): New function.
3156 * src/symtab.h: Declare it.
3157
6d8e724d
PE
31582007-09-21 Paul Eggert <eggert@cs.ucla.edu>
3159
3160 * GNUmakefile: Switch to coreutils's version.
3161 * bootstrap: Likewise.
3162 * Makefile.cfg: Adjust to new GNUmakefile.
3163 * README-hacking: Likewise.
3164
3165 Import from gnulib:
3166
3167 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
3168 Bruno Haible <bruno@clisp.org>
3169
3170 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
3171 and is a script that invokes bison. Tighten the code. Add comments.
3172
922bdd7f
JD
31732007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
3174
3175 Spell "boolean" as "Boolean". Reported by Akim Demaille.
3176 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
3177 * doc/bison.texinfo (Decl Summary): Fix.
3178 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
3179 * tests/input.at (Boolean %define variables): Update output.
3180 * tests/skeletons.at (%define boolean variables: invalid skeleton
3181 defaults): Rename to...
3182 (%define Boolean variables: invalid skeleton defaults): ... this and
3183 update output.
3184
1b17b01d
JD
31852007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
3186
3187 In impure push mode, don't allow more than one yypstate to be allocated
3188 since multiple impure parsers would corrupt yynerrs.
3189 * data/push.c (yypstate_allocated): New static global variable
3190 initialized to 0.
3191 (yypull_parse): If yypstate_new returns 0, don't report it as memory
3192 exhaustion if yypstate_allocated is 1, but still return 2.
3193 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
3194 already 1. Otherwise, set it to 1.
3195 (yypstate_delete): Set it to 0.
3196 * tests/push.at (Push Parsing: Multiple impure instances): New test
3197 case.
3198
9987d1b3
JD
31992007-08-17 Bob Rossi <bob@brasko.net>
3200
3201 * doc/bison.texinfo (Push Decl): Document the push parser.
3202 (Table of Symbols): Ditto.
3203 (Pure Decl): Ditto.
3204 (Decl Summary): Ditto.
3205 (Multiple Parsers, Push Parser Function, Pull Parser Function,
3206 Parser Create Function, Parser Delete Function):
3207 Add new push parser symbols.
3208 (Table of Symbols): Document push-parser, push-pull-parser,
3209 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
3210
f16b0819
PE
32112007-08-15 Paul Eggert <eggert@cs.ucla.edu>
3212
3213 Update to GPLv3.
3214 * doc/gpl-3.0.texi: New file.
3215 * doc/gpl.texi: Remove.
3216 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
3217 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
3218 * README-hacking, TODO, bootstrap, bootstrap.conf:
3219 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
3220 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
3221 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
3222 * data/lalr1.cc, data/lalr1.java, data/location.cc:
3223 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
3224 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
3225 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
3226 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
3227 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
3228 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
3229 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
3230 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
3231 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
3232 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
3233 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
3234 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
3235 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
3236 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
3237 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
3238 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
3239 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
3240 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
3241 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
3242 * src/complain.c, src/complain.h, src/conflicts.c:
3243 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
3244 * src/files.h, src/flex-scanner.h, src/getargs.c:
3245 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
3246 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
3247 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
3248 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
3249 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
3250 * src/print.c, src/print.h, src/print_graph.c:
3251 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
3252 * src/reduce.h, src/relation.c, src/relation.h:
3253 * src/revision.h, src/scan-code.h, src/scan-code.l:
3254 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
3255 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
3256 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
3257 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
3258 * tests/Makefile.am, tests/actions.at, tests/c++.at:
3259 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
3260 * tests/existing.at, tests/glr-regression.at:
3261 * tests/headers.at, tests/input.at, tests/java.at:
3262 * tests/local.at, tests/output.at, tests/push.at:
3263 * tests/reduce.at, tests/regression.at, tests/sets.at:
3264 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
3265 * tests/torture.at:
3266 Update to GPLv3.
3267
728c4be2
JD
32682007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
3269
3270 Get rid of broken %no-parser, -n, and --no-parser implementation and
3271 documentation.
3272 * TODO: Don't mention them.
3273 * doc/bison.1: Likewise.
3274 * doc/bison.texinfo (Decl Summary): Likewise.
3275 (Bison Options): Likewise.
3276 (Option Cross Key): Likewise.
3277 * src/getargs.c (no_parser_flag): Remove global variable.
3278 (usage): Don't print description of -n and --no-parser.
3279 (long_options): Remove --no-parser entry here.
3280 (getargs): Remove -n case in the switch here.
3281 * src/getargs.h (no_parser_flag): Remove extern.
3282 * tests/regression.at (Web2c Actions): Remove comment that mentions
3283 --no-parser.
3284
5d31a216
JD
32852007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
3286
3287 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
3288 name user variables starting with `yy'. Just pass NULL instead of a
3289 dummy local &yylval to yypush_parse.
3290 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
3291 starting with `yy'.
3292
a2ea208d
JD
32932007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
3294
3295 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
3296 true since it's then always used regardless of whether yyoverflow is
3297 defined. Reported by Christian Burger at
3298 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
3299 * THANKS: Add Christian Burger.
3300
91661ebb
JD
3301 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
3302 node names: say "Decl Summary" not "Bison Declaration Summary".
3303
cbd50549
JD
33042007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
3305
3306 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
3307 determine whether this function has already complained about an invalid
3308 value for a %define boolean variable, don't check whether Bison has
3309 ever examined the value. As written, the check was a tautology.
3310 Instead, record and check for this complaint using a separate muscle.
3311
eb1b0740
JD
33122007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
3313
3314 Fix push parsing memory leak reported by Brandon Lucia at
3315 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
3316 * THANKS: Add Brandon Lucia.
3317 * data/push.c (yypstate_delete): Free the stack if it was reallocated
3318 but the parse never completed and thus freed it.
3319 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
3320 * tests/testsuite.at: Include push.at.
3321 * test/push.at: New.
3322 (Push Parsing: Memory Leak for Early Deletion): New test case.
3323
9d774aff
JD
33242007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
3325
3326 Improve handling of multiple S/R conflicts in the same state and of S/R
3327 conflicts involving multiple reductions.
3328 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
3329 set for a state here or Bison will abort if it is reassigned on a
3330 later conflicted reduction in the same state.
3331 Similarly, don't finalize and assign the solved conflicts report here
3332 or it will be lost if it is reassigned on a later conflicted reduction
3333 in the same state.
3334 (set_conflicts): Instead, assign them both here after all S/R conflicts
3335 in the state have been fully examined.
3336 * src/print.c (shift_set): Rename to...
3337 (no_reduce_set): ... this.
3338 (print_reductions): Update for rename, and add %nonassoc error action
3339 tokens to no_reduce_set so that, when printing the first remaining
3340 reduction on an error action token, the reduction is enclosed in
3341 brackets.
3342 (print_results): Update for rename.
3343 * tests/conflicts.at (Solved conflicts report for multiple reductions
3344 in a state): New test case.
3345 (%nonassoc error actions for multiple reductions in a state): New test
3346 case.
3347
3348 * src/main.c (main): Don't depend on C99 features.
3349
10159d2a
JD
33502007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
3351
3352 * build-aux/.cvsignore: Add compile.
b541ffdf
JD
3353 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
3354 uniwidth.
10159d2a 3355
953b3935
JD
33562007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
3357
3358 * bootstrap (slurp): Create target directories that don't exist.
3359 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
3360
6ce2d93a
JD
33612007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
3362
3363 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
3364 than item number.
3365 * closure.c (closure): Likewise.
3366 * state.h (reductions): Comment sorting of rules.
3367 (state): Comment sorting of items.
3368
ce3448d5
JD
33692007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
3370
3371 Fix C++ test cases after recent Gnulib changes. Discussed starting at
3372 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
3373 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
3374 definition in order to avoid Gnulib headers since we don't use config.h
3375 here.
3376 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
3377 rather than AT_DATA so that config.h is included.
3378
8a86eef0
JD
33792007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
3380
3381 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
3382 instead of fprintf. Guard these functions with #if YYDEBUG instead of
3383 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
3384 and so that YYFPRINTF is guaranteed to be defined here.
3385
b1a81613
JD
33862007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
3387
3388 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
3389 with...
3390 (muscle_percent_define_check_values): ... this more helpful function.
3391 Again, it's not used yet, but it will be.
3392 * src/muscle_tab.h: Likewise.
3393
71b61d4d
JD
3394 Improve some comments in parser table construction.
3395 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
3396 (generate_states): Don't mention ruleset, which is internal to closure.
3397 * src/closure.c (closure): Explain sorting of core and itemset, which
3398 is required for this function to behave correctly.
3399 * src/closure.h (closure): Mention sorting.
3400
2a6b783d
JD
34012007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
3402
3403 * src/lalr.c (state_lookahead_tokens_count): For code readability,
3404 move the check for disabled transitions to an aver since conflict
3405 resolution hasn't happened yet.
3406
3407 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
3408 labels a state as inconsistent just because it has error transitions.
3409 The original form of this check appeared in revision 1.1 of lalr.c,
3410 which was committed on 1991-12-21. Now (at least), changing the
3411 consistency label on such a state appears to have no useful effect in
3412 any of the places it is examined, which I enumerate below. The key
3413 point to understanding each item in this enumeration is that a state
3414 with an error transition is labelled consistent in the first place only
3415 if it has no rules, so the check cannot matter for states that have
3416 rules. (1) Labelling a state as inconsistent will cause set_conflicts
3417 to try to identify its conflicts, and a state must have *rules* to have
3418 conflicts. (2) Labelling a state as inconsistent will affect how
3419 action_row sets the default *rule* for the state. (3) Labelling a
3420 state as inconsistent will cause build_relations to add lookback edges
3421 to *rules* in that state.
3422 * src/state.h (struct state): Word the comment for member consistent
3423 more carefully.
3424
14462c2b
JD
34252007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
3426
3427 Don't depend on C99 features.
3428 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
3429 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
3430 * src/reader.c (check_and_convert_grammar): Fix for-loop.
3431 * src/state.c (state_mark_reachable_states): Fix for-loop.
3432 (state_remove_unreachable_states): Fix for-loop.
3433
3434 Don't widen struct state with member reachable just to temporarily
3435 record reachability. Instead, use a local bitset.
3436 * src/state.h (struct state): Remove member.
3437 * src/state.c (state_new): Don't initialize it.
3438 (state_mark_reachable_states): Rename to...
3439 (state_record_reachable_states): ... this, and use bitset.
3440 (state_remove_unreachable_states): Use bitset.
3441
5a43d418
JD
34422007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
3443
3444 * src/Makefile.am (yacc): Quote target action commands properly so
3445 that the yacc script isn't corrupt. Reported by Hans Aberg at
3446 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
3447
0c650a20
JD
3448 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
3449 the case of pure parsers. Reported by Frans Englich at
3450 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
3451 * THANKS: Add Frans Englich.
3452
61fee93e
JD
3453 * NEWS (2.3a+): In the %code entry, reference section `Bison
3454 Declaration Summary' from the manual now since the %code summary has
3455 moved there.
3456 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
3457 in the rules section must be terminated by semicolons.
3458
f124d423
JD
34592007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
3460
3461 Extend the front-end API for %define variables to more completely
3462 mirror the back-end. This will be useful in the future.
3463 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
3464 Update comments to mention the new front-end counterparts of these
3465 macros.
3466 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
3467 for muscle_string_decode and muscle_location_decode.
3468 (muscle_string_decode): New static function.
3469 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
3470 (muscle_percent_define_get, muscle_percent_define_ifdef): New
3471 functions.
3472 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
3473 muscle_percent_define_get to mimic the b4_percent_define_flag_if
3474 implementation more closely.
3475 (muscle_percent_define_invalid_value): New function.
3476 * src/muscle_tab.h (muscle_percent_define_get,
3477 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
3478 Prototype.
3479
75ad86ee
JD
34802007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
3481
3482 * NEWS (2.3a+): Mention yesterday's state-removal change.
3483 (2.3a): Remove the %language entry, which was added after 2.3a.
3484 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
3485 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
3486 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
3487 tests/existing.at: Update copyright date.
3488
5967f0cf
JD
34892007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
3490
3491 If conflict resolution makes states unreachable, remove those states,
3492 report rules that are then unused, and don't report conflicts in those
3493 states.
3494 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
3495 New global function.
3496 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
3497 function.
3498 * src/main.c (main): After conflict resolution, remove the unreachable
3499 states and update all data structures that reference states by number.
3500 * src/state.c (state_new): Initialize each state's reachable member to
3501 false.
3502 (state_mark_reachable_states): New static function.
3503 (state_remove_unreachable_states): New global function.
3504 * src/state.h (struct state): Add member bool reachable.
3505 (state_remove_unreachable_states): Prototype.
3506 * tests/conflicts.at (Unreachable States After Conflict Resolution):
3507 New test case.
3508 * tests/existing.at (GNU pic Grammar): Update test case output now that
3509 an unused rule is discovered.
3510
b09f4f48
JD
35112007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
3512
3513 Minor code cleanup in parser table construction.
3514 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
3515 (new_itemsets, save_reductions): Update for rename to nitemset.
3516 * src/closure.c (nritemset): Rename to...
3517 (nitemset): ... this since the "r" appears to meaningless and isn't
3518 used in the comments.
3519 (closure): Update for rename.
3520 * src/closure.h (nritemset): Update extern to...
3521 (nitemset): ... this.
3522 * src/lalr.c (LA): Fix a typo in comments.
3523 * src/print.c (print_core): Update for rename to nitemset.
3524 * src/print_graph.c (print_graph): Likewise.
3525 * src/state.h: Fix some typos in header comments.
3526
bbb44d83
PE
35272007-04-04 Paul Eggert <eggert@cs.ucla.edu>
3528
9b33de72
PE
3529 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
3530 still sticks to ASCII. Sorry!
3531
bbb44d83
PE
3532 * README-hacking: New file, taken mostly from coreutils, with changes
3533 for Bison. Contains much of the contents of:
3534 * README-cvs: Remove.
3535 * bootstrap: Sync from gnulib.
3536 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
3537 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
3538
29553547
JD
35392007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
3540
3541 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
3542 Setzer.
3543 (Java Differences): Fix some typos.
3544 * THANKS: Add Sebastian Setzer.
3545
01b477c6
PB
35462007-03-07 Paolo Bonzini <bonzini@gnu.org>
3547
730739e4
AD
3548 * data/java.m4 (b4_single_class_if): Remove.
3549 (b4_abstract_if): Look at "%define abstract".
3550 (b4_lexer_if): New.
3551 (b4_union_name): Rename...
3552 (b4_yystype): ... to this. Map to "%define stype".
3553 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
3554 b4_maybe_throws): Fix quoting.
3555 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
3556 * data/lalr1.java (Lexer interface): Always define.
3557 (Lexer interface within parser class): Remove.
3558 (YYLexer class): New, used when "%code lexer" is present.
3559 (constructor): When "%code lexer" is used, pass %lex-param
3560 to the lexer constructor.
3561 (yylex, yyparse): Remove %lex-param from method invocations
3562 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
3563
3564 * doc/bison.texinfo (Java Bison Interface): Mention "%define
3565 abstract". Rename "%define union_name" to "%define stype".
3566 Rename method names according to previous patch.
3567 (Java Scanner Interface): Describe "%code lexer" instead of
3568 "%pure-parser" and "%define single_class".
3569 (Java Differences): Mention "%code lexer".
3570
3571 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
3572 Include scanner here, using macros from tests/local.at.
3573 (AT_DATA_CALC_Y): Remove final argument.
3574 (_AT_CHECK_JAVA_CALC): Likewise.
3575 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
3576 of %locations and %error-verbose.
3577 (main): Test with and without %lex-param.
3578 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
3579 (AT_BISON_OPTION_POPDEFS): Pop it.
01b477c6 3580
122bea3a
JMG
35812007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3582
3583 DJGPP spefic issue. Inhibit the use of disallowed characters for
3584 file name genertion on Win98, WinXP, etc. These are |<>":?*\
3585 and concern testsuite case 46.
3586 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
3587 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
3588 * djgpp/config.bat: Inhibit the use of disallowed characters.
3589
9611cfa2
JD
35902007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
3591
3592 Miscellaneous %define and %code cleanup.
3593 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
3594 values are interpreted.
3595 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
3596 documentation a little more.
3597 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
3598 muscle_percent_define_insert, muscle_percent_code_grow): New
3599 functions/macros.
3600 * src/muscle_tab.h (muscle_percent_define_insert,
3601 muscle_percent_code_grow): Prototype.
3602 * src/parse-gram.y (prologue_declaration): Use
3603 muscle_percent_define_insert and muscle_percent_code_grow when parsing
3604 %define and %code directives.
3605
3606 Make it easy to share %define boolean variables between the front-end
3607 and back-end. Though not used yet, this will be useful in the future.
3608 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
3609 Bison uses of names rather than just skeleton uses of names.
3610 (b4_percent_define_get, b4_percent_define_ifdef): Rename
3611 b4_percent_define_skeleton_variables(VARIABLE) to
3612 b4_percent_define_bison_variables(VARIABLE).
3613 (b4_percent_code_get, b4_percent_code_ifdef): Rename
3614 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
3615 b4_percent_code_bison_qualifiers(QUALIFIER).
3616 (b4_check_user_names_wrap): Update for renames.
3617 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
3618 muscle_percent_define_default): New functions mimicking
3619 b4_percent_define_flag_if and b4_percent_define_default.
3620
3621 For %define variables, report locations for invalid values and
bbb44d83 3622 redefinitions.
9611cfa2
JD
3623 * data/bison.m4 (b4_percent_define_flag_if): Read
3624 b4_percent_define_loc(VARIABLE) to report the location of an invalid
3625 value for VARIABLE.
3626 (b4_percent_define_default): Save a special location in
3627 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
3628 must later be reported as invalid.
3629 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
3630 functions.
3631 (muscle_percent_define_insert): Record the location of VARIABLE in
3632 muscle percent_define_loc(VARIABLE), and use it to report the previous
3633 location for a redefinition.
3634 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
3635 (muscle_percent_define_default): Update like b4_percent_define_default.
3636 (muscle_grow_user_name_list): Rename to...
3637 (muscle_user_name_list_grow): ... this for consistency and use
3638 muscle_location_grow.
3639 * src/muscle_tab.h (muscle_location_grow): Prototype.
3640 * tests/input.at (%define errors): Update expected output.
3641 * tests/skeletons.at (%define boolean variables: invalid skeleton
3642 defaults): New test case.
3643
0bf92491
JD
36442007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
3645
3646 * src/print.c (lookahead_set, state_default_rule): Remove.
3647 (print_reductions): Replace state_default_rule invocation with
3648 equivalent use of yydefact, which was computed in token_actions in
3649 tables.c.
3650 (print_results): Don't allocate lookahead_set.
3651
d3b12988
PB
36522007-02-27 Paolo Bonzini <bonzini@gnu.org>
3653
3654 * data/lalr1.java: Prefix all private members with yy.
3655
f57a7536
JD
36562007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
3657
3658 Use YYFPRINTF instead of fprintf where appropriate. Reported by
9b33de72 3659 Sebastien Fricker at
f57a7536 3660 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
9b33de72 3661 * THANKS: Add Sebastien Fricker.
f57a7536
JD
3662 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
3663 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
3664 accept a variable number of arguments.
3665
6404a5bf
JD
36662007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
3667
3668 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
3669
e4e09639
JMG
36702007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3671
3672 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
3673 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
3674 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
3675
d7e0a1a7
PE
36762007-02-11 Paul Eggert <eggert@cs.ucla.edu>
3677
3678 Undo my 2007-02-07 change, switching back to the c-strcase module
3679 introduced in the 2007-02-03 change. Bruno Haible reported that
3680 the 2007-02-07 change would be dangerous in Turkish if we add a
3681 language whose name contains "i", since "i" is not lowercase "I"
3682 in Turkish.
3683 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
3684 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
3685 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
3686 * m4/.cvsignore: Remove strcase.m4.
3687 * src/getargs.c: Revert 2007-02-07 change, as follows.
3688 Include c-strcase.h.
3689 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
3690
deee93a1
JD
36912007-02-11 Bruno Haible <bruno@clisp.org>
3692
3693 Enable the Java related testsuite tests when the only Java compiler
3694 found is a gcj < 4.3. Discussed at
3695 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
3696 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
3697
574add85
JD
36982007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
3699
3700 * data/Makefile.am: Update copyright date.
3701 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
3702 yypstate_new returns NULL.
3703 (yypstate_new): Return NULL if malloc does.
3704 * src/reader.c (packgram): Move translation of rule actions from the
3705 beginning of packgram to...
3706 (check_and_convert_grammar): ... here right before packgram is invoked
3707 so it's easier to write more complete comments, and remove redundant
3708 code.
3709
e785ccf7
JD
37102007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
3711
3712 As in semantic actions, make @$ in %initial-action, %destructor, and
3713 %printer imply %locations.
3714 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
3715 scanning @$.
3716 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
3717 (@$ in %initial-action implies %locations,
3718 @$ in %destructor implies %locations,
3719 @$ in %printer implies %locations): ... these new test cases.
3720
1cfe1ed7
PE
37212007-02-07 Paul Eggert <eggert@cs.ucla.edu>
3722
3723 Undo most of the 2007-02-03 change, switching to the strcase module
3724 now that gnulib strcase has been fixed.
3725 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
3726 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
3727 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
3728 * m4/.cvsignore: Add strcase.m4.
3729 * src/getargs.c: Revert 2007-02-03 change, as follows.
3730 Don't include c-strcase.h.
3731 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
3732 strcasecmp has "unspecified behavior" outside the POSIX locale,
3733 but it works fine in practice if at least one argument is ASCII,
3734 as is the case in Bison.
3735
0049ec86
PB
37362007-02-07 Paolo Bonzini <bonzini@gnu.org>
3737
3738 * tests/java.at: Skip tests if only one of javac/java is present.
3739 Reported by Joel E. Denny.
3740 * tests/atlocal.in: Adjust copyright years.
3741
37422007-02-05 Paolo Bonzini <bonzini@gnu.org>
3743
3744 * data/lalr1.java (Stack): Work around old verifiers that disallow
3745 access to the private fields of an inner class, from the outer class.
3746 We can make Stack's fields public because user code doesn't have access
3747 to the instance of Stack used by parse(). Reported by Paul Eggert.
3748
2c2b7220
PE
37492007-02-03 Paul Eggert <eggert@cs.ucla.edu>
3750
3751 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
3752 the right spot for these files?
3753 * bootstrap.conf (gnulib_modules): Add c-strcase.
3754 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
3755 c-strncasecmp.c.
3756 * src/getargs.c: Include c-strcase.h.
3757 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
3758 to avoid unspecified behavior.
3759
b2b81dae
JD
37602007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
3761
3762 * doc/bison.texinfo (Decl Summary): Correct typo.
3763
c1d19e10
PB
37642007-01-30 Paolo Bonzini <bonzini@gnu.org>
3765
3766 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
3767 Complain if the value does not match empty, "true" or "false".
3768 * data/c++.m4: Adjust default definitions of %define variables.
3769 * data/java.m4: Adjust default definitions of %define variables.
3770 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
3771 to above behavior.
3772 * tests/input.at (Boolean %define variables): Test new behavior.
3773
8405b70c
PB
37742007-01-29 Paolo Bonzini <bonzini@gnu.org>
3775
3776 * NEWS: Mention java.
3777 * TODO: Remove things that are done.
3778 * bootstrap.conf: Add javacomp-script and javaexec-script.
3779 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
3780
3781 * data/Makefile.am: Add new files.
3782 * data/java-skel.m4: New.
3783 * data/java.m4: New.
3784 * data/lalr1.java: New.
3785
3786 * doc/bison.texinfo: Put "A Complete C++ Example" under
3787 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
3788 under Other Languages.
3789
3790 * src/getargs.c (valid_languages): Add Java.
3791 * src/getargs.h (struct bison_language): Update size of string fields.
3792
3793 * tests/Makefile.am: Add java.at.
3794 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
3795 * tests/java.at: New.
3796 * tests/testsuite.at: Include it.
3797
3eb82471
JD
37982007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
3799
3800 Clean up.
3801 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
3802 at_directive_argv arguments so these no longer have to be global
3803 variables. Also, update the implementation for the following changes.
3804 (fail_for_at_directive_too_many_args,
3805 fail_for_at_directive_too_few_args): Add at_directive_name argument.
3806 (at_directive_name): Remove as at_directive_argv[0] will be used for
3807 this now.
3808 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
3809 for the directive name.
3810 (at_directive_argc, at_directive_argv): Make these local within
3811 skel_lex instead of global.
3812 (INITIAL): Update directive start action for above changes.
3813 (SC_AT_DIRECTIVE_ARG): Rename to...
3814 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
3815 (SC_AT_DIRECTIVE_SKIP_WS): Update.
3816 (scan_skel): Move yylex_destroy to...
3817 (skel_scanner_free): ... here.
3818 * tests/skeletons.at (installed skeleton file name): Rename to...
3819 (installed skeleton file names): ... this.
3820
148d66d8
JD
38212007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
3822
3823 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
3824 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
3825 Summary" not "Directives".
3826 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
3827 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
3828 since the former is now the more complete one.
3829 (Prologue Alternatives): Likewise and do the same for %defines.
3830 (Table of Symbols): Add summary of %code, add summary of %define, and
3831 move full %code documentation to...
3832 (Decl Summary): ... here for consistency with other entries in these
3833 sections.
3834 Move %define entry in order to keep this list alphabetized.
3835 Reword %define entry a little to put less emphasis on the skeleton
3836 concept, which most users shouldn't have to think about.
3837
665f0c24
PE
38382007-01-26 Paul Eggert <eggert@cs.ucla.edu>
3839
3840 Adjust to recent gnulib changes.
3841 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
3842 Add string.h, string_.h, unistd_.h, wchar_.h.
3843 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
3844 * src/system.h: Don't include <stpcpy.h>; this is now done by
3845 <string.h>.
3846
592d0b1e
PB
38472007-01-23 Paolo Bonzini <bonzini@gnu.org>
3848
3849 Simplify implementation of unqualified %code, implement macros for
3850 uniform treatment of boolean %define flags. Document %define.
3851 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
3852 b4_percent_code_ifdef): New.
3853 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
3854 * data/c++.m4: Define default value for global_tokens_and_yystype.
3855 * data/glr.cc: Likewise.
3856 * data/location.cc: Use b4_percent_define_flag_if.
3857
148d66d8 3858 * doc/bison.texinfo (Decl Summary): Document %define.
592d0b1e
PB
3859
3860 * src/parse-gram.y (Unqualified %code): Change muscle name to
3861 b4_percent_code().
3862 (content.opt): Default to empty.
3863
a7867f53
JD
38642007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
3865
3866 Implement support for relative and absolute skeleton file names.
3867 Discussed starting at
3868 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
3869 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
3870 (Bison Options): Document in --skeleton entry.
3871 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
3872 full_skeleton can't necessarily hold all of pkgdatadir.
3873 If the specified skeleton file name contains a `/', don't prepend
3874 pkgdatadir.
3875 * src/parse-gram.y (prologue_declaration): If the specified skeleton
3876 file name contains a `/', prepend the grammar file directory.
3877 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
3878 * skeletons.at: New file.
3879 (relative skeleton file names): New test case.
3880 (installed skeleton file names): New test case.
3881 * tests/testsuite.at: Include skeletons.at.
3882
3883 * bootstrap: Update copyright to 2007.
3884
830c9b18
PB
38852007-01-17 Paolo Bonzini <bonzini@gnu.org>
3886
3887 * bootstrap: Remove occurrences of .#bootmp from the files.
3888
a8c2e813
AD
38892007-01-17 Akim Demaille <akim@epita.fr>
3890
3891 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
3892 nonterminals.
3893 Use per-type %printer.
3894
279cabb6
JD
38952007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
3896
3897 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
3898 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
3899 djgpp/config.site, src/files.c, src/files.h, src/main.c,
3900 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
3901 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
3902 tests/glr-regression.at, tests/input.at, tests/local.at,
3903 tests/output.at, tests/torture.at: Update copyright to 2007.
3904
bb32f4f2
AD
39052007-01-16 Akim Demaille <akim@epita.fr>
3906
3907 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
3908 error code.
3909 (Calc++ Scanner): Exit with failure if we can't open the input
3910 file.
3911 Accept "-" standing for stdin.
3912 (Calc++ Top Level): Print the result only if the parsing was
3913 successful.
3914
7cff04b5
AD
39152007-01-16 Akim Demaille <akim@epita.fr>
3916
3917 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
3918
a4e25e1d
JD
39192007-01-15 Paolo Bonzini <bonzini@gnu.org>
3920 and Joel E. Denny <jdenny@ces.clemson.edu>
3921
3922 Clean up %define and %code implementation in M4 some. Most
3923 importantly, rename all related macros to be in the b4_percent_define
3924 and b4_percent_code namespaces. Also, complete support for `.' in
3925 %define variable names and %code qualifiers.
3926 * data/bison.m4 (b4_check_user_names): Check for special
3927 "SKELETON-NAMESPACE(name)" macros instead of using two nested
3928 m4_foreach loops.
3929 (b4_get_percent_define, b4_get_percent_code): Rename to...
3930 (b4_percent_define_get, b4_percent_code_get): ... these.
3931 Extend documentation with examples.
3932 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
3933 b4_percent_define_skeleton_variables and
3934 b4_percent_code_skeleton_qualifiers.
3935 Expect any value for the %define variable `foo' to be stored in the
3936 macro named `b4_percent_define(foo)'; expect any %code blocks for the
3937 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
3938 expect any unqualified %code blocks to be stored in a macro named
3939 `b4_percent_code_unqualified'.
3940 Use m4_indir so that %define variable names and %code qualifiers can
3941 contain `.', which is allowed by the grammar parser.
3942 (b4_percent_define_default): New macro to set a default value for a
3943 %define variable.
3944 (m4_wrap): Update wrapped code, and fix some underquoting.
3945 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
3946 Expect grammar uses of %define variables and %code qualifiers to be
3947 defined in b4_percent_define_user_variables and
3948 b4_percent_code_user_qualifiers.
3949 * data/c++.m4: Use b4_percent_define_default rather than
3950 m4_define_default. Fix some underquoting. Skeleton usage of %define
3951 variable define_location_comparison now implies skeleton usage of
3952 %define variable filename_type.
3953 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
3954 data/push.c, data/yacc.c: Update macro names.
3955 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
3956 muscle names.
3957
e37c665c
JMG
39582007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3959
3960 DJGPP specific issues.
3961
3962 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
3963 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
3964
7d2d521f
JD
39652007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
3966
3967 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
3968 run parsers in all tests so that Valgrind is invoked during
3969 maintainer-check-valgrind.
3970 (Duplicate representation of merged trees): Free all semantic values.
3971 (Duplicated user destructor for lookahead): Likewise.
3972
e0ac9b4b
JD
39732007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
3974
3975 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
3976 command-line prefix.
3977 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
3978 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
3979 miss Valgrind messages.
3980 (Exploding the Stack Size with Malloc): Likewise.
3981
78143faa
JD
39822007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
3983
3984 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
3985 locals. Reported by Juan Manuel Guerrero at
3986 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
3987 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
3988 Fix some indentation also.
3989 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
3990 explaining this issue.
3991
7ecec4dd
JD
39922007-01-09 Paolo Bonzini <bonzini@gnu.org>
3993 and Joel E. Denny <jdenny@ces.clemson.edu>
3994
3995 Simplify union and prologue handling, and escape union and lex/parse
3996 params with digraphs.
3997 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
3998 values to the empty string since these are no longer guaranteed
3999 initialized by the front-end.
4000 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
4001 braces around b4_user_stype since this is no longer done by the
4002 front-end.
4003 * src/files.c, src/files.h (pre_prologue_obstack,
4004 post_prologue_obstack): Remove.
4005 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
4006 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
4007 with digraphs. This fixes lex params and parse params.
4008 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
4009 * src/output.c (prepare): Remove muscle insertion of the prologues.
4010 (output): Remove freeing of pre_prologue_obstack and
4011 post_prologue_obstack.
4012 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
4013 than prologue_augment for prologue parsing so you don't need prologue
4014 obstacks.
5c80250c
JD
4015 (grammar_declaration): For %union RHS, use `braceless' instead of
4016 "{...}" so that braces are already stripped and code is escaped with
4017 digraphs.
7ecec4dd
JD
4018 * src/reader.c (prologue_augment): Remove.
4019 (reader): Remove initialization of pre_prologue_obstack and
4020 post_prologue_obstack.
4021 * src/reader.h (prologue_augment): Remove.
4022
4023 * data/c.m4: Remove stray parenthesis.
4024
16dc6a9e
JD
40252007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
4026
4027 Remove quotes from variables names in %define directives and from
4028 qualifiers in %code directives, and restrict the characters that are
4029 allowed in them to M4-friendly ones. For %define, continue to support
4030 the quoted form as a deprecated feature. Discussed starting at
4031 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
4032 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
4033 %code.
4034 * doc/bison.texinfo (Prologue Alternatives): Update.
91661ebb
JD
4035 (Decl Summary): In %defines entry, update mention of `%code requires'
4036 and `%code provides'.
16dc6a9e
JD
4037 (C++ Location Values): Update %define uses.
4038 (Calc++ Parser Interface): Likewise.
4039 (Calc++ Parser): Likewise, and update `%code requires' uses.
148d66d8 4040 (Table of Symbols): Update %code documentation.
16dc6a9e
JD
4041 * src/parse-gram.y (prologue_declaration): For %define variables, use
4042 `variable' instead of `STRING'.
4043 (grammar_declaration): For %code qualifiers, use `ID' instead of
4044 `STRING'.
4045 (variable): New nonterminal that takes an `ID' or a `STRING'.
4046 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
4047 and %define uses.
4048 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
4049 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
4050 (%define errors): Update %define uses.
4051
e9813cd4
JD
40522007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
4053
4054 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
4055 instead of muscle_insert for %define values so that M4-special
4056 characters are replaced with digraphs.
4057 * tests/input.at (%define errors): Extend to check weird values.
4058
6afc30cc
JD
40592007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
4060
4061 Instead of having skeletons declare all valid %define variables and
4062 %code qualifiers, provide macros that retrieve the associated values
4063 and build these lists automatically. Thus Bison will now warn when a
4064 variable or qualifier is not used by the skeleton in the current
4065 invocation regardless of whether it might sometimes be used by that
4066 skeleton in other invocations. Also, move all %define value macros to
4067 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
4068 form, which is replaced by %code.
4069 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
4070 (b4_check_user_names): ... this, and change the series of valid name
4071 arguments to a single list argument for names used in the skeleton
4072 similar to the existing list argument for names used in the grammar.
4073 Warn instead of complaining.
4074 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
4075 values and %code code, to format %code code properly, and to build
4076 lists of all %define variables and %code qualifiers used in the
4077 skeleton: b4_skeleton_percent_define_variables and
4078 b4_skeleton_percent_code_qualifiers.
4079 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
4080 Remove, and...
4081 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
4082 the skeleton names lists can finish building first. In place of
4083 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
4084 expect the lists b4_user_percent_define_variables and
4085 b4_user_percent_code_qualifiers.
4086 * data/c++.m4: Where setting default values for b4_parser_class_name,
4087 b4_location_type, b4_filename_type, b4_namespace, and
4088 b4_define_location_comparison, update their names to the
4089 b4_percent_define_ namespace.
4090 * data/glr.c: Don't use b4_check_percent_define_variables and
4091 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
4092 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
4093 (b4_parser_class_name, b4_namespace): Define these using
a4e25e1d 4094 b4_get_percent_define for parser_class_name and namespace.
6afc30cc
JD
4095 * data/location.cc: Use b4_get_percent_define.
4096 * data/push.c: Don't use b4_check_percent_define_variables and
4097 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
4098 * data/yacc.c: Likewise, and don't call m4_exit in
4099 b4_use_push_for_pull_if or m4_wrap code will never execute.
4100 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
4101 Rename to...
4102 (muscle_grow_user_name_list): ... this for consistency with the
4103 terminology used in bison.m4.
4104 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
4105 %define variable names, and rename muscle used_percent_define_variables
4106 to user_percent_define_variables.
4107 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
4108 user_percent_code_qualifiers.
4109 (content): Remove.
4110 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
4111 {CODE} form is no longer accepted.
4112 * tests/input.at (Reject bad %code qualifiers): Rename to...
4113 (Reject unused %code qualifiers): ... this, and update test output.
4114 (%define error): Update test output.
4115
7eb8a0bc
JD
41162007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
4117
4118 Check for unrecognized %define variables similar to checking for
4119 unrecognized %code qualifiers. Check for redefined %define variables.
4120 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
4121 generalizes...
4122 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
4123 (b4_check_percent_define_variables): New, also wraps it.
4124 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
4125 variables using b4_check_percent_define_variables.
4126 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
4127 all those exercised in the test suite and all those listed in the
4128 `Default values' section of c++.m4. Are there others?
4129 * data/push.c, data/yacc.c: Declare no valid %define variables.
4130 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
4131 similar to muscle_find, but it works even when the muscle stores a
4132 const value.
4133 (muscle_grow_used_name_list): New function for constructing the used
4134 name list muscles that b4_check_for_unrecognized_names requires.
4135 * src/parse-gram.y (prologue_declaration): Warn if a variable is
4136 %define'd more than once. Define the b4_used_percent_define_variables
4137 muscle with muscle_grow_used_name_list.
4138 (grammar_declaration): Abbreviate %code code with
4139 muscle_grow_used_name_list.
4140 * tests/input.at (%define errors): New.
4141
3fc65ead
JD
41422007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
4143
4144 Provide warn_at, complain_at, and fatal_at function callbacks to the
4145 skeletons, and use this for %code qualifier complaints.
4146 * data/bison.m4 (b4_error_at): New, invoked by...
4147 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
4148 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
4149 @fatal_at(...@) directives.
4150 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
4151 qualifiers in b4_used_percent_code_qualifiers and to use
4152 b4_complain_at.
4153 * src/location.c, src/location.h (boundary_set_from_string): New global
4154 function.
4155 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
4156 function.
4157 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
4158 to b4_used_percent_code_qualifiers.
4159 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
4160 function.
4161 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
4162 (lineno): Rename to...
4163 (out_lineno): ... this so I don't misunderstand it again.
4164 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
4165 here; these newlines are in the input but not the output file.
4166 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
4167 (at_directive_perform): ... this new static function, and add handling
4168 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
4169 directives.
4170 * tests/input.at (Reject bad %code qualifiers): Update test output with
4171 locations and extend.
4172
4173 * tests/output.at (Output file name: [, Output file name: ]): Remove
4174 bogus comment about these tests failing.
4175
1c7b7e1d
JD
41762007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
4177
4178 Clean up b4_check_percent_code_qualifiers a little.
4179 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
4180 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
4181 documentation and add examples.
4182 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
4183 qualifiers here.
4184
08af01c2
JD
41852007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
4186
4187 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
4188 unreliable -- especially when they're hidden inside another macro.
4189 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
4190 data/c.m4: Remove m4_divert(-1).
4191 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
4192 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
4193 m4_divert_push(0) and m4_divert_pop(0).
279cabb6 4194 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
08af01c2
JD
4195 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
4196 pushed and popped by m4sugar, should be first on the stack.
4197
4198 Provide warn, complain, and fatal function callbacks to the skeletons.
4199 This provides more flexibility than m4_fatal, improves the error
4200 message format, and captures messages for translation. Discussed
4201 starting at
4202 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
4203 * data/bison.m4 (b4_error): New, invoked by...
4204 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
4205 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
4206 directives. Because these M4 macros might be called when the current
4207 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
4208 the previous removal of uses of m4_divert, which caused trouble.
4209 (b4_check_percent_code_qualifiers): Use b4_complain instead of
4210 m4_fatal to report unrecognized %code qualifiers.
4211 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
4212 push parser requests.
4213 * data/glr.c: Use b4_complain instead of m4_fatal to report
4214 non-deterministic push parser requests.
4215 Update @output usage to @output(...@) form.
4216 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
4217 report missing %defines. Update @output usage to @output(...@) form.
4218 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
4219 @output(...@) form.
4220 * src/main.c (main): Invoke skel_scanner_free.
4221 * src/scan-skel.h (skel_scanner_free): Prototype new function.
4222 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
4223 obstack_for_string from flex-scanner.h.
4224 (YY_DECL): Use to declare skel_lex static.
4225 (decode_at_digraphs): Remove; now handled in the new
4226 SC_AT_DIRECTIVE_ARG start condition.
4227 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
4228 functions.
4229 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
4230 at_directive_argv): New static globals.
4231 (INITIAL): Use fail_for_invalid_at.
4232 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
4233 recognize the start of a generalized `@directive(...@)' form and
4234 start...
4235 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
4236 directive args (using the new obstack_for_string), to decode the
4237 contained @ diagraphs, and to perform the directive. It recognizes
4238 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
4239 @output(...@).
4240 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
4241 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
4242 `@,'.
4243 (scan_skel): Initialize obstack_for_string on the first call.
4244 (skel_scanner_free): New function to free obstack_for_string.
4245 * tests/input.at (Reject bad %code qualifiers): Update test output.
4246
8e0a5e9e
JD
42472007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
4248
4249 Consolidate the 4 prologue alternative directives (%code, %requires,
4250 %provides, and %code-top) into a single %code directive with an
4251 optional qualifier field. Discussed at
4252 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
4253 * NEWS (2.3a+): Rewrite the existing entry for the prologue
4254 alternatives.
4255 * doc/bison.texinfo (Prologue Alternatives): Update.
4256 (Decl Summary): Update to %code "requires" and %code "provides".
4257 (Calc++ Parser): Update to %code "requires".
148d66d8 4258 (Table of Symbols): Remove entries for %requires, %provides, and
8e0a5e9e
JD
4259 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
4260 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
4261 are replaced by b4_percent_code_provides and b4_percent_code_requires,
4262 which are skeleton-specific.
4263 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
4264 declare what %code qualifiers it supports and to complain if any other
4265 qualifiers were used in the grammar.
4266 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
4267 and b4_user_code([b4_percent_code_provides]) in place of
4268 b4_user_requires and b4_user_provides.
4269 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
4270 Add b4_user_code([b4_percent_code_top]) and
4271 b4_user_code([b4_percent_code]).
4272 Invoke b4_check_percent_code_qualifiers.
4273 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
4274 PERCENT_REQUIRES): Remove.
4275 (grammar_declaration): Remove RHS's for %code-top, %provides, and
4276 %requires. Rewrite the %code RHS as the unqualified form defining the
4277 muscle b4_percent_code. Add another RHS for the qualified %code form,
4278 which defines muscles of the form b4_percent_code_QUALIFIER and the
4279 b4_used_percent_code_qualifiers muscle.
4280 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
4281 PERCENT_REQUIRES): Remove.
4282 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
4283 %code "requires" and %code "provides".
4284 * tests/input.at (Reject bad %code qualifiers): New.
4285
95021767
JD
42862007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
4287
4288 Use the new code_props interface for destructors and printers.
4289 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
4290 printer_location members, and change the type of the destructor and
4291 printer members to code_props.
4292 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
4293 symbol_printer_get, semantic_type_destructor_set,
4294 semantic_type_printer_set, default_tagged_destructor_set,
4295 default_tagless_destructor_set, default_tagged_printer_set,
4296 default_tagless_printer_set): Use code_props in arguments and return
4297 types in place of char const * and location.
4298 (symbol_destructor_location_get, symbol_printer_location_get): Remove
4299 since the locations are now contained in the return of
4300 symbol_destructor_get and symbol_printer_get.
4301 * src/output.c (symbol_destructors_output, symbol_printers_output):
4302 Replace with...
4303 (symbol_code_props_output): ... this to eliminate duplicate code.
4304 (output_skeleton): Update to use symbol_code_props_output.
4305 * src/reader.c (symbol_should_be_used): Update use of
4306 symbol_destructor_get.
4307 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
4308 Update uses of the various _destructor_set and _printer_set functions.
4309 * src/symtab.c: (default_tagged_destructor_location,
4310 default_tagless_destructor_location, default_tagged_printer_location,
4311 default_tagless_printer_location): Remove since we...
4312 (default_tagged_destructor, default_tagless_destructor,
4313 default_tagged_printer, default_tagless_printer): ... change the type
4314 of these to code_props.
4315 (symbol_new, semantic_type_new, symbol_destructor_set,
4316 semantic_type_destructor_set, symbol_destructor_get,
4317 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
4318 symbol_check_alias_consistency, default_tagged_destructor_set,
4319 default_tagless_destructor_set, default_tagged_printer_set,
4320 default_tagless_printer_set): Update.
4321 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
4322 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
4323 code_props members.
4324 (symbol_print): Use SYMBOL_CODE_PRINT.
4325
f6857bbf
JD
43262007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
4327
4328 Use the new code_props interface for rule actions.
4329 * src/symlist.h (symbol_list): Replace action, action_location, and
4330 used members with a code_props action_props member.
4331 * src/reader.c (symbol_should_be_used, grammar_rule_check,
4332 grammar_midrule_action, grammar_current_rule_merge_set,
4333 grammar_current_rule_symbol_append, packgram): Update.
4334 * src/scan-code.h (translate_rule_action): Remove, no longer used.
4335 * src/scan-code.l (handle_action_dollar): Update.
4336 (translate_rule_action): Remove, no longer used.
4337 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
4338
7c0c6181
JD
43392007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
4340
4341 Use the new code_props interface in parse-gram.y.
4342 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
4343 Update all uses of translate_* functions to use the new code_props
4344 interface and to use gram_scanner_last_string_free and
4345 code_scanner_last_string_free where possible.
4346 (grammar_declaration): symbol_list_destructor_set and
4347 symbol_list_printer_set now perform the translation, so don't do it
4348 here. Use gram_scanner_last_string_free where possible.
4349 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
4350 translate_code): Remove, no longer used.
4351 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
4352 symbol_list_printer_set): Perform code translation here rather than
4353 depending on the caller to do so.
4354
4355 * src/symlist.h (struct symbol_list): Correct some documentation typos.
4356 * src/scan-gram.h (gram_last_string): Remove declaration.
4357 * src/scan-gram.l (last_string): Declare it static.
4358
28e52c0d
JD
43592007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
4360
4361 Encapsulate code properties and related functionality for the various
4362 destructors, printers, and actions into a code_props structure and
4363 interface. This patch merely implements code_props in scan-code.h and
4364 scan-code.l. Future patches will rewrite other modules to use it.
4365 Discussed starting at
4366 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
4367 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
4368 consistently initialize const structs that have an empty location
4369 field.
4370 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
4371 to ensure consistency.
4372 * src/scan-code.h (code_props): New structure.
4373 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
4374 function, macro, and const global variable for initializing a
4375 code_props with no code.
4376 (code_props_plain_init, code_props_symbol_action_init,
4377 code_props_rule_action_init, code_props_translate_code): The rest of
4378 the new code_props functional interface. Among other things, the init
4379 functions set the code_props kind field so that
4380 code_props_translate_code will know whether to behave like
4381 translate_symbol_action, translate_rule_action, or translate_code.
4382 These old translate functions must remain until all other modules are
4383 updated to use the new code_props interface.
4384 (code_scanner_last_string_free): New function similar to
4385 gram_scanner_last_string_free.
4386 (code_scanner_free): Add documentation.
4387 * src/scan-code.l: Implement the new interface.
4388 (code_lex): Make it static, add a code_props* argument, and remove the
4389 rule argument.
4390 (last_string): New static global similar to the one in scan-gram.l.
4391 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
4392 instead of rule.
4393 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
4394 code_props since Bison may one day use this information for destructors
4395 and printers.
4396 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
4397 (handle_action_dollar): Use symbol_list_n_get and set used flag
4398 directly since symbol_list_n_used_set is removed.
4399 (translate_action): Add a code_props* argument and remove the rule,
4400 action, and location arguments. Pass the code_props* on to code_lex.
4401 (translate_rule_action, translate_symbol_action, translate_code):
4402 Rewrite as wrappers around the new code_props interface.
4403 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
4404 it would eventually need to break the encapsulation of code_props.
4405
96034983
JD
44062007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
4407
4408 * etc/.cvsignore: New.
4409
945e396c
JD
44102007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
4411
4412 Add maintainer-push-check to run maintainer-check using push parsing in
4413 place of pull parsing where available.
4414 * Makefile.am (maintainer-push-check): New.
4415 * data/bison.m4 (b4_use_push_for_pull_if): New.
4416 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
4417 appropriately based on their existing values.
4418 (yypush_parse): Don't print push-parser-specific diagnostics if push
4419 parsing is being used in place of pull parsing.
4420 * data/yacc.c: If push parsing should replace pull parsing, redirect to
4421 push.c.
4422 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
4423 variable, and insert b4_use_push_for_pull_flag into muscles.
4424 * tests/Makefile.am (maintainer-push-check): New.
4425
7d596384
JD
44262006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
4427
4428 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
4429 (whether successful or failed) so that yypush_parse can be invoked
4430 again to start a new parse using the same yypstate.
4431 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
4432 check multiple yypull_parse invocations on the same yypstate. For pull
4433 mode, extend to check multiple yyparse invocations.
4434 (Exploding the Stack Size with Alloca): Extend to try with
4435 %push-pull-parser.
4436 (Exploding the Stack Size with Malloc): Likewise.
4437
4438 * tests/calc.at (Simple LALR Calculator): Don't specify
4439 %skeleton "push.c" since %push-pull-parser implies that now.
4440 * tests/headers.at (export YYLTYPE): Don't check for the push
4441 declarations. Otherwise, this test case can't be used to see if push
4442 mode can truly emulate pull mode.
4443 * tests/input.at (Torturing the Scanner): Likewise.
4444 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
4445 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
4446 AT_YACC_IF, which now includes the case of push mode since %skeleton
4447 need not be used for push mode. This will be more intuitive once
4448 push.c is renamed to yacc.c.
4449
7172e23e
JD
44502006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
4451
4452 For push mode, convert yyparse from a macro to a function, invoke yylex
4453 instead of passing a yylexp argument to yypull_parse, and don't
4454 generate yypull_parse or yyparse unless %push-pull-parser is declared.
4455 Discussed starting at
4456 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
4457 * data/bison.m4 (b4_pull_if): New.
4458 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
4459 * data/push.c: Improve M4 quoting a little.
4460 (b4_generate_macro_args, b4_parenthesize): Remove.
4461 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
4462 any time a pull parser is requested.
4463 Don't #define this as a wrapper around yypull_parse. Instead, when
4464 both push and pull are requested, make it a function that does that
4465 same thing.
4466 (yypull_parse): If there's a b4_prefix, #define this to
4467 b4_prefix[pull_parse] when both push and pull are requested.
4468 Don't define this as a function unless both push and pull are
4469 requested.
4470 Remove the yylexp argument and hard-code yylex invocation instead.
4471 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
4472 %push-parser.
4473 * src/getargs.c (pull_parser): New global initialized to true.
4474 * getargs.h (pull_parser): extern it.
4475 * src/output.c (prepare): Insert pull_flag muscle.
4476 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
4477 (prologue_declaration): Set both push_parser and pull_parser = true for
4478 %push-pull-parser. Set push_parser = true and pull_parser = false for
4479 %push-parser.
4480 * src/scan-gram.l: Don't accept %push_parser as an alternative to
4481 %push-parser since there's no backward-compatibility concern here.
4482 Scan %push-pull-parser.
4483 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
4484 instead of %push-parser.
4485 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
4486 prototype it in the module that calls yyparse.
4487 * tests/input.at (Torturing the Scanner): Likewise.
4488 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
4489
2e7944cb
JD
44902006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
4491
4492 Update etc/bench.pl. Optimize push mode a little (the yyn change
4493 deserves most of the credit).
4494 * Makefile.am (SUBDIRS): Add etc subdirectory.
4495 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
4496 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
4497 yytoken, yyval, and yyloc declarations to...
4498 (yyparse or yypush_parse): ... here to improve performance. For
4499 yypush_parse invocations after the first, be sure to assign yyn its old
4500 value again.
4501 (yypstate_new): Don't bother initializing the yyresult field since the
4502 initial value isn't used.
4503 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
4504 remove the #define that, in push mode, set it to yyps->NAME.
4505 * etc/Makefile.am: New.
4506 * etc/bench.pl: Remove and build it instead from...
4507 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
4508 "tests/bison" from the build directory by default rather than just
4509 invoking "bison" from $PATH.
4510 (calc_grammar): Update push parser code: don't declare yylval globally,
4511 don't define yyparse_wrapper, and don't #define yyparse.
4512 (bench_grammar): Update to check all working combinations of yacc.c,
4513 push.c, impure, pure, pull, and push.
4514
c3d50342
JD
45152006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
4516
4517 For push mode, add pull wrappers around yypush_parse.
4518 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
4519 (yypull_parse): New function wrapping yypush_parse.
4520 (yyparse): New #define wrapping yypull_parse.
4521 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
4522 is declared.
4523 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
4524 prototype yylex in the module that calls yyparse, and don't prototype
4525 yyparse there. Otherwise, the yyparse expansion won't compile.
4526 * tests/input.at (Torturing the Scanner): Likewise.
4527
94ebeba5
JD
45282006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
4529
4530 Enable push parsers to operate in impure mode. Thus, %push-parser no
4531 longer implies %pure-parser. The point of this change is to move
4532 towards being able to test the push parser code by running the entire
4533 test suite as if %push-parser had been declared.
4534 * data/push.c (yypush_parse): For impure mode, remove the
4535 yypushed_char, yypushed_val, and yypushed_loc arguments.
4536 Instead, declare these as local variables initialized to the global
4537 yychar, yylval, and yylloc.
4538 For the first yypush_parse invocation only, restore the initial values
4539 of these global variables when it's time to read a token since they
4540 have been overwritten.
4541 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
4542 %push-parser.
4543 * tests/calc.at (Simple LALR(1) Calculator): Always declare
4544 %pure-parser along with %push-parser since this test case was designed
4545 for pure push parsers.
4546 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
4547 (AT_YACC_OR_PUSH_IF): New.
4548 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
4549 add a note that it's still wrong for some cases (as it has been for a
4550 while).
4551 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
4552 %push-parser no longer implies %pure-parser.
4553
a0633178
JD
45542006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4555
4556 Remove some unnecessary differences between the pull parser code and
4557 the push parser code. This patch enables yynerrs in push mode.
4558 * data/push.c: Reformat M4 a little.
4559 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
4560 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
4561 because push mode is on. Instead, if pure mode is on, move yynerrs
4562 to...
4563 (b4_declare_parser_state_variables): ... here.
4564 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
4565 to yyps->NAME so it can be used in yypush_parse.
4566 (yypush_parse): Don't omit uses of yynerrs in push mode.
4567
8646b6a3
JD
45682006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4569
4570 Fix bug such that the first pushed token's value and location are
4571 sometimes overwritten (sometimes by %initial-action) before being used.
4572 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
4573 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
4574 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
4575 more closely mimic the pull parser logic.
4576 Don't copy the pushed token to yychar, yylval, and yylloc until it's
4577 time to read a token, which is after any initialization of yylval and
4578 yylloc.
4579 (gottoken): Rename label to...
4580 (yyread_pushed_token): ... for clarity and to avoid infringing on the
4581 user namespace.
4582
9baf4d74
JD
45832006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4584
4585 Rearrange initialization of the parser state variables so that the
4586 skeleton doesn't have to have a copy for pull mode and another for push
4587 mode. This patch also fixes at least a bug such that yylloc was not
4588 initialized (with b4_location_initial_line and
4589 b4_location_initial_column) upon calling yypush_parse. However, that
4590 initialization now overwrites the first token's location;
4591 %initial-action assigning @$ already did the same thing, and both bugs
4592 will be fixed in a later patch.
4593 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
4594 (b4_declare_parser_state_variables): Remove initialization of yytoken,
4595 yyss, yyvs, yyls, and yystacksize.
4596 (yypstate_new): Remove initialization of some yypstate fields: yystate,
4597 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
4598 yylsp.
4599 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
4600 yyps->NAME so it can be used in yypush_parse.
4601 (yyparse or yypush_parse): For yypush_parse, don't print the
4602 "Starting parse" diagnostic for invocations after the first.
4603 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
4604 yypush_parse, only do it for the first invocation.
4605 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
4606 initialization to occur in yypush_parse but only on the first
4607 invocation.
4608
23522164
JD
46092006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
4610
4611 * data/push.c: Add CPP guards around push parser declarations in both
4612 the header and the code file.
4613 In the code file, move the push parser declarations to the same place
4614 they appear in the header file.
4615 Clean up the M4 some, especially the inconsistent underquoting in
4616 some b4_c_function_def and b4_c_function_decl uses.
4617
bb010fe5
JD
46182006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
4619
4620 Encapsulate the push parser state variables into an M4 macro so the
4621 push skeleton doesn't have to list them again for pull mode's yyparse.
4622 For push mode, remove yypush_parse's local equivalents of these
4623 variables to eliminate unnecessary copying between the two sets at
4624 run-time. This patch also fixes at least a bug related to multiple
4625 %initial-action invocations in push mode.
4626 * data/push.c (b4_declare_parser_variables): Rename to...
4627 (b4_declare_scanner_communication_variables): ... this for clarity and
4628 update both uses.
4629 (b4_declare_yyparse_variables): Remove and move its contents to the one
4630 spot where it was invoked.
4631 (b4_declare_parser_state_variables): New macro containing the parser
4632 state variables required by push mode.
4633 (struct yypstate): Replace all fields but yynew with
4634 b4_declare_parser_state_variables.
4635 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
4636 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
4637 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
4638 (yyparse or yypush_parse): For yyparse in pull mode, replace local
4639 parser state variable declarations with
4640 b4_declare_parser_state_variables.
4641 Don't initialize parser state variables when calling yypush_parse since
4642 yypstate_new already does that.
4643 Invoke the user's initial action only upon the first yypush_parse
4644 invocation.
4645 Remove all code that copies between the local parser state variables
4646 and the yypstate.
4647
2d212f8c
JD
46482006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
4649
4650 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
4651 prevent a name collision in a future patch where these names will
4652 sometimes be #define'd.
4653 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
4654 since it no longer has the same name as the existing argument.
4655 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
4656
e6e704dc
JD
46572006-12-19 Paolo Bonzini <bonzini@gnu.org>
4658 and Joel E. Denny <jdenny@ces.clemson.edu>
4659
4660 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
4661 that the argument is case-insensitive, and there's no `=' here.
4662 For the %skeleton entry, mention that %language is better.
4663 (Bison Options): Likewise for --language and --skeleton. Move the
4664 --skeleton entry so that the `Tuning the parser' section is sorted
4665 alphabetically on long options.
4666 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
4667 %language directive in detail here; cross-reference the %language
4668 documentation instead.
4669 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
4670 `%require "2.3b"' so that the example is always up-to-date.
148d66d8 4671 (Table of Symbols): Add entries for %language and %skeleton.
e6e704dc
JD
4672 * examples/extexi (normalize): Instead of replacing every %require
4673 argument with the current Bison version, just substitute for
4674 `@value{VERSION}'. This guarantees that we're testing what actually
4675 appears in the documentation.
4676 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
4677 rather than `@VERSION@'.
4678
0e021770
PE
46792006-12-18 Paul Eggert <eggert@cs.ucla.edu>
4680
fd575f05
PE
4681 * NEWS: Reword the %language news a bit, and put it earlier.
4682
0e021770
PE
4683 * src/getargs.c (skeleton_arg): Last arg is now location const *.
4684 Rewrite to simplify the logic.
4685 (language_argmatch): Likewise.
fd575f05
PE
4686 (program_name): We now own this var.
4687 * src/getargs.h (struct bison_language): Use char[] rather than
4688 const char *.
0e021770
PE
4689
4690 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
4691 Java is supported.
4692 * src/complain.c (program_name): Remove decl; no longer needed.
4693 * src/main.c (program_name): Remove; now belongs to getargs.
4694
46952006-12-18 Paolo Bonzini <bonzini@gnu.org>
4696
4697 * NEWS: Document %language.
4698
4699 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
4700
4701 * data/c-skel.m4, data/c++-skel.m4: New files.
4702 * data/glr.c: Complain on push parsers.
4703
4704 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
4705 over %skeleton.
148d66d8 4706 (Decl Summary): Document %language and %skeleton.
0e021770
PE
4707 (Command line): Document -L.
4708
4709 * examples/extexi: Rewrite %require directive.
4710 * examples/calc++/Makefile.am: Pass VERSION to extexi.
4711
4712 * src/files.c (compute_exts_from_gc): Look in language structure
4713 for .y extension.
4714 (compute_file_name_parts): Check whether .tab should be added.
4715 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
4716 (language, skeleton_arg, language_argmatch): New.
4717 (long_options): Add --language.
4718 (getargs): Use skeleton_arg, add -L/--language.
4719 * src/getargs.h: Include location.h.
4720 (struct bison_language, language, skeleton_arg, language_argmatch): New.
4721 * src/output.c (prepare): Pick default skeleton from struct language.
4722 Don't dispatch C skeletons here.
4723 * src/parse-gram.y (PERCENT_LANGUAGE): New.
4724 (prologue_declaration): Add "%language" rule, use skeleton_arg.
4725 * src/scan-gram.l ("%language"): New rule.
4726
4727 * tests/calc.at: Test %skeleton and %language.
4728 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
4729 (AT_GLR_IF): Look for %skeleton "glr.cc".
4730 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
4731 (AT_YACC_IF): Reject %language.
4732
5691bf57
PE
47332006-12-18 Paul Eggert <eggert@cs.ucla.edu>
4734
db06f0ce
PE
4735 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
4736 since it wasn't used; only the typedef name 'semantic_type' is needed.
4737 Also, omit trailing white space.
4738
5691bf57
PE
4739 * bootstrap: Sync from coreutils.
4740 (gnulib_extra_files): Add build-aux/announce.gen.
4741 (slurp): Adjust .gitignore files like .cvsignore files.
4742 * build-aux/announce-gen: Remove from CVS, since bootstrap
4743 now creates this.
4744
791934e4
JD
47452006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
4746
4747 Make %push-parser imply %pure-parser. This fixes several bugs; see
4748 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
4749 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
4750 pure_parser = true.
4751 * data/push.c: Don't bother testing b4_push_if when deciding whether
4752 to expand b4_declare_parser_variables globally.
4753 (yypush_parse): Likewise in here.
4754
4755 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
4756 (yy_reduce_print): Reformat M4 for readability.
4757
ee5abb37
JD
47582006-12-15 Bob Rossi <bob@brasko.net>
4759 and Joel Denny <jdenny@ces.clemson.edu>
4760
4761 * data/push.c (yypstate): Add typedef, and update all uses of
4762 struct yypstate to just yypstate.
4763 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
4764
16ca01f9
JD
47652006-12-14 Bob Rossi <bob@brasko.net>
4766
4767 * data/push.c (yypush_parse): Declare prototype regardless of
4768 %locations option.
4769
ab8e7e1a
JD
47702006-12-14 Bob Rossi <bob@brasko.net>
4771
4772 * data/push.c (yyparse): Remove the prototype and the #define when in
4773 push-parser mode.
4774
9bf32be3
JD
47752006-12-13 Bob Rossi <bob@brasko.net>
4776
4777 * data/push.c (yypstate_init): Rename to...
4778 (yypstate_new): ... this and use b4_c_function_def.
4779 (yypstate_delete): New.
4780 (yypush_parse): Change parameters yynval and yynlloc to be const.
4781 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
4782 yypstate_delete functions.
4783
f02e2948
JD
47842006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
4785
4786 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
4787 strange test case titles. Reported by Bob Rossi.
4788
38eb7751
PE
47892006-12-13 Paul Eggert <eggert@cs.ucla.edu>
4790
4791 * TODO: Add pointer to Sylvain Schmitz's work on static detection
4792 of potential ambiguities in GLR grammers.
4793
bd9d212b
JD
47942006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
4795
4796 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
4797 `bison ', use m4_index instead of m4_substr since chopping up a string
4798 containing M4-special characters causes problems here.
4799
4800 Fix a couple of bugs related to special characters in user-specified
4801 file names, and make it easier for skeletons to compute output file
4802 names with the same file name prefix as Bison-computed output file
4803 names.
4804 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
4805 b4_parser_file_name and b4_spec_defines_file instead of
4806 @output_parser_name@ and @output_header_name@, which are now redundant.
4807 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
4808 b4_parser_file_name, b4_spec_defines_file, and the new
4809 @basename(FILENAME@) instead of @output_parser_name@ and
4810 @output_header_name@, which inappropriately escaped the file names as
4811 C string literals.
4812 * src/files.c (all_but_ext): Remove static qualifier.
4813 (compute_output_file_names): Move `free (all_but_ext)' to...
4814 (output_file_names_free): ... here since all_but_ext is needed later.
4815 * src/files.h (all_but_ext): Extern.
4816 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
4817 exactly what MUSCLE_INSERT_STRING used to do.
4818 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
4819 characters are escaped properly.
4820 * src/output.c (prepare): Define muscle file_name_all_but_ext as
4821 all_but_ext.
4822 For pkgdatadir muscle, maintain previous functionality by using
4823 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
4824 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
4825 digraphs would never be expanded. Hopefully no one has M4-special
4826 characters in his Bison installation path.
4827 * src/scan-skel.l: Don't parse @output_header_name@ and
4828 @output_parser_name@ anymore since they're now redundant.
4829 In @output, use decode_at_digraphs.
4830 Parse a new @basename command that invokes last_component.
4831 (decode_at_digraphs): New.
4832 (BASE_QPUTS): Remove unused.
4833 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
4834 (Output file name): New tests.
4835
3f7ca628
JD
48362006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
4837
4838 Warn about output files that are generated by the skeletons and that
4839 conflict with other output files.
4840 * data/glr.c: Don't generate the header file here when glr.cc does.
4841 * src/files.c (file_names, file_names_count): New static globals.
4842 (compute_output_file_names): Invoke output_file_name_check for files
4843 not generated by the skeletons and remove existing checks.
4844 (output_file_name_check): New function that warns about conflicting
4845 output file names.
4846 (output_file_names_free): Free file_names.
4847 * src/files.h (output_file_name_check): Declare.
4848 * src/scan-skel.l: Invoke output_file_name_check for files generated by
4849 the skeletons.
4850 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
4851 (Conflicting output files): New tests.
4852
178e123e
PE
48532006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4854
4855 * doc/bison.texinfo: Fix a couple of typos.
4856
48572006-12-08 Bob Rossi <bob@brasko.net>
8def5cd0
JD
4858
4859 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
4860 Rename to...
4861 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
4862 update all uses.
4863 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
4864 (yypush_parse): Rename yypvars argument to yyps and remove redundant
4865 local pv.
4866 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
4867 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
4868
ea17f233
JD
48692006-12-07 Bob Rossi <bob@brasko.net>
4870 and Joel Denny <jdenny@ces.clemson.edu>
4871
4872 * data/push.c (yypvarsinit): Change return type from void* to struct
4873 yypvars*. No longer cast to void* on return.
4874 (struct yypvars): Remove yylen since it need not be remembered between
4875 yypushparse invocations.
4876 (yypushparse): Don't copy between yylen and pv->yylen.
4877
55a30bda
JD
48782006-12-05 Bob Rossi <bob@brasko.net>
4879
4880 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
4881 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
4882 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
4883 (struct yypvars): Remove b4_declare_parser_variables.
4884 (yypvarsinit): Remove init code for removed variables.
4885 (global scope): Do not declare b4_declare_parser_variables if
4886 push or pure mode.
4887 (yypushparse): Add b4_declare_parser_variables.
4888 Init new local variables, and remove init code for removed
4889 yypvars variables.
4890 (yyparse): Delete.
4891 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
4892 and yyparse for other modes.
4893 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
4894 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
4895 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
4896 (AT_PURE_LEX_IF): True if pure or push parser.
4897
85894313
JD
48982006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
4899
4900 Document Yacc prologue alternatives and default %destructor's and
4901 %printer's as experimental. Don't mention Java yet. Discussed at
4902 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
4903 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
4904 (2.3a): Annotate this entry to say the old forms of these features were
4905 also experimental.
4906 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
148d66d8 4907 Table of Symbols): Say they're experimental. Comment out any mention
85894313
JD
4908 of Java (we'll want this back eventually).
4909
02975b9a
JD
49102006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
4911
4912 Support a file name argument to %defines. Deprecate `=' in
4913 %file-prefix, %name-prefix, and %output. Discussed at
4914 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
4915 * NEWS (2.3a+): Mention.
148d66d8 4916 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
02975b9a
JD
4917 form of %defines, and remove `=' from entries for %file-prefix,
4918 %name-prefix, and %output.
4919 * src/parse-gram.y (prologue_declaration): Implement.
4920 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
4921 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
4922 all but one occurrence of %name-prefix.
4923 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
4924 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
4925 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
4926 occurrence of each of %file-prefix and %output. Add check for %defines
4927 with argument.
4928 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
4929 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
4930 Remove the `=' from %output.
4931
287b314e
JD
49322006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
4933
4934 Don't escape $ in test case titles since Autoconf 2.61 now does that
4935 correctly.
4936 * tests/actions.at (Default %printer and %destructor are not for error
4937 or $undefined): Here.
4938 (Default %printer and %destructor are not for $accept): Here.
4939 * tests/input.at (Invalid $n and @n): Here.
4940
3ebecc24
JD
49412006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
4942
4943 Rename <!> to <>. Discussed starting at
4944 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
4945 * NEWS (2.3a+): Update.
148d66d8 4946 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
3ebecc24
JD
4947 Update.
4948 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
4949 * src/scan-gram.l (INITIAL): Implement.
4950 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
4951 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
4952 comment.
4953 * tests/actions.at (Default tagless %printer and %destructor,
4954 Default tagged and per-type %printer and %destructor,
4955 Default %printer and %destructor are not for error or $undefined,
4956 Default %printer and %destructor are not for $accept,
4957 Default %printer and %destructor for mid-rule values): Update.
4958 * tests/input.at (Default %printer and %destructor redeclared,
4959 Unused values with default %destructor): Update.
4960
26b8a438
JD
49612006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
4962
4963 Don't let %prec take a nonterminal.
4964 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
4965 token.
4966 * tests/input.at (%prec takes a token): New test checking that %prec
4967 won't take a nonterminal.
4968
07c39ae9
JD
49692006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
4970
405d53b7
JD
4971 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
4972 it was double-quoted.
07c39ae9
JD
4973 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
4974 grammar is maintained with Bison's highest standards.
4975 * src/getargs.c: Fix some typos in Doxygen comments.
4976
580b8926
JD
49772006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
4978
4979 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
4980 later. Reported by Paul Eggert in
4981 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
4982 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
4983 * src/scan-code.l (translate_action): Don't bother invoking
4984 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
4985 (code_scanner_free): Instead of invoking
4986 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
4987 which frees more.
4988 * src/scan-gram.l (gram_scanner_free): Likewise.
4989 * src/scan-skel.l (scan_skel): Likewise.
4990
4502eadc
JD
49912006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
4992
4993 * src/files.c (tr): Change return type to void.
4994 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
4995 has been called previously for the same key.
4996 (muscle_find): Return storage instead of value so that
4997 --enable-gcc-warnings doesn't produce warnings that the return discards
4998 const. aver that the value and storage are the same since storage
4999 could potentially be NULL when value is not.
5000 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
5001 same as 0.
5002
7746c8f6
PE
50032006-11-08 Paul Eggert <eggert@cs.ucla.edu>
5004
5005 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
5006 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
5007 us a slightly cleaner distribution, and also works.
5008 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
5009 gnulib changes.
5010
eb095650
PE
50112006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
5012 and Paul Eggert <eggert@cs.ucla.edu>
5013
5014 Don't let Bison leak memory except when it complains.
5015 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
5016 (spec_defines_file, dir_prefix): Now char *, not const char *,
5017 since they are freed.
5018 * src/files.c: Likewise.
5019 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
5020 Likewise.
5021 (tr): Now operates in-place. All uses changed.
5022 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
5023 values.
5024 (compute_file_name_parts, compute_output_file_names): Don't store
5025 read-only data in variables that will be freed.
5026 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
5027 src_extension, and header_extension.
5028 (output_file_names_free): New public function to free
5029 spec_verbose_file, spec_graph_file, spec_defines_file,
5030 parser_file_name, and dir_prefix.
5031 * src/getargs.c (getargs): Don't store read-only data in variables that
5032 will be freed.
5033 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
5034 (which previously existed but was unused), and quotearg_free.
5035 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
5036 * src/muscle_tab.c: Likewise.
5037 (muscle_entry): Make the value char const *,
5038 and add a new storage member that is char * and can be freed.
5039 (muscle_entry_free): New private function.
5040 (muscle_init): Use it instead of free.
5041 (muscle_insert, muscle_grow): Update and use new storage member.
5042 (muscle_code_grow): Free the string passed to muscle_grow
5043 since it's not needed anymore.
5044 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
5045 add a new `char *code' member.
5046 ("{...}"): Declare semantic type as code.
5047 * src/scan-code.h (translate_rule_action):
5048 (translate_symbol_action, translate_code, translate_action): Return
5049 `char const *' rather than `char *' since external code should not free
5050 these strings.
5051 * src/scan-code.l: Likewise.
5052 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
5053 which is "{...}" in the parser.
5054 * tests/Makefile.am (maintainer-check-valgrind): Set
5055 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
5056 Valgrind.
5057 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
5058 complain.
5059 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
5060 expecting a non-zero exit status sets --leak-check=summary and
5061 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
5062 this case, and we don't want to hear about it.
5063
ac564be4
PE
50642006-11-08 Paul Eggert <eggert@cs.ucla.edu>
5065
5066 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
5067 instead of from the template, to simplify configuration a bit.
5068 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
5069 and m4/wint_t.m4, as they are needed with the latest gnulib.
5070
17bd8a73
JD
50712006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
5072
5073 Disable unset/unused mid-rule value warnings by default, and recognize
5074 --warnings=midrule-values to enable them. Discussed starting at
5075 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
5076 * NEWS (2.3a+): Mention.
5077 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
5078 warnings): Add entry for midrule-values subargument.
5079 * src/reader.c (symbol_should_be_used): Don't return true just because
5080 the value is a set/used mid-rule value unless
5081 --warnings=midrule-values was specified.
5082 * tests/input.at (Unused values, Unused values before symbol
5083 declarations): Run tests with and without --warnings=midrule-values.
5084
5085 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
5086 than LIST_FREE directly.
5087
89eb3c76
JD
50882006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
5089
5090 Finish implementing --warnings=error, which should not be implied by
5091 --warnings=all (or by its synonyms -W and --warnings without
5092 subarguments).
5093 * src/complain.c (set_warning_issued): New function to report that
5094 warnings are being treated as errors and to record an error if so.
5095 Invoke...
5096 (warn_at, warn): ... here.
5097 * src/getargs.c (warnings_args, warnings_types): Reorder so that
5098 "error - warnings are errors" does not appear above "all - all of the
5099 above".
5100 (getargs): For -W and --warnings without subarguments, don't let
5101 FLAGS_ARGMATCH set warnings_error in warnings_flag.
5102 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
5103
ba7560e2
JD
51042006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
5105
5106 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
5107 empty subargument list. For example: `bison --warnings= parser.y'.
5108
31283fc3
JD
51092006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
5110
5111 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
5112 the parser header file so that gcc doesn't warn.
5113
12e35840
JD
51142006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
5115
5116 Split the default %destructor/%printer into two kinds: <*> and <!>.
5117 Discussed starting at
5118 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
5119 * NEWS (2.3a+): Mention.
5120 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
5121 previous change today related to mid-rules.
148d66d8 5122 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
3ebecc24 5123 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
12e35840
JD
5124 (TYPE_TAG_ANY): Add as <*>.
5125 (TYPE_TAG_NONE): Add as <!>.
5126 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
5127 for <*> and <!>.
5128 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
5129 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
5130 * src/symlist.c (symbol_list_default_new): Split into tagged and
5131 tagless versions.
5132 (symbol_list_destructor_set, symbol_list_printer_set): Split
5133 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
5134 SYMLIST_DEFAULT_TAGLESS.
5135 * src/symlist.h: Update symbol_list_default*_new prototypes.
5136 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
5137 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
5138 * src/symtab.c (default_destructor, default_destructor_location,
5139 default_printer, default_printer_location): Split each into tagged and
5140 tagless versions.
5141 (symbol_destructor_get, symbol_destructor_location_get,
5142 symbol_printer_get, symbol_printer_location_get): Implement tagged
5143 default and tagless default cases.
5144 (default_destructor_set, default_printer_set): Split each into tagged
5145 and tagless versions.
5146 * src/symtab.h: Update prototypes.
5147 * tests/actions.at (Default %printer and %destructor): Rename to...
5148 (Default tagless %printer and %destructor): ... this, and extend.
5149 (Per-type %printer and %destructor): Rename to...
5150 (Default tagged and per-type %printer and %destructor): ... this, and
5151 extend.
5152 (Default %printer and %destructor for user-defined end token): Extend.
5153 (Default %printer and %destructor are not for error or $undefined):
5154 Update.
5155 (Default %printer and %destructor are not for $accept): Update.
5156 (Default %printer and %destructor for mid-rule values): Extend.
5157 * tests/input.at (Default %printer and %destructor redeclared): Extend.
5158 (Unused values with default %destructor): Extend.
5159
f91b1629
JD
51602006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
5161
5162 Don't apply the default %destructor/%printer to an unreferenced midrule
5163 value. Mentioned at
5164 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
5165 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
5166 like $@n instead of just @n so that the default %destructor/%printer
5167 logic doesn't see them as user-defined symbols.
5168 (symbol_is_dummy): Check for both forms of the name.
5169 * src/reader.c (packgram): Remove the `$' from each midrule symbol
5170 name for which the midrule value is referenced in any action.
5171 * tests/actions.at (Default %printer and %destructor for mid-rule
5172 values): New test.
5173 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
5174 for change to dummy symbol names.
5175
519d0004
JD
51762006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
5177
5178 Warn about unset midrule $$ if the corresponding $n is used.
5179 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
5180 $n usage.
5181 (packgram): Before invoking grammar_rule_check on any rule, make sure
5182 all actions have already been scanned in order to set `used' flags.
5183 Otherwise, checking that a midrule's $$ is set will not always work
5184 properly because the midrule check must forward-reference the midrule's
5185 parent rule.
5186 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
5187 warning.
5188
a501eca9
JD
51892006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
5190
5191 More improvements to the documentation of the prologue alternatives:
5192 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
5193 Bison manual.
5194 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
5195 some text to clarify the relative importance of the new directives and
5196 to show how these directives may be viewed as code labels.
5197
2cbe6b7f
JD
51982006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
5199
5200 Similar to the recently removed %before-header, add %code-top as the
5201 alternative to the pre-prologue. Mentioned at
5202 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
5203 Also, let the prologue alternatives appear in the grammar section.
5204 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
5205 (prologue_declaration): Move the existing prologue alternatives to...
5206 (grammar_declaration): ... here and add %code-top.
5207 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
5208
5209 Clean up and extend documentation for the prologue alternatives.
5210 * NEWS (2.3a+): Describe prologue alternatives.
5211 * doc/bison.texinfo (Prologue): Move discussion of prologue
5212 alternatives to...
5213 (Prologue Alternatives): ... this new section, and extend it to discuss
5214 all 4 directives in detail.
148d66d8
JD
5215 (Table of Symbols): Clean up discussion of prologue alternatives and
5216 add %code-top.
2cbe6b7f 5217
e557d3ea
JMG
52182006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5219
5220 DJGPP specific issues.
5221
5222 * djgpp/config.bat: config.hin has been moved to lib. Adjust
5223 config.bat accordingly.
5224 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
5225 * djgpp/config.site: Likewise.
5226
136a0f76
PB
52272006-10-16 Paolo Bonzini <bonzini@gnu.org>
5228
27bd5d67
PB
5229 Replace %*-header with %provides, %requires, %code. See discussion at
5230 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
5231
136a0f76
PB
5232 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
5233 (b4_user_start_header): Remove.
5234 * data/glr.c: Use new macros instead of b4_*start_header
5235 and b4_*end_header.
5236 * data/glr.cc: Likewise.
5237 * data/lalr1.cc: Likewise.
5238 * data/push.c: Likewise.
5239 * data/yacc.c: Likewise.
5240
5241 * doc/bison.texinfo: Remove %before-header, rename
5242 %{start,end,after}-header to %requires, %provides, %code.
5243
5244 * src/parse-gram.y: Likewise (also rename token names accordingly).
5245 * src/scan-gram.l: Likewise.
5246 * tests/actions.at: Likewise.
5247
10f429ef
PE
52482006-10-14 Paul Eggert <eggert@cs.ucla.edu>
5249
5250 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
5251 Problem reported by Joel E. Denny.
5252
52532006-10-14 Jim Meyering <jim@meyering.net>
5254
5255 (Sync from coreutils.)
5256 Work also when the working directory (with e.g. coreutils sources)
5257 is version controlled with git, rather than CVS.
5258 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
5259 rather than CVS.
5260 In messages and comments, say e.g., "checked-out sources",
5261 rather than "CVS sources".
5262 (version_controlled_file): New function. Work for git as well as
5263 for CVS. Don't use grep's -q option.
5264 (slurp): Call it here, in place of CVS-specific code.
5265
c4bd5bf7
JD
52662006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
5267
5268 Fix testsuite for ./configure --enable-gcc-warnings:
5269 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
5270 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
5271 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
5272 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
5273 * test/regression.at (Diagnostic that expects two alternatives):
5274 Likewise.
5275
46356ea4
PE
52762006-10-12 Paul Eggert <eggert@cs.ucla.edu>
5277
231ed89a
PE
5278 * bootstrap.conf (gnulib_modules): Add config-h.
5279 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
5280 worry about HAVE_CONFIG_H.
5281 * lib/abitset.c: Likewise.
5282 * lib/bitset.c: Likewise.
5283 * lib/bitset_stats.c: Likewise.
5284 * lib/bitsetv-print.c: Likewise.
5285 * lib/bitsetv.c: Likewise.
5286 * lib/ebitset.c: Likewise.
5287 * lib/get-errno.c: Likewise.
5288 * lib/lbitset.c: Likewise.
5289 * lib/subpipe.c: Likewise.
5290 * lib/timevar.c: Likewise.
5291 * lib/vbitset.c: Likewise.
5292 * lib/bitset.c: Include "bitset.h" first, to test interface.
5293 * lib/bitset_stats.c: Include "bitset_stats.h" first.
5294 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
5295 * lib/bitsetv.c: Include "bitsetv.h" first.
5296 * lib/get-errno.c: Include "get-errno.h" first.
5297 * m4/.cvsignore: Add config-h.m4.
5298 * tests/actions.at (Default %printer and %destructor for ...):
5299 Adjust expected line numbers in output to reflect removal of #if
5300 HAVE_CONFIG_H lines.
5301 * tests/glr-regression.at (Missed %merge type warnings when ...):
5302 Likewise.
5303 * tests/regression.at (Braced code in declaration in rules section):
5304 Likewise.
5305 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
5306 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
5307 Include <config.h> unconditionally.
5308
46356ea4
PE
5309 * bootstrap: Sync from coreutils, as follows:
5310
5311 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
5312
5313 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
5314 variable was sometimes used without being initialized. This
5315 messed up the installation of the INSTALL file in some cases.
5316
5317 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
5318
5319 * bootstrap (usage, main program, symlink_to_gnulib): Add option
5320 --copy. Inspired by a suggestion from Bruno Haible.
5321
5322 2006-10-03 Jim Meyering <jim@meyering.net>
5323
5324 * bootstrap: Undo last change to this file, since now gnulib-tool
5325 sticks with the automake default in generating dependencies.
5326
dd4bf078
PE
53272006-10-12 Paul Eggert <eggert@cs.ucla.edu>
5328
cf2a5f7c
PE
5329 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
5330 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
5331
5332 * doc/bison.1: Add copyright notice.
5333
5334 * data/glr.c: Don't include <stdarg.h>; not used.
5335
35fe0834
PE
5336 * NEWS: The -g and --graph options now output graphs in Graphviz
5337 DOT format, not VCG format.
5338 * doc/bison.1: Likewise.
5339 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
fcab4a2e
PE
5340 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
5341 of this change in
5342 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
35fe0834
PE
5343 * TODO: Remove Graphviz entry.
5344 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
5345 remove vcg.c, vcg.h, vcg_defaults.h.
5346 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
5347 * src/graphviz.c, src/graphviz.h: New files.
5348 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
5349 * src/files.h: Make comment more generic.
5350 * src/main.c (main): Likewise.
5351 * src/print_graph.h: Likewise.
5352 * src/getargs.c (usage): Make usage description more generic.
5353 * src/print_graph.c: Include graphviz.h rather than vcg.h.
5354 (static_graph, fgraph): Remove. All uses changed to pass
5355 arguments instead of sharing a static var.
5356 (print_core, print_actions, print_state, print_graph):
5357 Output graphviz format rather than VCG format.
5358 * tests/.cvsignore: Remove *.vcg; add *.dot.
5359 * tests/output.at: Expect *.dot files, not *.vcg files.
5360
dd4bf078
PE
5361 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
5362 accommodates the 2006-10-08 change.
5363
efdd7421
PE
53642006-10-11 Bob Rossi <bob@brasko.net>
5365
5366 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
5367 (b4_yyssa, b4_yyerror_range): New macros.
5368 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
5369 (yypvarsinit): Remove init of removed fields.
5370 (yypushparse): Remove use of removed fields; use new macros instead.
5371
96a1981a
PE
53722006-10-11 Paul Eggert <eggert@cs.ucla.edu>
5373
5374 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
5375 in a push parser. Reindent slightly to match yacc.c better.
5376
53772006-10-11 Bob Rossi <bob@brasko.net>
5378
46356ea4
PE
5379 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
5380 yymsg_alloc fields.
5381 (yypvarsinit, yypushparse): Remove init of removed fields.
5382 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
96a1981a 5383
c1630a8b
PE
53842006-10-09 Paul Eggert <eggert@cs.ucla.edu>
5385
5386 * THANKS: Add Paolo Bonzini and Bob Rossi.
5387
90b9908d
PB
53882006-10-08 Paolo Bonzini <bonzini@gnu.org>
5389
5390 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
5391 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
5392 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
5393 b4_define_user_cde and uses): Remove.
5394 (b4_comment, b4_prefix, b4_sync_start): New.
5395 * data/bison.m4: New file, with most of the content removed from c.m4.
5396 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
5397 * src/output.c (output_skeleton): Pass bison.m4.
5398 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
5399 only if specified.
5400
cf806753
PE
54012006-10-05 Paul Eggert <eggert@cs.ucla.edu>
5402
5403 Fix test failure reported by Tom Lane in
5404 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
5405 and try to make such failures easier to catch in the future.
5406 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
5407 that's now the caller's responsibility.
5408 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
5409 Set yychar = YYEOF if it's negative.
5410 * tests/actions.at (yylex): Abort if asked to read past EOF.
5411 * tests/conflicts.at (yylex): Likewise.
5412 * tests/cxx-type.at (yylex): Likewise.
5413 * tests/glr-regression.at (yylex): Likewise.
5414 * tests/input.at (yylex): Likewise.
5415 * tests/regression.at (yylex): Likewise.
5416 * tests/torture.at (yylex): Likewise.
5417
0e2f006a
PE
54182006-10-01 Paul Eggert <eggert@cs.ucla.edu>
5419
5420 Fix problems with translating English-language diagnostics.
5421 * bootstrap: Fix bug introduced in recent bootstrap changes, with
5422 respect to bison-runtime pot generation. The YY_ stuff
5423 wasn't being captured.
5424 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
5425 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
5426 * runtime-po/POTFILES.in: Add data/push.c.
5427
e3ddc1e3
PE
54282006-09-29 Paul Eggert <eggert@cs.ucla.edu>
5429
5430 Merge bootstrap changes from coreutils.
5431
5432 2006-09-28 Jim Meyering <jim@meyering.net>
5433
5434 Automatically generated dependencies are important even
5435 when all of the sources in a directory come from gnulib.
5436 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
5437 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
5438
5439 2006-09-23 Jim Meyering <jim@meyering.net>
5440
5441 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
5442
5443 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
5444
5445 * bootstrap: Add support for --force.
5446 (usage): New function. Describe usage less tersely.
5447 (CVS_only_file): New var.
5448
01e972b3
PE
54492006-09-21 Paul Eggert <eggert@cs.ucla.edu>
5450
5451 * data/push.c (YYPUSH_MORE): Make it an enum instead.
5452 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
5453 Adjust white space and comments to match GNU style better.
5454
c63d3e90
PE
54552006-09-20 Bob Rossi <bob@brasko.net>
5456
5457 * data/push.c (yyresult_get): Remove function.
5458 (YYPUSH_MORE): Add #define.
5459 (yypushparse): Modify return value.
5460
e70f46d1
PE
54612006-09-20 Paul Eggert <eggert@cs.ucla.edu>
5462
5463 * stamp-h.in: Remove; no longer needed.
5464 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
5465 Remove config.h, config.hin, intl (no longer created).
5466 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
5467 stamp-h1.
5468
5469 Sync bootstrap from coreutils, as follows:
5470
5471 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
5472
5473 * bootstrap (symlink_to_gnulib): New function.
5474 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
5475 to copies-of-gnulib.
5476 (cp_mark_as_generated, slurp, gnulib_files):
5477 Avoid making a copy if it's the same as the old version.
5478 (gnulib_files): Add support for this variable (used by Bison).
5479
a92be413
PE
54802006-09-20 Paul Eggert <eggert@cs.ucla.edu>
5481
5482 * src/getargs.c (usage): Rework to use conventions similar to
5483 coreutils, to make translation a bit easier and the code a bit
5484 smaller. Problem reported by Tim Van Holder.
5485
4f82b42a
PE
54862006-09-15 Paul Eggert <eggert@cs.ucla.edu>
5487
3b2942e6
PE
5488 Use some of gnulib's new modules, taken from coreutils.
5489
5490 * bootstrap: Sync from coreutils, except add support for gnulib_files.
5491 * bootstrap.conf: New file.
5492 (gnulib_modules): Add configmake, inttypes, unistd.
5493 (XGETTEXT_OPTIONS): Add complain, complain_at,
5494 fatal, fatal_at, warn, warn_at, unexpected_end.
5495 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
5496 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
5497 (gl_EARLY): Add.
5498 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
5499 (gl_INIT): Add
5500 (GNULIB_AUTOCONF_SNIPPET): Remove.
5501 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
5502 the pickiest.
5503 * lib/.cvsignore: Add inttypes_.h.
5504 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
5505 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
5506 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
5507 no-longer-necessary initializations.
5508 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
5509 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
5510 use the unistd module.
5511 * src/system.h: Likewise.
5512 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
5513 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
5514 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
5515 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
5516 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
5517 * src/system.h: Include inttypes.h unconditionally, now that we
5518 use the inttypes module. Don't bother to include stdint.h, since
5519 inttypes.h now does that for us.
5520 (LOCALEDIR): Remove, now that we use the configmake module.
5521 * src/getargs.c: Include configmake.h.
5522 * src/main.c: Likewise.
5523 * src/output.c: Likewise.
5524 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
5525 not from $abs_top_builddir, since config.h moved.
5526
5527
4f82b42a
PE
5528 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
5529 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
5530
5531 * src/parse-gram.y (symbol_declaration): Don't put statements
5532 before declarations; it's not portable to C89.
5533 * src/scan-code.l (handle_action_at): Likewise.
5534
5535 * src/scan-code.l: Always initialize braces_level; the old code
5536 left it uninitialized and therefore had undefined behavior.
5537
5538 Don't attempt to redefine 'assert', since it runs afoul of
5539 systems where standard headers (mistakenly) include <assert.h>.
5540 Instead, define and use our own alternative, called 'aver'.
5541 * src/reader.c: Don't include assert.h, since we no longer
5542 use assert.
5543 * src/scan-code.l: Likewise.
5544 * src/system.h (assert): Remove, replacing with....
5545 (aver): New function, taking a bool arg. All uses changed.
5546 * src/tables.c (pack_vector): Ensure that aver arg is bool,
5547 not merely an integer.
5548
31c10e38
PE
55492006-09-15 Bob Rossi <bob@brasko.net>
5550
5551 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
5552 * data/c.m4 (YYPUSH): New.
5553 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
5554 * src/getargs.c (push_parser): New var.
5555 * src/getargs.h (push_parser): New declaration.
5556 * src/output.c (prepare): Add macro insertion of `push_flag'.
5557 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
5558 (prologue_declaration): Parse %push-parser.
5559 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
5560 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
5561 list of removed lines from the traces observed.
5562 (AT_CHECK_CALC_LALR): Added push parser tests.
5563
fa7b79c0
PE
55642006-09-13 Paul Eggert <eggert@cs.ucla.edu>
5565
21fe08ca
PE
5566 * NEWS: Version 2.3a.
5567 * configure.ac (AC_INIT): Likewise.
5568
e8ec4d9b
PE
5569 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
5570 "#define YYSTYPE int" that caused "make maintainer-check" to fail
5571 due to header ordering dependencies. I don't know why the #define
5572 was there.
5573
fa7b79c0
PE
5574 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
5575 runtime cost when YYDEBUG is not defined, and so that some tests
5576 that used to fail now work. Problem and initial suggestion by
5577 Paolo Bonzini.
5578 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
5579 * data/glr.cc (b4_parser_class_name):
5580 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
5581 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
5582 (yydebug_) [YYDEBUG]: New member.
5583 (yycdebug_): Now defined only if YYDEBUG.
5584 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
5585 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
5586 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
5587 if YYYDEBUG.
5588 (debug_stream, set_debug_stream, debug_level, set_debug_level):
5589 Define only if YYDEBUG.
5590 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
5591 set_debug_level.
5592 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
5593 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
5594 AT_CHECK_CALC_GLR_CC that are working now.
5595
4ec13d60
PE
55962006-09-12 Paul Eggert <eggert@cs.ucla.edu>
5597
5598 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
5599 We don't need them in glr.cc, and glr.c defines them.
5600 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
5601 assumes that defining it to anything is the same as defining
5602 it to 1. Problem reported by Paolo Bonzini.
5603
8e1687ae
PE
56042006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
5605
5606 * data/c.m4 (b4_null, b4_case): Define.
5607 * src/output.c (prepare_symbols): Use b4_null.
5608 (user_actions_output): Use b4_case.
5609
3dc5e96b
PE
56102006-09-11 Paul Eggert <eggert@cs.ucla.edu>
5611
aef3da86
PE
5612 * data/glr.c (b4_shared_declarations): Put start-header first,
5613 before any #includes that we generate, so that feature-test
5614 macros work. Problem reported by Michael Deutschmann in
5615 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
5616 * data/lalr1.cc: Likewise.
5617 * doc/bison.texinfo (Prologue): Document that feature-test macros
5618 should be defined before any Bison declarations.
5619 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
5620 that depend on location.hh after, not before, Bison decls, since
5621 we now include location.hh after the first user prologue.
5622
3dc5e96b
PE
5623 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
5624 Sander Brandenburg in
5625 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
5626 Also, fix minor white space and comment issues.
aef3da86
PE
5627 (Prologue): Mention that it's better to define feature-test macros
5628 before Bison declarations. Problem reported by Michael Deutschmann.
5629
5630 * README-cvs: Fix typo: "&" should be "&&". Problem reported
5631 by Jim Meyering.
5632 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
5633 This adjusts to recent gnulib changes.
3dc5e96b 5634
b2a0b7ca
JD
56352006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
5636
5637 Finish implementation of per-type %destructor/%printer. Discussed
5638 starting at
5639 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
5640 and
5641 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
5642 * NEWS (2.3+): Add a description of this feature to the default
5643 %destructor/%printer description.
5644 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
5645 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
5646 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
5647 list node contains a semantic type.
5648 * src/symtab.c, src/symtab.h: Extend with a table that associates
5649 semantic types with their %destructor's and %printer's.
5650 (semantic_type_from_uniqstr, semantic_type_get,
5651 semantic_type_destructor_set, semantic_type_printer_set): New functions
5652 composing the public interface of that table.
5653 (symbol_destructor_get, symbol_destructor_location_get,
5654 symbol_printer_get, symbol_printer_location_get): If there's no
5655 per-symbol %destructor/%printer, look up the per-type before trying
5656 the default.
5657 * tests/actions.at (Per-type %printer and %destructor): New test case.
5658 * tests/input.at (Default %printer and %destructor redeclared):
5659 Extend to check that multiple occurrences of %symbol-default in a
5660 single %destructor/%printer declaration is an error.
5661 (Per-type %printer and %destructor redeclared, Unused values with
5662 per-type %destructor): New test cases.
5663
3be03b13
JD
56642006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
5665
5666 Require default %destructor/%printer to be declared using
5667 %symbol-default instead of an empty symbol list, and start working on
5668 new per-type %destructor/%printer. Discussed at
5669 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
5670 * NEWS (2.3+): Add %symbol-default to example.
5671 * bison.texinfo (Freeing Discarded Symbols): Likewise.
148d66d8 5672 (Table of Symbols): Add entry for %symbol-default.
3be03b13
JD
5673 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
5674 (generic_symlist, generic_symlist_item): New nonterminals for creating
5675 a list in which each item is a symbol, semantic type, or
5676 %symbol-default.
5677 (grammar_declaration): Use generic_symlist in %destructor and %printer
5678 declarations instead of symbols.1 or an empty list.
5679 (symbol_declaration, precedence_declaration, symbols.1): Update actions
5680 for changes to symbol_list.
5681 * src/reader.c: Update for changes to symbol_list.
5682 * src/scan-code.l: Likewise.
5683 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
5684 * src/symlist.c, src/symlist.h: Extend such that a list node may
5685 represent a semantic type or a %symbol-default in addition to just an
5686 ordinary symbol. Add switched functions for setting %destructor's and
5687 %printer's.
5688 * tests/actions.at, tests/input.at: Add %symbol-default to all default
5689 %destructor/%printer declarations.
5690
3508ce36
JD
56912006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
5692
5693 Whether the default %destructor/%printer applies to a particular symbol
5694 isn't a question of whether the user *declares* that symbol (in %token,
5695 for example). It's a question of whether the user by any means
5696 *defines* the symbol at all (by simply using a char token, for
5697 example). $end is defined by Bison whereas any other token with token
5698 number 0 is defined by the user. The error token is always defined by
5699 Bison regardless of whether the user declares it with %token, but we
5700 may one day let the user define error as a nonterminal instead.
5701 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
5702 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
5703 the meaning of "user-defined".
5704 * tests/actions.at (Default %printer and %destructor for user-declared
5705 end token): Rename to...
5706 (Default %printer and %destructor for user-defined end token): ...
5707 this.
5708
5709 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
5710 computation of whether to apply the default, don't maintain a list of
5711 every Bison-defined symbol. Instead, just check for a first character
5712 of '$', which a user symbol cannot have, and check for the error token.
5713
9350499c
JD
57142006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
5715
5716 Don't apply the default %destructor or %printer to the error token,
5717 $undefined, or $accept. This change fits the general rule that the
5718 default %destructor and %printer are only for user-declared symbols,
5719 and it solves several difficulties that are described in the new test
5720 cases listed below.
5721 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
5722 * tests/actions.at (Default %printer and %destructor are not for error
5723 or $undefined, Default %printer and %destructor are not for $accept):
5724 New test cases.
5725
4d7370cb
JD
57262006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
5727
5728 Allow %start after the first rule.
5729 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
5730 when parsing the first rule.
5731 (check_and_convert_grammar): Search for it here after all grammar
5732 declarations have been parsed. Skip midrules, which have dummy LHS
5733 nonterminals.
5734 * src/symtab.c (symbol_is_dummy): New function.
5735 * src/symtab.h (symbol_is_dummy): Declare it.
5736 * tests/input.at (%start after first rule): New test.
5737
6d0ef4ec
JD
57382006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
5739
5740 Redo some of the previous commit: add back the ability to use
5741 non-aliased/undeclared string literals since it might be useful to
5742 those declaring %token-table.
5743 * src/reader.c (check_and_convert_grammar): Undo changes in previous
5744 commit: don't worry about complaints from symbols_pack.
5745 * src/symtab.c (symbol_new, symbol_class_set,
5746 symbol_check_alias_consistency): Undo changes in previous commit: count
5747 each string literal as a new symbol and token, assign it a symbol
5748 number, and don't complain about non-aliased string literals.
5749 (symbols_pack): Since symbol_make_alias still does not decrement symbol
5750 and token counts but does still set aliased tokens to the same number,
5751 symbol_pack_processor now leaves empty slots in the symbols array.
5752 Remove those slots.
5753 * tests/regression.at (Undeclared string literal): Remove test case
5754 added in previous commit since non-aliased string literals are allowed
5755 again.
5756 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
5757 remove unnecessary string literal declarations.
5758 * tests/sets.at (Firsts): Likewise.
5759
965537bc
JD
57602006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
5761
5762 Don't allow an undeclared string literal, but allow a string literal to
5763 be used before its declaration.
5764 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
5765 symbols_pack complained.
5766 * src/symtab.c (symbol_new): Don't count a string literal as a new
5767 symbol.
5768 (symbol_class_set): Don't count a string literal as a new token, and
5769 don't assign it a symbol number since symbol_make_alias does that.
5770 (symbol_make_alias): It's not necessary to decrement the symbol and
5771 token counts anymore. Don't assume that an alias declaration occurs
5772 before any uses of the identifier or string, and thus don't assert that
5773 one of them has the highest symbol number so far.
5774 (symbol_check_alias_consistency): Complain if there's a string literal
5775 that wasn't declared as an alias.
5776 (symbols_pack): Bail if symbol_check_alias_consistency failed since
5777 symbol_pack asserts that every token has been assigned a symbol number
5778 although undeclared string literals have not.
5779 * tests/regression.at (String alias declared after use, Undeclared
6d0ef4ec 5780 string literal): New test cases.
965537bc
JD
5781 (Characters Escapes, Web2c Actions): Declare string literals as
5782 aliases.
5783 * tests/sets.at (Firsts): Likewise.
5784
47aee066
JD
57852006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
5786
5787 In the grammar scanner, STRING_FINISH unclosed constructs and return
5788 them to the parser in order to improve error messages.
5789 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
5790 SC_BRACED_CODE, SC_PROLOGUE): Implement.
5791 * tests/input.at (Unclosed constructs): New test case.
5792 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
5793 seen.
5794
5795 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
5796 unused global.
5797
1f6b3679
JD
57982006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
5799
5800 Handle string aliases for character tokens correctly.
5801 * src/symtab.c (symbol_user_token_number_set): If the token has an
5802 alias, check and set its alias's user token number instead of its own,
5803 which is set to indicate the alias. Previously, every occurrence of
5804 the character token in the grammar overwrote that alias indicator with
5805 the character code.
5806 * tests/input.at (String aliases for character tokens): New test.
5807
219741d8
JD
58082006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
5809
5810 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
5811
11daa4e7
PE
58122006-08-11 Paul Eggert <eggert@cs.ucla.edu>
5813
5814 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
5815 to prevent failures when building on older platforms.
5816 Check for autopoint failure.
5817 Set XGETTEXT_OPTIONS to values that check for C format strings,
5818 so that translators are warned about them (this also helps
5819 prevent core dumps).
5820
5821 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
5822 function, since it simplifies our code a bit.
5823
5824 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
5825 rather than -W, so we don't get bogus warnings about sign comparisons.
5826 Add -Wpointer-arith, since that warning is useful (it reports code
5827 that does not conform to C89 and that some compilers reject).
5828 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
5829 since it's no longer needed.
5830
f9bfc42a
JD
58312006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
5832
5833 Clean up scanners a bit.
5834 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
5835 definitions so gcc won't warn when obstack_for_string is unused.
5836 * src/scan-code.l: config.h and system.h are already #include'd by
5837 scan-code-c.c, so get rid of them here.
5838 * src/scan-gram.l: Likewise.
5839 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
5840 definitions rather than duplicating the rest of it.
5841 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
5842
06e8700a
JD
58432006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
5844
5845 Suppress signed/unsigned comparison warnings for yycheck.
5846 * data/c.m4 (b4_safest_int_type): New macro.
5847 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
5848 a signed int type, cast it to b4_safest_int_type first.
5849 * data/yacc.c: Likewise.
5850 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
5851 also overwritten.
5852
9c437126
PE
58532006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
5854
5855 * doc/bison.texinfo: Fix some typos.
5856
284d8a13
PE
58572006-08-02 Paul Eggert <eggert@cs.ucla.edu>
5858
5859 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
5860 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
5861
5862 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
5863 the latest gnulib does this a different way.
5864 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
5865 translation was patched, so stop omitting it.
5866
ec5479ce
JD
58672006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
5868
5869 Enable declaration of default %printer/%destructor. Make the parser
5870 use these for all user-declared grammar symbols for which the user does
5871 not declare a specific %printer/%destructor. Thus, the parser uses it
5872 for token 0 if the user declares it but not if Bison generates it as
5873 $end. Discussed starting at
5874 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
5875 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
5876 and
5877 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
5878 * NEWS (2.3+): Mention.
5879 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
5880 declare a %destructor for a mid-rule's semantic value. It's just
5881 impossible to declare one specific to it.
5882 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
5883 code. Describe default %destructor form.
5884 * src/parse-gram.y (grammar_declaration): Parse default
5885 %printer/%destructor declarations.
5886 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
5887 and symbol_destructor_location_get rather than accessing the destructor
5888 and destructor_location members of struct symbol.
5889 (symbol_printers_output): Likewise but for %printer's.
5890 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
5891 again.
5892 * src/symtab.c (default_destructor, default_destructor_location,
5893 default_printer, default_printer_location): New static global
5894 variables to record the default %destructor and %printer.
5895 (symbol_destructor_get, symbol_destructor_location_get,
5896 symbol_printer_get, symbol_printer_location_get): New functions to
5897 compute the appropriate %destructor and %printer for a symbol.
5898 (default_destructor_set, default_printer_set): New functions to set the
5899 default %destructor and %printer.
5900 * src/symtab.h: Prototype all those new functions.
5901 * tests/actions.at (Default %printer and %destructor): New test to
5902 check that the right %printer and %destructor are called, that they're
5903 not called for $end, and that $$ and @$ work correctly.
5904 (Default %printer and %destructor for user-declared end token): New
5905 test to check that the default %printer and %destructor are called for
5906 a user-declared end token.
5907 * tests/input.at (Default %printer and %destructor redeclared, Unused
5908 values with default %destructor): New tests to check related grammar
5909 warnings and errors.
5910
868d2d96
JD
59112006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
5912
5913 Clean up handling of %destructor for the end token (token 0).
5914 Discussed starting at
5915 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
5916 and
5917 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
5918
5919 Make the skeletons consistent in how they pop the end token and invoke
5920 its %destructor.
5921 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
5922 state, which has token number 0, since this would invoke the
5923 %destructor for the end token.
5924 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
5925 until after shifting the end token, or else it won't be popped.
5926 * data/yacc.c (yyparse): Likewise.
5927
5928 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
5929 it's the end token. Upon termination, destroy an unshifted lookahead
5930 even when it's the end token.
5931 * data/lalr1.cc (yy::parser::parse): Likewise.
5932 * data/yacc.c (yyparse): Likewise.
5933
5934 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
5935 value warnings for the end token when the user gives the end token a
5936 %destructor.
5937
5938 * tests/actions.at (Printers and Destructors): Test all the above.
5939
62a9592d
PE
59402006-07-24 Paul Eggert <eggert@cs.ucla.edu>
5941
5942 Update to latest gnulib and gettext versions.
5943 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
5944 Add fopen-safer.
5945 (gnulib_files): Add m4/warning.m4. Don't worry about files
5946 overwritten by autopoint.
5947 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
5948 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
5949 rejects them.
5950 Don't use autoreconf; instead, invoke autopoint etc. by hand,
5951 so that we can remove the intl files at a better time.
5952 (intl_files_to_remove): Remove aclocal.m4, since it gets
5953 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
5954 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
5955 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
5956 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
5957 Remove datarootdir hack; no longer needed.
5958 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
5959 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
5960 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
5961 strdup.h.
5962 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
5963 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
5964
10d6970f
PE
59652006-07-20 Paul Eggert <eggert@cs.ucla.edu>
5966
5967 * bootstrap: Adjust to today's change to gnulib-tool by invoking
5968 it with --assume-autoconf='latest-stable'.
5969
50a33993
JD
59702006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
5971
5972 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
5973 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
5974 YYSTYPE' and `{'.
5975 * src/muscle_tab.h (muscle_grow): Replace the header comments with
5976 those from muscle_tab.c since the old ones are misleading.
5977
2ce4ed68
AD
59782006-07-13 Akim Demaille <akim@epita.fr>
5979
5980 Support %define "KEY" {VALUE}.
5981 * src/scan-code.h, src/scan-code.l (translate_action)
5982 (translate_rule_action, translate_symbol_action, translate_code):
5983 Return char *, not const char *.
5984 * src/parse-gram.y (declaration): Rename as...
5985 (prologue_declaration): this.
5986 (string_content): Remove this nonterminal, use STRING.
5987 (braceless, content, content.opt): New nonterminal.
5988 Use them.
5989 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
5990 as value.
5991 * src/scan-gram.l (getargs.h): Don't include it.
5992
db7e5eb5
PE
59932006-07-12 Paul Eggert <eggert@cs.ucla.edu>
5994
5995 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
5996 rather than a for-loop that declares a local bool variable. This
5997 should work around a compatibility problem with a Cray x1e C++
5998 compiler reported by Hung Nguyen in
5999 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
6000 The for-loop was introduced in the 2004-11-17 change but I don't
6001 know why it was needed.
6002
a5d80ba5
AD
60032006-07-12 Akim Demaille <akim@epita.fr>
6004
6005 * data/c.m4: Comment changes.
6006
23eb2a69
AD
60072006-07-10 Akim Demaille <akim@lrde.epita.fr>
6008
6009 * src/complain.c (error_message, ERROR_MESSAGE): New.
6010 To factor...
6011 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
6012 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
6013
ddc8ede1
PE
60142006-07-09 Paul Eggert <eggert@cs.ucla.edu>
6015
6016 * NEWS: Instead of %union, you can define and use your own union type
6017 YYSTYPE if your grammar contains at least one <type> tag.
6018 Your YYSTYPE need not be a macro; it can be a typedef.
6019 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
6020 (Union Decl, Decl Summary): Document this.
6021 * data/glr.c (YYSTYPE): Implement this.
6022 * data/glr.cc (YYSTYPE): Likewise.
6023 * data/lalr1.cc (YYSTYPE): Likewise.
6024 * data/yacc.c (YYSTYPE): Likewise.
6025 * src/output.c (prepare): Output tag_seen_flag.
6026 * src/parse-gram.y (declaration, grammar_declaration):
6027 Use 'union_seen' rather than 'typed' to determine whether
6028 %union has been seen, since grammars can now be typed without
6029 %union.
6030 (symbol_declaration, type.opt, symbol_def):
6031 Keep track of whether a tag has been seen.
6032 * src/reader.c (union_seen, tag_seen): New vars.
6033 (typed): remove.
6034 * src/reader.h (union_seen, tag_seen, typed): Likewise.
6035 * src/scan-code.l (untyped_var_seen): New variable.
6036 (handle_action_dollar): Adjust to above changes.
6037 (handle_action_dollar, handle_action_at):
6038 Improve overflow checking for outlandish numbers.
6039 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
6040 avoid new diagnostics generated by above changes.
6041 * tests/regression.at (YYSTYPE typedef): Add test to check
6042 for type tags without %union.
6043
6044 * src/symlist.c (symbol_list_length): Return int, not unsigned
6045 int, since callers expect int. This may need to get revisited
6046 once we have proper integer overflow checking.
6047
6048 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
6049 object is now static.
6050
6051 * src/getargs.c (flags_argmatch): Return void, not int,
6052 to pacify ./configure --enable-gcc-warnings.
6053
6054 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
6055 since last_string is already defined to FLEX_PREFIX (last_string).
6056
7b42569e
AD
60572006-07-09 Akim Demaille <akim@lrde.epita.fr>
6058
6059 Implement --warnings/-W.
6060 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
6061 replaced by...
6062 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
6063 Adjust callers.
6064 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
6065 (warnings_args, warnings_types): New.
6066 (getargs, short_options, long_options): Accept -W/--warnings.
6067 Sort the options by alphabetical order, upper case letter right
6068 before its lower case.
6069
3b452f4e
JD
60702006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
6071
6072 Change %merge result type clash warnings to errors. Discussed at
6073 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
6074 * src/reader.c (record_merge_function_type): Use complain_at.
6075 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
6076 declared later): Update test case results.
6077
b8a41559
AD
60782006-07-09 Akim Demaille <akim@lrde.epita.fr>
6079
6080 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
6081 to be in alphabetical order.
6082 (trace_args): Spelling fixes.
6083
cd9e1ba2
PE
60842006-07-09 Paul Eggert <eggert@cs.ucla.edu>
6085
6086 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
6087 so they don't collide with user-defined macros.
6088 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
6089 this was never guaranteed, and now that we're using gnulib stdint,
6090 which defines int_fast16_t to long int, the problem is exposed.
6091
cb48f191
PE
60922006-07-08 Paul Eggert <eggert@cs.ucla.edu>
6093
b8445a15
PE
6094 * data/c.m4 (b4_basename): Simplify a bit, since we don't
6095 need the full POSIX semantics (and weren't implementing them
6096 anyway).
6097
cb48f191
PE
6098 Adjust to Autoconf 2.60 and today's gnulib.
6099 * bootstrap (gnulib_modules): Add stdint.
6100 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
6101 no longer copies it.
6102 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
6103 since stdint needs the former and wcwidth (which is now required
6104 by mbswidth) needs the latter.
6105 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
6106 work around a compatibility glitch between gettext 0.14.6 and
6107 Autoconf 2.60.
6108 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
6109 Do not check for uintptr_t, since new stdint module does the right
6110 thing.
6111 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
6112 Add stdint.h, stdint_.h, wcwidth.h.
6113 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
6114 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
6115 stdint.m4, wchar_t.m4, wcwidth.m4.
6116 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
6117 usual order for ../lib/*.h files.
6118 (file_name_split): Use last_component, not base_name, to adjust
6119 to gnulib changes.
6120 * src/parse-gram.h: Include <strverscmp.h> in the usual order
6121 for ../lib/*.h files.
6122 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
6123 Define unconditionally, since we now assume the stdint module.
6124 * src/scan-skel.l: Include <dirname.h>.
6125 (BASE_QPUTS): Use last_component, not base_name.
6126 * src/system.h: Include <unlocked-io.h> in the usual order
6127 for ../lib/*.h files. Include <stdint.h> unconditionally,
6128 since we now use the stdint module.
6129 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
6130 HAVE_UINTPTR_T, since we now use the stdint module.
6131 (base_name): Remove decl, since files now include <dirname.h>
6132 to get the decl.
6133
cd48d21d
AD
61342006-07-08 Akim Demaille <akim@lrde.epita.fr>
6135
6136 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
6137 New, default to 1.
6138 * data/yacc.c, data/glr.c, data/location.cc: Use them.
6139 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
6140 default.
6141 * tests/calc.at: Adjust.
6142
8ec0a172
AD
61432006-07-08 Akim Demaille <akim@lrde.epita.fr>
6144
b8445a15 6145 * data/c.m4 (b4_basename): New.
8ec0a172
AD
6146 (b4_syncline): Also output the location of its invocation (from
6147 the skeleton).
6148 (b4_user_action, b4_define_user_action, b4_user_actions)
6149 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
6150 (b4_user_stype): New.
6151 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
6152
4a678af8
JD
61532006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
6154
6155 In the grammar file, the first column is 1 not 0 on the first line as
6156 on every other line.
6157 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
6158 * tests/input.at (Torturing the Scanner): Update output.
6159
6160 * src/scan-gram.l (scanner_cursor): Declare it static.
6161
dd60572a
JD
61622006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
6163
6164 In warnings, say "previous declaration" rather than "first
6165 declaration".
6166 * src/symtab.c (redeclaration): Do that here.
6167 * src/reader.c (record_merge_function_type): In the case of a result
6168 type clash, report the previous declaration rather than the very first
6169 one in the grammar file.
6170 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
6171 declared later): Add a third declaration to check this behavior.
6172 * tests/input.at (Incompatible Aliases): Update output.
6173
2073e1b6
AD
61742006-06-27 Akim Demaille <akim@epita.fr>
6175
6176 * doc/Doxyfile.in: New.
6177 * doc/Makefile.am: Use it.
6178 * src/lalr.h, src/symtab.h: Initial doxygenation.
6179
8ee5b538
JD
61802006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
6181
6182 Don't miss %merge result type warnings just because the LHS types are
fab044e6
JD
6183 declared after the %merge. This continues the effort of the previous
6184 patch.
8ee5b538
JD
6185 * src/reader.c (get_merge_function): Don't set the merger type yet.
6186 (record_merge_function_type): New function for setting the merger type
6187 and checking for clashes.
6188 (grammar_current_rule_merge_set): Set the location of the %merge for
6189 the current rule.
6190 (packgram): Invoke record_merge_function_type for each rule now that
6191 all symbol type declarations have been parsed.
6192 * src/reader.h (merger_list.type_declaration_location): New member
6193 storing the location of the first %merge from which the type for this
6194 merging function was derived.
6195 * src/symlist.h (symbol_list.merger_declaration_location): New member
6196 storing the location of a rule's %merge, if any.
6197 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
6198 declared later): New test to catch the error fixed by the above patch.
6199
ffa4ba3a
JD
62002006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
6201
6202 Get action warnings (grammar_rule_check) right even when symbol
fab044e6
JD
6203 declarations appear after the rules. Discussed at
6204 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
6205 and
6206 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
6207 Don't mistake the type of $$ in a midrule to be that of its parent
6208 rule's $$.
ffa4ba3a
JD
6209 * src/reader.c (grammar_current_rule_end): Don't invoke
6210 grammar_rule_check yet since not all symbol declarations may have been
6211 parsed yet.
6212 (grammar_midrule_action): Likewise.
6213 Don't record whether the midrule's $$ has been used yet since actions
6214 haven't been translated yet.
6215 Record the midrule's parent rule and its RHS index within the parent
6216 rule.
6217 (grammar_current_rule_action_append): Don't translate the action yet
6218 since not all symbol declarations may have been parsed yet and, thus,
6219 warnings about types for $$, $n, @$, and @n can't be reported yet.
6220 (packgram): Translate the action and invoke grammar_rule_check now that
6221 all symbol declarations have been parsed.
6222 * src/scan-code.l (handle_action_dollar): Now that this is invoked
6223 after parsing the entire grammar file, the symbol list here in the case
6224 of a midrule is actually the midrule's empty RHS, so reference its
6225 parent rule's RHS where necessary.
6226 On the other hand, now that you can already know it's a midrule, you
6227 aren't forced to think $$ has the same type as its parent rule's $$.
6228 (handle_action_at): In the case of a midrule, reference the parent rule
6229 where necessary.
6230 * src/symlist.c (symbol_list_new): Initialize new midrule-related
6231 members.
6232 (symbol_list_length): Now that this is invoked after all rules have
6233 been parsed, a NULL symbol (rather than a NULL symbol list node)
6234 terminates a rule. symbol_list_print already does this correctly.
6235 * src/symlist.h (symbol_list.midrule_parent_rule,
6236 symbol_list.midrule_parent_rhs_index): New members so that midrules can
6237 remember their relationships with their parents.
6238 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
6239 fixed by the above patch.
6240 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
6241 implementing...
6242 (Unused values): ... this old test case and...
6243 (Unused values before symbol declarations): ... this new test case.
6244 This one is the same as `Unused values' except that all symbol
6245 declarations appear after the rules in order to catch the rest of the
6246 errors fixed by the above patch.
6247
e256e17f
JD
62482006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
6249
300a1930
JD
6250 More cleanup.
6251 * src/reader.c (current_rule): Declare it static since it's no longer
6252 used outside this file.
6253 (grammar_current_rule_action_append): Remove redundant arguments from
6254 translate_rule_action invocation.
6255 * src/reader.h (current_rule): Remove this unused extern.
6256 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
6257 * src/scan-code.l (translate_rule_action): Likewise.
e256e17f 6258
381ecb06
JD
62592006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
6260
6261 Clean up yesterday's patch.
6262 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
6263 to...
6264 * src/reader.c (grammar_current_rule_action_append): ... here for
6265 consistency with grammar_current_rule_symbol_append.
6266 * tests/regression.at (Braced code in declaration in rules section):
6267 Make yyerror and yylex static as usual.
6268
4210cd0b
JD
62692006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
6270
6271 Fix bug that mistakes braced code in a declaration in the rules section
6272 to be a rule action. Mentioned at
6273 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
6274 * src/scan-gram.l: Move midrule action detection from the start of the
6275 scanning of any braced code to...
6276 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
6277 action. For readability, use $2 and @2 rather than the equivalent
6278 global variables.
6279 * tests/regression.at (Braced code in declaration in rules section):
6280 New test to catch the error fixed by the above patch.
6281
6282 Work on code readability some.
6283 * src/scan-code.l (current_rule): Get rid of this misleading and
6284 redundant declaration: it's actually extern'ed in reader.h.
6285 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
6286 translate_action): Add a rule argument and use it instead of the global
6287 current_rule.
6288 (translate_rule_action): This already receives current_rule through an
6289 argument, so pass it on to translate_action instead of assigning
6290 current_rule to current_rule.
6291 (translate_symbol_action, translate_code): Pass rule = NULL to
6292 translate_action.
6293
34f98f46
JD
62942006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
6295
6296 Rename %before-definitions to %start-header and %after-definitions to
6297 %end-header. Don't use these declarations to separate pre-prologue
6298 blocks from post-prologue blocks. Add new order-independent
6299 declarations %before-header and %after-header as alternatives to the
6300 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
6301 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
6302 * NEWS (2.3+): Update for these changes.
6303 * data/glr.c (b4_before_definitions): Update to...
6304 (b4_start_header): ... this.
6305 (b4_after_definitions): Update to...
6306 (b4_end_header): ... this.
6307 * data/glr.cc: Likewise.
6308 * data/lalr1.cc: Likewise.
6309 * data/yacc.c: Likewise.
6310 * doc/bison.texinfo (The prologue): Update names, and replace remaining
6311 prologue blocks with %*-header declarations.
6312 (Calc++ Parser): Likewise.
91661ebb 6313 (Decl Summary): Update names.
148d66d8 6314 (Table of Symbols): Update description.
34f98f46
JD
6315 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
6316 (PERCENT_END_HEADER): ... this.
6317 (PERCENT_BEFORE_DEFINITIONS): Update to...
6318 (PERCENT_START_HEADER): ... this.
6319 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
6320 (declaration): Update token names and m4 macro names.
6321 When parsing %end-header and %start-header, invoke translate_code
6322 before muscle_code_grow, and no longer set global booleans to remember
6323 whether these declarations have been seen.
6324 Parse new %after-header and %before-header.
6325 * src/reader.c (before_definitions, after_definitions): Remove.
6326 (prologue_augment): Accept a new bool argument to specify whether to
6327 augment the pre-prologue or post-prologue.
6328 * src/reader.h (before_definitions, after_definitions): Remove these
6329 extern's.
6330 (prologue_augment): Add new bool argument.
6331 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
6332 (PERCENT_END_HEADER): ... this.
6333 (PERCENT_BEFORE_DEFINITIONS): Update to...
6334 (PERCENT_START_HEADER): ... this.
6335 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
6336 * tests/actions.at (Printers and Destructors): Update names.
6337
31b2b07e
JD
63382006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
6339
6340 Add comparison operators for C++ location classes. Discussed at
6341 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
6342 * data/c++.m4 (b4_define_location_comparison): New boolean %define
6343 declaration indicating whether filename_type has an operator==. If
6344 filename_type is `std::string', it defaults to `1', `0' otherwise.
6345 * data/location.cc: Iff b4_define_location_comparison is `1', add
6346 operator== and operator!= for class position and for class location.
6347
6348 Some minor fixes.
6349 * src/scan-action.l: Remove unused file.
6350 * src/symtab.c (symbol_printer_set): Use printer_location not
6351 destructor_location.
6352 * src/symtab.h (struct symbol): Replace incorrect source comment for
6353 printer members.
6354 * tests/input.at (Incompatible Aliases): Update output with correct
6355 printer location.
6356
9bc0dd67
JD
63572006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
6358
6359 Don't put the pre-prologue in the header file. For the yacc.c code
6360 file and the glr.c header and code files, move the pre-prologue before
6361 the token definitions. Add new %before-definitions and
6362 %after-definitions to declare code that will go in both the header file
6363 and code file. Discussed at
6364 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
6365 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
6366 and
6367 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
6368 * NEWS (2.3+): Describe these changes.
6369 * data/glr.c (b4_pre_prologue): Move from within to before...
6370 (b4_shared_declarations): ... this.
6371 Add new b4_before_definitions before b4_token_enums.
6372 Add new b4_after_definitions at the end.
6373 * data/glr.cc (b4_pre_prologue): Replace with...
6374 (b4_before_definitions): ... this in the header file.
6375 (b4_after_definitions): New near the end of the header file.
6376 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
6377 code file right before including the header file.
6378 (b4_before_definitions): New in the previous position of
6379 b4_pre_prologue in the header file.
6380 (b4_after_definitions): New near the end of the header file.
6381 * data/yacc.c: Clean up some m4 quoting especially in the header file.
6382 (b4_token_enums_defines): In the code file, move to right before
6383 YYSTYPE for consistency with the header file.
6384 (b4_before_definitions): New right before b4_token_enums_defines in
6385 both the header and code file.
6386 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
6387 header and code file.
6388 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
6389 of prologues for %union dependencies.
91661ebb
JD
6390 (Decl Summary): In %defines description, mention the effect of
6391 %before-definitions and %after-definitions on the header file.
9bc0dd67
JD
6392 (Calc++ Parser): Forward declare driver in a %before-definitions rather
6393 than in the pre-prologue so that make check succeeds.
148d66d8 6394 (Table of Symbols): Add entries for %before-definitions and
9bc0dd67
JD
6395 %after-definitions.
6396 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
6397 %before-definitions.
6398 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
6399 (declaration): Parse those declarations and append to
6400 b4_before_definitions and b4_after_definitions, respectively.
6401 * src/reader.c (before_definitions, after_definitions): New bools to
6402 track whether those declarations have been seen.
6403 (prologue_augment): Add to the post-prologue if %union,
6404 %before-definitions, or %after-definitions has been seen.
6405 * src/reader.h (before_definitions, after_definitions): New extern's.
6406 * src/scan-gram.l: Scan the new declarations.
6407 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
6408 prologue block in a %before-definitions or a %after-definitions based
6409 on whether the %union is declared.
6410 * tests/regression.at (Early token definitions with --yacc, Early token
6411 definitions without --yacc): Move tests for token definitions into the
6412 post-prologue since token names are no longer defined in the
6413 pre-prologue.
6414
203b9274
AD
64152006-06-20 Akim Demaille <akim@epita.fr>
6416
6417 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
6418 (symbol_get): Use it.
6419 * src/parse-gram.y: Use it.
6420
a7ee59cf
JD
64212006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
6422
6423 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
6424 build succeeds when configured with --enable-gcc-warnings.
6425
5a2baae7
PE
64262006-06-19 Paul Eggert <eggert@cs.ucla.edu>
6427
33ad1a9c
PE
6428 * src/parse-gram.y (char_name): New function.
6429 (CHAR, STRING, string_content): For %printer, properly escape.
6430 (ID): Prefer fputs to fprintf.
6431 (id): Reindent to be consistent with other rules.
6432 Properly quote char.
6433
5a2baae7
PE
6434 The Translation Project changed its way of publishing translations
6435 to maintainers. I haven't received any responses to my request
6436 for supporting the old way, or for documenting the new way. I
6437 have modified 'bootstrap' to use screen scraping
6438 (in this case, HTML scraping). This is unreliable and inelegant,
6439 but I don't see any better way. Yuck.
6440 * bootstrap (TP_URL, WGET_COMMAND): New vars.
6441 (get_translations): New function, which uses HTML scraping to
6442 deduce locations of latest translations.
6443 Use this function to grab both bison and bison-runtime .po files.
6444 Don't bother priming the pump for the runtime-po domain any more,
6445 as it's now translated better than bison is.
6446
58d7a1a1
AD
64472006-06-19 Akim Demaille <akim@epita.fr>
6448
6449 * src/scan-gram.l: No longer "parse" things after `%union' until
6450 `{'. Rather, return a single "%union" token.
6451 No longer make symbols: return strings, and leave the conversion
6452 to symbols to the parser.
6453 (SC_PRE_CODE, token_type): Remove.
6454 * src/parse-gram.y (%union): New field `character'.
6455 Sort tokens.
6456 (CHAR): New token.
6457 (ID, ID_COLON): Now that the scanner no longer makes them
6458 identifiers, adjust all uses to invoke symbol_get.
6459 (id_colon): New, wraps the conversion from string to symbol.
6460 (%union): Accept a possible union_name.
6461 (symbol): Now can be a char.
6462 * data/c.m4 (b4_union_name): Leave a default value.
6463 * data/glr.c, data/yacc.c: Use it.
6464
b931235e
JD
64652006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
6466
6467 For associating token numbers with token names for "yacc.c", don't use
6468 #define statements unless `--yacc' is specified; always use enum
6469 yytokentype. Most important discussions start at:
6470 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
6471 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
6472 and
6473 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
6474 * NEWS (2.3+): Mention.
6475 * data/c.m4 (b4_yacc_if): New.
6476 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
6477 token #define's.
6478 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
6479 on token name definitions.
6480 * src/getargs.c (usage): Capitalize `Yacc' in English.
6481 * src/output.c (prepare): Define b4_yacc_flag.
6482 * tests/regression.at (Early token definitions): Test that tokens names
6483 are defined before the pre-prologue not just before the post-prologue.
6484 Remove this test case and copy to...
6485 (Early token definitions with --yacc): ... this to test #define's.
6486 (Early token definitions without --yacc): ... and this to test enums.
6487
9e6e7ed2
PE
64882006-06-11 Paul Eggert <eggert@cs.ucla.edu>
6489
6490 * NEWS: Reword the post-2.3 change to not be so optimistic about
6491 removing the old "look-ahead" spelling.
6492 Update previous look-ahead/lookahead change reports.
6493 * REFERENCES: look-ahead -> lookahead (since that's
6494 what he actually wrote).
6495 * doc/refcard.tex: look ahead -> lookahead,
6496 look-ahead -> lookahead
6497
742e4900
JD
64982006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
6499
6500 For consistency, use `lookahead' instead of `look-ahead' or
6501 `look_ahead'. Discussed starting at
6502 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
6503 and then at
6504 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
6505 * NEWS: For the next release, note the change to `--report'.
6506 * TODO, doc/bison.1: Update English.
6507 * doc/bison.texinfo: Update English.
6508 (Understanding Your Parser, Bison Options): Document as
6509 `--report=lookahead' rather than `--report=look-ahead'.
6510 * src/conflicts.c: Update English in comments.
6511 (lookahead_set): Rename from look_ahead_set.
6512 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
6513 (resolve_sr_conflict): Rename local look_ahead_tokens to
6514 lookahead_tokens, and update other uses.
6515 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
6516 count_rr_conflicts, conflicts_free): Update uses.
6517 * src/getargs.c (report_args): Move "lookahead" before alternate
6518 spellings.
6519 (report_types): Update uses.
6520 (usage): For `--report' usage description, state `lookahead' spelling
6521 rather than `look-ahead'.
6522 * src/getargs.h (report.report_lookahead_tokens): Rename from
6523 report_look_ahead_tokens.
6524 * src/lalr.c: Update English in comments.
6525 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
6526 (state_lookahead_tokens_count): Rename from
6527 state_look_ahead_tokens_count.
6528 Rename local n_look_ahead_tokens to n_lookahead_tokens.
6529 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
6530 Rename local n_look_ahead_tokens to n_lookahead_tokens.
6531 Update other uses.
6532 Update English in output.
6533 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
6534 * src/print.c: Update English in comments.
6535 (lookahead_set): Rename from look_ahead_set.
6536 (print_reduction): Rename argument lookahead_token from
6537 look_ahead_token.
6538 (print_core, state_default_rule, print_reductions, print_results):
6539 Update uses.
6540 * src/print_graph.c: Update English in comments.
6541 (print_core): Update uses.
6542 * src/state.c: Update English in comments.
6543 (reductions_new): Update uses.
6544 (state_rule_lookahead_tokens_print): Rename from
6545 state_rule_look_ahead_tokens_print, and update other uses.
6546 * src/state.h: Update English in comments.
6547 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
6548 (state_rule_lookahead_tokens_print): Rename from
6549 state_rule_look_ahead_tokens_print.
6550 * src/tables.c: Update English in comments.
6551 (conflict_row, action_row): Update uses.
6552 * tests/glr-regression.at
6553 (Incorrect lookahead during deterministic GLR,
6554 Incorrect lookahead during nondeterministic GLR): Rename
6555 print_look_ahead to print_lookahead.
6556 * tests/torture.at: Update English in comments.
6557 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
6558 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
6559 (Many lookahead tokens): Update uses.
6560 * data/glr.c: Update English in comments.
6561 * lalr1.cc: Likewise.
6562 * yacc.c: Likewise.
6563 * src/conflicts.h: Likewise.
6564 * src/lalr.h: Likewise.
6565 * src/main.c: Likewise.
6566 * src/output.c: Likewise.
6567 * src/parse-gram.c: Likewise.
6568 * src/tables.h: Likewise.
6569 * tests/calc.at: Likewise.
6570
3c40d0b5
JD
65712006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
6572
6573 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
6574
5d278082
PE
65752006-06-07 Paul Eggert <eggert@cs.ucla.edu>
6576
6577 * TODO: Add request from Nelson H. F. Beebe to be able to install
6578 Bison without installing the yacc script.
6579
9e668899
JD
65802006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
6581
6582 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
6583 and yytext if they're already #define'd.
6584 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
6585 * src/scan-code-c.c: ... here.
6586 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
6587 <config.h>.
6588
0c8e079f
JD
65892006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
6590
6591 Get Bison to build again when configured with --enable-gcc-warnings.
6592 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
6593 missing #include's.
6594 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
6595 loc argument as it shadows a global.
6596 * src/scan-gram.l: Remove stray comma that prevents boundary_set
6597 invocation.
6598
6599 * src/.cvsignore: Add scan-code.c.
6600
2346344a
AD
66012006-06-07 Akim Demaille <akim@epita.fr>
6602
6603 * src/scan-gram.l: Move the "add a trailing ; to actions" code
6604 to...
6605 * src/scan-code.l: here.
6606 * tests/input.at (Torturing the Scanner): Fix another location
6607 error.
6608
4862bdfd
AD
66092006-06-07 Akim Demaille <akim@epita.fr>
6610
6611 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
6612
e9071366
AD
66132006-06-06 Akim Demaille <akim@epita.fr>
6614
6615 Extract the parsing of user actions from the grammar scanner.
6616 As a consequence, the relation between the grammar scanner and
6617 parser is much simpler. We can also split "composite tokens" back
6618 into simple tokens.
6619 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
6620 * src/scan-gram.l (add_column_width, adjust_location): Move to and
6621 rename as...
6622 * src/location.h, src/location.c (add_column_width)
6623 (location_compute): these.
6624 Fix the column count: the initial column is 0.
6625 (location_print): Be robust to ending column being 0.
6626 * src/location.h (boundary_set): New.
6627 * src/main.c: Adjust to scanner_free being renamed as
6628 gram_scanner_free.
6629 * src/output.c: Include scan-code.h.
6630 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
6631 Use boundary_set.
6632 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
6633 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
6634 which is now, again, a separate token.
6635 Adjust all dependencies.
6636 Whereever actions with $ and @ are used, use translate_code.
6637 (action): Remove this nonterminal which is now useless.
6638 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
6639 (grammar_current_rule_action_append): Use translate_code.
6640 (packgram): Bound check ruleno, itemno, and rule_length.
6641 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
6642 (last_string, last_braced_code_loc, max_left_semantic_context)
6643 (scanner_initialize, scanner_free, scanner_last_string_free)
6644 (gram_out, gram_lineno, YY_DECL_): Move to...
6645 * src/scan-gram.h: this new file.
6646 (YY_DECL): Rename as...
6647 (GRAM_DECL): this.
6648 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
6649 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
6650 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
6651 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
6652 Move these declarations, and...
6653 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
6654 these to...
6655 * src/flex-scanner.h: this new file.
6656 * src/scan-gram.l (rule_length, rule_length_overflow)
6657 (increment_rule_length): Remove.
6658 (last_braced_code_loc): Rename as...
6659 (gram_last_braced_code_loc): this.
6660 Adjust to the changes of the parser.
6661 Move all the handling of $ and @ into...
6662 * src/scan-code.l: here.
6663 * src/scan-gram.l (handle_dollar, handle_at): Remove.
6664 (handle_action_dollar, handle_action_at): Move to...
6665 * src/scan-code.l: here.
6666 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
6667 scan-code.h, scan-code-c.c, scan-gram.h.
6668 (EXTRA_bison_SOURCES): Add scan-code.l.
6669 (BUILT_SOURCES): Add scan-code.c.
6670 (yacc): Be robust to white spaces.
6671
6672 * tests/conflicts.at, tests/input.at, tests/reduce.at,
6673 * tests/regression.at: Adjust the column numbers.
6674 * tests/regression.at: Adjust the error message.
7891a7c4 6675
184e42f0
JD
66762006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
6677
6678 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
6679 Use Akim's wording from
6680 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
6681
7891a7c4
JD
66822006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
6683
6684 Between Bison releases, manually append `+' to the previous Bison
6685 release number, and use that as a signal to automatically print the
6686 ChangeLog's CVS Id keyword from --version. Discussed starting at
6687 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
6688 * ChangeLog: Add Id header.
6689 * configure.ac (AC_INIT): Append `+' to `2.3'.
6690 * src/.cvsignore: Add revision.c.
6691 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
6692 (BUILT_SOURCES): Add revision.c.
6693 (revision.c): New target rule. This file defines a new global variable
6694 named revision. It initializes it with either the Id from ChangeLog
6695 or, if VERSION doesn't contain `+', with the empty string.
6696 * src/getargs.c (version): Print the value of revision.
6697 * src/revision.h: Extern revision.
6698
4ad3ed84
PE
66992006-06-05 Paul Eggert <eggert@cs.ucla.edu>
6700
6701 * NEWS: Version 2.3.
6702 * configure.ac (AC_INIT): Likewise.
6703
02103984
PE
67042006-05-30 Paul Eggert <eggert@cs.ucla.edu>
6705
6706 * data/glr.c (YYRECOVERING): Define to be a function-like macro
6707 with no arguments, not as an object-like macro. This is for
6708 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
6709 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
6710 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
6711 Document this.
6712
2c08afa5
JD
67132006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
6714
6715 * src/getargs.c (usage): Back out yesterday's modification of the
6716 --help output so that we don't have to wait for translation before
6717 releasing 2.3.
6718
6077da58
PE
67192006-05-29 Paul Eggert <eggert@cs.ucla.edu>
6720
6721 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
6722 Problem reported by Akim Demaille.
6723
2a26b6c2
JD
67242006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
6725
6726 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
6727
aefef0d6
PE
67282006-05-26 Paul Eggert <eggert@cs.ucla.edu>
6729
6730 * data/yacc.c (yy_reduce_print): Omit trailing white space in
6731 generated source code. Problem reported by Frans Englich in
6732 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
6733
fcd8e201
PE
67342006-05-22 Paul Eggert <eggert@cs.ucla.edu>
6735
6736 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
6737 shell, not within 'make', so that 'make' by an ordinary builder
6738 (using GNU make) does not worry about configuring gzip. This also
6739 works around a bug reported independently by Keith Thompson and by
6740 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
6741 stderr rather than stdout, messing up the build logs.
6742
7b5cdcbd
JD
67432006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
6744
6745 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
6746 to make sure that YYID will never be unused. This fixes a 'make
6747 maintainer-check' failure caused by the recent changes to the 'Trivial
6748 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
6749 not used.
6750 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
6751
5ad0a449
JD
67522006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
6753
6754 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
6755 state before an empty RHS is always resolved here. Only the location
6756 of that state is guaranteed to be resolved, and that's enough. This
6757 fixes the remaining bug reported by Derek M. Jones in
6758 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
6759 * tests/glr-regression.at (Uninitialized location when reporting
6760 ambiguity): Test the above case.
6761 Also, the embedded comments in this test case claim it checks the case
6762 of an empty RHS that has inherited the initial location. However, the
6763 corresponding LHS was already resolved, so yyresolveLocations didn't
6764 actually have reason to modify it. Fix this by forcing
6765 nondeterministic operation at the beginning of the parse.
6766
50cce58e
PE
67672006-05-20 Paul Eggert <eggert@cs.ucla.edu>
6768
6769 * data/c.m4 (b4_yy_symbol_print_generate):
6770 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
6771 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
6772 of the bugs reported today by Derek M Jones in
6773 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
6774 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
6775 defined to be a type name without parens or brackets.
6776 (Location Type): Similarly for YYLTYPE.
6777 * tests/regression.at (Trivial grammars): Put in a test for this
6778 bug that will be caught by 'make maintainer-check' (though not,
6779 alas, by 'make check' unless your compiler is picky).
6780
ab8d9dc5
PE
67812006-05-19 Paul Eggert <eggert@cs.ucla.edu>
6782
0d2c8934 6783 * NEWS: Version 2.2.
ab8d9dc5
PE
6784 * configure.ac (AC_INIT): Likewise.
6785
9138c575
JD
67862006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
6787
6788 * data/glr.c (yyreportTree): Make room in yystates for the state
6789 preceding the RHS. This fixes the segmentation fault reported by Derek
6790 M. Jones in
6791 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
6792 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
6793 to the user. Reported for yyreportTree by Derek M. Jones later in the
6794 same thread.
6795 * THANKS: Add Derek M. Jones.
6796 Update my email address.
6797 Fix typo in Steve Murphy's name.
6798
276f48df
PE
67992006-05-14 Paul Eggert <eggert@cs.ucla.edu>
6800
d6645148
PE
6801 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
6802 checking against YYLAST that caused the parser to miss a potential
6803 alternative in its diagnostic.
6804 Problem reported by Maria Jose Moron Fernandez in
6805 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
6806 * data/lalr1.cc (yysyntax_error_): Likewise.
6807 * data/yacc.c (yysyntax_error): Likewise.
6808 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
6809 tokens, in case we run into an older C compiler.
6810 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
6811 Use them to check for the off-by-one error fixed above.
6812
276f48df
PE
6813 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
6814 YYSIZE_T, not size_t.
6815 * tests/regression.at (Trivial grammars): New test, to catch
6816 the error fixed by the above patch.
6817
cd8b5791
AD
68182006-05-14 Akim Demaille <akim@lrde.epita.fr>
6819
6820 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
6821 scheme.
6822 Reported by Steve Murphy.
6823
34376418
AD
68242006-05-14 Akim Demaille <akim@lrde.epita.fr>
6825
6826 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
6827 * data/glr.cc: b4_location_flag is now b4_locations_flag.
6828
327afc7c
AD
68292006-05-14 Akim Demaille <akim@lrde.epita.fr>
6830
6831 Implement --trace=m4.
6832 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
6833 * src/output.c (output_skeleton): When set, pass -dV to m4.
6834
6835 Factor the handling of flags in m4.
6836 * src/output.c (prepare): Rename the muscle names debug, defines,
6837 error_verbose to debug_flag, defines_flag, error_verbose_flag.
6838 * data/c.m4: Adjust.
6839 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
6840 Use b4_define_flag_if to define other b4_FLAG_if macros.
6841 (b4_location_if): As a consequence, rename as...
6842 (b4_locations_if): this, for consistency.
6843 Adjust all the skeletons.
6844
ba9ecd19
AD
68452006-05-14 Akim Demaille <akim@lrde.epita.fr>
6846
6847 * etc/bench.pm: Shorten bench names.
6848
4e83ea15
AD
68492006-05-14 Akim Demaille <akim@lrde.epita.fr>
6850
6851 * src/output.h, src/output.c (error_verbose): Move to...
6852 * src/getargs.h, src/getargs.c: here.
6853 Sort the flags.
6854 Adjust dependencies.
6855
6e93d810
PE
68562006-05-13 Paul Eggert <eggert@cs.ucla.edu>
6857
6858 * data/c.m4 (b4_copyright): Put the special exception for Bison
6859 skeletons here, so we don't have to put it in each skeleton. All
b15296ff
PE
6860 uses changed. Suggested by Akim Demaille. Also, wrap the
6861 copyright notice, in case it is longer than 80 columns. Replace
6862 comma by newline after title.
6e93d810 6863
eaea13f5
PE
68642006-05-11 Paul Eggert <eggert@cs.ucla.edu>
6865
6866 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
6867 incompatibility, not a bug. Mention that it wasn't fixed as of
6868 flex 2.5.33.
6869
3cf084ec
AD
68702006-05-11 Akim Demaille <akim@lrde.epita.fr>
6871
6872 * examples/extexi: Enforce the precedence of concatenation over
6873 >>.
0a9f1c7d 6874 Reported by Tommy Nordgren.
3cf084ec 6875
32c96bd7
AD
68762006-05-11 Akim Demaille <akim@lrde.epita.fr>
6877
6878 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
6879 with the member "token".
f94705b2 6880 Reported by Martin Nylin.
32c96bd7 6881
eaea13f5
PE
68822006-05-08 Paul Eggert <eggert@cs.ucla.edu>
6883
6884 * data/glr.c: Switch to Bison 2.2 special-exception language in
6885 the copyright notice. Use more-regular format for titles and
6886 copyright notices.
6887 * data/glr.cc: Likewise.
6888 * data/location.cc: Likewise.
6889 * data/yacc.cc: Likewise.
6890 * doc/bison.texinfo (Conditions): Document this.
6891 * NEWS: likewise. Upgrade version to 2.2.
6892
6e2d1146
AD
68932006-04-27 Akim Demaille <akim@lrde.epita.fr>
6894
6895 * data/glr.cc: Remove dead code.
6896
47671055
PE
68972006-04-25 Paul Eggert <eggert@cs.ucla.edu>
6898
6899 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
6900 that variable and the line breaks the bootstrap. Problem reported
6901 by Juan M. Guerrero.
6902
ed2e6384
AD
69032006-04-24 Akim Demaille <akim@lrde.epita.fr>
6904
6905 * doc/bison.texinfo (Multiple start-symbols): New.
6906
3cedc2dc
AD
69072006-04-24 Akim Demaille <akim@lrde.epita.fr>
6908
6909 * etc/README, etc/bench.pl: New.
6910
b2ddc3f3
AD
69112006-04-03 Akim Demaille <akim@lrde.epita.fr>
6912
6913 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
6914 rule.
6915 Reported by Mickael Labau.
6916 * tests/input.at (Torturing the Scanner): Test it.
6917
91e3ac9a
PE
69182006-03-16 Paul Eggert <eggert@cs.ucla.edu>
6919
6920 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
6921 Problem reported by Bob Rossi.
6922
69232006-03-13 Paul Eggert <eggert@cs.ucla.edu>
6924
6925 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
6926 and didn't really work.
6927 For the index, use @ifnotinfo, not @iftex.
6928 Minor cleanups of spacing and terminology.
6929
5cf61e93
AD
69302006-03-12 Akim Demaille <akim@lrde.epita.fr>
6931
6932 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
6933 of AT_NAME_PREFIX when %name-prefix is not used.
6934
aa08666d
AD
69352006-03-12 Akim Demaille <akim@lrde.epita.fr>
6936
6937 Apply --prefix to C++ skeletons too: they change the namespace.
6938 The test suite already exercize these cases.
6939 * data/c++.m4 (b4_namespace): New.
6940 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
6941 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
6942 * data/yacc.c, data/glr.c: Remove a useless `[]'.
6943 * doc/bison.texinfo: Document it.
6944 (Option Cross Key): Use @multitable in all formats. It looks
6945 nicer, even in TeX outputs.
6946 (Rules): Use the same code whatever the output type is.
6947 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
6948 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
6949 * tests/calc.at: Use it, instead of hard coding `yy'.
91e3ac9a 6950
45567173
AD
69512006-03-10 Akim Demaille <akim@lrde.epita.fr>
6952
6953 * TODO: Remove dead items.
6954
e9d8f881 69552006-03-10 Akim Demaille <akim@lrde.epita.fr>
55ba27be
AD
6956
6957 * doc/FAQ: Remove, merged into...
6958 * doc/bison.texinfo (FAQ): this.
6959 * doc/Makefile.am (EXTRA_DIST): Adjust.
6960
c095d689
AD
69612006-03-10 Akim Demaille <akim@lrde.epita.fr>
6962
6963 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
6964 even if empty.
6965 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
6966 * doc/bison.texinfo (Calc++ Scanner): Use it.
6967
6e0f8287
PE
69682006-03-09 Paul Eggert <eggert@cs.ucla.edu>
6969
6970 Fix two nits reported by twlevo, plus one more that I discovered.
6971
6972 * src/assoc.h (assoc_to_string): Give a name to the arg, as
6973 this is the usual Bison style.
6974 * src/location.h (location_print): Likewise.
6975
6976 * src/reader.h (token_name): Likewise.
6977
d6b771c3
PE
69782006-03-08 Paul Eggert <eggert@cs.ucla.edu>
6979
6980 Fix some nits reported by twlevo.
6981 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
6982 and "POSIX". Use more-modern syntax for URLs. Mention C++
6983 and ask for Java. Don't hardwire OS version numbers. Add
6984 copyright notice.
6985 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
6986 * src/conflicts.c (solved_conflicts_obstack): Now static.
6987
1e137b71
JD
69882006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
6989
6990 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
6991 page. Say "you can use it" not "you may use it" as on the web page;
6992 we're describing capabilities not granting permission.
6993
73f2e47e
PE
69942006-03-06 Paul Eggert <eggert@cs.ucla.edu>
6995
6d05403d
PE
6996 * data/glr.c (yyresolveLocations): Rename local variables to avoid
6997 shadowing warnings. Use usual patter for iterating through RHS.
6998 * tests/glr-regression.at
6999 (Uninitialized location when reporting ambiguity):
7000 Modify yylex so that it uses its argument, rather than trying
7001 to rely on ARGSUSED (which doesn't work for gcc with warnings).
7002 const char -> char const.
7003
73f2e47e
PE
7004 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
7005 Don't use tabs inside commands; it messes up 'ps'.
7006 Problem reported by twlevo.
7007
8710fc41
JD
70082006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
7009
7010 * tests/glr-regression.at (Uninitialized location when reporting
7011 ambiguity): New test case.
7012 * data/glr.c (yyresolveLocations): New function, which uses
7013 YYLLOC_DEFAULT.
7014 (yyresolveValue): Invoke yyresolveLocations before reporting an
7015 ambiguity.
7016 * doc/bison.texinfo (Default Action for Locations): Note
7017 YYLLOC_DEFAULT's usage for ambiguity locations.
7018 (GLR Semantic Actions): Cross-reference those notes.
7019
ae952af2
JD
70202006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
7021
7022 * tests/glr-regression.at (Leaked semantic values when reporting
7023 ambiguity): Remove unnecessary union and type declarations.
7024 (Leaked lookahead after nondeterministic parse syntax error): New test
7025 case.
7026 * data/glr.c (yyparse): Check for zero stacks remaining before
7027 attempting to shift the lookahead so that you don't lose it.
7028
35ee866a
JD
70292006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
7030
7031 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
7032 * tests/glr-regression.at (Leaked semantic values when reporting
7033 ambiguity): New test case.
7034 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
7035 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
7036 now unnecessary yystackp parameter.
7037 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
7038 destructors can be called.
7039
7040 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
7041 in existing testcases.
7042
520181ab
JD
70432006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
7044
7045 Don't leak semantic values for parent RHS when a user action cuts the
7046 parser, and clean up related code a bit.
7047 * tests/glr-regression.at (Leaked merged semantic value if user action
35ee866a
JD
7048 cuts parse): Rename to...
7049 (Leaked semantic values if user action cuts parse): ... this. Add check
520181ab
JD
7050 for leaked parent RHS values.
7051 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
7052 between an unresolved state (non-empty chain of semantic options) and
7053 an incomplete one (signaled by an empty chain).
ae952af2 7054 (yyresolveStates): Document the interface. Move all manipulation of a
520181ab
JD
7055 successfully or unsuccessfully resolved yyGLRState to...
7056 (yyresolveValue): ... here so that yyresolveValue always leaves a
7057 yyGLRState with consistent data and thus is easier to understand.
7058 Remove the yyvalp and yylocp parameters since they are always just
7059 taken from the yys parameter. When reporting a discarded merged value
7060 in debugging output, note that it is incompletely merged. Document the
7061 interface.
7062 (yyresolveAction): If resolving any of the RHS states fails, destroy
7063 them all rather than leaking them. Thus, as long as user actions are
7064 written to clean up the RHS correctly, yyresolveAction always cleans up
7065 the RHS of a semantic option. Document the interface.
7066
18d9185c
PE
70672006-02-27 Paul Eggert <eggert@cs.ucla.edu>
7068
7069 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
7070 led to a segmentation fault in GNU Pascal. Problem reported
7071 by Waldek Hebisch.
7072
841a7737
JD
70732006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
7074
7075 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
7076 mid-rule action inside a nonterminal symbol in order to declare a
7077 destructor for its semantic value.
7078
fc3f467f
PE
70792006-02-16 Paul Eggert <eggert@cs.ucla.edu>
7080
7081 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
7082 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
7083 __cplusplus && ! defined _STDLIB_H && !
7084 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
7085 defined free))]: Include <stdlib.h> rather than rolling our own
7086 declarations of malloc and free, to avoid problems with
7087 incompatible declarations (using 'throw') C++'s stdlib.h. This
7088 should fix Debian bug 340012
7089 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
7090 reported by Guillaume Melquiond.
7091
a3af26dd
PE
70922006-02-13 Paul Eggert <eggert@cs.ucla.edu>
7093
4d7bc38c
PE
7094 * NEWS: Clarify symbols versus types in unused-value warnings.
7095
a3af26dd
PE
7096 * configure.ac (AC_INIT): Bump version number.
7097
4e26c69e
PE
70982006-02-13 Paul Eggert <eggert@cs.ucla.edu>
7099
7100 * NEWS: Version 2.1a.
7101 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
7102 since C99 requires this.
7103
498e897c
PE
71042006-02-11 Paul Eggert <eggert@cs.ucla.edu>
7105
7106 * m4/c-working.m4: New file.
7107 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
7108
57bb17ca
PE
71092006-02-10 Paul Eggert <eggert@cs.ucla.edu>
7110
7111 * Makefile.maint: Merge from coreutils.
7112
0be105dc
PE
71132006-02-09 Paul Eggert <eggert@cs.ucla.edu>
7114
7115 More portability fixes for problems summarized by Nelson H. F. Beebe.
7116
7117 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
7118 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
7119 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
7120 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
7121 messes up because C++ code is compiled in 32-bit mode but linked
7122 in 64-bit mode.
7123
6fc0c024
PE
71242006-02-08 Paul Eggert <eggert@cs.ucla.edu>
7125
7126 More portability fixes for problems summarized by Nelson H. F. Beebe.
7127
7870f699
PE
7128 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
7129 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
7130
6fc0c024
PE
7131 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
7132 nodist_PROGRAMS, since we don't need to actually compile the
7133 example if we're just doing a plain 'make'. This avoids bothering
7134 the installer unnecessarily about problems due to weird C++
7135 compilers.
7136
fe6c2fde
PE
71372006-02-06 Paul Eggert <eggert@cs.ucla.edu>
7138
7139 More portability fixes for problems summarized by Nelson H. F. Beebe.
7140
7141 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
7142 than #include "...", and compile with -I'.'. The old method was
7143 not portable, according to Posix and the C standard, and it does
7144 not work with Sun C 5.7, where previous #line directives affect
7145 the working directory used in later #include "..." directives.
7146
927b425b
JMG
71472006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7148
7149 Various DJGGP specific issues in /djgpp
7150
d9735e9e
PE
71512006-02-02 Paul Eggert <eggert@cs.ucla.edu>
7152
7153 More portability fixes for problems summarized by Nelson H. F. Beebe.
7154
7155 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
7156 '#include <map>' works and that you can apply ++ to iterators.
7157
5a6755af
PE
71582006-02-01 Paul Eggert <eggert@cs.ucla.edu>
7159
67a0dc4f
PE
7160 Work around portability problems summarized by Nelson H. F. Beebe in
7161 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
7162
8c86f0ef
PE
7163 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
7164 that '#include <string>' works.
7165
de35dd59
PE
7166 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
7167 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
7168 "warning: sorry: semantics of inline function static data `const
7169 unsigned char translate_table[262]' are wrong (you'll wind up with
7170 multiple copies)".
7171
67a0dc4f
PE
7172 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
7173 or, xor to not_, and_, or_, and xor_, respectively. This works
7174 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
7175 random system header somewhere that includes the equivalent of
7176 <iso646.h>.
7177
5a6755af
PE
7178 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
7179 -E" works; it apparently doesn't work with PathScale EKO Compiler
67a0dc4f 7180 Suite Version 2.0.
5a6755af 7181
3f001415
JD
71822006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
7183
7184 During deterministic GLR operation, user actions should be able to
7185 influence the parse by changing yychar. To make this easier to fix and
7186 to make glr.c easier to evolve in general, don't maintain yytoken in
7187 parallel with yychar; just compute yytoken when needed.
7188 * tests/glr-regression.at (Incorrect lookahead during deterministic
7189 GLR): Check that setting yychar in a user action has the intended
7190 effect.
7191 * data/glr.c (yyGLRStack): Remove yytokenp member.
7192 (yyclearin): Don't set *yytokenp.
7193 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
7194 yychar rather than *yytokenp to determine the current lookahead.
7195 Compute yytoken locally when needed.
7196 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
7197 point to.
7198
7199 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
7200 after `--report' documentation.
7201
e2a8c0f5
PE
72022006-01-30 Paul Eggert <eggert@cs.ucla.edu>
7203
7204 * src/parse-gram.y (grammar_declaration): Location of printer
7205 symbol is @1, not list->location. Bug reported by twlevo.
7206 * tests/input.at (Incompatible Aliases): Adjust to above change.
7207
6b702268
PE
72082006-01-29 Paul Eggert <eggert@cs.ucla.edu>
7209
27622431
PE
7210 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
7211 all the test at once. This makes the output easier to read in the
7212 normal case.
7213
6b702268
PE
7214 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
7215 got from <http://bro-ids.org/download.html>. The bug is that
7216 when two actions appeared in succession, the second one was
7217 scanned before the first one was added to the grammar rule
7218 as a midrule action. Bison then output the incorrect warning
7219 "parse.y:905.17-906.36: warning: unused value: $3".
7220 * src/parse-gram.y (BRACED_CODE, action): These are no longer
7221 associated with a value.
7222 (rhs): Don't invoke grammar_current_rule_action_append.
7223 (action): Invoke it here instead.
7224 * src/reader.c (grammar_midrule_action): Now extern.
7225 (grammar_current_rule_action_append): Don't invoke
7226 grammar_midrule_action; that is now the scanner's job.
7227 * src/reader.h (last_string, last_braced_code_loc):
7228 (grammar_midrule_action): New decls.
7229 * src/scan-gram.l (last_string): Now extern, sigh.
7230 (last_braced_code_loc): New extern variable.
7231 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
7232 rule already has an action.
7233 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
7234 * tests/input.at (AT_CHECK_UNUSED_VALUES):
7235 Add some tests to check that the above changes fixed the bug.
7236
d40ba6c2
PE
72372006-01-27 Paul Eggert <eggert@cs.ucla.edu>
7238
7239 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
7240 All used changed. Check whether the symbol has a destructor,
7241 not whether it is typed.
7242 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
7243 that the values are still reported as unused. All line numbers
7244 adjusted.
7245
401aace6
PE
72462006-01-23 Paul Eggert <eggert@cs.ucla.edu>
7247
7248 Work around a bug in bro 0.8, which underparenthesizes its
7249 definition of YYLLOC_DEFAULT.
7250 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
7251 their arguments.
7252 * data/lalr1.cc: Likewise.
7253 * data/yacc.cc: Likewise.
7254
06f01bc4
PE
72552006-01-22 Paul Eggert <eggert@cs.ucla.edu>
7256
401aace6
PE
7257 Work around a bug in Pike 7.0, and give the Pike folks a
7258 better way to override the usual int widths.
7259 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
7260 user can override the types.
7261 (short): #undef, to work around a bug in Pike 7.0.
7262 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
7263 (union yyalloc.yyss): Use yytype_int16 rather than short.
7264 All uses changed.
7265 (yysigned_char): Remove.
7266 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
7267 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
7268 * tests/regression.at (Web2c Actions): Adjust to above changes.
7269
7270 * src/reader.c (check_and_convert_grammar): New function.
7271 (reader): Close the input file even if something went wrong during
7272 parsing. Minor file descriptor leak reported by twlevo.
7273
06f01bc4
PE
7274 * src/assoc.c (assoc_to_string): Use a default: abort (); case
7275 to pacify gcc -Wswitch-default.
7276 * src/scan-gram.l (adjust_location): Use a default: break; case
7277 to pacify gcc -Wswitch-default.
7278 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
7279 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
7280 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
7281 Move these decls to scan-skel.l, since they don't need to be
7282 visible elsewhere.
7283 * src/scan-skel.l: Accept the above decls.
7284 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
7285 is used.
7286
02650b7f
PE
72872006-01-21 Paul Eggert <eggert@cs.ucla.edu>
7288
7289 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
7290 since we don't want to insist on a version number at the start
7291 of the changelog every time.
7292 * Makefile.maint: Sync from coreutils a bit better.
7293 (sc_trailing_blank): Renamed from sc_trailing_space.
7294 All uses changed.
7295 (sc_no_if_have_config_h, sc_require_config_h):
7296 (sc_prohibit_assert_without_use): New rules.
7297 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
7298 (sc_dd_max_sym_length): Fix leading spaces in rule.
7299 (sc_system_h_headers): Prefix with @.
7300 (sc_useless_cpp_parens, m4-check): Output line numbers.
7301 (changelog-check): Allow version only in head.
7302 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
7303 satisfy new Makefile.maint rule.
7304 * data/glr.c: Likewise.
7305 * data/glr.cc: Likewise.
7306 * data/lalr1.cc: Likewise.
7307 * data/yacc.c: Likewise.
7308 * lib/ebitsetv.c: Likewise.
7309 * lib/lbitset.c: Likewise.
7310 * lib/subpipe.c: Likewise.
7311 * lib/timevar.c: Likewise.
7312 * src/system.h: Likewise.
7313 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
7314 * djgpp/Makefile.maint: Add copyright notice.
7315 * djgpp/README.in: Likewise.
7316 * djgpp/config.bat: Likewise.
7317 * djgpp/config.site: Likewise.
7318 * djgpp/config_h.sed: Likewise.
7319 * djgpp/djunpack.bat: Likewise.
7320 * djgpp/config.sed: Fix copyright notice to match standard format.
7321 * djgpp/subpipe.h: Likewise.
7322 * lib/bitsetv-print.c: Likewise.
7323 * lib/bitsetv.c: Likewise.
7324 * lib/subpipe.h: Likewise.
7325 * lib/timevar.c: Likewise.
7326 * lib/timevar.h: Likewise.
7327 * djgpp/subpipe.c: Use standard recipe for config.h.
7328 * lib/abitset.c: Likewise.
7329 * lib/bitset.c: Likewise.
7330 * lib/bitset_stats.c: Likewise.
7331 * lib/bitsetv-print.c: Likewise.
7332 * lib/bitsetv.c: Likewise.
7333 * lib/ebitsetv.c: Likewise.
7334 * lib/get-errno.c: Likewise.
7335 * lib/lbitset.c: Likewise.
7336 * lib/subpipe.c: Likewise.
7337 * lib/timevar.c: Likewise.
7338 * lib/vbitset.c: Likewise.
7339 * tests/local.at: Likewise.
7340 * src/scan-gram.l: Don't include verify.h, since system.h does
7341 that for us.
7342 * .x-sc_require_config_h: New file.
7343 * .x-sc_unmarked_diagnostics: New file.
7344
287c78f6
PE
73452006-01-20 Paul Eggert <eggert@cs.ucla.edu>
7346
287c78f6
PE
7347 Be a bit more systematic about using 'abort'.
7348 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
7349 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
7350 Put 'default: abort ();' before some other case, to satisfy older
7351 pedantic compilers.
7352 * lib/bitset_stats.c (bitset_stats_init): Likewise.
7353 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
7354 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
7355 * src/conflicts.c (resolve_sr_conflict): Likewise.
68cae94e
PE
7356 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
7357 (get_decision_str, get_orientation_str, get_node_alignment_str):
7358 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
7359 (get_linestyle_str, get_arrowstyle_str): Likewise.
7360 * src/conflicts.c (resolve_sr_conflict):
7361 Use a default case rather than one for the one remaining enum
7362 value, to catch invalid enum values as well.
7363 * src/lalr.c (set_goto_map, map_goto):
7364 Prefer "assert (FOO);" to "if (!FOO) abort ();".
7365 * src/nullable.c (nullable_compute, token_definitions_output):
7366 Likewise.
7367 * src/reader.c (packgram, reader): Likewise.
7368 * src/state.c (transitions_to, state_new, state_reduction_find):
7369 Likewise.
7370 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
7371 (symbol_pack): Likewise.
7372 * src/tables.c (conflict_row, pack_vector): Likewise.
287c78f6
PE
7373 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
7374 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
68cae94e
PE
7375 * src/system.h: Don't include <assert.h>.
7376 (assert): New macro.
7377
7378 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
7379 (Destructor Decl, Parser Function, Pure Calling):
7380 Describe rules for braces inside C code more carefully.
287c78f6 7381
c66dfadd
PE
73822006-01-19 Paul Eggert <eggert@cs.ucla.edu>
7383
c21493b8
PE
7384 Fix some porting glitches found by Nelson H. F. Beebe.
7385 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
7386 compilers that don't understand that abort () does not return.
7387 * src/state.c (transitions_to): Likewise.
7388 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
7389 that '#include <cstdlib>' works.
7390 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
7391 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
7392 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
7393 for the benefit of some pre-C99 compilers.
7394
b6e3facf
PE
7395 * bootstrap: Undo changes to gnulib files that autoreconf made.
7396
c66dfadd
PE
7397 Minor fixups to get 'make maintainer-check' to work.
7398 * configure.ac: Don't use -Wnested-externs, as it's incompatible
7399 with the new verify.h implementation.
7400 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
7401 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
7402 * data/yacc.c (YYUSE): Likewise.
7403 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
7404 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
7405 * src/parse-gram.y (declaration): Don't pass a string constant
7406 to a function that expects char *, since GCC might complain
7407 about the constant value.
7408 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
7409 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
7410 before #defining them.
7411 * tests/glr-regression.at
7412 (Incorrectly initialized location for empty right-hand side in GLR):
7413 In yyerror, use the msg arg.
7414 (Corrupted semantic options if user action cuts parse):
7415 (Incorrect lookahead during deterministic GLR):
7416 (Incorrect lookahead during nondeterministic GLR):
7417 Don't name a local var 'index'; it shadows string.h's 'index'.
7418
ed94ef2a
AD
74192006-01-19 Akim Demaille <akim@epita.fr>
7420
7421 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
7422 location, not just parts of it.
7423
e9ad4aec
PE
74242006-01-18 Paul Eggert <eggert@cs.ucla.edu>
7425
d6ca7905
PE
7426 * NEWS: Document the fact that multiple %unions are now allowed.
7427 * doc/bison.texinfo (Union Decl): Likewise.
51cbef6f
PE
7428 * TODO: This feature is now implemented, so remove it from
7429 the wishlist.
d6ca7905 7430
ef1b70e0
PE
7431 * Makefile.maint: Merge with coreutils Makefile.maint.
7432 (CVS_LIST): Use build-aux version if available.
7433 (VERSION_REGEXP): New macro.
7434 (syntax-check-rules): Add sc_no_if_have_config_h,
7435 sc_prohibit_assert_without_use, sc_require_config_h,
7436 sc_useless_cpp_parens.
7437 (sc_obsolete_symbols): Check for O_NDELAY.
7438 (sc_dd_max_sym_length): Track coreutils.
7439 (sc_unmarked_diagnostics): Look in all files, not just *.c.
7440 (sc_useless_cpp_parens): New rule.
7441 (news-date-check): Look for version or today's date.
7442 (changelog-check): Don't require version number near head.
7443 (copyright-check): Use current year instead of hardwiring 2005.
7444 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
7445 (announcement): Add --gpg-key-ID.
7446
7447 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
7448 with "file system".
7449
2073ce56 7450 Avoid undefined behavior that addressed just before the start of an
e9ad4aec
PE
7451 array. Problem reported by twlevo.
7452 * src/reader.c (packgram): Prepend a new sentinel before ritem.
7453 * src/lalr.c (build_relations): Rely on new sentinel.
7454 * src/gram.c (gram_free): Adjust to new sentinel.
7455
b7691f15
JD
74562006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
7457
7458 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
7459 yylookaheadNeeds. All uses updated.
7460 (yysplitStack): Rename local yynewLookaheadStatuses to
7461 yynewLookaheadNeeds.
7462 * data/glr-regression.at (Incorrect lookahead during nondeterministic
7463 GLR): In comments, change `lookahead status' to `lookahead need'.
7464
ddee1b06
PH
74652006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7466
7467 * data/glr.c (yysplitStack): A little stylistic rewrite.
7468
12f4614d
PH
74692006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7470
7471 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
7472
32c29292
JD
74732006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
7474
7475 * doc/bison.texinfo: Fix some typos.
7476 (GLR Semantic Actions): New subsection discussing special
7477 considerations because GLR semantic actions might be deferred.
7478 (Actions): Mention look-ahead usage of yylval.
7479 (Actions and Locations): Mention look-ahead usage of yylloc.
7480 (Special Features for Use in Actions): Add YYEOF entry and mention it
7481 in the yychar entry.
7482 In the yychar entry, remove mention of the local yychar case (pure
7483 parser) since this is irrelevant information when writing semantic
148d66d8 7484 actions and since it's already discussed in `Table of Symbols' where
32c29292
JD
7485 yychar is otherwise described as an external variable.
7486 In the yychar entry, don't call it the `current' look-ahead since it
7487 isn't when semantic actions are deferred.
7488 In the yychar and yyclearin entries, add note about deferred semantic
7489 actions.
7490 Add yylloc and yylval entries discussing look-ahead usage.
7491 (Look-Ahead Tokens): When discussing yychar, don't call it the
7492 `current' look-ahead, and do mention yylval and yylloc.
7493 (Error Recovery): Cross-reference `Action Features' when mentioning
7494 yyclearin.
148d66d8 7495 (Table of Symbols): In the yychar entry, don't call it the `current'
32c29292
JD
7496 look-ahead.
7497 In the yylloc and yylval entries, mention look-ahead usage.
7498
de366a2f 74992006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2781dbd1
JD
7500
7501 * tests/glr-regression.at: Update copyright year to 2006.
7502
bf70fa87
JD
75032006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
7504
7505 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
7506 use during nondeterministic operation to track which stacks have
7507 actually needed the current lookahead.
7508 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
7509 Allocate, deallocate, resize, and otherwise shuffle space for
7510 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
7511 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
7512 appropriately during nondeterministic operation.
7513 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
7514 members to store the current lookahead to be used by the deferred
7515 user action.
7516 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
7517 from which the RHS is taken. Set the lookahead members of the new
7518 yySemanticOption according to the lookahead status for stack yyk.
7519 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
7520 yyaddDeferredAction.
7521 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
7522 members of yySemanticOption before invoking yyuserAction, and then set
7523 them back to their current values afterward.
7524 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
7525 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
7526 * tests/glr-regression.at: Remove `.' from the ends of recent test case
7527 titles for consistency.
7528 (Leaked merged semantic value if user action cuts parse): In order to
7529 suppress lint warnings, use arguments in merge function, and assign
7530 char value < 128 in main.
7531 (Incorrect lookahead during deterministic GLR): New test case.
7532 (Incorrect lookahead during nondeterministic GLR): New test case.
7533
05449a2c
JD
75342006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
7535
de366a2f 7536 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
05449a2c
JD
7537 !yyvaluep as signal that no semantic value is available to print.
7538 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
7539 to print a semantic value.
7540
4158e0a1 75412006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
fd2493f7 7542
4158e0a1
JD
7543 * tests/glr-regression.at: For consistency with my newer test cases,
7544 don't thank myself.
7545
d659304d
JD
75462006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
7547
7548 * data/glr.c (yyresolveValue): When merging semantic options, if at
7549 least one user action succeeds but a later one cuts the parse, then
7550 destroy the semantic value before returning rather than leaking it.
7551 (yyresolveStates): If a user action cuts the parse and thus
7552 yyresolveValue fails, ignore the (unset) semantic value rather than
7553 corrupting the yyGLRState, and empty the semantic options list since
7554 the user actions should have called all necessary destructors.
7555 Simplify code with YYCHK.
7556 * tests/glr-regression.at (Corrupted semantic options if user action
7557 cuts parse): New test case.
7558 (Undesirable destructors if user action cuts parse): New test case.
7559 Before applying any of this patch, this test case never actually failed
7560 for me... but only because the corrupted semantic options usually
7561 masked this bug.
7562 (Leaked merged semantic value if user action cuts parse): New test
7563 case.
7564
6ec2c0f2
AD
75652006-01-05 Akim Demaille <akim@epita.fr>
7566
7567 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
7568
1b9c21fb
PE
75692006-01-04 Paul Eggert <eggert@cs.ucla.edu>
7570
7571 * data/c.m4 (b4_c_modern): New macro, with a new provision for
7572 _MSC_VER. Problem reported by Cenzato Marco.
7573 (b4_c_function_def): Use it.
7574 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
7575 b4_c_modern.
7576 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
7577 than rolling our own.
7578
84866159
AD
75792006-01-04 Akim Demaille <akim@epita.fr>
7580
7581 Also warn about non-used mid-rule values.
7582 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
7583 member.
7584 (symbol_list_new): Adjust.
7585 * src/reader.c (symbol_typed_p): New.
7586 (grammar_rule_check): Use it.
7587 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
7588 Check its rule.
7589 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
7590 Use it.
7591 * tests/actions.at (Exotic Dollars): Adjust.
7592
378f4bd8
AD
75932006-01-04 Akim Demaille <akim@epita.fr>
7594
7595 * src/reader.c (grammar_midrule_action): If $$ is set in a
7596 mid-rule, move the `used' bit to its lhs.
7597 * tests/input.at (Unused values): New.
7598 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
7599
e2a21b6f
PE
76002006-01-03 Paul Eggert <eggert@cs.ucla.edu>
7601
54662697
PE
7602 * doc/bison.texinfo (Bison Options): Say more accurately what
7603 --yacc does.
7604 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
7605 about declarations in the grammar when in Yacc mode, as POSIX does
7606 not require a diagnostic when the grammar uses extensions.
7607
7608 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
7609
073f9288
PE
7610 Warn about dubious constructions like "%token T T".
7611 Reported by twlevo.
7612 * src/symtab.h (struct symbol.declared): New member.
7613 * src/symtab.c (symbol_new): Initialize it to false.
7614 (symbol_class_set): New arg DECLARING, specifying whether
7615 this is a declaration that we want to warn about, if there
7616 is more than one of them. All uses changed.
7617
1221b78a
PE
7618 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
7619 Allow multiple %union directives, whose contents concatenate.
7620 * src/parse-gram.y (grammar_declaration): Likewise.
7621 Use muscle_code_grow, so that we don't need stype_line any more.
7622 All uses changed.
7623
7624 * src/muscle_tab.c (muscle_grow): Fix comment.
7625
e2a21b6f
PE
7626 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
7627 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
7628 Update copyright year to 2006.
7629
8f7e3cf9
AD
76302006-01-03 Akim Demaille <akim@epita.fr>
7631
7632 Have glr.cc pass (some of) the calc.at tests.
7633 * data/glr.cc (b4_parse_param_orig): New.
7634 (b4_parse_param): Improve its definition, and bound it more
7635 clearly in the skeleton.
7636 (b4_epilogue): Append, instead of prepending, in order to keep
7637 #line consistency.
7638 Simplify the generation of auxiliary functions: locations and
7639 purity are mandated.
7640 (b4_global_tokens_and_yystype): Honor it.
7641 * data/location.cc (c++.m4): Don't include it.
7642 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
7643 and AT_SKEL_CC_IF.
7644 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
7645 AT_LALR1_CC_IF.
7646 Be sure to initialize the first position's filename.
7647 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
7648 mandated anyway.
7649 (AT_CHECK_CALC_GLR_CC): New.
7650 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
7651
3953ed88
AD
76522006-01-02 Akim Demaille <akim@epita.fr>
7653
7654 * src/output.c (output_skeleton): Don't hard wire the inclusion of
7655 c.m4.
0a96ba81 7656 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3953ed88
AD
7657 * data/glr.cc: Do not include stack.hh.
7658
9ecafbbf
AD
76592006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
7660
7661 * data/glr.c: Reformat whitespace with tabs.
7662 (b4_lpure_formals): Remove this unused m4 macro.
7663 * tests/cxx-type.at: Reformat whitespace with tabs.
7664 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
7665 since it's a member. Rename type to isNterm for clarity.
7666
c4d497a0
AD
76672005-12-29 Akim <akim@sulaco.local>
7668
7669 Let glr.cc catch up with symbol_value_print.
7670 * data/glr.cc (b4_yysymprint_generate): Replace by...
7671 (b4_yy_symbol_print_generate): this.
7672 (yy_symbol_print, yy_symbol_value_print): Declare them.
7673
4517da37
PE
76742005-12-28 Paul Eggert <eggert@cs.ucla.edu>
7675
7676 * src/location.h (boundary): Note that a line or column equal
7677 to INT_MAX indicates an overflow.
7678 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
7679 (rule_length_overflow, increment_rule_length, add_column_width):
7680 New functions.
7681 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
7682 (<SC_BRACED_CODE>"}"):
7683 Use increment_rule_length rather than incrementing it by hand.
7684 (adjust_location, handle_syncline): Diagnose overflow.
7685 (handle_action_dollar, handle_action_at):
7686 Fix bug with monstrosities like $-2147483648.
7687 Remove now-unnecessary checks.
7688 (scan_integer): Verify assumptions and remove now-unnecessary checks.
7689 (convert_ucn_to_byte): Verify assumptions.
7690 (handle_syncline): New arg LOC. All callers changed.
7691 Don't store through a value derived from char const * pointer.
7692
7693 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
7694 GCC warnings.
7695
e3233bf6
PE
76962005-12-27 Paul Eggert <eggert@cs.ucla.edu>
7697
7698 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
7699 Remove unnecessary forward static decls.
7700
8f3596a6
AD
77012005-12-27 Akim Demaille <akim@epita.fr>
7702
7703 * src/reader.c (grammar_current_rule_check): Also check that $$
7704 is used.
7705 Take the rule to check as argument, hence rename as...
7706 (grammar_rule_check): this.
7707 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
7708 Rename as...
7709 (grammar_rule_begin, grammar_rule_end): these, for consistency.
7710 (grammar_midrule_action, grammar_symbol_append): Now static.
7711 * tests/torture.at (input): Don't rely on the default action
7712 being always performed.
7713 * tests/calc.at: "Set" $$ even when the action is "cut" with
7714 YYERROR or other.
7715 * tests/actions.at (Exotic Dollars): Instead of using unused
7716 values, check that the warning is issued.
7717
721be13c
PE
77182005-12-22 Paul Eggert <eggert@cs.ucla.edu>
7719
7720 * NEWS: Improve wording for unused-value warnings.
7721
a0af42fc
AD
77222005-12-22 Akim Demaille <akim@epita.fr>
7723
7724 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
7725 (b4_yysymprint_generate): Rename as...
7726 (b4_yy_symbol_print_generate): this.
7727 Generate yy_symbol_print instead of yysymprint.
7728 Generate also yy_symbol_value_print, and use it.
7729
affac613
AD
77302005-12-22 Akim Demaille <akim@epita.fr>
7731
721be13c 7732 * NEWS: Warn about unused values.
affac613
AD
7733 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
7734 a `used' member.
7735 (symbol_list_n_get, symbol_list_n_used_set): New.
7736 (symbol_list_n_type_name_get): Use symbol_list_n_get.
7737 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
7738 * src/reader.c (grammar_current_rule_check): Check that values are
7739 used.
7740 * src/symtab.c (symbol_print): Accept 0.
7741 * tests/existing.at: Remove the type information.
7742 Empty the actions.
7743 Remove useless actions (beware of mid-rule actions: perl -000
7744 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
7745 * tests/actions.at (Exotic Dollars): Use unused values.
7746 * tests/calc.at: Likewise.
7747 * tests/glr-regression.at (No users destructors if stack 0 deleted):
7748 Likewise.
7749
7750 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
7751 rule_useful_p.
7752
9d9b8b70
PE
77532005-12-21 Paul Eggert <eggert@cs.ucla.edu>
7754
8bb4c753
PE
7755 Undo 2005-12-01 tentative license wording change. The wording is
7756 still being reviewed by the lawyers, and we don't want to wait for
7757 them before publishing a test release. For now, revert to the
7758 previous wording.
7759 * NEWS: Undo 2005-12-01 change.
7760 * data/glr.c: Revert to previous license wording.
7761 * data/glr.cc: Likewise.
7762 * data/lalr1.cc: Likewise.
7763 * data/location.cc: Likewise.
7764 * data/yacc.c: Likewise.
7765
9d9b8b70
PE
7766 * NEWS: Reword %destructor vs YYABORT etc.
7767 * data/glr.c: Use American spacing, for consistency.
7768 * data/glr.cc: Likewise.
7769 * data/lalr1.cc: Likewise.
7770 * data/yacc.c: Likewise.
7771 * data/yacc.c: Reformat comments slightly.
7772 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
7773 for consistency. Fix some spelling errors and reword recently-included
7774 text slightly.
7775 * tests/cxx-type.at: Cast results of malloc, for C++.
7776
2c3b392a
AD
77772005-12-21 Joel E. Denny <address@hidden>
7778
7779 * tests/cxx-type.at: Construct a tree, count the parents of shared
7780 nodes, and free each node once and only once. Previously, the memory
7781 for semantic values was leaked instead.
7782
d6cff4dc
AD
77832005-12-21 Joel E. Denny <address@hidden>
7784
7785 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
7786 (yylval, yylloc): If pure, #define to yystackp->yyval and
7787 yystackp->yyloc similar to yychar and yynerrs.
7788 (yyparse): If pure, remove local yylval and yylloc. Add local
7789 yystackp to accommodate pure definitions of yylval and yylloc.
7790 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
7791 yylvalp and yyllocp to &yylval and &yylloc.
7792 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
7793 namespace. Previously, nerrs and char were missing, but lval and lloc
7794 weren't necessary.
7795 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
7796 yylvalp and yyllocp parameters since, if pure, these are now always
7797 accessible through yystackp. If not pure, they are still accessible
7798 globally.
7799 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
7800 `if (YYID (N))' to pacify lint.
7801
a85284cf
AD
78022005-12-21 Akim Demaille <akim@epita.fr>
7803
7804 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
7805 destroy the RHS symbols of a rule.
7806 * data/yacc.c (yylen): Initialize to 0.
7807 Keep its value to the number of items to possibly shift.
7808 In particular, a regular successful parse that ends on YYFINAL by
7809 a (internal) YYACCEPT must not have yylen != 0.
7810 (yyerrorlab, yyreturn): Pop the RHS.
7811 Reorder a bit to emphasize the `shifting' bits of code.
7812 (YYPOPSTACK): Now accept a number of items to pop.
7813 * data/lalr1.cc: Likewise.
7814 * data/glr.c: Formatting changes.
7815 Use goto instead of fall through.
7816 * doc/bison.texinfo (Destructor Decl): Complete.
7817
d508c281
JMG
78182005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7819
7820 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
7821 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
7822 * djgpp/config.bat: Replace every occurence of the file name
7823 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
7824 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
7825 * djgpp/config.sed: Replace every occurence of the file name
7826 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
7827 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
7828 * djgpp/djunpack.bat: DJGPP specific file.
7829 * djgpp/fnchange.lst: DJGPP specific file.
7830 * djgpp/README.in: Add new information about how to unpack the bison
7831 source on MSDOS and other systems which have 8.3 file name restrictions
7832 using djunpack.bat and fnchange.lst.
7833
3e7a2cd9
PE
78342005-12-12 Paul Eggert <eggert@cs.ucla.edu>
7835
7836 * bootstrap (build_cvs_prefix): Remove; unused.
7837 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
7838 when getting gnulib.
7839
78402005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
7841
7842 * data/glr.c: Reorder typedef declarations for structs to match order
7843 of struct declarations.
7844 Rename yystack everywhere to yystackp except in yyparse where it's not
7845 a pointer.
7846 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
7847 consistency.
7848 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
7849 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
7850 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
7851 lint.
7852
877519f8
PE
78532005-12-09 Paul Eggert <eggert@cs.ucla.edu>
7854
0eca5a39
PE
7855 * tests/sets.at (Accept): Fix typos in regular expression used to
7856 sed out the final state number.
7857
2cec9080
PE
7858 Work around portability problem on Solaris 10: flex-generated
7859 files include <stdio.h> before <config.h>, which messes up
7860 because the latter defines __EXTENSIONS__. Address the problem
7861 by creating two new little files that include <config.h> first,
7862 then include the flex-generated files. Rewrite everyone else
7863 to include <config.h> first, as well.
7864 * lib/timevar.c: Always include "config.h".
7865 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
7866 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
7867 (EXTRA_bison_SOURCES): New macro.
7868 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
7869 * src/system.h: Don't include config.h.
7870 * src/LR0.c: Include <config.h> first.
7871 * src/assoc.c: Likewise.
7872 * src/closure.c: Likewise.
7873 * src/complain.c: Likewise.
7874 * src/conflicts.c: Likewise.
7875 * src/derives.c: Likewise.
7876 * src/files.c: Likewise.
7877 * src/getargs.c: Likewise.
7878 * src/gram.c: Likewise.
7879 * src/lalr.c: Likewise.
7880 * src/location.c: Likewise.
7881 * src/main.c: Likewise.
7882 * src/muscle_tab.c: Likewise.
7883 * src/nullable.c: Likewise.
7884 * src/output.c: Likewise.
7885 * src/parse-gram.y: Likewise.
7886 * src/print.c: Likewise.
7887 * src/print_graph.c: Likewise.
7888 * src/reader.c: Likewise.
7889 * src/reduce.c: Likewise.
7890 * src/relation.c: Likewise.
7891 * src/state.c: Likewise.
7892 * src/symlist.c: Likewise.
7893 * src/symtab.c: Likewise.
7894 * src/tables.c: Likewise.
7895 * src/uniqstr.c: Likewise.
7896 * src/vcg.c: Likewise.
7897
877519f8
PE
7898 * src/parse-gram.y: Fix minor problems uncovered by lint.
7899 (current_lhs, current_lhs_location): Now static.
7900 (current_assoc): Remove unused variable.
7901
7902 Cleanups so that Bison-generated parsers have less lint.
7903 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
7904 Prepend /*ARGSUSED*/, for lint's sake.
7905 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
7906 definition if 'lint' is defined.
7907 (YYID): New macro (or function, if lint).
7908 All uses of /*CONSTCOND*/0 replaced by YYID(0).
7909 * data/yacc.c: Likewise.
7910 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
7911 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
7912 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
7913 is C++ only.
7914 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
7915 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
7916 Use YYID(0) rather than 0, for lint.
7917 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
7918 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
7919
f5228370
PE
79202005-12-07 Paul Eggert <eggert@cs.ucla.edu>
7921
7922 * tests/glr-regression.at
7923 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
7924 Close memory leak reported by twlevo.
7925
69ce078b
PE
79262005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
7927
6ff99711
PE
7928 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
7929 all stacks.
7930 (yyparse): Iterate another stack in order to call user destructors.
69ce078b
PE
7931 * tests/glr-regression.at (No users destructors if stack 0 deleted):
7932 New test case.
7933 (Duplicated user destructor for lookahead): This test now is expected
7934 to succeed.
7935
af3412cd
PE
79362005-12-01 Paul Eggert <eggert@cs.ucla.edu>
7937
32b5b719 7938 * NEWS: Document the following change.
af3412cd
PE
7939 * data/yacc.c: Say "parser skeleton" rather than "file", since
7940 it's no longer just a file.
7941 * data/glr.c: Grant a special exception for C GLR parsers, that
7942 reads like the already-existing exception for C LALR(1) parsers.
7943 * data/glr.cc: Likewise.
7944 * data/lalr1.cc: Likewise.
7945 * data/location.cc: Likewise.
7946 * data/yacc.c: Reword the "written by" statement to clarify that
7947 it was the parser skeleton, not the entire output file.
7948 * data/glr.c: Written by Paul Hilfinger.
7949 * data/glr.cc: Written by Akim Demaille.
7950 * data/lalr1.cc: Likewise.
7951
035aa4a0
PE
79522005-11-18 Paul Eggert <eggert@cs.ucla.edu>
7953
d9963c85
PE
7954 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
7955 Fix typos in previous change that broke 'make check'.
7956 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
7957 supported in C.
7958 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
7959 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
7960 We can revert this once things settle down.
7961
035aa4a0
PE
7962 * src/conflicts.c (conflicts_print): Don't print file name twice
7963 when %expect fails because there were no conflicts.
7964 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
7965 change.
7966 * tests/conflicts.at (%expect not enough, %expect too much):
7967 (%expect with reduce conflicts): Adjust to new behavior.
7968
79692005-11-18 Akim Demaille <akim@epita.fr>
7970
7971 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
7972 errors.
7973 * NEWS: Document this.
7974 * doc/bison.texinfo (Expect Decl): Likewise.
7975
d1ff7a7c
AD
79762005-11-16 Akim Demaille <akim@epita.fr>
7977
7978 Generalize the display of semantic values and locations in traces.
7979 * data/glr.c (yy_reduce_print): Fix indices (again).
7980 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
7981 literal integers.
7982 * data/lalr1.cc (yyreduce_print): Rename as...
7983 (yy_reduce_print): this.
7984 Display values and locations.
7985 * data/yacc.c (yy_reduce_print): Likewise.
7986 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
7987 (yysymprint): Move higher to be visible from yy_reduce_print).
7988 (yyparse): Adjust.
7989 * tests/calc.at: Adjust the expected length of the traces.
7990
6de5398d
AD
79912005-11-14 Akim Demaille <akim@epita.fr>
7992
7993 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
7994 from 1 to N, while values and location start at 0.
7995 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
7996
a1373f55
AD
79972005-11-14 Akim Demaille <akim@epita.fr>
7998
7999 * data/glr.c (yy_reduce_print): Fix the $ number.
8000
613d8952
AD
80012005-11-14 Akim Demaille <akim@epita.fr>
8002
8003 "Use" parse parameters.
8004 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
8005 * data/glr.c, data/glr.cc: Use them.
8006 * data/glr.c (YYUSE): Have a C++ definition that supports
8007 non-pointer types.
8008
b2741627
AD
80092005-11-14 Akim Demaille <akim@epita.fr>
8010
8011 * data/glr.c (yyexpandGLRStack): Declare only if defined.
8012
5059b5c8
AD
80132005-11-14 Akim Demaille <akim@epita.fr>
8014
42249483
AD
8015 * data/glr.cc: New.
8016 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5059b5c8 8017
4626a15d
AD
80182005-11-12 Akim Demaille <akim@epita.fr>
8019
8020 Let position and location be PODs.
8021 * data/location.cc (position::initialize, location::initialize): New.
8022 (position::position, location::location): Define only if
8023 b4_location_constructors is defined.
8024 * data/lalr1.cc (b4_location_constructors): Define it for backward
8025 compatibility.
8026 * doc/bison.texinfo (Initial Action Decl): Use initialize.
8027
80282005-11-12 Akim Demaille <akim@epita.fr>
98ae9643
AD
8029
8030 * data/lalr1.cc: Move the body of the ctor and dtor into the
8031 parser file (instead of the header).
8032 Wrap the implementations in a "namespace yy".
8033
80342005-11-12 Akim Demaille <akim@epita.fr>
8035
8036 Have glr.c include its header file when created.
8037 * data/glr.c (b4_shared_declarations): New.
8038 Output them verbatim in the parser if !%defines, otherwise
8039 output then in the header file, and include it instead.
8040
1989d947
AD
80412005-11-11 Akim Demaille <akim@epita.fr>
8042
8043 * data/glr.c: Comment changes.
8044
80452005-11-11 Akim Demaille <akim@epita.fr>
62b08cfc
AD
8046
8047 When yydebug, report semantic and location values for reductions.
8048 * data/glr.c (yy_reduce_print): Report the semantic values and the
8049 locations.
8050 (YY_REDUCE_PRINT): Adjust.
8051 (yyglrReduce): Use them.
8052 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
8053 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
8054 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
8055 traces.
8056
02998094
AD
80572005-11-10 Akim Demaille <akim@epita.fr>
8058
8059 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
8060 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
8061 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
8062
5210672f
PE
80632005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
8064
8065 * m4/cxx.m4, examples/Makefile.am: Don't build
8066 examples/calc++ if no C++ compiler is available. (trivial change)
8067
a8991a1d
AD
80682005-11-09 Akim Demaille <akim@epita.fr>
8069
8070 * src/scan-skel.l: Use a couple of asserts.
8071
36b5e963
AD
80722005-11-03 Akim Demaille <akim@epita.fr>
8073
8074 In some (weird) cases, the final state number is incorrect.
8075 Reported by Alexandre Duret-Lutz.
8076 * src/LR0.c (state_list_append): Remove the computation of
8077 final_state.
8078 (save_reductions): Do it here.
8079 (get_state): Alpha conversion.
8080 (generate_states): Use a for loop.
8081 * src/gram.h (item_number_is_rule_number)
8082 (item_number_is_symbol_number): New.
8083 * src/state.c: Use assert.
8084 * src/system.h: Include assert.h.
8085 * tests/sets.at (Accept): New.
8086
44e7ead1
PH
80872005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8088
8089 * data/glr.c (yyfill): Adjust comment.
36b5e963 8090 (yyresolveAction): Initialize default location properly
44e7ead1
PH
8091 for empty right-hand sides.
8092 (yydoAction): Ditto.
8093 Add comment explaining apparently dead code.
36b5e963
AD
8094 * tests/glr-regression.at
8095 (Incorrectly initialized location for empty right-hand side in GLR):
44e7ead1 8096 New test.
36b5e963 8097
e10a80ee
PE
80982005-10-30 Paul Eggert <eggert@cs.ucla.edu>
8099
8100 * bootstrap (cleanup_gnulib): New function. Use it to clean up
8101 gnulib when interrupted. This fixes some race conditions and
8102 works around some portability problems (one noted by Paul
8103 Hilfinger).
8104
067b32ee
AD
81052005-10-22 Akim <akim@epita.fr>
8106
8107 * Makefile.cfg: Adjust to config -> build-aux.
8108 Reported by twledo.
8109
4b367315
AD
81102005-10-21 Akim Demaille <akim@epita.fr>
8111
8112 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
8113 the %parse-params.
8114 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
8115 * data/yacc.c (b4_Pure_if): Rename as...
8116 (b4_yacc_pure_if): this.
8117 (YY_SYMBOL_PRINT, yyparse): Adjust.
8118 * doc/bison.texinfo: Formatting changes.
8119
24cc23d9
AD
81202005-10-21 Akim Demaille <akim@epita.fr>
8121
8122 Finish the transition config -> build-aux.
8123 * configure.ac, Makefile.am: Use build-aux.
8124 * config/prev-version, config/announce-gen, config/Makefile.am:
8125 Move to...
8126 * build-aux/prev-version, build-aux/announce-gen,
8127 * build-aux/Makefile.am: here.
8128
d4476375
AD
81292005-10-14 Akim Demaille <akim@epita.fr>
8130
8131 * examples/calc++/test: Use set -x only when VERBOSE.
8132
302c0aee
PE
81332005-10-13 Paul Eggert <eggert@cs.ucla.edu>
8134
8135 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
8136 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
8137
7625ec2c
AD
81382005-10-13 Akim Demaille <akim@epita.fr>
8139
8140 * src/scan-skel.l: Output the base name parts of the parser and
8141 header file names.
302c0aee 8142 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7625ec2c
AD
8143 additional checks.
8144 Use this to exercise C++ outputs in subdirs.
8145 Reported by Oleg Smolsky.
8146
ba0fe3c7
PE
81472005-10-12 Paul Eggert <eggert@cs.ucla.edu>
8148
8149 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
8150 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
8151 Problem reported by John P. Hartmann.
8152 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
8153 already defined it.
8154
9b8a5ce0
AD
81552005-10-12 Akim Demaille <akim@epita.fr>
8156
8157 * src/parse-gram.y (version_check): Exit 63 to please missing
8158 (stands for "version mismatch).
8159 * tests/input.at, doc/bison.texinfo: Adjust.
8160
4f6e011e
PE
81612005-10-10 Paul Eggert <eggert@cs.ucla.edu>
8162
8163 Work around portability problems with Visual Age C compiler
8164 (xlc and xlC_r) reported by John P. Hartmann.
8165 * data/location.cc (initial_column, initial_line): Remove.
8166 All uses replaced by 0 and 1.
8167 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
8168 that xlc complains about.
8169 * src/scan-skel.l (skel_wrap): Likewise.
4d7aa45e 8170 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
ba0fe3c7 8171 as __STDC__.
4d7aa45e
PE
8172 * data/yacc.c (YYMODERN_C): New macro, which also looks at
8173 __STDC_VERSION__. Use it everywhere instead of looking at
8174 __STDC__ and __cplusplus.
4f6e011e 8175
a1b3bf8c
AD
81762005-10-10 Akim Demaille <akim@epita.fr>
8177
8178 * examples/calc++/test: Be quiet unless VERBOSE.
8179
412e44aa
PE
81802005-10-05 Paul Eggert <eggert@cs.ucla.edu>
8181
2a4647a3
PE
8182 * data/c.m4 (yydestruct, yysymprint):
8183 Use YYUSE instead of casting to void.
8184 * data/glr.c (YYUSE): New macro.
8185 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
8186 Use it instead of rolling our own.
8187 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
8188 (YYCHK1):
8189 Use /*CONSTCOND*/ to suppress lint warnings.
8190 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
8191 (YY_STACK_PRINT): Use 'false' not '0'.
8192 (YYUSE): New macro.
8193 (yysymprint_, yydestruct_): Use it instead of rolling our own.
8194 * data/yacc.c (YYUSE): New macro.
8195 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
8196 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
8197 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
8198
8199
412e44aa
PE
8200 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
8201 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
8202
88c6637f
PE
82032005-10-04 Paul Eggert <eggert@cs.ucla.edu>
8204
2f4f028d
PE
8205 Undo the parts of the unlocked-I/O change that substituted
8206 putc or puts for printf. This might hurt performance a bit,
8207 but some people prefer the printf style.
8208 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
8209 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
8210 All uses replaced by YYFPRINTF and YYDPRINTF.
8211 * data/yacc.c: Likewise.
8212 * lib/bitset.c (bitset_print): Likewise.
8213 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
8214 putc and puts.
8215 * lib/lbitset.c (debug_lbitset): Likewise.
8216 * src/closure.c (print_firsts, print_fderives): Likewise.
8217 * src/gram.c (grammar_dump): Likewise.
8218 * src/lalr.c (look_ahead_tokens_print): Likewise.
8219 * src/output.c (escaped_output): Likewise.
8220 (user_actions_output): Break apart two printfs.
8221 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
8222 * src/reduce.c (reduce_print): Likewise.
8223 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
8224 * src/system.h: Include unlocked-io.h rathe than stdio.h.
8225
88c6637f
PE
8226 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
8227 Use assignments rather than casts-to-void to suppress
8228 unused-variable warnings. This pacifies 'lint'.
8229 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
8230 unused-variable warnings.
8231
fb32e373
JMG
82322005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8233
8234 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
8235
edb8f44f
PE
82362005-10-02 Paul Eggert <eggert@cs.ucla.edu>
8237
fb9c0b33
PE
8238 Use unlocked I/O for a minor performance improvement on hosts like
8239 GNU/Linux and Solaris that support unlocked I/O. The basic idea
8240 is to use the gnlib unlocked-io module, and to prefer putc and
8241 puts to printf when either will work (since the latter doesn't
8242 come in an unlocked flavor).
8243 * bootstrap (gnulib_modules): Add unlocked-io.
8244 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
8245 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
8246 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
8247 and similarly for puts and putc and printf.
8248 * data/yacc.c: Likewise.
8249 * lib/bitset.c (bitset_print): Likewise.
8250 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
8251 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
8252 to printf.
8253 * lib/lbitset.c (debug_lbitset): Likewise.
8254 * src/closure.c (print_firsts, print_fderives): Likewise.
8255 * src/gram.c (grammar_dump): Likewise.
8256 * src/lalr.c (look_ahead_tokens_print): Likewise.
8257 * src/output.c (escaped_output): Likewise.
8258 (user_actions_output): Coalesce two printfs.
2f4f028d 8259 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
fb9c0b33
PE
8260 * src/reduce.c (reduce_print): Likewise.
8261 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2f4f028d 8262 * src/system.h: Include unlocked-io.h rather than stdio.h.
fb9c0b33 8263
edb8f44f
PE
8264 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
8265 this confuses xgettext.
8266
b50d2359
AD
82672005-10-02 Akim Demaille <akim@epita.fr>
8268
8269 * bootstrap (gnulib_modules): Add strverscmp.
8270 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
8271 * m4/.cvsignore: Add strverscmp.m4.
8272 * src/parse-gram.y (%require): New token, new rule.
8273 (version_check): New.
8274 * src/scan-gram.l (%require): Adjust.
8275 * tests/input.at (AT_REQUIRE): New.
8276 Use it.
8277 * doc/bison.texinfo (Require Decl): New.
8278 (Calc++ Parser): Use %require.
8279
21667f64
AD
82802005-10-02 Akim Demaille <akim@epita.fr>
8281
8282 * data/location.cc: New.
8283
2b81e969
AD
82842005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
8285 Akim Demaille <akim@epita.fr>
8286
8287 Make sure -odir/foo.cc creates dir/location.hh etc.
8288 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
8289 (spec_file_prefix, spec_verbose_file, spec_graph_file)
8290 (spec_defines_file): Now const.
8291 (dir_prefix): New.
8292 (short_base_name): Remove.
8293 * src/files.c: Adjust.
8294 (dirname.h): Include.
8295 (base_name): Don't prototype it.
8296 (finput): Remove, duplicates gram_in.
8297 (full_base_name, short_base_name): Replace by...
8298 (all_but_ext, all_but_tab_ext): these.
8299 (compute_base_names): Rename as...
8300 (compute_file_name_parts): this.
8301 Update to compute the new variables, including dir_prefix.
8302 Adjust dependencies.
8303 * src/output.c (prepare): Output them.
8304 * src/reader.c: Adjust to use gram_in, not finput.
8305 * src/scan-skel.l (@dir_prefix@): New.
8306
ad6a9b97
JMG
83072005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8308
8309 * lib/subpipe.c: New function end_of_output_subpipe() added
8310 to allow support for non-posix systems. This is a no-op function
8311 for posix systems.
8312
8313 * lib/subpipe.h: New function end_of_output_subpipe() added
8314 to allow support for non-posix systems. This is a no-op function
8315 for posix systems.
8316
8317 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
8318 handle the lack of pipe/fork functionality on non-posix systems.
8319
8320 * djgpp/Makefile.maint: DJGPP specific file.
8321
8322 * djgpp/README.in: DJGPP specific file.
8323
8324 * djgpp/config.bat: DJGPP specific configuration file.
8325
8326 * djgpp/config.sed: DJGPP specific configuration file.
8327
8328 * djgpp/config.site: DJGPP specific configuration file.
8329
8330 * djgpp/config_h.sed: DJGPP specific configuration file.
8331
8332 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
8333
8334 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
8335
fc695704
AD
83362005-10-02 Akim Demaille <akim@epita.fr>
8337
8338 * data/location.cc: New, extract from...
8339 * data/lalr1.cc: here.
8340 (location.hh): Include it after the user prologue, in case the
8341 filename type is defined by the user.
8342 Forward declation location and position before the pre-prologue.
8343 (yyresult_): Rename as...
8344 (yyresult): this, it's a local variable, not an attribute.
8345 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
8346
83472005-10-01 Akim Demaille <akim@epita.fr>
5215c87f
AD
8348
8349 * examples/extexi: Restore the #line generation.
8350
fb9712a9
AD
83512005-09-30 Akim Demaille <akim@epita.fr>,
8352 Alexandre Duret-Lutz <adl@gnu.org>
8353
8354 Move the token type and YYSTYPE in the parser class.
8355 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
8356 (parser::token): New, from the moved free definition of tokens.
8357 (parser::semantic_value): Now a full definition instead of an
8358 indirection to YYSTYPE.
8359 (b4_post_prologue): No longer included in the header file, but
8360 in the implementation file.
8361 * doc/bison.texi (C+ Language Interface): Update.
8362 * src/parse-gram.y: Support unary %define.
8363 * tests/actions.at: Define global_tokens_and_yystype for backward
8364 compatibility until we update the tests.
8365 * tests/calc.at: Idem.
8366 (first_line, first_column, last_line, last_column): Define for lalr1.cc
8367 to simplify the code.
8368
55f0c7b1
PE
83692005-09-29 Paul Eggert <eggert@cs.ucla.edu>
8370
8371 Port to SunOS 4.1.4, which lacks strtoul and strerror.
8372 Ah, the good old days! Problem reported by Peter Klein.
8373 * bootstrap (gnulib_modules): Add strerror, strtoul.
8374 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
8375 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
8376
fb9712a9 83772005-09-29 Akim Demaille <akim@epita.fr>
d4fb5e3c
AD
8378
8379 * data/c.m4 (b4_error_verbose_if): New.
8380 * data/lalr1.cc: Use it.
8381 (YYERROR_VERBOSE_IF): Remove.
8382 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
8383 parser members, replaced by...
8384 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
8385 local variables.
8386 (yysyntax_error_): Takes the state number as argument.
8387 (yyreduce_print_): Use the argument yyrule, not the former
8388 attribute yyn_.
8389
8a6f72f3
PE
83902005-09-26 Paul Eggert <eggert@cs.ucla.edu>
8391
8392 * bootstrap (gnulib_modules): Add verify.
8393 * lib/.cvsignore: Add verify.h.
8394 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
8395 * src/system.h (verify): Remove.
8396 Include verify.h instead.
8397 * src/tables.c (tables_generate): Use new API for 'verify'.
8398
0d50976f
PE
83992005-09-21 Paul Eggert <eggert@cs.ucla.edu>
8400
ebc3737e
PE
8401 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
8402 local variables whose names begin with 'yy'.
8403 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
8404 Trivial changes from Joel E. Denny.
8405
0d50976f
PE
8406 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
8407 it itself.
8408 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
8409 don't use alloca any more.
8410
8411 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
8412 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
62c4328e 8413 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
0d50976f
PE
8414 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
8415 to match yacc.c, to test more hosts.
8416
a05b79df
PE
84172005-09-20 Paul Eggert <eggert@cs.ucla.edu>
8418
55289366
PE
8419 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
8420 doesn't affect behavior.
8421 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
8422 Solaris, AIX, MSC.
8423 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
8424 This works a bit better with glibc, if user code has already included
8425 stdlib.h.
8426 * doc/bison.texinfo (Bison Parser): Document that users can't
8427 arbitrarily use malloc and free for other purposes. Document
8428 that <alloca.h> and <malloc.h> might be included.
8429 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
8430 user must declare alloca.
8431
a05b79df
PE
8432 * HACKING (release): Forwarn the Translation Project about
8433 stable releses.
8434
3ab2ca22
AD
84352005-09-20 Akim Demaille <akim@epita.fr>
8436
8437 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
8438
a9739e7c
PE
84392005-09-19 Paul Eggert <eggert@cs.ucla.edu>
8440
a702593e
PE
8441 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
8442 (YYSTACK_ALLOC_MAXIMUM): Use it.
8443 (yysyntax_error): New function.
8444 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
8445 multiple syntax errors are reported, and alloca is being used.
8446 Instead, reallocate buffers twice as big each time, so that
8447 we waste at most half the allocated memory. Start with a small
8448 (128-byte) buffer that will suffice in most cases anyway.
8449 Use yysyntax_error to do most of the work.
8450
8451 * doc/bison.texinfo (Error Reporting, Table of Symbols):
8452 yynerrs is the number of errors reported, not the number of
8453 errors encountered.
8454
a9739e7c
PE
8455 * tests/glr-regression.at (Duplicated user destructor for lookahead):
8456 Mark it as expected to fail.
8457 Cast result of malloc; problem reported by twlevo@xs4all.nl.
8458 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
8459 Don't start user-code symbols with "yy", to avoid name space problems.
8460
f479c6c6
AD
84612005-09-19 Akim Demaille <akim@epita.fr>
8462
8463 Remove the traits, failed experiment.
8464 It never proved useful, and anyway because of the current
8465 definition, it was not possible to have several specialization of
8466 this traits, making it useless.
8467 * data/lalr1.cc (yy:traits): Remove.
8468 Inline its definitions in the parser class.
8469
e2586f82
AD
84702005-09-19 Akim Demaille <akim@epita.fr>
8471
8472 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
8473 least Mac OSX with a /usr/local install of gettext.
8474
2e8cf949
AD
84752005-09-19 Akim Demaille <akim@epita.fr>
8476
8477 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
8478 and yytoken for similarity with the other skeletons.
8479
c7fb0b90
AD
84802005-09-19 Akim Demaille <akim@epita.fr>
8481
4e26c69e 8482 * NEWS, configure.ac: update version number to 2.1a.
c7fb0b90 8483
1bd0deda
PE
84842005-09-16 Paul Eggert <eggert@cs.ucla.edu>
8485
8486 * NEWS: Version 2.1.
8487
8488 * NEWS: Remove notice of yytname change, since it was never in an
8489 official release.
8490 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
8491 diagnostic.
8492 * src/output.c (prepare): Likewise.
8493 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
8494 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
8495 is not defined. This is an awful hack, but it's enough for now.
8496 All callers changed.
8497 * tests/glr-regression-at (make_value): Args are const pointers now,
8498 to avoid GCC warning.
8499 (Duplicated user destructor for lookahead): New test. Currently
8500 skipped. It fails on my host but I'm not sure it'll always fail.
8501
85022005-09-16 Akim Demaille <akim@epita.fr>
c1432f65
AD
8503
8504 * src/symtab.h (struct symbol): Declare the printer and destructor
8505 as const, to avoid accidental calls to free.
8506 (symbol_destructor_set, symbol_printer_set): Adjust.
8507 * src/symtab.c: Adjust.
8508
1bd0deda 85092005-09-16 Akim Demaille <akim@epita.fr>
cf147260
AD
8510
8511 * data/c.m4 (b4_token_enums): New.
8512 (b4_token_defines): Rename as...
8513 (b4_token_enums_defines): this.
8514 (b4_token_defines): New, output only the #defines.
8515 * data/yacc.c, data/glr.c: Adjust.
8516 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
8517 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
8518 as default values.
8519
dbcdae2d
AD
85202005-09-16 Akim Demaille <akim@epita.fr>
8521
8522 * data/lalr1.cc (yylex_): Remove, inline its code.
8523 (yyreport_syntax_error_): Remove, replaced by...
8524 (yysyntax_error_): this which returns a string and leaves to the
8525 caller the call to the users' error function.
8526 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
8527 Move from members of the parser object...
8528 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
8529 to local variables of the parse function.
8530
70d8f291
AD
85312005-09-16 Akim Demaille <akim@epita.fr>
8532
8533 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
8534 since it's in Bison's name space.
8535
b47dbebe
PE
85362005-09-15 Paul Eggert <eggert@cs.ucla.edu>
8537
ae199bf1
PE
8538 * data/glr.c (yyresolveValue): Add default case to pacify
8539 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
8540
b47dbebe
PE
8541 * NEWS: Document when yyparse started to return 2.
8542 * doc/bison.texinfo (Parser Function): Document when yyparse
8543 returns 2.
8544
8545 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
8546 (b4_filename_type): Renamed back from b4_file_name_type. All uses
8547 changed.
8548 (class position): file_name -> filename (reverting). All uses changed.
8549
85502005-09-14 Paul Eggert <eggert@cs.ucla.edu>
8551
8552 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
8553 do anything if $@ exists. This reverts part of the 2005-07-07
8554 patch.
8555
00292f66
PE
85562005-09-11 Paul Eggert <eggert@cs.ucla.edu>
8557
8558 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
8559 contains obsolete information and isn't worth distributing as a
8560 separate file anyway.
8561 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
8562 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
8563 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
8564 (yyparse): Abort if user code uses longjmp to throw an unexpected
8565 value.
8566
a420f962
PE
85672005-09-09 Paul Eggert <eggert@cs.ucla.edu>
8568
00292f66
PE
8569 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
8570 Suggested by twlevo@xs4all.nl.
8571
127287e9
PE
8572 * data/glr.c (YYCHK1): Do not assume YYE is in range.
8573 This avoids a diagnostic from gcc -Wswitch-enum.
8574 Problem reported by twlevo@xs4all.nl.
8575
a420f962
PE
8576 * doc/bison.texinfo: Don't use "filename", as per GNU coding
8577 standards. Use "file name" or "file" or "name", depending on
8578 the context.
8579 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
8580 not to hack/foo.tab.c.
8581 (Calc++ Top Level): 2nd arg of main is not const.
48b16bbc
PE
8582 * data/glr.c: b4_filename -> b4_file_name.
8583 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
8584 All uses changed.
8585 (class position): filename -> file_name. All uses changed.
8586 * data/yacc.c: b4_filename -> b4_file_name.
8587 * lib/bitset.h: filename -> file_name in local vars.
8588 * lib/bitset_stats.c: Likewise.
8589 * src/files.c: Likewise.
8590 * src/scan-skel.l ("@output ".*\n): Likewise.
8591 * src/files.c (file_name_split): Renamed from filename_split.
8592 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
a420f962
PE
8593
85942005-09-08 Paul Eggert <eggert@cs.ucla.edu>
8595
8596 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
8597 to accommodate latest gnulib.
8598
8599 * tests/glr-regression.at (Duplicate representation of merged trees):
8600 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
8601
8602 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
8603 needed.
8604
42a6501d
PE
86052005-08-26 Paul Eggert <eggert@cs.ucla.edu>
8606
8607 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
8608 All uses changed. Invoke user destructor after an error during a
8609 split parse (trivial change from Joel E. Denny).
8610
8611 * tests/glr-regression.at
8612 (User destructor after an error during a split parse): New test case.
8613 Problem reported by Joel E. Denny in:
8614 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
8615
ef9a1faf
PE
86162005-08-25 Paul Eggert <eggert@cs.ucla.edu>
8617
5b4aaf78
PE
8618 * README-cvs: Give URLs for recommended tools.
8619 Mention Gzip version problem, and bootstrapping issues.
8620 Remove troubleshooting section, as it's somewhat obsolete.
8621
b5240ba5
PE
8622 * bootstrap (no_cache): New var, to accommodate different wget
8623 variants. Use it instead of '-C off'. Problem reported by
8624 twlevo@xs4all.nl.
8625
ef9a1faf
PE
8626 * data/glr.c (yydestroyStackItem): New function.
8627 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
8628 debugging information. Problem reported by Joel E. Denny.
8629
e6efa9da
AD
86302005-08-25 Akim Demaille <akim@epita.fr>
8631
8632 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
8633
adc90f13
PE
86342005-08-24 Paul Eggert <eggert@cs.ucla.edu>
8635
8636 * data/glr.c (yyrecoverSyntaxError, yyreturn):
8637 Don't invoke destructor on unresolved entries.
8638 * tests/glr-regression.at
8639 (User destructor for unresolved GLR semantic value): New test case.
8640 Problem reported by Joel E. Denny in:
8641 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
8642
f9315de5
PE
86432005-08-21 Paul Eggert <eggert@cs.ucla.edu>
8644
15d29c1f
PE
8645 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
8646 Add strnlen.c.
8647 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
8648 lib-prefix.m4, po.m4.
8649
dd5f2af2
PE
8650 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
8651 in yydestruct diagnostic, since it might not be an error.
8652 Problem reported by Joel Denny near end of
8653 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6250acbd 8654 * data/lalr1.cc (yyerturn): Likewise.
dd5f2af2
PE
8655 * data/yacc.c (yyreturn): Likewise.
8656 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
8657
8658 * src/files.c: Remove obsolete FIXME comment.
8659
8660 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
8661 with the other templates, and to fix bogus run-on messages such
8662 as the one reported at the end of
8663 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
8664 All callers changed to avoid the newline.
8665 (yyprocessOneStack): Output two lines rather than one, to accommodate
8666 the above change. This changes the debug output format slightly.
8667
f9315de5
PE
8668 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
8669 reported by Joel E. Denny in
8670 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
8671 (trivial change).
8672 * tests/glr-regression.at (Duplicate representation of merged trees):
8673 New test, from Joel E. Denny in:
8674 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
8675 * THANKS: Add Joel E. Denny.
8676
8677 * configure.ac (AC_INIT): Bump to 2.0c.
8678
04098407
PE
86792005-07-24 Paul Eggert <eggert@cs.ucla.edu>
8680
8681 * NEWS: Version 2.0b.
8682
ca5d2013
PE
8683 * Makefile.am (SUBDIRS): Put examples before tests, so that
8684 "make check" doesn't finish with "All 1 tests passed".
8685
3d54b576
PE
8686 * tests/regression.at (Token definitions): Don't rely on
8687 AT_PARSER_CHECK for data that contains backslashes. It currently
8688 uses 'echo', and 'echo' isn't portable if its argument contains
8689 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
8690 that the byte '\0xff' is not printable in the C locale; it is,
8691 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
8692 not printable, so use '\0x81' to test.
8693
d53ae497
PE
8694 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
8695 version of GCC, since the macro is used with non-GCC compilers.
8696
fc01665e
PE
8697 Fix core dump reported by Pablo De Napoli in
8698 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
8699 * tests/regression.at (Invalid inputs with {}): New test.
8700 * src/parse-gram.y (token_name): Translate type before using
8701 it as an index.
8702
04098407
PE
8703 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
8704 the user's name space. All uses changed to __attribute__
8705 ((__unused__)).
8706 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
8707 Add __attribute__ ((__noreturn__)).
8708
8709 * etc/clcommit: Remove. We weren't using it, and it failed
8710 "make maintainer-distcheck".
8711 * Makefile.maint: Merge from coreutils.
8712 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
8713 (syntax-check-rules): Change list of rules as described below.
8714 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
8715 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
8716 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
8717 (sc_trailing_space): New rules.
8718 (sc_xalloc_h_in_src): Remove.
8719 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
8720 (sc_space_tab, sc_error_exit_success, sc_changelog):
8721 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
8722 (makefile-check, po-check, author_mark_check):
8723 (makefile_path_separator_check, copyright-check):
8724 Use grep -n, to make it easier to find violations.
8725 Use CVS_LIST and CVS_LIST_EXCEPT.
8726 (header_regexp, h_re): Remove.
8727 (dd_c): New macro.
8728 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
8729 (my-distcheck): Use more-modern GCC flags.
8730 (signatures, %.asc): Remove.
8731 (rel-files, announcement): Remove signatures.
8732 Restore old updating code, even though we don't use it, so
8733 that we're the same as coreutils.
8734 (alpha, beta, major): Depend on news-date-check.
8735 Make the upload commands.
8736
8737 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
8738 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
8739 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
8740 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
8741 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
8742 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
8743 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
8744 * tests/sets.at: Likewise.
8745
8746 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
8747 we comment out the Autoconf version number.
8748 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
8749 it's error-prone and "make maintainer-distcheck" rejects it.
8750
8751 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
8752 Indent calls to "error" to pacify "make maintainer-distcheck",
8753 when the calls are not intended to be translated.
8754 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
8755
8756 * src/Makefile.am (DEFS): Use +=, to pacify
8757 "make maintainer-distcheck".
8758 (bison_SOURCES): Add scan-skel.h.
8759 (sc_tight_scope): New rule, from coreutils.
8760
8761 * src/files.c (src_extension, header_extension):
8762 Now static, not extern.
8763 * src/getargs.c (short_options): Likewise.
8764 * src/muscle_tab.c (muscle_table): Likewise.
8765 * src/parse-gram.y (current_class, current_type, current_prec):
8766 Likewise.
8767 * src/reader.c (grammar_end, previous_rule_end): Likewise.
8768 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
8769 * src/main.c (main): Cast bindtextdomain and textdomain calls to
8770 void, to avoid warning when NLS is disabled.
8771 * src/output.c: Include scan-skel.h.
8772 (scan_skel): Remove decl, since scan-skel.h does this.
8773 (output_skeleton):
8774 Indent calls to "error" to pacify "make maintainer-distcheck".
8775 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
8776 * src/reader.h (gram_end, gram_lineno): New decls to pacify
8777 "make maintainer-distcheck".
8778 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
8779 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
8780 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
8781 (skel_lex_destroy, scan_skel): Move these decls to...
8782 * src/scan-skel.h: New file.
8783 * src/uniqstr.c (uniqstr_assert):
8784 Indent calls to "error" to pacify "make maintainer-distcheck".
8785
8786 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
8787 not @VAR@.
8788
8789 * tests/torture.at: Revamp to avoid misuse of atoi that
8790 "make maintainer-distcheck" complained about.
8791
8792 * examples/extexi (message): Don't print a message more than once,
8793 and omit line-number decoration that makes Emacs compile think
8794 that informative messages are worth worrying about.
8795
87962005-07-22 Paul Eggert <eggert@cs.ucla.edu>
8797
8798 * configure.ac: Update version number.
8799
8800 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
8801 accidentally.
8802 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
8803 autogenerated by the maintainer.
8804 * examples/calc++/.cvsignore: Add *.yy.
8805
8806 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
8807 * lib/bitset_stats.c (bitset_stats_init): Likewise.
8808 * lib/bitsetv.c (bitsetv_alloc): Likewise.
8809
8810 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
8811
8812 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
8813 from maintainer-distcheck about casting the argument of 'free'.
8814
8815 * NEWS: Mention recent yytname changes.
8816 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
8817
8818 * bootstrap: For translations that have not yet been upgraded to
8819 the new runtime-po domain, prime the pump by extracting the
8820 relevant strings from the obsolete translations. This code can be
8821 removed once the bison-runtime domain has been translated by each
8822 team.
8823
8824 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
8825 now that token names are already quoted.
8826
8827 Fix problem reported by Anthony Heading.
8828 * data/glr.c (YYTOKEN_TABLE): New macro.
8829 (yytname): Define if YYTOKEN_TABLE.
8830 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
8831 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
8832 (YYERROR_VERBOSE): Define the same way the other skeletons do.
8833 * src/output.c (prepare_symbols): Output token_table_flag.
8834
0ffda363
PE
88352005-07-21 Paul Eggert <eggert@cs.ucla.edu>
8836
8837 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
8838 again if the first call fails.
8839
8840 * data/glr.c (yytnamerr): New function.
8841 (yyreportSyntaxError): Use it to dequote most string literals.
8842 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
8843 with other skeletons. All uses changed.
8844 (yytnameerr_): New function.
8845 (yyreport_syntax_error): Use it to dequote most string literals.
8846 * data/yacc.c (yytnamerr): New function.
8847 (yyerrlab): Use it to decode most string literals.
8848 * doc/bison.texinfo (Decl Summary, Calling Convention):
8849 Clarify quoting convention of yytname.
8850 * src/output.c (prepare_symbols): Quote all names. This undoes
8851 the 2005-04-17 change, which is now accomplished (mostly) via
8852 changes in the parsers as described above.
8853 * tests/regression.at (Token definitions, Web2c Actions):
8854 Undo most 2005-04-17 change here, too.
8855
88562005-07-20 Paul Eggert <eggert@cs.ucla.edu>
8857
8858 Fix more problems reported by twlevo@xs4all.nl.
8859 * tests/cxx-type.at: Don't pipe output of ./types through sed to
8860 remove trailing spaces. This loses the exit status of ./types,
8861 and isn't needed since ./types shouldn't be emitting trailing
8862 spaces.
8863 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
8864 as the stack isn't valid in that case.
8865
8866 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
8867 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
8868 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
8869 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
8870 is used.
8871 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
8872 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
8873 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
8874 Likewise.
8875
8876 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
8877 overly-picky compilers that reject 'char *foo = "bar";'.
8878
8879 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
8880 to FILE * parameter, not to stderr. This fixes a typo introduced
8881 in the 2005-07-12 change.
8882
8883 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
8884 warnings from GCC 4.
8885
8886 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
8887 (yyglrShiftDefer, yysplitStack):
8888 Remove unused parameters b4_pure_formals. All uses changed.
8889 (yyglrShift): Remove unused parameters b4_user_formals.
8890 All uses changed.
8891 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
8892
6100a9aa
PE
88932005-07-18 Paul Eggert <eggert@cs.ucla.edu>
8894
258b75ca
PE
8895 Destructor cleanups and regularization among the three skeletons.
8896 * NEWS: Document the behavior changes.
8897 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
8898 stack before failing, as the cleanup code will do it for us now.
8899 * data/lalr1.cc (yyerrlab): Likewise.
8900 * data/glr.c (yyparse): Pop everything off the stack before
8901 freeing it, so that destructors get called properly.
8902 * data/lalr1.cc (yyreturn): Likewise.
8903 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
8904 This is more consistent.
8905 * doc/bison.texinfo (Destructor Decl): Mention more reasons
8906 why destructors might be called. 1.875 -> 2.1.
8907 (Destructor Decl, Decl Summary, Table of Symbols):
8908 Some English-language cleanups for %destructor.
8909 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
8910 Add output line for destructor of start symbol.
8911 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
8912 because of that same extra output line.
8913
1a059451
PE
8914 * NEWS: Document minor wording changes in diagnostics of
8915 Bison-generated parsers.
8916 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
8917 Remove unused formals. All uses changed.
8918 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
8919 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
8920 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
8921 Rename yyoverflowab to yyexhaustedlab.
8922 When memory exhaustion occurs during syntax-error reporting,
8923 report it separately rather than in a single diagnostic; this
8924 eases translation.
8925 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
8926 (Memory Exhausted): Renamed from Parser Stack Overflow.
8927 Revamp wording slightly to prefer "memory exhaustion".
8928 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
8929
97460c78
PE
8930 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
8931
30757c8c
PE
8932 Add i18n support to the GLR skeleton. Partially fix the C++
8933 skeleton; a C++ expert needs to finish this. Remove debugging
8934 msgids; there's little point to having them translated, since they
8935 can be understood only by someone who can read the
8936 (English-language) source code.
8937
8938 Generate runtime-po/bison-runtime.pot automatically, so that we
8939 don't have to worry about garbage getting in that file. We'll
8940 make sure after the next official release that old msgids don't
8941 get lost. See
8942 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
8943
8944 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
8945 Now auto-generated.
8946 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
8947 Fix typos in explanations of the runtime file.
8948 * bootstrap: Change gettext keyword from YYI18N to YY_.
8949 Use standard Makefile.in.in in runtime-po, since we'll arrange
8950 for backward-compatible bison-runtime.po files in a different way.
8951 * data/glr.c (YY_): New macro, from yacc.c.
8952 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
8953 Translate messages intended for users.
8954 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
8955 the wording in the other skeletons. We don't know that the memory
8956 is virtual.
8957 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
8958 Use same method that yacc.c uses.
8959 Don't translate debugging messages.
8960 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
8961 it doesn't work (yet), and requires C++ expertise to fix.
8962 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
8963 Move defn to a more logical place, to be consistent with other
8964 skeletons.
8965 Don't translate debugging messages.
8966 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
8967 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
8968 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
8969 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
8970
ac8c5689
PE
8971 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
8972 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
8973 void, not int.
8974 * tests/glr-regression.at (Badly Collapsed GLR States):
8975 Likewise.
8976 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
8977 yylex should return 0 at EOF rather than aborting.
8978
6100a9aa
PE
8979 Improve tests for stack overflow in GLR parser.
8980 Problem reported by twlevo@xs4all.nl.
8981 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
8982 All uses removed.
8983 (yyStackOverflow): Just longjmp, but with value 2 so that caller
8984 can handle the problem.
8985 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
8986 (yyparse): New local variable yyresult to record the result.
8987 Use result of setjmp to set it, rather than storing itinto
8988 struct.
8989 (yyDone): Remove label.
8990 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
8991 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
8992 if YYABORT is used).
8993 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
8994 yyparse status; put status > 1 into diagnostic.
8995 Check that status==2 works.
8996 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
8997 Use exit status 3 for failure to open (which shouldn't happen).
8998
15f40952
PE
89992005-07-17 Paul Eggert <eggert@cs.ucla.edu>
9000
67fd79c4
PE
9001 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
9002 1 on syntax error; just let yyparse do its thing.
9003 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
9004 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
9005 (Exploding the Stack Size with Alloca):
9006 (Exploding the Stack Size with Malloc):
9007 Expect exit status 2, not 1, since the parser is supposed to blow
9008 its stack. Problem reported by twlevo@xs4all.nl.
9009
15f40952
PE
9010 * data/glr.c (yyparse): Don't assume that the initial calls
9011 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
9012 Print a stack-overflow message and fail instead.
9013 Initialize the line-number information before creating the stack,
9014 so that the stack-overflow message can report line zero safely.
9015
f32c66b5
PE
90162005-07-14 Paul Eggert <eggert@cs.ucla.edu>
9017
a22ff96f 9018 Fix problems reported by twlevo@xs4all.nl.
e2688cd9
PE
9019 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
9020 (yyuserMerge): Provide a default case if b4_mergers is empty.
9021 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
9022 * tests/glr-regression.at
9023 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
c70fdfcd 9024 Add casts to pacify C++ compilers.
1beb0b24
PE
9025 * tests/glr-regression.at (Improper merging of GLR delayed action
9026 sets): Declare yylex before using it.
f32c66b5 9027 * tests/Makefile.am (maintainer-check-g++): Fix a stray
a22ff96f
PE
9028 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
9029 test for valgrind; valgrind is independent of g++.
9030 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
9031 for compatibility with POSIX 1003.1-2001 (if running coreutils).
9032 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
9033 Use a destructor, so that we can expand the stack. Change
9034 YYSTYPE to char * so that we can free it. Cast result of malloc.
f32c66b5 9035
d741bd1b
PE
90362005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
9037
9038 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
9039 a valgrind failure. Problem reported by twlevo@xs4all.nl.
9040
0410a6e0
PE
90412005-07-13 Paul Eggert <eggert@cs.ucla.edu>
9042
9043 * PACKAGING: New file, suggested by Bruno Haible and taken from
9044 similar wording in gettext's PACKAGING file.
9045 * NEWS: Mention PACKAGING.
9046 * Makefile.am (EXTRA_DIST): Add PACKAGING.
9047
f7ab6a50
PE
90482005-07-12 Paul Eggert <eggert@cs.ucla.edu>
9049
baf785db 9050 * NEWS: Document recent i18n improvements.
f7ab6a50
PE
9051 * bootstrap: Get runtime translations into runtime-po.
9052 Create runtime-po files automatically, if possible.
9053 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
9054 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
9055 does not infringe on the user's name space.
9056 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
9057 * doc/bison.texinfo (Internationalization): Revamp the English
9058 and Texinfo syntax a bit, to try to make it clearer.
9059 (Bison Options, Option Cross Key): Mention --print-localedir.
9060 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
9061 YYENABLE_NLS. Quote a bit more.
9062 * runtime-po/.cvsignore: New file.
9063 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
9064 * runtime-po/Rules-quot: Remove; now created by bootstrap.
9065 * runtime-po/quot.sed: Likewise.
9066 * runtime-po/boldquot.sed: Likewise.
9067 * runtime-po/en@quot.header: Likewise.
9068 * runtime-po/en@boldquot.header: Likewise.
9069 * runtime-po/insert-header.sin: Likewise.
9070 * runtime-po/remove-potcdate.sin: Likewise.
9071 * runtime-po/Makevars: Likewise.
9072 * runtime-po/LINGUAS: Likewise.
9073 * runtime-po/de.po: Likewise; we will rely on the translation project
9074 to maintain this, so "bootstrap" should get it.
0410a6e0 9075 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
f7ab6a50
PE
9076 its value.
9077 * src/main.c (main): Bind the bison-runtime domain, too.
9078
90792005-07-12 Bruno Haible <bruno@clisp.org>
9080
9081 * data/yacc.c: Include <libintl.h> when NLS is enabled.
9082 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
9083 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
9084 * runtime-po: New directory.
9085 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
9086 $(DOMAIN).pot-update rule, so that old messages are never dropped.
9087 * runtime-po/Rules-quot: New file, copied from po/.
9088 * runtime-po/quot.sed: Likewise.
9089 * runtime-po/boldquot.sed: Likewise.
9090 * runtime-po/en@quot.header: Likewise.
9091 * runtime-po/en@boldquot.header: Likewise.
9092 * runtime-po/insert-header.sin: Likewise.
9093 * runtime-po/remove-potcdate.sin: Likewise.
9094 * runtime-po/Makevars: New file.
9095 * runtime-po/POTFILES.in: New file.
9096 * runtime-po/LINGUAS: New file.
9097 * runtime-po/bison-runtime.pot: New file.
9098 * runtime-po/de.po: New file.
9099 * m4/bison.m4: New file.
9100 * Makefile.am (SUBDIRS): Add runtime-po.
9101 (aclocaldir, aclocal_DATA): New variables.
9102 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
9103 Define aclocaldir.
9104 * src/getargs.c (usage): Document --print-localedir option.
9105 (PRINT_LOCALEDIR_OPTION): New enum item.
9106 (long_options): Add --print-localedir option.
9107 (getargs): Handle --print-localedir option.
9108 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
9109 (Internationalization): New section.
9110
22dda0f0
AD
91112005-07-12 Akim Demaille <akim@epita.fr>
9112
9113 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
9114 for consistency with the rest of the code.
9115 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
9116 Add separators.
9117
82b248ad
AD
91182005-07-12 Akim Demaille <akim@epita.fr>
9119
9120 * src/parse-gram.y: Use %printer instead of YYPRINT.
9121
fa0e9314
AD
91222005-07-12 Akim Demaille <akim@epita.fr>
9123
867a3e00
AD
9124 * src/symtab.h, src/symtab.c (symbol_print): New.
9125 * src/symlist.h, src/symlist.c (symbol_list_print): New.
9126 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
9127
91282005-07-12 Akim Demaille <akim@epita.fr>
9129
9130 * data/glr.c (b4_syncline): Fix (swap) the definitions of
fa0e9314
AD
9131 b4_at_dollar and b4_dollar_dollar.
9132
e054b190
PE
91332005-07-11 Paul Eggert <eggert@cs.ucla.edu>
9134
9135 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
9136 and Pennello's paper.
9137
34160ec4
PE
91382005-07-09 Paul Eggert <eggert@cs.ucla.edu>
9139
407d4a75
PE
9140 * data/yacc.c (yyparse): Undo previous patch. Instead,
9141 set yylsp[0] and yyvsp[0] only if the initial action
9142 sets yylloc and yylval, respectively.
9143
34160ec4
PE
9144 * data/yacc.c (yyparse): In the initial action, set
9145 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
9146 This avoids the use of undefined variables if the initial
9147 action does not set yylloc and/or yylval.
9148
c3d5a4a7
PE
91492005-07-07 Paul Eggert <eggert@cs.ucla.edu>
9150
b34d96c1
PE
9151 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
9152 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
9153 Remove from CVS. These files are automatically generated.
9154 * examples/extexi: Clarify that this file is now part of Bison,
9155 not GNU M4, and that it works with any POSIX-compatible Awk.
9156 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
9157 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
9158 so that we also get calc++-parser.yy. Geneate it.
9159 Use $(AWK), not gawk, since any conforming Awk will do.
9160 Put comment before action, since older 'make' can't handle comment
9161 in action.
9162 $(BUILT_SOURCES): List all built sources, not just some of them.
9163 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
9164 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
9165 $($(calc_sources_generated)): Remove unnecessary test for existence
9166 of target. (This had a shell syntax error anyway; a stray "x".)
9167 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
9168 calc++-parser.yy.
9169 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
9170
c3d5a4a7
PE
9171 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
9172 implied by the other modules.
9173
828c373b
AD
91742005-07-06 Akim Demaille <akim@epita.fr>
9175
9176 Bind examples/calc++ to the package.
9177 * examples/calc++/Makefile: Remove, replaced by...
9178 * examples/calc++/Makefile.am: ... this new file.
9179 * examples/calc++/test: Remove input.
9180 * examples/calc++/compile: Remove.
9181 * examples/Makefile.am: New.
9182 * configure.ac, Makefile.am: Adjust.
9183 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
9184
63cb01d6
PE
91852005-07-05 Paul Eggert <eggert@cs.ucla.edu>
9186
fd2df2ed
PE
9187 * data/glr.c (yyFail): Drastically simplify; since the format argument
9188 never had any % directives, we can simply pass it to yyerror.
9189 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
9190 be modified later, as that is the usual style in glr.c.
9191 Problems reported by Paul Hilfinger.
9192
63cb01d6
PE
9193 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
9194 and size overflow errors.
9195 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
9196 in case the user prolog sets feature-test macros like _GNU_SOURCE.
9197 (YYSIZEMAX): New macro.
9198 (yystpcpy): New function, taken from yacc.c.
9199 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
9200 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
9201 so that we don't have to maintain their signatures.
9202 (yyFail): Check for buffer overflow, by using vsnprintf rather
9203 than vsprintf. Allocate a bigger buffer if possible.
9204 Report an error if buffer allocation fails.
9205 (yyStackOverflow): New function.
9206 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
9207 the initialization was successful. It might fail if storage was
9208 exhausted.
9209 (yyexpandGLRStack): Add more checks for storage allocation failure.
9210 Use yyStackOverflow to report failures.
9211 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
9212 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
9213 Don't assume stack number fits in int.
9214 (yysplitStack): Check for storage allocation failure.
9215 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
9216 can print diagnostics on storage allocation failure. All callers
9217 changed.
9218 (yyresolveValue): Use yybool for boolean.
9219 (yyreportSyntaxError): Check for size-calculation overflow.
9220 This code is taken from yacc.c.
9221 (yyparse): Check for storage allocation errors when allocating
9222 the initial stack.
9223
1c59e0a1
AD
92242005-07-05 Akim Demaille <akim@epita.fr>
9225
9226 Extract calc++ from the documentation.
9227 * doc/bison.texinfo (Calc++): Add the extraction marks.
9228 * examples/extexi: New, from the aborted GNU Programming 2E.
9229 Separate the different paragraph of a file with empty lines.
9230 * examples/Makefile: Use it to extract the whole calc++ example.
9231
8a0adb01
AD
92322005-06-24 Akim Demaille <akim@epita.fr>
9233
9234 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
9235 class typedefs.
9236
12545799
AD
92372005-06-22 Akim Demaille <akim@epita.fr>
9238
9239 * doc/bison.texinfo (C++ Language Interface): First stab.
9240 (C++ Parsers): Remove.
9241
99be0235
AD
92422005-06-22 Akim Demaille <akim@epita.fr>
9243
9244 * data/lalr1.cc (yylex_): Honor %lex-param.
9245
0ffd4fd1
AD
92462005-06-22 Akim Demaille <akim@epita.fr>
9247
9248 Start a set of simple examples.
9249 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
9250 * examples/calc++/calc++-driver.hh,
9251 * examples/calc++/calc++-parser.yy,
9252 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
9253 * examples/calc++/compile, examples/calc++/test: New.
9254
0925ebb4
PE
92552005-06-09 Paul Eggert <eggert@cs.ucla.edu>
9256
9257 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
9258 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
9259 which stems from the 2005-05-27 patch.
9260
43d3b664
PH
92612005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
9262
9263 * data/glr.c: Modify treatment of unused parameters to permit use
9264 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
9265
3062864d
PE
92662005-05-30 Paul Eggert <eggert@cs.ucla.edu>
9267
9268 Fix infringement on user name space reported by Janos Zoltan Szabo.
9269 * data/yacc.c (yyparse): strlen -> yystrlen.
9270
989b5b8e
AD
92712005-05-30 Akim Demaille <akim@epita.fr>
9272
9273 * data/lalr1.cc (_): New.
9274 Translate the various messages.
9275
bedf57f5
PE
92762005-05-27 Paul Eggert <eggert@cs.ucla.edu>
9277
9278 Fix infringement on user name space reported by Bruno Haible.
9279 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
9280 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
9281 the user's name space.
9282 (alloca): Include <stdlib.h> to get it, if it's not built in.
9283 (YYMALLOC, YYFREE): Define only if needed.
9284 (malloc, free): Declare, but only if needed, as this infringes on
9285 the user name space.
9286
4d1801f1
PE
92872005-05-25 Paul Eggert <eggert@cs.ucla.edu>
9288
9289 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
9290 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
9291 with %d format.
9292 * lib/ebitset.c (min, max): Undef before defining.
9293 * lib/vbitset.c (min, max): Likewise.
9294 * lib/subpipe.c (create_subpipe): Save local variables in case
9295 vfork clobbers them.
9296
92972005-05-24 Bruno Haible <bruno@clisp.org>
9298
9299 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
9300 error message syntax used by gcc-4.0.
9301
b94a9e1e
PE
93022005-05-23 Paul Eggert <eggert@cs.ucla.edu>
9303
85ac3861
PE
9304 * README: Mention m4 1.4.3. Remove obsolete advice about
9305 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
9306
b94a9e1e
PE
9307 * bootstrap: Remove workaround for problem I encountered with
9308 gettext 0.14.1; it seems to be fixed now.
9309
51c30d21
PE
93102005-05-22 Paul Eggert <eggert@cs.ucla.edu>
9311
009ce67d
PE
9312 * NEWS: Version 2.0a.
9313
f2a97c62
PE
9314 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
9315 the previous change.
9316
c8775f93
PE
9317 Various maintainer cleanups.
9318 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
9319 conftest*, for benefit of CVS commands run at the same time as
9320 "configure". Add build-aux, since "bootstrap" now creates it and
9321 its subfiles.
9322 * Makefile.cfg (move_if_change): Remove.
9323 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
9324 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
9325 (po_repo, do-po-update, po-update, wget_files, get-targets):
9326 (config.guess-url_prefix, config.sub-url_prefix):
9327 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
9328 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
9329 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
9330 Remove.
9331 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
9332 this is now the recommended name.
9333 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
9334 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
9335 ylwrap. These files now go into build-aux.
9336 * config/move-if-change: Remove.
9337 * config/prev-version.txt: Bump from 1.75 to 2.0.
9338
3ea5f0ec
PE
9339 * bootstrap: Add stdio-safer, unistd-safer modules.
9340 Remove m4/glibc2.m4 (introduced by latest gnulib, but
9341 we don't need it).
9342 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
9343 fopen-safer.c, stdio-safer.h, unistd-safer.h.
9344 * lib/subpipe.c: Include "unistd-safer.h".
9345 (create_subpipe): Make sure all the newly-created
9346 file descriptors are > 2, so that diagnostics don't
9347 get sent down them (which might cause Bison to hang, in theory).
9348 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
9349 * src/files.c (xfopen): Use fopen_safer, not fopen.
9350
51c30d21
PE
9351 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
9352 yesterday's yacc.c fix.
9353
cea1469d
PE
93542005-05-21 Paul Eggert <eggert@cs.ucla.edu>
9355
3ea5f0ec
PE
9356 * data/glr.c, data/lalr1.cc: Update copyright date.
9357
cea1469d
PE
9358 Fix a destructor bug reported by Wolfgang Spraul in
9359 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
9360 * data/yacc.c (yyabortlab): Don't call destructor, and
9361 don't set yychar to EMPTY.
9362 (yyoverflowlab): Don't call destructor.
9363 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
9364 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
9365 since we no longer output the message "discarding lookahead token
9366 end of input ()".
9367
5e6f62f2
PH
93682005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
9369
9370 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
9371 fix a small glitch in debugging output.
9372 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
9373 after YY_SYMBOL_PRINT where needed.
9374
9375 (struct yyGLRState): Add some comments.
9376 (struct yySemanticOption): Add some comments.
9377 (union yyGLRStackItem): Add comment.
9378
9379 (yymergeOptionSets): Correct this to properly perform the union,
9380 avoiding infinite reported by Michael Rosien.
9381 Update comment.
9382
9383 * tests/glr-regression.at: Add test for GLR merging error reported
9384 by M. Rosien.
cea1469d 9385
0fb669f9
PE
93862005-05-13 Paul Eggert <eggert@cs.ucla.edu>
9387
9388 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
9389 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
9390 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
9391 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
9392 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
9393 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
9394 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
9395 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
9396 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
9397 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
9398 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
9399 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
9400 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
9401 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
9402 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
9403 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
9404 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
9405 src/derives.h, src/files.c, src/files.h, src/getargs.c,
9406 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
9407 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
9408 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
9409 src/output.h, src/parse-gram.c, src/parse-gram.h,
9410 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
9411 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
9412 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
9413 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
9414 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
9415 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
9416 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
9417 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
9418 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
9419 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
9420 tests/reduce.at, tests/regression.at, tests/sets.at,
9421 tests/synclines.at, tests/testsuite.at, tests/torture.at:
9422 Update FSF postal mail address.
9423
51f4735e
PE
94242005-05-11 Paul Eggert <eggert@cs.ucla.edu>
9425
9426 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
9427 Problem reported by Ralf Menzel.
9428
80ce3401
PE
94292005-05-01 Paul Eggert <eggert@cs.ucla.edu>
9430
9431 * tests/actions.at: Test that stack overflow invokes destructors.
9432 From Marcus Holland-Moritz.
9433 * data/yacc.c (yyerrlab): Move the code that destroys the stack
9434 from here....
9435 (yyreturn): to here. That way, destructors are called properly
9436 even if the stack overflows, or the user calls YYACCEPT or
9437 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
9438 (yyoverflowlab): Destroy the lookahead.
9439
94402005-04-24 Paul Eggert <eggert@cs.ucla.edu>
9441
9442 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
9443
72f000b0
PE
94442005-04-17 Paul Eggert <eggert@cs.ucla.edu>
9445
9446 * NEWS: Bison-generated C parsers no longer quote literal strings
9447 associated with tokens.
9448 * src/output.c (prepare_symbols): Don't escape strings,
9449 since users don't want to see C escapes.
9450 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
9451 in diagnostics.
c19683bb 9452 * tests/input.at (Torturing the Scanner): Likewise.
72f000b0
PE
9453 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
9454
1094323f
PE
94552005-04-16 Paul Eggert <eggert@cs.ucla.edu>
9456
9457 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
9458 the data size is known to be too small and we can't increase it.
9459 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
9460
ca407bdf
PE
94612005-04-15 Paul Eggert <eggert@cs.ucla.edu>
9462
9463 * src/parse-gram.y: Include quotearg.h.
9464 (string_as_id): Quote $1 before using it as a key, since the
9465 lexer no longer quotes it for us.
9466 (string_content): Don't strip quotes, since lexer no longer
9467 quotes it for us.
9468 * src/scan-gram.l: Include quotearg.h.
9469 ("\""): Omit quote.
9470 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
9471 a key, since the rest of the lexer doesn't quote it.
9472 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
9473 * tests/regression.at (Token definitions): Check for backslashes
9474 in token strings.
9475
9476 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
9477 (YYSIZE_T): Define to unsigned long int when using an older compiler.
9478 (yyparse): Revamp code to generate long syntax error message, to
9479 make it easier to translate, and to avoid problems with arithmetic
9480 overflow. Change "virtual memory" to "memory" in diagnostic, since
9481 we don't know whether the memory is virtual.
9482
1ce59070
PE
94832005-04-13 Paul Eggert <eggert@cs.ucla.edu>
9484
9485 * NEWS: Bison-generated C parsers now use the _ macro to
9486 translate strings.
9487 * data/yacc.c (_) [!defined _]: New macro.
9488 All English strings wrapped inside this macro.
9489 * doc/bison.texinfo (Bison Parser): Document _.
9490 * po/POTFILES.in: Include src/parse-gram.c, since it now
9491 includes translateable strings that parse-gram.y doesn't.
9492
a749a695
PE
94932005-04-12 Paul Eggert <eggert@cs.ucla.edu>
9494
9495 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
9496 reverting the 2004-10-11 change to this function.
9497 (symbol_check_alias_consistency): Don't call symbol_type_set
9498 if the type name is already correct.
9499 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
9500
8fb1053b
PE
95012005-03-25 Paul Eggert <eggert@cs.ucla.edu>
9502
9503 * tests/regression.at (Token definitions): Don't use a token named
9504 c, as that generates a "#define c ..." that runs afoul of buggy
9505 stdlib.h that uses the identifier c as a member of struct
9506 drand48_data. Problem reported by Horst Wente.
9507
ff498c4a
PE
95082005-03-21 Paul Eggert <eggert@cs.ucla.edu>
9509
9510 * bootstrap: Change translation URL from
9511 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
9512 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
9513 redirection glitches. Problem reported by twlevo@xs4all.nl.
9514
65211d70
PE
95152005-03-20 Paul Eggert <eggert@cs.ucla.edu>
9516
9517 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
9518 after operands; POSIX says this isn't portable for the c99 command.
9519
9577fb1f
PE
95202005-03-18 Paul Eggert <eggert@cs.ucla.edu>
9521
9522 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
9523 immediately if a data overrun has occurred; this may help us track
9524 down what may be a spurious failure on MacOS.
9525
78b178f7
PE
95262005-03-17 Paul Eggert <eggert@cs.ucla.edu>
9527
a2599d0f
PE
9528 Respond to problems reported by twlevo@xs4all.nl.
9529
9530 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
9531
78b178f7
PE
9532 * src/vcg.h: Comment fix.
9533 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
9534 (G_CMAX): Change to -1 instead of INT_MAX.
9535
9536 * data/yacc.c (yyparse): Omit spaces before #line.
78b178f7 9537
7296e729
PE
95382005-03-15 Paul Eggert <eggert@cs.ucla.edu>
9539
9540 * src/tables.c (state_number_to_vector_number): Put it inside an
9541 "#if 0", since it's not currently used. Problem reported by
9542 Roland McGrath.
9543
05ac60f3
PE
95442005-03-06 Paul Eggert <eggert@cs.ucla.edu>
9545
9546 * src/output.c (escaped_output): Renamed from
9547 escaped_file_name_output, since we now use it for symbol tags as
9548 well. All uses changed.
9549 (symbol_destructors_output, symbol_printers_output):
9550 Escape symbol tags too.
9551 Problem reported by Matyas Forstner in
9552 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
9553
9554 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
9555 not needed.
9556 * src/output.c (user_actions_output, token_definitions_output,
9557 symbol_destructors_output, symbol_printers_output): Likewise.
9558 * src/reader.c (prologue_augment): Likewise.
9559 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
9560
9561 * src/vcg.c (output_edge): Don't quote linestyle arg.
9562 Problem reported by twlevo@xs4all.nl.
9563
7eb453ac
PE
95642005-02-28 Paul Eggert <eggert@cs.ucla.edu>
9565
9566 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
9567 example, reported by Derek M Jones. Also, make the example even
9568 more outrageous, to better illustrate how bad the problem is.
9569
4c04c52a
PE
95702005-02-24 Paul Eggert <eggert@cs.ucla.edu>
9571
9572 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
9573 putsym. Typo reported by Sebastian Piping.
9574
a61e1620
PE
95752005-02-23 Paul Eggert <eggert@cs.ucla.edu>
9576
9577 * doc/bison.texinfo (Language and Grammar): some -> same
9578 (Epilogue): int he -> in the
9579 Typos reported by Sebastian Piping via Justin Pence.
9580
9ec93868
PE
95812005-02-07 Paul Eggert <eggert@cs.ucla.edu>
9582
9583 * tests/glr-regression.at (Improper handling of embedded actions
9584 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
9585 embedded actions and $-N in GLR parsers", work around an Autoconf bug
9586 with dollar signs in test names.
9587 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
9588 for a similar reason.
9589
73ce7e7e
PE
95902005-01-28 Paul Eggert <eggert@cs.ucla.edu>
9591
9592 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
9593 wants to redefine G_VIEW.
9594
2e72b98e
PE
95952005-01-27 Paul Eggert <eggert@cs.ucla.edu>
9596
9597 * src/vcg.c (get_view_str): Remove case for normal_view.
9598 Problem reported by twlevo@xs4all.nl.
9599
e0d634e5
PE
96002005-01-24 Paul Eggert <eggert@cs.ucla.edu>
9601
ccf830a4
PE
9602 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
9603 Problem reported by twlevo@xs4all.nl.
9604
e0d634e5
PE
9605 * doc/bison.texinfo: Change @dircategory from "GNU programming
9606 tools" to "Software development". Requested by Richard Stallman
9607 via Karl Berry.
9608
7bbc8cb0
PE
96092005-01-23 Paul Eggert <eggert@cs.ucla.edu>
9610
9611 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
9612 Problem reported by twlevo@xs4all.nl.
9613
08b770bc
PE
96142005-01-21 Paul Eggert <eggert@cs.ucla.edu>
9615
9616 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
9617 keyword; it's not needed with modern compilers, and it doesn't
9618 affect correctness with older compilers. Suggested by
9619 twlevo@xs4all.nl.
9620
95f22ad2
PE
96212005-01-17 Paul Eggert <eggert@cs.ucla.edu>
9622
9623 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
9624 gcc -Wswitch-default.
9625 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
9626 * data/yacc.c (yyparse): Likewise.
9627
d229d15c
PE
96282005-01-12 Paul Eggert <eggert@cs.ucla.edu>
9629
9630 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
9631 already. Let config.h define any nonstandard values.
9632
ecadd90f
PE
96332005-01-10 Paul Eggert <eggert@cs.ucla.edu>
9634
9635 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
9636 for the benefit of slower hosts. Problem reported by
9637 Nelson H. F. Beebe.
9638
213744b5
PE
96392005-01-07 Paul Eggert <eggert@cs.ucla.edu>
9640
9641 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
9642 being defined and not used.
9643 * data/lalr1.cc (yyparse): Likewise.
9644 Use "if (false)" rather than "if (0)".
9645
249d3236
PE
96462005-01-05 Paul Eggert <eggert@cs.ucla.edu>
9647
9648 * TODO: Mention that we should allow NUL bytes in tokens.
9649
987cc1fb
PE
96502005-01-02 Paul Eggert <eggert@cs.ucla.edu>
9651
9652 * src/scan-skel.l (<<EOF>>): Don't close standard output.
9653 Problem reported by Hans Aberg.
9654
08fe02d9
PE
96552005-01-01 Paul Eggert <eggert@cs.ucla.edu>
9656
9657 * src/getargs.c (version): Happy new year; update overall
9658 program copyright date from 2004 to 2005.
9659
9660 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
9661 Problem reported by Hans Aberg.
9662 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
9663 (Output file names.): Add a test for the case when standard output
9664 is closed.
9665
010c0266
PE
96662004-12-26 Paul Eggert <eggert@cs.ucla.edu>
9667
9668 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
9669 to fix an oversight in the Bison 2.0 manual.
9670
da12206a
PE
96712004-12-25 Paul Eggert <eggert@cs.ucla.edu>
9672
9673 * NEWS: Version 2.0. Reformat the existing news items since
9674 1.875, so that related items are grouped together.
3a4734aa 9675 * configure.ac (AC_INIT): Bump version to 2.0.
da12206a
PE
9676 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
9677
c935d934
PE
9678 * tests/torture.at (Exploding the Stack Size with Alloca): Set
9679 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
9680 otherwise, we're not testing alloca. Unfortunately there's no
9681 simple way to consult HAVE_ALLOCA here.
9682
da12206a
PE
9683 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
9684 for yymsg, too.
9685
9686 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
9687 hand. This avoids a warning about comparing int to size_t when
9688 GCC warnings are enabled.
9689
0a2c5137
PE
96902004-12-22 Paul Eggert <eggert@cs.ucla.edu>
9691
d7e14fc0
PE
9692 * NEWS: Bison-generated parsers no longer default to using the
9693 alloca function (when available) to extend the parser stack, due
9694 to widespread problems in unchecked stack-overflow detection.
9695 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
9696 responsibility to set it to a positive value. This lets the user
9697 specify a value that is not a preprocessor constant.
9698 * data/yacc.c (YYMAXDEPTH): Likewise.
9699 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
9700 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
9701 to be a compile-time constant. However, explain the constraints on it.
9702 Also, explain the constraints on YYINITDEPTH.
9703 (Table of Symbols): Explain that alloca is no longer the default.
9704 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
9705 to 1.
9706
0a2c5137
PE
9707 * doc/bison.texinfo (Location Default Action): Mention that n must
9708 be zero when k is zero. Suggested by Frank Heckenbach.
9709
e019c247
AD
97102004-12-22 Akim Demaille <akim@epita.fr>
9711
9712 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
9713 (parser::state_type, parser::semantic_type, parser::location_type):
9714 Private, not public.
9715 (parser::parse): Return ints, not bool.
9716 Returning a bool introduces a problem: 0 corresponds to false, and
9717 it seems weird to return false on success. Returning true changes
9718 the conventions for yyparse.
9719 Alternatively we could return void and send an exception.
9720 There is no clear consensus (yet?).
9721 (state_stack, semantic_stack, location_stack): Rename as...
9722 (state_stack_type, semantic_stack_type, location_stack_type): these.
9723 Private, not public.
9724 * tests/c++.at: New.
9725 * tests/testsuite.at, tests/Makefile.am: Adjust.
9726
72731bb7
AD
97272004-12-21 Akim Demaille <akim@epita.fr>
9728
9729 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
9730
9a0d8bec
AD
97312004-12-21 Akim Demaille <akim@epita.fr>
9732
9733 Don't impose std::string for filenames.
9734
9735 * data/lalr1.cc (b4_filename_type): New.
9736 (position::filename): Use it.
9737 (parser.hh): Move the inclusion of stack.hh and location.hh below
9738 the user code, so that needed headers for the filename type can be
9739 included first.
72731bb7
AD
9740 Forward declare them before the user code.
9741 * tests/Makefile.am (check-local, installcheck-local): Pass
9742 TESTSUITEFLAGS to the TESTSUITE.
9a0d8bec 9743
99880de5
AD
97442004-12-20 Akim Demaille <akim@epita.fr>
9745
9746 Use more STL like names: my_class instead of MyClass.
9747
9748 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
9749 (SemanticStack, SemanticType, StateStack, StateType)
9750 (TokenNumberType, Stack, Slice, Traits, Parser::location)
9751 (Parser::value): Rename as...
9752 (location_stack, location_type, rhs_number_type, semantic_stack)
9753 (semantic_type, state_stack, state_type, token_number_type, stack)
9754 (slice, traits, parser::yylloc, parser::yylval): these.
9755
9756 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
9757
9bec482e
PE
97582004-12-19 Paul Eggert <eggert@cs.ucla.edu>
9759
9760 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
9761 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
9762
f6fbd3da
PE
97632004-12-17 Paul Eggert <eggert@cs.ucla.edu>
9764
9765 Remove uses of 'short int' and 'unsigned short int'. This raises
9766 some arbitrary limits. It uses more memory but nowadays that's
9767 not much of an issue.
9768
9769 This change does not affect the generated parsers; that's a different
9770 task, as some users will want to conserve memory there.
9771
9772 Ideally we should use size_t to represent all object counts, and
9773 something like ptrdiff_t to represent signed differences of object
9774 counts; but that will require more code-cleanup than I have the
9775 time to do right now.
9776
9777 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
9778 Use size_t, not int or short int, to count objects.
9779 * src/closure.c (nritemset, closure): Likewise.
9780 * src/closure.h (nritemset, closure): Likewise.
9781 * src/nullable.c (nullable_compute): Likewise.
9782 * src/print.c (print_core): Likewise.
9783 * src/print_graph.c (print_core): Likewise.
9784 * src/state.c (state_compare, state_hash): Likewise.
9785 * src/state.h (struct state): Likewise.
9786 * src/tables.c (default_goto, goto_actions): Likewise.
9787
9788 * src/gram.h (rule_number, rule): Use int, not short int.
9789 * src/output.c (prepare_rules): Likewise.
9790 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
9791 errs, reductions): Likewise.
9792 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
9793 Likewise.
9794 * src/tables.c (vector_number, tally, action_number,
9795 ACTION_NUMBER_MINIMUM): Likewise.
9796 * src/output.c (muscle_insert_short_int_table): Remove.
9797
efeed023
AD
97982004-12-17 Akim Demaille <akim@epita.fr>
9799
9800 * data/lalr1.cc: Extensive Doxygenation.
9801 (error_): Rename as...
9802 (error): this, since it is visible to the user.
9803 Adjust callers.
9804 (Parser::message): Now an automatic variable from...
9805 (Parser::yyreport_syntax_error_): here.
9806 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
9807 Parser::error.
9808 * tests/input.at: Escape $.
9809
bc82c5a5
PE
98102004-12-16 Paul Eggert <eggert@cs.ucla.edu>
9811
9812 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
9813 Parenthesize rhs to avoid obscure problems with mistakes like
9814 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
9815 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
9816 b4_rhs_location): Likewise.
9817 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
9818 b4_rhs_location): Likewise.
9819
fd19f271
AD
98202004-12-16 Akim Demaille <akim@epita.fr>
9821
9822 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
9823 yacc.c: be sure to stay within yycheck_.
9824 * tests/actions.at: Re-enable C++ tests.
9825
10454ea4
AD
98262004-12-16 Akim Demaille <akim@epita.fr>
9827
9828 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
9829 real.
9830
c5b95ccf
AD
98312004-12-16 Akim Demaille <akim@epita.fr>
9832
9833 Use #define to handle the %name-prefix.
9834
9835 * data/glr.c, data/yacc.c: Comment changes.
9836 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
9837 so that one can refer to yylex in the parser file, and have it
9838 renamed, as is the case with other skeletons.
9839
617a8f12
AD
98402004-12-16 Akim Demaille <akim@epita.fr>
9841
9842 Move lalr1.cc internals into yy*.
9843
9844 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
9845 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
9846 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
9847 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
9848 (empty_, final_, terror_, errcode_, ntokens_)
9849 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
9850 (looka_, ilooka_, error_range_, nerrs_):
9851 Rename as...
9852 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
9853 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
9854 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
9855 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
9856 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
9857 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
9858 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
9859 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
9860 these.
9861
1e547e6e
PE
98622004-12-15 Paul Eggert <eggert@cs.ucla.edu>
9863
9864 Fix some problems reported by twlevo at xs4all.
9865 * src/symtab.c (symbol_new): Report an error if the input grammar
9866 contains too many symbols. This is better than calling abort() later.
9867 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
9868 (struct node, struct graph):
9869 Rename member expand to stretch. All uses changed.
9870 (struct graph): Remove member layoutalgorithm. All uses removed.
9871 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
9872 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
9873 All uses changed.
9874 (N_STRETCH): Rename from N_EXPAND. All uses changed.
9875
735d6bd4
AD
98762004-12-15 Akim Demaille <akim@epita.fr>
9877
9878 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
9879 Add more Doxygen comments.
9880 (symprint_, stack_print_, reduce_print_, destruct_, pop)
9881 (report_syntax_error_, translate_): Rename as...
9882 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
9883 (yypop_, yyreport_syntax_error_, yytranslate_): this.
9884
2e1f5829
AD
98852004-12-15 Akim Demaille <akim@epita.fr>
9886
9887 * data/lalr1.cc (lex_): Rename as...
9888 (yylex_): this.
9889 Move the trace here.
9890 Take the %name-prefix into account.
9891 Reported by Alexandre Duret-Lutz.
9892
a3cb6248
AD
98932004-12-15 Akim Demaille <akim@epita.fr>
9894
9895 Simplify the C++ parser constructor.
9896
9897 * data/lalr1.cc (debug_): Rename as...
9898 (yydebug_): so that the parser's internals are always in the yy*
9899 pseudo namespace.
9900 Adjust uses.
9901 (b4_parse_param_decl): Remove the leading comma as it is now only
9902 called as unique argument list.
9903 (Parser::Parser): Remove the constructor accepting a location and
9904 an initial debugging level.
9905 Remove from the other ctor the argument for the debugging level.
9906 (debug_level_type, debug_level, set_debug_level): New.
9907
9908 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
9909 constructor calls.
9910
07fed891
AD
99112004-12-15 Akim Demaille <akim@epita.fr>
9912
9913 Remove b4_root related material: failure experiment
a3cb6248 9914 (which goal was to allow to derive from a class).
07fed891
AD
9915
9916 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
9917 definitions and uses.
9918
e603eaa5
PE
99192004-12-14 Paul Eggert <eggert@cs.ucla.edu>
9920
9921 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
9922 not 2, since it's not portable to subtract 1 from the start of an
9923 array. The new item 0 is never set or used. All uses changed.
9924
9925 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
9926 the default definition of YYLLOC_DEFAULT. Problem reported
9927 by Frank Heckenbach.
9928
fafb007d
PE
99292004-12-12 Paul Eggert <eggert@cs.ucla.edu>
9930
9931 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
9932 the normal case and one for the error case. Just use the
9933 first one uniformly. Problem reported by Frank Heckenbach.
9934 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
9935 use exactly the same macro in both places.
9936 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
9937 so that the normal-case YYRHSLOC works for the error case too.
9938 All uses changed.
9939 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
9940 (YYLLOC_DEFAULT): Use the same macro as glr.c.
9941 * doc/bison.texinfo (Location Default Action): Don't claim that
9942 we have an array of locations. Use the same macro for both glr
9943 and lalr parsers. Mention YYRHSLOC. Mention what happens when
9944 the index is 0.
9945
48814dcd
PE
99462004-12-10 Paul Eggert <eggert@cs.ucla.edu>
9947
a4e1a53b
PE
9948 * HACKING: Update email addresses to send announcements to.
9949
48814dcd
PE
9950 * configure.ac (AC_INIT): Bump version to 1.875f.
9951
337116ba
PE
99522004-12-10 Paul Eggert <eggert@cs.ucla.edu>
9953
9954 * NEWS: Version 1.875e.
9955 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
9956
9957 * src/scan-skel.l: Include "complain.h", for "fatal".
9958
9959 * src/relation.h (relation_print, relation_digraph):
9960 Relation sizes are of type relation_node, not size_t (this is
9961 merely a doc fix, since the two types are equivalent).
9962 (relation_transpose): Relation sizes are of type relation_node,
9963 not int.
9964 * src/relation.c: Likewise.
9965 (top, infinity): Now of type relation_node, not int.
9966 (traverse, relation_transpose): Use relation_node, not int.
9967
9968 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
9969 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
9970 (yyparse): Remove unused local introduced in 2004-10-25 patch.
9971
9972 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
68b082af 9973 specifying whether the test should be skipped. Use it tp
337116ba 9974 specify that the [%defines %skeleton "lalr1.cc"] tests currently
68b082af 9975 fail on some hosts, and should be skipped.
337116ba 9976
da2a7671
PE
99772004-12-08 Paul Eggert <eggert@cs.ucla.edu>
9978
9979 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
9980 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
9981 unless otherwise specified below.
9982
9983 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
9984 to allocate kernel_base, kernel_items, kernel_size, since
9985 they needn't be initialized to 0.
9986 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
9987 * src/closure.c (new_closure): Likewise, for itemset.
9988 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
9989 * src/lalr.c (set_goto_map): Likewise, for temp_map.
9990 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
9991 (build_relations): Likewise for edge, states1, includes.
9992 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
9993 * src/reader.c (packgram): Likewise, for ritem, rules.
9994 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
9995 * src/relation.c (relation_digraph): Likewise for VERTICES.
9996 (relation_transpose): Likewise for new_R, end_R.
9997 * src/symtab.c (symbols_token_translations_init): Likewise for
9998 token_translations.
9999 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
10000 (token_actions): Likewise for yydefact, actrow, conflrow,
10001 conflict_list.
10002 (save_column): Likewise for froms[symno], tos[symno].
10003 (goto_actions): Likewise for state_count.
10004 (pack_table): Likewise for base, pos, check.
10005 (tables_generate): Likewise for width.
10006
10007 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
10008 for initial core. Just have a separate core, so we needn't worry
10009 about whether kernel_size and kernel_base are initialized.
10010
10011 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
10012 kernel_size, kernel_items): Remove unnecessary initialization.
10013 * src/conflicts.c (conflicts): Likewise.
10014 * src/derives.c (derives): Likewise.
10015 * src/muscle_tablc (muscle_insert): Likewise.
10016 * src/relation.c (relation_digraph): Likewise.
10017 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
10018 conflrow, conflict_table, conflict_list, table, check):
10019 Likewise.
10020
10021 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
10022 This is because all callers pass unsigned int.
10023 * src/closure.h (new_closure): Likewise.
10024
10025 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
10026 (build_relations): Initialize includes[i] in all cases.
10027 * src/reader.c (packgram): Always initialize rules[ruleno].prec
10028 and rules[ruleno].precsym. Initialize members in order.
10029 * src/relation.c (relation_transpose): Always initialize new_R[i]
10030 and end_R[i].
10031 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
10032
10033 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
10034 conflict_list[0] was always 0, but now it isn't initialized.
10035
10036 * src/table.c (table_grow): When conflict_table grew, the grown
10037 area wasn't cleared. Fix this.
10038
10039 * lib/.cvsignore: Add strdup.c, strdup.h.
10040 * m4/.cvsignore: Add strdup.m4.
10041
00baeeac
PE
100422004-12-07 Paul Eggert <eggert@cs.ucla.edu>
10043
10044 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
10045 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
10046 GOTO_NUMBER_MAXIMUM, since we occasionally compute
10047 ngotos + 1 without checking for overflow.
10048 (build_relations): Use END_NODE, not -1, to denote end of edges.
10049 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
10050 build_relations): Use goto_number, not int, for goto numbers.
10051 * src/tables.c (save_column, default_goto): Likewise.
10052
be3d9d42
AD
100532004-11-23 Akim Demaille <akim@epita.fr>
10054
10055 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
10056 of #defining from yystype.
10057 Don't typedef yystype, C++ does not need it.
10058 This lets it possible to forward declare it as union.
10059
78e526d5
PE
100602004-11-23 Paul Eggert <eggert@cs.ucla.edu>
10061
10062 * bootstrap (gnulib_modules): Add extensions.
10063 Problem reported by Jim Meyering.
10064
afbb696d
PE
100652004-11-22 Paul Eggert <eggert@cs.ucla.edu>
10066
10067 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
10068 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
10069 src/system.h, src/tables.c: XFREE -> free, to accommodate
10070 recent change to gnulib xalloc.h.
78e526d5 10071 Problem reported by Jim Meyering.
afbb696d 10072
c1f8f16a
AD
100732004-11-17 Akim Demaille <akim@epita.fr>
10074
10075 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
10076
db7e5eb5 100772004-11-17 Akim Demaille <akim@epita.fr>,
9a1e9989
AD
10078 Alexandre Duret-Lutz <adl@gnu.org>
10079
10080 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
10081 changes.
10082 (YYCDEBUG): Adjust.
10083 Use it instead of cdebug_.
10084 (Parser::debug_stream, Parser::set_debug_stream): New.
10085 (Parser::symprint_): Define cdebug_ for temporary backward
10086 compatibility.
10087 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
10088 debug_stream ().
10089
68e11668
AD
100902004-11-17 Akim Demaille <akim@epita.fr>
10091
10092 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
10093 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
10094 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
10095 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
10096
97cbc73e
PE
100972004-10-27 Paul Eggert <eggert@cs.ucla.edu>
10098
10099 * data/glr.c (yyloc_default): Remove; not used.
10100 Problem reported by Frank Heckenbach.
10101
e342c3be
AD
101022004-10-25 Akim Demaille <akim@epita.fr>
10103
10104 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
10105 Introduce another definition to address simple location arrays.
10106 (yyGLRStack): New member: yyerror_range.
10107 (yyrecoverSyntaxError, yyparse): Update it.
10108 (yyrecoverSyntaxError): Use it when shifting the error token to
10109 have an accurate range, equivalent to the one computed by both
10110 yacc.c and lalr1.cc.
10111 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
10112 that column numbers start at column 0, as per GNU Coding
10113 Standards, the others tests, and the doc.
10114 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
10115 Adjust to the above change (first column is 0).
10116 And adjust the location of the "<error>", now covering the whole
10117 line.
10118
93602feb 101192004-10-22 Akim Demaille <akim@epita.fr>
04098407 10120 and Paul Eggert <eggert@cs.ucla.edu>
93602feb
PE
10121
10122 Remove some arbitrary limits on goto numbers and relations.
10123 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
10124 initial values, since they're never used.
10125 (set_goto_map): ngotos is now unsigned, so test for overflow
10126 by seeing whether it wraps around to zero.
10127 * src/lalr.h (goto_number): Now size_t, not short int.
10128 (GOTO_NUMBER_MAXIMUM): Remove.
10129 * src/relation.c (relation_print, traverse, relation_transpose):
10130 Check for END_NODE rather than looking at sign.
10131 * src/relation.h (END_NODE): New macro.
10132 (relation_node): Now size_t, not short int.
10133
dba08b04
PE
101342004-10-22 Paul Eggert <eggert@cs.ucla.edu>
10135
10136 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
10137 keyword, not an identifier. Problem reported by Baron Schwartz in
10138 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
10139
df09ef2e
AD
101402004-10-11 Akim Demaille <akim@epita.fr>
10141
10142 * src/symtab.c (symbol_check_alias_consistency): Also check
10143 type names, destructors, and printers.
10144 Reported by Alexandre Duret-Lutz.
10145 Recode the handling of associativity and precedence in terms
10146 of symbol_precedence_set.
10147 Accept no redeclaration at all, not even equal to the previous
10148 value.
10149 (redeclaration): New.
10150 Use it to factor redeclaration complaints.
10151 (symbol_make_alias): Don't set the type of the alias, let
10152 symbol_check_alias_consistency do it as for other features.
10153 * src/symtab.h (symbol): Add new member prec_location, and
10154 type_location.
10155 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
10156 * tests/input.at (Incompatible Aliases): New.
10157
146bc99d
PE
101582004-10-09 Paul Eggert <eggert@cs.ucla.edu>
10159
10160 .cvsignore fixes to accommodate gnulib changes,
10161 and the practice of naming build directories "_build".
10162 * .cvsignore: Add "_*". Sort.
10163 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
10164 * m4/.cvsignore: Add "*_gl.m4".
10165
e503aa60
AD
101662004-10-06 Akim Demaille <akim@epita.fr>
10167
10168 * src/parse-gram.y (add_param): Fix the truncation of trailing
10169 spaces.
10170
b4a20338
AD
101712004-10-05 Akim Demaille <akim@epita.fr>
10172
10173 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
10174 whether the reducion was empty or not. This leaves room to
10175 improve the use of YYLLOC_DEFAULT in such a case.
10176 lalr1.cc is still experimental, so changing this is acceptable.
10177 And finally, there are probably not many users who changed the
10178 handling of locations in GLR, so changing is admissible too.
10179
10180 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
10181 empty reduction, set @$ to an empty location ending the previously
10182 stacked symbol.
10183 Adjust uses to make sure the code is triggered on empty
10184 reductions.
10185 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
10186 expected output: empty reductions have empty locations.
10187
f85a5e6f
AD
101882004-09-29 Akim Demaille <akim@epita.fr>
10189
10190 * data/lalr1.cc: Move towards a more standard C++ coding style
10191 for templates: Class < T > -> Class<T>.
10192
b203fc2c
AD
101932004-09-29 Akim Demaille <akim@epita.fr>
10194
10195 * data/lalr1.cc: Reinstall the former ctor, for sake of
10196 compatibility, but warn it will be removed.
10197 Move towards a more standard C++ coding style (i.e., type *var ->
10198 type* var).
10199
5b7e1e73
PE
102002004-09-27 Paul Eggert <eggert@cs.ucla.edu>
10201
3fee967f
PE
10202 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
10203 since it's less likely to work if NULs are involved in the future.
5b7e1e73 10204
0dcca5c2
AD
102052004-09-27 Akim Demaille <akim@epita.fr>
10206
10207 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
10208
6dde1c82
AD
102092004-09-27 Akim Demaille <akim@epita.fr>
10210
10211 * data/lalr1.cc (b4_parse_param_decl_1): New.
b203fc2c 10212 (b4_parse_param_decl): Use it to have different names between attribute
6dde1c82
AD
10213 and argument names.
10214 (b4_cc_constructor_call): Likewise.
10215
b233d555
AD
102162004-09-24 Akim Demaille <akim@epita.fr>
10217
10218 * src/parse-gram.y (add_param): Strip the leading and trailing
10219 blanks from a formal argument declaration.
10220 (YY_LOCATION_PRINT): New.
10221
619404e3
AD
102222004-09-24 Akim Demaille <akim@epita.fr>
10223
10224 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
10225 after the location.
10226
dd8d9022
AD
102272004-09-24 Akim Demaille <akim@epita.fr>
10228
10229 * doc/bison.texinfo (Table of Symbols): Sort.
10230
0092f063
AD
102312004-09-21 Akim Demaille <akim@epita.fr>
10232
10233 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
10234 the useless parentheses.
10235 Suggested by Paul Eggert.
10236
451364ed
AD
102372004-09-20 Akim Demaille <akim@epita.fr>
10238
10239 Let the initial-action act on the look-ahead, and use it for the
10240 "initial push" (corresponding to an hypothetical beginning-of-file).
10241 And let lalr1.cc honor %initial-action.
10242
10243 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
10244 example.
10245 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
10246 (Parser::Parser): Remove the ctor that used to initialize it.
10247 (Parser::parse): Like in the other skeletons, issue the "starting
10248 parse" message before any action.
10249 Honor %initial-action.
10250 Initialize the stacks with the lookahead.
10251 * data/yacc.c: Let $$ and @$ in %initial-action designate the
10252 look-ahead.
10253 Push them in the stacks.
10254 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
10255
18d192f0
AD
102562004-09-20 Akim Demaille <akim@epita.fr>
10257
10258 * doc/bison.texinfo (Initial Action Decl): New.
10259
b8458aa5
AD
102602004-09-20 Akim Demaille <akim@epita.fr>
10261
10262 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
10263 clearer criterion to define it.
10264 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
10265 When reducing on an empty RHS, use the latest stacked location as
10266 location.
10267 yylloc is not always available.
10268 * data/glr.c: Likewise.
10269 Also, honor initial-actions.
10270
3fc16193
AD
102712004-09-20 Akim Demaille <akim@epita.fr>
10272
10273 * data/yacc.c (YY_LOCATION_PRINT): New.
10274 Define when we know YYLTYPE's structure, i.e., when the default
10275 YYLLOC_DEFAULT is used.
10276 * data/c.m4 (b4_yysymprint_generate): Use it.
10277 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
10278 value of the result.
10279 (error_start_): Replace with...
10280 (error_range_): this location array.
10281 This allows to replace code relying on the implementation of
10282 locations by portable code.
10283 * data/yacc.c (yylerrsp): Replace with...
10284 (yyerror_range): this.
10285 Every time a token is popped, update yyerror_range[0], to have an
10286 accurate location for the error token.
10287 * data/glr.c (YY_LOCATION_PRINT): New.
10288 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
10289 deference a pointer.
10290 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
10291 report the location in %printers.
10292
10293 * src/scan-skel.l: Instead of abort, report error messages to ease
10294 understanding skeleton scanning failures.
10295
ecfe33e7
AD
102962004-09-16 Akim Demaille <akim@epita.fr>
10297
10298 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
10299 (iterator, const_iterator): these, to be more in the C++ spirit.
10300 Also, return reverse iterators so that when displaying the stack
10301 we display its bottom first.
10302 (Parser::stack_print_, Parser::reduce_print_): Match the messages
10303 from yacc.c.
10304 We should probably use vector here though.
10305
1576d44d
AD
103062004-09-16 Akim Demaille <akim@epita.fr>
10307
10308 Have more complete shift traces.
10309
10310 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
10311 to report Shifts instead of ad hoc YYDPRINTF invocations,
10312 including for the error token.
10313 * data/lalr1.cc (symprint_): Output the location.
10314 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
10315 output the location within the %printer.
10316 Activate GLR tests, at least to make sure they compile properly.
10317 They still don't pass though.
10318 * tests/calc.at: Adjust expect verbose output, since now "Entering
10319 state..." is on a different line than the "Shifting" message.
10320
9c66f418
AD
103212004-09-08 Akim Demaille <akim@epita.fr>
10322
10323 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
10324 Bison directive from the Bison file to the invocation of this
10325 macro, so that these directives are passed to
10326 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
10327 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
10328 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
10329 the extra Bison directives instead of the whole series.
10330 Change the grammar so that there are recoverable errors, and
10331 unrecoverable errors. Now we can have the parser give up before
10332 consuming the whole input. As a result we now can observe that
10333 the lookahead is freed when needed.
10334 Change the parser source to parse argv[1] instead of a hard coded
10335 string.
10336 Simplify yylex, and give a value and location to EOF.
10337 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
10338 passed directives already coded in the file.
10339 Add some tests to check the location of "error".
10340 For some tests, the C++ parser is correct, and not yacc.c.
10341 For other tests, they provide different, but unsatisfying, values,
10342 so keep the C++ value so that at least one parser is "correct"
10343 according to the test suite.
10344 (Actions after errors): Remove, this is subsumed by the
10345 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
10346
52d5733f
AD
103472004-09-06 Akim Demaille <akim@epita.fr>
10348
10349 * data/lalr1.cc: Adjust the indentation of the labels.
04098407 10350 (Parser::pop): New.
52d5733f
AD
10351 Use it.
10352
a0e68930
AD
103532004-09-06 Akim Demaille <akim@epita.fr>
10354
10355 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
10356 argument, an informative message.
10357 Call YY_SYMBOL_PRINT.
10358 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
10359 * data/lalr1.cc (destruct_): Likewise.
10360 In addition, no longer depend on b4_yysymprint_generate and
10361 b4_yydestruct_generate to generate these functions, do it "by
10362 hand".
10363
e757bb10
AD
103642004-09-03 Akim Demaille <akim@epita.fr>
10365
10366 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
10367 invoked, yydestruct the lookahead.
10368 * tests/calc.at (Calculator $1): Update the expected lengths of
10369 traces: there is an added line for the discarded lookahead.
10370 * doc/bison.texinfo (Destructor Decl): Some rewording.
10371 Define "discarded" symbols.
10372
0fe1f06d
AD
103732004-09-02 Akim Demaille <akim@epita.fr>
10374
10375 * data/lalr1.cc (translate_, destruct_): No reason to be static.
10376
284acc8b
AD
103772004-09-02 Akim Demaille <akim@epita.fr>
10378
10379 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
10380 (YYDSYMPRINTF): Rename as...
10381 (YY_SYMBOL_PRINT): this.
10382 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
10383 two.
10384 Use it instead of direct symprint_ calls.
10385 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
10386 one.
10387
a5eb1ed2
AD
103882004-09-02 Akim Demaille <akim@epita.fr>
10389
b7c72fe1
AD
10390 * data/lalr1.cc (b4_yysymprint_generate): New.
10391 (symprint_): New member function, defined when YYDEBUG.
10392 Use it consistently instead of token/nterm debugging output by
10393 hand.
a5eb1ed2
AD
10394 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
10395 %printer calls to use cdebug_ when using lalr1.cc.
10396
417141dd
AD
103972004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
10398
10399 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
10400 with #ifdef YYDEBUG.
10401
2fa09258
AD
104022004-08-26 Akim Demaille <akim@epita.fr>
10403
10404 * doc/bison.texinfo (Implementing Loops): Rename as...
10405 (Implementing Gotos/Loops): this.
10406
9378b508
PE
104072004-08-13 Paul Eggert <eggert@cs.ucla.edu>
10408
10409 Adjust to latest gnulib.
10410 * bootstrap (gnulib_modules): Add xalloc-die.
10411 Set LC_ALL=C so that file names sort consistently.
10412 Prefer the gnulib copies of gettext.m4, glibc21.m4,
10413 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
10414 uintmax_t.m4, ulonglong.m4.
10415 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
10416 po.m4 since we are now using _gl.m4 instead.
10417
87a8ad5c
PE
104182004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
10419
10420 * src/scan-action.l: Remove. Scanning of semantic actions is
10421 handled in scan-gram.l.
10422
dca81a78
PE
104232004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
10424
10425 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
10426
10427 * src/location.h (struct): The file member is a uniqstr.
10428 (equal_boundaries): Use UNIQSTR_EQ for comparison.
10429
c9cbf7c5
PE
104302004-07-22 Paul Eggert <eggert@cs.ucla.edu>
10431
10432 Fix bug with non-%union parsers that have printers or destructors,
10433 which led to a Bison core dump. Reported by Peter Fales in
10434 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
2fa09258 10435
c9cbf7c5
PE
10436 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
10437 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
10438 not to our own type.
10439 * src/output.c (symbol_destructors_output, symbol_printers_output):
10440 Don't assume %union.
10441 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
10442 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
10443 UNION-FLAG. All callers changed.
10444 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
10445 Use type char, not unsigned int, when declaring an array of char;
10446 this lets us remove a cast.
10447 (Printers and Destructors): Add non-%union test cases.
10448
fa7e68c3
PE
104492004-06-21 Paul Eggert <eggert@cs.ucla.edu>
10450
10451 * doc/bison.texinfo: Minor editorial changes, mostly to the new
10452 GLR writeups. E.g., avoid frenchspacing and the future tense,
10453 change "lookahead" to "look-ahead", and change "wrt" to "with
10454 respect to".
2fa09258 10455
fa7e68c3
PE
104562004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10457
10458 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
10459 New sections, split off from the GLR Parsers section. Put the new
10460 Simple GLR Parser near the start of the GLR section, for clarity.
10461 Rewrite connective text.
10462
99a9344e
PE
104632004-06-21 Frank Heckenbach <frank@g-n-u.de>
10464
10465 * doc/bison.texinfo (Simple GLR Parsers): New section.
10466
8dd162d3
PE
104672004-06-21 Paul Eggert <eggert@cs.ucla.edu>
10468
10469 * NEWS, TODO, doc/bison.texinfo:
10470 Use "look-ahead" instead of "lookahead", to be consistent.
10471 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
10472 while we're fixing "look-ahead".
10473 * src/conflicts.c (shift_set): Renamed from shiftset.
10474 (look_ahead_set): Renamed from lookaheadset.
10475 * src/print.c: Likewise.
10476 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
10477 name for "lookahead".
10478 (report_types, usage): Likewise.
10479 * src/getargs.h (report_look_ahead_tokens): Renamed from
10480 report_lookaheads.
10481 * src/lalr.c (compute_look_ahead_tokens): Renamed from
10482 compute_lookaheads.
10483 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
10484 (look_ahead_tokens_print): Renamed from lookaheads_print.
10485 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
10486 state_rule_lookaheads_print.
10487 * src/state.h: Likewise.
10488 (reductions.look_ahead_tokens): Renamed from lookaheads.
10489 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
10490 AT_DATA_LOOKAHEADS_GRAMMAR.
10491
57a90331
PE
104922004-06-03 Paul Eggert <eggert@cs.ucla.edu>
10493
10494 * README: Update location of patched M4 distribution.
10495
8ed3234a
PE
104962004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
10497
10498 Don't assume the C++ compiler takes the same arguments as the C compiler
10499 (trivial change).
10500 * configure.ac (O0CXXFLAGS): New var.
10501 * tests/atlocal.in (CXXFLAGS): Use it.
10502
07971983
PE
105032004-05-29 Paul Eggert <eggert@cs.ucla.edu>
10504
10505 Fix some "make check" problems with C++ reported by
10506 Albert Chin-A-Young for Tru64 C++ in this thread:
10507 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
10508
10509 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
10510 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
10511 Output to a .cc file for C++, not to a .c file.
10512 * tests/calc.at (AT_CHECK_CALC): Likewise.
10513 * tests/regression.at (AT_CHECK_DANCER): Likewise.
10514 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
10515
29058652
PE
105162004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
10517
10518 * tests/calc.at, tests/actions.at: Workaround for SGI
10519 C++ compiler. (trivial change)
10520
62cb8a99
PE
105212004-05-27 Paul Eggert <eggert@cs.ucla.edu>
10522
fd418816
PE
10523 Spent a few hours checking out which prerequisite versions the
10524 current sources actually require. I went all the way back to
10525 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
10526 a seemingly endless set of combinations of versions more recent
10527 than that. The bottom line is that the current sources require
10528 fairly recent versions of the build tools, and it'll be some work
10529 to change this.
10530 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
10531 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
10532 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
10533 Add comments explaining why those particular versions are
10534 currently needed.
2fa09258 10535
62cb8a99
PE
10536 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
10537 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
161a71f3 10538 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
62cb8a99
PE
10539
10540 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
10541 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
10542
caa52c10
PE
105432004-05-26 Paul Eggert <eggert@cs.ucla.edu>
10544
10545 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
10546 0.11.5. Suggested by Bruno Haible.
10547 * bootstrap: Remove gettext version checking.
10548
10549 * doc/bison.texinfo (Decl Summary): Also mention that %union
10550 can depend on prerequisite types. Problem reported by Tim
10551 Van Holder.
10552
4bfd5e4e
PE
105532004-05-25 Paul Eggert <eggert@cs.ucla.edu>
10554
2cef3017
PE
10555 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
10556 * README-alpha: Don't tell people not to package this.
10557
b9c85d5c
PE
10558 * bootstrap: Don't assume $(...) works; use `...` instead.
10559 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
10560 gettext better.
10561
4bfd5e4e
PE
10562 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
10563 put into the -d output file, and mention what to do if YYSTYPE is
10564 defined as a macro.
10565
6a36ff94
PE
105662004-05-24 Paul Eggert <eggert@cs.ucla.edu>
10567
6712933e
PE
10568 Undo change made earlier today: it caused autopoint to not bring
10569 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
10570 autopoint's.
10571
10572 * bootstrap: Check that gettext version matches what's in
10573 configure.ac. Warn users to ignore robots.txt ERROR 404.
10574 * bootstrap: Undo today's earlier change (logged below).
10575 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
b9c85d5c 10576
6a36ff94
PE
10577 The gettext version checking is causing more trouble than it's
10578 curing; remove it. Problem reported by Paul Hilfinger.
10579
10580 * bootstrap: Issue a warning that one can expect a message
10581 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
10582 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
10583
209ea708
PE
105842004-05-23 Paul Eggert <eggert@cs.ucla.edu>
10585
10586 Ensure that the C++ compiler used for testing actually works on a
10587 simple test program; if not, skip the C++-related tests. Problem
10588 reported by Vin Shelton in:
161a71f3 10589 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
209ea708
PE
10590
10591 * m4/cxx.m4: New file.
10592 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
10593 * tests/atlocal.in (BISON_CXX_WORKS): Add.
10594 * tests/local.at (AT_COMPILE_CXX): Use it.
10595
41ca2549
PE
105962004-05-21 Paul Eggert <eggert@cs.ucla.edu>
10597
383e69dc
PE
10598 * data/glr.c (yylloc): Output this macro even if locations are not
10599 being generated, as the GLR parser needs it even in that case.
10600 Problem reported by Troy A. Johnson
10601 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
10602
41ca2549
PE
10603 * configure.ac (AC_INIT): Update to 1.875e.
10604
e476c87d
PE
106052004-05-21 Paul Eggert <eggert@cs.ucla.edu>
10606
10607 * NEWS: Version 1.875d.
10608 * configure.ac (AC_INIT): Likewise.
10609 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
10610
10611 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
10612 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
10613 lalr1.cc runs afoul of the first, and the last two are no longer
10614 supported by GCC 3.4.0.
10615 * README: Mention GNU m4 1.4 or later; mention m4 patches.
10616 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
10617
233a88ad
PE
106182004-05-06 Paul Eggert <eggert@cs.ucla.edu>
10619
10620 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
10621 unsigned int, for compatibility with latest gnulib hash module.
10622 * src/state.c (state_hash, state_hasher): Likewise.
10623 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
10624 * src/uniqstr.c (hash_uniqstr): Likewise.
e476c87d 10625
12ffdd28
PE
106262004-05-03 Paul Eggert <eggert@cs.ucla.edu>
10627
10628 * NEWS: Unescaped newlines are no longer allowed in char & strings.
10629
10630 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
10631 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
10632 character and string literals.
10633 (unexpected_end): New function.
10634 (unexpected_eof): Use it.
10635 (unexpected_newline): New function.
10636 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
10637 actions.
e476c87d 10638
12ffdd28
PE
10639 * NEWS: Document %expect-rr.
10640
10641 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
10642 Fix typo by replacing $1 with $option.
10643 Remove more 'intl'-related files.
9668e2be 10644 Don't DEFUN AM_INTL_SUBDIR twice.
12ffdd28
PE
10645
10646 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
10647 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
10648 strtoul.c.
10649 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
10650 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
10651 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
10652 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
10653 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
10654 * src/.cvsignore: Add *.output.
10655
10656 * src/parse-gram.y: Put copyright notice inside %{ %} so it
10657 gets copied to the output file.
e476c87d 10658
1f65350a
PE
106592004-04-28 Paul Eggert <eggert@twinsun.com>
10660
10661 Get files from the gnulib and po repositories, instead of relying
10662 on them being in our CVS. Upgrade to latest versions of gnulib
10663 and Automake.
10664
10665 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
10666 * bootstrap: Bootstrap from gnulib and po repositories.
10667 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
10668 * README-cvs: Document these changes. Remove version numbers from
10669 mentions of build tools, since they change so often. Mention Flex.
10670
10671 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
10672 (gl_USE_SYSTEM_EXTENSIONS): Add.
12ffdd28
PE
10673 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
10674 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
1f65350a 10675 does this for us.
12ffdd28
PE
10676 (AC_ISC_POSIX): Remove; we no longer support this
10677 ancient OS, as it gets in the way of latest Autoconf & gnulib.
1f65350a
PE
10678 (AC_HEADER_STDC): Remove: we now assume C89 or better.
10679 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
10680 Do not check for C89 headers, except for locale.h which is used
10681 by the Yacc library and must port to K&R hosts.
10682 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
10683 Do not check for C89 functions, except for setlocale which is
10684 used by the Yacc library.
10685 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
10686 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
10687 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
10688 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
10689 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
10690 AM_GNU_GETTEXT): Remove; now done by:
10691 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
10692 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
10693 for us.
10694
10695 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
10696 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
10697 Define to empty, as gnulib.mk will do the rest for us.
10698 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
10699 for us.
10700 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
10701 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
10702
10703 * src/files.c: Include gnulib's xstrndup.h.
10704
10705 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
10706 (REALLOC): Use xnrealloc, for likewise.
10707 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
10708 (strnlen, memrchr): Remove decls; functions no longer used.
10709 Include <stpcpy.h>.
10710
10711 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
10712 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
10713 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
10714 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
10715 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
10716 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
10717 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
10718 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
10719 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
10720 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
10721 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
10722 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
10723 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
10724 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
10725 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
10726 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
10727 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
10728 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
10729 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
10730 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
10731 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
10732 Remove, as these files are now generated automatically
10733 by bootstrap or automake.
10734
10735 * po/ChangeLog: Remove: all but one entry was a duplicate
10736 of this file, and I moved that 2000-11-02 entry here.
10737
10738 * config/.cvsignore: Add Makefile, depcomp, install-sh.
10739 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
10740 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
10741 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
10742 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
10743 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
10744 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
10745 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
10746 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
10747 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
10748 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
10749 xstrndup.h.
10750 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
10751 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
10752 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
10753 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
10754 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
10755 * src/.cvsignore: Remove *_.c.
10756
10757
10758 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
10759 support it. (The latest stable gzip doesn't.)
10760
107612004-04-27 Paul Eggert <eggert@twinsun.com>
10762
10763 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
10764 case, as stos_ is now used by destructors due to the 2004-02-09
10765 change.
10766
10767 Remove more K&R C support.
10768 * lib/libiberty.y (PARAMS): Remove. All uses removed.
10769 * lib/subpipe.c (errno): Remove decl.
10770 Include <stdlib.h> unconditionally.
10771 (EXIT_FAILURE): Remove macro.
10772 * src/complain.c (vfprintf, strerror): Remove.
10773 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
10774 unconditionally.
10775 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
10776 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
10777 (strchr, strspn, memchr): Remove decls.
10778 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
10779 unconditionally. Do not declare perror.
10780 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
10781 unconditionally.
10782
10783 * src/complain.c (_): Remove useless defn, as system.h defines this.
10784
10785 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
10786 with latest obstack.h.
10787 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
10788 to procedure types, as obstack.h now does that for us.
10789 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
10790
10791 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
10792 so that this include file can stand alone.
10793 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
10794 does this now. Include subpipe.h first after config.h, to
10795 test whether it can stand alone.
10796
10797 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
10798 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
10799 unused declaration.
10800
10801 * tests/synclines.at (%union synch line): Put a dummy member in
10802 the union, because empty unions aren't allowed in C. Caught
10803 by GCC 3.4.0.
10804
4f16766c
PE
108052004-04-13 Jim Meyering <jim@meyering.net>
10806
10807 * src/conflicts.c (conflicts_print): Correct format string typo:
10808 use `%%' to produce literal `%'. (trivial change)
10809
779e7ceb
PE
108102004-03-30 Paul Eggert <eggert@twinsun.com>
10811
10812 * src/getargs.c (version): Update copyright year to 2004.
10813
10814 * data/c.m4 (b4_int_type): Use 'short int' rather than
10815 'short', and similarly for 'long', 'unsigned', etc.
10816 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
10817 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
10818 yy_yypstack, yydumpstack): Likewise.
10819 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
10820 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
10821 Likewise.
10822 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
10823 yy_stack_print, yyparse): Likewise.
10824 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
10825 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
10826 * lib/bitset.c (bitset_print): Likewise.
10827 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
10828 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
10829 * lib/bitsetv.c (bitsetv_dump): Likewise.
10830 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
10831 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
10832 Likewise.
10833 * src/LR0.c (allocate_itemsets): Likewise.
10834 * src/gram.h (rule_number, rule): Likewise.
10835 * src/lalr.h (goto_number): Likewise.
10836 * src/nullable.c (nullable_compute): Likewise.
10837 * src/output.c (prepare_rules): Likewise.
10838 * src/relation.c (relation_print, relation_digraph): Likewise.
10839 * src/relation.h (relation_node): Likewise.
10840 * src/state.h (state_number, transitions, errs, reductions,
10841 struct state): Likewise.
10842 * src/symtab.h (symbol_number, struct symbol): Likewise.
10843 * src/tables.c (vector_number, tally, action_number,
10844 default_goto, goto_actions): Likewise.
10845 * tests/existing.at (GNU Cim Grammar): Likewise.
10846 * tests/regression.at (Web2c Actions): Likewise.
10847
10848 * src/output.c (muscle_insert_short_int_table): Renamed from
10849 muscle_insert_short_table. All uses changed.
10850
d6328241
PH
108512004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10852
10853 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
10854 (declaration): Replace expected_conflicts with expected_sr_conflicts.
10855 Add %expect-rr rule.
4f16766c 10856
d6328241
PH
10857 * src/scan-gram.l: Recognize %expect-rr.
10858
4f16766c 10859 * src/conflicts.h (expected_sr_conflicts): Rename from
d6328241 10860 expected_conflicts.
4f16766c 10861 (expected_rr_conflicts): Declare.
d6328241
PH
10862
10863 * src/conflicts.c (expected_sr_conflicts): Rename from
10864 expected_conflicts.
10865 (expected_rr_conflicts): Define.
10866 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
10867 for GLR parsers.
10868 Use expected_sr_conflicts in place of expected_conflicts.
10869 Warn if expected_rr_conflicts used in non-GLR parser.
4f16766c 10870
d6328241 10871 * doc/bison.texinfo: Add documentation for %expect-rr.
4f16766c 10872
1452af69
PE
108732004-03-08 Paul Eggert <eggert@gnu.org>
10874
10875 Add support for hex token numbers. Suggested by Odd Arild Olsen in
161a71f3 10876 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
1452af69
PE
10877
10878 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
10879 in lalr1.cc.
10880 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
10881 * src/scan-gram.l (scan_integer): New function.
10882 ({int}): Use it.
10883 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
10884 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
10885 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
10886 Say "long int", not "long", for uniformity with GNU style.
10887
006d217d
PE
108882004-02-25 Paul Eggert <eggert@twinsun.com>
10889
10890 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
10891 compilers. This fixes a problem with Intel's C++ compiler being
10892 chatty, reported by Guido Trentalancia in
161a71f3 10893 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
006d217d 10894
c2729758
ADL
108952004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
10896
10897 Support %destructor and merge error locations in lalr1.cc.
10898
10899 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
10900 (Parser::stos_): Define unconditionally.
10901 (Parser::destruct_): New method. Generate its body with
10902 b4_yydestruct_generate.
10903 (Parser::error_start_): New attribute.
10904 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
10905 token which are discarded.
10906 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
10907 error_start_ when erroneous token are discarded.
10908 (Parser::parse) <yyerrlab1>: Compute the location of the error
10909 token so that it covers all the discarded tokens.
10910 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
10911 it can be called with `%skeleton "lalr1.cc"', and do that.
10912
dd0e0635
PE
109132004-02-02 Paul Eggert <eggert@twinsun.com>
10914
10915 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
10916 $(top_srcdir)/lib and ../lib. This fixes a bug reported
10917 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
10918 There's no need to mention top_builddir since Automake does that
10919 for us.
10920 (INCLUDES): Remove, as Automake says it's obsolescent.
10921 Contents migrated into AM_CPPFLAGS as described above.
10922 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
10923
109242004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10925
10926 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
10927 (yyreportSyntaxError): Handle case where lookahead token is
10928 YYEMPTY.
10929
be16239b
PH
109302004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10931
10932 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
10933 resulting parsers are compilable with C++.
10934
5fa90832
PE
109352003-12-23 Paul Eggert <eggert@twinsun.com>
10936
10937 * config/depcomp, config/install-sh: Sync with Automake 1.8.
10938 * src/output.c (output_skeleton): Rename local var.
10939 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
10940 Bison tokens, as this runs afoul of the 2003-10-07 change that
10941 disallowed NUL bytes in character constants or string literals.
10942
10943 * tests/local.at: Require Autoconf 2.59's Autotest.
10944 * tests/testsuite.at: Don't include local.at, since we now assume
10945 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
10946 including it.
10947 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
10948 multiple inclusion warnings.
dd0e0635 10949
b165c324
AD
109502003-12-02 Akim Demaille <akim@epita.fr>
10951
10952 * doc/bison.texinfo (How Can I Reset the Parser): More about start
10953 conditions.
10954 From Bruno Haible.
10955
26e06a21
ADL
109562003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
10957
10958 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
10959
92ac3705
PE
109602003-10-07 Paul Eggert <eggert@twinsun.com>
10961
6a5ecb38
PE
10962 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
10963 if testsuite doesn't exist.
10964
92ac3705
PE
10965 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
10966 literals, unfortunately.
10967 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
10968 Complain about NUL bytes in character constants or string literals.
10969
91d2c560
PE
109702003-10-05 Paul Eggert <eggert@twinsun.com>
10971
10972 * NEWS: Don't document %no-default-prec, as it's still
10973 too experimental.
10974 * doc/bison.texinfo: Document %no-default-prec only if
10975 the defaultprec flag is set. Normally it's not.
10976
0cc3da3a
PE
109772003-10-04 Paul Eggert <eggert@twinsun.com>
10978
10979 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
10980 non-modifiable lvalue, instead of a modifiable one.
10981 * doc/bison.texinfo (Actions): Document that $$ can
10982 be assigned to. Do not claim that $$ and $N are
10983 array element references: user code should not rely on this.
10984
22fccf95
PE
109852003-10-01 Paul Eggert <eggert@twinsun.com>
10986
10987 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
10988 (grammar_declaration): Use it.
10989 * src/scan-gram.l: New token %no-default-prec.
10990 * tests/conflicts.at: Revamp tests to use %no-default-prec.
10991 * NEWS, doc/bison.texinfo: Document the above.
10992
fc8f2965
AD
109932003-10-01 Akim Demaille <akim@epita.fr>
10994
10995 VCG no longer supports long_straight_phase.
10996
10997 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
10998 * src/print_graph.c (print_graph): Adjust.
10999
39a06c25
PE
110002003-09-30 Frank Heckenbach <frank@g-n-u.de>
11001 and Paul Eggert <eggert@twinsun.com>
11002
11003 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
11004 Table of Symbols): Document %default-prec.
11005 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
11006 (grammar_declaration): Set default_prec on %default-prec.
11007 * src/scan-gram.l (%default-prec): New token.
11008 * src/reader.h (default_prec): New flag.
11009 * src/reader.c: Likewise.
11010 (packgram): Handle it.
11011 * tests/conflicts.at (%default-prec without %prec,
11012 %default-prec with %prec, %default-prec 1): New tests.
fc8f2965 11013
39a06c25
PE
110142003-09-30 Paul Eggert <eggert@twinsun.com>
11015
11016 * tests/testsuite.at: Include local.at, not input.at, fixing
11017 a typo in the 2003-08-25 patch.
11018
62b6aef9
AD
110192003-08-27 Akim Demaille <akim@epita.fr>
11020
11021 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
11022 GCC warnings.
11023
89e1cc61
AD
110242003-08-26 Akim Demaille <akim@epita.fr>
11025
11026 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
11027 "<\#" to avoid magic from Gnus when posting parts of this script.
11028
a08460b0
AD
110292003-08-26 Akim Demaille <akim@epita.fr>
11030
11031 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
11032 (Parser::parse): here.
11033 Adjust: nerrs and errstatus is now replaced by...
11034 (Parser::nerrs_, Parser::errstatus_): New.
11035
603f1cfd
AD
110362003-08-25 Akim Demaille <akim@epita.fr>
11037
11038 * config/announce-gen, Makefile.cfg: New.
11039 * Makefile.am: Adjust.
11040 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
11041 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
11042
cd3684cf
AD
110432003-08-25 Akim Demaille <akim@epita.fr>
11044
11045 When reducing initial empty rules, Bison parser read an initial
11046 location that is not defined. This results in garbage, and that
11047 affects Bison's own parser. Therefore we need (i) to extend Bison
11048 to support a means to initialize this location, and (ii) to use
11049 this CVS Bison to fix CVS Bison's parser.
11050
11051 * src/reader.h, reader.c (epilogue_augment): Remove, replace
11052 with...
11053 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
11054 * src/parse-gram.y: Adjust.
11055 (%initial-action): New.
11056 (%error-verbose): Since we require CVS Bison, there is no reason
11057 not to use it.
11058 * src/scan-gram.l: Adjust.
11059 * src/Makefile.am (YACC): New, to make sure we use our own parser.
11060 * data/yacc.c (yyparse): Use b4_initial_action.
11061
4e03e201
AD
110622003-08-25 Akim Demaille <akim@epita.fr>
11063
11064 * doc/bison.texinfo: Don't promote stdout for error messages.
11065
8c182d05
AD
110662003-08-25 Akim Demaille <akim@epita.fr>
11067
11068 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
11069 From Alexandre Duret-Lutz.
11070
6a60c4cf
PE
110712003-08-25 Akim Demaille <akim@epita.fr>
11072
11073 Version 1.875c.
11074
25f66e1a
AD
110752003-08-25 Akim Demaille <akim@epita.fr>
11076
11077 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
11078 Use them.
11079
5348bfbe
AD
110802003-08-25 Akim Demaille <akim@epita.fr>
11081
11082 * data/lalr1.cc (Parser::reduce_print_): New.
11083 Use it.
11084
47301314
AD
110852003-08-25 Akim Demaille <akim@epita.fr>
11086
11087 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
11088 error recovery loops. This patch is based on
161a71f3 11089 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
47301314
AD
11090 Also, augment the similarity between lalr1.cc and yacc.c.
11091 Note: the locations of error recovery rules are not correct yet.
11092
11093 * data/lalr1.cc: Comment changes to augment the similarity between
11094 lalr1.cc and yacc.c.
11095 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
11096 (yyerrlab1): Remove, but where it used to be (now the bottom part of
11097 yyerrlab), when hitting EOF, pop the whole stack here instead of
11098 merely falling thru the default error handling mechanism.
11099 (yyerrorlab): New label, with the old contents of YYERROR,
11100 plus the following change: pop the stack of rhs corresponding
11101 to the production that invoked YYERROR. That is how Yacc
11102 behaves (required by POSIX).
11103 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
11104 fail.
11105
1f7a61ff
AD
111062003-08-25 Akim Demaille <akim@epita.fr>
11107
11108 Tune local.at so that people can "autom4te -l autotest calc.at -o
11109 calc" for instance, to extract a sub test suite.
11110
11111 * tests/testsuite.at: Move the initialization, Autotest version
11112 requirement, and AT_TESTED invocation into...
11113 * tests/local.at: here.
11114 * tests/testsuite.at: Include it for compatibility with Autoconf
11115 2.57.
11116 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
11117 be ignore.
11118
327b5b56
PE
111192003-08-04 Paul Eggert <eggert@twinsun.com>
11120
11121 Rework code slightly to avoid gcc -Wtraditional warnings.
11122 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
11123 The returned value is now stored in *YY0. All callers changed.
11124 * src/output.c (merge_output): Adjust to the above change.
11125
0051e3ed
PE
111262003-07-26 Paul Eggert <eggert@twinsun.com>
11127
11128 * data/glr.c (YYASSERT): New macro.
11129 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
11130 yyresolveStates, yyprocessOneStack):
11131 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
11132 Derived from a suggestion by Frank Heckenbach.
1f7a61ff 11133
137437c6
PE
111342003-07-25 Paul Eggert <eggert@twinsun.com>
11135
5b620e06
PE
11136 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
11137 for portability to K&R C (after ansi2knr, presumably). See
161a71f3 11138 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
5b620e06
PE
11139 by Frank Heckenbach, though I have omitted the structure-initialization
11140 part of his glr-knr.diff patch since I recall that the Portable
11141 C Compiler didn't require that change.
11142
137437c6
PE
11143 Let the user specify how to allocate and free memory.
11144 Derived from a suggestion by Frank Heckenbach in
161a71f3 11145 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
137437c6
PE
11146 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
11147 All uses of free, malloc, realloc changed to use these macros,
11148 and unnecessary casts removed.
11149 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
11150
ddb85ca5
PE
111512003-07-06 Matthias Mann <MatthiasMann@gmx.de>
11152
11153 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
11154 use s.empty() rather than s == "" to test for empty string; see
161a71f3 11155 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
ddb85ca5
PE
11156 (trivial change)
11157
39910e09
AD
111582003-06-25 Akim Demaille <akim@epita.fr>
11159
11160 * config/depcomp, config/install-sh: Update from masters.
11161
0ae99356
PE
111622003-06-20 Paul Eggert <eggert@twinsun.com>
11163
11164 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
11165 and return properly parenthesized result.
11166 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
11167 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
11168 Remove unnecessary parentheses from uses.
11169 * doc/bison.texinfo (Location Default Action): Describe the
11170 conventions for parentheses.
11171
cd05d13c
PE
111722003-06-19 Paul Eggert <eggert@twinsun.com>
11173
81fd08ca
PE
11174 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
11175 yyreportTree): Do not assume that size_t is the same width as int,
11176 when printing sizes. Print sizes using an unsigned format.
11177 Problem reported by Frank Heckenbach in
161a71f3 11178 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4dcf140b 11179
cd05d13c
PE
11180 Port to Forte Developer 7 C compiler.
11181 * data/glr.c (struct YYLTYPE): If locations are not being used,
11182 declare a single dummy member, as empty structs do not conform
11183 to the C standard.
11184 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
11185 the Forte Developer 7 C compiler complains that end-of-loop
11186 code is not reached.
11187
4dcf140b
PE
111882003-06-17 Paul Eggert <eggert@twinsun.com>
11189
11190 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
11191 avoid warnings from picky compilers about redefinition of PARAMS.
11192
8dd76bee
PE
111932003-06-17 Paul Eggert <eggert@twinsun.com>
11194
11195 Version 1.875b.
11196
11197 * NEWS: Document 1.875b.
11198
11199 * lib/bbitset.h: Do not include config.h; that's the includer's job.
11200 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
11201 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
11202 Don't use 'index' in comments, as it's a builtin fn on some hosts.
11203 * lib/bitset_stats.c: Include gettext.h unconditionally, as
11204 per recent gettext manual's suggestion.
11205 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
11206 Use prototypes, not old-style definitions.
11207 * lib/lbitset.c (lbitset_unused_clear): Likewise.
11208 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
11209 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
11210 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
11211 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
11212 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
11213 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
11214 vbitset_or_and_cmp, vbitset_copy): Likewise.
11215
11216 * lib/libiberty.h: Do not include config.h; that's the includer's job.
11217 Do not include <stdlib.h>.
11218 (PARAMS): Define unconditionally for C89.
11219 (ATTRIBUTE_NORETURN): Remove.
11220 (ATTRIBUTE_UNUSED): Define unconditionally.
11221
11222 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
161a71f3 11223 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8dd76bee
PE
11224 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
11225 * lib/vbitset.c, lib/vbitset.h: New files.
11226 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
11227 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
11228 from libbitset.
11229
11230 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
11231 `How Can I Reset @code{yyparse}', since texinfo does not allow
11232 arbitrary @ in node names.
11233
11234 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
11235 shouldn't be needed according to the gettext 0.12.1 documentation
11236 but which seem to be needed anyway: codeset.m4 glibc21.m4
f8e8262e 11237 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8dd76bee 11238 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
f8e8262e 11239 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
cd05d13c 11240
8dd76bee
PE
11241 * lib/.cvsignore: Add stdbool.h.
11242 * m4/.cvsignore: Add nls.m4, po.m4.
11243
11244 Upgrade to CVS gnulib.
11245 * stdbool_.h: File renamed from stdbool.h.in.
11246 * configure.ac (AM_STDBOOL_H): Invoke this instead of
11247 AC_HEADER_STDBOOL.
11248 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
11249 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
11250 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
11251 (MOSTLYCLEANFILES): New var.
11252 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
11253 (stdbool.h): New rule.
11254 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
11255 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
11256 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
11257 m4/quote.m4: Upgrade to today's gnulib.
11258
11259 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
11260 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
11261 the tests right now.
11262 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
11263 yyerror are declared before use; C99 requires this.
11264
25005f6a
PH
112652003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11266
11267 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
11268 first.
11269 (yyrecoverSyntaxError): Correct the logic for setting and testing
11270 yyerrState.
11271 Correct comment on handling EOF.
11272 Allow states with only a default reduction, rather than failing
8dd76bee 11273 (I can't quite reconstruct why these were not allowed before).
25005f6a 11274
137437c6 11275 Fixes to avoid problem that $-N rules in GLR parsers can cause
25005f6a 11276 buffer overruns, corrupting state.
8dd76bee
PE
11277
11278 * src/output.c (prepare_rules): Output max_left_semantic_context
25005f6a
PH
11279 definition.
11280 * src/reader.h (max_left_semantic_context): New variable declaration.
11281 * src/scan-gram.l (max_left_semantic_context): Define.
11282 (handle_action_dollar): Update max_left_semantic_context.
11283 * data/glr.c (YYMAXLEFT): New definition.
11284 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
11285 (yyresolveAction): Ditto.
11286
11287 Fixes to problems with location handling in GLR parsers reported by
11288 Frank Heckenbach (2003/06/05).
11289
11290 * data/glr.c (YYLTYPE): Make trivial if locations not used.
11291 (YYRHSLOC): Add parentheses, and define only if locations used.
11292 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
11293 locations not used.
11294 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
11295 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8dd76bee 11296
25005f6a
PH
11297 * tests/cxx-type.at: Exercise location information; update tests
11298 to differentiate output with and without locations.
8dd76bee 11299 Remove forward declarations of yylex and yyerror---caused errors
25005f6a
PH
11300 because default YYLTYPE not yet defined.
11301 Change semantic actions to compute strings, rather than printing
11302 them directly (to test proper passing of semantics values). Change
11303 output to prefix notation and update test data and expected results.
11304 (yylex): Track locations.
11305 (stmtMerge): Return value rather than printing, and include arguments
11306 in value.
8dd76bee 11307
711f40b7
PE
113082003-06-03 Paul Eggert <eggert@twinsun.com>
11309
11310 Avoid warnings generated by GCC 2.95.4 when Bison is
11311 configured with --enable-gcc-warnings.
11312 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
11313 yy::]b4_parser_class_name[::translate_,
11314 yy::Stack::operator[] (unsigned),
11315 yy::Stack::operator[] (unsigned) const,
11316 yy::Slice::operator[] (unsigned),
11317 yy::Slice::operator[] (unsigned) const):
11318 Rename local vars to avoid warnings.
11319 * tests/glr-regression.at (Improper handling of embedded actions
11320 and $-N in GLR parsers): Remove unused local variable from yylex.
11321 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
11322 (void) as arg when not pure, since we now assume C89 when building
11323 Bison. Pacify GCC by using parameter.
11324
ac695f7d
PE
113252003-06-02 Paul Eggert <eggert@twinsun.com>
11326
11327 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
11328 yy::Location::lines, yy::Location::columns): Rename arguments
11329 to avoid shadowing; this removes a warning generated by GCC 3.3.
11330
26ec81e0
PE
113312003-06-01 Paul Eggert <eggert@twinsun.com>
11332
11333 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
11334 to g++, as GCC 3.3 complains if you do it.
11335 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
11336 everything that WARNING_CFLAGS has, except omit warnings
11337 not suitable for C++.
11338 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
11339 * tests/atlocal.in (CXXFLAGS): New var.
11340 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
11341
11342 Fix a GLR parser bug I reported in February; see
161a71f3 11343 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
26ec81e0
PE
11344 The problem was that GLR parsers did not conform to the C standard,
11345 because actions like { $1 = $2 + $3; } expanded to expressions
11346 that invoked YYFILL in separate subexpressions, and YYFILL assigned
11347 to a local variable. The C standard says that expressions
11348 like (var = f ()) + (var = f ()) have undefined behavior.
11349 Another problem was that GCC sometimes issues warnings that
11350 yyfill and its parameters are unused.
11351
11352 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
11353 as possibly unused.
11354 (yyfill): New function.
11355 (YYFILL): Use it.
11356 (yyuserAction): Change type of yynormal to bool, so that it matches
11357 the new yyfill signature. Mark it as possibly unused.
11358
11359
11360 Follow up on a bug I reported in February, where a Bison-generated
11361 parser can loop. Provide a test case and a fix for yacc.c. I
11362 don't have a fix for lalr1.cc or for glr.c, unfortunately.
11363 The original bug report is in:
161a71f3 11364 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
26ec81e0
PE
11365
11366 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
11367 macro's size was becoming unwieldy.
11368 (yyerrlab): Do not discard an empty lookahead symbol, as this
11369 might destroy garbage.
11370 (yyerrorlab): New label, with the old contents of YYERROR,
11371 plus the following change: pop the stack of rhs corresponding
11372 to the production that invoked YYERROR. That is how Yacc
11373 behaves, and POSIX requires this behavior.
11374 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
11375 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
11376 Define 'alarm' to do nothing if unistd.h is not available.
11377 Add a new rule "exp: '-' error;" to test the above change to
11378 data/yacc.c. Use 'alarm' to abort any test taking longer than
11379 10 seconds, as it's probably looping.
11380 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
11381 Also, the new yacc.c generates two fewer diagnostics for an
11382 existing test.
11383
d0829076
PE
113842003-05-24 Paul Eggert <eggert@twinsun.com>
11385
c6ae27df
PE
11386 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
11387 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
11388 This fixes a problem reported by John Bowman when the Compaq/HP
11389 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
11390 -ansi -Wall -gall).
11391 * data/yacc.c (union yyalloc): Likewise.
11392 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
26ec81e0 11393
d0829076
PE
11394 Switch from 'int' to 'bool' where that makes sense.
11395
11396 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
11397 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
11398 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
11399 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
11400 Return or accept bool, not int. All callers changed.
11401 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
11402 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
11403 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
11404 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
11405 bitset_or_and_cmp_): Likewise.
11406 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
11407 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
11408 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
11409 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
11410 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
11411 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
11412 bitset_stats_or_and_cmp): Likewise.
11413 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
11414 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
11415 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
11416 ebitset_xor_cmp): Likewise.
11417 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
11418 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
11419 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
11420 lbitset_xor_cmp): Likewise.
11421 * lib/bbitset.h: Include <stdbool.h>.
11422 (struct bitset_vtable): The following members now return bool, not
11423 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
11424 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
11425 or_and_cmp).
11426 * src/conflicts.c (count_rr_conflicts): Likewise.
11427 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
11428 All uses changed.
11429 * lib/ebitset.c (ebitset_obstack_init): Likewise.
11430 * lib/lbitset.c (lbitset_obstack_init): Likewise.
11431 * src/getargs.c (debug_flag, defines_flag, locations_flag,
11432 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
11433 graph_flag): Likewise.
11434 * src/getargs.h (debug_flag, defines_flag, locations_flag,
11435 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
11436 graph_flag): Likewise.
11437 * src/output.c (error_verbose): Likewise.
11438 * src/output.h (error_verbose): Likewise.
11439 * src/reader.c (start_flag, typed): Likewise.
11440 * src/reader.h (typed): Likewise.
11441 * src/getargs.c (LOCATIONS_OPTION): New constant.
11442 (long_options, getargs): Use it.
11443 * src/lalr.c (build_relations): Use bool, not int.
11444 * src/nullable.c (nullable_compute): Likewise.
11445 * src/print.c (print_reductions): Likewise.
11446 * src/tables.c (action_row, pack_vector): Likewise.
11447 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
11448 * src/output.c (prepare): Use it.
11449 * src/output.c (token_definitions_output,
11450 symbol_destructors_output, symbol_destructors_output): Use string,
11451 not boolean integer, to keep track of whether to output separator.
11452 * src/print_graph.c (print_core): Likewise.
11453 * src/state.c (state_rule_lookaheads_print): Likewise.
11454
11455 * config/install-sh: Sync from automake 1.7.5.
11456
6b2584b7
PE
114572003-05-14 Paul Eggert <eggert@twinsun.com>
11458
11459 * src/parse-gram.y (rules_or_grammar_declaration): Require a
11460 semicolon after a grammar declaration, in the interest of possible
11461 future changes to the Bison input language.
11462 Do not allow a stray semicolon at the start of the grammar.
11463 (rhses.1): Allow one or more semicolons after any rule, including
11464 just before "|" as required by POSIX.
11465 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
11466 grammar.
11467
caf37a36
ADL
114682003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
11469
11470 %parse-param support for lalr1.cc.
11471
11472 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
11473 b4_cc_constructor_calls, b4_cc_constructor_call,
11474 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
11475 definitions.
11476 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
11477 parse-param arguments.
11478 (yy::b4_parser_class_name): Declare instance variables to
11479 hold parse-param arguments.
11480 * tests/calc.at: s/value/semantic_value/ because value clashes
11481 with a member of yy::b4_parser_class_name. Adjust C++ code
11482 to handle %parse-param. Enable %parse-param test in C++.
11483
3ab37077
PE
114842003-05-12 Paul Eggert <eggert@twinsun.com>
11485
11486 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
11487 English a bit. Fix fclose typo. Change "const char" to "char
11488 const", and use ANSI C rather than K&R for "main". Suggest
11489 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
11490 and suggest yy_switch_to_buffer.
11491
114922003-05-05 Paul Eggert <eggert@twinsun.com>
163ab321
PE
11493
11494 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
11495 C89. This avoids a diagnostic on compilers that define __STDC__
11496 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
161a71f3 11497 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
163ab321 11498
e743727f
PE
114992003-05-03 Paul Eggert <eggert@twinsun.com>
11500
11501 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
11502 Do not overrun array bounds.
11503 This should fix a bug reported today by Olatunji Oluwabukunmi in
161a71f3 11504 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
e743727f 11505
916708d5
AD
115062003-04-29 Akim Demaille <akim@epita.fr>
11507
11508 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
11509 * src/getargs.c, src/getargs.h: here, as bool, not int.
11510 (nondeterministic_parser): New.
11511 * src/parse-gram.y, src/scan-gram.l: Support
11512 %nondeterministic-parser.
11513 * src/output.c (prepare): Use nondeterministic_parser instead
11514 of glr_parser where appropriate.
11515 * src/tables.c (conflict_row, action_row, save_row)
11516 (token_actions, token_actions, pack_vector): Ditto.
11517
a06ea4aa
AD
115182003-04-29 Akim Demaille <akim@epita.fr>
11519
11520 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
11521
211074ca
AD
115222003-04-29 Akim Demaille <akim@epita.fr>
11523
11524 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
11525 with %pure-parser and %locations to exercise the patch from Yakov
11526 Markovitch below.
11527
6175ffe3
PE
115282003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
11529
11530 * data/yacc.c: (b4_lex_param): Corrected for the case where
11531 %lex-param is provided and %pure-parser isn't.
11532
b1e95857
PE
115332003-04-27 Paul Eggert <eggert@twinsun.com>
11534
11535 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
161a71f3 11536 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
b1e95857
PE
11537 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
11538 if it is not defined.
11539 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
11540
acda9df6
PE
115412003-04-26 Paul Eggert <eggert@twinsun.com>
11542
3470c57b
PE
11543 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
11544 Declare to be of type suitable for the ninf value itself, not of
11545 type suitable for the corresponding table, since the latter might
11546 be unsigned but the ninf value might be negative. This fixes a
11547 bug reported by Alexandre Duret-Lutz in
161a71f3 11548 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
3470c57b 11549
acda9df6
PE
11550 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
11551 invokes it. We shouldn't invoke it twice because it will attempt
11552 to put error.o in the archive twice. This fixes a glitch reported
11553 by Martin Mokrejs in
161a71f3 11554 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
acda9df6 11555
b5250f26
PE
115562003-04-21 Paul Eggert <eggert@twinsun.com>
11557
11558 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
11559 to gnulib.
11560
089ac0f1
PE
115612003-04-21 Yakov Markovitch <Markovitch@iso.ru>
11562
11563 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
11564 Fix obvious typo that results in uncompilable GLR parsers
11565 when both %pure-parser and %locations are used. (trivial change)
11566
5ededac6
PE
115672003-04-17 Paul Eggert <eggert@twinsun.com>
11568
1b8f2fff
PE
11569 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
11570 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
11571 Do not insert the expected token via unput, as this runs afoul
11572 of a POSIX-compatibility bug in flex 2.5.31.
11573 All uses changed to BEGIN the parent state,
11574 since we no longer insert the expected token via unput.
11575 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
11576 that is no longer emitted after the above change.
11577
5ededac6
PE
11578 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
11579 the first one. This change is from Paul Hilfinger, and it fixes
11580 regression reported by Werner Lemberg in
161a71f3 11581 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5ededac6
PE
11582
11583 (resolve_sr_conflict): Don't invoke state_errs_set
11584 unless one or more tokens have been explicitly made errors.
11585 Otherwise, the above change causes Bison to abort.
11586
11587 * tests/existing.at (GNU pic Grammar): New test case, taken from
11588 Lemberg's email.
11589
b8be9132
AD
115902003-03-31 Akim Demaille <akim@epita.fr>
11591
11592 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
11593
d423d460
AD
115942003-03-31 Akim Demaille <akim@epita.fr>
11595
11596 * src/output.c (prepare_symbols): Avoid trailing spaces in the
11597 output.
11598
c7e441b4
AD
115992003-03-31 Akim Demaille <akim@epita.fr>
11600
11601 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
11602 From Paul Hilfinger.
11603
231897ad
AD
116042003-03-29 Akim Demaille <akim@epita.fr>
11605
11606 * m4/error.m4: Do not put under dynamic conditions some code which
11607 expansion is under static control.
11608
5b066063
AD
116092003-03-29 Akim Demaille <akim@epita.fr>
11610
11611 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
11612
22a74fec
AD
116132003-03-29 Akim Demaille <akim@epita.fr>
11614
11615 * doc/bison.texinfo (Strings are Destroyed): New.
11616
0eee27e7
PE
116172003-03-13 Paul Eggert <eggert@twinsun.com>
11618
11619 * .cvsignore: Add configure.lineno.
11620 * src/.cvsignore: Add yacc.
11621 * tests/.cvsignore: Add testsuite.log.
11622 * doc/fdl.texi: Sync with latest FSF version.
11623
f61aad93
PE
116242003-03-12 Paul Eggert <eggert@twinsun.com>
11625
537636c7
PE
11626 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
11627 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
11628 cursor, instead of leaving it undefined. This fixes a bug
11629 reported by Tim Van Holder in
161a71f3 11630 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
537636c7
PE
11631 * tests/input.at (Torturing the Scanner): Test the scanner on
11632 an empty input file, which was Tim Van Holder's test case.
11633
11634 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
11635 <sys/resource.h> can be included, include sys/time.h and
11636 sys/times.h first, if available. This works around the SunOS
11637 4.1.4 porting bug reported by Bruce Becker in
161a71f3 11638 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
537636c7
PE
11639
11640 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
11641 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
11642 AC_HEADER_SYS_WAIT.
11643
f61aad93
PE
11644 Merge changes from gnulib. This was prompted because the CVS
11645 snapshot didn't build on Solaris 7 due to strnlen problems.
11646
11647 These changes need to be merged back into gnulib:
11648 * lib/hash.c: Include <stdbool.h> unconditionally.
11649 * m4/onceonly.m4 (m4_quote): New macro.
11650 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
11651 Quote AC_FOREACH variable-expansions properly.
11652 The 2003-01-03 obstack.h change also needs merging.
11653 {end of changes requiring merging}
5b066063 11654
f61aad93
PE
11655 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
11656 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
11657 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
11658 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
11659 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
11660 New files, imported from gnulib.
11661 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
11662 above.
11663
11664 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
11665 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
11666 gnulib sources.
11667
11668 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
11669 Add.
11670 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
11671 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
11672 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
11673 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
11674 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
11675 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
11676 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
11677 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
11678 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
11679 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
11680 (jm_PREREQ_ARGMATCH): Remove.
11681 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
11682 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
11683
11684 * src/system.h: Include <stdbool.h> unconditionally.
11685
11686 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
11687 assuming at least C89 in the bitset code for some time now.
11688
d2ffe116
AD
116892003-03-03 Akim Demaille <akim@epita.fr>
11690
11691 * ro.po: New.
11692
052826fd
AD
116932003-03-02 Akim Demaille <akim@epita.fr>
11694
11695 * doc/bison.texinfo (Table of Symbols): Reactivate the
11696 documentation for %lex-param, and %parse-param.
11697
c4749565
AD
116982003-03-02 Akim Demaille <akim@epita.fr>
11699
11700 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
11701 generate verbose error messages.
11702 Use the number of tokens as an upper bound in yytname, as it
11703 cannot be a non terminal.
11704
d5286af1
AD
117052003-03-02 Akim Demaille <akim@epita.fr>
11706
11707 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
11708 message.
11709
22e304a6
AD
117102003-03-02 Akim Demaille <akim@epita.fr>
11711
22e304a6
AD
11712 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
11713 Use them to exercise yycheck overrun.
11714 Based on Andrew Suffield's grammar.
11715
67a25fed
AD
117162003-03-02 Akim Demaille <akim@epita.fr>
11717
11718 Create tests/local.at for Bison generic testing macros.
11719
11720 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
11721 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
11722 This new file.
11723 * tests/calc.at (AT_CHECK_CALC): Adjust.
11724 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
11725 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
11726 * tests/local.at: here.
11727 (AT_COMPILE_CXX): Tags the tests using it as c++.
11728 Ignore the test if CXX is not functional.
11729
9c2b381f
PE
117302003-03-01 Paul Eggert <eggert@twinsun.com>
11731
11732 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
11733 not loc->end, since loc->end might contain garbage and this leads
11734 to undefined behavior on some platforms.
11735 (id_loc, token_start): Use (IF_LINTed) initial values that do not
11736 depend on *loc, so that the reader doesn't give the the false
11737 impression that *loc is initialized.
11738 (<INITIAL>"%%"): Do not bother setting code_start, since its value
11739 does not survive the return.
11740
0433ba88
AD
117412003-03-01 Akim Demaille <akim@epita.fr>
11742
11743 * src/scan-gram.l (code_start): Always initialize it when entering
11744 into yylex, as SC_EPILOGUE is activated *before* the corresponding
11745 yylex invocation. An alternative would be making it static, but
11746 then it starts with the second %%'s beginning, instead of its end.
11747
b305ea69
PE
117482003-02-28 Paul Eggert <eggert@twinsun.com>
11749
11750 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
11751 around a UnixWare 7.1.1 porting bug reported by John Hughes in
161a71f3 11752 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
b305ea69 11753
c3d25e01
PE
117542003-02-26 Paul Eggert <eggert@twinsun.com>
11755
11756 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
11757 Remove Sequent/Pyramid discussion (nobody uses them any more).
11758 Merge VMS and MS-DOS discussion; these ports may well be dead
11759 but let's keep mentioning them for now. Put <> around email
11760 addresses. Add copyright notice.
11761
c267ffbc
PE
117622003-02-24 Paul Eggert <eggert@twinsun.com>
11763
11764 * data/glr.c (yy_reduce_print): yylineno -> yylno,
11765 to avoid collision with flex use of yylineno.
11766 Problem reported by Bruce Lilly in
161a71f3 11767 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
c267ffbc
PE
11768 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
11769 * data/yacc.c (yy_reduce_print): Likewise.
11770
11771 * config/depcomp: Sync with Automake 1.7.3.
11772
f939fc12
AD
117732003-02-21 Akim Demaille <akim@epita.fr>
11774
11775 * data/lalr1.cc: Use temporary variables instead of casts to
11776 change integer types.
11777 Suggested by Paul Eggert.
11778
95923bd6
AD
117792003-02-21 Akim Demaille <akim@epita.fr>
11780
11781 * doc/bison.texinfo: Use "location" consistently to refer to @n,
11782 to avoid confusions with lalr1.cc's notion of Position.
11783 Suggested by Paul Eggert.
11784
2cdc240e
AD
117852003-02-20 Akim Demaille <akim@epita.fr>
11786
11787 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
11788 before initial_columns.
11789 (location.hh): Use consistent variable names when defining the
11790 operator<<.
11791 Use "last" so that we subtract from Positions, not from unsigned.
11792
5d003116
AD
117932003-02-20 Akim Demaille <akim@epita.fr>
11794
11795 * data/lalr1.cc (position.hh): New subfile, including the extended
11796 and Doxygen'ed documentation of class Position.
11797 (location.hh): Use it.
11798 Document a` la Doxygen.
ba1ecc07 11799 With the help of Benoit Perrot.
5d003116 11800
d02b25f9
AD
118012003-02-20 Akim Demaille <akim@epita.fr>
11802
11803 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
11804 AT_YACC_IF.
11805 Redefine AT_YYERROR_SEES_LOC_IF using it.
11806 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
11807 not defined.
11808 Don't use the location in yy::Parser::error_ and
11809 yy::Parser::print_ when not %locations.
11810 Activate more lalr1.cc tests.
11811
0d1c3a04
AD
118122003-02-19 Akim Demaille <akim@epita.fr>
11813
11814 * data/lalr1.cc: When displaying a line number, be sure to make it
11815 an int.
11816
60a777aa
AD
118172003-02-19 Akim Demaille <akim@epita.fr>
11818
11819 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
11820 Remove, useless.
11821 (YYABORT, YYACCEPT, YYERROR): New.
11822 * tests/calc.at: Renable the lalr1.cc test.
11823
0b86fc41
AD
118242003-02-19 Akim Demaille <akim@epita.fr>
11825
11826 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
11827 error recovery, mixing with/without pops and discarding of the
11828 lookahead.
11829 Exercise YYERROR.
11830 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
11831
da99a5dc
PE
118322003-02-17 Paul Eggert <eggert@twinsun.com>
11833
11834 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
11835 * tests/testsuite.at (AT_COMPILE): Use them.
11836 This fixes the testsuite problem reported by Robert Lentz in
161a71f3 11837 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
da99a5dc 11838
93b8c255
PE
118392003-02-12 Paul Eggert <eggert@twinsun.com>
11840
11841 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
11842 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
161a71f3 11843 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
93b8c255
PE
11844 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
11845 Check for malloc failure, for consistency with yacc.c.
11846 (yytname_size): Remove, for consistency with yacc.c.
11847
11848 The bug still remains in data/lalr1.cc, as I didn't have time
11849 to fix it there.
11850
7548fed2
AD
118512003-02-06 Akim Demaille <akim@epita.fr>
11852
11853 * configure.ac (GXX): Rename as...
11854 (CXX): this, to keep the original Autoconf semantics.
11855 Require 2.57.
11856 * data/lalr1.cc: Fix b4_copyright invocations.
11857 If YYDEBUG is not defined, don't depend upon name_ being defined.
11858 (location.hh): Include string and iostream.
11859 (Position::filename): New member.
11860 (Position::Position ()): New.
11861 (operator<< (Position)): New.
11862 (operator- (Position, int)): New.
11863 (Location::first, Location::last): Rename as...
11864 (Location::begin, Location::end): these, to mock the conventional
11865 iterator names.
11866 (operator<< (Location)): New.
11867 * tests/atlocal.in (CXX): New.
11868 * tests/testsuite.at (AT_COMPILE_CXX): New.
11869 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
11870 locations in a more synthetic way.
11871 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
11872 lalr1.cc is used.
11873 Adjust the C locations to match those from Emacs: first column is
11874 column 0.
11875 Change all the expected results.
11876 Conform to the GCS: simplify the locations when applicable.
11877 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
11878 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
11879 these CPP macros with the m4 macros new defined by...
11880 (AT_CHECK_PUSHDEFS): this, i.e.:
11881 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
d02b25f9 11882 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7548fed2
AD
11883 New macros.
11884 (AT_CHECK_POPDEFS): Undefine them.
11885 (AT_CHECK_CALC_LALR1_CC): New.
11886 Use it for the first lalr1.cc test.
11887
43a176ef
AD
118882003-02-04 Akim Demaille <akim@epita.fr>
11889
11890 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
11891 Location as is defined.
11892
fc049e9c
AD
118932003-02-04 Akim Demaille <akim@epita.fr>
11894
11895 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
11896 name_ being defined.
11897
a737b216
PE
118982003-02-03 Paul Eggert <eggert@twinsun.com>
11899
11900 * src/gram.h (start_symbol): Remove unused decl.
11901
11902 Use more-consistent naming conventions for local vars.
11903
11904 * src/derives.c (derives_compute): Change type of local var from
11905 int to rule_number.
11906 * src/gram.c (grammar_rules_partial_print): Likewise.
11907 * src/print.c (print_core): Likewise.
11908 * src/reduce.c (reduce_grammar_tables): Likewise.
11909
11910 * src/gram.c (grammar_dump): Change name of item_number *
11911 local var from r to rp.
11912 * src/nullable.c (nullable_compute): Likewise.
11913
11914 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
11915
11916 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
11917 for symbol or symbol_number var.
11918 * src/reader.c (grammar_start_symbol_set): Likewise.
11919 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
11920 Likewise.
11921 * src/state.c (transitions_to): Likewise.
11922 * src/state.h: Likewise.
11923 * src/tables.c (symbol_number_to_vector_number): Likewise.
11924
11925 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
11926 char * var.
11927
11928 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
11929 var.
11930
11931 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
11932 var.
11933
11934 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
11935 Use str, not s, for char * var. Use ch, not c, for character var.
11936 Use size for size var.
11937
11938 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
11939 char * var.
11940 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
11941 uniqstr var.
11942 * src/uniqstr.h: Likewise.
11943
11944 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
11945 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
11946 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
11947 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
11948 param to have same name as that of enum, so that we don't use
11949 "s" to stand for a non-state.
11950
68e93ad5
AD
119512003-02-02 Akim Demaille <akim@epita.fr>
11952
11953 * src/scan-skel.l: Scan more than one inert character per yylex
11954 invocation.
11955
92898986
PE
119562003-02-01 Paul Eggert <eggert@twinsun.com>
11957
11958 Version 1.875a.
11959
1d9d5d71
PE
11960 * po/LINGUAS: Add ms.
11961
0435d061
AD
119622003-01-30 Akim Demaille <akim@epita.fr>
11963
11964 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
11965
6029a57f
PH
119662003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11967
11968 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
11969 of $1.
0435d061
AD
11970
11971 Changes in response to error report by S. Eken: GLR mode does not
6029a57f 11972 handle negative $ indices or $ indices in embedded rules correctly.
161a71f3 11973 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
0435d061 11974
6029a57f
PH
11975 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
11976 (b4_rhs_location): Ditto.
0435d061 11977 (yyfill): New function to copy from stack tree into array
6029a57f 11978 incrementally.
0435d061
AD
11979 (yyuserAction): Modify to allow incremental move of semantic values
11980 to rhs array when in GLR mode.
11981 Define YYFILL to use in user-defined actions to fill semantic array
6029a57f
PH
11982 as needed.
11983 Remove dummy use of yystack, as there is now a guaranteed use.
11984 (yydoAction): Modify to allow incremental move of semantic values
11985 to rhs array when in GLR mode.
11986 (yyresolveAction): Ditto.
11987 (yyglrShiftDefer): Update comment.
0435d061 11988 (yyresolveStates): Use X == NULL for pointers, not !X.
6029a57f
PH
11989 (yyglrReduce): Ditto.
11990 (yydoAction): Ditto
0435d061 11991
6029a57f
PH
11992 * tests/glr-regr1.at: Rename to ...
11993 * tests/glr-regression.at: Add new regression test for the problems
11994 described above (adapted from S. Eken).
11995 Update copyright notice.
11996 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
11997 * tests/Makefile.am: Ditto.
11998
6cee6297
PE
119992003-01-28 Paul Eggert <eggert@twinsun.com>
12000
12001 * data/lalr1.cc: Do not use @output_header_name@ unless
12002 b4_defines_flag is set. This fixes two bugs reported by
12003 Tim Van Holder in
161a71f3
PE
12004 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
12005 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
6cee6297 12006
b2a836b5
PE
120072003-01-21 Paul Eggert <eggert@twinsun.com>
12008
12009 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
12010 we don't need to worry about yyerrlab1 being reported as an
12011 "unused label" by non-GCC C compilers. The downside is that if
12012 locations are used then a couple of statements are duplicated each
12013 time YYERROR is invoked, but the upside is that the warnings
12014 should vanish.
12015 (yyerrlab1): Move code to YERROR.
12016 (yyerrlab2): Remove. Change uses back to yyerrlab1.
12017 This reverts some of the 2002-12-27 change.
12018
4196b931
PE
120192003-01-17 Paul Eggert <eggert@twinsun.com>
12020
12021 * src/output.c (symbol_printers_output): Fix typo that led
12022 to core dump. Problem reported by Antonio Rus in
161a71f3 12023 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
4196b931 12024
3ae831b4
AD
120252003-01-13 Akim Demaille <akim@epita.fr>,
12026 Quoc Peyrot <chojin@lrde.epita.fr>,
12027 Robert Anisko <anisko_r@lrde.epita.fr>
12028
12029 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
12030 when the stacks contain one element, as the loop would otherwise
12031 free the last state, and then use the top state (the one we just
12032 popped). This means that the initial elements will not be freed
12033 explicitly, as is the case in yacc.c; it is not a problem, as
12034 these elements have fake values.
12035
e3aa65c5
PE
120362003-01-11 Paul Eggert <eggert@twinsun.com>
12037
12038 * NEWS: %expect-violations are now just warnings, reverting
12039 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
12040 bootstrapping problem reported by Matthias Klose; see
161a71f3 12041 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
e3aa65c5
PE
12042 * src/conflicts.c (conflicts_print): Likewise.
12043 * tests/conflicts.at (%expect not enough, %expect too much,
12044 %expect with reduce conflicts): Likewise.
12045 * doc/bison.texinfo (Expect Decl): Document this. Also mention
12046 that the warning is enabled if the number of conflicts changes
12047 (not necessarily increases).
12048
12049 * src/getargs.c (version): Update copyright year.
12050
f0057011
AD
120512003-01-09 Akim Demaille <akim@epita.fr>
12052
12053 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
12054
1ee6d2a0
PE
120552003-01-08 Paul Eggert <eggert@twinsun.com>
12056
12057 * Makefile.maint (WGETFLAGS):
12058 New macro, containing "-C off" to disable proxy caches.
12059 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
12060 (rel-check): Use $(WGET) instead of wget.
12061
d4fd77c4
PE
120622003-01-06 Paul Eggert <eggert@twinsun.com>
12063
12064 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
12065 the GLR paper of Scott, Johnstone and Hussain.
12066
464c6927
PE
120672003-01-04 Paul Eggert <eggert@twinsun.com>
12068
d600ee67
PE
12069 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
12070 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
12071 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
12072 (EXTRA_LIBRARIES): New var, for liby.a.
12073 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
12074 (EXTRA_SCRIPTS): New var, for yacc.
12075
464c6927
PE
12076 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
12077 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
12078 Problem reported by Nelson H. F. Beebe.
12079
120802003-01-03 Paul Eggert <eggert@twinsun.com>
12081
12082 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
12083 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
12084 when compiling Bison 1.875's `bitset bset = obstack_alloc
12085 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
12086
12087 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
12088 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
12089 grow to a huge size with typical invocation.
d600ee67 12090
464c6927
PE
12091 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
12092 Use the pattern recommended by Autoconf 2.57, except also protect
12093 against double-definition.
12094 * src/system.h: Likewise.
12095 Portability issues reported by Nelson H. F. Beebe.
d600ee67 12096
464c6927
PE
12097 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
12098 All uses changed. Provide a definition in both C and C++.
12099 (yytrue, yyfalse): Define even if defined (__cplusplus).
12100
12101 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
12102 Reported by Nelson H. F. Beebe.
d600ee67 12103
464c6927
PE
12104 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
12105
0f42c7d5
PE
121062003-01-02 Paul Eggert <eggert@twinsun.com>
12107
12108 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
12109 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
12110 Bug reported by Nelson H. F. Beebe.
12111
dc546b0f
PE
121122003-01-01 Paul Eggert <eggert@twinsun.com>
12113
12114 * Version 1.875.
12115
2c09b6a7
PE
121162002-12-30 Paul Eggert <eggert@twinsun.com>
12117
12118 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
12119 Moved here from...
12120 (<INITIAL>","): Here. This causes stray "," to be treated
12121 more uniformly.
12122
dc546b0f 12123 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
12124 last brace in braced code when not in Yacc mode, for compatibility
12125 with Bison 1.35. This resurrects the 2001-12-15 patch to
12126 src/reader.c.
12127
12128 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
12129 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
12130
535c0f63
PE
121312002-12-28 Paul Eggert <eggert@twinsun.com>
12132
12133 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
12134 that of SYM's type. This fixes Debian bug 168069, reported by
12135 Thomas Olsson.
d600ee67 12136
963fcc17
PE
121372002-12-28 Paul Eggert <eggert@twinsun.com>
12138
12139 Version 1.75f.
12140
12141 Switch back to the Yacc style of conflict reports, undoing some
12142 of the 2002-07-30 change.
12143 * doc/bison.texinfo (Understanding): Use Yacc style for
12144 conflict reports. Also, use new way of locating rules.
12145 * src/conflicts.c (conflict_report):
12146 Renamed from conflict_report_yacc, removing the old
12147 'conflict_report'. Translate the entire conflict report at once,
12148 so that we don't assume that "," has the same interpretation in
12149 all languages.
12150 (conflicts_output): Use Yacc-style conflict report for each state,
12151 instead of our more-complicated style.
12152 (conflicts_print): Use Yacc-style conflict report, except print
12153 the input file name when not emulating Yacc.
12154 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
12155 Conflicted Reduction, %expect not enough, %expect too much,
12156 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
12157 * tests/existing.at (GNU Cim Grammar): Likewise.
12158 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
12159
12160 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
12161 fatal): Don't invoke fflush; it's not needed and it might even be
12162 harmful for stdout, as stdout might not be open.
12163 * src/reduce.c (reduce_print): Likewise.
12164
b1efe548
PE
121652002-12-27 Paul Eggert <eggert@twinsun.com>
12166
12167 Fix a bug where error locations were not being recorded correctly.
12168 This problem was originally reported by Paul Hilfinger in
161a71f3 12169 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
12170
12171 * data/yacc.c (yyparse): New local var yylerrsp, to record the
12172 top of the location stack's error locations.
12173 (yyerrlab): Set it. When discarding a token, push its location
12174 onto yylerrsp so that we don't lose track of the error's end.
12175 (yyerrlab1): Now is only the target of YYERROR, so that we can
12176 properly record the location of the action that failed. For GCC
12177 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
12178 GCC warning about yyerrlab1 being unused if YYERROR is unused.
12179 (yyerrlab2): New label, which yyerrlab now falls through to.
12180 Compute the error's location by applying YYLLOC_DEFAULT to
12181 the locations of all the symbols that went into the error.
12182 * doc/bison.texinfo (Location Default Action): Mention that
12183 YYLLOC_DEFAULT is also invoked for syntax errors.
12184 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
12185 Error locations include the locations of all the tokens that were
12186 discarded, not just the last token.
d600ee67 12187
983c5c2c
PE
121882002-12-26 Paul Eggert <eggert@twinsun.com>
12189
b1efe548
PE
12190 * src/files.c: Include quote.h.
12191 (compute_output_file_names): Warn if we detect conflicting
12192 outputs to the same file. This should catch the misunderstanding
12193 exemplified by Debian Bug 165349, reported by Bruce Stephens..
12194
12195 * src/conflicts.c (conflicts_print): If the user specifies
12196 "%expect N", report an error if there are any reduce/reduce
12197 conflicts. This is what the manual says should happen.
12198 This fixes Debian bug 130890, reported by Anthony DeRobertis.
12199 * tests/conflicts.at (%expect with reduce conflicts): New test.
12200
983c5c2c
PE
12201 Don't use m4_include on relative file names, as it doesn't work as
12202 desired if there happens to be a file with that name under ".".
d600ee67 12203
983c5c2c
PE
12204 * m4sugar/version.m4: Remove; it was included but it wasn't used.
12205 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
12206 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
12207 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
12208 * src/output.c (output_skeleton): Use full path names when
12209 specifying a file to include; don't rely on include path, as
12210 it's unreliable when the working file contains a file with
12211 that name.
d600ee67 12212
983c5c2c
PE
122132002-12-25 Paul Eggert <eggert@twinsun.com>
12214
12215 Remove obsolete references to bison.simple and bison.hairy.
12216 Problem mentioned by Aubin Mahe in
161a71f3 12217 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
12218 * data/glr.c: Comment fix.
12219 * doc/bison.1: Remove references. Also, mention "yacc".
12220
12221 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
12222 with -g option.
12223
12224 * src/parse-gram.y (declaration): Use enum "report_states" rather
12225 than its numeric value 1.
12226
12227 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
12228 opening a new one. This fixes Debian bug 165349, reported by
12229 Bruce Stephens.
12230
23f2d9dc
PE
122312002-12-24 Paul Eggert <eggert@twinsun.com>
12232
12233 Version 1.75e.
12234
12235 * Makefile.maint (cvs-update): Don't assume that the shell
12236 supports $(...), as Solaris sh doesn't.
12237
12238 * src/parse-gram.y (lloc_default): Remove test for empty
12239 nonterminals at the end, since it didn't change the result.
12240
122412002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
12242
12243 If the user does not define YYSTYPE as a macro, Bison now declares it
12244 using typedef instead of defining it as a macro. POSIX requires this.
12245 For consistency, YYLTYPE is also declared instead of defined.
12246
12247 %union directives can now have a tag before the `{', e.g., the
12248 directive `%union foo {...}' now generates the C code
12249 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
12250 The default union tag is `YYSTYPE', for compatibility with Solaris 9
12251 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
12252 instead of `yyltype'.
12253
12254 `yystype' and `yyltype' are now obsolescent macros instead of being
12255 typedefs or tags; they are no longer documented and will be
12256 withdrawn in a future release.
12257
12258 * data/glr.c (b4_location_type): Remove.
12259 (YYSTYPE): Renamed from yystype.
12260 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
12261 (struct YYLTYPE): Renamed from struct yyltype.
12262 (YYLTYPE): Renamed from yyltype.
12263 (yyltype, yystype): New (and obsolescent) macros,
12264 for backward compatibility.
12265 * data/yacc.c: Likewise.
12266
12267 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
12268 does not specify a union tag. This is for compatibility with
12269 Solaris 9 yacc.
12270
12271 * src/parse-gram.y (add_param): 2nd arg is now char * not char
12272 const *, since it is now modified by stripping surrounding { }.
12273 (current_braced_code): Remove.
12274 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
12275 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
12276 trailing " {...}". Now of type <chars>.
12277 (grammar_declaration): Adjust to bundled tokens.
12278 (code_content): Remove; stripping is now done by add_param.
12279 (print_token_value): Print contents of bundled tokens.
12280 (token_name): New function.
12281
12282 * src/reader.h (braced_code, current_braced_code): Remove.
12283 (token_name): New decl.
12284
12285 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
12286 token_type, not braced_code code_kind. All uses changed.
12287 (SC_PRE_CODE): New state, for scanning after a keyword that
12288 has (or usually has) an immediately-following braced code.
12289 (token_type): New local var, to keep track of which token type
12290 to return when scanning braced code.
12291 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 12292 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
12293 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
12294 instead of returning a token type immediately.
12295 (<INITIAL>"{"): Set token type.
12296 (<SC_BRACED_CODE>"}"): Use it.
12297 (handle_action_dollar, handle_action_at): Now returns bool
12298 indicating success. Fail if ! current_rule; this prevents a core dump.
12299 (handle_symbol_code_dollar, handle_symbol_code_at):
12300 Remove; merge body into caller.
12301 (handle_dollar, handle_at): Complain in invalid contexts.
12302
12303 * NEWS, doc/bison.texinfo: Document the above.
12304 * NEWS: Fix years and program names in copyright notice.
12305
879ca4f8
PE
123062002-12-17 Paul Eggert <eggert@twinsun.com>
12307
12308 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
12309 Reporting, Table of Symbols): Omit mentions of %lex-param and
12310 %parse-param from the documentation for now.
12311
1c5fe69d
PE
123122002-12-15 Paul Eggert <eggert@twinsun.com>
12313
12314 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
12315 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
12316 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
12317 disagreed with the Bison documentation. Bug
12318 reported by Andrew Walrond.
d600ee67 12319
1c5fe69d
PE
12320 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
12321 as the caller now does that.
12322 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
12323 (YYEMPTY): Parenthesize right hand side, since others use it.
12324 (yyparse): Don't assume that our generated code is the only code
12325 that sets yychar.
12326
d1de5372
PE
123272002-12-13 Paul Eggert <eggert@twinsun.com>
12328
12329 Version 1.75d.
12330
12331 POSIX requires a "yacc" command.
12332 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
12333 (MOSTLYCLEANFILES): Add yacc.
12334 (yacc): New rule.
1c5fe69d 12335 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
12336 as an alias for bison y.
12337
12338 * po/LINGUAS: Add da.
d600ee67 12339
d1de5372
PE
12340 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
12341 problem with latest <getopt.h>.
12342 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
12343
12344 * doc/fdl.texi: Upgrade to 1.2.
12345 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
12346 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
12347 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
12348 gnulib.
12349 * config/install-sh: Sync with autotools.
12350
12351 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
161a71f3 12352 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
12353 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
12354 locations are requested.
12355 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
12356 locations are requested.
12357
d0f3fe23
PE
123582002-12-12 Paul Eggert <eggert@twinsun.com>
12359
12360 Remove unportable casts and storage allocation tricks.
12361 While we're at it, remove almost all casts, since they
12362 usually aren't needed and are a sign of trouble.
12363
12364 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
12365
12366 * src/derives.c (derives_compute): Do not subtract NTOKENS from
12367 the pointer DSET returned by malloc; this isn't portable.
12368 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
12369 Similarly for DERIVES.
12370 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
12371 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
12372 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
12373
12374 * src/derives.c (derives_compute): Do not bother invoking
12375 int_of_rule_number, since rule numbers are integers.
12376
12377 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
12378 rather than XMALLOC (char, N).
12379
12380 * src/files.c (filename_split): Rewrite to avoid cast.
12381
12382 * src/gram.h (symbol_number_as_item_number,
12383 item_number_as_symbol_number, rule_number_as_item_number,
12384 item_number_as_rule_number):
12385 Now inline functions rather than macros, to avoid casts.
12386 * src/state.h (state_number_as_int): Likewise.
12387 * src/tables.c (state_number_to_vector_number,
12388 symbol_number_to_vector_number): Likewise.
12389
12390 * src/gram.h (int_of_rule_number): Remove; no longer used.
12391
12392 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
12393 since the resulting storage is always stored into.
12394
12395 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
12396 where it's needed.
12397
12398 * src/muscle_tab.c (muscle_m4_output):
12399 Now inline. Return bool, not int.
12400 * src/state.c (state_compare): Likewise.
12401 * src/symtab.c (symbol_check_defined,
12402 symbol_check_alias_consistency, symbol_pack, symbol_translation,
12403 hash_compare_symbol, hash_symbol):
12404 Likewise.
12405 * src/uniqstr.c (uniqstr_print): Likewise.
12406 * src/muscle_tab.c (muscle_m4_output_processor):
12407 New function, to avoid casts.
12408 * src/state.c (state_comparator, stage_hasher): Likewise.
12409 * src/symtab.c (symbol_check_defined_processor,
12410 symbol_check_alias_consistency_processor, symbol_pack_processor,
12411 symbol_translation_processor, hash_symbol_comparator,
12412 hash_symbol_hasher): Likewise.
12413 * src/uniqstr.c (uniqstr_print_processor): Likewise.
12414 * src/muscle_tab.c (muscles_m4_output):
12415 Use new functions instead of casting old functions unportably.
12416 * src/state.c (state_hash_new): Likewise.
12417 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
12418 symbols_token_translations_init):
12419 Likewise.
12420 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
12421
12422 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
12423 var instead of casting to long, to avoid casts.
12424 (prepare_states): Use MALLOC rather than alloca, so that we don't
12425 have to worry about alloca.
12426 * src/state.c (state_hash_lookup): Likewise.
12427
12428 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
12429 local var instead of casting to unsigned char, to avoid casts.
12430
12431 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
12432 STATE_ALLOC): Remove.
12433 (transitions_new, errs_new, reductions_new, state_new): Use malloc
12434 rather than calloc, and use offsetof to avoid allocating slightly
12435 too much storage.
12436 (state_new): Initialize all members.
12437
12438 * src/state.c (state_hash): Use unsigned accumulator, not signed.
12439
12440 * src/symtab.c (symbol_free): Remove; unused.
12441 (symbol_get): Remove cast in lhs of assignment.
12442 (symbols_do): Now static. Accept generic arguments, not
12443 hashing-related ones.
12444
12445 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
12446 (symbol_processor): Remove.
12447 (symbols_do): Remove decl; now static.
12448
12449 * src/system.h (alloca): Remove; decl no longer needed.
12450 (<stddef.h>): Include, for offsetof.
12451 (<inttypes.>, <stdint.h>): Include if available.
12452 (uintptr_t): New type, if system lacks it.
12453 (CALLOC, MALLOC, REALLOC): New macros.
12454 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
12455 new macros.
12456
12457 * src/tables.c (table_size): Now int, to pacify GCC.
12458 (table_grow, table_ninf_remap): Use signed table size.
12459 (save_row): Don't bother initializing locals when not needed.
12460 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
12461 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
12462
12463 * src/vcg.h: Correct misspellings.
12464
12465 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
12466
12467
12468 * src/getargs.c (getargs): Don't assume EOF == -1.
12469
26b4a969
PE
124702002-12-09 Paul Eggert <eggert@twinsun.com>
12471
12472 Change identifier spellings to avoid collisions with names
12473 that are reserved by POSIX.
12474
12475 Don't use names ending in _t, since POSIX reserves them.
12476 For consistency, remove _e and _s endings -- they're weren't
12477 needed to remove ambiguity. All uses changed.
12478 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
12479 turn was just renamed from struniq_t.
12480 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
12481 which in turn was just renamed from struniq_processor_t.
12482 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
12483 in turn was renamed from hash_compare_struniq_t.
12484 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
12485 (state_list): Renamed from state_list_t.
12486 * src/assoc.h (assoc): Renamed from assoc_t.
12487 * src/conflicts.c (enum conflict_resolution): Renamed from
12488 enum conflict_resolution_e.
12489 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
12490 (rule_list): Renamed from rule_list_t.
12491 * src/getargs.h (enum trace): Renamed from enum trace_e.
12492 (enum report): Renamed from enum report_e.
12493 * src/gram.h (item_number): Renamed from item_number_t.
12494 (rule_number): Renamed from rule_number_t.
12495 (struct rule_s): Remove the "rule_s" part; not used.
12496 (rule): Renamed from rule_t.
12497 (rule_filter): Renamed from rule_filter_t.
12498 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
12499 (goto_list): Renamed from goto_list_t.
12500 * src/lalr.h (goto_number): Renamed from goto_number_t.
12501 * src/location.h (location): Renamed from location_t.
12502 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
12503 and moved here from:
12504 * src/muscle_tab.h (muscle_entry_t): here.
12505 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
12506 (rule_list): Renamed from rule_list_t.
12507 * src/print_graph.c (static_graph): Renamed from graph.
12508 * src/reader.h (braced_code): Renamed from braced_code_t.
12509 Remove brace_code_e tag.
12510 * src/relation.h (relation_node): Renamed from relation_node_t.
12511 (relation_nodes): Renamed from relation_nodes_t.
12512 (relation): Renamed from relation_t.
12513 * src/state.h (state_number): Renamed from state_number_t.
12514 (struct state): Renamed from struct state_s.
12515 (state): Renamed from state_t.
12516 (transitions): Renamed from transitions_t. Unused (and
12517 misspelled) transtion_s tag removed.
12518 (errs): Renamed from errs_t. Unused errs_s tag removed.
12519 (reductions): Renamed from reductions_t. Unused tag
12520 reductions_s removed.
12521 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
12522 (struct symbol_list): Renamed from struct symbol_list_s.
12523 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
12524 (struct symbol): Renamed from struct symbol_s.
12525 (symbol): Renamed from symbol_t.
12526 * src/tables.c (vector_number): Renamed from vector_number_t.
12527 (action_number): Renamed from action_t.
12528 * src/tables.h (base_number): Renamed from base_t.
12529 * src/vcg.h (enum color): Renamed from enum color_e.
12530 (enum textmode): Renamed from enum textmode_e.
12531 (enum shape): Renamed from enum shape_e.
12532 (struct colorentry): Renamed from struct colorentry_s.
12533 (struct classname): Renamed from struct classname_s.
12534 (struct infoname): Renamed from struct infoname_s.
12535 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
12536 (enum decision): Renamed from enum decision_e.
12537 (enum orientation): Renamed from enum orientation_e.
12538 (enum alignment): Renamed from enum alignment_e.
12539 (enum arrow_mode): Renamed from enum arrow_mode_e.
12540 (enum crossing_type): Renamed from enum crossing_type_e.
12541 (enum view): Renamed from enum view_e.
12542 (struct node): Renamed from struct node_s.
12543 (node): Renamed from node_t.
12544 (enum linestyle): Renamed from enum linestyle_e.
12545 (enum arrowstyle): Renamed from enum arrowstyle_e.
12546 (struct edge): Renamed from struct edge.
12547 (edge): Renamed from edge_t.
12548 (struct graph): Renamed from struct graph_s.
12549 (graph): Renamed from graph_t.
12550 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
12551 Rename value_t -> value.
12552 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
12553 value_t_as_yystype -> value_as_yystype.
12554
12555 Don't include <errno.h> in the mainstream code, since it
12556 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
12557 * lib/get-errno.c, lib/get-errno.h: New files.
12558 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
12559 get-errno.c.
12560 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
12561 * src/output.c (output_skeleton): Likewise.
12562 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
12563 instead of errno.
12564 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
12565 Likewise.
12566 (handle_action_dollar, handle_action_at): Likewise.
12567 * src/system.h: Do not include <errno.h>.
12568 (TAB_EXT): Renamed from EXT_TAB.
12569 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
12570
12571 Avoid str[a-z]*, since <string.h> reserves that name space.
12572 Change all instances of "struniq" in names to "uniqstr", and
12573 likewise for "STRUNIQ" and "UNIQSTR".
12574 * src/uniqstr.c: Renamed from src/struniq.c.
12575 * src/uniqstr.h: Renamed from src/struniq.h.
12576 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
12577 * src/files.c (strsuffix): Remove; unused.
12578 (concat2): Renamed from stringappend. Now static.
12579 * src/files.h (strsuffix, stringappend): Remove; unused.
12580 * src/parse-gram.y (<chars>): Renamed from <string>.
12581 (<uniqstr>): Renamed from <struniq>.
12582 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
12583 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
12584 (struct graph_s.expand): Renamed from struct graph_s.stretch.
12585 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
12586 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
12587 (N_EXPAND): Renamed from N_STRETCH.
12588
12589 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
12590 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
12591 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
12592 Remove; unused.
12593 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
12594 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
12595 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
12596 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
12597 (BASE_MAXIMUM): Renamed from BASE_MAX.
12598 (BASE_MINIMUM): Renamed from BASE_MIN.
12599 (ACTION_MAX): Remove; unused.
12600 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
12601 Unnecessary casts removed from above defines.
12602
12603
12604 Fix misspelling in names.
12605 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
12606 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
12607 G_NODE_ALIGNEMENT.
12608
12609
12610 * lib/timevar.c (timevar_report): Renamed from time_report,
12611 for consistency with other names.
12612 * lib/timevar.h (timevar_report): New decl.
12613 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
12614
12615
12616 Sort include-file uses.
12617
12618 Reorder all include files under src to be in the order "system.h".
12619 then the ../lib include files in angle brackets (alphabetized),
12620 then the . include files in double-quotes (alphabetized). Fix
12621 dependency breakages encountered in this process, as follows:
12622 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
12623 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
12624 * src/state.h: Include "symtab.h".
12625
996b1c7e
PE
126262002-12-08 Paul Eggert <eggert@twinsun.com>
12627
12628 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
12629 since this causes problems when __file__ contains character
12630 sequences like "@" that are treated specially by src/scan-skel.l.
12631 Instead, just use the file's basename. This fixes the bug
12632 reported by Martin Mokrejs in
161a71f3 12633 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 12634
e19c4e5d
PE
126352002-12-06 Paul Eggert <eggert@twinsun.com>
12636
12637 Add support for rules that do not have trailing semicolons, as
12638 POSIX requires. Improve the quality of locations in Bison
12639 diagnostics.
26b4a969 12640
e19c4e5d
PE
12641 * src/location.c: Include <quotearg.h>.
12642 (empty_location): Now const.
12643 (location_print): New function. Follow the recommendation of the
12644 GNU Coding Standards for locations that span file boundaries.
12645 * src/location.h: Do not include <quotearg.h>; no longer needed.
12646 (boundary): New type.
12647 (location_t): Use it. This allows locations to span file boundaries.
12648 All member uses changed: file -> start.file or end.file (as needed),
12649 first_line -> start.line, first_column -> start.column,
12650 last_line -> end.line, last_column -> end.column.
12651 (equal_boundaries): New function.
12652 (LOCATION_RESET, LOCATION_STEP): Remove.
12653 (LOCATION_PRINT): Remove. All callers changed to use location_print.
12654 (empty_location): Now const.
12655 (location_print): New decl.
12656 * src/parse-gram.y (lloc_default): New function, which handles
12657 empty locations more accurately.
12658 (YYLLOC_DEFAULT): Use it.
12659 (%token COLON): Remove.
12660 (%token ID_COLON): New token.
26b4a969 12661 (rules): Use it.
e19c4e5d
PE
12662 (declarations, rules): Remove trailing semicolon.
12663 (declaration, rules_or_grammar_declaration):
12664 Allow empty (";") declaration.
12665 (symbol_def): Remove empty actions; no longer needed.
12666 (rules_or_grammar_declaration): Remove trailing semicolon.
12667 (semi_colon.opt): Remove.
12668 * src/reader.h: Include location.h.
12669 (scanner_cursor): New decl.
12670 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
12671 rolling our own.
12672 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
12673 of *loc.
12674 (STEP): Remove. No longer needed, now that adjust_location does
12675 the work. All uses removed.
12676 (scanner_cursor): New var.
12677 (adjust_location): Renamed from extend_location. It now sets
12678 *loc and adjusts the scanner cursor. All uses changed.
12679 Don't bother testing for CR.
12680 (handle_syncline): Remove location arg; now updates scanner cursor.
12681 All callers changed.
12682 (unexpected_end_of_file): Now accepts start boundary of token or
12683 comment, not location. All callers changed. Update scanner cursor,
12684 not the location.
12685 (SC_AFTER_IDENTIFIER): New state.
12686 (context_state): Renamed from c_context. All uses changed.
12687 (id_loc, code_start, token_start): New local vars.
12688 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
12689 processing of Yacc white space and equivalents here.
12690 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
12691 instead of returning ID immediately, since we need to search for
12692 a subsequent colon.
12693 (<INITIAL>"'", "\""): Save token_start.
12694 (<INITIAL>"%{", "{", "%%"): Save code_start.
12695 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
12696 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
12697 BEGIN context_state at end, not INITIAL.
12698 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
12699 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
12700 Return correct token start.
12701 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
12702 the start of a character, string or multiline comment is found.
12703 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
12704 Reduction): Adjust reported locations to match the more-precise
12705 results now expected.
12706 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
12707 * tests/reduce.at (Useless Rules, Reduced Automaton,
12708 Underivable Rules): Likewise.
12709 * tests/regression.at (Invalid inputs): No longer `expecting ";"
12710 or "|"' now that so many other tokens are allowed by the new grammar.
12711
12712 * src/complain.h (current_file): Remove duplicate decl;
12713 current_file is now owned by files.h.
12714 * src/complain.c, src/scan-gram.l: Include files.h.
12715
127162002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 12717
e19c4e5d
PE
12718 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
12719 promotes to int; it might be unsigned int.
12720 * data/yacc.c (yy_reduce_print): Likewise.
12721
12722 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
12723 be #defined in the prologue, not in the Bison declarations.
12724 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 12725
b64755e3
PE
127262002-12-02 Paul Eggert <eggert@twinsun.com>
12727
12728 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
12729 * lib/strtoul.c: New file, from gnulib.
12730 This fixes a porting bug reported by Peter Klein in
161a71f3 12731 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 12732
6e746484
PE
127332002-11-30 Paul Eggert <eggert@twinsun.com>
12734
b64755e3
PE
12735 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
12736 and put only a forward declaration in the prologue. This is for
12737 consistency with the other scanner helper functions.
12738
6ba55592
PE
12739 Type clashes now generate warnings, not errors, since it
12740 appears that POSIX may allow some grammars with type clashes.
12741 * src/reader.c (grammar_current_rule_check): Warn about
12742 type clashes instead of complaining.
12743 * tests/input.at (Type Clashes): Expect warnings, not complaints.
12744
6e746484
PE
12745 Add Yacc library, since POSIX requires it.
12746 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
12747 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
12748 * lib/main.c, lib/yyerror.c: New files.
12749
12750 gram_error can be static; it need not be extern.
12751 * src/reader.h (gram_error): Remove decl.
12752 * src/parse-gram.y (gram_error): Now static. Add static decl.
12753 (print_token_value): Omit parameter names from forward decl,
12754 for consistency.
12755
88510f9c
PE
127562002-11-29 Paul Eggert <eggert@twinsun.com>
12757
6e746484
PE
12758 * doc/bison.texinfo: Emphasize that yylex and yyerror must
12759 be declared before being used. E.g., one should typically
12760 declare them in the prologue. Use GNU coding style in examples.
12761 Put "const" consistently after the type it modifies. Mention
12762 that C99 supports "inline". Mention that yyerror traditionally
12763 returns "int".
12764
88510f9c
PE
12765 %parse-param and %lex-param now take just one argument, the
12766 declaration; the argument name is deduced from the declaration.
12767
12768 * doc/bison.texinfo (Parser Function, Pure Calling, Error
12769 Reporting, Table of Symbols): Document this.
12770 * src/parse-gram.y (add_param): New function.
12771 (COMMA): Remove.
12772 (declaration): Implement new rule for %parse-param and %lex-param.
12773 * src/scan-gram.l: "," now elicits a warning, rather than being
12774 a token; this is more compatible with byacc.
12775 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
12776
bb92250c
PE
127772002-11-27 Paul Eggert <eggert@twinsun.com>
12778
12779 Rename identifiers to avoid real and potential collisions.
12780
12781 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
12782 to avoid collision with lex macro described by Bruce Lilly in
161a71f3 12783 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
12784 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
12785 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
12786 * src/parse-gram.y (print_token_value): Renamed from yyprint.
12787 All uses changed.
12788 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
12789 The name "yycontrol" violates the name space rules, and this stuff
12790 wasn't being used anyway.
12791 (input): Remove action; this stuff wasn't being used.
12792 (gram_error): Rename local variable yylloc -> loc.
12793 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
12794 (YY_DECL): Don't use "yy" at start of local variables.
12795 All uses changed, e.g., yylloc -> loc.
12796 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
12797 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
12798 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
12799 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
12800
12801 * src/parse-gram.y (gram_error): loc is now const *.
12802 * src/reader.h (gram_error): Likewise.
12803
3af4feb2
PE
128042002-11-24 Paul Eggert <eggert@twinsun.com>
12805
12806 Version 1.75c.
12807
12808 * tests/actions.at (Actions after errors): Use an output format
12809 more similar to that of the Printers and Destructors test.
12810 Test the position of the ';' token too.
12811 (Printers and Destructors): Likewise.
12812 (Printers and Destructors: %glr-parser): Remove for now, to avoid
12813 unnecessarily alarming people when the test fails.
12814
12815 * data/yacc.c (yyerrlab1): Move this label down, so that the
12816 parser does not discard the lookahead token if the user code
12817 invokes YYERROR. This change is required for POSIX conformance.
12818
12819 * lib/error.c: Sync with gnulib.
12820
128212002-11-22 Paul Eggert <eggert@twinsun.com>
12822
12823 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
12824 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
12825 * lib/xmalloc.c: Likewise.
26b4a969 12826
58004308
PE
128272002-11-20 Paul Eggert <eggert@twinsun.com>
12828
12829 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
12830
128312002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 12832
58004308
PE
12833 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
12834 should use `if (! x) abort ();' rather than `assert (x);', and
12835 anyway it's one less thing to worry about configuring.
12836
12837 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
12838 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
12839 and replace all instances of assert with abort.
12840 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
12841 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
12842
12843 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
12844 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
12845 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
12846 hash_find_entry, hash_rehash, hash_insert): Likewise.
12847 * src/conflicts.c (resolve_sr_conflict): Likewise.
12848 * src/lalr.c (set_goto_map, map_goto): Likewise.
12849 * src/nullable.c (nullable_compute): Likewise.
12850 * src/output.c (prepare_rules, token_definitions_output): Likewise.
12851 * src/reader.c (packgram, reader): Likewise.
12852 * src/state.c (state_new, state_free, state_transitions_set,
12853 state_reduction_find): Likewise.
12854 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
12855 symbol_pack): Likewise.
12856 * src/tables.c (conflict_row, pack_vector): Likewise.
12857 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
12858 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
12859 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
12860 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
12861
12862 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
12863 (ARGMATCH_CONSTRAINT): New macro.
12864 (ARGMATCH_ASSERT): Use it.
12865
12866 * src/system.h (verify): New macro.
12867 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
12868 rather than assert.
12869 * src/tables.c (tables_generate): Likewise.
12870
12871 * src/struniq.c (struniq_assert): Now returns void, and aborts
12872 if the assertion is false.
12873 (struniq_assert_p): Remove.
12874 * src/struniq.h: Likewise.
12875
76ae8198
PE
128762002-11-18 Paul Eggert <eggert@twinsun.com>
12877
12878 * data/glr.c (yygetLRActions): Replace `yyindex' with
12879 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
12880 This fixes the regression with Sun ONE Studio 7 cc that I reported in
161a71f3 12881 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 12882
d3c4e709
AD
128832002-11-18 Akim Demaille <akim@epita.fr>
12884
12885 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
12886 space.
12887 From Tim Van Holder.
12888
8d8a7238
PE
128892002-11-17 Paul Eggert <eggert@twinsun.com>
12890
12891 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
12892 to "SyntaxError" for consistency with my 2002-11-15 change.
12893
12894 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
12895 not define to {}, since this breaks the common use of `YYDPRINTF
12896 ((...));' if a single statement is desired (e.g. before `else').
12897 Work around GCC warnings by surrounding corresponding calls with
12898 {} if needed.
12899 (yyhasResolvedValue): Remove unused function.
12900 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
12901 loop body.
12902 (yyreportSyntaxError): Renamed from yyreportParseError.
12903 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
12904 All uses changed.
12905 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
12906 extern when possible. Remove unused initializations.
12907
b0937b22
AD
129082002-11-16 Akim Demaille <akim@epita.fr>
12909
12910 Augment the similarity between GLR and LALR traces.
12911
12912 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
12913 (YY_REDUCE_PRINT): New.
12914 (yyparse): Use them.
12915 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
12916 YYDPRINT here.
12917 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
12918 state reached after the reduction/recovery, since...
12919 (yyparse, yyprocessOneStack): Report the state we are entering in.
12920
c5e3e510
AD
129212002-11-16 Akim Demaille <akim@epita.fr>
12922
12923 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
12924 Add support for --trace=skeleton.
12925 * src/scan-skel.l: %option debug.
12926 Scan strings of non-@ or \n instead of character by character.
12927 (scan_skel): Handle trace_skeleton.
12928 (QPUTS): New.
12929 (@output_parser_name@, @output_header_name@): ``Restore'' their
12930 support (used to be M4 macros).
12931 * data/yacc.c: Quote larger chunks, a la glr.c.
12932 * data/lalr1.cc: Likewise.
12933 The header guards are no longer available, so use some other
12934 string than `YYLSP_NEEDED'.
12935
4c6cc1db
AD
129362002-11-16 Akim Demaille <akim@epita.fr>
12937
12938 Make the ``Printers and Destructors'' test more verbose, taking
12939 `yacc.c''s behavior as (possibly wrong) reference.
12940
12941 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
12942 instead of fprint on stdout.
12943 Set and report the last_line of the symbols.
12944 Consistently display values and locations.
12945
6d9e8019
PE
129462002-11-16 Paul Eggert <eggert@twinsun.com>
12947
12948 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
12949
6e649e65
PE
129502002-11-15 Paul Eggert <eggert@twinsun.com>
12951
b25d88f6
PE
12952 * tests/actions.at (Actions after errors): New test case.
12953
6e649e65
PE
12954 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
12955 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
12956 tests/action.at, tests/calc.at, tests/conflicts.at,
12957 tests/cxx-type.at, tests/regression.at:
12958 "parse error" -> "syntax error" for POSIX compatibility.
12959 "parsing stack overflow..." -> "parser stack overflow" so
12960 that code matches Bison documentation.
12961
0f39aab9
AD
129622002-11-15 Akim Demaille <akim@epita.fr>
12963
12964 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
12965 take two BRACED_CODE, not two string_content.
12966 Free the scanner's obstack when we are done.
12967 (code_content): New.
12968 * tests/calc.at: Adjust.
12969 * doc/bison.texinfo: Adjust.
12970 Also, make sure to include the `,' for these declarations.
12971
761c1926
AD
129722002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
12973
12974 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
12975 definition; avoids potential autoreconf problems.
12976
b0f98b10
AD
129772002-11-15 Akim Demaille <akim@epita.fr>
12978
12979 Always check the value returned by yyparse.
12980
12981 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
12982 returned by yyparse.
12983 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
12984 Adjust calls.
12985 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
12986 returned by yyparse.
12987
970785f1
PH
129882002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12989
12990 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
12991 on input.at test.
12992
8fcc7db1
PE
129932002-11-14 Paul Eggert <eggert@twinsun.com>
12994
7ec1b48e
PE
12995 * src/output.c (output_skeleton): Call xfopen instead of
12996 duplicating xfopen's body.
12997
cfff7583 12998 Fix bugs reported by Nelson H. F. Beebe in
161a71f3 12999 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 13000
8fcc7db1
PE
13001 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
13002 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
13003 Group compiler. Instead, use "$CC -E bar.c". Include the .h
13004 file twice in the grammar, as an extra check.
13005
13006 * tests/input.at (Torturing the Scanner): Surround the
13007 backslash-newline tests with "#if 0", to make it less likely that
13008 we'll run into compiler bugs. Bring back solitary \ inside
13009 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 13010 test backslash-newline in C character constant.
8fcc7db1 13011
4e8d992c
AD
130122002-11-14 Akim Demaille <akim@epita.fr>
13013
13014 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
13015 status of the compiler.
f32b346d 13016 Calling `exit 1' is no longer needed.
4e8d992c
AD
13017 Reported by Nelson H. F. Beebe.
13018
9501dc6e
AD
130192002-11-14 Akim Demaille <akim@epita.fr>
13020
13021 * tests/atlocal.in (CPPFLAGS): We have config.h.
13022 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
13023 New.
13024 * tests/actions.at, tests/calc.at, tests/conflicts.at,
13025 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
13026 * tests/regression.at, tests/torture.at: Use them for all the
13027 grammars that are to be compiled.
13028 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
13029 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
13030 * doc/bison.texinfo (GLR Parsers): Document `inline'.
13031
18b519c0
AD
130322002-11-14 Akim Demaille <akim@epita.fr>
13033
13034 * doc/bison.texinfo: Various formatting changes (alignments in
13035 samples, additional @group/@end group, GCS in samples.
13036 Use @deffn instead of simple @table to define the directives,
13037 macros, variables etc.
13038
9a86cdb9
PE
130392002-11-13 Paul Eggert <eggert@twinsun.com>
13040
daa33def 13041 Fix some bugs reported by Albert Chin-A-Young in
161a71f3 13042 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 13043
daa33def 13044 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 13045 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
13046 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
13047 * tests/headers.at (export YYLTYPE): Likewise.
13048
13049 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 13050 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 13051
9a86cdb9
PE
13052 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
13053 comments, since they're not portable. Use GNU coding style.
13054
9c1e26bd
AD
130552002-11-13 Akim Demaille <akim@epita.fr>
13056
13057 * data/yacc.c: Leave bigger chunks of quoted text.
13058 (YYDSYMPRINTF): New.
13059 Use it to report symbol activities.
13060 * data/glr.c (YYDSYMPRINTF): New.
13061 Use it.
13062
87f721cc
PE
130632002-11-12 Paul Eggert <eggert@twinsun.com>
13064
13065 Version 1.75b.
13066
13067 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
13068 (yyglrReduce): Return yyok, not 0.
13069 This should avoid the enumerated-type warnings reported
464c6927 13070 by Nelson H. F. Beebe in
161a71f3 13071 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
13072
13073 * lib/bbitset.h (BITSET_INLINE): Remove.
13074 * lib/bitset.h [! BITSET_INLINE]: Remove.
13075 (bitset_set, bitset_reset, bitset_test): Rename local vars
13076 to avoid shadowing warnings by GCC.
13077
13078 * data/glr.c (inline): Remove #define. It's the user's
13079 responsibility to #define it away, just like 'const'.
464c6927 13080 This fixes one of the bugs reported by Nelson H. F. Beebe in
161a71f3 13081 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 13082
87f721cc
PE
13083 * Makefile.maint (po-check): Scan .l and .y files instead of the
13084 .c and the .h files that they generate. This fixes the bug
13085 reported by Tim Van Holder in:
161a71f3 13086 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
13087 Look for N_ as well as for _. Try to avoid matching #define for
13088 N_ and _.
13089 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
13090 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
13091 * src/scan-gram.l: Revamp regular expressions so that " and '
13092 do not confuse xgettext.
13093
13094 * src/struniq.h (struniq_new): Do not declare the return type
13095 to be 'const'; this violates the C standard.
13096 * src/struniq.c (struniq_new): Likewise.
13097
be14ade5
AD
130982002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
13099
13100 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
13101 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
13102 linker.
13103
05291fbc
AD
131042002-11-12 Akim Demaille <akim@epita.fr>
13105
13106 * Makefile.maint: Sync with Autoconf:
13107 (local_updates): New.
13108
1f5fd52e
AD
131092002-11-12 Akim Demaille <akim@epita.fr>
13110
13111 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
13112
283f1e64
AD
131132002-11-12 Akim Demaille <akim@epita.fr>
13114
13115 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
13116 locations.
13117
886b69d1
AD
131182002-11-12 Akim Demaille <akim@epita.fr>
13119
13120 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
13121 not yyvalue.
13122
3df37415
AD
131232002-11-12 Akim Demaille <akim@epita.fr>
13124
13125 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
13126 Use it to test the GLR parser.
13127
7bd6c77e
AD
131282002-11-12 Akim Demaille <akim@epita.fr>
13129
13130 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
13131 defines it.
13132 * data/glr.c (yystos): New.
13133 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
13134 (YYDSYMPRINT): New.
13135 (yyval): Don't define it, it is handled via M4.
13136 (yyrecoverParseError): Free verbosely the discarded symbols.
13137 * data/yacc.c (yysymprint): Remove, rather...
13138 (b4_yysymprint_generate): invoke.
13139 * data/c.m4 (b4_yysymprint_generate): New.
13140 Accept pointers as arguments, as opposed to the version from
13141 yacc.c.
13142 (b4_yydestruct_generate): Likewise.
13143 * tests/cations.at (Printers and Destructors): Use Bison directives
13144 instead of CPP macros.
13145 Don't rely on internal details.
13146
b0400cc6
AD
131472002-11-12 Akim Demaille <akim@epita.fr>
13148
13149 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
13150 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
13151 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
13152 it against YYEMPTY and so forth), work on yytoken (i.e., set
13153 it to YYEMPTY etc.).
13154 (yydestruct): Replace with a b4_yydestruct_generate invocation.
13155 (b4_symbol_actions): Remove.
13156 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
13157 for 0, end-of-input.
13158
72f889cc
AD
131592002-11-12 Akim Demaille <akim@epita.fr>
13160
13161 * doc/bison.texinfo (Destructor Decl): New.
13162
b1ae9233
AD
131632002-11-12 Akim Demaille <akim@epita.fr>
13164
13165 * src/tables.c (tables_generate): Use free for pointers that
13166 cannot be NULL, not XFREE.
13167 (pack_vector): Use assert, not fatal, for bound violations.
13168 * src/state.c (state_new): Likewise.
13169 * src/reader.c (reader): Likewise.
13170 * src/lalr.c (set_goto_map): Likewise.
72f889cc 13171 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
13172 the file name.
13173
7ec2d4cd
AD
131742002-11-12 Akim Demaille <akim@epita.fr>
13175
13176 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
13177 Restore.
13178 * src/scan-gram.l (last_string): Is global to the file, not to
13179 yylex.
13180 * src/parse-gram.y (input): Don't append the epilogue here,
13181 (epilogue.opt): do it here, and free the scanner's obstack.
13182 * src/reader.c (epilogue_set): Rename as...
13183 (epilogue_augment): this.
13184 * data/c.m4 (b4_epilogue): Defaults to empty.
13185
573a6cd3
AD
131862002-11-12 Akim Demaille <akim@epita.fr>
13187
13188 * src/getargs.c (long_options): Remove duplicates.
13189 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
13190 Remove.
13191 * doc/bison.rnh: Remove.
13192 * doc/bison.texinfo (VMS Invocation): Remove.
13193
95612cfa
AD
131942002-11-12 Akim Demaille <akim@epita.fr>
13195
13196 * src/struniq.h, src/struniq.c (struniq_t): Is const.
13197 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
13198
13199 Use struniq for symbols.
13200
13201 * src/symtab.h (symbol_t): The tag member is a struniq.
13202 (symbol_type_set): Adjust.
13203 * src/symtab.c (symbol_new): Takes a struniq.
13204 (symbol_free): Don't free the tag member.
13205 (hash_compare_symbol_t, hash_symbol_t): Rename as...
13206 (hash_compare_symbol, hash_symbol): these.
13207 Use the fact that tags as struniqs.
13208 (symbol_get): Use struniq_new.
13209 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
13210 Returns a strniq.
13211 * src/reader.h (merger_list, grammar_currentmerge_set): The name
13212 and type members are struniqs.
13213 * src/reader.c (get_merge_function)
13214 (grammar_current_rule_merge_set): Adjust.
13215 (TYPE, current_type): Are struniq.
13216
13217 Use struniq for file names.
13218
13219 * src/files.h, src/files.c (infile): Split into...
13220 (grammar_file, current_file): these.
13221 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
13222 * src/reduce.c (reduce_print): Likewise.
13223 * src/getargs.c (getargs): Likewise.
13224 * src/complain.h, src/complain.c: Likewise.
13225 * src/main.c (main): Call struniqs_new early enough to use it for
13226 file names.
13227 Don't free the input file name.
13228
3e6656f9
AD
132292002-11-12 Akim Demaille <akim@epita.fr>
13230
13231 * src/symtab.c (symbol_free): Remove dead deactivated code:
13232 type_name are properly removed.
13233 Don't use XFREE to free items that cannot be NULL.
13234 * src/struniq.h, src/struniq.c: New.
13235 * src/main.c (main): Initialize/free struniqs.
13236 * src/parse-gram.y (%union): Add astruniq member.
13237 (yyprint): Adjust.
13238 * src/scan-gram.l (<{tag}>): Return a struniq.
13239 Free the obstack bit that used to store it.
13240 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
13241
7672019c
PE
132422002-11-11 Paul Eggert <eggert@twinsun.com>
13243
13244 Revamp to fix many (but not all) of the C- and M4-related quoting
13245 problems. Among other things, this fixes the Bison bug reported
13246 by Jan Hubicka when processing the Bash grammar; see:
161a71f3 13247 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
13248
13249 Use new @ escapes consistently. Represent brackets with @{ and @}
13250 rather than @<:@ and @:>@, since this works a bit better with dumb
13251 editors like vi. Represent @ with @@, since @ is now consistently
13252 an escape. Use @oline@ and @ofile@ rather than __oline__ and
13253 __ofile__, to avoid unexpected expansions. Similarly, use @output
13254 rather than #output.
13255
13256 * data/c.m4 (b4_copyright): Omit file name from comment, since
13257 the file name could contain "*/".
13258 (b4_synclines_flag): Don't quote the 2nd argument; it should already
13259 be quoted. All uses changed.
13260
13261 * data/glr.c: Use new @ escapes consistently.
13262 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
13263 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
13264 Remove, since they couldn't handle arbitrary characters in file
13265 names.
13266 * data/lalr1.cc: Likewise.
13267 * data/yacc.c: Likewise.
13268
13269 * src/files.c (output_infix): Remove; all uses removed.
13270 * src/files.h: Likewise.
13271
13272 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
13273 mishandled funny characters in file names, and anyway it isn't
13274 needed any more.
13275 * data/yacc.c: Likewise.
13276 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
13277
13278 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
13279 * data/yacc.c: Likewise.
13280
13281 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
13282 strings now.
13283 (muscle_init): Quote filename as a C string.
13284 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
13285 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
13286 * src/output.c (escaped_file_name_output): New function.
13287 (prepare_symbols): Quote tokens for M4.
13288 (prepare): Don't insert output_infix, output_prefix,
13289 output_parser_name, output_header_name; this is now down by scan-skel.
13290 Insert skeleton as a C string.
13291
13292 * src/output.c (user_actions_output, symbol_destructors_output,
13293 symbol_printers_output): Quote filenames for C and M4.
13294 * src/reader.c (prologue_augment, epilogue_set): Likewise.
13295
13296 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
13297 escapes other than \\ and \'; this simplifies the code.
13298 (<SC_STRING>): Likewise, for \\ and \".
13299 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
13300 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
13301 Use new escapes @{ and @} for [ and ].
13302
13303 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
13304 them with auto vars.
13305 Switch to new escape scheme, where @ is the escape character uniformly.
13306 Abort if a stray escape character is found. Avoid unbounded input
13307 buffer when parsing non-escaped text.
13308
13309 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
13310 __oline__, #output, $@, and @{ do not have unintended meanings.
13311
acea4f3b
PE
133122002-11-09 Paul Eggert <eggert@twinsun.com>
13313
13314 Fix the test failure due to GCC warnings described in
161a71f3 13315 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
13316 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
13317 evaluate to 0 if it's impossible for NINF to be in the respective
13318 table.
13319 (yygetLRActions, yyrecoverParseError): Use them.
13320
13321 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
13322 counted in the token inserted at end of file. Now takes
13323 location_t *, not location_t, so that the location can be
13324 adjusted. All uses changed.
13325
13326 * tests/regression.at (Invalid inputs): Adjust wording in
13327 diagnostic to match the new behavior.
13328
13329 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
13330 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
13331 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
13332 abort ();'. This reduces the runtime of the "Many lookaheads"
13333 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
13334 GCC 3.2.
13335
20ef1ad5
PE
133362002-11-07 Paul Eggert <eggert@twinsun.com>
13337
13338 * src/parse-gram.y (CHARACTER): Remove unused token.
13339 All uses removed.
13340
13341 * src/scan-gram.l: Remove stack option. We no longer use the
13342 stack, since the stack was never deeper than 1; instead, use the
13343 new auto var c_context to record the stacked value.
13344
13345 Remove nounput option. At an unexpected end of file, we now unput
13346 the minimal input necessary to end cleanly; this simplifies the
13347 code.
13348
13349 Avoid unbounded token sizes where this is easy.
13350
13351 (unexpected_end_of_file): New function.
13352 Use it to systematize the error message on unexpected EOF.
13353 (last-string): Now auto, not static.
13354 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
13355 (scanner_last_string_free): Remove; not used.
13356 (percent_percent_count): Move decl to just before use.
13357 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
13358 not the (never otherwised-used) CHARACTER.
13359
93724f13
AD
133602002-11-07 Akim Demaille <akim@epita.fr>
13361
13362 Let yyerror always receive the msg as last argument, so that
13363 yyerror can be variadic.
13364
13365 * data/yacc.c (b4_yyerror_args): New.
13366 Use it when calling yyerror.
13367 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
13368 Use it when calling yyerror.
13369 * doc/bison.texinfo (Error Reporting): Adjust.
13370 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
13371 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
13372
6e40b4eb
AD
133732002-11-06 Akim Demaille <akim@epita.fr>
13374
13375 #line should have quoted strings.
13376 Ideally, this should be done by m4_quotearg.
13377
13378 * src/scan-skel.l: Include quotearg.h.
13379 Quote __ofile__.
13380 * src/output.c (symbol_printers_output)
13381 (symbol_destructors_output): Quote the file name.
13382
2dfbfc12
AD
133832002-11-06 Akim Demaille <akim@epita.fr>
13384
13385 * tests/regression.at (Invalid inputs): Adjust to the recent
13386 messages.
13387
437c2d80
AD
133882002-11-06 Akim Demaille <akim@epita.fr>
13389
13390 Restore --no-lines.
13391 Reported by Jim Kent.
13392
13393 * data/c.m4 (b4_syncline): New.
13394 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
13395 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
13396 * src/output.c (user_actions_output): Likewise.
13397 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 13398 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 13399
900c5db5
AD
134002002-11-06 Akim Demaille <akim@epita.fr>
13401
13402 * src/main.c (main): Free `infile'.
13403 * src/scan-gram.l (handle_syncline): New.
13404 Recognize `#line'.
13405 * src/output.c (user_actions_output, symbol_destructors_output)
13406 (symbol_printers_output): Use the location's file name, not
13407 infile.
13408 * src/reader.c (prologue_augment, epilogue_set): Likewise.
13409
e183b123 134102002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 13411
e183b123 13412 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 13413 either has GLR conflict entries.
e183b123 13414
193eb6b7
PE
134152002-11-05 Paul Eggert <eggert@twinsun.com>
13416
e183b123
PE
13417 * src/scan-gram.l: Use more accurate diagnostics, e.g.
13418 "integer out of range" rather than "invalid value".
13419 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
13420 accordingly.
13421
193eb6b7
PE
13422 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
13423 Also, remove one static variable in the scanner.
13424
13425 * src/scan-gram.l (braces_level): Now auto, not static.
13426 Initialize to zero if the compiler is being picky.
13427 (INITIAL): Clear braces_level instead of incrementing it.
13428 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
13429 as POSIX 1003.1-2001 requires.
13430 * src/system.h (IF_LINT): New macro, taken from coreutils.
13431 * configure.ac: Define "lint" if --enable-gcc-warnings.
13432
29c01725
AD
134332002-11-05 Akim Demaille <akim@epita.fr>
13434
13435 * src/scan-gram.l: When it starts with `%', complain about the
13436 whole directive, not just that `invalid character: %'.
13437
8aeac3ca
AD
134382002-11-04 Akim Demaille <akim@epita.fr>
13439
13440 * Makefile.maint: Update from Autoconf.
13441 (update, cvs-update, po-update, do-po-update): New.
13442
793a58bb
AD
134432002-11-04 Akim Demaille <akim@epita.fr>
13444
13445 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
13446 and yyerror.
13447 Have yyerror `use' its arguments.
13448 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
13449 returns true when location & yacc & pure & parse-param.
13450 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
13451
c4d720cd
AD
134522002-11-04 Akim Demaille <akim@epita.fr>
13453
13454 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
13455 clashes.
13456 * src/scan-gram.l: Use [\'] instead of ['] to pacify
13457 font-lock-mode.
13458 Use complain_at.
13459 Use quote, not quote_n since LOCATION_PRINT no longer uses the
13460 slot 0.
13461
613a0dc5
PE
134622002-11-03 Paul Eggert <eggert@twinsun.com>
13463
13464 * src/reader.c (get_merge_function, grammar_current_rule_check):
13465 Use consistent diagnostics for reporting type name clashes.
13466 Quote the types with <>, for consistency with Yacc.
13467 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
13468
2a8d363a
AD
134692002-11-03 Akim Demaille <akim@epita.fr>
13470
13471 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
13472 New.
13473 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
13474 (b4_parse_param): Remove.
13475 Use b4_identification.
13476 Propagate b4_pure_args where needed to pass them to yyerror.
13477 * data/glr.m4 (b4_parse_param): Remove.
13478 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
13479 (b4_lpure_formals): New.
13480 Use b4_identification.
13481 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
13482 b4_user_formals and b4_user_args.
13483 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
13484 (yyreportAmbiguity): When using a pure parser, also need
13485 the location, and the parse-params.
13486 Adjust callers.
13487 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
13488 When using a pure parser, also need the parse-params.
13489 Adjust callers.
13490 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
13491 (%pure-parser + %parse-param) LALR and GLR parsers.
13492 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
13493 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
13494 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
13495 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
13496 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
13497 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
13498 * doc/bison.texinfo: Untabify the whole file.
13499 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
13500 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
13501 (Error Reporting): Adjust to these new directives.
13502 Document %error-verbose, deprecate YYERROR_VERBOSE.
13503
9e32add8
AD
135042002-11-03 Akim Demaille <akim@epita.fr>
13505
13506 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
13507 AT_CHECK_CALC_GLR invocations to use % directives, instead of
13508 command line options.
13509 * tests/cxx-type.at: Formatting changes.
13510
b02d90a5
PE
135112002-11-03 Paul Eggert <eggert@twinsun.com>
13512
13513 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
13514 to count columns correctly, and to check for invalid inputs.
9e32add8 13515
b02d90a5
PE
13516 Use mbsnwidth to count columns correctly. Account for tabs, too.
13517 Include mbswidth.h.
13518 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
13519 (extend_location): New function.
13520 (YY_LINES): Remove.
13521
13522 Handle CRLF in C code rather than in Lex code.
13523 (YY_INPUT): New macro.
13524 (no_cr_read): New function.
13525
13526 Scan UCNs, even though we don't fully handle them yet.
13527 (convert_ucn_to_byte): New function.
13528
13529 Handle backslash-newline correctly in C code.
13530 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
13531 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
13532 all uses changed.
13533 (tag, splice): New EREs. Do not allow NUL or newline in tags.
13534 Use {splice} wherever C allows backslash-newline.
13535 YY_STEP after space, newline, vertical-tab.
13536 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 13537
b02d90a5
PE
13538 (letter, id): Don't assume ASCII; e.g., spell out a-z.
13539
13540 ({int}, handle_action_dollar, handle_action_at): Check for integer
13541 overflow.
9e32add8 13542
b02d90a5
PE
13543 (YY_STEP): Omit trailing semicolon, so that it's more like C.
13544
13545 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
13546 as well as \000. Check for UCHAR_MAX, not 255.
13547 Allow \x with an arbitrary positive number of digits, as in C.
13548 Check for overflow here.
13549 Allow \? and UCNs, for compatibility with C.
13550
13551 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
13552 with quote slot used by complain_at.
13553
13554 * tests/input.at: Add tests for backslash-newline, m4 quotes
13555 in symbols, long literals, and funny escapes in strings.
13556
13557 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
13558 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
13559 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
13560 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
13561 * m4/mbswidth.m4: New file, from GNU coreutils.
13562
13563 * doc/bison.texinfo (Grammar Outline): Document // comments.
13564 (Symbols): Document that trigraphs have no special meaning in Bison,
13565 nor is backslash-newline allowed.
13566 (Actions): Document that trigraphs have no special meaning.
13567
13568 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
13569 no longer used.
13570
135712002-11-02 Paul Eggert <eggert@twinsun.com>
13572
13573 * src/reader.c: Don't include quote.h; not needed.
13574 (get_merge_function): Reword warning to be consistent with
13575 type clash diagnostic in grammar_current_rule_check.
13576
13577 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
13578 bug in trigraph handling.
13579
13580 * src/output.c (prepare_symbols): When printing token names,
13581 escape "[" as "@<:@" and likewise for "]".
13582
13583 * src/system.h (errno): Remove declaration, as we are now
13584 assuming C89 or better, and C89 guarantees errno.
13585
762b212b
PE
135862002-10-30 Paul Eggert <eggert@twinsun.com>
13587
13588 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
13589 Check for close failures.
13590 * src/files.h (xfclose): Return void, not int, since it always
13591 returned zero.
13592 * src/files.c (xfclose): Likewise. Report I/O error if ferror
13593 indicates one.
13594 * src/output.c (output_skeleton): Use xfclose rather than fclose
13595 and ferror. xfclose now checks ferror.
13596
13597 * data/glr.c (YYLEFTMOST_STATE): Remove.
13598 (yyreportTree): Use a stack-based leftmost state. This avoids
13599 our continuing battles with bogus warnings about initializers.
13600
56100c60
AD
136012002-10-30 Akim Demaille <akim@epita.fr>
13602
13603 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
13604 #if.
13605
51b4a04c
PH
136062002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13607
13608 * tests/glr-regr1.at: New test for reported regressions.
13609 * tests/testsuite.at: Add glr-regr1.at test.
13610 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 13611
bf1ebda2
PE
136122002-10-24 Paul Eggert <eggert@twinsun.com>
13613
5c16c6b1
PE
13614 Version 1.75a.
13615
bf1ebda2
PE
13616 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
13617 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
13618 we use malloc. Don't assume 'A' through 'Z' are contiguous.
13619 Don't assume strdup exists; POSIX says its an XSI extension.
13620 Check for buffer overflow on input.
13621
b526ee61
AD
136222002-10-24 Akim Demaille <akim@epita.fr>
13623
13624 * src/output.c (output_skeleton): Don't disable M4sugar comments
13625 too soon: it results in comments being expanded.
13626 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
13627 first output.
13628
f1886bb2
AD
136292002-10-24 Akim Demaille <akim@epita.fr>
13630
13631 * data/yacc.c (m4_int_type): New.
13632 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
13633 char' as only yacc.c wants K&R portability.
13634 * data/glr.c (yysigned_char): Remove.
13635 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
13636 Reported by Quoc Peyrot.
13637
c5576256
PE
136382002-10-23 Paul Eggert <eggert@twinsun.com>
13639
13640 * src/main.c (main): With --trace=time, report times even if a
13641 non-fatal error occurs. Formerly, the times were reported in some
13642 such cases but not in others.
13643 * src/reader.c (reader): Just return if a complaint has been issued,
13644 instead of exiting, so that 'main' can report times.
13645
27b0ffea
AD
136462002-10-22 Akim Demaille <akim@epita.fr>
13647
13648 * src/system.h: Include sys/types.
13649 Reported by Bert Deknuydt.
13650
223a7883
PE
136512002-10-23 Paul Eggert <eggert@twinsun.com>
13652
13653 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
13654 Suggested by Art Haas.
13655
136562002-10-22 Paul Eggert <eggert@twinsun.com>
13657
13658 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
13659 decl; not needed any more.
13660 * src/main.c (main): Use return to exit, undoing yesterday's change.
13661 The last OS that we could find where this wouldn't work is
13662 SunOS 3.5, and that's too old to worry about now.
13663
13664 * data/glr.c (struct yyltype): Define members even when not
13665 doing locations. This is more consistent with yacc.c, and it
13666 works around the following bug reports:
161a71f3
PE
13667 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
13668 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 13669
223a7883
PE
13670 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
13671 @acronym consistently. Standardize on "Yacc" instead of "YACC",
13672 "Algol" instead of "ALGOL". Give a bit more history about BNF.
13673
8b76775a
AD
136742002-10-22 Akim Demaille <akim@epita.fr>
13675
13676 * data/README: New.
13677
6db10d14
PE
136782002-10-21 Paul Eggert <eggert@twinsun.com>
13679
13680 Be consistent about 'bool'; the old code used an enum in one
13681 module and an int in another, and this violates the C standard.
13682 * m4/stdbool.m4: New file, from coreutils 4.5.3.
13683 * configure.ac (AC_HEADER_STDBOOL): Add.
13684 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
13685 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
13686 * src/symtab.c (hash_compare_symbol_t): Likewise.
13687 * src/system.h (bool, false, true): Use a definition consistent
13688 with ../lib/hash.c. All uses changed.
13689
13690 * src/complain.c (warning_issued): Renamed from warn_message_count,
13691 so that we needn't worry about integer overflow (!).
13692 Now of type bool. All uses changed.
13693 (complaint_issued): Renamed from complain_message_count; likewise.
13694
13695 * src/main.c (main): Use exit to exit with failure.
27b0ffea 13696
6db10d14
PE
13697 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
13698 rather than 1 and 0.
13699 * src/main.c (main): Likewise.
13700 * src/getargs.c (getargs): Likewise.
13701 * src/reader.c (reader): Likewise.
13702
13703 * src/getarg.c (getargs): Remove duplicate code for
13704 "Try `bison --help'".
13705
13706 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
13707 What was that "2" for?
13708
13709 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
13710 * src/getargs.c (usage): Likewise.
13711
13712 * src/getargs.c (getargs): When there are too few operands, report
13713 the last one. When there are too many, report the first extra
13714 one. This is how diffutils does it.
13715
92a060fd
PE
137162002-10-20 Paul Eggert <eggert@twinsun.com>
13717
13718 Remove K&R vestiges.
13719 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
13720 * src/complain.c (VA_START): Remove. Assume prototypes.
13721 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
13722 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
13723 fatal): Assume prototypes.
13724 * src/complain.h: Assume prototypes.
13725 * src/system.h (PARAMS): Remove.
13726 Include <limits.h> unconditionally, since it's guaranteeed even
13727 for a freestanding C89 compiler.
13728 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
13729 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 13730
e7cb57c0
AD
137312002-10-20 Akim Demaille <akim@epita.fr>
13732
13733 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
13734 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
13735 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
13736 (yyresolveStates, yyresolveAction, yyresolveStack)
13737 (yyprocessOneStack): Use them.
13738 (yy_reduce_print): New.
13739 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
13740
0245f82d
AD
137412002-10-20 Akim Demaille <akim@epita.fr>
13742
13743 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
13744 arguments and output `void'.
13745 (b4_c_function): Rename as...
13746 (b4_c_function_def): this.
13747 (b4_c_function_decl, b4_c_ansi_function_def)
13748 (b4_c_ansi_function_decl): New.
13749 Change the interpretation of the arguments: before `int, foo', now
13750 `int foo, foo'.
13751 * data/yacc.c (yyparse): Prototype and define thanks to these.
13752 Adjust b4_c_function_def uses.
13753 * data/glr.c (yyparse): Likewise, but ANSI only.
13754
39912f52
AD
137552002-10-20 Akim Demaille <akim@epita.fr>
13756
13757 * src/output.c (prepare): Move the definition of `tokens_number',
13758 `nterms_number', `undef_token_number', `user_token_number_max'
13759 to...
13760 (prepare_tokens): Here.
13761 (prepare_tokens): Rename as...
13762 (prepare_symbols): this.
13763 (prepare): Move the definition of `rules_number' to...
13764 (prepare_rules): here.
13765 (prepare): Move the definition of `last', `final_state_number',
13766 `states_number' to...
13767 (prepare_states): here.
13768 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
13769
20c1e2ad
AD
137702002-10-20 Akim Demaille <akim@epita.fr>
13771
13772 * src/tables.h, src/tables.c, src/output.c: Comment changes.
13773
21964f43
AD
137742002-10-20 Akim Demaille <akim@epita.fr>
13775
13776 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
13777 * data/c.m4: here.
13778
66d30cd4
AD
137792002-10-20 Akim Demaille <akim@epita.fr>
13780
13781 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
13782 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
13783 `pair'.
13784 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
13785 `name' to...
13786 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
13787 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
13788 These.
13789
95f2c9fe
PE
137902002-10-19 Paul Eggert <eggert@twinsun.com>
13791
13792 Do not create a temporary file, as that involves security and
13793 cleanup headaches. Instead, use a pair of pipes.
13794 Derived from a suggestion by Florian Krohm.
13795 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
13796 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
13797 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
13798 (BISON_PREREQ_SUBPIPE): Add.
13799 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
13800 Add subpipe.h, subpipe.c.
13801 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
13802 * po/POTFILES.in: Add lib/subpipe.c.
13803 * src/output.c: Include "subpipe.h".
13804 (m4_invoke): Remove decl.
13805 (scan_skel): New decl.
13806 (output_skeleton): Use pipe rather than temporary file for m4 input.
13807 Check that m4sugar.m4 is readable, to avoid deadlock.
13808 Check for pipe I/O error.
13809 * src/scan-skel.l (readpipe): Remove decl.
13810 (scan_skel): New function, to be used in place of m4_invoke.
13811 Read from stream rather than file.
66d30cd4 13812
95f2c9fe
PE
13813 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
13814 float, as this generates a warning on Solaris 8 + GCC 3.2 with
13815 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
13816 this generates a more-accurate value anyway.
13817
13818 * lib/timevar.c (timervar_accumulate): Rename locals to
13819 avoid confusion with similarly-named more-global.
13820 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
13821
13822 * src/output.c (prepare): Use xstrdup to convert char const *
13823 to char *, to avoid GCC warning.
13824
c19988b7
AD
138252002-10-19 Akim Demaille <akim@epita.fr>
13826
13827 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
13828 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
13829 Use them to have `calc.y' ready for %pure-parser.
13830 * data/yacc.c (YYLEX): Pass a yylex return type to
13831 b4_c_function_call.
13832
ae7453f2
AD
138332002-10-19 Akim Demaille <akim@epita.fr>
13834
13835 Prototype support of %lex-param and %parse-param.
13836
13837 * src/parse-gram.y: Add the definition of the %lex-param and
13838 %parse-param tokens, plus their rules.
13839 Drop the `_' version of %glr-parser.
13840 Add the "," token.
13841 * src/scan-gram.l (INITIAL): Scan them.
13842 * src/muscle_tab.c: Comment changes.
13843 (muscle_insert, muscle_find): Rename `pair' as `probe'.
13844 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
13845 (muscle_entry_s): The `value' member is no longer const.
13846 Adjust all dependencies.
13847 * src/muscle_tab.c (muscle_init): Adjust: use
13848 MUSCLE_INSERT_STRING.
13849 Initialize the obstack earlier.
13850 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
13851 (muscle_pair_list_grow): New.
13852 * data/c.m4 (b4_c_function_call, b4_c_args): New.
13853 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
13854 * tests/calc.at: Use %locations, not --locations.
13855 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
13856
0e575721
AD
138572002-10-19 Akim Demaille <akim@epita.fr>
13858
13859 * src/getargs.c (usage): Take status as argument and exit
13860 accordingly.
13861 Report the traditional `Try ... --help' message when status != 0.
13862 (usage, version): Don't take a FILE * as arg, it is pointless.
13863 (getargs): When there is an incorrect number of arguments, make it
13864 an error, and report it GNUlically thanks to `usage ()'.
13865
724ce7f5
PE
138662002-10-18 Paul Eggert <eggert@twinsun.com>
13867
3a781eb2
PE
13868 * data/glr.c (yyreportParseError): Don't assume that sprintf
13869 yields the length of the printed string, as this is not true
13870 on SunOS 4.1.4. Reported by Peter Klein.
13871
724ce7f5
PE
13872 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
13873 * tests/conflicts.at (%nonassoc and eof): Likewise.
13874 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
13875
473d0a75
AD
138762002-10-17 Akim Demaille <akim@epita.fr>
13877
13878 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
13879 * src/getargs.c (trace_types, trace_args): Adjust.
13880 * src/reader.c (grammar_current_rule_prec_set)
13881 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
13882 Standardize error messages.
13883 And s/@prec/%prec/!
13884 (reader): Use trace_flag to enable scanner/parser debugging,
13885 instead of an adhoc scheme.
13886 * src/scan-gram.l: Remove trailing debugging code.
13887
e76d2469
PE
138882002-10-16 Paul Eggert <eggert@twinsun.com>
13889
93e2236a
PE
13890 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
13891 MUSCLE_TAB_H.
13892
e76d2469
PE
13893 * NEWS: Officially drop support for building Bison with K&R C,
13894 since it didn't work anyway and it's not worth worrying about.
13895 * Makefile.maint (wget_files): Remove ansi2knr.c.
13896 (ansi2knr.c-url_prefix): Remove.
13897 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
13898 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
13899 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
13900
5bd1c419
PE
139012002-10-15 Paul Eggert <eggert@twinsun.com>
13902
13903 Stop using the "enum_" trick for K&R-style function definitions;
13904 it confused me, and I was the author! Instead, assume that people
13905 who want to use K&R C compilers (when using these modules in GCC,
13906 perhaps?) will run ansi2knr.
13907
13908 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
13909 All uses of "enum_" changed to "enum ".
13910 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
13911 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 13912
5bd1c419
PE
13913 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
13914 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
13915 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
13916 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
13917 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
13918 abitset_not, abitset_ones, abitset_or, abitset_or_and,
13919 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
13920 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
13921 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
13922 Use function prototypes; this removes the need for declaring
13923 static functions simply to provide their prototypes.
13924 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
13925 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
13926 bitset_count_, bitset_create, bitset_dump, bitset_first,
13927 bitset_free, bitset_init, bitset_last, bitset_next,
13928 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
13929 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
13930 bitset_print, bitset_release_memory, bitset_toggle_,
13931 bitset_type_choose, bitset_type_get, bitset_type_name_get,
13932 debug_bitset): Likewise.
13933 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
13934 * lib/bitset_stats.c (bitset_log_histogram_print,
13935 bitset_percent_histogram_print, bitset_stats_and,
13936 bitset_stats_and_cmp, bitset_stats_and_or,
13937 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
13938 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
13939 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
13940 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
13941 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
13942 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
13943 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
13944 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
13945 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
13946 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
13947 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
13948 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
13949 bitset_stats_zero): Likewise.
13950 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
13951 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
13952 bitsetv_dump, debug_bitsetv): Likewise.
13953 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
13954 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
13955 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
13956 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
13957 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
13958 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
13959 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
13960 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
13961 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
13962 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
13963 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
13964 Likewise.
13965 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
13966 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
13967 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
13968 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
13969 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
13970 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
13971 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
13972 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
13973 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
13974 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
13975 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 13976
ae26e1f0
AD
139772002-10-14 Akim Demaille <akim@epita.fr>
13978
13979 Version 1.75.
13980
d43baf71
AD
139812002-10-14 Akim Demaille <akim@epita.fr>
13982
13983 * tests/Makefile.am (maintainer-check-posix): New.
13984
7ebc83e3
AD
139852002-10-14 Akim Demaille <akim@epita.fr>
13986
13987 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
13988 member.
13989
05846dae
AD
139902002-10-14 Akim Demaille <akim@epita.fr>
13991
13992 * src/tables.c (table_ninf_remap): base -> tab.
13993 Reported by Matt Rosing.
13994
1318e37d
PE
139952002-10-14 Paul Eggert <eggert@twinsun.com>
13996
447fbb17
PE
13997 * tests/action.at, tests/calc.at, tests/conflicts.at,
13998 tests/cxx-type.at, tests/headers.at, tests/input.at,
13999 tests/regression.at, tests/synclines.at, tests/torture.at:
14000 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
14001 so that the tests still work even if POSIXLY_CORRECT is set.
14002 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 14003
1318e37d
PE
14004 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
14005 for portability to K&R hosts. Fix typo: signed char is guaranteed
14006 only to 127, not to 128.
14007 * data/glr.c (yysigned_char): New type.
14008 * data/yacc.c (yysigned_char): Likewise.
14009 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
14010
cc0f0794
PE
140112002-10-13 Paul Eggert <eggert@twinsun.com>
14012
5038f418
PE
14013 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
14014 true due to limited range of data type" warning from GCC.
14015
cc0f0794
PE
14016 * data/c.m4 (b4_token_defines): Protect against double-inclusion
14017 by wrapping enum yytokentype's definition inside #ifndef
14018 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
14019
6fed0802
AD
140202002-10-13 Akim Demaille <akim@epita.fr>
14021
14022 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
14023 Un yy- yyrhs to avoid the name clash with the global YYRHS.
14024
32f0598d
AD
140252002-10-13 Akim Demaille <akim@epita.fr>
14026
14027 * Makefile.maint: Update from Autoconf 2.54.
14028 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
14029
7ea9a33f
AD
140302002-10-13 Akim Demaille <akim@epita.fr>
14031
14032 * src/print.c (print_state): Separate the list of solved conflicts
14033 from the other items.
14034 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
14035
ea99527d
AD
140362002-10-13 Akim Demaille <akim@epita.fr>
14037
14038 Let nondeterministic skeletons be usable with deterministic
14039 tables.
14040
14041 With the patch, GAWK compiled by GCC without -O2 passes its test
14042 suite using a GLR parser driven by LALR tables. It fails with -O2
14043 because `struct stat' gives two different answers on my machine:
14044 88 (definition of an auto var) and later 96 (memset on this var).
14045 Hence the stack is badly corrumpted. The headers inclusion is to
14046 blame: if I move the awk.h inclusion before GLR's system header
14047 inclusion, the two struct stat have the same size.
14048
14049 * src/tables.c (pack_table): Always create conflict_table.
14050 (token_actions): Always create conflict_list.
14051 * data/glr.c (YYFLAG): Remove, unused.
14052
f377f69f
AD
140532002-10-13 Akim Demaille <akim@epita.fr>
14054
14055 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
14056 (O0FLAGS): New.
14057 (VALGRIND, GXX): New.
14058 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
14059 * tests/bison.in: Run $PREBISON a pre-command.
14060 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
14061 (maintainer-check-g++): New.
14062 * Makefile.am (maintainer-check): New.
14063
2a1fe6ed
AD
140642002-10-13 Akim Demaille <akim@epita.fr>
14065
14066 * data/glr.c: Formatting changes.
14067 Tweak some trace messages to match yacc.c's.
14068
f50adbbd
AD
140692002-10-13 Akim Demaille <akim@epita.fr>
14070
14071 GLR parsers sometimes raise parse errors instead of performing the
14072 default reduction.
14073 Reported by Charles-Henry de Boysson.
14074
14075 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
ba0fe3c7 14076 check the length of the traces when %glr.
f50adbbd
AD
14077 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
14078 GLR's traces.
14079 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
14080 Test GLR parsers.
14081 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
14082 (yyltype): Remove the yy prefix from the member names.
14083 (yytable): Complete its comment.
14084 (yygetLRActions): Map error action number from YYTABLE from
14085 YYTABLE_NINF to 0.
14086 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
14087 (which was a bug: it should have been YYTABEL_NINF, and yet it was
14088 not satisfying as we could compare an YYACTION computed from
14089 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
14090 only value for error actions.
14091 (yyreportParseError): In verbose parse error messages, don't issue
14092 `error' in the list of expected tokens.
14093 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
14094 next action to perform to match glr.c's decoding.
14095 (yytable): Complete its comment.
14096
bcbad5b9
PE
140972002-10-13 Paul Eggert <eggert@twinsun.com>
14098
14099 Fix problem reported by Henrik Grubbstroem in
161a71f3 14100 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
14101 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
14102 because the Bison parser reads the second action before reducing
14103 the first one.
14104 * src/scan-gram.l (rule_length): New static var.
14105 Use it to keep track of the rule length in the scanner, since
14106 we can't expect the parser to be in lock-step sync with the scanner.
14107 (handle_action_dollar, handle_action_at): Use this var.
14108 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 14109
14904b89
PE
141102002-10-12 Paul Eggert <eggert@twinsun.com>
14111
1fe611e5
PE
14112 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
14113 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
14114 Include <sys/time.h> when checking for clock_t and struct tms.
14115 Use same include order as source.
14116 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
161a71f3 14117 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 14118
1fe611e5
PE
14119 * lib/timevar.c: Update copyright date and clarify comments.
14120 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 14121
1fe611e5
PE
14122 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
14123 GCC version as of today, then merge Bison's changes.
14124 Change "GCC" to "Bison" in copyright notice. timevar.def's
14125 author is Akim, so change that too.
14126
98194095
PE
14127 * src/reader.c (grammar_current_rule_check):
14128 Don't worry about the default action if $$ is untyped.
14129 Prevents bogus warnings reported by Jim Gifford in
161a71f3 14130 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 14131
14904b89
PE
14132 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
14133 * data/glr.c, data/lalr1.cc, data/yacc.c:
14134 Output token definitions before the first part of user declarations.
14135 Fixes compatibility problem reported by Jim Gifford for kbd in
161a71f3 14136 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 14137
ff6dca18
PE
141382002-10-11 Paul Eggert <eggert@twinsun.com>
14139
14140 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
14141 (yyparse): here. This undoes some of the 2002-07-25 change.
14142 Compatibility problem reported by Ralf S. Engelschall with
14143 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
14144
eb714592
AD
141452002-10-11 Akim Demaille <akim@epita.fr>
14146
14147 * tests/regression.at Characters Escapes): New.
14148 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
14149 characters.
14150 Reported by Jan Nieuwenhuizen.
14151
b7195100
AD
141522002-10-11 Akim Demaille <akim@epita.fr>
14153
14154 * po/id.po: New.
14155
f28a0f2d
PE
141562002-10-10 Paul Eggert <eggert@twinsun.com>
14157
14158 Portability fixes for bitsets; this also avoids several GCC
14159 warnings.
14160
14161 * lib/abitset.c: Include <stddef.h>, for offsetof.
14162 * lib/lbitset.c: Likewise.
14163
14164 * lib/abitset.c (abitset_bytes): Return a size that is aligned
14165 properly for vectors of objects. Do not assume that adding a
14166 header size to a multiple of a word size yields a value that is
14167 properly aligned for the whole union.
14168 * lib/bitsetv.c (bitsetv_alloc): Likewise.
14169
14170 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
14171 unique names for structures.
14172 * lib/ebitset.c (ebitset_bytes): Likewise.
14173 * lib/lbitset.c (lbitset_bytes): Likewise.
14174
14175 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
14176 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
14177 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
14178 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
14179 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
14180 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
14181 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
14182 to improve the type-checking that GCC can do.
14183 * lib/bitset.c (bitset_op4_cmp): Likewise.
14184 * lib/bitset_stats.c (bitset_stats_count,
14185 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
14186 bitset_stats_copy, bitset_stats_disjoint_p,
14187 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
14188 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
14189 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
14190 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
14191 bitset_stats_and_or_cmp, bitset_stats_andn_or,
14192 bitset_stats_andn_or_cmp, bitset_stats_or_and,
14193 bitset_stats_or_and_cmp): Likewise.
14194 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
14195 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
14196 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
14197 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
14198
14199 * lib/abitset.h: Include bitset.h, not bbitset.h.
14200 * lib/ebitset.h: Likewise.
14201 * lib/lbitset.h: Likewise.
14202
14203 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
14204 All instances of parameters of type enum bitset_opts are now of
14205 type enum_bitset_opts, to conform to the C Standard, and similarly
14206 for enum_bitset_type.
14207 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
14208 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
14209
14210 Do not use "struct bitset_struct" to mean different things in
14211 different modules. Not only is this confusing, it violates
14212 the C Standard, which requires that structure types in different
14213 modules must be compatible if one is to be passed to the other.
14214 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
14215 All instances of "struct bitset_struct *" replaced with "bitset".
14216 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
14217 (union bitset_union, struct abitset_struct, struct ebitset_struct,
14218 struct lbitset_struct, struct bitset_stats_struct): New types.
14219 All uses of struct bitset_struct changed to union bitset_union,
14220 etc.
ba0fe3c7 14221 * lib/abitset.c (struct abitset_struct, abitset,
f28a0f2d
PE
14222 struct bitset_struct): Remove.
14223 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
14224 struct bitset_struct): Remove.
14225 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
14226 bitset_struct): Remove.
14227 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
14228 Likewise.
14229
14230 Do not call a function of type T using a call that assumes the
14231 function is of a different type U. Standard C requires that a
14232 function must be called with a type that is compatible with its
14233 definition.
14234 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
14235 New decls.
14236 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
14237 New functions.
14238 * lib/ebitset.c (PFV): Remove.
14239 * lib/lbitset.c (PFV): Likewise.
14240 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
14241 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
14242 decls.
14243 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
14244 (ebitset_vtable): Use them.
14245 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
14246 lbitset_xor): New functions.
14247 (lbitset_vtable): Use them.
14248
14249 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
14250 Declare.
14251
14252 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
14253 GCC warning.
14254 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
14255 Use offsetof, for simplicity.
14256
6fbe4984
PE
142572002-10-06 Paul Eggert <eggert@twinsun.com>
14258
14259 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
14260 the same width as int. This reapplies a hunk of the 2002-08-12 patch
161a71f3 14261 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
14262 which was inadvertently undone by the 2002-09-30 patch.
14263 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
14264 the same width as int.
14265
420f93c8
PE
142662002-10-04 Paul Eggert <eggert@twinsun.com>
14267
14268 Version 1.50.
14269
14270 * configure.ac (AC_INIT), NEWS: Increment version number.
14271
14272 * doc/bison.texinfo: Minor spelling, grammar, and white space
14273 fixes.
14274 (Symbols): Mention that any negative value returned from yylex
14275 signifies end-of-input. Warn about negative chars. Mention
14276 the portable Standard C character set.
14277
14278 The GNU coding standard says CFLAGS and YFLAGS are reserved
14279 for the installer to set.
14280 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
14281 * src/Makefile.am (AM_CFLAGS): Likewise.
14282 (AM_YFLAGS): Renamed from YFLAGS.
14283
14284 Fix some MAX and MIN problems.
14285 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
14286 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
14287 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
14288 * src/reader.c (reader): Use it.
14289
14290 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
14291 POSIX 1003.1-2001 has removed fgrep.
14292
142932002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
14294
14295 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
14296 interpreted as signed.
14297 * lib/ebitset.c (ebitset_list): Fix bug.
14298
ff68026d
PE
142992002-10-01 Paul Eggert <eggert@twinsun.com>
14300
14301 More fixes for 64-bit hosts and large bitsets.
14302
14303 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
14304 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
14305 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
14306 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
14307 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
14308 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
14309 bitset_count_): Likewise.
14310 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
14311 bitset_first, bitset_last): Likewise.
14312 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
14313 bitset_stats_list_reverse, bitset_stats_size,
14314 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
14315 Likewise.
14316 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
14317 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
14318 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
14319 bitsetv_reflexive_transitive_closure): Likewise.
14320 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
14321 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
14322 Likewise.
14323 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
14324 Likewise.
420f93c8 14325
ff68026d
PE
14326 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
14327 Use size_t, not unsigned int, to count bytes.
14328 * lib/abitset.h (abitset_bytes): Likewise.
14329 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
14330 Likewise.
14331 * lib/bitset.h (bitset_bytes): Likewise.
14332 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
14333 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
14334 * lib/bitsetv.c (bitsetv_alloc): Likewise.
14335 * lib/ebitset.c (ebitset_bytes): Likewise.
14336 * lib/ebitset.h (ebitset_bytes): Likewise.
14337 * lib/lbitset.c (lbitset_bytes): Likewise.
14338 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 14339
ff68026d
PE
14340 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
14341 abitset_subset_p, abitset_disjoint_p, abitset_and,
14342 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
14343 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
14344 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
14345 abitset_or_and, abitset_or_and_cmp):
14346 Use bitset_windex instead of unsigned int.
14347 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
14348 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
14349 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
14350 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
14351 Likewise.
14352 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 14353
ff68026d
PE
14354 * lib/bitset.c (bitset_print):
14355 Use proper printf formats for widths of integer types.
14356 * lib/bitset_stats.c (bitset_percent_histogram_print,
14357 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
14358 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
14359 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
14360 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 14361
ff68026d
PE
14362 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
14363 BITSET_SIZE_MAX): New macros.
14364 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
14365 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
14366 to BITSET_WINDEX_MAX.
14367
14368 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
14369 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
14370 since we now return the bitset_bindex type (not int).
14371
14372 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
14373 when computing sizes.
14374 * lib/ebitset.c (ebitset_elts_grow): Likewise.
14375
14376 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
14377 and avoid cast to unsigned.
14378
6aa452a6
AD
143792002-09-30 Akim Demaille <akim@epita.fr>
14380
14381 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
14382 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
14383 Updates from Michael Hayes.
14384
927f7817
AD
143852002-09-30 Art Haas <ahaas@neosoft.com>
14386
14387 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
14388 invocations.
14389 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
14390 defined.
14391
9738f41e
AD
143922002-09-27 Akim Demaille <akim@epita.fr>
14393
14394 Version 1.49c.
14395
a5c75d7f
AD
143962002-09-27 Akim Demaille <akim@epita.fr>
14397
14398 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
14399 (Because of AC_LIBSOURCE).
14400
8280e179
AD
144012002-09-27 Akim Demaille <akim@epita.fr>
14402
14403 Playing with Autoscan.
14404
14405 * configure.ac: Remove the old LIBOBJ tweaks.
14406 (AC_REPLACE_FUNCS): Add strrchr and strtol.
14407 * lib/strrchr.c: New.
14408 * lib/strtol.c: New, from the Coreutils 4.5.1.
14409
ae64af35
AD
144102002-09-27 Akim Demaille <akim@epita.fr>
14411
14412 Playing with Autoscan.
14413
14414 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
14415 * lib/Makefile.am (libbison_a_SOURCES): No longer include
14416 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
14417 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
14418 Coreutils 4.5.1.
14419
d1a1114f
AD
144202002-09-24 Akim Demaille <akim@epita.fr>
14421
14422 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
14423 (Frequently Asked Questions, Parser Stack Overflow): New.
14424
b906441c
AD
144252002-09-13 Akim Demaille <akim@epita.fr>
14426
14427 Playing with autoscan.
14428
14429 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
14430 * src/files.c (skeleton_find): Remove, unused.
14431 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
14432 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
14433
bd701811
AD
144342002-09-13 Akim Demaille <akim@epita.fr>
14435
14436 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
14437 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
14438
e0a13e7b
AD
144392002-09-13 Akim Demaille <akim@epita.fr>
14440
14441 * configure.ac: Require 2.54.
14442 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
14443 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
14444 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
14445 Remove, provided by Autoconf macros.
14446
c97011bf
AD
144472002-09-12 Akim Demaille <akim@epita.fr>
14448
14449 * m4/prereq.m4: Update, from Coreutils 4.5.1.
14450
d862b1be
AD
144512002-09-12 Akim Demaille <akim@epita.fr>
14452
14453 * m4/prereq.m4: Update, from Fileutils 4.1.5.
14454 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
14455 Reported by Martin Mokrejs.
14456
3d38c03a
AD
144572002-09-10 Akim Demaille <akim@epita.fr>
14458
14459 * src/parse-gram.y: Associate a human readable string to each
14460 token type.
14461 * tests/regression.at (Invalid inputs): Adjust.
14462
b6347355
AD
144632002-09-10 Gary V. Vaughan <gary@gnu.org>
14464
14465 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
14466 with an Autoconf-2.5x style configure.ac.
14467
09ba4ab2
PE
144682002-09-06 Paul Eggert <eggert@twinsun.com>
14469
14470 * doc/bison.texinfo (Conditions): Make explicit that the GPL
14471 exception applies only to yacc.c. This is a modification of a
14472 patch originally suggested by Akim Demaille.
14473
21846f69
AD
144742002-09-06 Akim Demaille <akim@epita.fr>
14475
09ba4ab2
PE
14476 * data/c.m4 (b4_copyright): Move the GPL exception comment from
14477 here to...
14478 * data/yacc.c: here.
14479
21846f69
AD
14480 * data/lalr1.cc (struct yyltype): Don't define it, since we use
14481 LocationType.
14482 (b4_ltype): Default to yy::Location from location.hh.
14483
c0ad8bf3
AD
144842002-09-04 Jim Meyering <jim@meyering.net>
14485
14486 * data/yacc.c: Guard the declaration of yytoknum also with
14487 `#ifdef YYPRINT', so it is declared only when used.
14488
3a93251e
AD
144892002-09-04 Akim Demaille <akim@epita.fr>
14490
14491 * configure.in: Rename as...
14492 * configure.ac: this.
14493 Bump to 1.49c.
14494
427c0dda
AD
144952002-09-04 Akim Demaille <akim@epita.fr>
14496
14497 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
14498 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
14499 translate maintainer only messages.
14500
6a254321
PE
145012002-08-12 Paul Eggert <eggert@twinsun.com>
14502
645e30d1
PE
14503 Version 1.49b.
14504
6a254321
PE
14505 * Makefile.am (SUBDIRS): Remove intl.
14506 (DISTCLEANFILES): Remove.
14507 * NEWS: Mention that GNU M4 is now required. Clarify what is
14508 meant by "larger grammars". Mention the pt_BR translation.
14509 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
14510 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
14511 Bump version from 0.11.2 to 0.11.5.
14512 (BISON_PREREQ_STAGE): Remove.
14513 (AM_GNU_GETTEXT): Use external gettext.
14514 (AC_OUTPUT): Remove intl/Makefile.
14515
14516 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
14517
14518 * data/glr.c: Include string.h, for strlen.
14519 (yyreportParseError): Use size_t for yysize.
14520 (yy_yypstack): No longer nested inside yypstates, as nested
14521 functions are not portable. Do not assume size_t is the
14522 same width as int.
14523 (yypstates): Do not assume that ptrdiff_t is the same width
14524 as int, and similarly for yyposn and YYINDEX.
14525
14526 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
14527
14528 * lib/Makefile.am (INCLUDES): Do not include from the intl
14529 directory, which has been removed.
14530 * src/Makefile.am (INCLUDES): Likewise.
14531
14532 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
14533 (bitsets_sources, additional_bitsets_sources, timevars_sources):
14534 New vars.
14535
14536 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
14537 * tests/Makefile.am (EXTRA_DIST): Likewise.
14538
14539 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
14540 Do not assume that bitset_windex is the same width as unsigned.
14541
14542 * lib/abitset.c (abitset_unused_clear): Do not assume that
14543 bitset_word is the same width as int.
14544 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
14545 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
14546 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
14547 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
14548 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
14549
14550 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
14551 portability to one's complement hosts!).
14552 * lib/ebitset.c (ebitset_op1): Likewise.
14553 * lib/lbitset.c (lbitset_op1): Likewise.
14554
14555 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
14556 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
14557 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
14558 Sync with fileutils.
14559 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
14560 lib/gettext.h: Sync with diffutils.
14561
14562 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
14563 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
14564
14565 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
14566 PROTOTYPES to check for prototypes, and "defined __STDC__" to
14567 check for void *.
14568
14569 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
14570 size_t; the old version tried to do this but casted improperly.
14571 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
14572 (bitset_test): Now returns int, not unsigned long.
14573
14574 * lib/bitset_stats.c: Include "gettext.h".
14575 (_): New macro.
14576 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
14577 name locals "index", as it generates unnecessary warnings on some
14578 hosts that have an "index" function.
14579
14580 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
14581 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
14582 they need translation.
14583 * src/LR0.c (state_list_append, new_itemsets, get_state,
14584 append_states, generate_states): Likewise.
14585 * src/assoc.c (assoc_to_string): Likewise.
14586 * src/closure.c (print_closure, set_firsts, closure): Likewise.
14587 * src/gram.c (grammar_dump): Likewise.
14588 * src/injections.c (injections_compute): Likewise.
14589 * src/lalr.c (lookaheads_print): Likewise.
14590 * src/relation.c (relation_transpose): Likewise.
14591 * src/scan-gram.l: Likewise.
14592 * src/tables.c (table_grow, pack_vector): Likewise.
14593
14594 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
14595 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
14596 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
14597 * m4/mbstate_t.m4: Sync with fileutils.
14598 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
14599
14600 * po/LINGUAS: Add pt_BR.
14601 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
14602 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
14603 lib/timevar.c.
14604 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
14605 manual recommends.
14606 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
14607
14608 * src/complain.c (strerror_r): Remove decl; not needed.
14609 (strerror): Use same pattern as ../lib/error.c.
14610
14611 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
14612
14613 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
14614
14615 * src/main.c (main): Cast result of bindtextdomain and textdomain
14616 to void, to avoid a GCC warning when --disable-nls is in effect.
14617
14618 * src/scan-gram.l: Use strings rather than escapes when possible,
14619 to minimize the number of warnings from xgettext.
14620 (handle_action_dollar, handle_action_at): Don't use isdigit,
14621 as it mishandles negative chars and it may not work as expected
14622 outside the C locale.
14623
14624 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
14625 this is a GCC extension and is not portable to other compilers.
14626
14627 * src/system.h (alloca): Use same pattern as ../lib/error.c.
14628 Do not include <ctype.h>; no longer needed.
14629 Do not include <malloc.h>; no longer needed (and generates
14630 warnings on OpenBSD 3.0).
14631
14632 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
14633 it's not portable.
14634
14635 * tests/regression.at: Do not use 'cc -c input.c -o input';
14636 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
14637
14638 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
14639 exit status as failure, not just exit status 1. Sun C exits
14640 with status 2 sometimes.
14641
14642 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
14643 Use it for the two large tests.
14644
c8f002c7
AD
146452002-08-02 Akim Demaille <akim@epita.fr>
14646
14647 * src/conflicts.c (conflicts_output): Don't output rules never
14648 reduced here, since anyway that computation doesn't work.
14649 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
14650 (rule_useless_p, rule_never_reduced_p): New.
14651 (grammar_rules_partial_print): Use a filter instead of a range.
14652 Display the title only if needed.
14653 (grammar_rules_print): Adjust.
14654 (grammar_rules_never_reduced_report): New.
14655 * src/tables.c (action_row): Move the computation of rules never
14656 reduced to...
14657 (token_actions): here.
14658 * src/main.c (main): Make the parser before making the report, so
14659 that rules never reduced are computed.
14660 Call grammar_rules_never_reduced_report.
14661 * src/print.c (print_results): Report rules never reduced.
14662 * tests/conflicts.at, tests/reduce.at: Adjust.
14663
cd08e51e
AD
146642002-08-01 Akim Demaille <akim@epita.fr>
14665
14666 Instead of attaching lookaheads and duplicating the rules being
14667 reduced by a state, attach the lookaheads to the reductions.
14668
14669 * src/state.h (state_t): Remove the `lookaheads',
14670 `lookaheads_rule' member.
14671 (reductions_t): Add a `lookaheads' member.
14672 Use a regular array for the `rules'.
14673 * src/state.c (reductions_new): Initialize the lookaheads member
14674 to 0.
14675 (state_rule_lookaheads_print): Adjust.
14676 * src/state.h, src/state.c (state_reductions_find): New.
14677 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
14678 (count_rr_conflicts): Adjust.
14679 * src/lalr.c (LArule): Remove.
14680 (add_lookback_edge): Adjust.
14681 (state_lookaheads_count): New.
14682 (states_lookaheads_initialize): Merge into...
14683 (initialize_LA): this.
14684 (lalr_free): Adjust.
14685 * src/main.c (main): Don't free nullable and derives too early: it
14686 is used by --verbose.
14687 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
14688
bb0027a9
AD
146892002-08-01 Akim Demaille <akim@epita.fr>
14690
14691 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
14692 `rule_number_t**'.
14693 (set_derives, free_derives): Rename as...
14694 (derives_compute, derives_free): this.
14695 Adjust all dependencies.
14696 * src/nullable.c (set_nullable, free_nullable): Rename as...
14697 (nullable_compute, nullable_free): these.
14698 (rule_list_t): Store rule_t *, not rule_number_t.
14699 * src/state.c (state_rule_lookaheads_print): Directly compare rule
14700 pointers, instead of their numbers.
14701 * src/main.c (main): Call nullable_free, and derives_free earlier,
14702 as they were lo longer used.
14703
3325ddc4
AD
147042002-08-01 Akim Demaille <akim@epita.fr>
14705
14706 * lib/timevar.c (get_time): Include children time.
14707 * src/lalr.h (LA, LArule): Don't export them: used with the
14708 state_t.
14709 * src/lalr.c (LA, LArule): Static.
14710 * src/lalr.h, src/lalr.c (lalr_free): New.
14711 * src/main.c (main): Call it.
14712 * src/tables.c (pack_vector): Check whether loc is >= to the
14713 table_size, not >.
14714 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
14715 (tables_generate): do it, since that's also it which allocates
14716 them.
14717 Don't free LA and LArule, main does.
14718
c6f1a33c
AD
147192002-07-31 Akim Demaille <akim@epita.fr>
14720
14721 Separate parser tables computation and output.
14722
14723 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
14724 (conflict_list, conflict_list_cnt, table, check, table_ninf)
14725 (yydefgoto, yydefact, high): Move to...
14726 * src/tables.h, src/tables.c: here.
14727 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
14728 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
14729 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
14730 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
14731 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
14732 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
14733 (action_row, save_row, token_actions, save_column, default_goto)
14734 (goto_actions, sort_actions, matching_state, pack_vector)
14735 (table_ninf_remap, pack_table, prepare_actions): Move to...
14736 * src/tables.c: here.
14737 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
14738 * src/output.c (token_actions, output_base, output_conflicts)
14739 (output_check): Merge into...
14740 (prepare_actions): this.
14741 (actions_output): Rename as...
14742 (user_actions_output): this.
14743 * src/main.c (main): Call tables_generate and tables_free.
14744
1509d42f
AD
147452002-07-31 Akim Demaille <akim@epita.fr>
14746
14747 Steal GCC's --time-report support.
14748
14749 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
14750 stolen/adjusted from GCC.
14751 * m4/stage.m4: Remove time related checks.
14752 * m4/timevar.m4: New.
14753 * configure.in: Adjust.
14754 * src/system.h: Adjust to using timevar.h.
14755 * src/getargs.h, src/getargs.c: Support trace_time for
14756 --trace=time.
14757 * src/main.c (stage): Remove.
14758 (main): Replace `stage' invocations with timevar calls.
14759 * src/output.c: Insert pertinent timevar calls.
14760
273a74fa
AD
147612002-07-31 Akim Demaille <akim@epita.fr>
14762
14763 Let --trace have arguments.
14764
14765 * src/getargs.h (enum trace_e): New.
14766 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
14767 (long_options, short_options): --trace/-T takes an optional
14768 argument.
14769 Change all the uses of trace_flag to reflect the new flags.
14770 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
14771
14772 Strengthen `stage' portability.
14773
14774 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
14775 * configure.in: Use it.
14776 Don't check for malloc.h and sys/times.h.
14777 * src/system.h: Include them when appropriate.
14778 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
14779 times and struct tms are available.
14780
217598da
AD
147812002-07-30 Akim Demaille <akim@epita.fr>
14782
14783 In verbose parse error message, don't report `error' as an
14784 expected token.
14785 * tests/actions.at (Printers and Destructors): Adjust.
14786 * tests/calc.at (Calculator $1): Adjust.
14787 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
14788 error message, do not report the parser accepts the error token in
14789 that state.
14790
52489d44
AD
147912002-07-30 Akim Demaille <akim@epita.fr>
14792
14793 Normalize conflict related messages.
14794
14795 * src/complain.h, src/complain.c (warn, complain): New.
14796 * src/conflicts.c (conflicts_print): Use them.
14797 (conflict_report_yacc): New, extracted from...
14798 (conflicts_print): here.
14799 * tests/conflicts.at, tests/existing.at: Adjust.
14800
e8832397
AD
148012002-07-30 Akim Demaille <akim@epita.fr>
14802
14803 Report rules which are never reduced by the parser: those hidden
14804 by conflicts.
14805
14806 * src/LR0.c (save_reductions): Don't make the final state too
14807 different: save its reduction (accept) instead of having a state
14808 without any action (no shift or goto, no reduce).
14809 Note: the final state is now a ``regular'' state, i.e., the
14810 parsers now contain `reduce 0' as default reduction.
14811 Nevertheless, since they decide to `accept' when yystate =
14812 final_state, they still will not reduce rule 0.
14813 * src/print.c (print_actions, print_reduction): Adjust.
14814 * src/output.c (action_row): Track reduced rules.
14815 (token_actions): Report rules never reduced.
14816 * tests/conflicts.at, tests/regression.at: Adjust.
14817
caf23d24
AD
148182002-07-30 Akim Demaille <akim@epita.fr>
14819
14820 `stage' was accidently included in a previous patch.
14821 Initiate its autoconfiscation.
14822
14823 * configure.in: Look for malloc.h and sys/times.h.
14824 * src/main.c (stage): Adjust.
14825 Report only when trace_flag.
14826
640748ee
AD
148272002-07-29 Akim Demaille <akim@epita.fr>
14828
14829 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
14830 state_number_t.
14831 (errs_t): symbol_t*, not symbol_number_t.
14832 (reductions_t): rule_t*, not rule_number_t.
14833 (FOR_EACH_SHIFT): New.
14834 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
14835 * src/print.c, src/print_graph.c: Adjust.
14836
88bce5a2
AD
148372002-07-29 Akim Demaille <akim@epita.fr>
14838
14839 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
14840
14841 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
14842 (endtoken, accept): these.
14843 * src/reader.c (reader): Set endtoken's default tag to "$end".
14844 Set undeftoken's tag to "$undefined" instead of "$undefined.".
14845 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
14846 Adjust.
14847
1bfb97db
AD
148482002-07-29 Akim Demaille <akim@epita.fr>
14849
14850 * src/reduce.c (reduce_grammar): When the language is empty,
14851 complain about the start symbol, not the axiom.
14852 Use its location.
14853 * tests/reduce.at (Empty Language): New.
14854
fc5734fe
AD
148552002-07-26 Akim Demaille <akim@epita.fr>
14856
14857 * src/reader.h, src/reader.c (gram_error): ... can't get
14858 yycontrol without making too strong assumptions on the parser
14859 itself.
14860 * src/output.c (prepare_tokens): Use the real 0th value of
14861 token_translations instead of `0'.
14862 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
14863 visible here.
14864 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
14865 for the time being: %locations ought to provide it to yyerror.
14866
3650b4b8
AD
148672002-07-25 Akim Demaille <akim@epita.fr>
14868
14869 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
14870 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
14871 * tests/regression.at (Web2c Actions): Adjust.
14872
4b3d3a8e
AD
148732002-07-25 Akim Demaille <akim@epita.fr>
14874
14875 Stop storing rules from 1 to nrules + 1.
14876
14877 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
14878 * src/nullable.c, src/output.c, src/print.c, src/reader.c
14879 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
14880 Iterate from 0 to nrules.
14881 Use rule_number_as_item_number and item_number_as_rule_number.
14882 Adjust to `derive' now containing possibly 0.
14883 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
14884 Handle the `- 1' part in rule numbers from/to item numbers.
14885 * src/conflicts.c (log_resolution): Fix the message which reversed
14886 shift and reduce.
14887 * src/output.c (action_row): Initialize default_rule to -1.
14888 (token_actions): Adjust.
14889 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
14890 expected output.
14891 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
14892
4a2a22f4
AD
148932002-07-25 Akim Demaille <akim@epita.fr>
14894
14895 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
14896 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
14897 (b4_c_knr_arg_decl): New.
14898 * data/yacc.c: Use it to define yysymprint, yydestruct, and
14899 yyreport_parse_error.
14900
b8df3223
AD
149012002-07-25 Akim Demaille <akim@epita.fr>
14902
14903 * data/yacc.c (yyreport_parse_error): New, extracted from...
14904 (yyparse): here.
14905 (yydestruct, yysymprint): Move above yyparse.
14906 Be K&R compliant.
14907
a762e609
AD
149082002-07-25 Akim Demaille <akim@epita.fr>
14909
14910 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
14911 replace...
14912 (b4_sint_type, b4_uint_type): these.
14913 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
14914 * tests/regression.at (Web2c Actions): Adjust.
14915
12b0043a
AD
149162002-07-25 Akim Demaille <akim@epita.fr>
14917
14918 * src/gram.h (TIEM_NUMBER_MAX): New.
14919 (item_number_of_rule_number, rule_number_of_item_number): Rename
14920 as...
14921 (rule_number_as_item_number, item_number_as_rule_number): these.
14922 Adjust dependencies.
14923 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
14924 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
14925 (symbol_number_to_vector_number): New.
14926 (order): Of vector_number_t* type.
14927 (base_t, BASE_MAX, BASE_MIN): New.
14928 (froms, tos, width, pos, check): Of base_t type.
14929 (action_number_t, ACTION_MIN, ACTION_MAX): New.
14930 (actrow): Of action_number_t type.
14931 (conflrow): Of unsigned int type.
14932 (table_ninf, base_ninf): New.
14933 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
14934 (muscle_insert_int_table, muscle_insert_base_table)
14935 (muscle_insert_rule_number_table): New.
14936 (prepare_tokens): Output `toknum' as int_table.
14937 (action_row): Returns a rule_number_t.
14938 Use ACTION_MIN, not SHRT_MIN.
14939 (token_actions): yydefact is rule_number_t*.
14940 (table_ninf_remap): New.
14941 (pack_table): Use it for `base' and `table'.
14942 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
14943 replaced with...
14944 (YYPACT_NINF, YYTABLE_NINF): these.
14945 (yypact, yytable): Compute their types instead of hard-coded
14946 `short'.
14947 * tests/regression.at (Web2c Actions): Adjust.
14948
5dde258a
AD
149492002-07-19 Akim Demaille <akim@epita.fr>
14950
14951 * src/scan-gram.l (id): Can start with an underscore.
14952
a945ec39
AD
149532002-07-16 Akim Demaille <akim@epita.fr>
14954
14955 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
14956 Adjust all former `associativity' dependencies.
14957 * src/symtab.c (symbol_new): Default associativity is `undef', not
14958 `right'.
14959 (symbol_check_alias_consistence): Adjust.
14960
fae437e8
AD
149612002-07-09 Akim Demaille <akim@epita.fr>
14962
14963 * doc/bison.texinfo: Properly set the ``header'' part.
14964 Use @dircategory ``GNU programming tools'' as per Texinfo's
14965 documentation.
14966 Use @copying.
14967
1a715ef2
AD
149682002-07-09 Akim Demaille <akim@epita.fr>
14969
14970 * lib/quotearg.h: Protect against multiple inclusions.
14971 * src/location.h (location_t): Add a `file' member.
14972 (LOCATION_RESET, LOCATION_PRINT): Adjust.
14973 * src/complain.c (warn_at, complain_at, fatal_at): Drop
14974 `error_one_per_line' support.
14975
a5d50994
AD
149762002-07-09 Akim Demaille <akim@epita.fr>
14977
14978 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
14979 * src/reader.c (lineno): Remove.
14980 Adjust all dependencies.
14981 (get_merge_function): Take a location and use complain_at.
14982 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
14983 * tests/regression.at (Invalid inputs, Mixing %token styles):
14984 Adjust.
14985
b275314e
AD
149862002-07-09 Akim Demaille <akim@epita.fr>
14987
14988 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
14989 recovery rule, and forbid extensions when --yacc.
14990 (gram_error): Use complain_at.
14991 * src/reader.c (reader): Exit if there were parse errors.
14992
865b9df1
AD
149932002-07-09 Akim Demaille <akim@epita.fr>
14994
14995 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
14996 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
14997 Reported by R Blake <blakers@mac.com>.
14998
c76e14da
AD
149992002-07-09 Akim Demaille <akim@epita.fr>
15000
15001 * data/yacc.c: Output the copyright notive in the header.
15002
7db2ed2d
AD
150032002-07-03 Akim Demaille <akim@epita.fr>
15004
15005 * src/output.c (froms, tos): Are state_number_t.
15006 (save_column): sp, sp1, and sp2 are state_number_t.
15007 (prepare): Rename `final' as `final_state_number', `nnts' as
15008 `nterms_number', `nrules' as `rules_number', `nstates' as
15009 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
15010 unused.
15011 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
15012 * data/lalr1.cc (nsym_): Remove, unused.
15013
e68e0410
AD
150142002-07-03 Akim Demaille <akim@epita.fr>
15015
15016 * src/lalr.h, src/lalr.c (goto_number_t): New.
15017 * src/lalr.c (goto_list_t): New.
15018 Propagate them.
15019 * src/nullable.c (rule_list_t): New.
15020 Propagate.
15021 * src/types.h: Remove.
15022
e1a4f3a4
AD
150232002-07-03 Akim Demaille <akim@epita.fr>
15024
15025 * src/closure.c (print_fderives): Use rule_rhs_print.
15026 * src/derives.c (print_derives): Use rule_rhs_print.
15027 (rule_list_t): New, replaces `shorts'.
15028 (set_derives): Add comments.
15029 * tests/sets.at (Nullable, Firsts): Adjust.
15030
536545f3
AD
150312002-07-03 Akim Demaille <akim@epita.fr>
15032
15033 * src/output.c (prepare_actions): Free `tally' and `width'.
15034 (prepare_actions): Allocate and free `order'.
15035 * src/symtab.c (symbols_free): Free `symbols'.
15036 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
15037 * src/output.c (m4_invoke): Move to...
15038 * src/scan-skel.l: here.
15039 (<<EOF>>): Close yyout, and free its name.
15040
8b752b00
AD
150412002-07-03 Akim Demaille <akim@epita.fr>
15042
15043 Fix some memory leaks, and fix a bug: state 0 was examined twice.
15044
15045 * src/LR0.c (new_state): Merge into...
15046 (state_list_append): this.
15047 (new_states): Merge into...
15048 (generate_states): here.
15049 (set_states): Don't ensure a proper `errs' state member here, do it...
15050 * src/conflicts.c (conflicts_solve): here.
15051 * src/state.h, src/state.c: Comment changes.
15052 (state_t): Rename member `shifts' as `transitions'.
15053 Adjust all dependencies.
15054 (errs_new): For consistency, also take the values as argument.
15055 (errs_dup): Remove.
15056 (state_errs_set): New.
15057 (state_reductions_set, state_transitions_set): Assert that no
15058 previous value was assigned.
15059 (state_free): New.
15060 (states_free): Use it.
15061 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
15062 temporary storage: use `errs' and `nerrs' as elsewhere.
15063 (set_conflicts): Allocate and free this `errs'.
15064
613f5e1a
AD
150652002-07-02 Akim Demaille <akim@epita.fr>
15066
15067 * lib/libiberty.h: New.
15068 * lib: Update the bitset implementation from upstream.
15069 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
15070 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
15071 * src/main.c: Adjust bitset stats calls.
15072
26e0cadc
PE
150732002-07-01 Paul Eggert <eggert@twinsun.com>
15074
15075 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
15076 char, so that negative chars don't collide with $.
15077
1154cced
AD
150782002-06-30 Akim Demaille <akim@epita.fr>
15079
15080 Have the GLR tests be `warning' checked, and fix the warnings.
15081
15082 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
15083 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
15084 (yyremoveDeletes): `yyi' and `yyj' are size_t.
15085 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
15086 (yyaddDeferredAction): static.
15087 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
15088 (yyreportParseError): yyprefix is const.
15089 yytokenp is used only when verbose.
15090 (yy__GNUC__): Replace with __GNUC__.
15091 (yypdumpstack): yyi is size_t.
15092 (yypreference): Un-yy local variables and arguments, to avoid
15093 clashes with `yyr1'. Anyway, we are not in the user name space.
15094 (yytname_size): be an int, as is compared with ints.
15095 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
15096 Use them.
15097 * tests/cxx-gram.at: Use quotation to protect $1.
15098 Use AT_COMPILE to enable warnings hunts.
15099 Prototype yylex and yyerror.
15100 `Use' argc.
15101 Include `string.h', not `strings.h'.
15102 Produce and prototype stmtMerge only when used.
15103 yylex takes a location.
15104
97650f4e
AD
151052002-06-30 Akim Demaille <akim@epita.fr>
15106
15107 We spend a lot of time in quotearg, in particular when --verbose.
15108
15109 * src/symtab.c (symbol_get): Store a quoted version of the key.
15110 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
15111 Adjust all callers.
15112
d2576365
AD
151132002-06-30 Akim Demaille <akim@epita.fr>
15114
15115 * src/state.h (reductions_t): Rename member `nreds' as num.
15116 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
15117 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
15118
ccaf65bc
AD
151192002-06-30 Akim Demaille <akim@epita.fr>
15120
15121 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
15122 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
15123 (shifts_to): Rename as...
15124 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
15125 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
15126 (TRANSITION_IS_DISABLED, transitions_to): these.
15127
87675353
AD
151282002-06-30 Akim Demaille <akim@epita.fr>
15129
15130 * src/print.c (print_shifts, print_gotos): Merge into...
15131 (print_transitions): this.
15132 (print_transitions, print_errs, print_reductions): Align the
15133 lookaheads columns.
15134 (print_core, print_transitions, print_errs, print_state,
15135 print_grammar): Output empty lines separator before, not after.
15136 (state_default_rule_compute): Rename as...
15137 (state_default_rule): this.
15138 * tests/conflicts.at (Defaulted Conflicted Reduction),
15139 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
15140 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
15141
ce4ccb4b
AD
151422002-06-30 Akim Demaille <akim@epita.fr>
15143
15144 Display items as we display rules.
15145
15146 * src/gram.h, src/gram.c (rule_lhs_print): New.
15147 * src/gram.c (grammar_rules_partial_print): Use it.
15148 * src/print.c (print_core): Likewise.
15149 * tests/conflicts.at (Defaulted Conflicted Reduction),
15150 (Unresolved SR Conflicts): Adjust.
15151 (Unresolved SR Conflicts): Adjust and rename as...
15152 (Resolved SR Conflicts): this, as was meant.
15153 * tests/regression.at (Web2c Report): Adjust.
15154
bc933ef1
AD
151552002-06-30 Akim Demaille <akim@epita.fr>
15156
15157 * src/print.c (state_default_rule_compute): New, extracted from...
15158 (print_reductions): here.
15159 Pessimize, but clarify the code.
15160 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
15161
53d4308d
AD
151622002-06-30 Akim Demaille <akim@epita.fr>
15163
15164 * src/output.c (action_row): Let default_rule be always a rule
15165 number.
15166
574fb2d5
AD
151672002-06-30 Akim Demaille <akim@epita.fr>
15168
15169 * src/closure.c (print_firsts, print_fderives, closure):
15170 Use BITSET_EXECUTE.
15171 * src/lalr.c (lookaheads_print): Likewise.
15172 * src/state.c (state_rule_lookaheads_print): Likewise.
15173 * src/print_graph.c (print_core): Likewise.
15174 * src/print.c (print_reductions): Likewise.
15175 * src/output.c (action_row): Likewise.
15176 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
15177
05811fd7
AD
151782002-06-30 Akim Demaille <akim@epita.fr>
15179
15180 * src/print_graph.c: Use report_flag.
15181
0e4d5753
AD
151822002-06-30 Akim Demaille <akim@epita.fr>
15183
15184 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
15185 to...
15186 * src/relation.h, src/relation.c (traverse, relation_digraph)
15187 (relation_print, relation_transpose): New.
15188
24c7d800
AD
151892002-06-30 Akim Demaille <akim@epita.fr>
15190
15191 * src/state.h, src/state.c (shifts_to): New.
15192 * src/lalr.c (build_relations): Use it.
15193
9222837b
AD
151942002-06-30 Akim Demaille <akim@epita.fr>
15195
15196 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
15197 (item_number_of_rule_number, rule_number_of_item_number): New.
15198 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
15199 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
15200 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
15201 Propagate their use.
15202 Much remains to be done, in particular wrt `shorts' from types.h.
15203
260008e5
AD
152042002-06-30 Akim Demaille <akim@epita.fr>
15205
15206 * src/symtab.c (symbol_new): Initialize the `printer' member.
15207
8a731ca8
AD
152082002-06-30 Akim Demaille <akim@epita.fr>
15209
15210 * src/LR0.c (save_reductions): Remove, replaced by...
15211 * src/state.h, src/state.c (state_reductions_set): New.
15212 (reductions, errs): Rename as...
15213 (reductions_t, errs_t): these.
15214 Adjust all dependencies.
15215
32e1e0a4
AD
152162002-06-30 Akim Demaille <akim@epita.fr>
15217
15218 * src/LR0.c (state_list_t, state_list_append): New.
15219 (first_state, last_state): Now symbol_list_t.
15220 (this_state): Remove.
15221 (new_itemsets, append_states, save_reductions): Take a state_t as
15222 argument.
15223 (set_states, generate_states): Adjust.
15224 (save_shifts): Remove, replaced by...
15225 * src/state.h, src/state.c (state_shifts_set): New.
15226 (shifts): Rename as...
15227 (shifts_t): this.
15228 Adjust all dependencies.
15229 * src/state.h (state_t): Remove the `next' member.
15230
e5fb6710
AD
152312002-06-30 Akim Demaille <akim@epita.fr>
15232
15233 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
15234 escaped in slot 0.
15235
c7ca99d4
AD
152362002-06-30 Akim Demaille <akim@epita.fr>
15237
15238 Use hash.h for the state hash table.
15239
15240 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
15241 (allocate_storage): Use state_hash_new.
15242 (free_storage): Use state_hash_free.
15243 (new_state, get_state): Adjust.
15244 * src/lalr.h, src/lalr.c (states): Move to...
15245 * src/states.h (state_t): Remove the `link' member, no longer
15246 used.
15247 * src/states.h, src/states.c: here.
15248 (state_hash_new, state_hash_free, state_hash_lookup)
15249 (state_hash_insert, states_free): New.
15250 * src/states.c (state_table, state_compare, state_hash): New.
15251 * src/output.c (output_actions): Do not free states now, since we
15252 still need to know the final_state number in `prepare', called
15253 afterwards. Do it...
15254 * src/main.c (main): here: call states_free after `output'.
15255
df0e7316
AD
152562002-06-30 Akim Demaille <akim@epita.fr>
15257
15258 * src/state.h, src/state.c (state_new): New, extracted from...
15259 * src/LR0.c (new_state): here.
15260 * src/state.h (STATE_ALLOC): Move to...
15261 * src/state.c: here.
15262 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
15263 * src/state.h, src/state.c: here.
15264
39f41916
AD
152652002-06-30 Akim Demaille <akim@epita.fr>
15266
15267 * src/reader.c (gensym): Rename as...
15268 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
15269 (getsym): Rename as...
15270 (symbol_get): this.
15271
d57650a5
AD
152722002-06-30 Akim Demaille <akim@epita.fr>
15273
15274 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
15275 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
15276 * src/output.c, src/print.c, src/print_graph.c: Propagate.
15277 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
15278
5a08f1ce
AD
152792002-06-30 Akim Demaille <akim@epita.fr>
15280
15281 Make the test suite pass with warnings checked.
15282
15283 * tests/actions.at (Printers and Destructors): Improve.
15284 Avoid unsigned vs. signed issues.
15285 * tests/calc.at: Don't exercise the scanner here, do it...
15286 * tests/input.at (Torturing the Scanner): here.
15287
720623af
PH
152882002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15289
88e7e941 15290 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
15291 reorganize first lines parallel to yacc.c.
15292
fb8135fa
AD
152932002-06-28 Akim Demaille <akim@epita.fr>
15294
15295 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
15296 (b4_token_enum, b4_token_defines): New, factored from...
15297 * data/lalr1.cc, data/yacc.c, glr.c: here.
15298
41442480
AD
152992002-06-28 Akim Demaille <akim@epita.fr>
15300
15301 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
15302 unused variables.
15303 * src/output.c (merger_output): static.
15304
e0e5bf84
AD
153052002-06-28 Akim Demaille <akim@epita.fr>
15306
ba0fe3c7 15307 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
e0e5bf84
AD
15308 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
15309 pacify GCC.
15310 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 15311
676385e2
PH
153122002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15313
15314 Accumulated changelog for new GLR parsing features.
15315
6a254321 15316 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
15317 conflicts_total_count.
15318 * src/conflicts.h: Ditto.
15319 * src/output.c (token_actions): Use the new name.
15320 (output_conflicts): Change conflp => conflict_list_heads, and
15321 confl => conflict_list for better readability.
15322 * data/glr.c: Use the new names.
15323 * NEWS: Add self to GLR announcement.
e0e5bf84 15324
676385e2
PH
15325 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
15326
15327 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
15328 Akim Demaille.
15329
15330 * data/bison.glr: Change name to glr.c
15331 * data/glr.c: Renamed from bison.glr.
15332 * data/Makefile.am: Add glr.c
e0e5bf84
AD
15333
15334 * src/getargs.c:
15335
676385e2 15336 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
ba0fe3c7 15337 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 15338
676385e2
PH
15339 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15340
15341 * data/bison.glr: Be sure to restore the
15342 current #line when returning to the skeleton contents after having
15343 exposed the input file's #line.
15344
15345 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15346
15347 * data/bison.glr: Bring up to date with changes to bison.simple.
15348
15349 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15350
15351 * data/bison.glr: Correct definitions that use b4_prefix.
15352 Various reformatting.
15353 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
15354 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
15355 yytokenp argument; now part of stack.
15356 (yychar): Define to behave as documented.
15357 (yyclearin): Ditto.
e0e5bf84 15358
676385e2
PH
15359 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15360
15361 * src/reader.h: Add declaration for free_merger_functions.
15362
15363 * src/reader.c (merge_functions): New variable.
15364 (get_merge_function): New function.
15365 (free_merger_functions): New function.
15366 (readgram): Check for %prec that is not followed by a symbol.
15367 Handle %dprec and %merge declarations.
15368 (packgram): Initialize dprec and merger fields in rules array.
15369
15370 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
15371 conflict_list_cnt, conflict_list_free): New variables.
15372 (table_grow): Also grow conflict_table.
e0e5bf84 15373 (prepare_rules): Output dprec and merger tables.
676385e2 15374 (conflict_row): New function.
e0e5bf84 15375 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
15376 default reduction in conflicted states for GLR parser so that there
15377 are spaces for the conflict lists.
15378 (save_row): Also save conflict information.
15379 (token_actions): Allocate conflict list.
15380 (merger_output): New function.
15381 (pack_vector): Pack conflict table, too.
15382 (output_conflicts): New function to output yyconflp and yyconfl.
15383 (output_check): Allocate conflict_tos.
15384 (output_actions): Output conflict tables, also.
15385 (output_skeleton): Output b4_mergers definition.
15386 (prepare): Output b4_max_rhs_length definition.
15387 Use 'bison.glr' as default skeleton for GLR parsers.
15388
15389 * src/gram.c (glr_parser): New flag.
15390 (grammar_free): Call free_merger_functions.
15391
15392 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
15393 all pairs of conflicting reductions, rather than just all tokens
15394 causing conflicts. Needed to size conflict tables.
e0e5bf84 15395 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
15396 interface.
15397 (conflicts_print): Ditto.
15398 (count_total_conflicts): New function.
15399
15400 * src/reader.h (merger_list): New type.
15401 (merge_functions): New variable.
15402
15403 * src/lex.h (tok_dprec, tok_merge): New token types.
15404
15405 * src/gram.h (rule_s): Add dprec and merger fields.
15406 (glr_parser): New flag.
15407
15408 * src/conflicts.h (count_total_conflicts): New function.
15409
15410 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
15411
15412 * doc/bison.texinfo (Generalized LR Parsing): New section.
15413 (GLR Parsers): New section.
15414 (Language and Grammar): Mention GLR parsing.
15415 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
15416 Correct typo ("tge" -> "the").
15417
15418 * data/bison.glr: New skeleton for GLR parsing.
15419
15420 * tests/cxx-gram.at: New tests for GLR parsing.
15421
15422 * tests/testsuite.at: Include cxx-gram.at.
15423
15424 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 15425
676385e2
PH
15426 * src/parse-gram.y:
15427
15428 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
15429
15430 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 15431
b5480d74 154322002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
15433
15434 * src/options.h, src/options.c: Remove.
15435 * src/getargs.c (short_options, long_options): New.
15436
60491a94
AD
154372002-06-27 Akim Demaille <akim@epita.fr>
15438
15439 * data/bison.simple, data/bison.c++: Rename as...
15440 * data/yacc.c, data/lalr1.cc: these.
15441 * doc/bison.texinfo (Environment Variables): Remove.
15442
9be0c25b
AD
154432002-06-25 Raja R Harinath <harinath@cs.umn.edu>
15444
15445 * src/getargs.c (report_argmatch): Initialize strtok().
15446
1ae72863
AD
154472002-06-20 Akim Demaille <akim@epita.fr>
15448
15449 * data/bison.simple (b4_symbol_actions): New, replaces...
15450 (b4_symbol_destructor, b4_symbol_printer): these.
15451 (yysymprint): Be sure to call YYPRINT only for tokens, and using
15452 user token numbers.
15453
87542d29
AD
154542002-06-20 Akim Demaille <akim@epita.fr>
15455
15456 * data/bison.simple (yydestructor): Rename as...
15457 (yydestruct): this.
15458
1a31ed21
AD
154592002-06-20 Akim Demaille <akim@epita.fr>
15460
15461 * src/symtab.h, src/symtab.c (symbol_type_set)
15462 (symbol_destructor_set, symbol_precedence_set): The location is
15463 the last argument.
15464 Adjust all callers.
15465
e776192e
AD
154662002-06-20 Akim Demaille <akim@epita.fr>
15467
15468 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
15469 internals.
15470 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
15471 Takes a location.
15472 * src/symtab.h, src/symtab.c (symbol_class_set)
15473 (symbol_user_token_number_set): Likewise.
15474 Adjust all callers.
15475 Promote complain_at.
15476 * tests/input.at (Type Clashes): Adjust.
15477
5c1180b3
AD
154782002-06-20 Akim Demaille <akim@epita.fr>
15479
15480 * data/bison.simple (YYLEX): Fix the declaration when
15481 %pure-parser.
15482
e3170060
AD
154832002-06-20 Akim Demaille <akim@epita.fr>
15484
15485 * data/bison.simple (yysymprint): Don't print the token number,
15486 just its name.
15487 * tests/actions.at (Destructors): Rename as...
15488 (Printers and Destructors): this.
15489 Also exercise %printer.
15490
253862fd
AD
154912002-06-20 Akim Demaille <akim@epita.fr>
15492
15493 * data/bison.simple (YYDSYMPRINT): New.
15494 Use it to remove many of the #if YYDEBUG/if (yydebug).
15495
366eea36
AD
154962002-06-20 Akim Demaille <akim@epita.fr>
15497
15498 * src/symtab.h, src/symtab.c (symbol_t): printer and
15499 printer_location are new members.
15500 (symbol_printer_set): New.
15501 * src/parse-gram.y (PERCENT_PRINTER): New token.
15502 Handle its associated rule.
15503 * src/scan-gram.l: Adjust.
15504 (handle_destructor_at, handle_destructor_dollar): Rename as...
15505 (handle_symbol_code_at, handle_symbol_code_dollar): these.
15506 * src/output.c (symbol_printers_output): New.
15507 (output_skeleton): Call it.
15508 * data/bison.simple (yysymprint): New. Cannot be named yyprint
15509 since there are already many grammar files with a user `yyprint'.
15510 Replace the calls to YYPRINT to calls to yysymprint.
15511 * tests/calc.at: Adjust.
15512 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
15513 taking advantage of parser very internal details (stack size!).
15514
4f25ebb0
AD
155152002-06-20 Akim Demaille <akim@epita.fr>
15516
15517 * src/scan-gram.l: Complete the scanner with the missing patterns
15518 to pacify Flex.
15519 Use `quote' and `symbol_tag_get' where appropriate.
15520
93b68a0e
AD
155212002-06-19 Akim Demaille <akim@epita.fr>
15522
15523 * tests/actions.at (Destructors): Augment to test locations.
15524 * data/bison.simple (yydestructor): Pass it the current location
15525 if locations are enabled.
15526 Prototype only when __STDC__ or C++.
15527 Change the argument names to move into the yy name space: there is
15528 user code here.
15529
58612f1d
AD
155302002-06-19 Akim Demaille <akim@epita.fr>
15531
74310291
AD
15532 * data/bison.simple (b4_pure_if): New.
15533 Use it instead of #ifdef YYPURE.
15534
155352002-06-19 Akim Demaille <akim@epita.fr>
15536
15537 * data/bison.simple (b4_location_if): New.
58612f1d
AD
15538 Use it instead of #ifdef YYLSP_NEEDED.
15539
f25bfb75
AD
155402002-06-19 Akim Demaille <akim@epita.fr>
15541
15542 Prepare @$ in %destructor, but currently don't bind it in the
15543 skeleton, as %location use is not cleaned up yet.
15544
15545 * src/scan-gram.l (handle_dollar, handle_destructor_at)
15546 (handle_action_at): New.
15547 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
15548 a braced_code_t and a location as additional arguments.
15549 (handle_destructor_dollar): Instead of requiring `b4_eval', just
15550 unquote one when outputting `b4_dollar_dollar'.
15551 Adjust callers.
15552 * data/bison.simple (b4_eval): Remove.
15553 (b4_symbol_destructor): Adjust.
15554 * tests/input.at (Invalid @n): Adjust.
15555
c732d2c6
AD
155562002-06-19 Zack Weinberg <zack@codesourcery.com>
15557
15558 * doc/bison.texinfo: Document ability to have multiple
15559 prologue sections.
15560
8c165d89
AD
155612002-06-18 Akim Demaille <akim@epita.fr>
15562
15563 * src/files.c (compute_base_names): When computing the output file
15564 names from the input file name, strip the directory part.
15565
ca98bf57
AD
155662002-06-18 Akim Demaille <akim@epita.fr>
15567
15568 * data/bison.simple.new: Comment changes.
15569 Reported by Andreas Schwab.
15570
0bfb02ff
AD
155712002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
15572
15573 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
15574 there are no `label `yyoverflowlab' defined but not used' warnings
15575 when yyoverflow is defined.
15576
24c0aad7
AD
155772002-06-18 Akim Demaille <akim@epita.fr>
15578
15579 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
15580 new member.
15581 (symbol_destructor_set): Adjust.
15582 * src/output.c (symbol_destructors_output): Output the destructor
15583 locations.
15584 Output the symbol name.
15585 * data/bison.simple (b4_symbol_destructor): Adjust.
15586
5719c109
AD
155872002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
15588 and Akim Demaille <akim@epita.fr>
15589
15590 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
15591 what's left on the stack when the error recovery hits EOF.
15592 * tests/actions.at (Destructors): Complete to exercise this case.
15593
9280d3ef
AD
155942002-06-17 Akim Demaille <akim@epita.fr>
15595
15596 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
15597 arguments is really empty, not only equal to `[]'.
15598 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
15599 member.
15600 (symbol_destructor_set): New.
15601 * src/output.c (symbol_destructors_output): New.
15602 * src/reader.h (brace_code_t, current_braced_code): New.
15603 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
15604 (handle_dollar): Rename as...
15605 (handle_action_dollar): this.
15606 (handle_destructor_dollar): New.
15607 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
15608 (grammar_declaration): Use it.
15609 * data/bison.simple (yystos): Is always defined.
15610 (yydestructor): New.
15611 * tests/actions.at (Destructors): New.
15612 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
15613
dafdc66f
AD
156142002-06-17 Akim Demaille <akim@epita.fr>
15615
15616 * src/symlist.h, src/symlist.c (symbol_list_length): New.
15617 * src/scan-gram.l (handle_dollar, handle_at): Compute the
15618 rule_length only when needed.
15619 * src/output.c (actions_output, token_definitions_output): Output
15620 the full M4 block.
15621 * src/symtab.c: Don't access directly to the symbol tag, use
15622 symbol_tag_get.
15623 * src/parse-gram.y: Use symbol_list_free.
15624
56c47203
AD
156252002-06-17 Akim Demaille <akim@epita.fr>
15626
15627 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
15628 (symbol_list_prepend, get_type_name): Move to...
15629 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
15630 (symbol_list_prepend, symbol_list_n_type_name_get): here.
15631 Adjust all callers.
15632 (symbol_list_free): New.
15633 * src/scan-gram.l (handle_dollar): Takes a location.
15634 * tests/input.at (Invalid $n): Adjust.
15635
1e0bab92
AD
156362002-06-17 Akim Demaille <akim@epita.fr>
15637
15638 * src/reader.h, src/reader.c (symbol_list_new): Export it.
15639 (symbol_list_prepend): New.
15640 * src/parse-gram.y (%union): `list' is a new member.
15641 (symbols.1): New, replaces...
15642 (terms_to_prec.1, nterms_to_type.1): these.
15643 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
15644 Take a location as additional argument.
15645 Adjust all callers.
15646
04e60654
AD
156472002-06-15 Akim Demaille <akim@epita.fr>
15648
15649 * src/parse-gram.y: Move %token in the declaration section so that
15650 we don't depend upon CVS Bison.
15651
10e5b8bd
AD
156522002-06-15 Akim Demaille <akim@epita.fr>
15653
15654 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
15655 * src/print.c (print_core): Use it.
15656
9801d40c
AD
156572002-06-15 Akim Demaille <akim@epita.fr>
15658
15659 * src/conflicts.c (log_resolution): Accept the rule involved in
15660 the sr conflicts instead of the lookahead number that points to
15661 that rule.
15662 (flush_reduce): Accept the current lookahead vector as argument,
15663 instead of the index in LA.
15664 (resolve_sr_conflict): Accept the current number of lookahead
15665 bitset to consider for the STATE, instead of the index in LA.
15666 (set_conflicts): Adjust.
15667 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
15668
c0263492
AD
156692002-06-15 Akim Demaille <akim@epita.fr>
15670
15671 * src/state.h (state_t): Replace the `lookaheadsp' member, a
15672 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
15673 Adjust all dependencies.
15674 * src/lalr.c (initialize_lookaheads): Split into...
15675 (states_lookaheads_count, states_lookaheads_initialize): these.
15676 (lalr): Adjust.
15677
9757c359
AD
156782002-06-15 Akim Demaille <akim@epita.fr>
15679
15680 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
15681 out of...
15682 (grammar_rules_print): here.
15683 * src/reduce.c (reduce_output): Use it.
15684 * tests/reduce.at (Useless Rules, Reduced Automaton)
15685 (Underivable Rules): Adjust.
15686
6b98e4b5
AD
156872002-06-15 Akim Demaille <akim@epita.fr>
15688
15689 Copy BYacc's nice way to report the grammar.
15690
15691 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
15692 New.
15693 Don't print the rules' location, it is confusing and useless.
15694 (rule_print): Use grammar_rhs_print.
15695 * src/print.c (print_grammar): Use grammar_rules_print.
15696
6b98e4b5
AD
156972002-06-15 Akim Demaille <akim@epita.fr>
15698
15699 Complete and rationalize `useless thing' warnings.
15700
15701 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
15702 (symbol_tag_print): New.
15703 Use them everywhere in place of accessing directly the tag member.
15704 * src/gram.h, src/gram.c (rule_print): New.
15705 Use it where a rule used to be printed `by hand'.
15706 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
15707 (reduce_grammar_tables): Report the useless rules.
15708 (reduce_print): Useless things are a warning, not an error.
15709 Report it as such.
15710 * tests/reduce.at (Useless Nonterminals, Useless Rules):
15711 (Reduced Automaton, Underivable Rules): Adjust.
15712 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
15713 * tests/conflicts.at (Unresolved SR Conflicts)
15714 (Solved SR Conflicts): Adjust.
15715
ee000ba4
AD
157162002-06-15 Akim Demaille <akim@epita.fr>
15717
15718 Let symbols have a location.
15719
15720 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
15721 (getsym): Adjust.
15722 Adjust all callers.
15723 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
15724 Use location_t, not int.
15725 * src/symtab.c (symbol_check_defined): Take advantage of the
15726 location.
15727 * tests/regression.at (Invalid inputs): Adjust.
15728
8efe435c
AD
157292002-06-15 Akim Demaille <akim@epita.fr>
15730
15731 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
15732 (input): Don't try to initialize yylloc here, do it in the
15733 scanner.
15734 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
15735 * src/gram.h (rule_t): Change line and action_line into location
15736 and action_location, of location_t type.
15737 Adjust all dependencies.
15738 * src/location.h, src/location.c (empty_location): New.
15739 * src/reader.h, src/reader.c (grammar_start_symbol_set)
15740 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
15741 (grammar_current_rule_symbol_append)
15742 (grammar_current_rule_action_append): Expect a location as argument.
15743 * src/reader.c (grammar_midrule_action): Adjust to attach an
15744 action's location as dummy symbol location.
15745 * src/symtab.h, src/symtab.c (startsymbol_location): New.
15746 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
15747 the line numbers.
15748
1921f1d7
AD
157492002-06-14 Akim Demaille <akim@epita.fr>
15750
15751 Grammar declarations may be found in the grammar section.
15752
15753 * src/parse-gram.y (rules_or_grammar_declaration): New.
15754 (declarations): Each declaration may end with a semicolon, not
15755 just...
15756 (grammar_declaration): `"%union"'.
15757 (grammar): Branch to rules_or_grammar_declaration.
15758
4515534c
AD
157592002-06-14 Akim Demaille <akim@epita.fr>
15760
15761 * src/main.c (main): Invoke scanner_free.
15762
f958596b
AD
157632002-06-14 Akim Demaille <akim@epita.fr>
15764
15765 * src/output.c (m4_invoke): Extracted from...
15766 (output_skeleton): here.
15767 Free tempfile.
15768
2c569025
AD
157692002-06-14 Akim Demaille <akim@epita.fr>
15770
15771 * src/parse-gram.y (directives, directive, gram)
15772 (grammar_directives, precedence_directives, precedence_directive):
15773 Rename as...
15774 (declarations, declaration, grammar, grammar_declaration)
15775 (precedence_declaration, precedence_declarator): these.
15776 (symbol_declaration): New.
15777
592e8d4d
AD
157782002-06-14 Akim Demaille <akim@epita.fr>
15779
15780 * src/files.c (action_obstack): Remove, unused.
15781 (output_obstack): Remove it, and all its dependencies, as it is no
15782 longer needed.
15783 * src/reader.c (epilogue_set): Build the epilogue in the
15784 muscle_obstack.
15785 * src/output.h, src/output.c (muscle_obstack): Move to...
15786 * src/muscle_tab.h, src/muscle_tab.h: here.
15787 (muscle_init): Initialize muscle_obstack.
15788 (muscle_free): New.
15789 * src/main.c (main): Call it.
15790
0c15323d
AD
157912002-06-14 Akim Demaille <akim@epita.fr>
15792
15793 * src/location.h: New, extracted from...
15794 * src/reader.h: here.
15795 * src/Makefile.am (noinst_HEADERS): Merge into
15796 (bison_SOURCES): this.
15797 Add location.h.
15798 * src/parse-gram.y: Use location_t instead of Bison's.
15799 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
15800 Use location_t instead of ints.
15801
e96c9728
AD
158022002-06-14 Akim Demaille <akim@epita.fr>
15803
15804 * data/bison.simple, data/bison.c++: Be sure to restore the
15805 current #line when returning to the skeleton contents after having
15806 exposed the input file's #line.
15807
75d1fe16
AD
158082002-06-12 Akim Demaille <akim@epita.fr>
15809
15810 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
15811 eager.
15812 * tests/actions.at (Exotic Dollars): New.
15813
6c35d22c
AD
158142002-06-12 Akim Demaille <akim@epita.fr>
15815
15816 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
15817 ['"/] too eagerly.
15818 * tests/input.at (Torturing the Scanner): New.
15819
1d6412ad
AD
158202002-06-11 Akim Demaille <akim@epita.fr>
15821
15822 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
15823 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
15824 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
15825 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
15826 * src/reader.c (reader): Use it.
15827
4cdb01db
AD
158282002-06-11 Akim Demaille <akim@epita.fr>
15829
15830 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
15831 Adjust all callers.
15832 (scanner_last_string_free): New.
15833
44995b2e
AD
158342002-06-11 Akim Demaille <akim@epita.fr>
15835
15836 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
15837 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
15838 (last_string, YY_OBS_FREE): New.
15839 Use them when returning an ID.
15840
e9955c83
AD
158412002-06-11 Akim Demaille <akim@epita.fr>
15842
15843 Have Bison grammars parsed by a Bison grammar.
15844
15845 * src/reader.c, src/reader.h (prologue_augment): New.
15846 * src/reader.c (copy_definition): Remove.
15847
15848 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
15849 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
15850 (grammar_current_rule_prec_set, grammar_current_rule_check)
15851 (grammar_current_rule_symbol_append)
15852 (grammar_current_rule_action_append): Export.
15853 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
15854 (symbol_list_action_append): Remove.
15855 Hook the routines from reader.
15856 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
15857 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
15858
15859 * src/reader.c (read_declarations): Remove, unused.
15860
15861 * src/parse-gram.y: Handle the epilogue.
15862 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
15863 (grammar_start_symbol_set): this.
15864 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
15865 * src/reader.c (readgram): Remove, unused.
15866 (reader): Adjust to insert eoftoken and axiom where appropriate.
15867
15868 * src/reader.c (copy_dollar): Replace with...
15869 * src/scan-gram.h (handle_dollar): this.
15870 * src/parse-gram.y: Remove `%thong'.
15871
15872 * src/reader.c (copy_at): Replace with...
15873 * src/scan-gram.h (handle_at): this.
15874
15875 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
15876 New.
15877
15878 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
15879 time being.
15880
15881 * src/reader.h, src/reader.c (grammar_rule_end): New.
15882
15883 * src/parse.y (current_type, current_class): New.
15884 Implement `%nterm', `%token' support.
15885 Merge `%term' into `%token'.
15886 (string_as_id): New.
15887 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
15888 type name.
15889
15890 * src/parse-gram.y: Be sure to handle properly the beginning of
15891 rules.
15892
15893 * src/parse-gram.y: Handle %type.
15894 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
15895
15896 * src/parse-gram.y: More directives support.
15897 * src/options.c: No longer handle source directives.
15898
15899 * src/parse-gram.y: Fix %output.
15900
15901 * src/parse-gram.y: Handle %union.
15902 Use the prologue locations.
15903 * src/reader.c (parse_union_decl): Remove.
15904
15905 * src/reader.h, src/reader.c (epilogue_set): New.
15906 * src/parse-gram.y: Use it.
15907
15908 * data/bison.simple, data/bison.c++: b4_stype is now either not
15909 defined, then default to int, or to the contents of %union,
15910 without `union' itself.
15911 Adjust.
15912 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
15913
15914 * src/output.c (actions_output): Don't output braces, as they are
15915 already handled by the scanner.
15916
15917 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
15918 characters to themselves.
15919
15920 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
15921 that the epilogue has a proper #line.
15922
15923 * src/parse-gram.y: Handle precedence/associativity.
15924
15925 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
15926 a terminal.
15927 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
15928 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
15929 at all to define terminals that cannot be emitted.
15930
15931 * src/scan-gram.l: Escape M4 characters.
15932
15933 * src/scan-gram.l: Working properly with escapes in user
15934 strings/characters.
15935
15936 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
15937 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
15938 grammar.
15939 Use more modest sizes, as for the time being the parser does not
15940 release memory, and therefore the process swallows a huge amount
15941 of memory.
15942
15943 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
15944 stricter %token grammar.
15945
15946 * src/symtab.h (associativity): Add `undef_assoc'.
15947 (symbol_precedence_set): Do nothing when passed an undef_assoc.
15948 * src/symtab.c (symbol_check_alias_consistence): Adjust.
15949
15950 * tests/regression.at (Invalid %directive): Remove, as it is now
15951 meaningless.
15952 (Invalid inputs): Adjust to the new error messages.
15953 (Token definitions): The new grammar doesn't allow too many
15954 eccentricities.
15955
15956 * src/lex.h, src/lex.c: Remove.
15957 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
15958 (copy_character, copy_string2, copy_string, copy_identifier)
15959 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
15960 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
15961 (parse_action): Remove.
15962 * po/POTFILES.in: Adjust.
15963
2e047461
AD
159642002-06-11 Akim Demaille <akim@epita.fr>
15965
cd05d13c 15966 * src/reader.c (parse_action): Don't store directly into the
2e047461
AD
15967 rule's action member: return the action as a string.
15968 Don't require `rule_length' as an argument: compute it.
15969 (grammar_current_rule_symbol_append)
15970 (grammar_current_rule_action_append): New, eved out from
15971 (readgram): here.
15972 Remove `action_flag', `rulelength', unused now.
15973
9af3fbce
AD
159742002-06-11 Akim Demaille <akim@epita.fr>
15975
15976 * src/reader.c (grammar_current_rule_prec_set).
15977 (grammar_current_rule_check): New, eved out from...
15978 (readgram): here.
15979 Remove `xaction', `first_rhs': useless.
15980 * tests/input.at (Type clashes): New.
15981 * tests/existing.at (GNU Cim Grammar): Adjust.
15982
1485e106
AD
159832002-06-11 Akim Demaille <akim@epita.fr>
15984
15985 * src/reader.c (grammar_midrule_action): New, Eved out from
15986 (readgram): here.
15987
da4160c3
AD
159882002-06-11 Akim Demaille <akim@epita.fr>
15989
15990 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
15991 New.
15992 (readgram): Use them as replacement of inlined code, crule and
15993 crule1.
15994
f6d0f937
AD
159952002-06-11 Akim Demaille <akim@epita.fr>
15996
15997 * src/reader.c (grammar_end, grammar_symbol_append): New.
15998 (readgram): Use them.
15999 Make the use of `p' as local as possible.
16000
69078d4b
AD
160012002-06-10 Akim Demaille <akim@epita.fr>
16002
16003 GCJ's parser requires the tokens to be defined before the prologue.
16004
16005 * data/bison.simple: Output the token definition before the user's
16006 prologue.
16007 * tests/regression.at (Braces parsing, Duplicate string)
16008 (Mixing %token styles): Check the output from bison.
16009 (Early token definitions): New.
16010
5e424082
AD
160112002-06-10 Akim Demaille <akim@epita.fr>
16012
16013 * src/symtab.c (symbol_user_token_number_set): Don't complain when
16014 assigning twice the same user number to a token, so that we can
16015 use it in...
16016 * src/lex.c (lex): here.
16017 Also use `symbol_class_set' instead of hand written code.
16018 * src/reader.c (parse_assoc_decl): Likewise.
16019
44536b35
AD
160202002-06-10 Akim Demaille <akim@epita.fr>
16021
16022 * src/symtab.c, src/symtab.c (symbol_class_set)
16023 (symbol_user_token_number_set): New.
16024 * src/reader.c (parse_token_decl): Use them.
16025 Use a switch instead of ifs.
16026 Use a single argument.
16027
8b9f2372
AD
160282002-06-10 Akim Demaille <akim@epita.fr>
16029
16030 Remove `%thong' support as it is undocumented, unused, duplicates
16031 `%token's job, and creates useless e-mail traffic with people who
16032 want to know what it is, why it is undocumented, unused, and
16033 duplicates `%token's job.
16034
16035 * src/reader.c (parse_thong_decl): Remove.
16036 * src/options.c (option_table): Remove "thong".
16037 * src/lex.h (tok_thong): Remove.
16038
3ae2b51f
AD
160392002-06-10 Akim Demaille <akim@epita.fr>
16040
16041 * src/symtab.c, src/symtab.c (symbol_type_set)
16042 (symbol_precedence_set): New.
16043 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
16044 (value_components_used): Remove, unused.
16045
2f1afb73
AD
160462002-06-09 Akim Demaille <akim@epita.fr>
16047
16048 Move symbols handling code out of the reader.
16049
16050 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
16051 (axiom): Move to...
16052 * src/symtab.h, src/symtab.c: here.
16053
16054 * src/gram.c (start_symbol): Remove: use startsymbol->number.
16055 * src/reader.c (startval): Rename as...
16056 * src/symtab.h, src/symtab.c (startsymbol): this.
16057 * src/reader.c: Adjust.
16058
16059 * src/reader.c (symbol_check_defined, symbol_make_alias)
16060 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
16061 (token_translations_init)
16062 Move to...
16063 * src/symtab.c: here.
16064 * src/reader.c (packsymbols): Move to...
16065 * src/symtab.h, src/symtab.c (symbols_pack): here.
16066 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
16067 argument.
16068
e9bca3ad
AD
160692002-06-03 Akim Demaille <akim@epita.fr>
16070
16071 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
16072 then statements.
16073
86eff183
AD
160742002-06-03 Akim Demaille <akim@epita.fr>
16075
16076 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
16077 structs with non literals.
16078 * src/scan-skel.l: never-interactive.
16079 * src/conflicts.c (enum conflict_resolution_e): No trailing
16080 comma.
16081 * src/getargs.c (usage): Split long literal strings.
16082 Reported by Hans Aberg.
16083
717be197
AD
160842002-05-28 Akim Demaille <akim@epita.fr>
16085
16086 * data/bison.c++: Use C++ ostreams.
16087 (cdebug_): New member.
16088
670ddffd
AD
160892002-05-28 Akim Demaille <akim@epita.fr>
16090
16091 * src/output.c (output_skeleton): Be sure to allocate enough room
16092 for `/' _and_ for `\0' in full_skeleton.
16093
769b430f
AD
160942002-05-28 Akim Demaille <akim@epita.fr>
16095
16096 * data/bison.c++: Catch up with bison.simple:
16097 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16098 and Paul Eggert <eggert@twinsun.com>: `error' handing.
16099 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
16100 and popping traces.
16101
7067cb36
PH
161022002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16103
16104 * src/output.c (output_skeleton): Put an explicit path in front of
16105 the skeleton file name, rather than relying on the -I directory,
16106 to partially alleviate effects of having a skeleton file lying around
16107 in the current directory.
769b430f 16108
4a713ec2
PH
161092002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16110
769b430f 16111 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
16112 obstack_printf should be obstack_fgrow1.
16113
b408954b
AD
161142002-05-26 Akim Demaille <akim@epita.fr>
16115
16116 * src/state.h (state_t): `solved_conflicts' is a new member.
16117 * src/LR0.c (new_state): Set it to 0.
16118 * src/conflicts.h, src/conflicts.c (print_conflicts)
16119 (free_conflicts, solve_conflicts): Rename as...
16120 (conflicts_print, conflicts_free, conflicts_solve): these.
16121 Adjust callers.
16122 * src/conflicts.c (enum conflict_resolution_e)
16123 (solved_conflicts_obstack): New, used by...
16124 (log_resolution): this.
16125 Adjust to attach the conflict resolution to each state.
16126 Complete the description with the precedence/associativity
16127 information.
16128 (resolve_sr_conflict): Adjust.
16129 * src/print.c (print_state): Output its solved_conflicts.
16130 * tests/conflicts.at (Unresolved SR Conflicts)
16131 (Solved SR Conflicts): Exercise --report=all.
16132
a49aecd5
AD
161332002-05-26 Akim Demaille <akim@epita.fr>
16134
16135 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
16136 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
16137 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
16138 (token_number_t, item_number_as_token_number)
16139 (token_number_as_item_number, muscle_insert_token_number_table):
16140 Rename as...
16141 (symbol_number_t, item_number_as_symbol_number)
16142 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
16143 these, since it is more appropriate.
16144
5504898e
AD
161452002-05-26 Akim Demaille <akim@epita.fr>
16146
16147 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
16148 `Error:' lines.
16149 * data/bison.simple (yystos) [YYDEBUG]: New.
16150 (yyparse) [YYDEBUG]: Display the symbols which are popped during
16151 error recovery.
16152 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
16153
ec3bc396
AD
161542002-05-25 Akim Demaille <akim@epita.fr>
16155
16156 * doc/bison.texinfo (Debugging): Split into...
16157 (Tracing): this new section, its former contents, and...
16158 (Understanding): this new section.
16159 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
16160 by...
16161 (report_flag): this.
16162 Adjust all dependencies.
16163 (report_args, report_types, report_argmatch): New.
16164 (usage, getargs): Report/support -r, --report.
16165 * src/options.h
16166 (struct option_table_struct): Rename as..,
16167 (struct option_table_s): this.
16168 Rename the `set_flag' member to `flag' to match with getopt_long's
16169 struct.
16170 * src/options.c (option_table): Split verbose into an entry for
16171 %verbose, and another for --verbose.
16172 Support --report/-r, so remove -r from the obsolete --raw.
16173 * src/print.c: Attach full item sets and lookaheads reports to
16174 report_flag instead of trace_flag.
16175 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
16176
78df8250
PE
161772002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16178 and Paul Eggert <eggert@twinsun.com>
769b430f 16179
78df8250
PE
16180 * data/bison.simple (yyparse): Correct error handling to conform to
16181 POSIX and yacc. Specifically, after syntax error is discovered,
16182 do not reduce further before shifting the error token.
16183 Clean up the code a bit by removing the labels yyerrdefault,
16184 yyerrhandle, yyerrpop.
16185 * NEWS: Document the above.
16186
c0c9ea05
PH
161872002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16188
16189 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
16190 type; it isn't always big enough, since it doesn't necessarily
16191 include non-terminals.
769b430f 16192 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
16193 the latter can be removed.
16194 (yy_token_number_type): Remove, only one use.
16195 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
16196 don't use TokenNumberType as element type.
769b430f 16197
c0c9ea05
PH
16198 * tests/regression.at: Modify expected output to agree with change
16199 to yyr1 and yytranslate.
769b430f 16200
6390a83f
FK
162012002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
16202
16203 * src/reader.c (parse_action): Use copy_character instead of
16204 obstack_1grow.
16205
db7c8e9a
AD
162062002-05-13 Akim Demaille <akim@epita.fr>
16207
16208 * tests/regression.at (Token definitions): Prototype yylex and
16209 yyerror.
16210
fcc61800
PH
162112002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16212
158c687b 16213 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
16214 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
16215 32-bit arithmetic.
16216 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
16217
5683e9b2
AD
162182002-05-07 Akim Demaille <akim@epita.fr>
16219
16220 * tests/synclines.at: Be sure to prototype yylex and yyerror to
16221 avoid GCC warnings.
16222
0c2d3f4c
AD
162232002-05-07 Akim Demaille <akim@epita.fr>
16224
16225 Kill GCC warnings.
16226
16227 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
16228 over the RHS of each rule.
16229 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
16230 * src/state.h (state_t): Member `nitems' is unsigned short.
16231 * src/LR0.c (get_state): Adjust.
16232 * src/reader.c (packgram): Likewise.
16233 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
16234 `Type'.
16235 (muscle_insert_int_table): Remove, unused.
16236 (prepare_rules): Remove `max'.
16237
1565b720
AD
162382002-05-06 Akim Demaille <akim@epita.fr>
16239
16240 * src/closure.c (print_firsts): Display of the symbol tags.
16241 (bitmatrix_print): Move to...
16242 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
16243 here.
16244 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
16245
cfaee611
AD
162462002-05-06 Akim Demaille <akim@epita.fr>
16247
16248 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
16249 hash_do_for_each.
16250
458be8e0
AD
162512002-05-06 Akim Demaille <akim@epita.fr>
16252
16253 * src/LR0.c (new_state, get_state): Instead of using the global
16254 `kernel_size' and `kernel_base', have two new arguments:
16255 `core_size' and `core'.
16256 Adjust callers.
16257
a900a624
AD
162582002-05-06 Akim Demaille <akim@epita.fr>
16259
16260 * src/reader.c (packgram): No longer end `ritem' with a 0
16261 sentinel: it is not used.
16262
d4e7d3a1
AD
162632002-05-05 Akim Demaille <akim@epita.fr>
16264
16265 New experimental feature: display the lookaheads in the report and
16266 graph.
16267
16268 * src/print (print_core): When --trace-flag, display the rules
16269 lookaheads.
16270 * src/print_graph.c (print_core): Likewise.
16271 Swap the arguments.
16272 Adjust caller.
16273
39ceb25b
AD
162742002-05-05 Akim Demaille <akim@epita.fr>
16275
16276 * tests/torture.at (Many lookaheads): New test.
16277
5372019f
AD
162782002-05-05 Akim Demaille <akim@epita.fr>
16279
16280 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
16281 (GENERATE_MUSCLE_INSERT_TABLE): this.
16282 (output_int_table, output_unsigned_int_table, output_short_table)
16283 (output_token_number_table, output_item_number_table): Replace with...
16284 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
16285 (muscle_insert_short_table, muscle_insert_token_number_table)
16286 (muscle_insert_item_number_table): these.
16287 Adjust all callers.
16288 (prepare_tokens): Don't free `translations', since...
16289 * src/reader.h, src/reader.c (grammar_free): do it.
16290 Move to...
16291 * src/gram.h, src/gram.c (grammar_free): here.
16292 * data/bison.simple, data/bison.c++: b4_token_number_max is now
16293 b4_translate_max.
16294
5df5f6d5
AD
162952002-05-05 Akim Demaille <akim@epita.fr>
16296
16297 * src/output.c (output_unsigned_int_table): New.
16298 (prepare_rules): `i' is unsigned.
16299 `prhs', `rline', `r2' are unsigned int.
16300 Rename muscle `rhs_number_max' as `rhs_max'.
16301 Output muscles `prhs_max', `rline_max', and `r2_max'.
16302 Free rline and r1.
16303 * data/bison.simple, data/bison.c++: Adjust to use these muscles
16304 to compute types instead of constant types.
16305 * tests/regression.at (Web2c Actions): Adjust.
16306
b87f8b21
AD
163072002-05-04 Akim Demaille <akim@epita.fr>
16308
16309 * src/symtab.h (SALIAS, SUNDEF): Rename as...
16310 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
16311 Adjust dependencies.
16312 * src/output.c (token_definitions_output): Be sure not to output a
16313 `#define 'a'' when fed with `%token 'a' "a"'.
16314 * tests/regression.at (Token definitions): New.
16315
8bb936e4
PE
163162002-05-03 Paul Eggert <eggert@twinsun.com>
16317
16318 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
16319 for K&R C.
16320
163212002-05-03 gettextize <bug-gnu-gettext@gnu.org>
16322
16323 * Makefile.am (SUBDIRS): Remove intl.
16324 (EXTRA_DIST): Add config/config.rpath.
16325
53c71a12
AD
163262002-05-03 Akim Demaille <akim@epita.fr>
16327
16328 * data/bison.simple (m4_if): Don't output empty enums.
16329 And actually, output valid enum definitions :(.
16330
289dd0cf
AD
163312002-05-03 Akim Demaille <akim@epita.fr>
16332
16333 * configure.bat: Remove, completely obsolete.
16334 * Makefile.am (EXTRA_DIST): Adjust.
16335 Don't distribute config.rpath...
16336 * config/Makefile.am (EXTRA_DIST): Do it.
16337
db85e524
AD
163382002-05-03 Akim Demaille <akim@epita.fr>
16339
16340 * configure.in (GETTEXT_VERSION): New.
16341 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
16342
83ccf991
AD
163432002-05-03 Akim Demaille <akim@epita.fr>
16344
16345 * data/bison.simple (b4_token_enum): New.
16346 (b4_token_defines): Use it to output tokens both as #define and
16347 enums.
16348 Suggested by Paul Eggert.
16349 * src/output.c (token_definitions_output): Don't output spurious
16350 white spaces.
16351
1f418995
AD
163522002-05-03 Akim Demaille <akim@epita.fr>
16353
16354 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
16355
45119f04
RA
163562002-05-02 Robert Anisko <robert@lrde.epita.fr>
16357
16358 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
16359 Update the stack class, give a try to deque as the default container.
16360
b2d52318
AD
163612002-05-02 Akim Demaille <akim@epita.fr>
16362
16363 * data/bison.simple (yyparse): Do not implement @$ = @1.
16364 (YYLLOC_DEFAULT): Adjust to do it.
16365 * doc/bison.texinfo (Location Default Action): Fix.
16366
3a8b4109
AD
163672002-05-02 Akim Demaille <akim@epita.fr>
16368
16369 * src/reader.c (parse_braces): Merge into...
16370 (parse_action): this.
16371
84614e13
AD
163722002-05-02 Akim Demaille <akim@epita.fr>
16373
16374 * configure.in (ALL_LINGUAS): Remove.
16375 * po/LINGUAS, hr.po: New.
16376
fdbcd8e2
AD
163772002-05-02 Akim Demaille <akim@epita.fr>
16378
16379 Remove the so called hairy (semantic) parsers.
16380
16381 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
16382 * src/gram.h, src/gram.c (semantic_parser): Remove.
16383 (rule_t): Remove the guard and guard_line members.
16384 * src/lex.h (token_t): remove tok_guard.
16385 * src/options.c (option_table): Remove %guard and %semantic_parser
16386 support.
16387 * src/output.c, src/output.h (guards_output): Remove.
16388 (prepare): Adjust.
16389 (token_definitions_output): Don't output the `T'
16390 tokens (???).
16391 (output_skeleton): Don't output the guards.
16392 * src/files.c, src/files.c (attrsfile): Remove.
16393 * src/reader.c (symbol_list): Remove the guard and guard_line
16394 members.
16395 Adjust dependencies.
16396 (parse_guard): Remove.
16397 * data/bison.hairy: Remove.
16398 * doc/bison.texinfo (Environment Variables): Remove occurrences of
16399 BISON_HAIRY.
16400
82b6cb3f
AD
164012002-05-02 Akim Demaille <akim@epita.fr>
16402
16403 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
16404 (parse_guard): Rename the formal argument `stack_offset' as
16405 `rule_length', which is more readable.
16406 Adjust callers.
16407 (copy_at, copy_dollar): Instead of outputting the hard coded
16408 values of $$, $n and so forth, output invocation to b4_lhs_value,
16409 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
16410 Note: this patch partially drops `semantic-parser' support: it
16411 always does `rule_length - n', where semantic parsers ought to
16412 always use `-n'.
82b6cb3f
AD
16413 * data/bison.simple, data/bison.c++ (b4_lhs_value)
16414 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
16415
6cbfbcc5
AD
164162002-05-02 Akim Demaille <akim@epita.fr>
16417
16418 * configure.in (AC_INIT): Bump to 1.49b.
16419 (AM_INIT_AUTOMAKE): Short invocation.
16420
b8548114
AD
164212002-05-02 Akim Demaille <akim@epita.fr>
16422
16423 Version 1.49a.
16424
c20cd1fa
AD
164252002-05-01 Akim Demaille <akim@epita.fr>
16426
16427 * src/skeleton.h: Remove.
16428
8a9566d4
AD
164292002-05-01 Akim Demaille <akim@epita.fr>
16430
16431 * src/skeleton.h: Fix the #endif.
16432 Reported by Magnus Fromreide.
16433
8c6d399a
PE
164342002-04-26 Paul Eggert <eggert@twinsun.com>
16435
16436 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
16437 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 16438 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 16439
2b7ed18a
RA
164402002-04-25 Robert Anisko <robert@lrde.epita.fr>
16441
16442 * src/scan-skel.l: Postprocess quadrigraphs.
16443
16444 * src/reader.c (copy_character): New function, used to output
16445 single characters while replacing `[' and `]' with quadrigraphs, to
16446 avoid troubles with M4 quotes.
16447 (copy_comment): Output characters with copy_character.
16448 (read_additionnal_code): Likewise.
16449 (copy_string2): Likewise.
16450 (copy_definition): Likewise.
16451
16452 * tests/calc.at: Exercise M4 quoting.
16453
34a89c50
AD
164542002-04-25 Akim Demaille <akim@epita.fr>
16455
16456 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
16457 between `!' and the command.
16458 Reported by Paul Eggert.
16459
0dd1580a
RA
164602002-04-24 Robert Anisko <robert@lrde.epita.fr>
16461
16462 * tests/calc.at: Exercise prologue splitting.
16463
16464 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
16465 `b4_post_prologue' instead of `b4_prologue'.
16466
16467 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
16468 muscles.
16469 (output): Free pre_prologue_obstack and post_prologue_obstack.
16470 * src/files.h, src/files.c (attrs_obstack): Remove.
16471 (pre_prologue_obstack, post_prologue_obstack): New.
16472 * src/reader.c (copy_definition): Add a parameter to specify the
16473 obstack to fill, instead of using attrs_obstack unconditionally.
16474 (read_declarations): Pass pre_prologue_obstack to copy_definition if
16475 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
16476
83c1796f
PE
164772002-04-23 Paul Eggert <eggert@twinsun.com>
16478
16479 * data/bison.simple: Remove unnecessary commentary and white
16480 space differences from 1_29-branch.
16481 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
16482
16483 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
16484 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
16485 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
16486 constructors or destructors.
16487
16488 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
16489
1207eeac
AD
164902002-04-23 Akim Demaille <akim@epita.fr>
16491
16492 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
16493 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
16494 location with columns.
16495 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
16496 All reported by Paul Eggert.
16497
78ab8f67
AD
164982002-04-22 Akim Demaille <akim@epita.fr>
16499
16500 * src/reduce.c (dump_grammar): Move to...
16501 * src/gram.h, src/gram.c (grammar_dump): here.
16502 Be sure to separate long item numbers.
16503 Don't read the members of a rule's prec if its nil.
16504
133c20e2
AD
165052002-04-22 Akim Demaille <akim@epita.fr>
16506
16507 * src/output.c (table_size, table_grow): New.
16508 (MAXTABLE): Remove, replace uses with table_size.
16509 (pack_vector): Instead of dying when the table is too big, grow it.
16510
9515e8a7
AD
165112002-04-22 Akim Demaille <akim@epita.fr>
16512
16513 * data/bison.simple (yyr1): Its type is that of a token number.
16514 * data/bison.c++ (r1_): Likewise.
16515 * tests/regression.at (Web2c Actions): Adjust.
16516
23c5a174
AD
165172002-04-22 Akim Demaille <akim@epita.fr>
16518
16519 * src/reader.c (token_translations_init): 256 is now the default
16520 value for the error token, i.e., it will be assigned another
16521 number if the user assigned 256 to one of her tokens.
16522 (reader): Don't force 256 to error.
16523 * doc/bison.texinfo (Symbols): Adjust.
16524 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
16525 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
16526 etc. instead of 10, 20, 30 (which was used to `jump' over error
16527 (256) and undefined (2)).
16528
5fbb0954
AD
165292002-04-22 Akim Demaille <akim@epita.fr>
16530
16531 Propagate more token_number_t.
16532
16533 * src/gram.h (token_number_as_item_number)
16534 (item_number_as_token_number): New.
16535 * src/output.c (GENERATE_OUTPUT_TABLE): New.
16536 Use it to create output_item_number_table and
16537 output_token_number_table.
16538 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
16539 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
16540 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
16541 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
16542
4f940944
AD
165432002-04-22 Akim Demaille <akim@epita.fr>
16544
16545 * src/output.h, src/output.c (get_lines_number): Remove.
16546
3ded9a63
AD
165472002-04-19 Akim Demaille <akim@epita.fr>
16548
16549 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
16550 as Lex/Flex'.
16551 (Debugging): More details about enabling the debugging features.
16552 (Table of Symbols): Describe $$, $n, @$, and @n.
16553 Suggested by Tim Josling.
16554
e0c471a9
AD
165552002-04-19 Akim Demaille <akim@epita.fr>
16556
16557 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
16558
fecc10cd
AD
165592002-04-10 Akim Demaille <akim@epita.fr>
16560
16561 * src/system.h: Rely on HAVE_LIMITS_H.
16562 Suggested by Paul Eggert.
16563
51dec47b
AD
165642002-04-09 Akim Demaille <akim@epita.fr>
16565
16566 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
16567 full stderr, and strip it according to the bison options, instead
16568 of composing the error message from different bits.
16569 This makes it easier to check for several error messages.
16570 Adjust all the invocations.
16571 Add an invocation exercising the error token.
16572 Add an invocation demonstrating a stupid error message.
16573 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
16574 Adjust the tests.
16575 Error message are for stderr, not stdout.
16576
007a50a4
AD
165772002-04-09 Akim Demaille <akim@epita.fr>
16578
16579 * src/gram.h, src/gram.c (error_token_number): Remove, use
16580 errtoken->number.
16581 * src/reader.c (reader): Don't specify the user token number (2)
16582 for $undefined, as it uselessly prevents using it.
16583 * src/gram.h (token_number_t): Move to...
16584 * src/symtab.h: here.
16585 (state_t.number): Is a token_number_t.
16586 * src/print.c, src/reader.c: Use undeftoken->number instead of
16587 hard coded 2.
16588 (Even though this 2 is not the same as above: the number of the
16589 undeftoken remains being 2, it is its user token number which
16590 might not be 2).
16591 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
16592 `user_token_number_max'.
16593 Output `undef_token_number'.
16594 * data/bison.simple, data/bison.c++: Use them.
16595 Be sure to map invalid yylex return values to
16596 `undef_token_number'. This saves us from gratuitous SEGV.
16597
16598 * tests/conflicts.at (Solved SR Conflicts)
16599 (Unresolved SR Conflicts): Adjust.
16600 * tests/regression.at (Web2c Actions): Adjust.
16601
06446ccf
AD
166022002-04-08 Akim Demaille <akim@epita.fr>
16603
16604 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
16605 Adding #line.
16606 Remove the duplicate `typedefs'.
16607 (RhsNumberType): Fix the declaration and various other typos.
16608 Use __ofile__.
16609 * data/bison.simple: Use __ofile__.
16610 * src/scan-skel.l: Handle __ofile__.
16611
62a3e4f0
AD
166122002-04-08 Akim Demaille <akim@epita.fr>
16613
16614 * src/gram.h (item_number_t): New, the type of item numbers in
16615 RITEM. Note that it must be able to code symbol numbers as
16616 positive number, and the negation of rule numbers as negative
16617 numbers.
16618 Adjust all dependencies (pretty many).
16619 * src/reduce.c (rule): Remove this `short *' pointer: use
16620 item_number_t.
16621 * src/system.h (MINSHORT, MAXSHORT): Remove.
16622 Include `limits.h'.
16623 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
16624 (shortcpy): Remove.
16625 (MAXTABLE): Move to...
16626 * src/output.c (MAXTABLE): here.
16627 (prepare_rules): Use output_int_table to output rhs.
16628 * data/bison.simple, data/bison.c++: Adjust.
16629 * tests/torture.at (Big triangle): Move the limit from 254 to
16630 500.
16631 * tests/regression.at (Web2c Actions): Ajust.
16632
16633 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
16634 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
16635 passes, but produces negative #line number, once fixed, GCC is
16636 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
16637 C), it passes.
16638 * src/state.h (state_h): Code input lines on ints, not shorts.
16639
bb88b0fc
AD
166402002-04-08 Akim Demaille <akim@epita.fr>
16641
16642 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
16643 and then the grammar.
16644
9a636f47
AD
166452002-04-08 Akim Demaille <akim@epita.fr>
16646
16647 * src/system.h: No longer using strndup.
16648
680e8701
AD
166492002-04-07 Akim Demaille <akim@epita.fr>
16650
16651 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
16652 * src/output.c (output_table_data): Return the longest number.
16653 (prepare_tokens): Output `token_number_max').
16654 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
16655 New.
16656 Use them to define yy_token_number_type/TokenNumberType.
16657 Use this type for yytranslate.
16658 * tests/torture.at (Big triangle): Push the limit from 124 to
16659 253.
16660 * tests/regression.at (Web2c Actions): Adjust.
16661
817e9f41
AD
166622002-04-07 Akim Demaille <akim@epita.fr>
16663
16664 * tests/torture.at (Big triangle): New.
16665 (GNU AWK Grammar, GNU Cim Grammar): Move to...
16666 * tests/existing.at: here.
16667
5123689b
AD
166682002-04-07 Akim Demaille <akim@epita.fr>
16669
16670 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
16671 nritems.
16672 Adjust dependencies.
16673
f3849179
AD
166742002-04-07 Akim Demaille <akim@epita.fr>
16675
16676 * src/reader.c: Normalize increments to prefix form.
16677
bd02036a
AD
166782002-04-07 Akim Demaille <akim@epita.fr>
16679
16680 * src/reader.c, symtab.c: Remove debugging code.
16681
db8837cb
AD
166822002-04-07 Akim Demaille <akim@epita.fr>
16683
16684 Rename all the `bucket's as `symbol_t'.
16685
16686 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
16687 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
16688 * src/symtab.c, src/symtab.h (bucket): Rename as...
16689 (symbol_t): this.
16690 (symbol_list_new, bucket_check_defined, bucket_make_alias)
16691 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
16692 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
16693 (buckets_new, buckets_free, buckets_do): Rename as...
16694 (symbol_list_new, symbol_check_defined, symbol_make_alias)
16695 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
16696 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
16697 (symbols_new, symbols_free, symbols_do): these.
16698
72a23c97
AD
166992002-04-07 Akim Demaille <akim@epita.fr>
16700
16701 Use lib/hash for the symbol table.
16702
16703 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
16704 EOF.
16705 * src/lex.c (lex): Set the `number' member of new terminals.
16706 * src/reader.c (bucket_check_defined, bucket_make_alias)
16707 (bucket_check_alias_consistence, bucket_translation): New.
16708 (reader, grammar_free, readgram, token_translations_init)
16709 (packsymbols): Adjust.
16710 (reader): Number the predefined tokens.
16711 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
16712 for predefined tokens.
16713 * src/symtab.h (bucket): Remove all the hash table related
16714 members.
16715 * src/symtab.c (symtab): Replace by...
16716 (bucket_table): this.
16717 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
16718 (buckets_new, buckets_do): New.
16719
280a38c3
AD
167202002-04-07 Akim Demaille <akim@epita.fr>
16721
16722 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
16723 (start_symbol, max_user_token_number, semantic_parser)
16724 (error_token_number): Initialize.
16725 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
16726 Initialize.
16727 (reader): Don't.
16728 (errtoken, eoftoken, undeftoken, axiom): Extern.
16729
03b31c0c
AD
167302002-04-07 Akim Demaille <akim@epita.fr>
16731
16732 * src/gram.h (rule_s): prec and precsym are now pointers
16733 to the bucket giving the priority/associativity.
16734 Member `associativity' removed: useless.
16735 * src/reduce.c, src/conflicts.c: Adjust.
16736
8b3df748
AD
167372002-04-07 Akim Demaille <akim@epita.fr>
16738
16739 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
16740 Properly escape the symbols' TAG when outputting them.
16741
e601aa1d
AD
167422002-04-07 Akim Demaille <akim@epita.fr>
16743
16744 * src/lalr.h (LA): Is a bitsetv, not bitset*.
16745
b0299a2e
AD
167462002-04-07 Akim Demaille <akim@epita.fr>
16747
16748 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
16749 (LArule): this, which is an array to rule_t*.
16750 * src/print.c, src/conflicts.c: Adjust.
16751
d7e1f00c
AD
167522002-04-07 Akim Demaille <akim@epita.fr>
16753
16754 * src/gram.h (rule_t): Rename `number' as `user_number'.
16755 `number' is a new member.
16756 Adjust dependencies.
16757 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
16758
cc9305dd
AD
167592002-04-07 Akim Demaille <akim@epita.fr>
16760
16761 As a result of the previous patch, it is no longer needed
16762 to reorder ritem itself.
16763
16764 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
16765
b0940840
AD
167662002-04-07 Akim Demaille <akim@epita.fr>
16767
16768 Be sure never to walk through RITEMS, but use only data related to
16769 the rules themselves. RITEMS should be banished.
16770
16771 * src/output.c (output_token_translations): Rename as...
16772 (prepare_tokens): this.
16773 In addition to `translate', prepare the muscles `tname' and
16774 `toknum', which were handled by...
16775 (output_rule_data): this.
16776 Remove, and move the remainder of its outputs into...
16777 (prepare_rules): this new routines, which also merges content from
16778 (output_gram): this.
16779 (prepare_rules): Be sure never to walk through RITEMS.
16780 (output_stos): Rename as...
16781 (prepare_stos): this.
16782 (output): Always invoke prepare_states, after all, just don't use it
16783 in the output if you don't need it.
16784
643a5994
AD
167852002-04-07 Akim Demaille <akim@epita.fr>
16786
16787 * src/LR0.c (new_state): Display `nstates' as the name of the
16788 newly created state.
16789 Adjust to initialize first_state and last_state if needed.
16790 Be sure to distinguish the initial from the final state.
16791 (new_states): Create the itemset of the initial state, and use
16792 new_state.
16793 * src/closure.c (closure): Now that the initial state has its
16794 items properly set, there is no need for a special case when
16795 creating `ruleset'.
16796
16797 As a result, now the rule 0, reducing to $axiom, is visible in the
16798 outputs. Adjust the test suite.
16799
16800 * tests/conflicts.at (Solved SR Conflicts)
16801 (Unresolved SR Conflicts): Adjust.
16802 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
16803 * tests/conflicts.at (S/R in initial): New.
16804
b4c4ccc2
AD
168052002-04-07 Akim Demaille <akim@epita.fr>
16806
16807 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
16808 the RHS of the rules.
16809 * src/output.c (output_gram): Likewise.
16810
bba97eb2
AD
168112002-04-07 Akim Demaille <akim@epita.fr>
16812
16813 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
16814 bucket.
16815 Adjust all dependencies.
16816 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
16817 `number' of the buckets too.
16818 * src/gram.h: Include `symtab.h'.
16819 (associativity): Move to...
16820 * src/symtab.h: here.
16821 No longer include `gram.h'.
16822
c3b407f4
AD
168232002-04-07 Akim Demaille <akim@epita.fr>
16824
16825 * src/gram.h, src/gram.c (rules_rhs_length): New.
16826 (ritem_longest_rhs): Use it.
16827 * src/gram.h (rule_t): `number' is a new member.
16828 * src/reader.c (packgram): Set it.
16829 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
16830 the end of `rules', and count them out of `nrules'.
16831 (reduce_output, dump_grammar): Adjust.
16832 * src/print.c (print_grammar): It is no longer needed to check for
16833 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
16834 * tests/reduce.at (Reduced Automaton): New test.
16835
11652ab3
AD
168362002-04-07 Akim Demaille <akim@epita.fr>
16837
16838 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
16839 lacking `+ 1' to nrules, Bison reported as useless a token if it
16840 was used solely to set the precedence of the last rule...
16841
26b23c1a
AD
168422002-04-07 Akim Demaille <akim@epita.fr>
16843
16844 * data/bison.c++, data/bison.simple: Don't output the current file
16845 name in #line, to avoid useless diffs between two identical
16846 outputs under different names.
16847
18bcecb0
AD
168482002-04-07 Akim Demaille <akim@epita.fr>
16849
16850 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
16851 Normalize loops to using `< nrules + 1', not `<= nrules'.
16852
fa770c86
AD
168532002-04-07 Akim Demaille <akim@epita.fr>
16854
16855 * TODO: Update.
16856
d9b739c3
AD
168572002-04-07 Akim Demaille <akim@epita.fr>
16858
16859 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
16860 bucket.value as bucket.number.
16861
99013900
AD
168622002-04-07 Akim Demaille <akim@epita.fr>
16863
16864 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
16865 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
16866 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
16867 RHS, instead of being an index in RITEMS.
16868
e966383b
PE
168692002-04-04 Paul Eggert <eggert@twinsun.com>
16870
16871 * doc/bison.texinfo: Update copyright date.
16872 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
16873 (Symbols): Warn about running Bison in one character set,
16874 but compiling and/or running in an incompatible one.
16875 Warn about character code 256, too.
16876
168772002-04-03 Paul Eggert <eggert@twinsun.com>
16878
16879 * src/bison.data (YYSTACK_ALLOC): Depend on whether
16880 YYERROR_VERBOSE is nonzero, not whether it is defined.
16881
16882 Merge changes from bison-1_29-branch.
c307773e 16883
8d6c48b9
PE
168842002-03-20 Paul Eggert <eggert@twinsun.com>
16885
16886 Merge fixes from Debian bison_1.34-1.diff.
16887
16888 * configure.in (AC_PREREQ): 2.53.
16889
e53c6322
AD
168902002-03-20 Akim Demaille <akim@epita.fr>
16891
16892 * src/conflicts.c (log_resolution): Argument `resolution' is const.
16893
9ffbeca7
PE
168942002-03-19 Paul Eggert <eggert@twinsun.com>
16895
21db0b2a
PE
16896 * src/bison.simple (YYCOPY): New macro.
16897 (YYSTACK_RELOCATE): Use it.
16898 Remove Type arg; no longer needed. All callers changed.
16899 (yymemcpy): Remove; no longer needed.
16900
9ffbeca7
PE
16901 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
16902 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
16903
642cb8f8
AD
169042002-03-19 Akim Demaille <akim@epita.fr>
16905
16906 Test and fix the #line outputs.
16907
16908 * tests/atlocal.at (GCC): New.
16909 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
0ffd4fd1 16910 (Prologue synch line, %union synch line, Postprologue synch line)
642cb8f8
AD
16911 (Action synch line, Epilogue synch line): New tests.
16912 * src/reader.c (parse_union_decl): Define the muscle stype_line.
16913 * data/bison.simple, data/bison.c++: Use it.
16914
3c31a486
AD
169152002-03-19 Akim Demaille <akim@epita.fr>
16916
16917 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
16918 (Solved SR Conflicts, %expect not enough, %expect right)
16919 (%expect too much): Move to...
16920 * tests/conflicts.at: this new file.
16921
0d8bed56
AD
169222002-03-19 Akim Demaille <akim@epita.fr>
16923
16924 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
16925 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
16926 that we can move to enums for instance.
16927 * src/output.c (token_definitions_output): Output a list of
16928 `token-name, token-number' instead of the #define.
16929 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
16930
9208d17f
AD
169312002-03-14 Akim Demaille <akim@epita.fr>
16932
16933 Use Gettext 0.11.1.
16934
af27eacb
RA
169352002-03-09 Robert Anisko <robert@lrde.epita.fr>
16936
16937 * data/bison.c++: Make the user able to add members to the generated
16938 parser by subclassing.
16939
9101a310
RA
169402002-03-05 Robert Anisko <robert@lrde.epita.fr>
16941
16942 * src/reader.c (read_additionnal_code): `c' should be an integer, not
16943 a character.
16944 Reported by Nicolas Tisserand and Nicolas Burrus.
16945
fff9bf0b
RA
169462002-03-04 Robert Anisko <robert@lrde.epita.fr>
16947
16948 * src/reader.c: Warn about lacking semi-colons, do not complain.
16949
64dba31e
RA
169502002-03-04 Robert Anisko <robert@lrde.epita.fr>
16951
16952 * data/bison.c++: Remove a debug line.
16953
374f5a14
RA
169542002-03-04 Robert Anisko <robert@lrde.epita.fr>
16955
16956 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
16957 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
16958 provide a default implementation.
16959
bfcf1f3a
AD
169602002-03-04 Akim Demaille <akim@epita.fr>
16961
16962 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
16963 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
16964 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
16965 * tests/semantic.at (Parsing Guards): Similarly.
16966 * src/reader.at (readgram): Complain if the last rule is not ended
16967 with a semi-colon.
16968
65ccf9fc
AD
169692002-03-04 Akim Demaille <akim@epita.fr>
16970
16971 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
16972 * src/closure.c: here.
16973 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
16974 RTC.
16975 * src/warshall.h, src/warshall.c: Remove.
16976 * tests/sets.at (Broken Closure): Adjust.
16977
d0039cbc
AD
169782002-03-04 Akim Demaille <akim@epita.fr>
16979
16980 * src/output.c (output_skeleton): tempdir is const.
16981 bytes_read is unused.
16982
345cea78
AD
169832002-03-04 Akim Demaille <akim@epita.fr>
16984
16985 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
16986 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
16987 Update.
16988 From Michael Hayes.
16989
564801f7
AD
169902002-03-04 Akim Demaille <akim@epita.fr>
16991
16992 * src/closure.c (closure): `r' is unused.
16993
e5352bc7
AD
169942002-03-04 Akim Demaille <akim@epita.fr>
16995
16996 * tests/sets.at (Broken Closure): Add the ending `;'.
16997 * src/reader.at (readgram): Complain if a rule is not ended with a
16998 semi-colon.
16999
914feea9
AD
170002002-03-04 Akim Demaille <akim@epita.fr>
17001
17002 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
17003 (count_sr_conflicts): Use bitset_count.
17004 * src/reduce.c (inaccessable_symbols): Ditto.
17005 (bits_size): Remove.
17006 * src/warshall.h, src/warshall.c: Convert to bitsetv.
17007
f0250de6
AD
170082002-03-04 Akim Demaille <akim@epita.fr>
17009
17010 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
17011 * src/reduce.c: Remove the `bitset_zero's following the
17012 `bitset_create's, as now it is performed by the latter.
17013
ef017502
AD
170142002-03-04 Akim Demaille <akim@epita.fr>
17015
17016 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
17017 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
17018 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
17019 latest sources from Michael.
17020
76514394
AD
170212002-03-04 Akim Demaille <akim@epita.fr>
17022
17023 * src/output.c (output): Don't free the grammar.
17024 * src/reader.c (grammar_free): New.
17025 * src/main.c (main): Call it and don't free symtab here.
17026
55024580
AD
170272002-03-04 Akim Demaille <akim@epita.fr>
17028
17029 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
17030 before returning.
17031 Reported by Benoit Perrot.
17032
f9abaa2c
AD
170332002-03-04 Akim Demaille <akim@epita.fr>
17034
17035 Use bitset operations when possible, not loops over bits.
17036
17037 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
17038 bitset_or.
17039 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
17040 * src/reduce.c (useless_nonterminals): Formatting changes.
17041 * src/warshall.c (TC): Use bitset_or.
17042
0e721e75
AD
170432002-03-04 Akim Demaille <akim@epita.fr>
17044
17045 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
17046 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
17047 Ditto.
17048
0fb1ffb1
AD
170492002-03-04 Akim Demaille <akim@epita.fr>
17050
17051 * src/lalr.c (F): Now a bitset*.
17052 Adjust all dependencies.
17053
b86796bf
AD
170542002-03-04 Akim Demaille <akim@epita.fr>
17055
17056 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
17057 Adjust all dependencies.
17058
602bbf31
AD
170592002-03-04 Akim Demaille <akim@epita.fr>
17060
17061 * src/L0.c, src/LR0.h (nstates): Be size_t.
17062 Adjust comparisons (signed vs unsigned).
17063 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
17064 bitset*.
17065 Adjust all dependencies.
17066
d8a0245c
AD
170672002-03-04 Akim Demaille <akim@epita.fr>
17068
17069 * src/closure.c (firsts): Now, also a bitset.
17070 Adjust all dependencies.
17071 (varsetsize): Remove, now unused.
17072 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
17073
34ba9743
AD
170742002-03-04 Akim Demaille <akim@epita.fr>
17075
17076 * src/print.c: Convert to use bitset.h, not hand coded iterations
17077 over ints.
17078
ed86e78c
AD
170792002-03-04 Akim Demaille <akim@epita.fr>
17080
17081 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
17082
dfdb1797
AD
170832002-03-04 Akim Demaille <akim@epita.fr>
17084
17085 * src/closure.c (ruleset): Be a bitset.
17086 (rulesetsize): Remove.
17087
7086e707
AD
170882002-03-04 Akim Demaille <akim@epita.fr>
17089
17090 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
17091 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
17092 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
17093 * src/closure.c (fderives): Be an array of bitsets.
17094
98254360
RA
170952002-02-28 Robert Anisko <robert@lrde.epita.fr>
17096
17097 * data/bison.c++: Merge the two generated headers. Insert a copyright
17098 notice in each output file.
17099
a75c057f
AD
171002002-02-28 Akim Demaille <akim@epita.fr>
17101
17102 * data/bison.c++: Copy the prologue of bison.simple to fetch
17103 useful M4 definitions, such as b4_header_guard.
17104
06b00abc
AD
171052002-02-25 Akim Demaille <akim@epita.fr>
17106
17107 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
17108 translator friendly scheme for the bgr
17109 copyright notice.
06b00abc 17110
70e7d534
AD
171112002-02-25 Akim Demaille <akim@epita.fr>
17112
17113 * src/output.c (header_output): Remove, now handled completely via
17114 M4.
17115
abe017f6
AD
171162002-02-25 Akim Demaille <akim@epita.fr>
17117
17118 * m4/m4.m4: New, from CVS Autoconf.
17119 * configure.in: Invoke it.
17120 * src/output.c (output_skeleton): Use its result instead of the
17121 hard coded name.
17122
381fb12e
AD
171232002-02-25 Akim Demaille <akim@epita.fr>
17124
17125 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
17126 Fileutils 4.1.5.
17127 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
17128 * src/output.c (output_skeleton): Use mkstemp to create a real
17129 temporary file.
17130 Move the filling of `skeleton' and its muscle to...
17131 (prepare): here.
17132 (output): Move the definition of the prologue muscle to...
17133 (prepare): here.
17134 * src/system.h (DEFAULT_TMPDIR): New.
17135
6f38107f
PE
171362002-02-14 Paul Eggert <eggert@twinsun.com>
17137
17138 Remove the support for C++ namespace cleanliness; it was
17139 causing more problems than it was curing, since it didn't work
17140 properly on some nonstandard C++ compilers. This can wait
17141 for a proper C++ parser.
17142
17143 * NEWS: Document this.
17144 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
17145 of C++, as it's treated like C now.
17146 * src/bison.simple (YYSTD): Remove.
17147 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
17148 Treat C++ just like Standard C instead of trying to support
17149 namespace cleanliness.
17150
80cce3da
AD
171512002-02-14 Akim Demaille <akim@epita.fr>
17152
17153 * tests/regression.at (else): Adjust to Andreas' change.
17154
842e8679
AD
171552002-02-14 Akim Demaille <akim@epita.fr>
17156
17157 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
17158
4bda3f10
AD
171592002-02-13 Andreas Schwab <schwab@suse.de>
17160
17161 * src/output.c (output_rule_data): Don't output NULL, it might
17162 not be defined yet.
17163
4162fa07 171642002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 17165
4162fa07
RA
17166 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
17167 (Copyright notice): Update.
b418ecd8 17168
bd16a5dc
AD
171692002-02-11 Akim Demaille <akim@epita.fr>
17170
17171 * tests/regression.at (%nonassoc and eof): Don't include
17172 nonportable headers.
17173
8d69a1a3
RA
171742002-02-08 Robert Anisko <robert@lrde.epita.fr>
17175
17176 * data/bison.c++: Correct error recovery. Make the user able to
17177 initialize the starting location.
17178
9b2d0677
AD
171792002-02-07 Akim Demaille <akim@epita.fr>
17180
17181 * tests/input.at: New.
17182
69e2658b
RA
171832002-02-07 Robert Anisko <robert@lrde.epita.fr>
17184
17185 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 17186 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
17187 directives around tables only needed for debugging.
17188
4aacc3a7
RA
171892002-02-07 Robert Anisko <robert@lrde.epita.fr>
17190
17191 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
17192 C++ parsers.
17193 (yy::b4_name::parse): Use print_.
17194
762a801e
RA
171952002-02-07 Robert Anisko <robert@lrde.epita.fr>
17196
17197 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
17198
4bb2bc3f
RA
171992002-02-07 Robert Anisko <robert@lrde.epita.fr>
17200
17201 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
17202 C++ parsers.
17203 (yy::b4_name::parse): Build verbose error messages, and use error_.
17204
6b45a3ca
RA
172052002-02-06 Robert Anisko <robert@lrde.epita.fr>
17206
17207 * data/bison.c++: Fix m4 quoting in comments.
17208
50997c6e
RA
172092002-02-06 Robert Anisko <robert@lrde.epita.fr>
17210
17211 * data/bison.c++: Adjust the parser code. Fix some muscles that were
17212 not expanded by m4.
17213
3f3eed27
AD
172142002-02-05 Akim Demaille <akim@epita.fr>
17215
17216 * data/bison.c++: Adjust to the M4 back end.
17217 More is certainly needed.
17218
be2a1a68
AD
172192002-02-05 Akim Demaille <akim@epita.fr>
17220
17221 Give a try to M4 as a back end.
17222
17223 * lib/readpipe.c: New, from wdiff.
17224 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
17225 BISON_HAIRY.
17226 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
17227 specific values. Now it is m4 that performs the lookup.
17228 * src/parse-skel.y: Remove.
17229 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
17230 * src/output.c (actions_output, guards_output)
17231 (token_definitions_output): No longer keeps track of the output
17232 line number, hence remove the second argument.
17233 (guards_output): Check against the guard member of a rule, not the
17234 action member.
17235 Adjust callers.
17236 (output_skeleton): Don't look for the skeleton location, let m4 do
17237 that.
17238 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
17239 file will be used.
17240 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
17241 (prepare): Given that for the time being changesyntax is not
17242 usable in M4, rename the muscles using `-' to `_'.
17243 Define `defines_flag', `output_parser_name' and `output_header_name'.
17244 * src/output.h (actions_output, guards_output)
17245 (token_definitions_output): Adjust prototypes.
17246 * src/scan-skel.l: Instead of scanning the skeletons, it now
17247 processes the output of m4: `__oline__' and `#output'.
17248 * data/bison.simple: Adjust to be used by M4(sugar).
17249 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
17250 to date.
17251 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
17252 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
17253 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
17254 shamelessly stolen from CVS Autoconf.
17255
beda758b
AD
172562002-02-05 Akim Demaille <akim@epita.fr>
17257
17258 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
17259 * configure.in: Check for the declarations of free and malloc.
17260 * src/muscle_tab.c: Adjust.
17261
5ece6d43
AD
172622002-02-05 Akim Demaille <akim@epita.fr>
17263
17264 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
17265 which have no values.
17266
5bb18f9a
AD
172672002-02-05 Akim Demaille <akim@epita.fr>
17268
17269 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
17270 * data/: here.
17271
894dd62e
PE
172722002-01-29 Paul Eggert <eggert@twinsun.com>
17273
17274 * src/bison.simple (YYSIZE_T): Do not define merely because
17275 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
17276 On some platforms, <alloca.h> does not declare YYSTD (size_t).
17277
82841af7
AD
172782002-01-27 Akim Demaille <akim@epita.fr>
17279
17280 Fix `%nonassoc and eof'.
17281
17282 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
17283 which were not properly copied! Replace
17284 memcpy (res->errs, src->errs, src->nerrs);
17285 with
17286 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
17287 !!!
17288 * tests/regression.at (%nonassoc and eof): Adjust to newest
17289 Autotest: `.' is not in the PATH.
17290
318b76e9
AD
172912002-01-27 Akim Demaille <akim@epita.fr>
17292
17293 * tests/sets.at (AT_EXTRACT_SETS): New.
17294 (Nullable): Use it.
17295 (Firsts): New.
17296
30d2f3d5
AD
172972002-01-26 Akim Demaille <akim@epita.fr>
17298
17299 * tests/actions.at, tests/calc.at, tests/headers.at,
17300 * tests/torture.at: Adjust to the newest Autotest which no longer
17301 forces `.' in the PATH.
17302
30f8c395
AD
173032002-01-25 Akim Demaille <akim@epita.fr>
17304
17305 * tests/regression.at (%nonassoc and eof): New.
17306 Suggested by Robert Anisko.
17307
29ae55f1
AD
173082002-01-24 Akim Demaille <akim@epita.fr>
17309
17310 Bison dumps core when trying to complain about broken input files.
17311 Reported by Cris van Pelt.
17312
17313 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
17314 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
17315 into...
17316 (Invalid inputs): Strengthen: exercise parse_percent_token.
17317
2b548aa6
RA
173182002-01-24 Robert Anisko <robert.anisko@epita.fr>
17319
17320 * src/Makefile.am: Add bison.c++.
17321 * src/bison.c++: New skeleton.
17322
bb0146c2
AD
173232002-01-21 Paolo Bonzini <bonzini@gnu.org>
17324
17325 * po/it.po: New.
17326
bec30531
AD
173272002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
17328
17329 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
17330
fc6edc45
MA
173312002-01-20 Marc Autret <marc@gnu.org>
17332
17333 * src/files.c (compute_output_file_names): Fix
17334
5e5d5415
MA
173352002-01-20 Marc Autret <marc@gnu.org>
17336
17337 * tests/output.at: New test.
17338 * src/files.c (compute_base_names): Don't map extensions when
17339 the YACC flag is set, use defaults.
17340 Reported by Evgeny Stambulchik.
17341
44ea3fbd
MA
173422002-01-20 Marc Autret <marc@gnu.org>
17343
ba0fe3c7
PE
17344 * src/system.h: Need to define __attribute__ away for non-GCC
17345 compilers as well (i.e., the vendor C compiler).
44ea3fbd
MA
17346 Suggested by Albert Chin-A-Young.
17347
338963d1
TVH
173482002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
17349
17350 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
17351 canonical definition.
17352 * src/system.h: Use the canonical definition for PARAMS (avoids
17353 a conflict with the macro from lib/hash.h).
17354
c57b2479
AD
173552002-01-11 Akim Demaille <akim@epita.fr>
17356
17357 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 17358 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 17359
b85810ae
AD
173602002-01-09 Akim Demaille <akim@epita.fr>
17361
17362 * src/files.c, src/files.h (output_infix): New.
17363 (tab_extension): Remove.
17364 (compute_base_names): Compute the former, drop the latter.
17365 * src/output.c (prepare): Insert the muscles `output-infix', and
17366 `output-suffix'.
17367 * src/parse-skel.y (string, string.1): New.
17368 (section.header): Use it.
17369 (section.yacc): Remove.
17370 (prefix): Remove too.
17371 * src/scan-skel.l: Adjust.
17372 * src/bison.simple, src/bison.hairy: Adjust.
17373
cae60122
AD
173742002-01-09 Akim Demaille <akim@epita.fr>
17375
17376 * configure.in (WERROR_CFLAGS): Compute it.
17377 * src/Makefile.am (CFLAGS): Pass it.
17378 * tests/atlocal.in (CFLAGS): Idem.
17379 * src/files.c: Fix a few warnings.
17380 (get_extension_index): Remove, unused.
17381
ae404801
AD
173822002-01-08 Akim Demaille <akim@epita.fr>
17383
17384 * src/getargs.c (AS_FILE_NAME): New.
17385 (getargs): Use it to convert DOSish file names.
17386 * src/files.c (base_name): Rename as full_base_name to avoid
17387 clashes with `base_name ()'.
17388 (filename_split): New.
17389 (compute_base_names): N-th rewrite, using filename_split.
17390
22312b71
AD
173912002-01-08 Akim Demaille <akim@epita.fr>
17392
17393 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
17394 New, stolen from the Fileutils 4.1.
17395 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
17396 * configure.in: Check for the presence of memrchr, and of its
17397 prototype.
17398
a67cef01
TVH
173992002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
17400
17401 * lib/hash.h (__P): Added definition for this macro.
17402 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
17403 BUILT_SOURCES, to ensure they are generated first.
17404 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
17405 %error-verbose to allow bootstrapping with bison 1.30x.
17406
2b25d624
AD
174072002-01-06 Akim Demaille <akim@epita.fr>
17408
17409 * src/reader.c (parse_braces): Don't fetch the next char, the
17410 convention is to fetch on entry.
17411 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
17412 'switch' without a following semicolon.
17413 * tests/regression.at (braces parsing): New.
17414
3460813b
AD
174152002-01-06 Akim Demaille <akim@epita.fr>
17416
17417 Bison is dead wrong in its RR conflict reports.
17418
17419 * tests/torture.at (GNU Cim Grammar): New.
17420 * src/conflicts.c (count_rr_conflicts): Fix.
17421
73784c64
AD
174222002-01-06 Akim Demaille <akim@epita.fr>
17423
17424 Creating package.m4 from configure.ac causes too many problems.
17425
17426 * tests/Makefile.am (package.m4): Create it by hand,
17427 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
17428
25d81090
AD
174292002-01-06 Akim Demaille <akim@epita.fr>
17430
17431 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
17432 skeleton.h.
17433
a9b8959e
PE
174342002-01-04 Paul Eggert <eggert@twinsun.com>
17435
17436 * doc/bison.texinfo (Debugging):
17437 Remove YYSTDERR; it's no longer defined or used.
17438 Also, s/cstdio.h/cstdio/.
17439
25d81090
AD
174402002-01-03 Akim Demaille <akim@epita.fr>
17441
17442 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
17443
1109455c
AD
174442002-01-03 Akim Demaille <akim@epita.fr>
17445
17446 * src/parse-skel.y (process_skeleton): Don't bind the parser's
17447 tracing code to --trace, wait for a better --trace option, with
17448 args.
17449
7ea5e977
AD
174502002-01-03 Akim Demaille <akim@epita.fr>
17451
17452 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
17453 The ISO C++ standard is extremely clear about it: stderr is
17454 considered a macro, not a regular symbol (see table 94 `Header
17455 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
17456 Therefore std:: does not apply to it. It still does with fprintf.
17457 Also, s/cstdio.h/cstdio/.
17458
fab5b110
AD
174592002-01-03 Akim Demaille <akim@epita.fr>
17460
17461 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
17462 for non system headers.
17463
aed7fd9b
AD
174642002-01-02 Akim Demaille <akim@epita.fr>
17465
17466 Equip the skeleton chain with location tracking, runtime trace,
17467 pure parser and scanner.
17468
17469 * src/parse-skel.y: Request a pure parser, locations, and prefix
17470 renaming.
17471 (%union): Having several members with the same type does not help
17472 type mismatches, simplify.
17473 (YYPRINT, yyprint): New.
17474 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
17475 (skel_error): this.
17476 Handle locations.
17477 * src/scan-skel.l: Adjust to these changes.
17478 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
17479 (LOCATION_PRINT, skel_control_t): New.
17480
24fad99e
AD
174812001-12-30 Akim Demaille <akim@epita.fr>
17482
17483 * src/parse-skel.y: Get rid of the shift/reduce conflict:
17484 replace `gb' with BLANKS.
17485 * src/scan-skel.l: Adjust.
17486
a4b36db4
AD
174872001-12-30 Akim Demaille <akim@epita.fr>
17488
17489 * src/system.h: We don't need nor want bcopy.
17490 Throw away MS-DOS crap: we don't need getpid.
17491 * configure.in: We don't need strndup. It was even causing
17492 problems: because Flex includes the headers *before* us,
17493 _GNU_SOURCE is not defined by config.h, and therefore strndup was
17494 not visible.
17495 * lib/xstrndup.c: New.
17496 * src/scan-skel.l: Use it.
17497 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
17498 * src/parse-skel.y: Use %directives instead of #defines.
17499
1239777d
AD
175002001-12-30 Akim Demaille <akim@epita.fr>
17501
17502 * src/skeleton.h: New.
17503 * src/output.c (output_parser, output_master_parser): Remove, dead
17504 code.
17505 * src/output.h (get_lines_number, actions_output, guards_output)
17506 (token_definitions_output): Prototype them.
17507 * src/parse-skel.y: Add the license notice.
17508 Include output.h and skeleton.h.
17509 (process_skeleton): Returns void, and takes a single parameter.
17510 * src/scan-skel.l: Add the license notice.
17511 Include skeleton.h.
17512 Don't use %option yylineno: it seems that then Flex imagines
17513 REJECT has been used, and therefore it won't reallocate its
17514 buffers (which makes no other sense to me than a bug). It results
17515 in warnings for `unused: yy_flex_realloc'.
17516
9b3add5b
RA
175172001-12-30 Robert Anisko <robert.anisko@epita.fr>
17518
17519 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
17520 (MUSCLE_INSERT_PREFIX): ...to there.
17521 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
17522 (MUSCLE_INSERT_PREFIX): Move from here...
17523
17524 * src/bison.hairy: Add a section directive. Put braces around muscle
17525 names. This parser skeleton is still broken, but Bison should not
17526 choke on a bad muscle 'syntax'.
17527 * src/bison.simple: Add a section directive. Put braces around muscle
17528 names.
17529
17530 * src/files.h (strsuffix, stringappend): Add declarations.
17531 (tab_extension): Add declaration.
17532 (short_base_name): Add declaration.
17533
17534 * src/files.c (strsuffix, stringappend): No longer static. These
17535 functions are used in the skeleton parser.
17536 (tab_extension): New.
17537 (compute_base_names): Use the computations done in this function
fab5b110 17538 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
17539 names.
17540 (short_base_name): No longer static.
17541
17542 * src/output.c (output_skeleton): New.
17543 (output): Disable call to output_master_parser, and give a try to
17544 a new skeleton handling system.
17545 (guards_output, actions_output): No longer static.
17546 (token_definitions_output, get_lines_number): No longer static.
17547
17548 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
17549
fab5b110 17550 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
17551 parse-skel.y.
17552
17553 * src/parse-skel.y: New file.
17554 * src/scan-skel.l: New file.
17555
b5b61c61
AD
175562001-12-29 Akim Demaille <akim@epita.fr>
17557
17558 %name-prefix is broken.
17559
17560 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
17561 Adjust all dependencies.
17562 * tests/headers.at (export YYLTYPE): Strengthen this test: use
17563 %name-prefix.
17564
17565 Renaming yylval but not yylloc is not consistent. Now we do.
17566
17567 * src/bison.simple: Prefix yylloc if used.
17568 * doc/bison.texinfo (Decl Summary): Document that.
17569
8c9a50be
AD
175702001-12-29 Akim Demaille <akim@epita.fr>
17571
17572 * doc/bison.texinfo: Promote `%long-directive' over
17573 `%long_directive'.
17574 Remove all references to fixed-output-files, yacc is enough.
17575
d99361e6
AD
175762001-12-29 Akim Demaille <akim@epita.fr>
17577
17578 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
17579 user prologue. These are defaults.
17580 * tests/actions.at (Mid-rule actions): Make sure the user can
17581 define YYDEBUG and YYERROR_VERBOSE.
17582
b9cecb91
AD
175832001-12-29 Akim Demaille <akim@epita.fr>
17584
17585 * src/output.c (header_output): Don't forget to export YYLTYPE and
17586 yylloc.
17587 * tests/headers.at (export YYLTYPE): New, make sure it does.
17588 * tests/regression.at (%union and --defines, Invalid CPP headers):
17589 Move to...
17590 * tests/headers.at: here.
17591
aea13e97
AD
175922001-12-29 Akim Demaille <akim@epita.fr>
17593
17594 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
17595
931394cb
AD
175962001-12-29 Akim Demaille <akim@epita.fr>
17597
17598 * tests/actions.at (Mid-rule actions): Output on a single line
17599 instead of several.
17600
704a47c4
AD
176012001-12-29 Akim Demaille <akim@epita.fr>
17602
17603 * doc/bison.texinfo: Formatting changes.
17604
091e20bb
AD
176052001-12-29 Akim Demaille <akim@epita.fr>
17606
17607 Don't store the token defs in a muscle, just be ready to output it
17608 on command. Now possible via `symbols'. Fixes a memory leak.
17609
17610 * src/output.c (token_definitions_output): New.
17611 (output_parser, header_output): Use it.
17612 * src/reader.c (symbols_save): Remove.
17613
cce71710
AD
176142001-12-29 Akim Demaille <akim@epita.fr>
17615
17616 * src/bison.simple: Do not provide a default for YYSTYPE and
17617 YYLTYPE before the user's prologue. Otherwise it's hardly... a
17618 default.
17619
82c035a8
AD
176202001-12-29 Akim Demaille <akim@epita.fr>
17621
17622 Mid-rule actions are simply... ignored!
17623
17624 * src/reader.c (readgram): Be sure to attach mid-rule actions to
17625 the empty-rule associated to the dummy symbol, not to the host
17626 rule.
17627 * tests/actions.at (Mid-rule actions): New.
17628
8419d367
AD
176292001-12-29 Akim Demaille <akim@epita.fr>
17630
17631 Memory leak.
17632
17633 * src/reader.c (reader): Free grammar.
17634
375d5806
AD
176352001-12-29 Akim Demaille <akim@epita.fr>
17636
17637 Memory leak.
17638
17639 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
17640 since it allocates it for each state, although only one is needed.
17641 (allocate_storage): Do it here.
17642
f51cb8ff
AD
176432001-12-29 Akim Demaille <akim@epita.fr>
17644
17645 * src/options.h, src/options.c (create_long_option_table): Rename
17646 as...
17647 (long_option_table_new): this, with a clearer prototype.
17648 (percent_table): Remove, unused,
17649 * src/getargs.c (getargs): Adjust.
17650
29e88316
AD
176512001-12-29 Akim Demaille <akim@epita.fr>
17652
17653 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
17654 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
17655 as states.
17656
b9f71f19
AD
176572001-12-29 Akim Demaille <akim@epita.fr>
17658
17659 * src/lalr.c (build_relations): Rename `states' as `states1'.
17660 Sorry, I don't understand exactly what it is, no better name...
17661
1a2b5d37
AD
176622001-12-29 Akim Demaille <akim@epita.fr>
17663
17664 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
17665 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
17666 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
17667 as rules.
17668
1cca533e
AD
176692001-12-29 Akim Demaille <akim@epita.fr>
17670
17671 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
17672 ago.
17673
c03ae966
AD
176742001-12-29 Akim Demaille <akim@epita.fr>
17675
17676 * src/reader.c, src/reader.h (user_toknums): Remove.
17677 Adjust all users to use symbols[i]->user_token_number.
17678
5a670b1e
AD
176792001-12-29 Akim Demaille <akim@epita.fr>
17680
17681 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
17682 Adjust all users to use symbols[i]->prec or ->assoc.
17683
ad949da9
AD
176842001-12-29 Akim Demaille <akim@epita.fr>
17685
17686 * src/reader.c, src/reader.h (tags): Remove.
17687 Adjust all users to use symbols[i]->tag.
17688
0e78e603
AD
176892001-12-29 Akim Demaille <akim@epita.fr>
17690
17691 * src/gram.h, src/gram.c (symbols): New, similar to state_table
17692 and rule_table.
17693 * src/reader.c (packsymbols): Fill this table.
17694 Drop sprec.
17695 * src/conflicts.c (resolve_sr_conflict): Adjust.
17696 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
17697 single table.
17698 Use symbols[i]->tag instead of tags[i].
17699
213e640e
AD
177002001-12-29 Akim Demaille <akim@epita.fr>
17701
17702 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
17703 In addition, put a comment in there, to replace...
17704 * tests/regression.at (%union and C comments): Remove.
17705
e7b8bef1
AD
177062001-12-29 Akim Demaille <akim@epita.fr>
17707
17708 * tests/regression.at (Web2c Actions): Blindly move the actual
17709 output as expected output. The contents *seem* right to me, but I
17710 can't pretend reading perfectly parser tables... Nonetheless, all
17711 the other tests pass correctly, the table look OK, even though the
17712 presence of `$axiom' is to be noted: AFAICS it is useless (but
17713 harmless).
17714
b68e7744
AD
177152001-12-29 Akim Demaille <akim@epita.fr>
17716
17717 * src/reader.c (readgram): Don't add the rule 0 if there were no
17718 rules read. In other words, add it _after_ having performed
17719 grammar sanity checks.
17720 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
17721
78d5bae9
AD
177222001-12-29 Akim Demaille <akim@epita.fr>
17723
17724 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
17725 visible, and some states have now a different number.
17726
ff442794
AD
177272001-12-29 Akim Demaille <akim@epita.fr>
17728
17729 * src/reader.c (readgram): Bind the initial rule's lineno to that
17730 of the first rule.
17731 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
17732 (Solved SR Conflicts): Adjust rule 0's line number.
17733
610ab194
AD
177342001-12-29 Akim Demaille <akim@epita.fr>
17735
17736 Fix the `GAWK Grammar' failure.
17737
17738 * src/LR0.c (final_state): Initialize to -1 so that we do compute
17739 the reductions of the first state which was mistakenly confused
17740 with the final state because precisely final_state was initialized
17741 to 0.
17742 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
17743 now noticed by Bison.
17744 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
17745 have a reduction on $default.
17746
29d29c8f
AD
177472001-12-29 Akim Demaille <akim@epita.fr>
17748
17749 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
17750 rule line numbers.
17751 * src/closure.c (print_closure): Likewise.
17752 * src/derives.c (print_derives): Likewise.
17753 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
17754 now.
17755
7c6b64d0
AD
177562001-12-29 Akim Demaille <akim@epita.fr>
17757
17758 * src/lalr.c (lookaheads_print): New.
17759 (lalr): Call it when --trace-flag.
17760 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
17761 are dumped.
17762
3d4daee3
AD
177632001-12-29 Akim Demaille <akim@epita.fr>
17764
17765 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
17766 when walking through ritem, even via rule->rhs.
17767 * src/reduce.c (dump_grammar, useful_production, reduce_output)
17768 (useful_production, useless_nonterminals): Likewise.
17769 (reduce_grammar_tables): Likewise, plus update nritems.
17770 * src/nullable.c (set_nullable): Likewise.
17771 * src/lalr.c (build_relations): Likewise.
17772 * tests/sets.at (Nullable): Adjust.
17773 Fortunately, now, the $axiom is no longer nullable.
17774
9e7f6bbd
AD
177752001-12-29 Akim Demaille <akim@epita.fr>
17776
17777 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
17778 the 0-sentinel.
17779 * src/gram.c (ritem_longest_rhs): Likewise.
17780 * src/reduce.c (nonterminals_reduce): Likewise.
17781 * src/print_graph.c (print_graph): Likewise.
17782 * src/output.c (output_rule_data): Likewise.
17783 * src/nullable.c (set_nullable): Likewise.
17784
255ef638
AD
177852001-12-29 Akim Demaille <akim@epita.fr>
17786
17787 * src/output.c: Comment changes.
17788
0d8a7363
AD
177892001-12-27 Paul Eggert <eggert@twinsun.com>
17790
17791 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
17792 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
17793 Sparc, as they were causing more porting problems than the
17794 (minor) performance improvement was worth.
17795
17796 Also, catch up with 1.31's YYSTD.
17797
3db472b9
AD
177982001-12-27 Akim Demaille <akim@epita.fr>
17799
17800 * src/output.c (output_gram): Rely on nritems, not the
17801 0-sentinel. See below.
17802 Use -1 as separator, not 0.
17803 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
17804 Rely on -1 as separator in yyrhs, instead of 0.
17805 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
17806 twice `Now at end of input', therefore there are two lines less to
17807 expect.
17808
b365aa05
AD
178092001-12-27 Akim Demaille <akim@epita.fr>
17810
17811 * tests/regression.at (Unresolved SR Conflicts):
17812 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
17813 below.
17814
30171f79
AD
178152001-12-27 Akim Demaille <akim@epita.fr>
17816
17817 * src/LR0.c (new_state): Recognize the final state by the fact it
17818 is reached by eoftoken.
17819 (insert_start_shifting_state, insert_eof_shifting_state)
17820 (insert_accepting_state, augment_automaton): Remove, since now
17821 these states are automatically computed from the initial state.
17822 (generate_states): Adjust.
17823 * src/print.c: When reporting a rule number to the user, substract
17824 1, so that the axiom rule is rule 0, and the first user rule is 1.
17825 * src/reduce.c: Likewise.
17826 * src/print_graph.c (print_core): For the time being, just as for
17827 the report, depend upon --trace-flags to dump the full set of
17828 items.
17829 * src/reader.c (readgram): Once the grammar read, insert the rule
17830 0: `$axiom: START-SYMBOL $'.
17831 * tests/set.at: Adjust: rule 0 is now displayed, and since the
17832 number of the states has changed (the final state is no longer
17833 necessarily the last), catch up.
17834
75142d45
AD
178352001-12-27 Akim Demaille <akim@epita.fr>
17836
17837 Try to make the use of the eoftoken valid. Given that its value
17838 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
17839 is used instead of > 0 where appropriate, (ii), depend upon nritems
17840 instead of the 0-sentinel.
17841
17842 * src/gram.h, src/gram.c (nritems): New.
17843 Expected to be duplication of nitems, but for the time being...
17844 * src/reader.c (packgram): Assert nritems and nitems are equal.
17845 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
17846 * src/closure.c (print_closure, print_fderives): Likewise.
17847 * src/gram.c (ritem_print): Likewise.
17848 * src/print.c (print_core, print_grammar): Likewise.
17849 * src/print_graph.c: Likewise.
17850
b7c49edf
AD
178512001-12-27 Akim Demaille <akim@epita.fr>
17852
17853 * src/main.c (main): If there are complains after grammar
17854 reductions, then output the report anyway if requested, then die.
17855 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
17856 * src/reader.c (eoftoken): New.
17857 (parse_token_decl): If the token being defined has value `0', it
17858 is the eoftoken.
17859 (packsymbols): No longer hack `tags' to insert `$' by hand.
17860 Be sure to preserve the value of the eoftoken.
17861 (reader): Make sure eoftoken is defined.
17862 Initialize nsyms to 0: now eoftoken is created just like the others.
17863 * src/print.c (print_grammar): Don't special case the eof token.
17864 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
17865 lie anyway, albeit pleasant.
17866 * tests/calc.at: Exercise error messages with eoftoken.
17867 Change the grammar so that empty input is invalid.
17868 Adjust expectations.
17869 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
17870
ec2da99f
AD
178712001-12-27 Akim Demaille <akim@epita.fr>
17872
17873 * configure.in: Check the protos of strchr ans strspn.
17874 Replace strchr if needed.
17875 * src/system.h: Provide the protos of strchr, strspn and memchr if
17876 missing.
17877 * lib/strchr.c: New.
17878 * src/reader.c (symbols_save): Use strchr.
17879
8adfa272
AD
178802001-12-27 Akim Demaille <akim@epita.fr>
17881
17882 * src/print.c, src/print_graph.c (escape): New.
17883 Use it to quote the TAGS outputs.
17884 * src/print_graph.c (print_state): Now errors are in red, and
17885 reductions in green.
17886 Prefer high to wide: output the state number on a line of its own.
17887
80dac38c
AD
178882001-12-27 Akim Demaille <akim@epita.fr>
17889
17890 * src/state.h, src/state.c (reductions_new): New.
17891 * src/LR0.c (set_state_table): Let all the states have a
17892 `reductions', even if reduced to 0.
17893 (save_reductions): Adjust.
17894 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
17895 * src/print.c (print_reductions, print_actions): Adjust.
17896 * src/output.c (action_row): Adjust.
17897
2cec70b9
AD
178982001-12-27 Akim Demaille <akim@epita.fr>
17899
17900 * src/state.h, src/state.c (errs_new, errs_dup): New.
17901 * src/LR0.c (set_state_table): Let all the states have an errs,
17902 even if reduced to 0.
17903 * src/print.c (print_errs, print_reductions): Adjust.
17904 * src/output.c (output_actions, action_row): Adjust.
17905 * src/conflicts.c (resolve_sr_conflict): Adjust.
17906
13ca549a
AD
179072001-12-27 Akim Demaille <akim@epita.fr>
17908
17909 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
17910
5092aba5
AD
179112001-12-27 Akim Demaille <akim@epita.fr>
17912
17913 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
17914 * src/print.c: here.
17915 (lookaheadset, shiftset): New, used as additional storage by
17916 print_reductions.
17917 (print_results): Adjust.
17918 (print_shifts, print_gotos, print_errs): New, extracted from...
17919 (print_actions): here.
17920 * src/print_graph.c (print_actions): Remove dead code.
17921
11e2beca
AD
179222001-12-27 Akim Demaille <akim@epita.fr>
17923
17924 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
17925 `$n' and `@n'.
17926
dac3c910
AD
179272001-12-27 Akim Demaille <akim@epita.fr>
17928
17929 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
17930 (build_relations): Adjust.
17931
d0b0fefa
AD
179322001-12-27 Akim Demaille <akim@epita.fr>
17933
17934 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
17935 duplication.
17936
adc8c848
AD
179372001-12-27 Akim Demaille <akim@epita.fr>
17938
17939 * src/reader.c (packgram): Catch nitems overflows.
17940
14d293ac
AD
179412001-12-27 Akim Demaille <akim@epita.fr>
17942
17943 * src/files.c, src/files.h (guard_obstack): Remove.
17944 * src/output.c (output): Adjust.
17945 * src/reader.c (parse_braces): New, factoring...
17946 (copy_action, copy_guard): these two which are renamed as...
17947 (parse_action, parse_guard): these.
17948 As a voluntary consequence, using braces around guards is now
17949 mandatory.
17950
f499b062
AD
179512001-12-27 Akim Demaille <akim@epita.fr>
17952
17953 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
17954 * src/reader.c (symbol_list): `guard' and `guard_line' are new
17955 members.
17956 (symbol_list_new): Adjust.
17957 (copy_action): action_line is the first line, not the last.
17958 (copy_guard): Just as for actions, store the `action' only, not
17959 the switch/case/break flesh.
17960 Don't parse the user action that might follow the guard, let...
17961 (readgram): do it, i.e., now, there can be an action after a
17962 guard.
17963 In other words the guard is just explicitly optional.
17964 (packgram): Adjust.
17965 * src/output.c (guards_output): New.
17966 (output_parser): Call it when needed.
17967 (output): Also free the guard and attrs obstacks.
17968 * src/files.c, src/files.h (obstack_save): Remove.
17969 (output_files): Remove.
17970 As a result, if one needs the former `.act' file, using an
17971 appropriate skeleton which requires actions and guards is now
17972 required.
17973 * src/main.c (main): Adjust.
17974 * tests/semantic.at: New.
17975 * tests/regression.at: Use `input.y' as input file name.
17976 Avoid 8+3 problems by requiring input.c when the test needs the
17977 parser.
17978
d945f5cd
AD
179792001-12-27 Akim Demaille <akim@epita.fr>
17980
17981 * src/reader.c (symbol_list_new): Be sure to initialize all the
17982 fields.
17983
d200e455
AD
179842001-12-27 Akim Demaille <akim@epita.fr>
17985
17986 All the hacks using a final pseudo state are now useless.
17987
17988 * src/LR0.c (set_state_table): state_table holds exactly nstates.
17989 * src/lalr.c (nLA): New.
17990 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
17991 instead of lookaheadsp from the pseudo state (nstate + 1).
17992
f9507c28
AD
179932001-12-27 Akim Demaille <akim@epita.fr>
17994
17995 * src/output.c (action_row, token_actions): Use a state_t instead
17996 of a integer, and nlookaheads instead of the following state's
17997 lookaheadsp.
17998
065fbd27
AD
179992001-12-27 Akim Demaille <akim@epita.fr>
18000
18001 * src/conflicts.c (log_resolution, flush_shift)
18002 (resolve_sr_conflict, set_conflicts, solve_conflicts)
18003 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
18004 (conflicts_print, print_reductions): Use a state_t instead of an
18005 integer when referring to a state.
18006 As much as possible, depend upon nlookaheads, instead of the
18007 `lookaheadsp' member of the following state (since lookaheads of
18008 successive states are successive, the difference between state n + 1
18009 and n served as the number of lookaheads for state n).
18010 * src/lalr.c (add_lookback_edge): Likewise.
18011 * src/print.c (print_core, print_actions, print_state)
18012 (print_results): Likewise.
18013 * src/print_graph.c (print_core, print_actions, print_state)
18014 (print_graph): Likewise.
18015 * src/conflicts.h: Adjust.
18016
1b177bd7
AD
180172001-12-27 Akim Demaille <akim@epita.fr>
18018
18019 * src/bison.hairy: Formatting/comment changes.
18020 ANSIfy.
18021 Remove `register' indications.
18022 Add plenty of `static'.
18023
7742ddeb
AD
180242001-12-27 Akim Demaille <akim@epita.fr>
18025
18026 * src/output.c (prepare): Drop the muscle `ntbase' which
18027 duplicates ntokens.
18028 * src/bison.simple: Formatting/comment changes.
18029 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
18030 is an undocumented synonym.
18031
1fa14068
AD
180322001-12-22 Akim Demaille <akim@epita.fr>
18033
18034 * src/output.c (output_table_data): Change the prototype to use
18035 `int' for array ranges: some invocations do pass an int, not a
18036 short.
18037 Reported by Wayne Green.
18038
b9752825
AD
180392001-12-22 Akim Demaille <akim@epita.fr>
18040
18041 Some actions of web2c.y are improperly triggered.
18042 Reported by Mike Castle.
18043
18044 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
18045 * tests/regression.at (Web2c): Rename as...
18046 (Web2c Report): this.
18047 (Web2c Actions): New.
18048
776209d6
AD
180492001-12-22 Akim Demaille <akim@epita.fr>
18050
18051 Reductions in web2c.y are improperly reported.
18052 Reported by Mike Castle.
18053
18054 * src/conflicts.c (print_reductions): Fix.
18055 * tests/regression.at (Web2c): New.
18056
275fc3ad
AD
180572001-12-18 Akim Demaille <akim@epita.fr>
18058
18059 Some host fail on `assert (!"foo")', which expands to
18060 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
18061 Reported by Nelson Beebee.
18062
18063 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
18064 `#define it_succeeded 0' and `assert (it_succeeded)'.
18065
897668ee
MA
180662001-12-17 Marc Autret <autret_m@epita.fr>
18067
18068 * src/bison.simple: Don't hard code the skeleton line and filename.
18069 * src/output.c (output_parser): Rename 'line' as 'output_line'.
18070 New line counter 'skeleton_line' (skeleton-line muscle).
18071
ab3399e0
PE
180722001-12-17 Paul Eggert <eggert@twinsun.com>
18073
18074 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
18075 YYDEBUG must be defined to a nonzero value.
18076
18077 * src/bison.simple (yytname): Do not assume that the user defines
18078 YYDEBUG to a properly parenthesized expression.
18079
3877f72b
AD
180802001-12-17 Akim Demaille <akim@epita.fr>
18081
18082 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
18083 nlookaheads is a new member.
18084 Adjust all users.
18085 * src/lalr.h (nlookaheads): Remove this orphan declaration.
18086 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
18087 state.
776209d6 18088
331dbc1b
AD
180892001-12-17 Akim Demaille <akim@epita.fr>
18090
18091 * src/files.h, src/files.c (open_files, close_files): Remove.
18092 * src/main.c (main): Don't open/close files, nor invoke lex_free,
18093 let...
18094 * src/reader.c (reader): Do it.
776209d6 18095
be750e4c
AD
180962001-12-17 Akim Demaille <akim@epita.fr>
18097
18098 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 18099
709ae8c6
AD
181002001-12-17 Akim Demaille <akim@epita.fr>
18101
18102 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
18103 (flush_reduce): New.
18104 (resolve_sr_conflict): Adjust.
776209d6 18105
f87685c3
AD
181062001-12-17 Akim Demaille <akim@epita.fr>
18107
18108 * src/output.c (output_obstack): Be static and rename as...
18109 (format_obstack): this, to avoid any confusion with files.c's
18110 output_obstack.
18111 * src/reader.h (muscle_obstack): Move to...
18112 * src/output.h: here, since it's defined in output.c.
18113
837491d8
AD
181142001-12-17 Akim Demaille <akim@epita.fr>
18115
18116 * src/output.c (action_row, save_column, default_goto)
18117 (sort_actions, matching_state, pack_vector): Better variable
18118 locality.
18119
796d61fb
AD
181202001-12-17 Akim Demaille <akim@epita.fr>
18121
18122 * src/output.c: Various formatting changes.
776209d6 18123
64d15509
AD
181242001-12-17 Akim Demaille <akim@epita.fr>
18125
18126 * src/files.c (output_files): Free the output_obstack.
18127 * src/main.c (main): Call print and print_graph conditionally.
18128 * src/print.c (print): Work unconditionally.
18129 * src/print_graph.c (print_graph): Work unconditionally.
18130 * src/conflicts.c (log_resolution): Output only if verbose_flag.
18131
fbc8ecb7
MA
181322001-12-16 Marc Autret <autret_m@epita.fr>
18133
18134 * src/output.c (actions_output): Fix. When we use %no-lines,
18135 there is one less line per action.
18136
f0440388
MA
181372001-12-16 Marc Autret <autret_m@epita.fr>
18138
18139 * src/bison.simple: Remove a useless #line directive.
18140 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
18141 * src/output.c (get_lines_number): New.
776209d6 18142 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
18143 output muscles.
18144 Fix line numbering.
18145 (actions_output): Computes the number of lines taken by actions.
18146 (output_master_parser): Insert new skeleton which is the name of
18147 the output parser file name.
18148
a79986b8
MA
181492001-12-15 Marc Autret <autret_m@epita.fr>
18150
18151 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
18152
4ec8e00f
MA
181532001-12-15 Marc Autret <autret_m@epita.fr>
18154
18155 * src/output.c (output_gram): Keep track of the hairy one.
18156
1a4648ff
AD
181572001-12-15 Akim Demaille <akim@epita.fr>
18158
18159 Make `make distcheck' work.
18160
18161 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
18162 system.h which uses libgettext.h.
18163
9c2c67e6
AD
181642001-12-15 Akim Demaille <akim@epita.fr>
18165
18166 * src/nullable.c (set_nullable): Useless rules must be skipped,
18167 otherwise, since we range over their symbols, we might look at a
18168 nonterminal which no longer ``exists'', i.e., it is not counted in
18169 `nvars', hence we overflow our arrays.
18170
93ede233
AD
181712001-12-15 Akim Demaille <akim@epita.fr>
18172
18173 The header can also be produced directly, without any obstack!
18174 Yahoo!
18175
18176 * src/files.c, src/files.h (defines_obstack): Remove.
18177 (compute_header_macro): Global.
18178 (defines_obstack_save): Remove.
18179 * src/reader.c (parse_union_decl): No longer output to
18180 defines_obstack: its content can be found in the `stype' muscle
18181 anyway.
18182 (output_token_translations): Merge into...
18183 (symbols_output): this.
18184 Rename as...
18185 (symbols_save): this.
18186 (reader): Adjust.
18187 * src/output.c (header_output): New.
18188 (output): Call it.
18189
2666f928
AD
181902001-12-15 Akim Demaille <akim@epita.fr>
18191
18192 * src/reader.c (parse_union_decl): Instead of handling two obstack
18193 simultaneously, use one to define the `stype' muscle, and use the
18194 value of the latter to fill defines_obstack.
18195 (copy_comment): Remove.
18196 (copy_comment2): Work for a single obstack.
18197 Rename as...
18198 (copy_comment): this.
18199
428046f8
AD
182002001-12-15 Akim Demaille <akim@epita.fr>
18201
18202 * src/lex.c, src/lex.h (xgetc): No longer static.
18203 * src/reader.c (parse_union_decl): Revamp.
18204
ea52d706
AD
182052001-12-15 Akim Demaille <akim@epita.fr>
18206
18207 Still making progress in separating Bison into (i) input, (ii)
18208 process, (iii) output: now we can directly output the parser file
18209 without using table_obstack at all.
18210
18211 * src/files.c, src/files.h (table_obstack): Bye bye.
18212 (parser_file_name): New.
18213 * src/files.c (compute_output_file_names): Compute it.
18214 * src/output.c (actions_output, output_parser)
18215 (output_master_parser): To a file instead of an obstack.
18216
3f96f4dc
AD
182172001-12-15 Akim Demaille <akim@epita.fr>
18218
18219 Attach actions to rules, instead of pre-outputting them to
18220 actions_obstack.
18221
18222 * src/gram.h (rule_t): action and action_line are new members.
18223 * src/reader.c (symbol_list): Likewise.
18224 (copy_action): Save the actions within the rule.
18225 (packgram): Save them in rule_table.
18226 * src/output.c (actions_output): New.
18227 (output_parser): Use it on `%%actions'.
18228 (output_rule_data): Don't free rule_table.
18229 (output): Do it.
18230 (prepare): Don't save the `action' muscle.
18231 * src/bison.simple: s/%%action/%%actions/.
18232
51576fb3
AD
182332001-12-15 Akim Demaille <akim@epita.fr>
18234
18235 * src/reader.c (copy_action): When --yacc, don't append a `;'
18236 to the user action: let it fail if lacking.
dee049eb 18237 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 18238
2648a72d
AD
182392001-12-14 Akim Demaille <akim@epita.fr>
18240
18241 * src/lex.c (literalchar): Simply return the char you decoded, non
18242 longer mess around with obstacks and int pointers.
18243 Adjust all callers.
18244
92790e5b
AD
182452001-12-14 Akim Demaille <akim@epita.fr>
18246
18247 * src/lex.c (literalchar): Don't escape the special characters,
18248 just decode them, and keep them as char (before, eol was output as
18249 the 2 char string `\n' etc.).
18250 * src/output.c (output_rule_data): Use quotearg to output the
18251 token strings.
18252
927c1557
PE
182532001-12-13 Paul Eggert <eggert@twinsun.com>
18254
18255 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
18256 Do not infringe on the global user namespace when using C++.
18257 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
18258 All uses of `fprintf' and `stderr' changed.
18259
18260 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
18261
ed8e1f68
AD
182622001-12-13 Akim Demaille <akim@epita.fr>
18263
18264 The computation of nullable is broken: it doesn't handle empty
18265 RHS's properly.
18266
18267 * tests/torture.at (GNU AWK Grammar): New.
18268 * tests/sets.at (Nullable): New.
18269 * src/nullable.c (set_nullable): Instead of blindly looping over
18270 `ritems', loop over the rules, and then over their rhs's.
18271
18272 Work around Autotest bugs.
18273
18274 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
18275 frame, because Autotest understand lines starting with a `+' as
18276 traces from the shell. Then, they are not processed properly.
18277 Admittedly an Autotest bug, but we don't have time to wait for
18278 Autotest to catch up.
18279 * tests/regression.at (Broken Closure): Adjust to the new table
18280 frames.
18281 Move to...
18282 * tests/sets.at: here.
18283
cb581495
AD
182842001-12-13 Akim Demaille <akim@epita.fr>
18285
18286 * src/closure.c (closure): Use nrules instead of playing tricks
18287 with BITS_PER_WORD.
18288
2e729273
AD
182892001-12-13 Akim Demaille <akim@epita.fr>
18290
18291 * src/print.c (print_actions): Output the handling of `$' as the
18292 traces do: shifting the token EOF. Before EOF was treated as a
18293 nonterminal.
18294 * tests/regression.at: Adjust some tests.
18295 * src/print_graph.c (print_core): Complete the set of items via
18296 closure. The next-to-final and final states are still unsatisfying,
18297 but that's to be addressed elsewhere.
18298 No longer output the rule numbers, but do output the state number.
18299 A single loop for the shifts + gotos is enough, but picked a
18300 distinct color for each.
18301 (print_graph): Initialize and finalize closure.
18302
107f7dfb
AD
183032001-12-13 Akim Demaille <akim@epita.fr>
18304
18305 * src/reader.c (readgram): Remove dead code, an strip useless
18306 braces.
18307 (get_type): Remove, unused.
18308
9b53a24f
AD
183092001-12-12 Akim Demaille <akim@epita.fr>
18310
18311 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
18312 on that of lib/error.c.
18313
dbfb6dcd
AD
183142001-12-12 Akim Demaille <akim@epita.fr>
18315
18316 Some hosts don't like `/' in includes.
18317
18318 * src/system.h: Include libgettext.h without qualifying the path.
18319 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
18320 $(top_srcdir).
18321
c25fb648
MA
183222001-12-11 Marc Autret <autret_m@epita.fr>
18323
18324 * src/output.c (output_parser): Remove useless muscle.
18325
710ddc4f
MA
183262001-12-11 Marc Autret <autret_m@epita.fr>
18327
18328 * src/bison.simple: Remove #line just before %%epilogue. It
18329 is now handled in ...
18330 * src/reader.c (read_additionnal_code): Add the output of a
18331 #line for the epilogue.
18332
e83d80b8
MA
183332001-12-10 Marc Autret <autret_m@epita.fr>
18334
927c1557 18335 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
18336 replace precedent remove.
18337 * src/bison.simple: Remove #line before %%prologue because
18338 %%input-line is wrong at this time.
18339
971d5158
MA
183402001-12-10 Marc Autret <autret_m@epita.fr>
18341
18342 * src/reader.c (symbols_output): Clean up.
927c1557 18343 * src/output.c (output_gram, output): Clean up.
971d5158 18344
5edafffd
AD
183452001-12-10 Akim Demaille <akim@epita.fr>
18346
18347 * src/lalr.c (initialize_lookaheads): New. Extracted from...
18348 * src/LR0.c (set_state_table): here.
18349 * src/lalr.c (lalr): Call it.
18350
0279f8e9
AD
183512001-12-10 Akim Demaille <akim@epita.fr>
18352
18353 * src/state.h (shifts): Remove the `number' member: shifts are
18354 attached to state, hence no longer need to be labelled with a
18355 state number.
18356
190c4f5f
AD
183572001-12-10 Akim Demaille <akim@epita.fr>
18358
18359 Now that states have a complete set of members, the linked list of
18360 shifts is useless: just fill directly the state's shifts member.
18361
18362 * src/state.h (shifts): Remove the `next' member.
18363 * src/LR0.c (first_state, last_state): Remove.
18364 Adjust the callers.
18365 (augment_automaton): Don't look for the shifts that must be added
18366 a shift on EOF: it is those of the state we looked for! But now,
18367 since shifts are attached, it is no longer needed to looking
18368 merely by its id: its number.
18369
2a73b93d
AD
183702001-12-10 Akim Demaille <akim@epita.fr>
18371
18372 * src/LR0.c (augment_automaton): Better variable locality.
18373 Remove an impossible branch: if there is a state corresponding to
18374 the start symbol being shifted, then there is shift for the start
18375 symbol from the initial state.
18376
74392f6a
AD
183772001-12-10 Akim Demaille <akim@epita.fr>
18378
18379 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
18380 only when appropriate: when insert_start_shifting_state' is not
18381 invoked.
18382 * tests/regression.at (Rule Line Numbers): Adjust.
18383
37c82725
AD
183842001-12-10 Akim Demaille <akim@epita.fr>
18385
18386 * src/LR0.c (augment_automaton): Now that all states have shifts,
18387 merge the two cases addition shifts to the initial state.
18388
6a164e0c
AD
183892001-12-10 Akim Demaille <akim@epita.fr>
18390
18391 * src/lalr.c (set_state_table): Move to...
18392 * src/LR0.c: here.
18393 * src/lalr.c (lalr): Don't call it...
18394 * src/LR0.c (generate_states): do it.
18395 * src/LR0.h (first_state): Remove, only the table is used.
18396
7215de24
AD
183972001-12-10 Akim Demaille <akim@epita.fr>
18398
18399 * src/LR0.h (first_shift, first_reduction): Remove.
18400 * src/lalr.c: Don't use first_shift: find shifts through the
18401 states.
18402
80e25d4d
AD
184032001-12-10 Akim Demaille <akim@epita.fr>
18404
18405 * src/LR0.c: Attach shifts to states as soon as they are
18406 computed.
18407 * src/lalr.c (set_state_table): Instead of assigning shifts to
18408 state, just assert that the mapping was properly done.
18409
0ab3728b
AD
184102001-12-10 Akim Demaille <akim@epita.fr>
18411
18412 * src/LR0.c (insert_start_shift): Rename as...
18413 (insert_start_shifting_state): this.
18414 (insert_eof_shifting_state, insert_accepting_state): New.
18415 (augment_automaton): Adjust.
18416 Better locality of the variables.
18417 When looking if the start_symbol is shifted from the initial
18418 state, using `while (... symbol != start_symbol ...)' sounds
18419 better than `while (... symbol < start_symbol ...)': If fail
18420 to see how the order between symbols could be relevant!
18421
78af9bbc
AD
184222001-12-10 Akim Demaille <akim@epita.fr>
18423
18424 * src/getargs.h: Don't declare `spec_name_prefix' and
18425 `spec_file_prefix', declared by src/files.h.
18426 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
18427 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
18428 * src/output.c (prepare): Adjust.
18429 * src/reader.c (symbols_output): Likewise.
18430 * src/vmsgetargs.c: Vaguely adjust, but who cares?
18431
bdef2a41
AD
184322001-12-10 Akim Demaille <akim@epita.fr>
18433
18434 * src/muscle_tab.c (muscle_init): NULL is a better default than
18435 `"0"'.
18436
3735969c
AD
184372001-12-10 Akim Demaille <akim@epita.fr>
18438
18439 * src/reader.c (reader): Calling symbols_output once is enough.
18440
49701457
AD
184412001-12-10 Akim Demaille <akim@epita.fr>
18442
18443 Now that states have a complete set of members, the linked list of
18444 reductions is useless: just fill directly the state's reductions
18445 member.
18446
18447 * src/state.h (struct reductions): Remove member `number' and
18448 `next'.
18449 * src/LR0.c (first_reduction, last_reduction): Remove.
18450 (save_reductions): Don't link the new reductions, store them in
18451 this_state.
18452 * src/lalr.c (set_state_table): No need to attach reductions to
18453 states, it's already done.
18454 * src/output.c (output_actions): No longer free the shifts, then
18455 the reductions, then the states: free all the states and their
18456 members.
18457
0edad749
AD
184582001-12-10 Akim Demaille <akim@epita.fr>
18459
18460 * src/options.c (OPTN, DRTV, BOTH): New.
18461 (option_table): Use them.
18462
0edad749
AD
18463 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
18464 the job of system.h.
18465 * src/options.c: Don't include stdio.h and xalloc.h for the same
18466 reasons.
18467
5449dd0f
AD
184682001-12-10 Akim Demaille <akim@epita.fr>
18469
18470 * src/output.c (output, prepare): Make sure the values of the
18471 muscles `action' and `prologue' are 0-terminated.
18472
a870c567
AD
184732001-12-10 Akim Demaille <akim@epita.fr>
18474
18475 Clean up GCC warnings.
18476
18477 * src/reader.c (copy_action): `buf' is not used.
18478 (parse_skel_decl): Be static.
18479 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
18480 * src/options.h (create_long_option_table): Have a real prototype.
18481 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
18482 (hash_delete_at): Return const void *.
18483 Adjust casts to preserve the const.
18484
80df8768
AD
184852001-12-10 Akim Demaille <akim@epita.fr>
18486
18487 * configure.in: Require 2.52g.
18488 M4 is not needed, but AUTOM4TE is.
18489 * m4/m4.m4: Remove.
18490 * tests/Makefile.am: Adjust.
18491
f693ad14
AD
184922001-12-10 Akim Demaille <akim@epita.fr>
18493
18494 One structure for states is enough, even though theoretically
18495 there are LR(0) states and LALR(1) states.
18496
18497 * src/lalr.h (state_t): Remove.
18498 (state_table): Be state_t **, not state_t *.
18499 * src/state.h (core, CORE_ALLOC): Rename as...
18500 (state_t, STATE_ALLOC): this.
18501 Add the LALR(1) members: shifts, reductions, errs.
18502 * src/LR0.c (state_table): Rename as...
18503 (state_hash): this, to avoid name clashes with the global
18504 `state_table'.
18505 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
18506 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
18507
74ffbcb6
AD
185082001-12-10 Akim Demaille <akim@epita.fr>
18509
18510 Bison dumps core on bash.y.
18511 Reported by Pascal Bart.
18512
18513 * src/warshall.c (bitmatrix_print): New.
18514 (TC): Use it.
ba0fe3c7 18515 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
74ffbcb6
AD
18516 j must be the outer loop.
18517 * tests/regression.at (Broken Closure): New.
18518
07708e19
AD
185192001-12-05 Akim Demaille <akim@epita.fr>
18520
18521 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
18522 its argument.
ba1ecc07 18523 Reported by Peter Hamorsky.
07708e19 18524
92b16366
AD
185252001-12-05 Akim Demaille <akim@epita.fr>
18526
18527 * src/conflicts.c (err_table): Remove.
18528 (resolve_sr_conflict): Adjust.
18529 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
18530 Rename as...
18531 (state_t.reductions, state_t.shifts): this.
18532
076ab033
AD
185332001-12-05 Akim Demaille <akim@epita.fr>
18534
18535 * src/reduce.c (reduce_grammar_tables): No longer disable the
18536 removal of useless rules via CPP but via `if (0)', so that the
18537 compiler still check the code is valid.
18538 For instance, it should have noticed `rline' no longer exists: use
18539 the `line' member of rule_t.
18540 * src/gram.c (dummy, rline): Remove, unused.
18541
3843c413
AD
185422001-12-05 Akim Demaille <akim@epita.fr>
18543
18544 * src/output.c (pack_vector): Use assert, not berror.
18545 * src/main.c (berror): Remove, unused.
18546
43168960
AD
185472001-12-05 Akim Demaille <akim@epita.fr>
18548
18549 New experimental feature: if --verbose --trace output all the
18550 items of a state, not only its kernel.
18551
18552 * src/print.c (print_core): If `trace_flag', then invoke closure
18553 before outputting the items of the state (print_core is no longer
18554 a correct name them).
18555 (print_results): Invoke new_closure/free_closure if needed.
18556
b2872512
AD
185572001-12-05 Akim Demaille <akim@epita.fr>
18558
18559 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
18560 * src/closure.c, src/closure.h (itemsetsize): Rename as...
18561 (nitemset): for consistency with the rest of the project.
18562
23cbcc6c
AD
185632001-12-05 Akim Demaille <akim@epita.fr>
18564
18565 * src/closure.c (print_closure): Improve.
18566 (closure): Use it for printing input and output.
18567
03ec521c
AD
185682001-12-05 Akim Demaille <akim@epita.fr>
18569
18570 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
18571 indexed by nonterminals.
18572
3a7456dd
AD
185732001-12-05 Akim Demaille <akim@epita.fr>
18574
18575 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
18576 what it was!).
18577 * src/warshall.h: Remove accidental duplication of the content.
18578
1cbcf2e7
AD
185792001-12-05 Akim Demaille <akim@epita.fr>
18580
18581 * src/closure.c (set_fderives): De-obfuscate.
18582
84182270
AD
185832001-12-05 Akim Demaille <akim@epita.fr>
18584
18585 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
18586
3f6f053c
AD
185872001-12-05 Akim Demaille <akim@epita.fr>
18588
18589 * src/closure.c (set_firsts): De-obfuscate.
18590
7a5350ba
AD
185912001-12-05 Akim Demaille <akim@epita.fr>
18592
18593 * src/output.c (action_row): De-obfuscate
18594 using the good o' techniques: arrays not pointers, variable
18595 locality, BITISSET, RESETBIT etc.
18596
d954473d
AD
185972001-12-05 Akim Demaille <akim@epita.fr>
18598
18599 Pessimize the code to simplify it: from now on, all the states
18600 have a valid SHIFTS, which NSHIFTS is possibly 0.
18601
18602 * src/LR0.c (shifts_new): Be global and move to..
18603 * src/state.c, src/state.h: here.
18604 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
18605 * src/print_graph: Adjust.
18606
9839bbe5
AD
186072001-12-05 Akim Demaille <akim@epita.fr>
18608
18609 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
18610 * src/conflicts.c: Use it.
18611 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
18612 incorrectly ``simplified''.
18613
9f136c07
AD
186142001-12-05 Akim Demaille <akim@epita.fr>
18615
18616 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
18617 using the good o' techniques: arrays not pointers, variable
18618 locality, BITISSET, RESETBIT etc.
18619
b608206e
AD
186202001-12-05 Akim Demaille <akim@epita.fr>
18621
18622 * src/state.h (SHIFT_SYMBOL): New.
18623 * src/conflicts.c: Use it to deobfuscate.
18624
52afa962
AD
186252001-12-05 Akim Demaille <akim@epita.fr>
18626
18627 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
18628 (print_reductions): De-obfuscate using the good o' techniques:
18629 arrays not pointers, variable locality, BITISSET.
18630
e74dc321
AD
186312001-12-05 Akim Demaille <akim@epita.fr>
18632
18633 * src/conflicts.c (print_reductions): Arrays, not pointers.
18634 Use BITISSET.
18635
768fca83
AD
186362001-12-05 Akim Demaille <akim@epita.fr>
18637
18638 * src/conflicts.c (print_reductions): Pessimize, but clarify.
18639
a17e599f
AD
186402001-12-05 Akim Demaille <akim@epita.fr>
18641
18642 * src/conflicts.c (print_reductions): Improve variable locality.
18643
a04bc341
AD
186442001-12-05 Akim Demaille <akim@epita.fr>
18645
18646 * src/conflicts.c (print_reductions): Pessimize, but clarify.
18647
c8ea038e
AD
186482001-12-05 Akim Demaille <akim@epita.fr>
18649
18650 * src/conflicts.c (print_reductions): Improve variable locality.
18651
aa2aab3c
AD
186522001-12-05 Akim Demaille <akim@epita.fr>
18653
18654 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
18655 * src/lalr.c: Use them.
18656
b178c8cc
AD
186572001-12-05 Akim Demaille <akim@epita.fr>
18658
18659 * src/LR0.c (augment_automaton): Formatting changes.
18660 Better variable locality.
18661
f67d13aa
AD
186622001-12-05 Akim Demaille <akim@epita.fr>
18663
18664 * src/lalr.c (matrix_print): New.
18665 (transpose): Use it.
18666 Use arrays instead of pointers.
18667
c2713865
AD
186682001-12-05 Akim Demaille <akim@epita.fr>
18669
18670 * src/lalr.c (maxrhs): Move to...
18671 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
18672 * src/lalr.c (build_relations): Adjust.
18673
9887c18a
AD
186742001-12-05 Akim Demaille <akim@epita.fr>
18675
18676 * src/lalr.c (transpose): Free the memory allocated to the
18677 argument, as it is replaced by the results by the unique caller.
18678 (build_relations): Merely invoke transpose: it handles the memory
18679 deallocation.
18680 Improve variable locality.
18681 Avoid variables used as mere abbreviations.
18682 (compute_lookaheads): Use arrays instead of pointers.
18683
4d4f699c
AD
186842001-12-05 Akim Demaille <akim@epita.fr>
18685
18686 * src/lalr.c (initialize_F): Improve variable locality.
18687 Avoid variables used as mere abbreviations.
18688
80a69750
AD
186892001-12-05 Akim Demaille <akim@epita.fr>
18690
18691 * src/derives.c (print_derives): Display the ruleno.
18692 * src/lalr.c (initialize_F, transpose): Better variable locality
18693 to improve readability.
18694 Avoid variables used as mere abbreviations.
18695
fe961097
AD
186962001-12-05 Akim Demaille <akim@epita.fr>
18697
18698 * src/lalr.c (traverse): Use arrays instead of pointers.
18699
e3e4e814
AD
187002001-12-05 Akim Demaille <akim@epita.fr>
18701
18702 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
18703 the handling of squeue.
18704 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
18705
630e182b
AD
187062001-12-05 Akim Demaille <akim@epita.fr>
18707
18708 Because useless nonterminals are now kept alive (instead of being
18709 `destroyed'), we now sometimes examine them, and store information
18710 related to them. Hence we need to know their number, and adjust
18711 memory allocations.
18712
18713 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
18714 static.
18715 * src/LR0.c (allocate_itemsets): The memory allocated to
18716 `symbol_count' was used for two different purpose: once to count
18717 the number of occurrences of each symbol, and later reassigned to
18718 `shift_symbol', containing the symbol that can be shifted from a
18719 given state.
18720 Deobfuscate, i.e., allocate, use and free `symbol_count' here
18721 only, and...
18722 (new_itemsets): Allocate `shift_symbol' here.
18723 (allocate_itemsets): symbol_count includes useless nonterminals.
18724 Make room for them.
18725 (free_storage): Use `free', not `XFREE', for pointers that cannot
18726 be null.
18727
81b51460
AD
187282001-12-05 Akim Demaille <akim@epita.fr>
18729
18730 * src/nullable.c (set_nullable): Deobfuscate the handling of
18731 ritem.
18732 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
18733
3067fbef
AD
187342001-12-05 Akim Demaille <akim@epita.fr>
18735
18736 * src/gram.c, src/gram.h (ritem_print): New.
18737 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
18738 (This useless function was defined only to work around VMS linkers
18739 that can't handle compilation units with variables only).
18740 * src/reduce.c (dump_grammar): Use it to trace the construction of
18741 ritem.
18742
c2bea5f9
PE
187432001-12-04 Paul Eggert <eggert@twinsun.com>
18744
7d27c823
PE
18745 * src/bison.simple (union yyalloc): Change member names
18746 to be the same as the stack names.
18747 (yyparse): yyptr is now union yyalloc *, not char *.
18748 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
18749 and may generate better code on some machines.
c2bea5f9
PE
18750 (yystpcpy): Use prototype if __STDC__ is defined, not just
18751 if __cplusplus is defined.
35687a9d 18752
2c8a9dfa
AD
187532001-11-30 Akim Demaille <akim@epita.fr>
18754
18755 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
18756 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
18757 Gettext doesn't compile cleanly, and dies with -Werror.
18758 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
18759 Include WARNING_CFLAGS here.
18760 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
18761 before being defined.
18762
f4e421e6
AD
187632001-11-27 Paul Eggert <eggert@twinsun.com>
18764
18765 * lib/quotearg.h (quotearg_n, quotearg_n_style):
18766 First arg is int, not unsigned.
18767 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
18768 (SIZE_MAX, UINT_MAX): New macros.
18769 (quotearg_n_options): Abort if N is negative.
18770 Avoid overflow check on hosts where size_t is 64 bits and int
18771 is 32 bits, as overflow is impossible there.
18772 Fix off-by-one typo that caused unnecessary reallocation.
18773
7093d0f5
AD
187742001-11-29 Paul Eggert <eggert@twinsun.com>
18775
18776 Name space cleanup in generated parser.
18777
18778 * doc/bison.texinfo (Bison Parser): Discuss system headers
18779 and their effect on the user name space.
18780
18781 * src/bison.simple:
18782 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
18783 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
18784 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
18785
18786 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
18787 on user names when possible.
18788
18789 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
18790 Simplify test for whather <alloca.h> exists.
18791
18792 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
18793
18794 (<stdio.h>): Include if YYDEBUG.
18795
18796 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
18797 ! defined (yyoverflow) && ! defined (yymemcpy).
18798
18799 (yymemcpy, yyparse): Rename local variables as needed so that
18800 they all begin with 'yy'.
18801
18802 (yystrlen, yystpcpy): New functions.
18803
18804 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
18805 All uses changed.
18806
18807 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
18808 instead of relying on string.h functions. Use YYSTACK_ALLOC
18809 and YYSTACK_FREE instead of malloc and free.
18810
fd51e5ff
AD
188112001-11-30 Akim Demaille <akim@epita.fr>
18812
18813 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
18814 before their first uses.
18815 (YYBISON, YYPURE): Move to the top of the output.
18816
7d13ff5f
AD
188172001-11-30 Akim Demaille <akim@epita.fr>
18818
18819 * tests/reduce.at (Useless Nonterminals): Fix.
18820
892a3995
AD
188212001-11-30 Akim Demaille <akim@epita.fr>
18822
18823 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
18824 if body instead of `;' to pacify GCC's warnings.
18825
68f1e3ed
AD
188262001-11-30 Akim Demaille <akim@epita.fr>
18827
18828 Instead of mapping the LHS of unused rules to -1, keep the LHS
18829 valid, but flag the rules as invalid.
18830
18831 * src/gram.h (rule_t): `useful' is a new member.
18832 * src/print.c (print_grammar): Adjust.
18833 * src/derives.c (set_derives): Likewise.
18834 * src/reader.c (packgram, reduce_output): Likewise.
18835 * src/reduce.c (reduce_grammar_tables): Likewise.
18836 * tests/reduce.at (Underivable Rules, Useless Rules): New.
18837
d2d1b42b
AD
188382001-11-30 Akim Demaille <akim@epita.fr>
18839
18840 * src/reduce.c (reduce_output): Formatting changes.
18841 * src/print.c (print_results, print_grammar): Likewise.
18842 * tests/regression.at (Rule Line Numbers)
18843 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
18844
760b53a8
AD
188452001-11-30 Akim Demaille <akim@epita.fr>
18846
18847 * src/reduce.c (nonterminals_reduce): Instead of throwing away
18848 useless nonterminals, move them at the end of the symbol arrays.
18849 (reduce_output): Adjust.
18850 * tests/reduce.at (Useless Nonterminals): Adjust.
18851
00238958
AD
188522001-11-30 Akim Demaille <akim@epita.fr>
18853
18854 * src/reduce.c: Various comment/formatting changes.
18855 (nonterminals_reduce): New, extracted from...
18856 (reduce_grammar_tables): here.
18857 (reduce_grammar): Call nonterminals_reduce.
18858
396452de
PE
188592001-11-29 Paul Eggert <eggert@twinsun.com>
18860
18861 * src/bison.simple (YYSTACK_REALLOC): Remove.
18862 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
18863 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
18864 New macros.
18865 (union yyalloc): New type.
18866 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
18867 an arbitrary restriction on hosts where size_t is wider than int.
18868
18869 (yyparse): Don't dump core if alloca or malloc fails; instead, report
18870 a parser stack overflow. Allocate just one block of memory for all
18871 three stacks, instead of allocating three blocks; this typically is
18872 faster and reduces fragmentation.
18873
18874 Do not limit the number of items in the stack to a value that fits
18875 in 'int', as this is an arbitrary limit on hosts with 64-bit
18876 size_t and 32-bit int.
18877
147e184c
MA
188782001-11-29 Marc Autret <autret_m@epita.fr>
18879
18880 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
18881 of defining YYERROR_VERBOSE.
18882 [AT_DATA]: $4 is now out of C declarations in the prologue.
18883
426cf563
MA
188842001-11-28 Marc Autret <autret_m@epita.fr>
18885
18886 * src/reader.c (parse_dquoted_param): New.
18887 (parse_skel_decl): Use it.
18888 * src/lex.h: Add its prototype.
18889 * src/lex.c (literalchar): Become not static.
18890
c7925b99
MA
188912001-11-28 Marc Autret <autret_m@epita.fr>
18892
18893 * src/output.h: And put its extern declaration here.
18894 * src/output.c (error_verbose): Define here.
18895 (prepare): Echo name modification.
18896 * src/getargs.h: Clean its extern declaration.
18897 * src/getargs.c (error_verbose_flag): Remove.
18898 (getargs): Remove case 'e'.
18899 * src/options.c (option_table): 'error-verbose' is now seen as simple
18900 percent option.
18901 Include output.h.
18902
18903 * src/reader.c (read_declarations): Remove case tok_include.
18904 (parse_include_decl): Remove.
18905 * src/lex.h (token_t): Remove tok_include.
18906 * src/options.c (option_table): 'include' is now a simple command line
18907 option.
18908
5b5d1929
MA
189092001-11-28 Marc Autret <autret_m@epita.fr>
18910
18911 * src/bison.simple: Adjust muscle names.
18912 * src/muscle_tab.c (muscle_init): Also rename the muscles.
18913 * src/output.c (prepare): s/_/-/ for the muscles names.
18914 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
18915
8850be4b
MA
189162001-11-28 Marc Autret <autret_m@epita.fr>
18917
18918 * src/bison.simple: Fix debug.
18919 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
18920
4a38e613
AD
189212001-11-28 Akim Demaille <akim@epita.fr>
18922
18923 * src/LR0.c (shifts_new): New.
18924 (save_shifts, insert_start_shift, augment_automaton): Use it.
18925
4b35e1c1
AD
189262001-11-28 Akim Demaille <akim@epita.fr>
18927
18928 * src/closure.c (closure): `b' and `ruleno' denote the same value:
18929 keep ruleno only.
18930
d2b04478
AD
189312001-11-28 Akim Demaille <akim@epita.fr>
18932
18933 * src/closure.c (closure): Instead of looping over word in array
18934 then bits in words, loop over bits in array.
18935
2c4c30aa
AD
189362001-11-28 Akim Demaille <akim@epita.fr>
18937
18938 * src/closure.c (closure): No longer optimize the special case
18939 where all the bits of `ruleset[r]' are set to 0, to make the code
18940 clearer.
18941
576890b7
AD
189422001-11-28 Akim Demaille <akim@epita.fr>
18943
18944 * src/closure.c (closure): `r' and `c' are new variables, used to
18945 de-obfuscate accesses to RULESET and CORE.
18946
cb487d7d
AD
189472001-11-28 Akim Demaille <akim@epita.fr>
18948
18949 * src/reduce.c (reduce_print): Use ngettext.
18950 (dump_grammar): Improve the trace accuracy.
18951
6013d43f
AD
189522001-11-28 Akim Demaille <akim@epita.fr>
18953
18954 * src/reduce.c (dump_grammar): Don't translate trace messages.
18955
cb4956ee
AD
189562001-11-28 Akim Demaille <akim@epita.fr>
18957
18958 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
18959 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
18960 as all tags are free'ed afterwards.
18961 From Enrico Scholz.
18962
648185ab
PE
189632001-11-27 Paul Eggert <eggert@twinsun.com>
18964
18965 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
18966 use alloca when we didn't want to, and vice versa.
18967
68254a03
MA
189682001-11-27 Marc Autret <autret_m@epita.fr>
18969
9113b58f
AD
18970 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
18971 initialization.
68254a03
MA
18972 * src/output.c (prepare): Remove its update.
18973
04d843a2
MA
189742001-11-27 Marc Autret <autret_m@epita.fr>
18975
18976 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
18977 Use %error-verbose.
18978
d2079671 189792001-11-27 Marc Autret <autret_m@epita.fr>
eeeb962b
MA
18980
18981 * src/bison.simple: Remove YYERROR_VERBOSE using.
18982 Use %%error_verbose.
18983 (yyparse): Likewise.
18984 * src/output.c (prepare): Give its final value.
18985 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
18986 * src/getargs.h: Add its extern declaration.
18987 * src/getargs.c (error_verbose_flag): New int.
18988 (getargs): Update to catch new case.
18989 * src/options.c (option_table): 'error-verbose' is a new option.
18990 (shortopts): Update.
18991
e0327bc8
AD
189922001-11-27 Akim Demaille <akim@epita.fr>
18993
18994 * src/system.h: Use intl/libgettext.h.
18995 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
18996
000f1a3c
AD
189972001-11-27 Akim Demaille <akim@epita.fr>
18998
18999 * tests/torture.at (Exploding the Stack Size with Malloc):
19000 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
19001
26cfe0be
AD
190022001-11-27 Akim Demaille <akim@epita.fr>
19003
19004 * src/files.c: Include error.h.
19005 Reported by Hans Aberg.
19006
f6bd5427
MA
190072001-11-26 Marc Autret <autret_m@epita.fr>
19008
d2079671 19009 * src/reader.c (parse_include_decl): New, not yet implemented.
f6bd5427
MA
19010 (read_declarations): Add case tok_include.
19011 * src/getargs.h (include): Add its extern definition.
19012 * src/getargs.c (include): New const char *.
19013 (getargs): Add case '-I'.
19014 * src/options.c (option_table): Add include as command line and
19015 percent option.
19016 * src/lex.h (token_t): Add tok_include.
19017
2ca209c1
AD
190182001-11-26 Akim Demaille <akim@epita.fr>
19019
19020 * src/reader.c (readgram): Make sure rules for mid-rule actions
19021 have a lineno equal to that of their host rule.
19022 Reported by Hans Aberg.
19023 * tests/regression.at (Rule Line Numbers): New.
19024
0e41b407
AD
190252001-11-26 Akim Demaille <akim@epita.fr>
19026
19027 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
19028 size_ts.
19029
190302001-11-26 Akim Demaille <akim@epita.fr>
19031
19032 * src/complain.c, src/complain.h (error): Remove, provided by
19033 lib/error.[ch].
19034
e0c40012
AD
190352001-11-26 Akim Demaille <akim@epita.fr>
19036
19037 * src/reader.c (read_declarations): Don't abort on tok_illegal,
19038 issue an error message.
19039 * tests/regression.at (Invalid %directive): New.
19040 Reported by Hans Aberg.
19041
5e147124
AD
190422001-11-26 Akim Demaille <akim@epita.fr>
19043
19044 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
19045 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
19046
a034c8b8
AD
190472001-11-26 Akim Demaille <akim@epita.fr>
19048
19049 * src/conflicts.c (conflicts_print): Don't complain at all when
19050 there are no reduce/reduce conflicts, and as many shift/reduce
19051 conflicts as expected.
19052 * tests/regression.at (%expect right): Adjust.
19053
c64a20f3
AD
190542001-11-23 Akim Demaille <akim@epita.fr>
19055
19056 * lib/alloca.c: Update, from fileutils.
19057
5b0d29bb
AD
190582001-11-23 Akim Demaille <akim@epita.fr>
19059
19060 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
19061
722c4bfe
AD
190622001-11-23 Akim Demaille <akim@epita.fr>
19063
19064 * src/system.h: Include alloca.h.
19065 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
19066
6255b435
AD
190672001-11-23 Akim Demaille <akim@epita.fr>
19068
19069 * src/print_graph.c (print_actions): Remove `rule', unused.
19070 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
19071 pacify GCC's signed < unsigned warnings.
19072 * src/closure.c (itemsetsize): Likewise.
19073 * src/reader.c (symbol_list_new): Static.
19074
b29b2ed5
AD
190752001-11-23 Akim Demaille <akim@epita.fr>
19076
19077 Attaching lineno to buckets is stupid, since only one copy of each
19078 symbol is kept, only the line of the first occurrence is kept too.
19079
19080 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
19081 * src/reader.c (rline_allocated): Remove, unused.
19082 (symbol_list): Have a `line' member.
19083 (symbol_list_new): New.
19084 (readgram): Use it.
19085 * src/print.c (print_grammar): Output the rule line numbers.
19086 * tests/regression.at (Solved SR Conflicts)
19087 (Unresolved SR Conflicts): Adjust.
19088 Reported by Hans Aberg.
19089
a81b1d4a
MA
190902001-11-22 Marc Autret <autret_m@epita.fr>
19091
19092 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
19093
c1ecb3c1
MA
190942001-11-22 Marc Autret <autret_m@epita.fr>
19095
19096 * src/muscle_tab.c (muscle_init): Remove initialization of
19097 skeleton muscle.
19098 * src/output.c (output_master_parser): Do it here.
19099
fbe01355
AD
191002001-11-20 Akim Demaille <akim@epita.fr>
19101
19102 * po/sv.po: New.
19103 * configure.in (ALL_LINGUAS): Adjust.
19104 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
19105 longer contains strings to translate.
19106
81e895c0
AD
191072001-11-19 Akim Demaille <akim@epita.fr>
19108
19109 * src/conflicts.c (conflicts_print): Add a missing \n.
19110
6bb1878b
AD
191112001-11-19 Akim Demaille <akim@epita.fr>
19112
19113 * src/nullable.c (nullable_print): New.
19114 (set_nullable): Call it when tracing.
19115 Better locality of variables.
19116
d9ec2d07
AD
191172001-11-19 Akim Demaille <akim@epita.fr>
19118
19119 * src/print.c (print_actions): Better locality of variables.
19120
720e5c1b
AD
191212001-11-19 Akim Demaille <akim@epita.fr>
19122
19123 * src/derives.c (print_derives): Fix and enrich.
19124 * src/closure.c (print_fderives): Likewise.
19125
fb908786
AD
191262001-11-19 Akim Demaille <akim@epita.fr>
19127
19128 * src/closure.c (itemsetend): Remove, replaced with...
19129 (itemsetsize): new.
19130
125ecb56
AD
191312001-11-19 Akim Demaille <akim@epita.fr>
19132
19133 * src/LR0.c (kernel_end): Remove, replaced with...
19134 (kernel_size): new.
19135
d8cf039f
AD
191362001-11-19 Akim Demaille <akim@epita.fr>
19137
19138 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
19139 to clarify.
19140
7bec0760
AD
191412001-11-19 Akim Demaille <akim@epita.fr>
19142
19143 * src/closure.c (closure): Use arrays instead of pointers to clarify.
19144
c87d4863
AD
191452001-11-19 Akim Demaille <akim@epita.fr>
19146
19147 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
19148 trace messages.
19149 * src/LR0.c: Likewise.
19150 (allocate_itemsets): Use arrays instead of pointers to clarify.
19151
9bfe901c
AD
191522001-11-19 Akim Demaille <akim@epita.fr>
19153
19154 * src/getargs.c (statistics_flag): Replace with...
19155 (trace_flag): New.
19156 (longopts): Accept --trace instead of --statistics.
19157 * src/getargs.h, src/options.c: Adjust.
19158 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
19159 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
19160
97db7bd4
AD
191612001-11-19 Akim Demaille <akim@epita.fr>
19162
cc72668c 19163 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
97db7bd4
AD
19164 pointers to clarify the code.
19165 (save_reductions, save_shifts): Factor common parts of alternatives.
19166
2c5f66ed
AD
191672001-11-19 Akim Demaille <akim@epita.fr>
19168
19169 * src/LR0.c (new_state, get_state): Complete TRACE code.
19170 * src/closure.c: Include `reader.h' to get `tags', needed by the
19171 trace code.
19172 Rename the conditional DEBUG as TRACE.
19173 Output consistently TRACEs to stderr, not stdout.
19174 * src/derives.c: Likewise.
19175 * src/reduce.c: (inaccessable_symbols): Using if is better style
19176 than goto.
19177 Use `#if TRACE' instead of `#if 0' for tracing code.
19178
300f275f
AD
191792001-11-19 Akim Demaille <akim@epita.fr>
19180
19181 * src/system.h (LIST_FREE, shortcpy): New.
19182 * src/LR0.c: Use them.
19183 * src/output.c (free_itemsets, free_reductions, free_shifts):
19184 Remove, replaced by LIST_FREE.
19185
f59c437a
AD
191862001-11-19 Akim Demaille <akim@epita.fr>
19187
19188 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
19189 (REDUCTIONS_ALLOC): New.
19190 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
19191 allocation.
19192
6986fd9e
AD
191932001-11-19 Akim Demaille <akim@epita.fr>
19194
19195 * src/LR0.c (new_state): Complete trace code.
19196 * src/nullable.c (set_nullable): Don't translate traces.
19197
4bc30f78
AD
191982001-11-19 Akim Demaille <akim@epita.fr>
19199
19200 * src/print_graph.c (print_core): Better locality of variables.
19201 * src/print.c (print_core): Likewise.
19202
08a946e0
AD
192032001-11-19 Akim Demaille <akim@epita.fr>
19204
19205 * src/vcg.c: You do the output, so you are responsible of the
19206 handling of VCG syntax, in particular: use quotearg.
19207 * src/print_graph.c: Don't.
19208 (print_actions): Don't output the actions as part of the nodes,
19209 since that's the job of the edges.
19210 (print_state): Don't output by hand: fill the node description,
9bfe901c 19211 and ask for its output.
08a946e0 19212
f0473484
AD
192132001-11-19 Akim Demaille <akim@epita.fr>
19214
cc72668c
AD
19215 * src/bison.simple (yyparse): When verbosely reporting an error,
19216 no longer put additional quotes around token names.
f0473484
AD
19217 * tests/calc.at: Adjust.
19218
e41dc700
AD
192192001-11-19 Akim Demaille <akim@epita.fr>
19220
19221 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
19222 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
19223 * src/output.c: Adjust.
19224
652a871c
AD
192252001-11-19 Akim Demaille <akim@epita.fr>
19226
19227 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
19228 (rule_t): this.
19229 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
19230
b2ed6e58
AD
192312001-11-19 Akim Demaille <akim@epita.fr>
19232
19233 * src/gram.h (rule_t): New.
19234 (rule_table): New.
19235 (rrhs, rlhs): Remove, part of state_t.
19236 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
19237 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
19238 * src/reader.c, src/reduce.c: Adjust.
19239
edad7067
AD
192402001-11-19 Akim Demaille <akim@epita.fr>
19241
19242 * src/reader.c (symbols_output): New, extracted from...
19243 (packsymbols): Here.
19244 (reader): Call it.
19245
3feec034
AD
192462001-11-19 Akim Demaille <akim@epita.fr>
19247
19248 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
19249 (maxrhs): this new function.
19250
ddcd5fdf
AD
192512001-11-19 Akim Demaille <akim@epita.fr>
19252
cc72668c 19253 * src/lalr.c (F): New macro to access the variable F.
ddcd5fdf
AD
19254 Adjust.
19255
bb527fc2
AD
192562001-11-19 Akim Demaille <akim@epita.fr>
19257
cc72668c 19258 * src/lalr.h (LA): New macro to access the variable LA.
bb527fc2
AD
19259 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
19260 * src/lalr.c: Adjust.
19261
a845a697
AD
192622001-11-19 Akim Demaille <akim@epita.fr>
19263
19264 * src/lalr.c (initialize_LA): Only initialize LA. Let...
19265 (set_state_table): handle the `lookaheads' members.
19266
f004bf6a
AD
192672001-11-19 Akim Demaille <akim@epita.fr>
19268
cc72668c
AD
19269 * src/lalr.h (lookaheads): Removed array, whose contents is now
19270 a member of...
f004bf6a
AD
19271 (state_t): this structure.
19272 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
19273 Adjust.
19274
de326cc0
AD
192752001-11-19 Akim Demaille <akim@epita.fr>
19276
cc72668c
AD
19277 * src/lalr.h (consistent): Removed array, whose contents is now
19278 a member of...
de326cc0
AD
19279 (state_t): this structure.
19280 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
19281 Adjust.
19282
90b4416b
AD
192832001-11-19 Akim Demaille <akim@epita.fr>
19284
cc72668c
AD
19285 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
19286 contents are now members of...
90b4416b
AD
19287 (state_t): this structure.
19288 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
19289 Adjust.
19290
9703cc49
AD
192912001-11-19 Akim Demaille <akim@epita.fr>
19292
19293 * src/lalr.h (state_t): New.
19294 (state_table): Be a state_t * instead of a core **.
19295 (accessing_symbol): Remove, part of state_t.
19296 * src/lalr.c: Adjust.
19297 (set_accessing_symbol): Merge into...
19298 (set_state_table): this.
19299 * src/print_graph.c, src/conflicts.c: Adjust.
19300
d803322e
AD
193012001-11-14 Akim Demaille <akim@epita.fr>
19302
19303 * tests/calc.at, tests/output.at, tests/regression.at,
19304 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
19305 now the tests are run in private dirs, therefore AC_CLEANUP and
19306 family can be simplified to 0-ary.
19307 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
19308 use abs. path to find config.h.
19309 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
19310 stderr, there can be way too much random noise.
19311 Instead pass -Werror to GCC and rely on the exit status.
19312 Reported by Wolfram Wagner.
19313
3d76b07d
AD
193142001-11-14 Akim Demaille <akim@epita.fr>
19315
19316 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
19317 defined only if yyoverflow is defined, to avoid `warning: unused
19318 variable `yyvs1''.
19319 Reported by The Test Suite.
19320
09b503c8
AD
193212001-11-14 Akim Demaille <akim@epita.fr>
19322
19323 * src/print.c: Include reduce.h.
19324 Reported by Hans Aberg.
19325
193262001-11-14 Akim Demaille <akim@epita.fr>
19327
19328 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
19329 Revert a previous patch: these are really const.
19330 * src/conflicts.c (conflict_report): Additional useless pair of
19331 braces to pacify GCC's warnings for `if () if () {} else {}'.
19332 * src/lex.c (parse_percent_token): Replace equal_offset with
19333 arg_offset.
19334 arg is const.
19335 Be sure to strdup `arg' when used, since there is no reason for
19336 token_buffer not to change.
19337
0f37a994
AD
193382001-11-14 Akim Demaille <akim@epita.fr>
19339
19340 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
19341 definition.
19342 * src/main.c (main): Use them.
19343 Suggested by Hans Aberg.
19344
d39d93b8
AD
193452001-11-12 Akim Demaille <akim@epita.fr>
19346
19347 * src/system.h (ngettext): Now that we use ngettext, be sure to
19348 provide a default definition when NLS are not used.
19349
9edcd895
AD
193502001-11-12 Akim Demaille <akim@epita.fr>
19351
19352 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
19353 Use @kbd to denote user input.
19354 (Language and Grammar): ANSIfy the example.
19355 Adjust its layout for info/notinfo.
19356 (Location Tracking Calc): Output error messages to stderr.
19357 Output locations in a more GNUtically correct way.
19358 Fix a couple of Englishos.
19359 Adjust @group/@end group pairs.
19360
7da99ede
AD
193612001-11-12 Akim Demaille <akim@epita.fr>
19362
e3aa65c5 19363 %expect was not functioning at all.
7da99ede
AD
19364
19365 * src/conflicts.c (expected_conflicts): Set to -1.
19366 (conflict_report): Use ngettext.
19367 (conflicts_print): Check %expect and make its violation an error.
19368 * doc/bison.texinfo (Expect Decl): Adjust.
19369 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
19370 * tests/regression.at (%expect not enough, %expect right)
19371 (%expect too much): New.
19372
ba9dda1a
AD
193732001-11-12 Akim Demaille <akim@epita.fr>
19374
19375 * tests/regression.at (Conflicts): Rename as...
19376 (Unresolved SR Conflicts): this.
19377 (Solved SR Conflicts): New.
19378
337c5bd1
AD
193792001-11-12 Akim Demaille <akim@epita.fr>
19380
19381 * src/reduce.c (print_results): Rename as...
19382 (reduce_output): This.
19383 Output to OUT, passed as argument, instead of output_obstack.
19384 (dump_grammar): Likewise.
19385 (reduce_free): New.
19386 Also free V1.
19387 (reduce_grammar): No longer call reduce_output, since...
19388 * src/print.c (print_results): do it.
19389 * src/main.c (main): Call reduce_free;
19390
c73a41af
AD
193912001-11-12 Akim Demaille <akim@epita.fr>
19392
19393 * src/conflicts.c (print_reductions): Accept OUT as argument.
19394 Output to it, not to output_obstack.
19395 * src/print.c (print_actions): Adjust.
19396
0df87bb6
AD
193972001-11-12 Akim Demaille <akim@epita.fr>
19398
19399 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
19400 the result instead of using...
19401 (src_total, rrc_total, src_count, rrc_count): Remove.
19402 (any_conflicts): Remove.
19403 (print_conflicts): Split into...
19404 (conflicts_print, conflicts_output): New.
19405 * src/conflicts.h: Adjust.
19406 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
0f37a994 19407 * src/print.c (print_grammar): Issue `\n' between two rules.
0df87bb6
AD
19408 * tests/regression.at (Conflicts): New.
19409 Reported by Tom Lane.
19410
e4d3d4de
AD
194112001-11-12 Akim Demaille <akim@epita.fr>
19412
19413 * tests/regression.at (Invalid input): Remove, duplicate with
19414 ``Invalid input: 1''.
19415
6d7d248e
AD
194162001-11-12 Akim Demaille <akim@epita.fr>
19417
19418 * tests/torture.at (AT_DATA_STACK_TORTURE)
19419 (Exploding the Stack Size with Alloca)
19420 (Exploding the Stack Size with Malloc): New.
19421
e9e4c321
AD
194222001-11-12 Akim Demaille <akim@epita.fr>
19423
19424 * src/bison.simple (YYSTACK_REALLOC): New.
19425 (yyparse) [!yyoverflow]: Use it and free the old stack.
0f37a994 19426 Reported by Per Allansson.
e9e4c321 19427
5f7e0832
AD
194282001-11-12 Pascal Bart <pascal.bart@epita.fr>
19429
19430 * src/bison.simple: Define type yystype instead of YYSTYPE, and
19431 define CPP macro, which substitute YYSTYPE by yystype.
19432 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
19433 with yyltype/YYLTYPE. This allows inclusion of the generated
19434 header within the parser if the compiler, such as GGC, accepts
19435 multiple equivalent #defines.
19436 From Akim.
19437
e3f1699f
AD
194382001-11-05 Akim Demaille <akim@epita.fr>
19439
19440 * src/reader.c (symbols_output): New, extracted from...
19441 (packsymbols): here.
19442 (reader): Adjust.
19443
65be0866
AD
194442001-11-05 Akim Demaille <akim@epita.fr>
19445
19446 * src/lex.c (parse_percent_token): s/quotearg/quote/.
19447
e4d910bf
AD
194482001-11-05 Akim Demaille <akim@epita.fr>
19449
19450 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
19451 pattern.
19452
951366c1
AD
194532001-11-05 Akim Demaille <akim@epita.fr>
19454
19455 * src/options.h (struct option_table_struct): set_flags is void*.
19456 * src/options.c (longopts): Support `--output' and `%output'.
19457 (usage): Adjust.
19458 * src/lex.h (tok_setopt): Remove, replaced with...
19459 (tok_intopt, tok_stropt): these new guys.
19460 * src/lex.c (getopt.h): Not needed.
19461 (token_buffer, unlexed_token_buffer): Not const.
19462 (percent_table): Promote `-' over `_' in directive names.
19463 Active `%name-prefix', `file-prefix', and `output'.
19464 (parse_percent_token): Accept possible arguments to directives.
19465 Promote `-' over `_' in directive names.
19466
d8988b2f
AD
194672001-11-04 Akim Demaille <akim@epita.fr>
19468
19469 * doc/bison.texinfo (Decl Summary): Split the list into
19470 `directives for grammars' and `directives for bison'.
19471 Sort'em.
19472 Add description of `%name-prefix', `file-prefix', and `output'.
19473 Promote `-' over `_' in directive names.
19474 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
19475 Simplify the description of `--name-prefix'.
19476 Promote `-' over `_' in directive names.
19477 Promote `--output' over `--output-file'.
19478 Fix the description of `--defines'.
19479 * tests/output.at: Exercise %file-prefix and %output.
19480
6468d18e
AD
194812001-11-02 Akim Demaille <akim@epita.fr>
19482
19483 * doc/refcard.tex: Update.
19484
6b7e85b9
AD
194852001-11-02 Akim Demaille <akim@epita.fr>
19486
19487 * src/symtab.h (SUNDEF): New.
19488 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
19489 stand for `uninitialized', instead of 0.
19490 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
19491 * src/lex.c (lex): Adjust.
19492
19493 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
19494 Number it 0.
19495 Let yylex return it instead of a plain 0.
19496 Reported by Dick Streefland.
19497
cd5aafcf
AD
194982001-11-02 Akim Demaille <akim@epita.fr>
19499
19500 * tests/regression.at (Mixing %token styles): New test.
19501
037ca2f1
AD
195022001-11-02 Akim Demaille <akim@epita.fr>
19503
19504 * src/reader.c (parse_thong_decl): Formatting changes.
19505 (token_translations_init): New, extracted from...
19506 (packsymbols): Here.
19507 Adjust.
19508
270a173c
AD
195092001-11-01 Akim Demaille <akim@epita.fr>
19510
19511 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
19512 Check that `9foo.y' produces correct cpp guards.
19513 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
19514 guards.
19515 Reported by Wwp.
19516
561f9a30
AD
195172001-11-01 Akim Demaille <akim@epita.fr>
19518
19519 * tests/regression.at (Invalid input: 2): New.
19520 * src/lex.c (unlexed_token_buffer): New.
19521 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
19522 too.
19523 Reported by Wwp.
19524
f987e9d2
AD
195252001-11-01 Akim Demaille <akim@epita.fr>
19526
19527 * tests/calc.at: Catch up with 1.30.
19528 * configure.in: Bump to 1.49a.
19529 Adjust to newer Autotest.
19530
0846f581
PB
195312001-10-19 Pascal Bart <pascal.bart@epita.fr>
19532
19533 * src/conflicts.c: Move global variables rrc_total and src_total ...
19534 (print_conflicts): here.
19535 * src/output.c (output): Free global variable user_toknums.
19536 * src/lex.c (token_obstack): Become static.
19537
3c1a79b3
AD
195382001-10-18 Akim Demaille <akim@epita.fr>
19539
19540 * tests/atlocal.in (GCC): Add.
19541 * tests/calc.at: s/m4_match/m4_bmatch/.
19542 s/m4_patsubst/m4_bpatsubst/.
19543 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
19544 * configure.in: AC_SUBST(GCC).
19545
5d52e7d0
MA
195462001-10-14 Marc Autret <autret_m@epita.fr>
19547
19548 * src/options.c (create_long_option_table): Fix.
19549
631aa1d3
AD
195502001-10-10 Akim Demaille <akim@epita.fr>
19551
19552 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
19553
f6ec6d13
AD
195542001-10-04 Akim Demaille <akim@epita.fr>
19555
19556 * src/reader.c (parse_union_decl): Push the caracters in
19557 union_obstack, not attrs_obstack.
19558
342b8b6e
AD
195592001-10-04 Akim Demaille <akim@epita.fr>
19560
19561 Merge in the branch 1.29.
19562
19563 * src/reader.c (packsymbols): Use a temporary obstack for
19564 `%%tokendef', since output_stack is already used elsewhere.
19565
19566 2001-10-02 Akim Demaille <akim@epita.fr>
19567
19568 Bump 1.29d.
19569
19570 2001-10-02 Akim Demaille <akim@epita.fr>
19571
19572 Version 1.29c.
19573
19574 2001-10-02 Akim Demaille <akim@epita.fr>
19575
19576 * tests/regression.at (Invalid CPP headers): New.
19577 From Alexander Belopolsky.
19578 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
19579
19580 2001-10-02 Akim Demaille <akim@epita.fr>
19581
19582 * tests/regression.at (Invalid input): New.
19583 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
19584 Reported by Shura.
19585
19586 2001-10-02 Akim Demaille <akim@epita.fr>
19587
19588 * tests/calc.at: Now that --debug works, the tests must be adjusted.
19589
19590 2001-10-02 Akim Demaille <akim@epita.fr>
19591
19592 * src/output.c (output_parser): Assert `skeleton'.
19593 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
19594 systems.
19595 From Shura.
19596
19597 2001-10-01 Marc Autret <autret_m@epita.fr>
19598
19599 * src/lex.h: Echo modifications.
19600 * src/lex.c (unlex): Parameter is now token_t.
19601 From Hans Aberg.
19602
19603 2001-10-01 Marc Autret <autret_m@epita.fr>
19604
19605 * src/main.c: Include lex.h.
19606 From Hans Aberg.
19607
19608 2001-09-29 Akim Demaille <akim@epita.fr>
19609
19610 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
19611
19612 2001-09-28 Akim Demaille <akim@epita.fr>
19613
19614 * tests/testsuite.at: Update to newer Autotest.
19615 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
19616
19617 2001-09-27 Akim Demaille <akim@epita.fr>
19618
19619 Position independent wrapper.
19620
19621 * tests/bison: Remove.
19622 * tests/bison.in: New.
19623 * configure.in: Adjust.
19624
19625 2001-09-27 Paul Eggert <eggert@twinsun.com>
19626
19627 Port quotearg fixes from tar 1.13.24.
19628
19629 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
19630 tm to be declared.
19631 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
19632 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
19633
19634 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
19635 * m4/mbrtowc.m4: New file.
19636 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
19637 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
19638
19639 2001-09-27 Akim Demaille <akim@epita.fr>
19640
19641 Bump to 1.29c.
19642
19643 2001-09-27 Akim Demaille <akim@epita.fr>
19644
19645 Version 1.29b.
19646
19647 2001-09-25 Akim Demaille <akim@epita.fr>
19648
19649 * src/system.h: Include `xalloc.h'.
19650 Remove it from the C files.
19651 * src/files.c (output_files): Free the obstacks.
19652 * src/lex.c (init_lex): Rename as...
19653 (lex_init): this.
19654 (lex_free): New.
19655 * src/main.c (main): Use it.
19656
19657 2001-09-24 Marc Autret <autret_m@epita.fr>
19658
19659 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
19660 to output informations in fout (FILE*).
19661 (open_graph, close_graph): Likewise.
19662 (output_graph, output_edge, output_node): Likewise.
19663 * src/vcg.h: Update function prototypes.
19664 * src/print_graph.c (print_graph): Open output graph file.
19665 (print_actions): Adjust.
19666 * src/files.h: Remove extern declaration.
19667 * src/files.c: Remove graph_obstack declaration.
19668 (open_files): Remove graph_obstack initialization.
19669 (output_files): Remove graph_obstack saving.
19670
19671 2001-09-24 Marc Autret <autret_m@epita.fr>
19672
19673 * src/files.c (compute_output_file_names): Fix.
19674
19675 2001-09-24 Marc Autret <autret_m@epita.fr>,
19676 Akim Demaille <akim@epita.fr>
19677
19678 * src/reader.c (reader): Remove call to free_symtab ().
19679 * src/main.c (main): Call it here.
19680 Include symtab.h.
19681 * src/conflicts.c (initialize_conflicts): Rename as...
19682 (solve_conflicts): this.
19683 * src/print.c (print_core, print_actions, print_state)
19684 (print_grammar): Dump to a file instead a `output_obstack'.
19685 (print_results): Dump `output_obstack', and then proceed with the
19686 FILE *.
19687 * src/files.c (compute_output_file_names, close_files): New.
19688 (output_files): Adjust.
19689 * src/main.c (main): Adjust.
19690
19691 2001-09-23 Marc Autret <autret_m@epita.fr>
19692
19693 * src/files.c (compute_header_macro): Computes header macro name
19694 from spec_defines_file when given.
19695
19696 2001-09-23 Marc Autret <autret_m@epita.fr>
19697
19698 * src/files.c (output_files): Add default extensions.
19699
19700 2001-09-22 Akim Demaille <akim@epita.fr>
19701
19702 * src/conflicts.c (finalize_conflicts): Rename as...
19703 (free_conflicts): this.
19704
19705 2001-09-22 Akim Demaille <akim@epita.fr>
19706
19707 * src/gram.c (gram_free): Rename back as...
19708 (dummy): this.
19709 (output_token_translations): Free `token_translations'.
19710 * src/symtab.c (free_symtab): Free the tag field.
19711
19712 2001-09-22 Akim Demaille <akim@epita.fr>
19713
19714 Remove `translations' as it is always set to true.
19715
19716 * src/gram.h: Adjust.
19717 * src/reader.c (packsymbols, parse_token_decl): Adjust
19718 * src/print.c (print_grammar): Adjust.
19719 * src/output.c (output_token_translations): Adjust.
19720 * src/lex.c (lex): Adjust.
19721 * src/gram.c: Be sure the set pointers to NULL.
19722 (dummy): Rename as...
19723 (gram_free): this.
19724
19725 2001-09-22 Akim Demaille <akim@epita.fr>
19726
19727 * configure.in: Invoke AM_LIB_DMALLOC.
19728 * src/system.h: Use dmalloc.
19729 * src/LR0.c: Be sure to have pointers initialized to NULL.
19730 (allocate_itemsets): Allocate kernel_items only if needed.
19731
19732 2001-09-22 Akim Demaille <akim@epita.fr>
19733
19734 * configure.in: Bump to 1.29b.
19735 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
19736 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
19737 need xmalloc.c in calc.y.
19738 From Pascal Bart.
19739
19740 2001-09-21 Akim Demaille <akim@epita.fr>
19741
19742 Version 1.29a.
19743 * Makefile.maint, config/config.guess, config/config.sub,
19744 * config/missing: Update from masters.
19745 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
19746 upon package.m4.
19747 * configure.in (ALL_LINGUAS): Add `tr'.
19748
19749 2001-09-21 Akim Demaille <akim@epita.fr>
19750
19751 * tests/Makefile.am (package.m4): Move to...
19752 ($(srcdir)/$(TESTSUITE)): here.
19753
19754 2001-09-20 Akim Demaille <akim@epita.fr>
19755
19756 * src/complain.c: No longer try to be standalone: use system.h.
19757 Don't assume __STDC__ is defined to 1. Just test if it is defined.
19758 * src/complain.h: Likewise.
19759 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
19760 Remove the unused variable `n'.
19761 From Albert Chin-A-Young.
19762
19763 2001-09-18 Marc Autret <autret_m@epita.fr>
19764
19765 * doc/bison.1: Update.
19766 * doc/bison.texinfo (Bison Options): Update --defines and --graph
19767 descriptions.
19768 (Option Cross Key): Update.
19769 Add --graph.
19770
19771 2001-09-18 Marc Autret <autret_m@epita.fr>
19772
19773 * tests/regression.at: New test (comment in %union).
19774
19775 2001-09-18 Marc Autret <autret_m@epita.fr>
19776
19777 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
19778 do that.
19779 Reported by Keith Browne.
19780
19781 2001-09-18 Marc Autret <autret_m@epita.fr>
19782
19783 * tests/output.at: Add tests for --defines and --graph.
19784
19785 2001-09-18 Marc Autret <autret_m@epita.fr>
19786
19787 * tests/output.at: Removes tests of %{header,src}_extension features.
19788
19789 2001-09-18 Akim Demaille <akim@epita.fr>
19790
19791 * tests/Makefile.am (package.m4): New.
19792 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
19793 (_AT_CHECK_CALC_ERROR): Likewise.
19794 Factor the `, ' part of verbose error messages.
19795
19796 2001-09-18 Marc Autret <autret_m@epita.fr>
19797
19798 * src/getargs.c (longopts): Declare --defines and --graph as options
19799 with optional arguments.
19800 * src/files.h: Add extern declarations.
19801 * src/files.c (spec_graph_file, spec_defines_file): New.
19802 (output_files): Update.
19803 Remove CPP-outed code.
19804
19805 2001-09-18 Marc Autret <autret_m@epita.fr>
19806
19807 Turn off %{source,header}_extension feature.
19808
19809 * src/files.c (compute_exts_from_gf): Update.
19810 (compute_exts_from_src): Update.
19811 (output_files): CPP-out useless code.
19812 * src/files.h: Remove {header,source}_extension extern declarations.
19813 * src/reader.c (parse_dquoted_param): CPP-out.
19814 (parse_header_extension_decl): Remove.
19815 (parse_source_extension_decl): Remove.
19816 (read_declarations): Remove cases tok_{hdrext,srcext}.
19817 * src/lex.c (percent_table): Remove {header,source}_extension entries.
19818 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
19819
19820 2001-09-10 Akim Demaille <akim@epita.fr>
19821
19822 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
19823 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
19824 (AT_CHECK_OUTPUT): this.
19825 Merely check ls' exit status, its output is useless.
19826
19827 2001-09-10 Akim Demaille <akim@epita.fr>
19828
19829 * tests/calc.at: Use m4_match.
19830 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
19831
19832 2001-09-10 Marc Autret <autret_m@epita.fr>,
19833 Akim Demaille <akim@epita.fr>
19834
19835 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
19836 enum color_e.
19837 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
19838 to `normal'.
19839 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
19840 * src/lex.h: Adjust prototype.
19841 (token_t): Add `tok_undef'.
19842 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
19843 (parse_percent_token): Now returns token_t.
19844 Add default statement in switch.
19845 (lex): Separate `c' as an input variable, from the token_t result
19846 part.
19847 (unlexed): Is a token_t.
19848
19849 2001-09-10 Akim Demaille <akim@epita.fr>
19850
19851 * configure.in: Bump to 1.29a.
19852
19853 2001-09-07 Akim Demaille <akim@epita.fr>
19854
19855 Version 1.29.
19856
19857 2001-08-30 Akim Demaille <akim@epita.fr>
19858
19859 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
19860 * m4/atconfig.m4: Remove.
19861 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
19862 * tests/bison: New.
19863 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
19864 m4_if, m4_patsubst, and m4_regexp.
19865 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
19866 `input' file instead of echo.
19867
19868 2001-08-29 Akim Demaille <akim@epita.fr>
19869
19870 Bump to 1.28e.
19871
19872 2001-08-29 Akim Demaille <akim@epita.fr>
19873
19874 Version 1.28d.
19875
19876 2001-08-29 Paul Eggert <eggert@twinsun.com>
19877
19878 * src/bison.simple (yyparse): Don't take the address of an
19879 item before the start of an array, as that doesn't conform to
19880 the C Standard.
19881
19882 2001-08-29 Robert Anisko <anisko_r@epita.fr>
19883
19884 * doc/bison.texinfo (Location Tracking Calc): New node.
19885
19886 2001-08-29 Paul Eggert <eggert@twinsun.com>
19887
19888 * src/output.c (output): Do not define const, as this now
19889 causes more problems than it cures.
19890
19891 2001-08-29 Akim Demaille <akim@epita.fr>
19892
19893 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
19894 the nodes.
19895 Be sure to tag the `detailmenu'.
19896
19897 2001-08-29 Akim Demaille <akim@epita.fr>
19898
19899 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
19900 download in a tmp dir.
19901
19902 2001-08-28 Marc Autret <autret_m@epita.fr>
19903
19904 * config/depcomp: New file.
19905
19906 2001-08-28 Marc Autret <autret_m@epita.fr>
19907
19908 * doc/bison.1 (mandoc): Adjust.
19909 From Juan Manuel Guerrero.
19910
19911 2001-08-28 Marc Autret <autret_m@epita.fr>
19912
19913 * src/print_graph.c (print_state): Fix.
19914
19915 2001-08-27 Marc Autret <autret_m@epita.fr>
19916
19917 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
19918 char * members.
19919 Echo modifications to the functions prototypes.
19920 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
19921
19922 2001-08-27 Marc Autret <autret_m@epita.fr>
19923
19924 * src/vcg.c: Include `xalloc.h'.
19925 (add_colorentry): New.
19926 (add_classname): New.
19927 (add_infoname): New.
19928 * src/vcg.h: Add new prototypes.
19929
19930 2001-08-27 Akim Demaille <akim@epita.fr>
19931
19932 * Makefile.maint: Sync. again with CVS Autoconf.
19933
19934 2001-08-27 Akim Demaille <akim@epita.fr>
19935
19936 * Makefile.maint: Formatting changes.
19937 (po-update, cvs-update, update): New targets.
19938 (AMTAR): Remove.
19939
19940 2001-08-27 Akim Demaille <akim@epita.fr>
19941
19942 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
19943 * Makefile.maint: Sync. with CVS Autoconf.
19944
19945 2001-08-27 Marc Autret <autret_m@epita.fr>
19946
19947 * src/vcg.h (struct infoname_s): New.
19948 (struct colorentry_s): New.
19949 (graph_s): New fields {vertical,horizontal}_order in structure.
19950 Add `infoname' field.
19951 Add `colorentry' field;
19952 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
19953 (G_HORIZONTAL_ORDER): New.
19954 (G_INFONAME): New.
19955 (G_COLORENTRY): New.
19956 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
19957 Add output of `infoname'.
19958 Add output of `colorentry'.
19959
19960 2001-08-27 Marc Autret <autret_m@epita.fr>
19961
19962 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
19963 This one shadowed a global parameter.
19964
19965 2001-08-24 Marc Autret <autret_m@epita.fr>
19966
19967 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
19968 instead of `unsigned'.
19969 (print_state): Do not call obstack_object_size () in obstack_grow ()
19970 to avoid macro variables shadowing.
19971
19972 2001-08-23 Marc Autret <autret_m@epita.fr>
19973
19974 * src/lex.c (percent_table): Typo: s/naem/name/.
19975 Add graph option.
19976 Normalize new options declarations.
19977
19978 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
19979
19980 * tests/suite.at: Exercise %header_extension and %source_extension.
19981
19982 2001-08-16 Marc Autret <autret_m@epita.fr>
19983
19984 * src/reader.c (parse_dquoted_param): New.
19985 (parse_header_extension_decl): Use it.
19986 (parse_source_extension_decl): Likewise.
19987
19988 2001-08-16 Marc Autret <autret_m@epita.fr>
19989
19990 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
19991 (get_xxxx_str): Use assert () instead of complain ().
19992 Remove return invokations in default cases.
19993 (get_decision_str): Modify default behaviour. Remove second argument.
19994 Echo modifications on calls.
19995 (output_graph): Fix.
19996
19997 2001-08-16 Marc Autret <autret_m@epita.fr>
19998
19999 * src/getargs.c (usage): Update with ``-g, --graph''.
20000
20001 2001-08-16 Marc Autret <autret_m@epita.fr>
20002
20003 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
20004 (Option Cross Key): Likewise.
20005 * doc/bison.1: Update.
20006
1c8c2190
PB
200072001-09-25 Pascal Bart <pascal.bart@epita.fr>
20008
20009 * src/output.c (output_master_parser): Don't finish action_obstack.
20010 (output_parser): Don't care about the muscle action, here.
20011 (prepare): Copy the action_obstack in the action muscle.
20012 (output): Free action_obstack.
20013
180d45ba
PB
200142001-09-23 Pascal Bart <pascal.bart@epita.fr>
20015
20016 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
20017 will contain `%union' declaration.
20018 (parse_union_decl): Delete #line directive output.
20019 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
20020 informations about %union.
20021 (parse_union_decl): Copy the union_obstack in the muscle stype.
20022 * src/bison.simple: Add new #line directive.
20023 Add typdef %%stype YYSTYPE.
20024
c51d1a19
PB
200252001-09-23 Pascal Bart <pascal.bart@epita.fr>
20026
20027 * src/bison.simple: Add new `#line' directive.
20028
6f9344da
PB
200292001-09-22 Pascal Bart <pascal.bart@epita.fr>
20030
20031 * src/bison.simple: New `#line' directive.
20032 * src/output.c (output_parser): Support new dynamic muscle input_line.
20033
652def80
MA
200342001-09-22 Marc Autret <autret_m@epita.fr>
20035
20036 * src/output.c (output_master_parser): New.
20037 (output_parser): Be more re-entrant.
20038
25b222fa
MA
200392001-09-21 Marc Autret <autret_m@epita.fr>
20040
20041 * src/reader.c (copy_definition, parse_union_decl): Update and use
20042 `linef' muscle.
20043 (copy_action): Likewise.
20044 Use obstack_1grow ().
20045 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
20046
6bc35ae5
MA
200472001-09-21 Marc Autret <autret_m@epita.fr>
20048
20049 * src/options.c (option_table): Adjust.
20050 * src/lex.c (parse_percent_token): Fix.
20051
c0629aa1
PB
200522001-09-20 Pascal Bart <pascal.bart@epita.fr>
20053
20054 * src/options.c (symtab.h): Include it, need by lex.h.
342b8b6e 20055
82b6d266
PB
200562001-09-20 Pascal Bart <pascal.bart@epita.fr>
20057
20058 * src/lex.c (parse_percent_token): Change type of variable `tx', which
20059 is now an option_table_struct*.
20060 (option_strcmp): New function option_strcmp.
20061 (parse_percent_token): Call option_strcmp.
20062 * src/getargs.c (xalloc.h, options.h): Include it.
20063 (getargs): Call create_long_option_table.
20064 (getargs): Free longopts at the end of the function.
20065 (shortopts): Move in options.c.
20066 * src/options.c (create_long_option_table): New function. Convert
20067 information from option_table to option structure.
20068 * src/reader.c (options.h): Include it.
20069
20070 * src/Makefile.am: Adjust.
20071 * src/options.c (option_table): Create from longopts and percent_table.
20072 * src/getargs.c (longopts): Delete.
20073 * src/lex.c (struct percent_table_struct): Delete.
20074 (percent_table): Delete.
20075 (options.h): Include it.
20076 * src/options.c: Create.
20077 * src/options.h: Create.
20078 Declare enum opt_access_e.
20079 Define struct option_table_struct.
20080
75f5aaea
MA
200812001-09-20 Marc Autret <autret_m@epita.fr>
20082
20083 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
20084 sections of Bison.
20085
f508cb0a
PB
200862001-09-19 Pascal Bart <pascal.bart@epita.fr>
20087
20088 * src/bison.simple: s/%%filename/%%skeleton.
20089 * src/muscle_tab.c (getargs.h): Include it.
20090 (muscle_init): Insert new muscle skeleton.
20091
13105fc1
PB
200922001-09-18 Pascal Bart <pascal.bart@epita.fr>
20093
20094 * src/output.c (output_parser): Delete unused variable actions_dumped.
20095
b0c4483e
PB
200962001-09-07 Pascal Bart <pascal.bart@epita.fr>
20097
20098 * src/output.c (output): Delete call to reader_output_yylsp.
20099 * src/reader.c (reader): Likewise.
ba0fe3c7 20100 * src/reader.h: Delete declaration of reader_output_yylsp.
342b8b6e 20101
11d82f03
MA
201022001-09-02 Marc Autret <autret_m@epita.fr>
20103
20104 * src/reader.c: Include muscle_tab.h.
20105 (parse_union_decl): Update.
20106 (parse_macro_decl): Rename parse_muscle_decl.
20107 Update to use renamed functions and variable.
20108 (read_declarations, copy_action, read_additionnal_code, : Updated
20109 with correct variables and functions names.
20110 (packsymbols, reader): Likewise.
342b8b6e 20111
11d82f03 20112 * src/reader.h (muscle_obstack): Extern declaration update.
342b8b6e 20113
11d82f03
MA
20114 * src/output.c: Include muscle_tab.h
20115 In all functions using macro_insert, change by using muscle_insert ().
20116 (macro_obstack): Rename muscle_obstack.
20117 Echo modifications in the whole file.
20118 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
20119 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
20120 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
20121
20122 * src/muscle_tab.h: Update double inclusion macros.
20123 (macro_entry_s): Rename muscle_entry_s.
20124 Update prototypes.
342b8b6e 20125
11d82f03
MA
20126 * src/muscle_tab.c: Include muscle_tab.h.
20127 Rename macro_tabble to muscle_table.
20128 (mhash1, mhash2, mcmp): Use muscle_entry.
20129 (macro_init): Rename muscle_init. Update.
20130 (macro_insert): Rename muscle_insert. Update.
20131 (macro_find): Rename muscle_find. Update.
20132
20133 * src/main.c: Include muscle_tab.h.
20134 (main): Call muscle_init ().
20135 * src/Makefile.am (bison_SOURCES): Echo modifications.
20136
93a37297
MA
201372001-09-02 Marc Autret <autret_m@epita.fr>
20138
f753cd62 20139 Now the files macro_tab.[ch] are named muscle_tab.[ch].
342b8b6e 20140
f753cd62
MA
20141 * src/muscle_tab.c, src/muscle_tab.h: Add files.
20142
201432001-09-02 Marc Autret <autret_m@epita.fr>
20144
20145 * src/macrotab.c, src/macrotab.h: Remove.
93a37297 20146
682d48cd
PB
201472001-09-01 Pascal Bart <pascal.bart@epita.fr>
20148
342b8b6e 20149 * src/reader.c (copy_guard): Use muscle to specify the `#line'
682d48cd
PB
20150 filename.
20151
087c8fda
MA
201522001-09-01 Marc Autret <autret_m@epita.fr>
20153
20154 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
20155 to an explicit value to activate the feature. We do it here.
20156
dda680cb
PB
201572001-08-31 Pascal Bart <pascal.bart@epita.fr>
20158
20159 * src/output.c (prepare): Delete the `filename' muscule insertion.
20160 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
20161 (parse_union_decl): Likewise.
20162 * src/macrotab.c (macro_init): Initialize filename by infile.
20163
9e644e64
MA
201642001-08-31 Marc Autret <autret_m@epita.fr>
20165
20166 * src/bison.simple (YYLSP_NEEDED): New definition.
20167 * src/output.c (prepare): Add macro insertion of `locations_flag'
20168
17da6427
PB
201692001-08-31 Pascal Bart <pascal.bart@epita.fr>
20170
20171 * src/output.c (prepare): Delete insertion of previous muscles,
20172 and insert the `prefix' muscles.
20173 * src/macrotab.c (macro_init): Likewise.
20174 (macro_init): Initialization prefix directive by `yy'.
342b8b6e 20175 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17da6427
PB
20176 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
20177 yylval, yydebug, yyerror, yynerrs and yyparse.
342b8b6e 20178 New directive `#define' to substitute yydebug, ... with option
17da6427
PB
20179 name_prefix.
20180
e8cb70b9
PB
201812001-08-31 Pascal Bart <pascal.bart@epita.fr>
20182
20183 * src/main.c (main): Standardize.
20184 * src/output.c (output_table_data, output_parser): Likewise.
20185 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
20186
63c2d5de
MA
201872001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
20188
342b8b6e 20189 * src/reader.c (read_additionnal_code): Rename %%user_code to
63c2d5de
MA
20190 %%epilogue.
20191 * src/output.c (output): Rename %%declarations to %%prologue.
20192 * src/bison.simple: Echo modifications.
342b8b6e 20193
d8cb5183
MA
201942001-08-31 Marc Autret <autret_m@epita.fr>
20195
20196 * src/reader.c (readgram): CleanUp.
20197 (output_token_defines): Likewise.
20198 (packsymbols): Likewise.
20199 (reader): Likewise.
20200 * src/output.c (output): CPP-out useless code.
20201
6c686258
PB
202022001-08-31 Pascal Bart <pascal.bart@epita.fr>
20203
342b8b6e 20204 * src/reader.c (reader): Delete obsolete call to function
6c686258
PB
20205 output_trailers and output_headers.
20206 * src/output.h: Remove obsolete functions prototypes of output_headers
20207 and output_trailers.
20208
8f451ef7
PB
202092001-08-30 Pascal Bart <pascal.bart@epita.fr>
20210
20211 * src/main.c: Include macrotab.h.
342b8b6e 20212 * src/macrotab.h (macro_entry_s): Constify fields.
8f451ef7
PB
20213 Adjust functions prototypes.
20214 * src/macrotab.c (macro_insert): Constify key and value.
20215 (macro_find): Constify key.
20216 (macro_insert): Include 'xalloc.h'
20217 (macro_insert): Use XMALLOC.
20218 (macro_find): Constify return value.
20219 * src/output.c (output_table_data): Rename table to table_data.
20220 (output_parser): Constify macro_key, macro_value.
20221
997b6fd0 202222001-08-30 Marc Autret <autret_m@epita.fr>
2ba3b73c
MA
20223
20224 * src/reader.c (parse_skel_decl): New.
342b8b6e 20225 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
2ba3b73c
MA
20226 * src/lex.h (token_t): New token `tok_skel'.
20227 * src/lex.c (percent_table): Add skeleton option entry.
20228 Standardize.
20229
ff48177d
MA
202302001-08-29 Marc Autret <autret_m@epita.fr>
20231
20232 * src/bison.simple: Add %%user_code directive at the end.
20233 * src/reader.c (read_additionnal_code): New.
20234 (reader): Use it.
20235 * src/output.c (output_program): Remove.
20236 (output): Update.
20237
b33160bf
MA
202382001-08-28 Marc Autret <autret_m@epita.fr>
20239
20240 * src/output.c (output_actions): Clean up.
4e5caae2 20241 (output_gram): CPP-out useless code.
b33160bf
MA
20242 * src/reader.c (reader): Clean up, CPP-out useless code.
20243
d1a2daf7
PB
202442001-08-28 Pascal Bart <pascal.bart@epita.fr>
20245
342b8b6e 20246 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
535c0e75 20247 directive.
d1a2daf7
PB
20248 * src/bison.simple: Add `%%definitions'.
20249
2b763dfe
MA
202502001-08-28 Marc Autret <autret_m@epita.fr>
20251
20252 * config/depcomp: New file.
20253
f1a87ef6
PE
202542001-08-27 Paul Eggert <eggert@twinsun.com>
20255
20256 * src/bison.simple (yyparse): Don't take the address of an
20257 item before the start of an array, as that doesn't conform to
20258 the C Standard.
20259
82e236e2
RA
202602001-08-27 Robert Anisko <robert.anisko@epita.fr>
20261
f1a87ef6 20262 * src/output.c (output): Remove the initialization of the macro
82e236e2
RA
20263 obstack. It was done too late here.
20264
20265 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
20266 completely wrong.
20267 (reader): Initialize the macro obstack here, since we need it to grow
20268 '%define' directives.
20269
20270 * src/reader.h: Declare the macro obstack as extern.
20271
b0cfa28a
RA
202722001-08-27 Robert Anisko <robert.anisko@epita.fr>
20273
20274 * src/output.c (output_parser): Fix. Store single '%' characters in
20275 the output obstack instead of throwing them away.
20276
6fc74234
AD
202772001-08-27 Akim Demaille <akim@epita.fr>
20278
20279 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
20280
9c76d118
RA
202812001-08-25 Robert Anisko <robert.anisko@epita.fr>
20282
20283 * lib/Makefile.am: Adjust.
20284
a8289c62
RA
202852001-08-25 Robert Anisko <robert.anisko@epita.fr>
20286
20287 * src/bison.simple: Update and add '%%' directives.
20288
b6610515
RA
202892001-08-25 Robert Anisko <robert.anisko@epita.fr>
20290
20291 * src/reader.c (reader): Remove calls to 'output_headers' and
20292 'output_trailers'. Remove some C output.
20293 (readgram): Disable a piece of code that was writing a default
20294 definition for 'YYSTYPE'.
20295 (reader_output_yylsp): Remove.
20296 (packsymbols): Output token defintions to a macro.
20297 (copy_definition): Disable C output.
6fc74234 20298
b6610515
RA
20299 * src/reader.c (parse_macro_decl): New function used to parse macro
20300 declarations.
20301 (copy_string2): Put the body of copy_string into this new function.
20302 Add a parameter to let the caller choose whether he wants to copy the
20303 string delimiters or not.
20304 (copy_string): Be a simple call to copy_string2 with the last argument
20305 bound to true.
20306 (read_declarations): Add case for macro definition.
20307 (copy_identifier): New.
6fc74234 20308 (parse_macro_decl): Read macro identifiers using copy_identifier
b6610515
RA
20309 rather than lex.
20310
26f609ff
RA
203112001-08-25 Robert Anisko <robert.anisko@epita.fr>
20312
20313 * src/output.c (prepare): Add prefixed names.
20314 (output_parser): Output semantic actions.
20315 (output_parser): Fix bug on '%%line' directives.
6fc74234 20316
26f609ff
RA
20317 * src/output.c (output_headers): Remove. The C code printed by this
20318 function should now be in the skeletons.
20319 (output_trailers): Remove.
20320 (output): Disable call to 'reader_output_yylsp'.
20321 (output_rule_data): Do not output tables to the table obstack.
20322
20323 * src/output.c: Remove some C dedicated output.
20324 Improve the use of macro and output obstacks.
20325 (output_defines): Remove.
6fc74234 20326
26f609ff
RA
20327 * src/output.c (output_token_translations): Associate 'translate'
20328 table with a macro. No output to the table obstack.
20329 (output_gram): Same for 'rhs' and 'prhs'.
20330 (output_stos): Same for 'stos'.
20331 (output_rule_data): Same for 'r1' and 'r2'.
20332 (token_actions): Same for 'defact'.
20333 (goto_actions): Same for 'defgoto'.
20334 (output_base): Same for 'pact' and 'pgoto'.
20335 (output_table): Same for 'table'.
20336 (output_check): Same for 'check'.
6fc74234 20337
26f609ff
RA
20338 * src/output.c (output_table_data): New function.
20339 (output_short_table): Remove.
20340 (output_short_or_char_table): Remove.
6fc74234 20341
26f609ff
RA
20342 * src/output.c (output_parser): Replace most of the skeleton copy code
20343 with something new. Skeletons are now processed character by character
20344 rather than line by line, and Bison looks for '%%' macros. This is the
20345 first step in making Bison's output process (a lot) more flexible.
20346 (output_parser): Use the macro table.
20347
6f43b113
RA
203482001-08-25 Robert Anisko <robert.anisko@epita.fr>
20349
20350 * src/main.c (main): Initialize the macro table.
20351
dd3127cf
RA
203522001-08-25 Robert Anisko <robert.anisko@epita.fr>
20353
20354 * src/lex.c (percent_table): Add tok_define.
20355 * src/lex.h: Add tok_define.
20356
aa321494
RA
203572001-08-25 Robert Anisko <robert.anisko@epita.fr>
20358
20359 * src/macrotab.c: New file.
20360 * src/macrotab.h: New file.
20361 * src/Makefile.am: Update.
20362
68bd3b6b
RA
203632001-08-25 Robert Anisko <robert.anisko@epita.fr>
20364
20365 * lib/hash.c: New file.
20366 * lib/hash.h: New file.
20367 * lib/Makefile.am: Update.
20368
45f8dd1e
AD
203692001-08-15 Akim Demaille <akim@epita.fr>
20370
20371 Version 1.28c.
20372
40a64a7a 203732001-08-15 Marc Autret <autret_m@epita.fr>
0b8afb77
AD
20374
20375 * src/reader.c (readgram): Indent output macro YYSTYPE.
20376 (packsymbols): Likewise.
20377 (output_token_defines): Likewise.
20378 * src/files.c: Standardize.
20379 (compute_header_macro): New.
20380 (defines_obstack_save): New. Use compute_header_macro.
20381 (output_files): Update. Use defines_obstack_save.
20382
f9a8293a
AD
203832001-08-15 Akim Demaille <akim@epita.fr>
20384
20385 * doc/bison.texinfo (Table of Symbols): Document
20386 YYSTACK_USE_ALLOCA.
20387
150ca7a7
AD
203882001-08-15 Akim Demaille <akim@epita.fr>
20389
20390 * missing: Update from CVS Automake.
20391 * config/config.guess, config/config.sub, config/texinfo.tex:
20392 Update from gnu.org.
20393
69b5cec4
AD
203942001-08-15 Akim Demaille <akim@epita.fr>
20395
20396 * Makefile.maint: Sync with CVS Autoconf.
20397
f2b5126e
PB
203982001-08-14 Pascal Bart <pascal.bart@epita.fr>
20399
69b5cec4 20400 * doc/bison.texinfo: Include GNU Free Documentation License from
f2b5126e
PB
20401 `fdl.texi'.
20402 * doc/fdl.texi: Add to package.
20403
4ecbf796
MA
204042001-08-14 Marc Autret <autret_m@epita.fr>
20405
20406 Turn on %{source,header}_extension features.
20407
69b5cec4 20408 * src/lex.c (percent_table): Un-CPP out header_extension and
4ecbf796
MA
20409 source_extension.
20410 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
69b5cec4 20411 (compute_exts_from_src): Remove conditions. It restores priorities
4ecbf796
MA
20412 between options.
20413
95fb5662
MA
204142001-08-14 Marc Autret <autret_m@epita.fr>
20415
20416 * src/files.c (compute_base_names): Add extensions computing when
20417 `--file-prefix' used.
20418 Standardize function calls.
20419
78d09da9
MA
204202001-08-13 Marc Autret <autret_m@epita.fr>
20421
69b5cec4 20422 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
78d09da9
MA
20423 defining it (defined but null disables alloca).
20424
5a009f2c
MA
204252001-08-13 Marc Autret <autret_m@epita.fr>
20426
20427 * src/bison.simple (_yy_memcpy): CPP reformat.
20428
1e41465a
PB
204292001-08-13 Pascal Bart <pascal.bart@epita.fr>
20430
20431 * tests/atconfig.in (CPPFLAGS): Fix.
20432
c67a198d
PB
204332001-08-10 Pascal Bart <pascal.bart@epita.fr>
20434
79282c6c 20435 * doc/bison.texinfo: Include GNU General Public License from
c67a198d
PB
20436 `gpl.texi'.
20437 * doc/gpl.texi: Add to package.
20438
09a6de7e
MA
204392001-08-10 Marc Autret <autret_m@epita.fr>
20440
20441 * src/print_graph.h: Fix.
20442 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
20443
b77b9ee0
AD
204442001-08-10 Akim Demaille <akim@epita.fr>
20445
20446 * src/system.h: Provide default declarations for stpcpy, strndup,
20447 and strnlen.
20448
3e259915
MA
204492001-08-10 Robert Anisko <anisko_r@epita.fr>
20450
20451 * doc/bison.texinfo (Locations): Update @$ stuff.
20452
ca96bc2d
MA
204532001-08-09 Robert Anisko <anisko_r@epita.fr>
20454
20455 * src/bison.simple (YYLLOC_DEFAULT): Update.
20456 (yyparse): Adjust.
20457
fdc6758b
MA
204582001-08-08 Marc Autret <autret_m@epita.fr>
20459
b77b9ee0 20460 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
fdc6758b
MA
20461 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
20462 Reported by Fabrice Bauzac.
957d4dbf 20463
600cad3b
MA
204642001-08-08 Marc Autret <autret_m@epita.fr>
20465
20466 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
20467 * src/vcg.c (output_node): Fix.
20468 * src/vcg.h: Cleanup.
20469 * src/print_graph.c: Add comments.
b77b9ee0 20470 (node_output_size): New global variable. Simplify the formatting of
600cad3b 20471 the VCG graph output.
b77b9ee0 20472 (print_actions): Unused code is now used. It notifies the final state
600cad3b 20473 and no action states in the VCG graph. It also give the reduce actions.
b77b9ee0 20474 The `shift and goto' edges are red and the `go to state' edges are
600cad3b
MA
20475 blue.
20476 Get the current node name and node_obstack by argument.
20477 (node_obstack): New variable.
20478 (print_state): Manage node_obstack.
20479 (print_core): Use node_obstack given by argument.
20480 A node is not only computed here but in print_actions also.
20481 (print_graph): CPP out useless code instead of commenting it.
20482
976e528f
AD
204832001-08-07 Pascal Bart <pascal.bart@epita.fr>
20484
20485 * tests/atconfig.in (CPPFLAGS): Fix.
20486
20e8e5ca
AD
204872001-08-07 Akim Demaille <akim@epita.fr>
20488
20489 * src/print_graph.c (quote): New.
20490 (print_core): Use it.
20491
957d4dbf 204922001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
3e3da797 20493
3e3da797
AD
20494 * src/vcg.c (complain.h): Include it.
20495 Unepitaize `return' invocations.
c4b66126 20496 [NDEBUG] (main): Remove.
79282c6c 20497 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
c4b66126
AD
20498 * src/files.c (open_files): Initialize graph_obstack.
20499 * src/print_graph.c (print_actions): CPP out useless code.
20500 (print_core): Don't output the last `\n' in labels.
20501 Use `quote'.
20502 * src/files.c (output_files): Output the VCG file.
20503 * src/main.c (main): Invoke print_graph ();
3e3da797 20504
957d4dbf 205052001-08-06 Marc Autret <autret_m@epita.fr>
22c2cbc0
AD
20506
20507 Automaton VCG graph output.
20508 Using option ``-g'' or long option ``--graph'', you can generate
20509 a gram_filename.vcg file containing a VCG description of the LALR (1)
20510 automaton of your grammar.
20511
20512 * src/main.c: Call to print_graph() function.
20513 * src/getargs.h: Update.
20514 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
20515 (graph_flag): New flag.
20516 (longopts): Update.
20517 (getargs): Add case `g'.
20518 * src/files.c (graph_obstack): New obstack struct.
20519 (open_files): Initialize new obstack.
20520 (output_files): Saves graph_obstack if required.
20521 * src/files.h (graph_obstack): New extern declaration.
20522 * src/Makefile.am: Add new source files.
20523
927c1557 205242001-08-06 Marc Autret <autret_m@epita.fr>
ce4d5ce0
AD
20525
20526 * src/print_graph.c, src/print_graph.h (graph): New.
20527 * src/vcg.h: New file.
20528 * src/vcg.c: New file, VCG graph handling.
20529
7333d403
AD
205302001-08-06 Marc Autret <autret_m@epita.fr>
20531
20532 Add of %source_extension and %header_extension which specify
20533 the source or/and the header output file extension.
20534
20535 * src/files.c (compute_base_names): Remove initialisation of
20536 src_extension and header_extension.
20537 (compute_exts_from_gf): Update.
20538 (compute_exts_from_src): Update.
20539 (output_files): Update.
20540 * src/reader.c (parse_header_extension_decl): New.
20541 (parse_source_extension_decl): New.
20542 (read_declarations): New case statements for the new tokens.
20543 * src/lex.c (percent_table): Add entries for %source_extension
20544 and %header_extension.
20545 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
20546
84163231
AD
205472001-08-06 Marc Autret <autret_m@epita.fr>
20548
20549 * configure.in: Bump to 1.28c.
20550 * doc/bison.texinfo: Texinfo thingies.
20551
8303fc42
AD
205522001-08-04 Pascal Bart <pascal.bart@epita.fr>
20553
20554 * tests/atconfig.in (CPPFLAGS): Add.
20555 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
20556
70a84437
AD
205572001-08-03 Akim Demaille <akim@epita.fr>
20558
20559 Version 1.28b.
20560
2ce10144
AD
205612001-08-03 Akim Demaille <akim@epita.fr>
20562
20563 * tests/Makefile.am (check-local): Ship testsuite.
20564 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
20565 Include `string.h'.
20566
1e3e4bc1
AD
205672001-08-03 Akim Demaille <akim@epita.fr>
20568
20569 * configure.in: Try using -Wformat when compiling.
20570
42b45b7f
AD
205712001-08-03 Akim Demaille <akim@epita.fr>
20572
20573 * configure.in: Bump to 1.28b.
20574
8f13fe33
AD
205752001-08-03 Akim Demaille <akim@epita.fr>
20576
20577 * src/complain.c: Adjust strerror_r portability issues.
20578
b37ba92c
AD
205792001-08-03 Akim Demaille <akim@epita.fr>
20580
20581 Version 1.28a.
20582
b0ce6046
AD
205832001-08-03 Akim Demaille <akim@epita.fr>
20584
20585 * src/getargs.c, src/getarg.h (skeleton)): Constify.
20586 * src/lex.c (literalchar): Avoid name clashes on `buf'.
20587 * src/getargs.c: Include complain.h.
20588 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
20589 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
20590
d01c415b
AD
205912001-08-03 Akim Demaille <akim@epita.fr>
20592
20593 * src/reader.c (readgram): Display hidden chars in error messages.
20594
459dd1a6
AD
205952001-08-03 Akim Demaille <akim@epita.fr>
20596
20597 Update to gettext 0.10.39.
20598
53b74c0c
AD
205992001-08-03 Akim Demaille <akim@epita.fr>
20600
20601 * lib/strspn.c: New.
20602
234a3be3
AD
206032001-08-01 Marc Autret <autret_m@epita.fr>
20604
20605 * doc/bison.texinfo: Update.
20606 * doc/bison.1 (mandoc): Update.
20607 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
20608 * src/files.c: Support output files extensions computing.
20609 (src_extension): New static variable.
20610 (header_extension): New static variable.
20611 (tr): New function.
20612 (get_extension_index): New function, gets the index of an extension
20613 filename in a string.
20614 (compute_exts_from_gf): New function, computes extensions from the
20615 grammar file extension.
20616 (compute_exts_from_src): New functions, computes extensions from the
20617 C source file extension, file given by ``-o'' option.
20618 (compute_base_names): Update.
20619 (output_files): Update.
20620
847bf1f5
AD
206212001-08-01 Robert Anisko <anisko_r@epita.fr>
20622
d995fee7 20623 * doc/bison.texi: Document @$.
847bf1f5
AD
20624 (Locations): New section.
20625
d074a105
AD
206262001-07-18 Akim Demaille <akim@epita.fr>
20627
20628 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
20629 * config/prev-version.txt, config/move-if-change: New.
20630 * Makefile.am: Adjust.
20631
3419715d
AD
206322001-07-08 Pascal Bart <pascal.bart@epita.fr>
20633
20634 * src/bison.simple (yyparse): Suppress warning `comparaison
20635 between signed and unsigned'.
20636
62ab6972
AD
206372001-07-05 Pascal Bart <pascal.bart@epita.fr>
20638
20639 * src/getargs.h (raw_flag): Remove.
20640 * src/getargs.c: Die on `-r'/`--raw'.
20641 * src/lex.c (parse_percent_token): Die on `%raw'.
20642 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
20643 * tests/calc.at: Suppress test with option `--raw'.
20644
1e24cc5b
AD
206452001-07-14 Akim Demaille <akim@epita.fr>
20646
20647 * config/: New.
20648 * configure.in: Require Autoconf 2.50.
20649 Update to gettext 0.10.38.
20650
32dfccf8
AD
206512001-03-16 Akim Demaille <akim@epita.fr>
20652
20653 * doc/bison.texinfo: ANSIfy the examples.
20654
cd5bd6ac
AD
206552001-03-16 Akim Demaille <akim@epita.fr>
20656
20657 * getargs.c (skeleton): New variable.
20658 (longopts): --skeleton is a new option.
20659 (shortopts, getargs): -S is a new option.
20660 * getargs.h: Declare skeleton.
20661 * output.c (output_parser): Use it.
20662
5141b016
AD
206632001-03-16 Akim Demaille <akim@epita.fr>
20664
20665 * m4/strerror_r.m4: New.
20666 * m4/error.m4: Run AC_FUNC_STRERROR_R.
20667 * lib/error.h, lib/error.c: Update.
20668
447992b9
AD
206692001-03-16 Akim Demaille <akim@epita.fr>
20670
20671 * src/getargs.c (longopts): Clean up.
20672
274d42ce
AD
206732001-02-21 Akim Demaille <akim@epita.fr>
20674
20675 * src/reader.c (gensym): `gensym_count' is your own.
20676 Use a static buf to create the symbol name, as token_buffer is no
20677 longer a buffer.
20678
22c821f3
AD
206792001-02-08 Akim Demaille <akim@epita.fr>
20680
20681 * src/conflicts.c (conflict_report): Be sure not to append to res
20682 between two calls, which could happen if both first sprintf were
20683 skipped, but not the first cp += strlen.
20684
18569462
AD
206852001-02-08 Akim Demaille <akim@epita.fr>
20686
20687 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
20688 New, from fileutils 4.0.37.
20689 * configure.in: Require Autoconf 2.49c. I took some time before
20690 making this decision. This is the only way out for portability
20691 issues in Bison, it would mean way too much duplicate effort to
20692 import in Bison features implemented in 2.49c since 2.13.
20693 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
20694
0d8f3c8a
AD
206952001-02-02 Akim Demaille <akim@epita.fr>
20696
20697 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
66075dcf 20698 * lib/xalloc.h, lib/xmalloc.c: Update.
0d8f3c8a 20699
f17bcd1f
AD
207002001-01-19 Akim Demaille <akim@epita.fr>
20701
20702 Get rid of the ad hoc handling of token_buffer in the scanner: use
20703 the obstacks.
20704
20705 * src/lex.c (token_obstack): New.
20706 (init_lex): Initialize it. No longer call...
20707 (grow_token_buffer): this. Remove it.
20708 Adjust all the places which used it to use the obstack.
20709
511e79b3
AD
207102001-01-19 Akim Demaille <akim@epita.fr>
20711
20712 * src/lex.h: Rename all the tokens:
20713 s/\bENDFILE\b/tok_eof/g;
20714 s/\bIDENTIFIER\b/tok_identifier/g;
20715 etc.
20716 Let them be enums, not #define, to ease debugging.
20717 Adjust all the code.
20718
0d6508ef
AD
207192001-01-18 Akim Demaille <akim@epita.fr>
20720
20721 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
20722 * src/lex.c (maxtoken, grow_token_buffer): Static.
20723
6deb4447
AD
207242001-01-18 Akim Demaille <akim@epita.fr>
20725
20726 Since we now use obstacks, more % directives can be enabled.
20727
20728 * src/lex.c (percent_table): Also accept `%yacc',
20729 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
20730 `%debug'.
20731 Handle the actions for `%semantic_parser' and `%pure_parser' here,
20732 instead of returning a token.
20733 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
20734 * src/reader.c (read_declarations): Adjust.
20735 * src/files.c (open_files): Don't call `compute_base_names', don't
20736 compute `attrsfile' since they depend upon data which might be
20737 *in* the input file now.
20738 (output_files): Do it here.
20739 * src/output.c (output_headers): Document the fact that this patch
20740 introduces a guaranteed SEGV for semantic parsers.
20741 * doc/bison.texinfo: Document them.
20742 * tests/suite.at: Exercise these %options.
20743
ff4423cc
AD
207442000-12-20 Akim Demaille <akim@epita.fr>
20745
20746 Also handle the output file (--verbose) with obstacks.
20747
20748 * files.c (foutput): Remove.
20749 (output_obstack): New.
20750 Adjust all dependencies.
20751 * src/conflicts.c: Return a string.
20752 * src/system.h (obstack_grow_string): Rename as...
20753 (obstack_sgrow): this. Be ready to work with non literals.
20754 (obstack_fgrow4): New.
20755
956dba3a
AD
207562000-12-20 Akim Demaille <akim@epita.fr>
20757
20758 * src/files.c (open_files): Fix the computation of short_base_name
20759 in the case of `-o foo.tab.c'.
20760
337bab46
AD
207612000-12-20 Akim Demaille <akim@epita.fr>
20762
20763 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
20764 (copy_dollar): Now that everything uses obstacks, get rid of the
20765 FILE * parameters.
20766
5d3214b8
AD
207672000-12-20 Akim Demaille <akim@epita.fr>
20768
20769 * src/files.c (open_files): Actually the `.output' file is based
20770 on the short_base_name, not base_name.
20771 * tests/suite.at (Checking output file names): Adjust.
20772
29092a57
AD
207732000-12-20 Akim Demaille <akim@epita.fr>
20774
20775 * src/bison.s1: Remove, we now use directly...
20776 * src/bison.simple: this.
20777 * src/Makefile.am: Use pkgdata instead of data.
20778
ea5607fd
AD
207792000-12-20 Akim Demaille <akim@epita.fr>
20780
20781 * src/files.c (guard_obstack): New.
20782 (open_files): Initialize it.
20783 (output_files): Dump it...
20784 * src/files.h: Export it.
20785 * src/reader.c (copy_guard): Use it.
20786
27110317
AD
207872000-12-19 Akim Demaille <akim@epita.fr>
20788
20789 * src/files.c (outfile, defsfile, actfile): Removed as global
20790 vars.
20791 (open_files): Don't compute them.
20792 (output_files): Adjust.
20793 (base_name, short_base_name): Be global.
20794 Adjust dependencies.
20795
19c50364
AD
207962000-12-19 Akim Demaille <akim@epita.fr>
20797
20798 * src/files.c (strsuffix): New.
20799 (stringappend): Be just like strcat but allocate.
20800 (base_names): Eve out from open_files.
20801 Try to simplify the rather hairy computation of base_name and
20802 short_base_name.
20803 (open_files): Use it.
20804 * tests/suite.at (Checking output file names): New test.
20805
573c1d9f
AD
208062000-12-19 Akim Demaille <akim@epita.fr>
20807
20808 * src/system.h (obstack_grow_literal_string): Rename as...
20809 (obstack_grow_string): this.
20810 * src/output.c (output_parser): Recognize `%% actions' instead of
20811 `$'.
20812 * src/bison.s1: s/$/%% actions/.
20813 * src/bison.hairy: Likewise.
20814
ef7ddedd
AD
208152000-12-19 Akim Demaille <akim@epita.fr>
20816
20817 * src/output.c (output_parser): Compute the `#line' lines when
20818 there are.
20819 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
20820 Suggested by Hans Aberg.
20821
ff61dabd
AD
208222000-12-19 Akim Demaille <akim@epita.fr>
20823
20824 Let the handling of the skeleton files be local to the procedures
20825 that use it.
20826
20827 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
20828 longer static.
20829 (fparser, open_extra_files): Remove.
20830 (open_files, output_files): Don't take care of fparser.
20831 * src/files.h: Adjust.
20832 * src/output.c (output_parser): Open and close the file to the
20833 skeleton.
20834 * src/reader.c (read_declarations): When %semantic_parser, open
20835 fguard.
20836
55b96341
AD
208372000-12-19 Akim Demaille <akim@epita.fr>
20838
20839 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
20840 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
20841
358c15b7
AD
208422000-12-19 Akim Demaille <akim@epita.fr>
20843
20844 * src/files.c (open_files): Yipee! We no longer need all the code
20845 looking for `/tmp' since we have no tmp file.
20846
7de3329e
AD
208472000-12-19 Akim Demaille <akim@epita.fr>
20848
20849 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
20850 New macros.
20851 * src/files.c (open_files): Less dependency on MSDOS etc.
20852
3abcd459
AD
208532000-12-14 Akim Demaille <akim@epita.fr>
20854
20855 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
20856 Provide a default definition.
20857 Use it when executing the default @ action.
20858 * src/reader.c (reader_output_yylsp): No longer include
20859 `timestamp' and `text' in the default YYLTYPE.
20860
2a91a95e
AD
208612000-12-12 Akim Demaille <akim@epita.fr>
20862
20863 * src/reader.c (copy_definition, parse_union_decl, copy_action)
20864 (copy_guard): Quote the file names.
20865 Reported by Laurent Mascherpa.
20866
14d3eb9b
AD
208672000-12-12 Akim Demaille <akim@epita.fr>
20868
20869 * src/output.c (output_headers, output_program, output): Be sure
20870 to escape special characters when outputting filenames.
20871 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
20872 (output_headers): Don't depend on them, Use ACTSTR.
20873
d7045ec6
AD
208742000-11-17 Akim Demaille <akim@epita.fr>
20875
20876 * lib/obstack.h: Formatting changes.
20877 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
20878 prevents type checking.
20879 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
20880 cast the value to (void *): assigning a `foo *' to a `void *'
20881 variable is valid.
20882 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
20883 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
20884 append characters.
20885
6fd54b73
AD
208862000-11-17 Akim Demaille <akim@epita.fr>
20887
20888 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
20889 as...
20890 (suite.m4, regression.m4, calc.m4): these.
20891 * tests/atgeneral.m4: Update from CVS Autoconf.
20892
4c50eae6
AD
208932000-11-17 Akim Demaille <akim@epita.fr>
20894
20895 * tests/regression.m4 (%union and --defines): New test,
20896 demonstrating a current bug in the obstack implementation.
20897
a35f64ea
AD
208982000-11-17 Akim Demaille <akim@epita.fr>
20899
20900 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
20901 macros.
20902 Use them to declare the variables which are global or local to
20903 `yyparse'.
20904
7de23534
AD
209052000-11-17 Akim Demaille <akim@epita.fr>
20906
20907 * acconfig.h: Remove, no longer used.
20908
aa7815f5
AD
209092000-11-07 Akim Demaille <akim@epita.fr>
20910
20911 * src: s/Copyright (C)/Copyright/g.
20912
5af1f549
AD
209132000-11-07 Akim Demaille <akim@epita.fr>
20914
20915 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
20916 defining.
20917 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
20918
553e2b22
AD
209192000-11-07 Akim Demaille <akim@epita.fr>
20920
20921 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
20922 Merge in a single CPP if/else.
20923
8a4f41d6
AD
209242000-11-07 Akim Demaille <akim@epita.fr>
20925
20926 * src/output.c (output): Remove useless variables.
20927 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
20928 argument `data' for consistency with the prototypes.
20929 Qualify it `const'.
20930 (obstack_copy, obstack_copy0): Rename the second argument as
20931 `address' for consistency. Qualify it `const'.
20932 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
20933 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
20934 `const' their input argument (`data' or `address').
20935 Adjust the corresponding macros to include `const' in casts.
20936
095a3fb5
AD
209372000-11-03 Akim Demaille <akim@epita.fr>
20938
20939 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
20940 s/PFILE1/BISON_HAIRY/.
20941 Adjust dependencies.
20942
d1cdce7c
AD
209432000-11-03 Akim Demaille <akim@epita.fr>
20944
090c5ebf 20945 For some reason, this was not applied.
d1cdce7c
AD
20946
20947 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
20948 `unlink': it's no longer used.
20949
9311529b
AD
209502000-11-03 Akim Demaille <akim@epita.fr>
20951
20952 * src/files.c (skeleton_find): New function, eved out of...
20953 (open_files, open_extra_files): here.
20954
d8880f69
AD
209552000-11-03 Akim Demaille <akim@epita.fr>
20956
20957 Don't use `atexit'.
20958
20959 * src/files.c (obstack_save): New function.
20960 (done): Rename as...
20961 (output_files): this.
20962 Use `obstack_save'.
20963 * src/main.c (main): Don't use `atexit' to register `done', since
20964 it no longer has to remove tmp files, just call `output_files'
20965 when there are no errors.
20966
0dbb648e
AD
209672000-11-02 Akim Demaille <akim@epita.fr>
20968
20969 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
20970 `unlink': it's no longer used.
20971 * src/files.h: Formatting changes.
20972
896fe5c1
AD
209732000-11-02 Akim Demaille <akim@epita.fr>
20974
20975 Remove the last uses of mktemp and unlink/delete.
20976
20977 * src/files.c (fdefines, ftable): Removed.
20978 (defines_ostack, table_obstack): New.
20979 Adjust dependencies of the former into uses of the latter.
20980 * src/output.c (output_short_or_char_table, output_short_table):
20981 Convert to using obstacks.
20982 * src/reader.c (copy_comment2): Accept one FILE * and two
20983 obstacks.
20984 (output_token_defines, reader_output_yylsp): Use obstacks.
20985 * src/system.h (obstack_fgrow3): New.
1f65350a 20986 * po/POTFILES.in: Adjust.
896fe5c1 20987
dd60faec
AD
209882000-11-01 Akim Demaille <akim@epita.fr>
20989
20990 Change each use of `fattrs' into a use of `attrs_obstack'.
20991
20992 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
20993 * src/files.c (fattrs): Remove.
20994 (attrs_obstack): New.
20995 Adjust all dependencies.
20996 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
20997
8c7ebe49
AD
209982000-11-01 Akim Demaille <akim@epita.fr>
20999
21000 Introduce obstacks.
21001 Change each use of `faction' into a use of `action_obstack'.
21002
21003 * lib/obstack.h, lib/obstack.c: New files.
21004 * src/files.c (faction): Remove.
21005 (action_obstack): New.
21006 Adjust all dependencies.
21007
77aee789
AD
210082000-10-20 Akim Demaille <akim@epita.fr>
21009
21010 * lib/quote.h (PARAMS): New macro. Use it.
21011
43591cec
AD
210122000-10-16 Akim Demaille <akim@epita.fr>
21013
21014 * src/output.c (output_short_or_char_table): New function.
21015 (output_short_table, output_token_translations): Use it.
21016 (goto_actions): Use output_short_table.
21017
1e9798d5
AD
210182000-10-16 Akim Demaille <akim@epita.fr>
21019
21020 * src/symtab.c (bucket_new): New function.
21021 (getsym): Use it.
21022
21023 * src/output.c (output_short_table): New argument to display the
21024 comment associated with the table.
21025 Adjust dependencies.
21026 (output_gram): Use it.
21027 (output_rule_data): Nicer output layout for YYTNAME.
21028
f282676b
AD
210292000-10-16 Akim Demaille <akim@epita.fr>
21030
21031 * src/lex.c (read_typename): New function.
21032 (lex): Use it.
21033 * src/reader.c (copy_dollar): Likewise.
21034
550a72a3
AD
210352000-10-16 Akim Demaille <akim@epita.fr>
21036
21037 * src/reader.c (copy_comment2): Expect the input stream to be on
21038 the `/' which is suspected to open a comment, instead of being
21039 called after `//' or `/*' was read.
21040 (copy_comment, copy_definition, parse_union_decl, copy_action)
21041 (copy_guard): Adjust.
21042
131e2fef
AD
210432000-10-16 Akim Demaille <akim@epita.fr>
21044
21045 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
21046 `read_signed_integer'.
21047
79282c5a
AD
210482000-10-16 Akim Demaille <akim@epita.fr>
21049
21050 * src/reader.c (copy_dollar): New function.
21051 (copy_guard, copy_action): Use it.
21052
ff4a34be
AD
210532000-10-16 Akim Demaille <akim@epita.fr>
21054
21055 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
21056 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
21057 New files, from Fileutils 4.0.27.
21058 * src/main.c (printable_version): Remove.
21059 * src/lex.c, src/reader.c: Use `quote'.
21060
210612000-10-04 Akim Demaille <akim@epita.fr>
21062
21063 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
21064
14ded682
AD
210652000-10-04 Akim Demaille <akim@epita.fr>
21066
21067 * doc/bison.texinfo: Various typos spotted by Neil Booth.
21068
8e03724b
AD
210692000-10-04 Akim Demaille <akim@epita.fr>
21070
21071 When a literal string is used to define two different tokens,
21072 `bison -v' segfaults.
21073 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
21074
21075 * tests/regression.m4: New file.
21076 Include the core of the sample provided by Piotr Gackiewicz.
21077 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
21078 properly.
21079
a9e64249
AD
210802000-10-04 Akim Demaille <akim@epita.fr>
21081
21082 * src/reader.c (parse_expect_decl): Keep `count' within the size
21083 of `buffer'.
21084 From Neil Booth.
21085
da9abf43
AD
210862000-10-02 Paul Eggert <eggert@twinsun.com>
21087
21088 * bison.s1 (yyparse): Assign the default value
21089 unconditionally, to avoid a GCC warning and make the parser a
21090 tad smaller.
21091
c33638bb
AD
210922000-10-02 Akim Demaille <akim@epita.fr>
21093
21094 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
21095 options.
21096
444c570a
AD
210972000-10-02 Akim Demaille <akim@epita.fr>
21098
21099 * src/derives.c, src/print.c, src/reduce.c: To ease the
21100 translation, move some `\n' out of the translated strings.
21101
89cab50d
AD
211022000-10-02 Akim Demaille <akim@epita.fr>
21103
21104 The location tracking mechanism is precious for parse error
21105 messages. Nevertheless, it is enabled only when `@n' is used in
21106 the grammar, which is a different issue (you can use it in error
21107 message, but not in the grammar per se). Therefore, there should
21108 be another means to enable it.
21109
21110 * src/getargs.c (getargs): Support `--locations'.
21111 (usage): Report it.
21112 * src/getargs.h (locationsflag): Export it.
21113 * src/lex.c (percent_table): Support `%locations'.
21114 * src/reader.c (yylsp_needed): Remove this variable, now replaced
21115 with `locationsflag'.
21116 * doc/bison.texinfo: Document `--locations' and `%locations'.
21117 Sort the options.
21118 * tests/calc.m4: Test it.
21119
21120 For regularity of the names, replace each
21121 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
21122 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
21123 In addition replace each `flag' with `_flag'.
21124
d6c2cba0
AD
211252000-10-02 Akim Demaille <akim@epita.fr>
21126
21127 Also test parse error messages, including with YYERROR_VERBOSE.
21128
21129 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
21130 associative).
21131 Use it to check the computations.
21132 Use it to check `nonassoc' is honored.
21133 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
21134 `--yyerror-verbose'.
21135 (_AT_CHECK_CALC): Adjust to this option.
21136 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
21137
5a35a6cb
AD
211382000-10-02 Akim Demaille <akim@epita.fr>
21139
21140 Test also `--verbose', `--defines' and `--name-prefix'. Testing
21141 the latter demonstrates a flaw in the handling of non debugging
21142 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
21143 was used in order to simplify:
21144
21145 #if YYDEBUG
21146 if (yydebug)
21147 {
21148 ...
21149 }
21150 #endif
21151
21152 into
21153
21154 if (yydebug)
21155 {
21156 ...
21157 }
21158
21159 unfortunately this leads to a CPP conflict when
21160 `--name-prefix=foo' is used since it produces `#define yydebug
21161 foodebug'.
21162
21163 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
21164 (YYDPRINTF): New macro.
21165 Spread its use.
21166 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
21167 the bison options.
21168 Also test `--verbose', `--defines' and `--name-prefix'.
21169
71da9eea
AD
211702000-10-02 Akim Demaille <akim@epita.fr>
21171
21172 Improve the readability of the produced parsers.
21173
21174 * src/bison.s1: Formatting changes.
21175 Improve the comment related to the `$' mark.
21176 (yydefault): Don't fall through to `yyresume': `goto' there.
21177 * src/output.c (output_parser): When the `$' is met, skip the end
21178 of its line.
21179 New variable, `number_of_dollar_signs', to check there's exactly
21180 one `$' in the parser skeleton.
21181
95e36146
AD
211822000-10-02 Akim Demaille <akim@epita.fr>
21183
21184 * lib/xstrdup.c: New file, from the fileutils.
21185 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
21186 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
21187 instead of strlen + xmalloc + strcpy.
21188 * src/symtab.c (copys): Remove, use xstrdup instead.
21189
d7020c20
AD
211902000-10-02 Akim Demaille <akim@epita.fr>
21191
21192 * src/gram.h (associativity): New enum type which replaces the
21193 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
21194 `right_assoc', `left_assoc' and `non_assoc'.
21195 Adjust all dependencies.
21196 * src/reader.c: Formatting changes.
21197 (LTYPESTR): Don't define it, use it as a literal in
21198 `reader_output_yylsp'.
21199 * src/symtab.h (symbol_class): New enum type which replaces the
21200 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
21201 `sunknown', `stoken and `snterm'.
21202
1916f98e
AD
212032000-10-02 Akim Demaille <akim@epita.fr>
21204
21205 * src/getargs.c (fixed_outfiles): Rename as...
21206 (yaccflag): for consistency and accuracy.
21207 Adjust dependencies.
21208
d7913476
AD
212092000-10-02 Akim Demaille <akim@epita.fr>
21210
21211 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
21212 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
21213 difficult and introduced a lot of core dump. It turns out that
21214 Bison used an implementation of `xmalloc' based on `calloc', and
21215 at various places it does depend upon the initialization to 0. I
21216 have not tried to isolate the pertinent places, and all the former
21217 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
21218 someone should address this issue.
21219
21220 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
21221 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
21222 files.
21223 Adjust dependencies.
21224 * src/warshall.h: New file.
21225 Propagate.
21226
340ef489
AD
212272000-10-02 Akim Demaille <akim@epita.fr>
21228
21229 Various anti-`extern in *.c' changes.
21230
21231 * src/system.h: Include `assert.h'.
21232
b2ca4022
AD
212332000-10-02 Akim Demaille <akim@epita.fr>
21234
21235 * src/state.h (nstates, final_state, first_state, first_shift)
21236 (first_reduction): Move their exportation from here...
21237 * src/LR0.h: to here.
21238 Adjust dependencies.
21239 * src/getargs.c (statisticsflag): New variable.
21240 Add support for `--statistics'.
21241 Adjust dependencies.
21242
21243 Remove a lot of now useless `extern' statements in most files.
21244
403b315b
AD
212452000-10-02 Akim Demaille <akim@epita.fr>
21246
21247 * src/LR0.h: New file.
21248 Propagate its use.
21249
07a58c13
AD
212502000-10-02 Akim Demaille <akim@epita.fr>
21251
21252 * src/print.h: New file.
21253 Propagate its use.
21254 * src/print.c: Formatting and ordering changes.
21255 (verbose, terse): Replace with...
21256 (print_results): this new function.
21257 Adjust dependencies.
21258
0619caf0
AD
212592000-10-02 Akim Demaille <akim@epita.fr>
21260
21261 * src/conflicts.c (conflict_report): New function.
21262 (conflict_log, verbose_conflict_log): Replace with...
21263 (print_conflicts): this function.
21264 Adjust dependencies.
21265 * src/conflicts.h: New file.
21266 Propagate its inclusion.
21267
3519ec76
AD
212682000-10-02 Akim Demaille <akim@epita.fr>
21269
21270 * src/nullable.h: New file.
21271 Propagate its inclusion.
21272 * src/nullable.c: Formatting changes.
21273
015acc48
AD
212742000-10-02 Akim Demaille <akim@epita.fr>
21275
21276 * src/reduce.h: New file.
21277 Propagate its inclusion.
21278 * src/reduce.c: Topological sort and other formatting changes.
21279 (bool, TRUE, FALSE): Move their definition to...
21280 * src/system.h: here.
21281
8963a27b
AD
212822000-10-02 Akim Demaille <akim@epita.fr>
21283
21284 * src/files.c: Formatting changes.
21285 (tryopen, tryclose, openfiles): Rename as...
21286 (xfopen, xfclose, open_files): this.
21287 (stringappend): static.
21288 * src/files.h: Complete the list of exported symbols.
21289 Propagate its use.
21290
a70083a3
AD
212912000-10-02 Akim Demaille <akim@epita.fr>
21292
21293 * src/reader.h: New file.
21294 Propagate its use instead of tedious list of `extern' and
21295 prototypes.
21296 * src/reader.c: Formatting changes, topological sort,
21297 s/register//.
21298
abadc117
AD
212992000-10-02 Akim Demaille <akim@epita.fr>
21300
21301 * src/lex.h: Prototype `lex.c' exported functions.
21302 * src/reader.c: Adjust.
21303 * src/lex.c: Formatting changes.
21304 (safegetc): Rename as...
21305 (xgetc): this.
21306
720d742f
AD
213072000-10-02 Akim Demaille <akim@epita.fr>
21308
21309 * src/lalr.h: New file.
21310 Propagate its inclusion instead of prototypes and `extern'.
21311 * src/lalr.c: Formatting changes, topological sorting etc.
21312
f2acea59
AD
213132000-10-02 Akim Demaille <akim@epita.fr>
21314
21315 * src/output.c (token_actions): Introduce a temporary array,
21316 YYDEFACT, that makes it possible for this function to use
21317 output_short_table.
21318
d019d655
AD
213192000-10-02 Akim Demaille <akim@epita.fr>
21320
21321 `user_toknums' is output as a `short[]' in `output.c', while it is
21322 defined as a `int[]' in `reader.c'. For consistency with the
21323 other output tables, `user_toknums' is now defined as a table of
21324 shorts.
21325
21326 * src/reader.c (user_toknums): Be a short table instead of an int
21327 table.
21328 Adjust dependencies.
21329
21330 Factor the short table outputs.
21331
21332 * src/output.c (output_short_table): New function.
21333 * src/output.c (output_gram, output_stos, output_rule_data)
21334 (output_base, output_table, output_check): Use it.
21335
6c89f1c1
AD
213362000-10-02 Akim Demaille <akim@epita.fr>
21337
21338 * src/output.c (output): Topological sort of the functions, in
21339 order to get rid of the `static' prototypes.
21340 No longer use `register'.
21341 * src/output.h: New file.
21342 Propagate its inclusion in files explicitly prototyping functions
21343 from output.c.
21344
d9efd181
AD
213452000-09-21 Akim Demaille <akim@epita.fr>
21346
21347 * src/atgeneral.m4: Update from Autoconf.
21348
c29240e7 213492000-09-21 Akim Demaille <akim@epita.fr>
2fa6973e
AD
21350
21351 * src/closure.h: New file.
21352 * src/closure.c: Formatting changes, topological sort over the
21353 functions, use of closure.h.
21354 (initialize_closure, finalize_closure): Rename as...
21355 (new_closure, free_closure): these. Adjust dependencies.
21356 * src/LR0.c: Formatting changes, topological sort, use of
21357 cloture.h.
21358 (initialize_states): Rename as...
21359 (new_states): this.
21360 * src/Makefile.am (noinst_HEADERS): Adjust.
21361
499daa50
AD
213622000-09-20 Akim Demaille <akim@epita.fr>
21363
21364 * src/acconfig.h: Don't protect config.h against multiple
21365 inclusion.
21366 Don't define PARAMS.
21367 * src/system.h: Define PARAMS.
21368 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
21369 purpose of config.h. system.h must not try to fix wrong
21370 definitions in config.h.
21371
cc84fd5d
AD
213722000-09-20 Akim Demaille <akim@epita.fr>
21373
21374 * src/derives.h: New file.
21375 * src/main.c, src/derives.h: Use it.
21376 Formatting changes.
21377 * src/Makefile.am (noinst_HEADERS): Adjust.
21378
db5b3a89
AD
213792000-09-20 Akim Demaille <akim@epita.fr>
21380
21381 * tests/atgeneral.m4: Update from Autoconf.
21382 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
21383 (AT_CHECK_CALC): New macros.
21384 Use these macros to test bison with options `', `--raw',
21385 `--debug', `--yacc', `--yacc --debug'.
21386
ceed8467
AD
213872000-09-19 Akim Demaille <akim@epita.fr>
21388
21389 * src/output.c: Formatting changes.
21390 * src/machine.h: Remove, leaving its contents in...
21391 * src/system.h: here.
21392 Include stdio.h.
21393 Adjust all dependencies on stdio.h and machine.h.
21394 * src/getargs.h: New file.
21395 Let all `extern' declarations about getargs.c be replaced with
21396 inclusion of `getargs.h'.
21397 * src/Makefile.am (noinst_HEADERS): Adjust.
21398
21399 * tests/calc.m4 (yyin): Be initialized in main, not on the global
21400 scope.
21401 (yyerror): Returns void, not int.
21402 * doc/bison.texinfo: Formatting changes.
21403
05a1d24b
AD
214042000-09-19 Akim Demaille <akim@epita.fr>
21405
21406 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
21407 portable.
21408
cbd25751
AD
214092000-09-18 Akim Demaille <akim@epita.fr>
21410
21411 * configure.in: Append WARNING_CFLAGS to CFLAGS.
21412 * src/Makefile.am (INCLUDES): Don't.
21413 Be ready to fetch headers in lib/.
21414
13863333
AD
214152000-09-18 Akim Demaille <akim@epita.fr>
21416
21417 * doc/bison.texinfo: Update the copyright.
21418 ANSIfy and GNUify the examples.
21419 Remove the old menu.
21420
0d533154
AD
214212000-09-18 Akim Demaille <akim@epita.fr>
21422
21423 First set of tests: use the `calc' example from the documentation.
21424
21425 * src/bison.s1 (yyparse): Condition the code using `yytname' which
21426 is defined only when YYDEBUG is.
21427 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
21428 * src/files.c (tryopen, tryclose): Formatting changes.
21429 Move to the top and be static.
21430 * src/reader.c (read_signed_integer): Likewise.
21431 * tests/calc.m4: New file.
21432 * Makefile.am, suite.m4: Adjust.
21433 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
21434
e79137ac
AD
214352000-09-18 Akim Demaille <akim@epita.fr>
21436
21437 Add support for an Autotest test suite for Bison.
21438
21439 * m4/m4.m4, m4/atconfig.m4: New files.
21440 * m4/Makefile.am (EXTRA_DIST): Adjust.
21441 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
21442 files.
21443 * src/getargs.c: Display a more standard --version message.
21444 * src/reader.c (reader): Formatting changes.
21445 No longer depend upon VERSION_STRING.
21446 * configure.in: No longer use `dnl'.
21447 Set up the test suite and the new directory `tests/.
21448 (VERSION_STRING): Remove.
21449
27821bff
AD
214502000-04-14 Akim Demaille <akim@epita.fr>
21451
21452 * src/reader.c (copy_comment2): New function, same as former
21453 `copy_comment', but outputs into two FILE *.
21454 (copy_comment): Use it.
21455 (parse_union_decl): Use it.
21456 (get_type, parse_start_decl): Use the same `invalid' message.
21457 (parse_start_decl, parse_union_decl): Use the same `multiple'
21458 message.
21459 (parse_union_decl, copy_guard, copy_action): Use the same
21460 `unmatched' message.
21461 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
21462
cfe5fbc0
AD
214632000-03-31 Akim Demaille <akim@epita.fr>
21464
21465 * src/files.c (tryopen, tryclose): Move to the top.
21466 Be static.
21467
cb7db13e
AD
214682000-03-31 Akim Demaille <akim@epita.fr>
21469
21470 * src/main.c (main): Don't call `done', exit does it.
21471
a0f6b076
AD
214722000-03-31 Akim Demaille <akim@epita.fr>
21473
36281465
AD
21474 * allocate.c: s/return (foo)/return foo/.
21475 * lalr.c: Likewise.
21476 * LR0.c: Likewise.
21477 * output.c: Likewise.
21478 * reader.c: Likewise.
21479 * symtab.c: Likewise.
21480 * vmsgetargs.c: Likewise.
21481
214822000-03-31 Akim Demaille <akim@epita.fr>
21483
21484 Clean up the error reporting functions.
a0f6b076
AD
21485
21486 * src/report.c: New file.
21487 * src/report.h: Likewise.
21488 * src/Makefile.am: Adjust.
21489 * m4/error.m4: New file.
21490 * m4/Makefile.am: Adjust.
21491 * configure.in (jm_PREREQ_ERROR): Call it.
21492 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
21493 Remove.
21494 (fatal, fatals): Remove. All callers use complain.c::fatal.
21495 (warn, warni, warns, warnss, warnss): Remove. All callers use
21496 complain.c::complain.
21497 (toomany): Remove, use fatal instead.
21498 * src/files.c (done): No argument, use complain_message_count.
21499 * src/main.c (main): Register `done' to `atexit'.
21500
21501 * src/getargs.c (usage): More `fputs', less `fprintf'.
21502
18539825
AD
215032000-03-28 Akim Demaille <akim@epita.fr>
21504
21505 * lib/: New directory.
21506 * Makefile.am (SUBDIRS): Adjust.
21507 * configure.in: Adjust.
21508 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
21509 useless.
21510 * src/alloca.c: Moved to lib/.
21511 * src/getopt.c: Likewise.
21512 * src/getopt1.c: Likewise.
21513 * src/getopt.h: Likewise.
21514 * src/ansi2knr.c: Likewise.
21515 * src/ansi2knr.1: Likewise.
21516 * src/Makefile.am: Adjust.
21517 * lib/Makefile.am: New file.
21518
9f306f2a
AD
215192000-03-28 Akim Demaille <akim@epita.fr>
21520
21521 * src/getargs.c (usage): Refresh the help message.
21522
0ba347b6
AD
215232000-03-17 Akim Demaille <akim@epita.fr>
21524
21525 * src/getopt1.c: Updated from textutils 2.0e
21526 * src/getopt.c: Likewise.
21527 * src/getopt.h: Likewise.
21528
dbe7f271
AD
215292000-03-17 Akim Demaille <akim@epita.fr>
21530
21531 * src/Makefile.am (bison.simple): Fix the awk program: quote only
21532 the file name, not the whole `#line LINE FILE'.
21533
75bbe78d
AD
215342000-03-17 Akim Demaille <akim@epita.fr>
21535
21536 On syntax errors, report the token on which we choked.
21537
aa5fd0ee
AD
21538 * src/bison.s1 (yyparse): In the label yyerrlab, when
21539 YYERROR_VERBOSE, add yychar in msg.
75bbe78d 21540
7b306f52
AD
215412000-03-17 Akim Demaille <akim@epita.fr>
21542
aa5fd0ee 21543 * src/reader.c (copy_at): New function.
7b306f52
AD
21544 (copy_guard): Use it.
21545 (copy_action): Use it.
21546
e87b5700
AD
215472000-03-17 Akim Demaille <akim@epita.fr>
21548
21549 Be kind to translators, save some useless translations.
21550
aa5fd0ee 21551 * src/main.c (banner): New function.
e87b5700
AD
21552 (fatal_banner): Use it.
21553 (warn_banner): Use it.
21554
ae3c3164
AD
215552000-03-17 Akim Demaille <akim@epita.fr>
21556
aa5fd0ee
AD
21557 * src/reader.c (copy_definition): Use copy_string and
21558 copy_comment. Removed now unused `match', `ended',
21559 `cplus_comment'.
ae3c3164
AD
21560 (copy_comment, copy_string): Moved, to be visible from
21561 copy_definition.
21562
4dc58e7c
AD
215632000-03-17 Akim Demaille <akim@epita.fr>
21564
aa5fd0ee
AD
21565 * src/reader.c (copy_string): Declare `static inline'. No
21566 problems with inline, since it is checked by configure.
4dc58e7c
AD
21567 (copy_comment): Likewise.
21568
0a6384c4
AD
215692000-03-17 Akim Demaille <akim@epita.fr>
21570
aa5fd0ee 21571 * src/reader.c (packsymbols): Formatting changes.
0a6384c4 21572
3cef001a
AD
215732000-03-17 Akim Demaille <akim@epita.fr>
21574
aa5fd0ee 21575 * src/reader.c (copy_comment): New function, factored out from:
3cef001a
AD
21576 (copy_action): Use it. Removed now unused `match', `ended',
21577 `cplus_comment'.
21578 (copy_guard): Likewise.
21579
ca36d2ef
AD
215802000-03-17 Akim Demaille <akim@epita.fr>
21581
aa5fd0ee 21582 * src/reader.c (copy_string): New function, factored out from:
ca36d2ef
AD
21583 (copy_action): Use it.
21584 (copy_guard): Likewise.
21585
6666f98f
AD
215862000-03-17 Akim Demaille <akim@epita.fr>
21587
21588 Change the handling of @s so that they behave exactly like $s.
21589 There is now a pseudo variable @$ (readble and writable), location
21590 of the lhs of the rule (by default ranging from the location of
21591 the first symbol of the rhs, to the location of the last symbol,
21592 or, if the rhs is empty, YYLLOC).
21593
21594 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
21595 yyval.
21596 (yyparse): When providing a default semantic action, provide a
21597 default location action.
21598 (after the $): No longer change `*YYLSP', just stack YYLOC the
21599 same way you stack YYVAL.
21600 * src/reader.c (read_declarations): Use warns.
21601 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
21602 (copy_action, case '@'): Likewise.
21603 Use a standard error message, to save useless work from
21604 translators.
21605
41aca2e0
AD
216062000-03-17 Akim Demaille <akim@epita.fr>
21607
aa5fd0ee
AD
21608 * src/bison.s1: Formatting and cosmetics changes.
21609 * src/reader.c: Likewise.
41aca2e0
AD
21610 Update the Copyright notice.
21611
dc08c1d5
AD
216122000-03-17 Akim Demaille <akim@epita.fr>
21613
aa5fd0ee
AD
21614 * src/bison.s1 (#line): All set to `#line' only, since the
21615 Makefile now handles them.
dc08c1d5 21616
9ee3c97b
AD
216172000-03-16 Akim Demaille <akim@epita.fr>
21618
21619 * src/output.c (output_rule_data): Output the documentation of
21620 some of the tables.
21621 (Copyright notice): Update.
21622 Formatting changes.
21623
0de741ca
AD
216242000-03-16 Akim Demaille <akim@epita.fr>
21625
21626 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
21627 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
21628 One `#if YYDEBUG' remains, since it uses variables which are
21629 defined only if `YYDEBUG != 0'.
21630
bb10be54
AD
216312000-03-16 Akim Demaille <akim@epita.fr>
21632
21633 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
21634 and related variables so that the similarities are highlighted.
21635
b07b484a
AD
216362000-03-16 Akim Demaille <akim@epita.fr>
21637
21638 * src/bison.s1: Properly indent CPP directives.
21639
361f60b3
AD
216402000-03-16 Akim Demaille <akim@epita.fr>
21641
21642 * src/bison.s1: Properly indent the `alloca' CPP section.
21643
8c44d3ec
AD
216442000-03-16 Akim Demaille <akim@epita.fr>
21645
21646 Do not hard code values of directories in `configure.in'.
21647 Update the `configure' tool chain.
21648
21649 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
21650 src/makefile.am.
21651 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
21652 (AC_OUTPUT): Add m4/Makefile.
21653 Bump to bison 1.28a, 1.29 has never been released.
21654 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
21655 handled via src/Makefile.am.
21656 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
21657 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
21658 autoheader.
21659 * Makefile.am (SUBDIRS): Add m4.
21660 (ACLOCAL_AM_FLAGS): New variable.
21661 (AUTOMAKE_OPTIONS): Add check-news.
21662 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
21663 the proper line number and file name.
21664 (DEFS): Propagate the location of bison library files and of the
21665 locale files.
21666 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
21667 builddir.
21668 * acinclude.m4: Remove, replaced by the directory m4.
21669 * m4/Makefile.am (EXTRA_DIST): New variable.
21670 * m4/gettext.m4: New file, from the fileutils.
21671 * m4/lcmessage.m4: Likewise
21672 * m4/progtest.m4: Likewise.
21673 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
21674
f95997e7
AD
216752000-03-10 Akim Demaille <akim@epita.fr>
21676
21677 * src/closure.c:
21678 Formatting changes of various comments.
21679 Respect the GNU coding standards at various places.
21680 Don't use `_()' when no translation is needed.
21681
216821999-12-13 Jesse Thilo <jthilo@gnu.org>
21683
21684 * src/files.c:
21685 OS/2 honors TMPDIR environment variable.
21686
216871999-12-13 Jesse Thilo <jthilo@gnu.org>
21688
21689 * doc/bison.texinfo: Tweaked spelling and grammar.
21690 Updated ISBN.
21691 Removed reference to price of printed copy.
21692 Mention BISON_SIMPLE and BISON_HAIRY.
21693
216941999-12-13 Jesse Thilo <jthilo@gnu.org>
21695
21696 * configure.in, NEWS:
21697 Bison 1.29 released.
21698
216991999-10-27 Jesse Thilo <jthilo@gnu.org>
21700
21701 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
21702 Added reference card.
21703
217041999-07-26 Jesse Thilo <jthilo@gnu.org>
21705
21706 * po/ru.po: Added Russian translation.
21707
217081999-07-26 Jesse Thilo <jthilo@gnu.org>
21709
21710 * configure.in: Added Russian translation.
21711
217121999-07-06 Jesse Thilo <jthilo@gnu.org>
21713
21714 * configure.in, NEWS, README:
21715 Released version 1.28.
21716
217171999-06-14 Jesse Thilo <jthilo@gnu.org>
21718
21719 * src/system.h:
21720 Squashed redefinition warning on some systems.
21721
21722 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
21723 Have configure build version string instead of relying on ANSI string
21724 concatentation.
21725
217261999-06-14 Jesse Thilo <jthilo@gnu.org>
21727
21728 * po/POTFILES.in: Got rid of version.c.
21729
217301999-06-14 Jesse Thilo <jthilo@gnu.org>
21731
21732 * acconfig.h, configure.in:
21733 Have configure build version string instead of relying on ANSI string
21734 concatentation.
21735
217361999-06-08 Jesse Thilo <jthilo@gnu.org>
21737
21738 * doc/bison.1:
21739 Dropped mention of `+' for long-named options.
21740
217411999-05-30 Jesse Thilo <jthilo@gnu.org>
21742
21743 * src/files.c: Added <unistd.h> for unlink().
21744
21745 * src/Makefile.am, src/system.h:
21746 I18n fixes.
21747
217481999-05-30 Jesse Thilo <jthilo@gnu.org>
21749
21750 * README: Added a FAQ list.
21751
21752 * configure.in, acconfig.h:
21753 I18n fixes.
21754
217551999-05-30 Jesse Thilo <jthilo@gnu.org>
21756
21757 * doc/FAQ, doc/Makefile.am:
21758 Added a FAQ list.
21759
217601999-05-19 Jesse Thilo <jthilo@gnu.org>
21761
21762 * src/alloc.h, src/symtab.h, src/version.c:
21763 Protected inclusion of "config.h" with HAVE_CONFIG_H.
21764
217651999-04-18 Jesse Thilo <jthilo@gnu.org>
21766
21767 * src/.cvsignore, src/Makefile.am:
21768 Reorganized: sources in `src', documentation in `doc'.
21769
21770 * src/lex.c (literalchar):
21771 fixed the code for escaping double quotes (thanks
21772 Jonathan Czisny.)
21773
217741999-04-18 Jesse Thilo <jthilo@gnu.org>
21775
21776 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
21777 Adjusted paths to reflect directory reorganization.
21778
217791999-04-18 Jesse Thilo <jthilo@gnu.org>
21780
21781 * doc/.cvsignore, doc/Makefile.am:
21782 Reorganized: sources in `src', documentation in `doc'.
21783
217841999-04-18 Jesse Thilo <jthilo@gnu.org>
21785
21786 * configure.in:
21787 Updated AC_INIT file to reflect directory reorganization.
21788
21789 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
21790 Reorganized: sources in `src', documentation in `doc'.
21791
217921999-04-13 Jesse Thilo <jthilo@gnu.org>
21793
21794 * src/allocate.c:
21795 Don't declare calloc() and realloc() if not necessary.
21796
217971999-04-13 Jesse Thilo <jthilo@gnu.org>
21798
21799 * configure.in, acconfig.h, acinclude.m4:
21800 Don't declare calloc() and realloc() if not necessary.
21801
218021999-03-23 Jesse Thilo <jthilo@gnu.org>
21803
21804 * po/.cvsignore: Added i18n support.
21805
218061999-03-23 Jesse Thilo <jthilo@gnu.org>
21807
21808 * acconfig.h, configure.in, Makefile.am:
21809 Added i18n support.
21810
218111999-03-22 Jesse Thilo <jthilo@gnu.org>
21812
21813 * src/bison.s1: Fixed #line numbers.
21814
218151999-03-15 Jesse Thilo <jthilo@gnu.org>
21816
21817 * po/es.po, po/fr.po, po/nl.po, po/de.po:
21818 Added PO files from Translation Project.
21819
218201999-03-03 Jesse Thilo <jthilo@gnu.org>
21821
21822 * Makefile.am:
21823 Added support for non-ANSI compilers (ansi2knr).
21824
218251999-02-16 Jesse Thilo <jthilo@gnu.org>
21826
21827 * configure.in: Bumped version number to 1.27.
21828
21829 * Makefile.am:
21830 Added `bison.simple' to list of files removed by `make distclean'.
21831
218321999-02-12 Jesse Thilo <jthilo@gnu.org>
21833
21834 * src/files.c, src/files.h:
21835 Defined locations of parser files in config.h instead of Makefile.
21836
218371999-02-12 Jesse Thilo <jthilo@gnu.org>
21838
21839 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
21840 Defined locations of parser files in config.h instead of Makefile.
21841
218421999-02-09 Jesse Thilo <jthilo@gnu.org>
21843
21844 * Makefile.am:
21845 Removed inappropriate use of $< macro.
21846
218471999-02-05 Jesse Thilo <jthilo@gnu.org>
21848
21849 * po/Makefile.in.in, po/POTFILES.in:
21850 Add `po' directory skeleton.
21851
218521999-01-27 Jesse Thilo <jthilo@gnu.org>
21853
21854 * README: Document help-bison list.
21855
21856 * configure.in: Add check for mkstemp().
21857
218581999-01-20 Jesse Thilo <jthilo@gnu.org>
21859
21860 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
21861 Hush a few compiler warnings.
21862
21863 * src/files.c:
21864 Add tryclose(), which verifies that fclose was successful.
21865 Hush a couple of compiler warnings.
21866
218671999-01-20 Jesse Thilo <jthilo@gnu.org>
21868
21869 * Makefile.am, OChangeLog:
21870 ChangeLog is now automatically generated. Include the old version as
21871 OChangeLog.
21872
218731999-01-14 Jesse Thilo <jthilo@gnu.org>
21874
21875 * 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:
21876 Update FSF address.
21877
218781999-01-14 Jesse Thilo <jthilo@gnu.org>
21879
21880 * doc/bison.texinfo: Fix formatting glitch.
21881
21882 * doc/bison.texinfo: Update FSF address.
21883
218841999-01-14 Jesse Thilo <jthilo@gnu.org>
21885
21886 * acconfig.h: Update FSF address.
21887
218881999-01-08 Jesse Thilo <jthilo@gnu.org>
21889
21890 * src/system.h:
21891 Don't define PACKAGE here, since config.h defines it.
21892
218931998-12-30 Jesse Thilo <jthilo@gnu.org>
21894
21895 * src/reader.c: Update copyright date.
21896
21897 * src/main.c:
21898 Ditch sprintf to statically-sized buffers in fatal/warn functions in
21899 favor of output directly to stderr (avoids buffer overruns).
21900
21901 * src/reader.c: Some checks for premature EOF.
21902
21903 * 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:
21904 Use prototypes if the compiler understands them.
21905
21906 * src/files.c: Honor TMPDIR on Unix hosts.
21907 Use prototypes if the compiler understands them.
21908
21909 * src/reader.c:
21910 Fix a couple of buffer overrun bugs.
21911 Use prototypes if the compiler understands them.
21912
21913 * src/system.h: Include unistd.h and ctype.h.
21914 Use #ifdef instead of #if for NLS symbols.
21915
219161998-12-30 Jesse Thilo <jthilo@gnu.org>
21917
21918 * doc/bison.texinfo:
21919 Delete comment "consider using @set for edition number, etc..." since
21920 we now are doing so.
21921
219221998-12-30 Jesse Thilo <jthilo@gnu.org>
21923
21924 * configure.in:
21925 Use prototypes if the compiler understands them.
21926
21927 * NEWS: Document 1.26 highlights.
21928
21929 * Makefile.am: Require Automake 1.3 or later.
21930
21931 * acconfig.h:
21932 Use prototypes if the compiler understands them.
21933
219341998-12-29 Jesse Thilo <jthilo@gnu.org>
21935
21936 * src/version.c:
21937 Use VERSION symbol from automake for version number.
21938
219391998-12-29 Jesse Thilo <jthilo@gnu.org>
21940
21941 * acconfig.h, configure.in, version.cin:
21942 Use VERSION symbol from automake for version number.
21943
219441998-11-28 Jesse Thilo <jthilo@gnu.org>
21945
21946 * Makefile.am:
21947 Distribute original version of simple parser (bison.s1), not built
21948 version (bison.simple).
21949
219501998-11-28 Jesse Thilo <jthilo@gnu.org>
21951
21952 * doc/bison.texinfo: Add info dir entry.
21953
21954 * doc/bison.texinfo:
21955 Let automake put version number into documentation.
21956
219571998-11-26 Jesse Thilo <jthilo@gnu.org>
21958
21959 * src/bison.cld, src/build.com, src/vmshlp.mar:
21960 Add non-RCS files from /gd/gnu/bison.
21961
219621998-11-26 Jesse Thilo <jthilo@gnu.org>
21963
21964 * doc/bison.1:
21965 Document the BISON_HAIRY and BISON_SIMPLE variables.
21966
219671998-11-25 Jesse Thilo <jthilo@gnu.org>
21968
21969 * src/version.c: Build version.c automatically.
21970
21971 * src/reader.c:
21972 Fix token numbering (used to start at 258, not 257).
21973
21974 * src/system.h: Include config.h.
21975
21976 * src/getargs.c: Update bug report address.
21977
21978 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
21979 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
21980
219811998-11-25 Jesse Thilo <jthilo@gnu.org>
21982
21983 * Makefile.am:
21984 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
21985
21986 * configure.in, version.cin:
21987 Build version.c automatically.
21988
21989 * AUTHORS: Add AUTHORS file.
21990
21991 * README: Update bug report address.
21992
21993 * bison.simple:
21994 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
21995
21996 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
21997 Add automake stuff.
21998
219991998-11-25 Jesse Thilo <jthilo@gnu.org>
22000
22001 * doc/bison.texinfo: Clean up some formatting.
22002
220031998-05-05 Richard Stallman <rms@gnu.org>
22004
22005 * doc/bison.texinfo:
22006 Explain better why to make a pure parser.
22007
220081998-01-05 Richard Stallman <rms@gnu.org>
22009
22010 * src/files.c (openfiles):
22011 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
22012 find a temporary directory, if possible. Do not unlink files while
22013 they are open.
22014
220151997-08-25 Richard Stallman <rms@gnu.org>
22016
22017 * src/reader.c (stack_offset;):
22018 Change some warni to warns.
22019
22020 * src/lex.c (literalchar): Use warns, not warni.
22021
220221997-06-28 Richard Stallman <rms@gnu.org>
22023
22024 * src/bison.s1: Add a Bison version comment.
22025
22026 * src/main.c (fatal, warn, berror):
22027 Use program_name.
22028
220291997-06-28 Richard Stallman <rms@gnu.org>
22030
22031 * Makefile.in (bison_version): New variable.
22032 (dist): Use that variable.
22033 (bison.s1): Substitute the Bison version into bison.simple.
22034
22035 * bison.simple: Add a Bison version comment.
22036
220371997-06-18 Richard Stallman <rms@gnu.org>
22038
22039 * src/main.c (fatal, warn, berror):
22040 Make error messages standard.
22041 (toomany): Improve error message text.
22042
22043 * 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:
22044 new.h renamed to alloc.h.
22045
220461997-06-18 Richard Stallman <rms@gnu.org>
22047
22048 * Makefile.in: new.h renamed to alloc.h.
22049
220501997-05-24 Richard Stallman <rms@gnu.org>
22051
22052 * src/lex.c (literalchar):
22053 Fix the code for escaping \, " and '.
22054
22055 (lex): Avoid trouble when there are many chars
22056 to discard in a char literal with just several chars in it.
22057
220581997-05-17 Richard Stallman <rms@gnu.org>
22059
22060 * src/bison.s1:
22061 Use malloc, if using alloca is troublesome.
22062 (YYSTACK_USE_ALLOCA): New flag macro.
22063 Define it for some systems and compilers.
22064 (YYSTACK_ALLOC): New macro.
22065 (yyparse): Use YYSTACK_ALLOC to allocate stack.
22066 If it was malloc'd, free it.
22067
220681997-05-17 Richard Stallman <rms@gnu.org>
22069
22070 * bison.simple:
22071 Use malloc, if using alloca is troublesome.
22072 (YYSTACK_USE_ALLOCA): New flag macro.
22073 Define it for some systems and compilers.
22074 (YYSTACK_ALLOC): New macro.
22075 (yyparse): Use YYSTACK_ALLOC to allocate stack.
22076 If it was malloc'd, free it.
22077
220781997-04-23 Richard Stallman <rms@gnu.org>
22079
22080 * src/bison.s1:
22081 (alloca) [__hpux]: Always define as __builtin_alloca.
22082
220831997-04-23 Richard Stallman <rms@gnu.org>
22084
22085 * bison.simple:
22086 (alloca) [__hpux]: Always define as __builtin_alloca.
22087
220881997-04-22 Richard Stallman <rms@gnu.org>
22089
22090 * src/bison.s1:
22091 [__hpux]: Include alloca.h (right for HPUX 10)
22092 instead of declaring alloca (right for HPUX 9).
22093
22094 * src/bison.s1 (__yy_memcpy):
22095 Declare arg `count' as unsigned int.
22096 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
22097
220981997-04-22 Richard Stallman <rms@gnu.org>
22099
22100 * bison.simple:
22101 [__hpux]: Include alloca.h (right for HPUX 10)
22102 instead of declaring alloca (right for HPUX 9).
22103
22104 * bison.simple (__yy_memcpy):
22105 Declare arg `count' as unsigned int.
22106 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
22107
221081997-01-03 Richard Stallman <rms@gnu.org>
22109
22110 * src/allocate.c: [__STDC__ or _MSC_VER]:
22111 Declare calloc and realloc to return void *.
22112
221131997-01-02 Richard Stallman <rms@gnu.org>
22114
22115 * src/system.h:
22116 [_MSC_VER]: Include stdlib.h and process.h.
22117 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
22118
22119 * src/main.c (main): Return FAILURE as a value.
22120 (printable_version): Declare arg as int, not char.
22121
221221997-01-02 Richard Stallman <rms@gnu.org>
22123
22124 * Makefile.in (dist):
22125 Explicitly check for symlinks, and copy them.
22126
221271996-12-19 Richard Stallman <rms@gnu.org>
22128
22129 * src/files.c:
22130 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
22131
221321996-12-18 Paul Eggert <eggert@gnu.org>
22133
22134 * src/bison.s1 (yyparse):
22135 If __GNUC__ and YYPARSE_PARAM are both defined,
22136 declare yyparse to have a void * argument.
22137
221381996-12-18 Paul Eggert <eggert@gnu.org>
22139
22140 * bison.simple (yyparse):
22141 If __GNUC__ and YYPARSE_PARAM are both defined,
22142 declare yyparse to have a void * argument.
22143
221441996-12-17 Richard Stallman <rms@gnu.org>
22145
22146 * src/reduce.c (nbits): Add some casts.
22147
221481996-08-12 Richard Stallman <rms@gnu.org>
22149
22150 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
22151
221521996-08-12 Richard Stallman <rms@gnu.org>
22153
22154 * bison.simple: Test _MSDOS as well as _MSDOS_.
22155
221561996-07-31 Richard Stallman <rms@gnu.org>
22157
22158 * src/bison.s1:
22159 [__sun && __i386]: Include alloca.h.
22160
221611996-07-31 Richard Stallman <rms@gnu.org>
22162
22163 * bison.simple:
22164 [__sun && __i386]: Include alloca.h.
22165
221661996-07-30 Richard Stallman <rms@gnu.org>
22167
22168 * src/bison.s1: Comment change.
22169
22170 * src/bison.s1: Test _MSDOS_, not MSDOS.
22171
221721996-07-30 Richard Stallman <rms@gnu.org>
22173
22174 * bison.simple: Comment change.
22175
22176 * bison.simple: Test _MSDOS_, not MSDOS.
22177
221781996-06-01 Richard Stallman <rms@gnu.org>
22179
22180 * 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:
22181 Insert `_' macro around many string constants.
22182
22183 * src/main.c:
22184 Insert `_' macro around many string constants.
22185
22186 (main): Call setlocale, bindtextdomain and textdomain.
22187
22188 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
22189 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
22190 [ENABLE_NLS]: Include libintl.h.
22191 [ENABLE_NLS] (gettext): Define.
22192 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
22193 (N_, PACKAGE, LOCALEDIR): New macros.
22194
221951996-06-01 Richard Stallman <rms@gnu.org>
22196
22197 * POTFILES.in: New file.
22198
22199 * Makefile.in (allocate.o):
22200 Define target explicitly.
22201
22202 * Makefile.in (CFLAGS): Set to @CFLAGS@.
22203 (LDFLAGS): Set to @LDFLAGS@.
22204 (configure): Run autoconf only if preceding `cd' succeeds.
22205 (bison.s1): Redirect output to temporary file then move the
22206 temporary to the target, rather than redirecting directly to bison.s1.
22207 (clean): Remove config.status and config.log.
22208 (distclean): Don't remove config.status here.
22209
222101996-05-12 Richard Stallman <rms@gnu.org>
22211
22212 * src/bison.s1:
22213 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
22214
222151996-05-12 Richard Stallman <rms@gnu.org>
22216
22217 * bison.simple:
22218 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
22219
222201996-05-11 Richard Stallman <rms@gnu.org>
22221
22222 * src/bison.s1 (__yy_memcpy):
22223 Really reorder the args, as was supposedly done on Feb 14 1995.
22224 (yyparse): Calls changed accordingly.
22225
222261996-05-11 Richard Stallman <rms@gnu.org>
22227
22228 * Makefile.in (dist): Don't use $(srcdir).
22229
22230 * bison.simple (__yy_memcpy):
22231 Really reorder the args, as was supposedly done on Feb 14 1995.
22232 (yyparse): Calls changed accordingly.
22233
222341996-01-27 Richard Stallman <rms@gnu.org>
22235
22236 * src/output.c (output_rule_data):
22237 Test YYERROR_VERBOSE in the conditional
22238 around the definition of ttyname.
22239
222401995-12-29 Richard Stallman <rms@gnu.org>
22241
22242 * src/bison.s1:
22243 Fix line numbers in #line commands.
22244
222451995-12-29 Richard Stallman <rms@gnu.org>
22246
22247 * bison.simple:
22248 Fix line numbers in #line commands.
22249
222501995-12-27 Richard Stallman <rms@gnu.org>
22251
22252 * src/bison.s1 (YYPARSE_PARAM_DECL):
22253 In C++, make it always null.
22254 (YYPARSE_PARAM_ARG): New macro.
22255 (yyparse): Use YYPARSE_PARAM_ARG.
22256
222571995-12-27 Richard Stallman <rms@gnu.org>
22258
22259 * bison.simple (YYPARSE_PARAM_DECL):
22260 In C++, make it always null.
22261 (YYPARSE_PARAM_ARG): New macro.
22262 (yyparse): Use YYPARSE_PARAM_ARG.
22263
222641995-11-29 Richard Stallman <rms@gnu.org>
22265
22266 * doc/bison.texinfo:
22267 Describe literal string tokens, %raw, %no_lines, %token_table.
22268
222691995-11-29 Daniel Hagerty <hag@gnu.org>
22270
22271 * doc/bison.texinfo: Fixed update date
22272
222731995-10-16 Richard Stallman <rms@gnu.org>
22274
22275 * src/version.c: Version 1.25.
22276
222771995-10-16 Richard Stallman <rms@gnu.org>
22278
22279 * NEWS: *** empty log message ***
22280
222811995-10-16 Richard Stallman <rms@gnu.org>
22282
22283 * doc/bison.1, doc/bison.rnh:
22284 Add new options.
22285
222861995-10-15 Richard Stallman <rms@gnu.org>
22287
22288 * src/vmsgetargs.c, src/getargs.c:
22289 Added -n, -k, and -raw switches.
22290 (noparserflag, toknumflag, rawtoknumflag): New variables.
22291
22292 * src/symtab.h (SALIAS):
22293 New #define for adding aliases to %token.
22294 (struct bucket): Added `alias' field.
22295
22296 * src/reduce.c (reduce_grammar):
22297 Revise error message.
22298 (print_notices): Remove final `.' from error message.
22299
22300 * src/reader.c (reader_output_yylsp):
22301 New function.
22302 (readgram): Use `#if 0' around code that accepted %command
22303 inside grammar rules: The documentation doesn't allow it,
22304 and it will fail since the %command processors scan for the next %.
22305 (parse_token_decl): Extended the %token
22306 declaration to allow a multi-character symbol as an alias.
22307 (parse_thong_decl): New function.
22308 (read_declarations): Added %thong declarations.
22309 (read_declarations): Handle NOOP to deal with allowing
22310 % declarations as another means to specify the flags.
22311 (readgram): Allow %prec prior to semantics embedded in a rule.
22312 (skip_to_char, read_declarations, copy_definition)
22313 (parse_token_decl, parse_start_decl, parse_type_decl)
22314 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
22315 (get_type_name, copy_guard, copy_action, readgram)
22316 (get_type, packsymbols): Revised most error messages.
22317 Changed `fatal' to `warnxxx' to avoid aborting for error.
22318 Revised and use multiple warnxxx functions to avoid using VARARGS1.
22319 (read_declarations): Improve the error message for
22320 an invalid character. Do not abort.
22321 (read_declarations, copy_guard, copy_action): Use
22322 printable_version to avoid unprintable characters in printed output.
22323 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
22324 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
22325 Allow the type of a non-terminal can be given
22326 more than once, as long as all specifications give the same type.
22327
22328 * src/output.c:
22329 (output_headers, output_trailers, output, output_gram)
22330 (output_rule_data): Implement noparserflag variable.
22331 Implement toknumflag variable.
22332 (output): Call reader_output_yylsp to output LTYPESTR.
22333
22334 * src/main.c (main):
22335 If reader sees an error, don't process the grammar.
22336 (fatals): Updated to not use VARARGS1.
22337 (printable_version, int_to_string, warn, warni, warns, warnss)
22338 (warnsss): New error reporting functions. Avoid abort for error.
22339
22340 * src/lex.h:
22341 Added THONG and NOOP for alias processing.
22342 Added SETOPT for the new code that allows setting options with %flags.
22343
22344 * src/lex.c:
22345 Include getopt.h. Add some extern decls.
22346 (safegetc): New function to deal with EOF gracefully.
22347 (literalchar); new function to deal with reading \ escapes.
22348 (lex): Use literalchar.
22349 (lex): Implemented "..." tokens.
22350 (literalchar, lex, parse_percent_token): Made tokenbuffer
22351 always contain the token. This includes growing the token
22352 buffer while reading an integer.
22353 (parse_percent_token): Replaced if-else statement with percent_table.
22354 (parse_percent_token): Added % declarations as another
22355 way to specify the flags -n, -l, and -r. Also added hooks for
22356 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
22357 major changes to files.c.
22358 (lex) Retain in the incoming stream a character following
22359 an incorrect '/'.
22360 (skip_white_space, lex): Revised most error messages
22361 and changed fatal to warn to avoid aborting.
22362 (percent_table): Added %thong declarations.
22363
22364 * src/gram.h: Comment changes.
22365
22366 * src/files.c (openfiles, open_extra_files, done):
22367 Add faction flag
22368 and actfile file. Handle noparserflag. Both for -n switch.
22369
22370 * src/conflicts.c (resolve_sr_conflict):
22371 Remove use of alloca.
22372
223731995-06-01 Jim Meyering <meyering@gnu.org>
22374
22375 * doc/bison.texinfo: *** empty log message ***
22376
223771995-05-06 Richard Stallman <rms@gnu.org>
22378
22379 * src/bison.s1: Comment change.
22380
223811995-05-06 Richard Stallman <rms@gnu.org>
22382
22383 * bison.simple: Comment change.
22384
223851995-05-03 Richard Stallman <rms@gnu.org>
22386
22387 * src/version.c: Version now 1.24.
22388
22389 * src/bison.s1: Change distribution terms.
22390
22391 * src/version.c: Version now 1.23.
22392
223931995-05-03 Richard Stallman <rms@gnu.org>
22394
22395 * doc/bison.texinfo:
22396 Rewrite "Conditions for Using Bison".
22397 Update version to 1.24.
22398
223991995-05-03 Richard Stallman <rms@gnu.org>
22400
22401 * bison.simple: Change distribution terms.
22402
224031995-02-23 Richard Stallman <rms@gnu.org>
22404
22405 * src/files.c: Test __VMS_POSIX as well as VMS.
22406
224071995-02-14 Jim Meyering <meyering@gnu.org>
22408
22409 * src/bison.s1 (__yy_memcpy):
22410 Renamed from __yy_bcopy to avoid
22411 confusion. Reverse FROM and TO arguments to be consistent with
22412 those of memcpy.
22413
224141995-02-14 Jim Meyering <meyering@gnu.org>
22415
22416 * bison.simple (__yy_memcpy):
22417 Renamed from __yy_bcopy to avoid
22418 confusion. Reverse FROM and TO arguments to be consistent with
22419 those of memcpy.
22420
224211994-11-10 David J. MacKenzie <djm@gnu.org>
22422
22423 * NEWS: reformat
22424
22425 * NEWS: New file.
22426
22427 * Makefile.in (DISTFILES): Include NEWS.
22428
22429 * Makefile.in (DISTFILES):
22430 Include install-sh, not install.sh.
22431
22432 * configure.in: Update to Autoconf v2 macro names.
22433
224341994-10-05 David J. MacKenzie <djm@gnu.org>
22435
22436 * Makefile.in: fix typo
22437
22438 * Makefile.in (prefix, exec_prefix):
22439 Let configure set them.
22440
224411994-09-28 David J. MacKenzie <djm@gnu.org>
22442
22443 * Makefile.in: Set datadir to $(prefix)/share.
22444
224451994-09-15 Richard Stallman <rms@gnu.org>
22446
22447 * src/bison.s1:
22448 Update copyright notice and GPL version.
22449
224501994-09-15 Richard Stallman <rms@gnu.org>
22451
22452 * bison.simple:
22453 Update copyright notice and GPL version.
22454
224551994-07-12 Richard Stallman <rms@gnu.org>
22456
22457 * src/reduce.c, src/reader.c:
22458 entered into RCS
22459
224601994-05-05 David J. MacKenzie <djm@gnu.org>
22461
22462 * Makefile.in: entered into RCS
22463
224641994-03-26 Richard Stallman <rms@gnu.org>
22465
22466 * src/bison.s1: entered into RCS
22467
224681994-03-26 Richard Stallman <rms@gnu.org>
22469
22470 * bison.simple: entered into RCS
22471
224721994-03-25 Richard Stallman <rms@gnu.org>
22473
22474 * src/main.c: entered into RCS
22475
224761994-03-24 Richard Stallman <rms@gnu.org>
22477
22478 * src/conflicts.c: entered into RCS
22479
224801994-01-02 Richard Stallman <rms@gnu.org>
22481
22482 * Makefile.in: *** empty log message ***
22483
224841993-11-21 Richard Stallman <rms@gnu.org>
22485
22486 * src/bison.s1: *** empty log message ***
22487
224881993-11-21 Richard Stallman <rms@gnu.org>
22489
22490 * doc/bison.texinfo: entered into RCS
22491
22492 * doc/bison.texinfo: *** empty log message ***
22493
224941993-11-21 Richard Stallman <rms@gnu.org>
22495
22496 * bison.simple: *** empty log message ***
22497
224981993-10-25 David J. MacKenzie <djm@gnu.org>
22499
22500 * doc/bison.texinfo: *** empty log message ***
22501
225021993-10-19 Richard Stallman <rms@gnu.org>
22503
22504 * src/bison.s1: *** empty log message ***
22505
225061993-10-19 Richard Stallman <rms@gnu.org>
22507
22508 * bison.simple: *** empty log message ***
22509
225101993-10-14 Richard Stallman <rms@gnu.org>
22511
22512 * src/bison.s1: *** empty log message ***
22513
225141993-10-14 Richard Stallman <rms@gnu.org>
22515
22516 * bison.simple: *** empty log message ***
22517
225181993-09-14 David J. MacKenzie <djm@gnu.org>
22519
22520 * doc/bison.texinfo: *** empty log message ***
22521
225221993-09-13 Noah Friedman <friedman@gnu.org>
22523
22524 * Makefile.in: *** empty log message ***
22525
225261993-09-10 Richard Stallman <rms@gnu.org>
22527
22528 * src/conflicts.c: *** empty log message ***
22529
22530 * src/system.h: entered into RCS
22531
225321993-09-10 Richard Stallman <rms@gnu.org>
22533
22534 * doc/bison.1: entered into RCS
22535
225361993-09-06 Noah Friedman <friedman@gnu.org>
22537
22538 * src/version.c: entered into RCS
22539
225401993-09-06 Noah Friedman <friedman@gnu.org>
22541
22542 * Makefile.in: *** empty log message ***
22543
225441993-07-30 David J. MacKenzie <djm@gnu.org>
22545
22546 * Makefile.in: *** empty log message ***
22547
225481993-07-24 Richard Stallman <rms@gnu.org>
22549
22550 * src/bison.s1: *** empty log message ***
22551
225521993-07-24 Richard Stallman <rms@gnu.org>
22553
22554 * bison.simple: *** empty log message ***
22555
225561993-07-08 David J. MacKenzie <djm@gnu.org>
22557
22558 * Makefile.in: *** empty log message ***
22559
225601993-07-04 Richard Stallman <rms@gnu.org>
22561
22562 * src/bison.s1: *** empty log message ***
22563
225641993-07-04 Richard Stallman <rms@gnu.org>
22565
22566 * bison.simple: *** empty log message ***
22567
225681993-06-26 David J. MacKenzie <djm@gnu.org>
22569
22570 * src/getargs.c: entered into RCS
22571
225721993-06-26 David J. MacKenzie <djm@gnu.org>
22573
22574 * doc/bison.texinfo: *** empty log message ***
22575
22576 * doc/bison.1: New file.
22577
225781993-06-25 Richard Stallman <rms@gnu.org>
22579
22580 * src/getargs.c: New file.
22581
225821993-06-16 Richard Stallman <rms@gnu.org>
22583
22584 * src/bison.s1: *** empty log message ***
22585
225861993-06-16 Richard Stallman <rms@gnu.org>
22587
22588 * bison.simple: *** empty log message ***
22589
225901993-06-03 Richard Stallman <rms@gnu.org>
22591
22592 * src/bison.s1: New file.
22593
225941993-06-03 Richard Stallman <rms@gnu.org>
22595
22596 * doc/bison.texinfo: *** empty log message ***
22597
225981993-06-03 Richard Stallman <rms@gnu.org>
22599
22600 * bison.simple: New file.
22601
226021993-05-19 Richard Stallman <rms@gnu.org>
22603
22604 * doc/bison.texinfo: New file.
22605
226061993-05-07 Noah Friedman <friedman@gnu.org>
22607
22608 * Makefile.in: *** empty log message ***
22609
226101993-04-28 Noah Friedman <friedman@gnu.org>
22611
22612 * src/reader.c: *** empty log message ***
22613
226141993-04-23 Noah Friedman <friedman@gnu.org>
22615
22616 * src/alloc.h: entered into RCS
22617
226181993-04-20 David J. MacKenzie <djm@gnu.org>
22619
22620 * src/version.c: *** empty log message ***
22621
22622 * src/files.c, src/allocate.c:
22623 entered into RCS
22624
22625 * src/reader.c: *** empty log message ***
22626
22627 * src/lex.c: entered into RCS
22628
22629 * src/conflicts.c: New file.
22630
22631 * src/symtab.c: entered into RCS
22632
22633 * src/alloc.h: New file.
22634
22635 * src/LR0.c: entered into RCS
22636
226371993-04-18 Noah Friedman <friedman@gnu.org>
22638
22639 * src/reader.c: New file.
22640
22641 * src/version.c: *** empty log message ***
22642
226431993-04-18 Noah Friedman <friedman@gnu.org>
22644
22645 * Makefile.in: *** empty log message ***
22646
226471993-04-17 Noah Friedman <friedman@gnu.org>
22648
22649 * Makefile.in: *** empty log message ***
22650
226511993-04-15 Richard Stallman <rms@gnu.org>
22652
22653 * src/main.c, src/files.c:
22654 New file.
22655
226561993-04-15 Noah Friedman <friedman@gnu.org>
22657
22658 * configure.in: entered into RCS
22659
22660 * configure.in: *** empty log message ***
22661
22662 * configure.in: New file.
22663
226641993-04-14 Richard Stallman <rms@gnu.org>
22665
22666 * Makefile.in: New file.
22667
226681993-04-13 Richard Stallman <rms@gnu.org>
22669
22670 * src/version.c: New file.
22671
226721993-03-25 Richard Stallman <rms@gnu.org>
22673
22674 * src/output.c: entered into RCS
22675
226761992-09-25 Richard Stallman <rms@gnu.org>
22677
22678 * configure.bat: entered into RCS
22679
226801992-06-22 Richard Stallman <rms@gnu.org>
22681
22682 * src/vmsgetargs.c: entered into RCS
22683
226841992-06-22 Richard Stallman <rms@gnu.org>
22685
22686 * doc/bison.rnh: entered into RCS
22687
226881992-04-20 David J. MacKenzie <djm@gnu.org>
22689
22690 * README: entered into RCS
22691
226921992-01-22 Richard Stallman <rms@gnu.org>
22693
22694 * src/machine.h: entered into RCS
22695
226961991-12-21 Richard Stallman <rms@gnu.org>
22697
22698 * src/lalr.c, src/closure.c:
22699 entered into RCS
22700
227011991-12-20 Richard Stallman <rms@gnu.org>
22702
22703 * src/state.h: entered into RCS
22704
227051991-12-18 Richard Stallman <rms@gnu.org>
22706
22707 * src/print.c, src/nullable.c, src/derives.c:
22708 entered into RCS
22709
227101991-11-03 David J. MacKenzie <djm@gnu.org>
22711
22712 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
22713 entered into RCS
22714
227151988-09-09 Richard Stallman <rms@gnu.org>
22716
22717 * src/bison.hairy: entered into RCS
22718
227191987-12-16 Richard Stallman <rms@gnu.org>
22720
22721 * REFERENCES: entered into RCS
dc546b0f 22722
f294a2c2 22723
04098407 22724 -----
f294a2c2 22725
04098407 22726 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
9126263e 22727 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
95021767 22728 Free Software Foundation, Inc.
f294a2c2 22729
04098407
PE
22730 Copying and distribution of this file, with or without
22731 modification, are permitted provided the copyright notice and this
22732 notice are preserved.