1 2008-11-15 Akim Demaille <demaille@gostai.com>
3 Remove duplicate header inclusion.
6 2008-11-15 Akim Demaille <demaille@gostai.com>
8 * src/parse-gram.h, src/parse-gram.c: Regen.
10 2008-11-15 Akim Demaille <demaille@gostai.com>
12 Support parametric types.
14 There are two issues to handle: first scanning nested angle
15 bracket pairs to support types such as std::pair< std::string,
16 std::list<std::string> > >.
18 Another issue is to address idiosyncracies of C++: do not glue two
19 closing angle brackets together (otherwise it's operator>>), and
20 avoid sticking blindly a TYPE to the opening <, as it can result
21 in '<:' which is a digraph for '['.
23 * src/scan-gram.l (brace_level): Rename as...
26 Implement support for complex tags.
29 * data/lalr1.cc (b4_symbol_value, b4_symbol_value_template)
30 (b4_symbol_variant): Leave space around types as parameters.
31 * examples/variant.yy: Use nested template types and leading ::.
32 * src/parse-gram.y (TYPE, TYPE_TAG_ANY, TYPE_TAG_NONE, type.opt):
34 (TAG, TAG_ANY, TAG_NONE, tag.opt): these.
35 * tests/c++.at: Test parametric types.
37 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
40 This is not sufficient, but we test at least that the make_SYMBOL
41 interface is not affected by token.prefix. A more general test
42 will be implemented when the support of token.prefix is generalized
45 * tests/c++.at: One more variant test, using token.prefix.
47 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
49 Test the make_TOKEN interface.
50 * tests/c++.at (AT_CHECK_VARIANTS): Require and use locations.
51 Factor the common code in yylex.
52 Use it to test "%define lex_symbol".
54 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
58 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
60 Simplify code for variants bench marks.
61 * etc/bench.pl.in (&generate_grammar_list): Define and use
63 Factor the common code in yylex.
65 2008-11-15 Akim Demaille <demaille@gostai.com>
68 * bootstrap (find_tool): Fix the error message.
70 2008-11-15 Akim Demaille <demaille@gostai.com>
72 Update variant.yy to newest interface.
73 * examples/variant.yy: Define lex_symbol.
76 2008-11-15 Akim Demaille <demaille@gostai.com>
78 Don't use locations in variant.yy.
79 * examples/variant.yy: Adjust to not using locations.
81 2008-11-15 Akim Demaille <demaille@gostai.com>
84 * data/local.mk, etc/local.mk, examples/local.mk: Use Automake
85 comments for the license.
87 2008-11-15 Akim Demaille <demaille@gostai.com>
89 Remove tests/Makefile.am.
90 * tests/Makefile.am: Rename as...
91 * tests/local.mk: this.
92 * Makefile.am, configure.ac: Adjust.
93 * Makefile.am (DISTCLEANFILES): Define.
94 (maintainer-check, maintainer-xml-check, maintainer-push-check):
95 Remove, we no longer need to bounce to the real targets.
97 2008-11-15 Akim Demaille <demaille@gostai.com>
101 2008-11-15 Akim Demaille <demaille@gostai.com>
104 * Makefile.am (EXTRA_DIST): Move djgpp related part to...
105 * djgpp/local.mk: this new file.
107 2008-11-15 Akim Demaille <demaille@gostai.com>
109 Remove doc/Makefile.am.
110 * doc/Makefile.am: Rename as...
111 * doc/local.mk: this.
113 * Makefile.am, configure.ac: Adjust.
114 * Makefile.am (MOSTLYCLEANFILES): New.
115 * src/local.mk: Adjust.
117 2008-11-15 Akim Demaille <demaille@gostai.com>
119 Move sc_tight_scope into maint.mk.
120 It does not work, and I don't know how it was supposed to work: it
121 seems to be looking for sources in the build tree. I just moved
122 it at a better place, fixing it is still required.
124 * src/local.mk (echo): Remove.
125 (sc_tight_scope): Move to...
128 2008-11-15 Akim Demaille <demaille@gostai.com>
131 * src/parse-gram.h, src/parse-gram.h: Regen.
133 2008-11-15 Akim Demaille <demaille@gostai.com>
135 Remove src/Makefile.am.
136 * src/Makefile.am: Rename as...
137 * src/local.mk: this.
138 Prefix all the paths with src/.
139 (AUTOMAKE_OPTIONS): Build object files in the sub dirs.
140 (AM_CPPFLAGS): Find find in builddir/src.
141 (YACC): Move the flags into...
143 * maint.mk (sc_tight_scope): Disable.
144 It used to bounce to the version in src/Makefile.am which is now
145 part of this very Makefile.
146 * Makefile.am, configure.ac: Adjust.
147 * src/scan-code-c.c, src/scan-code.l: We can no longer rely on
148 include "..." to find files "here": we are no longer in src/, so
149 qualify the includes with src/.
150 * doc/Makefile.am (PREPATH): No longer include the top_builddir
152 (.x.1): Adjust to be able to create src/foo from the top level
153 Makefile, instead of going bounce to src/Makefile the creation of
156 2008-11-15 Akim Demaille <demaille@gostai.com>
158 Remove useless variable.
159 * doc/Makefile.am (srcsrcdir): Remove.
161 2008-11-15 Akim Demaille <demaille@gostai.com>
163 Remove data/Makefile.am.
164 * data/Makefile.am: Rename as...
165 * data/local.mk: this.
167 * Makefile.am, configure.ac: Adjust.
169 2008-11-15 Akim Demaille <demaille@gostai.com>
171 Remove etc/Makefile.am.
172 * etc/Makefile.am: Rename as...
173 * etc/local.mk: this.
175 * Makefile.am, configure.ac: Adjust.
177 2008-11-15 Akim Demaille <demaille@gostai.com>
179 Remove examples/local.mk.
180 examples/calc++/Makefile.am might be interesting to keep as is, since
181 it is an example in itself.
183 * examples/Makefile.am: Rename as...
184 * examples/local.mk: this.
186 * Makefile.am, configure.ac: Adjust.
188 2008-11-15 Akim Demaille <demaille@gostai.com>
190 Remove build-aux/Makefile.am.
191 Recursive Makefiles are really way too slow, let's get rid of some of
194 * build-aux/Makefile.am: Rename as...
195 * build-aux/local.mk: this.
197 * Makefile.am, configure.ac: Adjust.
199 2008-11-15 Akim Demaille <demaille@gostai.com>
201 Provide convenience constructors for locations and positions.
202 * data/location.cc (position::position): Accept file, line and
203 column as arguments with default values.
204 Always qualify initial line and column literals as unsigned.
205 (location::location): Provide convenience constructors.
207 2008-11-15 Akim Demaille <demaille@gostai.com>
209 Instead of using make_symbol<TOK_FOO>, generate make_FOO for each
211 Using template buys us nothing, and makes it uselessly complex to
212 construct a symbol. Besides, it could not be generalized to other
213 languages, while make_FOO would work in C/Java etc.
215 * data/lalr1.cc (b4_symbol_): New.
217 (b4_symbol_constructor_declaration_)
218 (b4_symbol_constructor_definition_): Instead of generating
219 specializations of an overloaded template function, just generate
220 several functions whose names are forged from the token names
221 without the token.prefix.
222 (b4_symbol_constructor_declarations): Generate them for all the
223 symbols, not just by class of symbol type, now that instead of
224 specializing a function template by the token, we generate a
225 function named after the token.
226 (b4_symbol_constructor_specialization_)
227 (b4_symbol_constructor_specializations): Remove.
228 * etc/bench.pl.in: Adjust to this new API.
230 2008-11-13 Akim Demaille <demaille@gostai.com>
232 %define token.prefix.
233 Provide a means to add a prefix to the name of the tokens as
234 output in the generated files. Because of name clashes, it is
235 good to have such a prefix such as TOK_ that protects from names
236 such as EOF, FILE etc. But it clutters the grammar itself.
238 * data/bison.m4 (token.prefix): Empty by default.
239 * data/c.m4 (b4_token_enum, b4_token_define): Use it.
240 * data/lalr1.cc (b4_symbol): Ditto.
242 2008-11-13 Akim Demaille <demaille@gostai.com>
244 Compute at M4 time some of the subtractions.
245 * data/lalr1.cc (b4_substract): New.
246 (b4_rhs_data): Use it.
248 2008-11-13 Akim Demaille <demaille@gostai.com>
251 This allows the user to get the type of a token returned by yylex.
253 * data/lalr1.cc (symbol::token): New.
254 (yytoknum_): Define when %define lex_symbol, independently of
256 (yytoken_number_): Move into...
257 (symbol::token): here, since that's the only use.
258 The other one is YYPRINT which was not officially supported
259 by lalr1.cc, and anyway it did not work since YYPRINT uses this
260 array under a different name (yytoknum).
262 2008-11-13 Akim Demaille <demaille@gostai.com>
265 * TODO (YYERRCODE): Mention the case of $undef.
267 2008-11-13 Akim Demaille <demaille@gostai.com>
270 * TODO (YYPRINT): New.
272 2008-11-13 Akim Demaille <demaille@gostai.com>
275 * data/lalr1.cc, data/yacc.c: Fix the description of the
276 yytranslate and yytoknum tables.
278 2008-11-13 Akim Demaille <demaille@gostai.com>
280 Define make_symbol in the header.
281 To reach good performances these functions should be inlined (yet
282 this is to measure precisely). To this end they must be available
285 * data/lalr1.cc (b4_symbol_constructor_definition_): Qualify
286 location_type with the class name.
287 Since will now be output in the header, declare "inline".
288 No longer use b4_symbol_constructor_specializations, but
289 b4_symbol_constructor_definitions in the header.
290 Don't call it in the *.cc file.
292 2008-11-13 Akim Demaille <demaille@gostai.com>
294 Define yytranslate in the header for lex_symbol.
295 * data/lalr1.cc: Move the invocation of b4_yytranslate_definition
296 into the header file when using %define lex_symbol.
297 (yytranslate_): Declare inline.
299 2008-11-13 Akim Demaille <demaille@gostai.com>
301 Define the constructors of symbol_type in
302 b4_symbol_constructor_definitions.
303 The constructors are called by the make_symbol functions, which a
304 forthcoming patch will move elsewhere. Hence the interest of
305 putting them together.
307 The stack_symbol_type does not need to be moved, it is used only
310 * data/lalr1.cc: Move symbol_type and symbol_base_type
312 (b4_symbol_constructor_definitions): here.
315 2008-11-13 Akim Demaille <demaille@gostai.com>
317 Make it easier to move the definition of yytranslate_.
318 Forthcoming changes will make it possible to use yytranslate_
319 from outside the parser implementation file.
321 * data/lalr1.cc (b4_yytranslate_definition): New.
324 2008-11-13 Akim Demaille <demaille@gostai.com>
326 Remove useless class specification.
327 * data/lalr1.cc (b4_symbol_constructor_specialization_): No need
328 to refer to the class name to use a type defined by the class for
329 arguments of member functions.
331 2008-11-13 Akim Demaille <demaille@gostai.com>
333 Finer input type for yytranslate.
334 This patch is debatable: the tradition expects yylex to return an int
335 which happens to correspond to token_number (which is an enum). This
336 allows for instance to return characters (such as '*' etc.). But this
337 goes against the stronger typing I am trying to have with the new
338 lex interface which return a symbol_type. So in this case, feed
339 yytranslate_ with a token_type.
341 * data/lalr1.cc (yytranslate_): When in %define lex-symbol,
344 2008-11-13 Akim Demaille <demaille@gostai.com>
346 Honor lex-params in %define lex_symbol mode.
347 * data/lalr1.cc: Use b4_lex_param.
349 2008-11-13 Akim Demaille <demaille@gostai.com>
352 * src/output.c (symbol_definitions_output): Rename symbol
353 attributes type_name and has_type_name as type and has_type.
354 * data/lalr1.cc: Adjust uses.
356 2008-11-13 Akim Demaille <demaille@gostai.com>
358 Use b4_type_names for the union type.
359 The union used to compute the size of the variant used to iterate
360 over the type of all the symbols, with a lot of redundancy. Now
361 iterate over the lists of symbols having the same type-name.
363 * data/lalr1.cc (b4_char_sizeof_): New.
364 (b4_char_sizeof): Use it.
365 Adjust to be called with a list of numbers instead of a single
367 Adjust its caller for new-line issues.
369 2008-11-13 Akim Demaille <demaille@gostai.com>
371 Define the "identifier" of a symbol.
372 Symbols may have several string representations, for instance if
373 they have an alias. What I call its "id" is a string that can be
374 used as an identifier. May not exist.
376 Currently the symbols which have the "tag_is_id" flag set are
377 those that don't have an alias. Look harder for the id.
379 * src/output.c (is_identifier): Move to...
380 * src/symtab.c (is_identifier): here.
381 * src/symtab.h, src/symtab.c (symbol_id_get): New.
382 * src/output.c (symbol_definitions_output): Use it to define "id"
384 Remove the definition of "tag_is_id".
385 * data/lalr1.cc: Use the "id" and "has_id" whereever "tag" and
386 "tag_is_id" were used to produce code.
387 We still use "tag" for documentation.
389 2008-11-11 Akim Demaille <demaille@gostai.com>
391 Locations are no longer required by lalr1.cc.
392 * data/lalr1.cc (_b4_args, b4_args): New.
393 Adjust all uses of locations to make them optional.
394 * tests/c++.at (AT_CHECK_VARIANTS): No longer use the locations.
395 (AT_CHECK_NAMESPACE): Check the use of locations.
396 * tests/calc.at (_AT_DATA_CALC_Y): Adjust to be usable with or
397 without locations with lalr1.cc.
399 * tests/output.at: Check lalr1.cc with and without location
401 * tests/regression.at (_AT_DATA_EXPECT2_Y, _AT_DATA_DANCER_Y):
404 2008-11-11 Akim Demaille <demaille@gostai.com>
407 * tests/local.at (AT_FULL_COMPILE): New.
408 * tests/actions.at, tests/calc.at, tests/regression.at: Use it.
410 2008-11-11 Akim Demaille <demaille@gostai.com>
412 Support parens in calc++.
413 * doc/bison.texinfo (Calc++ Scanner, Calc++ Parser): Support parens.
414 * examples/calc++/test (run): Check the expected output.
418 2008-11-11 Akim Demaille <demaille@gostai.com>
420 Simplify lalr1.cc since %defines is mandatory.
421 * data/lalr1.cc: Remove useless calls to b4_defines_if.
423 2008-11-11 Akim Demaille <demaille@gostai.com>
426 * TODO (yysyntax_error): New item.
428 2008-11-11 Akim Demaille <demaille@gostai.com>
431 * data/lalr1.cc: Use b4_error_verbose_if instead of #if
434 2008-11-11 Akim Demaille <demaille@gostai.com>
436 Support i18n of the parse error messages.
437 * TODO (lalr1.cc/I18n): Remove.
438 * data/lalr1.cc (yysyntax_error_): Support the translation of the
439 error messages, as done in yacc.c.
440 Stay within the yy* pseudo namespace.
442 2008-11-11 Akim Demaille <demaille@gostai.com>
445 * TODO (single stack, yysyntax_error): New.
447 2008-11-11 Akim Demaille <demaille@gostai.com>
449 Make it possible to return a symbol_type from yylex.
450 * data/lalr1.cc (b4_lex_symbol_if): New.
451 (parse): When lex_symbol is defined, expected yylex to return the
453 * etc/bench.pl.in (generate_grammar_list): Extend to support this
455 (bench_variant_parser): Exercise it.
457 2008-11-11 Akim Demaille <demaille@gostai.com>
459 Remove useless bench case.
460 * etc/bench.pl.in (bench_variant_parser): VARIANT_DESTROY is
463 2008-11-11 Akim Demaille <demaille@gostai.com>
465 Improve display of directives.
466 * etc/bench.pl.in (parse_term): Don't add useless eol.
468 2008-11-11 Akim Demaille <demaille@gostai.com>
470 Use string_cast in the bench.
471 * etc/bench.pl.in (generate_grammar_list): Define and use
474 2008-11-11 Akim Demaille <demaille@gostai.com>
476 Replace yychar with a Boolean.
477 * data/lalr1.cc (parse::yychar): Replace by...
478 (parse::yyempty): this.
480 2008-11-11 Akim Demaille <demaille@gostai.com>
485 2008-11-11 Akim Demaille <demaille@gostai.com>
487 Let yytranslate handle the eof case.
488 * data/lalr1.cc (yytranslate_): Handle the EOF case.
490 No longer expect yychar to be equal to yyeof_, rather, test the
491 lookahead's (translated) kind.
493 2008-11-11 Akim Demaille <demaille@gostai.com>
495 yychar cannot be empty in yyerrlab.
496 * TODO (yychar == yyempty_): New.
497 * data/lalr1.cc: Remove the handling of this case.
498 This eases forthcoming changes related to yychar and yytranslate.
500 2008-11-11 Akim Demaille <demaille@gostai.com>
502 Bench: syntactic sugar for %define/#define.
503 * etc/bench.pl.in (parse_dirs): Support %d and #d with arguments.
504 (&bench_push_parser, bench_variant_parser): Use this feature.
508 2008-11-11 Akim Demaille <demaille@gostai.com>
510 Less memory pressure on the "list" bench.
511 * etc/bench.pl.in (generate_grammar_list): Do not accumulate all
512 the values, to limit memory pressure.
514 2008-11-11 Akim Demaille <demaille@gostai.com>
516 Introduce make_symbol.
517 make_symbol provides a means to construct a full symbol (kind,
518 value, location) in a single shot. It is meant to be a Symbol
519 constructor, parameterized by the symbol kind so that overloading
520 would prevent incorrect kind/value pairs. Unfortunately
521 parameterized constructors do not work well in C++ (unless the
522 parameter also appears as an argument, which is not acceptable),
523 hence the use of a function instead of a constructor.
525 * data/lalr1.cc (b4_symbol_constructor_declaration_)
526 (b4_symbol_constructor_declarations)
527 (b4_symbol_constructor_specialization_)
528 (b4_symbol_constructor_specializations)
529 (b4_symbol_constructor_definition_)
530 (b4_symbol_constructor_definitions): New.
531 Use them where appropriate to generate declaration, declaration of
532 the specializations, and implementations of the templated
533 overloaded function "make_symbol".
534 (variant::variant): Always define a default ctor.
535 Also provide a copy ctor.
536 (symbol_base_type, symbol_type): New ctor overloads for value-less
538 (symbol_type): Now public, so that functions such as yylex can use
541 2008-11-11 Akim Demaille <demaille@gostai.com>
543 Inform m4 whether a tag is a valid id.
544 * src/output.c (is_identifier): New.
545 (symbol_definitions_output): Use it to define tag_is_id.
546 But maybe this should be done at m4 level?
548 2008-11-11 Akim Demaille <demaille@gostai.com>
550 Test 214 was failing: it greps with a pattern containing [ ]*
551 which obviously meant to catch spaces and tabs, but contained only
552 spaces. Tabulations in sources are a nuisance, so to simplify the
553 matter, get rid of all the tabulations in the Java sources. The
554 other skeletons will be treated equally later.
556 * data/java.m4, data/lalr1.java: Untabify.
557 * tests/java.at: Simplify AT_CHECK_JAVA_GREP invocations:
558 tabulations are no longer generated.
560 2008-11-11 Paolo Bonzini <bonzini@gnu.org>
562 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
563 * configure.ac: Adjust usage.
564 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
565 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
566 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
568 2008-11-10 Di-an Jan <dianj@freeshell.org>
570 Workaround Java's ``code too large'' problem for parser tables
571 in most cases, by using one function per initialization.
572 * data/java.m4 (b4_typed_parser_table, b4_integral_parser_table): New.
573 * data/lalr1.java (yypact_, yydefact_, yypgoto_, yydefgoto_,
574 yytable_, yycheck_, yystos_, yytoken_number_, yyr1_, yyr2_, yyrhs_
575 yyprhs_, yyrline_, yytranslate_table_): Use b4_integral_parser_table.
576 (yytname_): Use b4_typed_parser_table.
577 * doc/bison.texinfo (Java Bison Interface): Add note on Java's
578 ``code too large'' error.
580 2008-11-10 Di-an Jan <dianj@freeshell.org>
582 * NEWS: Document them.
584 General Java skeleton improvements.
585 * configure.ac (gt_JAVACOMP): Request target of 1.4, which allows
586 using gcj < 4.3 in the testsuite, according to comments in
587 gnulib/m4/javacomp.m4.
588 * data/java.m4 (stype, parser_class_name, lex_throws, throws,
589 location_type, position_type): Remove extraneous brackets from
590 b4_percent_define_default.
591 (b4_lex_param, b4_parse_param): Remove extraneous brackets from
592 m4_define and m4_define_default.
593 * data/lalr1.java (b4_pre_prologue): Change to b4_user_post_prologue,
594 which marks the end of user code with appropriate syncline, like all
596 (b4_user_post_prologue): Add. Don't silently drop.
598 (parse): Inline yylex.
599 * doc/bison.texinfo (bisonVersion, bisonSkeleton): Document.
600 (%{...%}): Fix typo of %code imports.
601 * tests/java.at (AT_JAVA_COMPILE): Add "java" keyword.
603 Support annotations on parser class with %define annotations.
604 * data/lalr1.java (annotations): Add to parser class modifier.
605 * doc/bison.texinfo (Java Parser Interface): Document
607 (Java Declarations Summary): Document %define annotations.
608 * tests/java.at (Java parser class modifiers): Test annotations.
610 Do not generate code for %error-verbose unless requested.
611 * data/lalr1.java (errorVerbose): Rename to yyErrorVerbose.
612 Make private. Make conditional on %error-verbose.
613 (getErrorVerbose, setErrorVerbose): New.
614 (yytnamerr_): Make conditional on %error-verbose.
615 (yysyntax_error): Make some code conditional on %error-verbose.
616 * doc/bison.texinfo (Java Bison Interface): Remove the parts
617 about %error-verbose having no effect.
618 (getErrorVerbose, setErrorVerbose): Document.
620 Move constants for token names to Lexer interface.
621 * data/lalr1.java (Lexer): Move EOF, b4_token_enums(b4_tokens) here.
622 * data/java.m4 (b4_token_enum): Indent for move to Lexer interface.
623 (parse): Qualify EOF to Lexer.EOF.
624 * doc/bison.texinfo (Java Parser Interface): Move documentation of
625 EOF and token names to Java Lexer Interface.
626 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove Calc qualifier.
629 * data/lalr1.java (Lexer.yyerror): Use longer parameter name.
630 (yyerror): Change to public. Add Javadoc comments. Use longer
631 parameter names. Make the body rather than the declarator
632 conditional on %locations.
633 * doc/bison.texinfo (yyerror): Document. Don't mark as protected.
635 Allow user to add code to the constructor with %code init.
636 * data/java.m4 (b4_init_throws): New, for %define init_throws.
637 * data/lalr1.java (YYParser.YYParser): Add b4_init_throws.
638 Add %code init to the front of the constructor body.
639 * doc/bison.texinfo (YYParser.YYParser): Document %code init
640 and %define init_throws.
641 (Java Declarations Summary): Document %code init and
643 * tests/java.at (Java %parse-param and %lex-param): Adjust grep.
644 (Java constructor init and init_throws): Add tests.
646 2008-11-10 Akim Demaille <demaille@gostai.com>
649 * TODO (-D): is implemented.
650 (associativity): Same precedence must have the same associativity.
651 For instance, how can a * b / c be parsed if * is %left and / is
653 (YYERRORCODE, YYFAIL, YYBACKUP): New.
655 2008-11-10 Akim Demaille <demaille@gostai.com>
659 2008-11-10 Akim Demaille <demaille@gostai.com>
661 More information about the symbols.
662 * src/output.c (type_names_output): Document all the symbols,
663 including those that don't have a type-name.
664 (symbol_definitions_output): Define "is_token" and
666 * data/lalr1.cc (b4_type_action_): Skip symbols that have an empty
667 type-name, now that they are defined too in b4_type_names.
669 2008-11-10 Akim Demaille <demaille@gostai.com>
673 2008-11-10 Akim Demaille <demaille@gostai.com>
675 Make parser::yytranslate static.
676 Small speedup (1%) on the list grammar. And makes yytranslate_
677 available in non member functions.
679 * data/lalr1.cc (yytranslate_): Does not need to be a instance
682 2008-11-10 Akim Demaille <demaille@gostai.com>
684 Avoid trailing spaces.
685 * data/c.m4: b4_comment(TEXT): Don't indent empty lines.
686 * data/lalr1.cc: Don't indent before rule and symbol actions, as
687 they can be empty, and anyway this incorrectly indents the first
690 2008-11-10 Akim Demaille <demaille@gostai.com>
694 2008-11-10 Akim Demaille <demaille@gostai.com>
696 Use "enum" for integral constants.
697 This is just nicer to read, I observed no speedup.
699 * data/lalr1.cc (yyeof_, yylast_, yynnts_, yyempty_, yyfinal_)
700 (yterror_, yyerrcode_, yyntokens_): Define as members of an enum.
701 (yyuser_token_number_max_, yyundef_token_): Move into...
702 (yytranslate_): here.
704 2008-11-10 Akim Demaille <demaille@gostai.com>
706 Shortcuts in bench directives.
707 * etc/bench.pl.in (parse_dirs): New.
709 (bench_variant_parser, bench_fusion_parser): Use %s and %d.
710 Create the benches in "benches/".
712 2008-11-10 Akim Demaille <demaille@gostai.com>
715 * data/lalr1.cc: here.
717 2008-11-10 Akim Demaille <demaille@gostai.com>
719 Adjust verbose message to using emacs.
720 * etc/bench.pl.in: Inform compilation-mode when we change the
722 (generate_grammar_list): Recognize %define "variant" in addition
725 2008-11-10 Akim Demaille <demaille@gostai.com>
727 Classify symbols by type-name.
728 * src/uniqstr.h (UNIQSTR_CMP): New.
729 * src/output.c (symbol_type_name_cmp, symbols_by_type_name)
730 (type_names_output): New.
731 (muscles_output): Use it.
732 * data/lalr1.cc (b4_symbol_action_): Remove.
733 (b4_symbol_case_, b4_type_action_): New.
734 Adjust uses of b4_symbol_action_ to use b4_type_action_.
736 2008-11-10 Akim Demaille <demaille@gostai.com>
738 Change the handling of the symbols in the skeletons.
739 Before we were using tables which lines were the symbols and which
740 columns were things like number, tag, type-name etc. It is was
741 difficult to extend: each time a column was added, all the numbers had
742 to be updated (you asked for colon $2, not for "tag"). Also, it was
743 hard to filter these tables when only a subset of the symbols (say the
744 tokens, or the nterms, or the tokens that have and external number
745 *and* a type-name) was of interest.
747 Now instead of monolithic tables, we define one macro per cell. For
748 instance "b4_symbol(0, tag)" is a macro name which contents is
749 self-decriptive. The macro "b4_symbol" provides easier access to
752 * src/output.c (type_names_output): Remove.
753 (symbol_numbers_output, symbol_definitions_output): New.
754 (muscles_output): Call them.
755 (prepare_symbols): Define b4_symbols_number.
757 2008-11-10 Akim Demaille <demaille@gostai.com>
760 * src/getargs.h, src/getargs.c (trace_muscle): New.
761 (trace_types, trace_args): Support it.
762 * src/output.c (output_skeleton): Use it.
764 2008-11-10 Akim Demaille <demaille@gostai.com>
767 * src/output.c (muscles_output): New, extracted from...
768 (output_skeleton): here.
771 2008-11-10 Akim Demaille <demaille@gostai.com>
775 2008-11-10 Akim Demaille <demaille@gostai.com>
777 Update the variant example.
778 * examples/variant.yy: Formatting changes.
781 2008-11-10 Akim Demaille <demaille@gostai.com>
783 Support constructor with an argument.
784 This improves the "list" bench by 2%.
786 * data/lalr1.cc (variant::build): Add an overloaded version with
788 * tests/c++.at (AT_CHECK_VARIANT): Check it.
790 2008-11-10 Akim Demaille <demaille@gostai.com>
793 * tests/c++.at (AT_CHECK_VARIANTS): New.
794 Use it with and without %define assert.
796 2008-11-10 Akim Demaille <demaille@gostai.com>
798 Add %precedence support.
799 Unfortunately it is not possible to reuse the %prec directive. This
800 is because to please POSIX, we do not require to end the rules with a
801 semicolon. As a result,
805 is ambiguous: either a rule which precedence is that of baz, or a rule,
806 and then a declaration of the precedence of the token baz.
808 * doc/bison.texinfo: Document %precedence.
809 (Precedence Only): New.
810 * src/assoc.h, src/assoc.c (precedence_assoc): New.
811 * src/conflicts.c (resolve_sr_conflict): Support it.
812 * src/scan-gram.l, src/parse-gram.y (%precedence): New token.
814 * tests/calc.at: Use %precedence for NEG.
815 * tests/conflicts.at (%precedence does not suffice)
816 (%precedence suffices): New tests.
818 2008-11-09 Akim Demaille <demaille@gostai.com>
820 Make benches in a sub dirs.
821 * etc/bench.pl.in ($dir): New.
823 Check the use of constructors with an argument.
824 (bench_variant_parser): Fix.
826 2008-11-09 Akim Demaille <demaille@gostai.com>
830 2008-11-09 Akim Demaille <demaille@gostai.com>
834 2008-11-09 Akim Demaille <demaille@gostai.com>
836 Require the generation of parse-gram.output.
837 * src/Makefile.am (YACC): Pass --report=all.
839 2008-11-09 Akim Demaille <demaille@gostai.com>
843 2008-11-09 Akim Demaille <demaille@gostai.com>
846 * TODO: Remove obsolete items.
849 2008-11-09 Akim Demaille <demaille@gostai.com>
852 * etc/bench.pl.in (parse, parse_expr, parse_term, parse_fact)
853 (@token, $grammar, $bench): New.
854 (generate_grammar_variant): Rename as...
855 (generate_grammar_list): this.
856 (generate_grammar): Adjust.
857 (bench_grammar): Rename as...
859 Use it in the various bench-marking routines.
860 (-b, -g): New options.
862 2008-11-09 Akim Demaille <demaille@gostai.com>
864 Use a static hierarchy for symbols in the C++ parser.
865 * data/lalr1.cc (symbol_base_type, symbol_type)
866 (stack_symbol_type): Make it a static hierarchy.
869 2008-11-09 Akim Demaille <demaille@gostai.com>
871 bench.pl -d, --directive.
872 * etc/bench.pl.in (@directive): New.
873 (&bench_grammar): Use it.
874 (&bench_list_grammar): New, to provide access to the "variant"
877 (getopts): Support -d, --directive.
879 2008-11-09 Akim Demaille <demaille@gostai.com>
881 Use inline for small operations.
882 * data/lalr1.cc (symbol_base_type, symbol_type)
883 (stack_symbol_type): Declare constructor and other operations as
885 (yy_destroy_): Inline.
887 2008-11-09 Akim Demaille <demaille@gostai.com>
889 Introduce a hierarchy for symbols.
890 * data/lalr1.cc (symbol_base_type, symbol_type): New.
891 (data_type): Rename as...
892 (stack_symbol_type): this.
893 Derive from symbol_base_type.
894 (yy_symbol_value_print_): Merge into...
895 (yy_symbol_print_): this.
898 (yydestruct_): Rename as...
900 (b4_symbols_actions, YY_SYMBOL_PRINT): Adjust.
901 (parser::parse): yyla is now of symbol_type.
902 Use its type member instead of yytoken.
904 2008-11-09 Akim Demaille <demaille@gostai.com>
906 Rename data_type and stack_symbol_type.
907 * data/lalr1.cc (data_type): Rename as...
908 (stack_symbol_type): this.
910 2008-11-09 Akim Demaille <demaille@gostai.com>
912 Handle semantic value and location together.
913 * data/lalr1.cc (b4_symbol_actions): Bounce $$ and @$ to
914 yydata.value and yydata.location.
915 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_)
916 (YY_SYMBOL_PRINT): Now take semantic value and location as a
919 (yydestruct_): New overload for a stack symbol.
921 2008-11-09 Akim Demaille <demaille@gostai.com>
923 Push a complete symbol, not connected parts.
924 * data/lalr1.cc (yypush_): Take a data_type&, not disconnected
925 state, value and location.
928 2008-11-09 Akim Demaille <demaille@gostai.com>
930 Agregate yylval and yylloc.
931 * data/lalr1.cc (parser::yylval, parser::yylloc): Replace by...
932 (parser::yyla): this.
934 2008-11-09 Akim Demaille <demaille@gostai.com>
936 Rely on the state stack to display reduction traces.
937 To display rhs symbols before a reduction, we used information
938 about the rule reduced, which required the tables yyrhs and
939 yyprhs. Now use rely only on the state stack to get the same
942 * data/lalr1.cc (b4_rhs_data, b4_rhs_state): New.
944 (parser::yyrhs_, parser::yyprhs_): Remove.
945 (parser::yy_reduce_print_): Use the state stack.
947 2008-11-09 Akim Demaille <demaille@gostai.com>
949 Fuse yyval and yyloc into yylhs.
950 * data/lalr1.cc (b4_lhs_value, b4_lhs_location): Adjust to using
952 (parse): Replace yyval and yyloc with yylhs.value and
954 After a user action, compute yylhs.state earlier.
955 (yyerrlab1): Do not play tricks with yylhs.location, rather, use a
958 2008-11-09 Di-an Jan <dianj@freeshell.org>
960 Remove unused variable.
961 * src/output.c (type_names_output): Remove unused variable sep.
963 2008-11-09 Paolo Bonzini <bonzini@gnu.org>
965 Change tests/output.at quoting.
966 * tests/output.at (AT_CHECK_OUTPUT): Use conventional m4 quoting when
969 2008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
971 Don't add a semicolon to actions for %skeleton or %language.
972 It breaks Java test cases as reported by Akim Demaille.
973 * src/scan-code.l: Implement.
975 2008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
977 Clean up %skeleton and %language priority implementation.
978 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
979 remove static qualifier because others will soon need to see it.
980 (language_prio): Likewise.
981 (getargs): Use command_line_prio rather than 0.
982 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
984 (skeleton_prio): Extern it.
985 (language_prio): Extern it.
986 * src/parse-gram.y: Use grammar_prio rather than 1.
988 2008-11-07 Akim Demaille <demaille@gostai.com>
990 Moving push traces into yypush_.
991 * data/lalr1.cc (yypush_): Now takes a optional trace message.
994 2008-11-07 Akim Demaille <demaille@gostai.com>
996 The single-stack C++ parser is now the standard one.
997 * data/lalr1.cc: Rename as...
998 * data/lalr1-split.cc: this.
999 * data/lalr1-fusion.cc: Rename as...
1000 * data/lalr1.cc: this.
1001 * etc/bench.pl.in: Adjust.
1003 2008-11-07 Akim Demaille <demaille@gostai.com>
1005 Avoid empty-if warnings.
1006 Reported by Quentin Hocquet.
1008 * data/lalr1-fusion.cc (YY_SYMBOL_PRINT, YY_REDUCE_PRINT)
1009 (YY_STACK_PRINT): Provide some contents even when !YYDEBUG.
1011 2008-11-07 Akim Demaille <demaille@gostai.com>
1013 Pass command line location to skeleton_arg and language_argmatch.
1014 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
1015 The location argument is now mandatory.
1016 Adjust all dependencies.
1017 (getargs): Use command_line_location.
1019 2008-11-07 Akim Demaille <demaille@gostai.com>
1022 * src/getargs.c (usage): Document -D.
1023 Fix help string for --locations.
1024 (command_line_location): New.
1025 (short_options, long_options, getargs): Support -D, --define.
1026 (getargs): Move -d support at the right place.
1027 * doc/bison.texinfo (Bison Options): Update.
1028 * tests/input.at (%define, --define): New.
1030 2008-11-07 Akim Demaille <demaille@gostai.com>
1032 Initialize the muscle table before parsing the command line.
1033 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
1034 (getargs): Define file_name.
1035 * src/main.c (main): Initialize muscle_tab before calling
1037 * src/muscle_tab.c (muscle_init): No longer define file_name, as
1038 its value is not available yet.
1040 2008-11-07 Akim Demaille <demaille@gostai.com>
1042 Locations without columns for command line arguments.
1043 * src/location.c (location_print): Don't display negative columns.
1044 * src/location.h: Document this.
1046 2008-11-07 Akim Demaille <demaille@gostai.com>
1049 * src/getargs.c (usage): Fix help string for -W.
1051 2008-11-07 Akim Demaille <demaille@gostai.com>
1053 Handle more general types of option arguments.
1054 * build-aux/cross-options.pl: The argument ends at the first
1055 space, not the first non-symbol character.
1056 Use @var for each word appearing the argument description.
1058 2008-11-07 Akim Demaille <demaille@gostai.com>
1060 Destroy the variants that remain on the stack in case of error.
1061 * data/lalr1-fusion.cc (yydestruct_): Invoke the variant's
1063 Display the value only if yymsg is nonnull.
1064 (yyreduce): Invoke yydestruct_ when popping lhs symbols.
1066 2008-11-07 Akim Demaille <demaille@gostai.com>
1068 Add "%define assert" to variants.
1069 This is used to help the user catch cases where some value gets
1070 ovewritten by a new one. This should not happen, as this will
1073 Unfortunately this uncovered a bug in the C++ parser itself: the
1074 lookahead value was not destroyed between two calls to yylex. For
1075 instance if the previous lookahead was a std::string, and then an int,
1076 then the value of the std::string was correctly taken (i.e., the
1077 lookahead was now an empty string), but std::string structure itself
1080 This is now done in variant::build(other&) (which is used to take the
1081 value of the lookahead): other is not only stolen from its value, it
1082 is also destroyed. This incurs a new performance penalty of a few
1083 percent, and union becomes faster again.
1085 * data/lalr1-fusion.cc (variant::build(other&)): Destroy other.
1086 (b4_variant_if): New.
1087 (variant::built): New.
1088 Use it whereever the status of the variant changes.
1089 * etc/bench.pl.in: Check the penalty of %define assert.
1091 2008-11-07 Akim Demaille <demaille@gostai.com>
1093 Use "%define variant" in bench.pl.
1094 * etc/bench.pl.in: No longer use the pseudo directive %variants,
1095 just use %define variants.
1097 2008-11-07 Akim Demaille <demaille@gostai.com>
1100 * src/parse-gram.h, src/parse-gram.c: Regen.
1102 2008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
1104 Fix user actions without a trailing semicolon.
1105 Reported by Sergei Steshenko at
1106 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
1107 * THANKS (Sergei Steshenko): Add.
1108 * src/scan-code.l (SC_RULE_ACTION): Fix it.
1109 * tests/regression.at (Fix user actions without a trailing semicolon):
1112 2008-11-04 Akim Demaille <demaille@gostai.com>
1114 Use b4_copyright_years.
1115 * data/yacc.c (b4_copyright_years): New.
1116 Fix its value according to the comments in the file.
1117 Use it and undefine it.
1119 2008-11-04 Akim Demaille <demaille@gostai.com>
1122 * data/lalr1-fusion.cc, src/parse-gram.y: here.
1124 2008-11-04 Akim Demaille <demaille@gostai.com>
1127 * data/lalr1-fusion.cc: here.
1129 2008-11-04 Akim Demaille <demaille@gostai.com>
1131 Use strict on bench.pl.
1132 * etc/bench.pl.in (&run, &generate_grammar): New.
1133 Rename the grammar generating functions for consistency.
1134 Change the interface so that the list of benches to run is passed
1135 as (optionless) arguments.
1136 (&compile): Use &run.
1138 2008-11-04 Akim Demaille <demaille@gostai.com>
1140 Remove spurious initial empty lines.
1141 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
1142 * data/yacc.c: End the @output lines with an @.
1144 2008-11-04 Akim Demaille <demaille@gostai.com>
1146 Improve the display of sizes.
1147 * etc/bench.p.in: Higher precision.
1148 Sort by decreasing size.
1150 2008-11-04 Akim Demaille <demaille@gostai.com>
1152 Don't memcpy C++ structures.
1153 * data/lalr1-fusion.cc (b4_symbol_variant): Adjust additional
1155 (variant::build): New overload for
1156 copy-construction-that-destroys.
1157 (variant::swap): New.
1158 (parser::yypush_): Use it in variant mode.
1160 2008-11-04 Akim Demaille <demaille@gostai.com>
1162 Better defaults for bench.pl.
1163 * etc/bench.pl.in ($verbose, $cflags, $iterations): Change the
1165 Adjust &verbose uses.
1168 2008-11-04 Akim Demaille <demaille@gostai.com>
1170 Make variant.yy more complex.
1171 std::list cannot be copied via memcpy, they are more demanding than
1172 std::string. Use one std::list to strengthen the test.
1174 * examples/variant.yy: Use lalr1-fusion.cc, not lalr1.cc.
1176 Create a list of strings, instead of a single large string.
1178 2008-11-04 Akim Demaille <demaille@gostai.com>
1181 * etc/bench.pl.in (--bench, $bench): New.
1183 2008-11-04 Akim Demaille <demaille@gostai.com>
1186 * data/lalr1-fusion.cc (destroy): Use as() in its definition.
1187 Define it after as().
1189 2008-11-04 Akim Demaille <demaille@gostai.com>
1192 * data/lalr1-fusion.cc (b4_rhs_location): Remove useless parens.
1194 2008-11-04 Akim Demaille <demaille@gostai.com>
1196 Issue missing synclines after user actions.
1197 * data/c.m4 (b4_case): Issue synclines on the output file.
1199 2008-11-04 Akim Demaille <demaille@gostai.com>
1201 Remove trailing empty line.
1202 * data/lalr1-fusion.cc: Don't add an empty line after the user's
1205 2008-11-04 Akim Demaille <demaille@gostai.com>
1207 Fix output of copyright years.
1208 * data/bison.m4 (b4_copyright): Fix the indentation of the
1209 copyright year paragraph.
1210 Use b4_copyright_years when no years are given.
1211 * data/lalr1.cc, data/lalr1-fusion.cc, data/location.cc
1212 (b4_copyright_years): New.
1215 2008-11-04 Akim Demaille <demaille@gostai.com>
1217 Avoid the spurious initial empty line.
1218 * data/lalr1-fusion.cc, data/location.cc: Put a trailing "@" at
1219 the end of @output request to suppress the empty line that
1222 2008-11-04 Akim Demaille <demaille@gostai.com>
1224 Remove parser::rhs_number_type.
1225 * data/lalr1-fusion.cc (rhs_number_type): No longer define it.
1226 (yyrhs_): Use b4_table_define.
1228 2008-11-04 Akim Demaille <demaille@gostai.com>
1231 * data/lalr1-fusion.cc: Use an int to iterate up to an int.
1233 2008-11-04 Akim Demaille <demaille@gostai.com>
1235 Factor the declaration of the integer tables.
1236 * data/lalr1-fusion.cc (b4_table_define): New.
1239 2008-11-03 Akim Demaille <demaille@gostai.com>
1241 Fix indentation of tables in lalr1.cc
1242 * data/lalr1-fusion.cc: Fix the indentation.
1244 2008-11-03 Akim Demaille <demaille@gostai.com>
1246 Destroy the lhs symbols after reduction.
1247 * data/lalr1-fusion.cc (parse): After the user action, when in
1248 variant mode, destroy the lhs symbols.
1250 2008-11-03 Akim Demaille <demaille@gostai.com>
1252 Simplify yysyntax_error_ use.
1253 * data/lalr1-fusion.cc (yysyntax_error_): Always pass it the token
1254 type, but make it unnamed in the declaration when it is not used.
1256 2008-11-03 Akim Demaille <demaille@gostai.com>
1258 Let yy::variant::build return an lvalue.
1259 * data/lalr1-fusion.cc (variant::build): Return a reference to the
1262 2008-11-03 Akim Demaille <demaille@gostai.com>
1264 Define yy::variant only when needed.
1265 * data/lalr1-fusion.cc (yy::variant): Define only if variants are
1268 2008-11-03 Akim Demaille <demaille@gostai.com>
1270 Bench the three-stack lalr1.cc.
1271 * etc/bench.pl.in: Bench the three-stack lalr1.cc vs. the
1274 2008-11-03 Akim Demaille <demaille@gostai.com>
1276 Fail on parse error in calc++.
1277 * doc/bison.texinfo (calc++.cc): Propagate failures to the exit
1279 * examples/calc++/test ($me, $number, $exit, run): New.
1280 Use them to propagate errors to the exit status.
1282 2008-11-03 Akim Demaille <demaille@gostai.com>
1284 Don't specify the skeleton twice in the example.
1285 * examples/calc++/Makefile.am: Don't pass -S to Bison, the grammar
1286 file does what is needed.
1288 2008-11-03 Akim Demaille <demaille@gostai.com>
1290 bench: Improve output.
1291 * etc/bench.pl.in (bench_grammar): Tune the printf format.
1293 2008-11-03 Akim Demaille <demaille@gostai.com>
1295 bench: check impact of %debug on variants.
1296 * etc/bench.pl.in (variant_grammar): Fix the computation of
1298 Generate a grammar file that can work with or without %debug.
1299 Do use the @directive.
1300 (bench_variant_parser): Check impact of %debug.
1301 (@directives): Rename all the occurrences to...
1302 (@directive): this, for consistency.
1304 2008-11-03 Akim Demaille <demaille@gostai.com>
1306 bench: report the size too.
1307 * etc/bench.pl.in ($iterations): Defaults to -3.
1308 (&bench_grammar): Require hireswallclock.
1309 Compute and display the size of the result.
1312 2008-11-03 Akim Demaille <demaille@gostai.com>
1314 bench: More use of the verbosity level.
1315 * etc/bench.pl.in ($verbose, &verbose): New.
1317 More POD documentation.
1319 2008-11-03 Akim Demaille <demaille@gostai.com>
1321 bench.pl: a command line interface
1322 * etc/bench.pl.in: More doc.
1323 Some fixes in the documentation.
1324 ($cflags, $iterations, &help, &getopt): New.
1326 (&variant_grammar): Let the number of stages be 10 times what is
1329 2008-11-03 Akim Demaille <demaille@gostai.com>
1331 Bench the use of Boost.Variants.
1332 * etc/bench.pl.in ($cxx, &variant_grammar, &bench_variant_parser):
1334 (&compile): Be ready to compile C++ parsers.
1335 (&bench_push_parser): Move debug information to the outermost
1337 * THANKS: Add Michiel De Wilde.
1339 2008-11-03 Akim Demaille <demaille@gostai.com>
1341 bench.pl: Pass directives as a list instead of as a string.
1342 * etc/bench.pl.in (&directives): New.
1343 (&triangular_grammar, &calc_grammar): Use it to format the Bison
1345 (&triangular_grammar): Do use the directives (were ignored).
1346 (&bench_grammar, &bench_push_parser): Adjust to pass lists of
1349 2008-11-03 Akim Demaille <demaille@gostai.com>
1351 Improve genericity of bench.pl.
1352 * etc/bench.pl.in (&bench_grammar): Take the set of benches as
1354 (&bench_push_parser): New.
1357 2008-11-03 Akim Demaille <demaille@gostai.com>
1359 Add documentation to bench.pl.
1360 * etc/bench.pl.in: Comment changes.
1362 2008-11-03 Akim Demaille <demaille@gostai.com>
1364 Fuse the three stacks into a single one.
1366 In order to make it easy to perform benchmarks to ensure that
1367 there are no performance loss, lalr1.cc is forked into
1368 lalr1-fusion.cc. Eventually, lalr1-fusion.cc will replace
1371 Meanwhile, to make sure that lalr1-fusion.cc is correctly
1372 exercized by the test suite, the user must install a symbolic link
1373 from lalr1.cc to it.
1375 Instead of having three stacks (state, value, location), use a
1376 stack of triples. This considerably simplifies the code (and it
1377 will be easier not to require locations as currently does the C++
1378 parser), and also gives a 10% speedup according to
1379 etc/bench (probably mainly since memory allocation is done once
1380 instead of three times).
1382 Another motivation is to make it easier to destruct properly
1383 semantic values: now that they are bound to their state (hence
1384 symbol type) it will be easier to call the appropriate destructor.
1386 These changes should probably benefit the C parser too.
1388 * data/lalr1.cc: Copy as...
1389 * data/lalr1-fusion.cc: this new file.
1390 (b4_rhs_value, b4_rhs_location): New definitions overriding those
1392 (state_stack_type, semantic_stack_type, location_stack_type)
1393 (yystate_stack_, yysemantic_stack_, yylocation_stack_): Remove.
1394 (data_type, stack_type, yystack_): New.
1395 (YYLLOC_DEFAULT, yypush_): Adjust.
1396 (yyerror_range): Now based on data_type, not location_type.
1398 2008-11-03 Akim Demaille <demaille@gostai.com>
1400 Push the state, value, and location at the same time.
1401 This is needed to prepare a forthcoming patch that fuses the three
1404 * data/lalr1.cc (parser::yypush_): New.
1405 (parser::yynewstate): Change the semantics: instead of arriving to
1406 this label when value and location have been pushed, but yystate
1407 is to be pushed on the state stack, now the three of them must
1408 have been pushed before. yystate still must be the new state.
1409 This allows to use yypush_ everywhere instead of individual
1410 handling of the stacks.
1412 2008-11-03 Akim Demaille <demaille@gostai.com>
1414 Prefer references to pointers.
1415 * data/lalr1.cc (b4_symbol_actions): New, overrides the default C
1416 definition to use references instead of pointers.
1417 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_):
1418 Take the value and location as references.
1421 2008-11-03 Akim Demaille <demaille@gostai.com>
1423 stack::size instead of stack::height.
1424 * data/lalr1.cc (stack::height): Rename as...
1425 (stack::size): this.
1426 Fix the output type.
1429 2008-11-03 Akim Demaille <demaille@gostai.com>
1431 Use variants to support objects as semantic values.
1432 This patch was inspired by work by Michiel De Wilde. But he used
1433 Boost variants which (i) requires Boost on the user side, (ii) is
1434 slow, and (iii) has useless overhead (the parser knows the type of
1435 the semantic value there is no reason to duplicate this
1436 information as Boost.Variants do).
1438 This implementation reserves a buffer large enough to store the
1439 largest objects. yy::variant implements this buffer. It was
1440 implemented with Quentin Hocquet.
1442 * src/output.c (type_names_output): New.
1443 (output_skeleton): Invoke it.
1444 * data/c++.m4 (b4_variant_if): New.
1445 (b4_symbol_value): If needed, provide a definition for variants.
1446 * data/lalr1.cc (b4_symbol_value, b4_symbol_action_)
1447 (b4_symbol_variant, _b4_char_sizeof_counter, _b4_char_sizeof_dummy)
1448 (b4_char_sizeof, yy::variant): New.
1449 (parser::parse): If variants are requested, define
1450 parser::union_type, parser::variant, change the definition of
1451 semantic_type, construct $$ before running the user action instead
1452 of performing a default $$ = $1.
1453 * examples/variant.yy: New.
1454 Based on an example by Michiel De Wilde.
1456 2008-11-03 Akim Demaille <demaille@gostai.com>
1458 Parameterize the extraction of semantic values.
1459 To make future changes easier, no longer rely on ".TYPE" being the
1460 way to get a semantic value.
1462 * data/c.m4 (b4_symbol_value): New.
1464 * data/c++.m4, data/yacc.c: Use it.
1465 * data/glr.c: Use b4_symbol_value.
1469 2008-11-03 Akim Demaille <demaille@gostai.com>
1471 Prepare easier M4 changes.
1472 * data/lalr1.cc: Use escaped [] instead of literals to prepare
1475 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1477 Initiate further development.
1478 * NEWS: Create an empty section for new entries.
1479 * gnulib: Update submodule to HEAD.
1481 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1483 * NEWS: Version 2.4.
1485 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1487 Prepare for next release.
1488 * NEWS: Briefly mention changes since 2.3b.
1489 * README: Say GNU m4 1.4.6, which we've been requiring in release
1490 announcements already, not 1.4.3, which breaks the build.
1492 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1494 Say %language is experimental.
1495 We're thinking of extending it's effect on output file naming. See the
1497 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
1498 * NEWS: Say it's experimental.
1499 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
1500 recommend it over %skeleton for now.
1501 (Bison Options): Likewise.
1502 (C++ Bison Interface): Use %skeleton not %language.
1503 (Calc++ Parser): Use %skeleton not %language.
1504 * src/getargs.c (usage): Say it's experimental.
1506 2008-11-01 Di-an Jan <dianj@freeshell.org>
1507 Paolo Bonzini <bonzini@gnu.org>
1509 Support all Java parser class modifiers.
1510 * data/java.m4 (b4_percent_define_get3): New.
1511 (b4_final_if, b4_strictfp_if): New.
1512 * data/lalr1.java (final, strictfp, extends, implements): Support.
1513 * doc/bison.texinfo (final, strictfp, extends, implements): Add
1515 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
1516 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
1517 (AT_CHECK_JAVA_GREP): New.
1518 (Java parser class modifiers): New test.
1519 (Java parser class extends and implements): New test.
1521 Model exception propagation better with throws and lex_throws.
1522 * data/java.m4 (b4_list2): New.
1523 (throws): Change default.
1524 * data/lalr1.java (yyaction): Add throws.
1525 (parse): Add lex_throws in addition to throws.
1526 * doc/bison.texinfo (throws, lex_throws): Add documentation.
1527 * tests/java.at (Java throws specifications): New test.
1529 Improve documentation for Java parsers.
1530 * doc/bison.texinfo (Java Parsers): Add subsections.
1531 Don't quote first argument of %define.
1532 (Java Bison Interface): Document output files. Move documentation
1533 of parser class and merge into Java Parser Interface. Document
1534 features that error out. Document directives with no effect.
1535 Move note about Javadoc higher.
1536 (Java Semantic Values): Explicitly mention stype.
1537 Document that generic types cannot be used.
1538 (Java Location Values): Use @deftypeivar. Document constructors.
1539 Correct return value for toString.
1540 (Java Parser Interface): List undocumented constants/fields.
1541 Move documentation of fields added by %parse-param closer to list
1542 of members. Document that token names are added as fields.
1543 Document constructors accurately. Remove error method.
1544 (Java Scanner Interface): Move note on %pure-parser to Java Bison
1545 Interface. Describe %code lexer and yylex accutately.
1546 Remove documentation that does not match the code.
1547 (Java Action Features): New.
1548 (Java Differences): Add reference. Add item on semantic values.
1549 Add note about @{ ... @}. Clarify %% epilogue placement.
1550 (Java Declarations Summary): New.
1553 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
1554 (b4_remove_comma): Quote test argument.
1555 (b4_identification): Remove "bison" field.
1556 * tests/java.at (Java parser class and package names): New test.
1557 (Java %parse-param and %lex-param): New test.
1558 (Java stype, position_class and location_class): New test.
1560 2008-10-31 Di-an Jan <dianj@freeshell.org>
1562 * data/lalr1.jave: Update copyright years.
1563 (YYParser): Correct name of "generated from" file in Javadoc:
1564 use b4_file_name instead of @ofile@.
1565 (Location constructor): Correct Javadoc parameter name.
1566 (yylloc): Add missing opening m4 quote after b4_location_if.
1567 This removes a stray [ in the Javadoc of Lexer.getStartPos.
1568 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
1569 (YYParser constructor): Correct Javadoc parameter name.
1571 2008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
1573 Always put auxiliary code files in the same dir as other output files.
1574 * src/files.c (compute_file_name_parts): When the user specifies
1575 --output but not --file-prefix, extract the directory prefix from the
1576 file prefix not from the grammar file name. This affects the location
1577 of files like location.hh generated by the C++ skeleton. The includes
1578 in the other output files require this fix.
1579 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
1580 for expected output files.
1581 (Output files): Add a test for the above.
1583 2008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
1585 * gnulib: Update submodule to HEAD.
1587 2008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
1589 Update copyright year.
1590 * src/files.c: Here.
1592 2008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
1594 Don't overwrite the input file.
1595 * src/files.c (output_file_name_check): Fatal error if using input file
1597 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
1599 (Conflicting output files): Add test.
1601 2008-10-28 Akim Demaille <demaille@gostai.com>
1604 * data/lalr1.cc: Formatting changes.
1606 2008-10-28 Akim Demaille <demaille@gostai.com>
1608 Don't define debugging functions when !YYDEBUG.
1609 * data/lalr1.cc (debug_stream, set_debug_stream)
1610 (debug_level_type, debug_level, set_debug_level): Don't
1611 declare them when YYDEBUG is not defined.
1612 The implementation are already YYDEBUG-aware.
1614 2008-10-28 Akim Demaille <demaille@gostai.com>
1616 Prefer "continue" for empty loop bodies.
1617 * etc/bench.pl.in: Use "continue" instead of {}.
1619 2008-10-28 Akim Demaille <demaille@gostai.com>
1621 Space and comments changes.
1622 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
1623 * data/c.m4, data/lalr1.cc: Space changes.
1625 2008-10-28 Akim Demaille <demaille@gostai.com>
1627 Make gnulib a submodule.
1629 * .gitmodules (gnulib): New.
1631 2008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
1633 Fix yyerror_range for user-defined location type in C++. Reported by
1635 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
1636 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
1637 * THANKS (Georg Sauthoff): Add.
1639 2008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
1641 Update several administrative files mainly to facilitate releasing.
1642 * HACKING (Administrivia): Make the git-merge-changelog notes more
1644 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
1645 (Release Procedure): Update for git and add numerous details that were
1647 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
1648 * maint.mk (announcement): Don't list bison as a bootstrap tool so
1649 that announcements don't claim we bootstrapped with whatever bison
1650 happened to be in PATH. Add flex as a bootstrap tool.
1651 * Makefile.maint: Remove, previously replaced by maint.mk.
1652 * Makefile.cfg: Remove, and migrate settings to...
1653 * cfg.mk: ... here for the sake of `make announcement'.
1654 * bootstrap.conf (gnulib_modules): Add announce-gen.
1655 * README: Say GNU Bison instead of just Bison. Suggested by Karl
1658 2008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
1660 Small but important bugfixes for the Java skeleton.
1661 * data/lalr1.java (yyerror): Change Location to b4_location_type.
1662 (yy_symbol_print): Call toString on yyvaluep.
1664 2008-08-29 Akim Demaille <demaille@gostai.com>
1666 Clarify UPDATED use.
1667 * doc/bison.texinfo: It refers to the last edition of this file,
1668 not to the release date of Bison.
1669 Reported by Joel E. Denny.
1671 2008-08-29 Akim Demaille <demaille@gostai.com>
1673 * README: Update FAQ pointer.
1674 Reported by Joel E. Denny.
1676 2008-08-27 Eric Blake <ebb9@byu.net>
1678 Resync m4sugar from autoconf.
1679 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
1680 (m4_init): Adjust to latest m4.git changes.
1681 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
1683 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
1684 (_m4_list_cmp): Reduce side effects.
1686 2008-08-27 Akim Demaille <demaille@gostai.com>
1688 Check yyerrok in calc.at.
1689 * tests/calc.at (calc.y): Use yyerrok on "( error )".
1690 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
1693 2008-08-27 Akim Demaille <demaille@gostai.com>
1695 Support yyerrok in lalr1.cc.
1696 YYBACKUP is still to import back into lalr1.cc.
1697 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
1699 2008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
1701 For maintainer-check*, don't recompile for a $(VERSION) update.
1703 (_is-dist-target): Override the one in GNUmakefile.
1704 * Makefile.am (EXTRA_DIST): Add cfg.mk.
1706 2008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
1708 Update for recent change to gnulib.
1709 * src/parse-gram.y: Don't include strverscmp.h. It comes from
1712 2008-08-15 Eric Blake <ebb9@byu.net>
1714 Remaining m4sugar merge from autoconf.
1715 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
1716 * data/m4sugar/foreach.m4: New file, copied from autoconf.
1717 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
1718 * src/output.c (output_skeleton): Tell m4 how to find it.
1720 Partial m4sugar merge from autoconf: m4_map.
1721 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
1722 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
1723 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
1724 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
1726 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
1728 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
1731 2008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
1733 Keep .version and PACKAGE_VERSION in sync.
1734 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
1735 dependency, and add comments justifying this in more detail. Discussed
1737 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
1739 2008-08-06 Eric Blake <ebb9@byu.net>
1741 Partial m4sugar merge from autoconf: m4_shiftn.
1742 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
1743 (m4_shift2, m4_shift3): New macros.
1744 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
1745 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
1746 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
1747 * data/java.m4 (b4_remove_comma): Likewise.
1749 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
1750 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
1751 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
1752 (m4_init): Consolidate wrapped text into single m4_wrap.
1753 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
1756 2008-08-05 Eric Blake <ebb9@byu.net>
1758 Partial m4sugar merge from autoconf: builtins, version.m4.
1759 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
1760 (m4_prepend): Remove, as it is unused and inherently quadratic,
1761 whereas m4_append is linear in newer m4.
1762 (m4_mkstemp): New builtin.
1763 (m4_symbols): Make rename conditional.
1764 (m4_version_prereq): Ensure fatal error if used in bison, which
1765 intentionally lacks version.m4.
1767 Fix comments in m4sugar.
1768 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
1770 2008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
1772 Update for recent .gitignore fix in Gnulib.
1773 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
1774 anchored .gitignore entries.
1776 2008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
1778 Set gnu or gnits strictness.
1779 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
1780 development and gnits strictness for releases. Based on Eric Blake's
1782 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
1784 2008-07-31 Paolo Bonzini <bonzini@gnu.org>
1786 * NEWS: Clarify documentation of %language.
1788 2008-07-31 Paolo Bonzini <bonzini@gnu.org>
1790 Support usage of git-merge-changelog.
1791 * .gitattributes: New.
1792 * HACKING: Document usage of git-merge-changelog.
1793 * bootstrap: Install git-merge-changelog entries in .git/config
1796 2008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
1798 Remove remaining dependence on CVS Id keyword.
1799 * ChangeLog: For the sake of people still using CVS, don't use dollars
1801 * data/xslt/bison.xsl: Remove Id from header comments, where it was
1803 * data/xslt/xml2dot.xsl: Likewise.
1804 * data/xslt/xml2text.xsl: Likewise.
1805 * data/xslt/xml2xhtml.xsl: Likewise.
1806 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
1807 * doc/Makefile.am (neutralize): Remove, no longer needed.
1808 (.x.1): Don't use neutralize.
1809 (edit): Don't substitute for ID.
1810 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
1812 2008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
1814 Fix dependence on computed configure variables.
1815 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
1816 $(top_srcdir)/configure.ac so that changes to computed variables, such
1817 as PACKAGE_VERSION, are seen.
1818 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
1820 2008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
1822 Update copyright dates for recent changes.
1823 * Makefile.am: Here.
1824 * src/Makefile.am: Here.
1825 * src/reduce.c: Here.
1826 * tests/reduce.at: Here.
1828 2008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
1830 Use git-version-gen for version names between releases.
1831 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
1832 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
1833 * .prev-version: New.
1834 * .version.in: Remove.
1835 * ChangeLog: Remove the Id previously used for capturing the CVS
1837 * GNUmakefile: Remove, now copied from Gnulib.
1838 * Makefile.am: Add code suggested by comments in
1839 build-aux/git-version-gen.
1840 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
1841 .prev-version, and .version.
1842 * NEWS (2.3b+): Rename to...
1843 (?.?): ... this because we're dropping the "+" version naming scheme,
1844 but, in general, we still can't be sure of our next release name.
1845 * bootstrap: Add a quick hack to remove from .gitignore the
1846 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
1847 entry. This should really be fixed in gnulib instead.
1848 * bootstrap.conf (gnulib_modules): Add gnumakefile.
1849 * configure.ac (AC_INIT): Set version name by invoking
1850 build-aux/git-version-gen.
1851 (AC_CONFIG_FILES): Remove .version, now generated by
1852 build-aux/git-version-gen.
1853 * maint.mk: New, copied from coreutils.
1854 * doc/.cvsignore (bison.1): Add.
1855 * doc/.gitignore (/bison.1): Add.
1856 * doc/bison.1: Remove, generated.
1857 * src/.cvsignore (revision.c): Remove.
1858 * src/.gitignore (/revision.c): Remove.
1859 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
1860 (BUILT_SOURCES): Remove revision.c.
1861 (revision.c): Remove.
1862 * src/getargs.c (version): Don't print revision after the VERSION.
1863 * src/revision.h: Remove.
1865 2008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
1867 Fix untranslatable composition of sentences. Reported by Goran
1869 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
1870 * THANKS (Goran Uddeborg): Add.
1871 * src/reduce.c (reduce_print): Report the number of nonterminals and
1872 rules useless in the grammar in separate sentences.
1873 * tests/reduce.at (Useless Rules): Update output.
1874 (Reduced Automaton): Likewise.
1875 (Underivable Rules): Likewise.
1876 (Empty Language): Likewise.
1878 2008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
1880 Fix some .gitignore and .cvsignore problems.
1881 * bootstrap (insert_sorted_if_absent): Replace all uses with...
1882 (insert_vc_ignore): ... this new function, which prepends `/' to all
1883 .gitignore entries before passing them to insert_sorted_if_absent.
1884 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
1885 .cvsignore files are maintained even though Bison developers run
1886 bootstrap while using Git.
1887 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
1890 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
1891 unneeded. Reported by Eric Blake.
1892 * lib/.gitignore (/*~): Add.
1893 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
1894 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
1896 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
1898 2008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
1900 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
1901 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
1902 * bootstrap.conf (gnulib_modules): Add unsetenv.
1903 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
1904 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
1906 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
1907 the first argument because it may become position-dependent, and unset
1908 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
1909 Add comments explaining these issues in more detail.
1911 2008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
1913 Add .gitignore everywhere based on .cvsignore.
1915 * build-aux/.gitignore: New.
1916 * data/.gitignore: New.
1917 * doc/.gitignore: New.
1918 * etc/.gitignore: New.
1919 * examples/.gitignore: New.
1920 * examples/calc++/.gitignore: New.
1921 * lib/.gitignore: New.
1922 * m4/.gitignore: New.
1923 * po/.gitignore: New.
1924 * runtime-po/.gitignore: New.
1925 * src/.gitignore: New.
1926 * tests/.gitignore: New.
1928 2008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
1930 * NEWS (2.3b+): New section, empty for now.
1931 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
1933 2008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
1935 * NEWS (2.3b): Update release date since there has been a delay in
1936 getting the announcements and tarballs out.
1938 2008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
1940 * NEWS: Version 2.3b.
1941 * configure.ac (AC_INIT): Likewise.
1942 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
1944 2008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
1946 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
1947 been doing it for years.
1948 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
1949 (Release Procedure): Add FIXME about make alpha being unmaintained.
1951 2008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
1953 * data/yacc.c: Reformat m4 a little for readability.
1954 * src/lalr.c (build_relations): Correct comment.
1956 2008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1958 DJGPP specific issue.
1959 * djgpp/config.sed: Fixes required to run configure scripts generated
1962 2008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
1964 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
1965 coordinator@translationproject.org.
1967 2008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
1969 * THANKS: Add Eric Blake.
1971 2008-04-23 Eric Blake <ebb9@byu.net>
1973 Revert prior patch, by working around autoconf regression.
1974 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
1975 ("Output file name: ("): Uncomment test.
1976 ("Output file name: )"): Likewise.
1977 Based on an idea from Noah Misch.
1979 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1981 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
1982 2.61. Reported by Juan Manuel Guerrero at
1983 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
1984 * tests/output.at ("Output file name: ("): Comment out test case for
1986 ("Output file name: )"): Likewise.
1988 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1990 * GNUmakefile: Update git-version-gen invocation so make dist
1993 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1995 Update to the current gnulib CVS repository, and fix trigraph handling
1997 * bootstrap: Update gnulib CVS repository URL.
1998 (symlink_to_dir): Encapsulate the code that guarantees the destination
1999 directory exists into...
2000 (check_dst_dir): ... this new function, and...
2001 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
2002 fail when copying files into lib/uniwidth/.
2003 * src/output.c (prepare_symbols): When writing yytname muscles, where
2004 symbol names will be encoded in C-string literals, tell quotearg to
2005 escape trigraphs. This used to be the default in gnulib.
2006 * tests/regression.at (Token definitions): Because of the change in
2007 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
2008 escapes trigraphs in symbol names. Thus, yytname no longer has
2009 trigraphs unnecessarily doubly escaped. Update test case output.
2010 Extend test case to be sure Bison's own error messages will no longer
2011 have trigraphs in symbol names unnecessarily escaped once.
2013 2008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
2015 Fix make dist infinite loop reported by Juan Manuel Guerrero at
2016 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
2017 * .cvsignore: Add .version.
2019 * bootstrap.conf (gnulib_modules): Add git-version-gen.
2020 * configure.ac (AC_CONFIG_FILES): Add .version.
2021 * build-aux/.cvsignore: Add git-version-gen.
2023 2008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
2025 * NEWS (2.3a+): Mention that -g now takes an argument.
2026 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
2027 consistency. Update the -g and -x entries now that they take
2028 arguments. Use brackets to indicate optional arguments.
2029 * src/getargs.c (usage): Explain the relationship between arguments of
2030 long and short options more completely. Document --defines and -d
2031 separately since the former takes an argument but, for POSIX Yacc, the
2033 (short_options): Let -W take an optional argument like --warnings.
2034 (getargs): Sort cases.
2036 2008-02-28 Akim Demaille <demaille@gostai.com>
2038 * doc/bison.texinfo: Fix a few typos.
2040 2008-02-28 Akim Demaille <akim@epita.fr>
2042 * doc/bison.texinfo (Bison Options): Document -W.
2043 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
2045 2008-02-28 Akim Demaille <akim@epita.fr>
2047 * src/getargs.c (short_options): Split and sort for readability.
2048 -g and -x take optional arguments, just like their long options.
2049 * build-aux/cross-options.pl: Use /x to make the regexp easier to
2051 Fix the handling of $opt which resulted in all the argument to be
2052 considered as optional.
2054 2008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
2056 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
2057 say its interface is experimental.
2058 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
2060 (Bison Options): In the -L and --language entry, mention Java.
2061 (Java Bison Interface): Say the interface is experimental.
2062 * src/getargs.c (usage): Mention -L and --language.
2064 * NEWS (2.3a+): Say the push parsing interface is experimental.
2065 * doc/bison.texinfo (Push Decl): Likewise.
2066 (Decl Summary): Likewise in the "%define api.push_pull" entry.
2067 (Push Parser Function): Likewise.
2068 (Pull Parser Function): Likewise.
2069 (Parser Create Function): Likewise.
2070 (Parser Delete Function): Likewise.
2071 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
2072 yypull_parse, and yypush_parse entries.
2074 * NEWS (2.3a+): Mention XML support, and say the schema is
2076 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
2077 * src/getargs.c (usage): Say the XML schema is experimental.
2079 * NEWS (2.3a+): Say option instead of flag.
2081 2008-02-21 Wojciech Polak <polak@gnu.org>
2083 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
2086 2008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
2088 Fix impure push parser compile error reported by Bob Rossi at
2089 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
2090 * data/yacc.c: Clean up whitespace in the output a little.
2091 (yypstate_allocated): Define for impure push parsers regardless of
2092 whether the pull interface is also requested.
2093 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
2094 check impure push parsers without the pull interface.
2096 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
2097 yyerror takes arguments specified by %parse-param while yypstate_new
2099 * doc/bison.texinfo (Parser Create Function): Document that
2100 yypstate_new returns 0 for multiple impure parser instances.
2101 * tests/push.at (Push Parsing: Multiple impure instances): Update
2102 expected stderr output.
2104 2008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
2106 * runtime-po/POTFILES.in (push.c): Remove.
2108 2008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
2110 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
2111 * data/push.c: Rename to...
2112 * data/yacc.c: ... this, overwriting it.
2113 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
2114 `%push-pull-parser' -> `%define api.push_pull "both"'.
2115 Remove old yacc.c tests, and update push.c tests to yacc.c.
2117 2008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
2119 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
2120 `"%code top" blocks' instead of `%code "top" blocks'.
2121 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
2122 Clean up whitespace in the output a little.
2124 2008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
2126 Fix documentation problems reported by Tim Josling at
2127 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
2128 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
2129 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
2130 integers. Explain the effect of literal string aliases on error
2131 messages. Copy token 0 documentation from the C++ skeleton
2134 2008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
2136 Accept a token number in a %left, %right, or %nonassoc for POSIX
2137 conformance. Reported by Tim Josling at
2138 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
2139 * NEWS (2.3a+): Mention.
2140 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
2141 and code numbers are treated by precedence declarations.
2142 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
2144 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
2146 (symbol.prec): New, just like symbol but allows INT.
2147 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
2149 * tests/regression.at (Token number in precedence declaration): New
2152 2008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2154 DJGPP specific issues.
2155 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
2156 be changed. Copyright timestamp adjusted.
2157 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
2158 be changed. Copyright timestamp adjusted.
2159 * djgpp/config.site: Copyright timestamp adjusted.
2160 * djgpp/config_h.sed: Copyright timestamp adjusted.
2161 * djgpp/djunpack.bat: Copyright timestamp adjusted.
2162 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
2163 filename translation list.
2164 * djgpp/subpipe.c (init_subpipe): Check the environment variables
2165 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
2166 files shall be created. Before trying to use the temp dir where the
2167 environment variable points to check that the dir really exists. If
2168 not default to the cwd as temp dir. Copyright timestamp adjusted.
2169 * djgpp/subpipe.h: Copyright timestamp adjusted.
2170 * djgpp/testsuite.sed: Copyright timestamp adjusted.
2172 2008-01-30 Paul Eggert <eggert@cs.ucla.edu>
2174 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
2176 2008-01-09 Paul Eggert <eggert@cs.ucla.edu>
2178 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
2179 Problem reported by Claudio Saavedra in
2180 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
2182 2008-01-05 Wojciech Polak <polak@gnu.org>
2184 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
2185 document's title with the input grammar file name.
2187 2007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
2189 Automate regression testing of the XML/XSLT implementation. Discussed
2191 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
2192 * configure.ac (XSLTPROC): New substitution.
2193 * Makefile.am (maintainer-xml-check): New phony target invoking...
2194 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
2195 invoking make maintainer-check with BISON_TEST_XML=1.
2196 * tests/atlocal.in (XSLTPROC): New.
2197 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
2198 not to report reachable memory when Bison is expected to have a
2199 non-zero exit status and (2) to compare XML/XSLT output with --graph
2200 and --report=all output for every working grammar when
2202 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
2203 (AT_BISON_CHECK_XML): New.
2204 (AT_QUELL_VALGRIND): New.
2205 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
2206 (AT_CHECK): ... don't redefine this since this was the old way to
2208 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
2209 AT_BISON_CHECK invocations.
2210 * tests/c++.at: Likewise.
2211 * tests/calc.at: Likewise.
2212 * tests/conflicts.at: Likewise.
2213 * tests/cxx-type.at: Likewise.
2214 * tests/existing.at: Likewise.
2215 * tests/glr-regression.at: Likewise.
2216 * tests/headers.at: Likewise.
2217 * tests/input.at: Likewise.
2218 * tests/java.at: Likewise.
2219 * tests/output.at: Likewise.
2220 * tests/push.at: Likewise.
2221 * tests/reduce.at: Likewise.
2222 * tests/regression.at: Likewise.
2223 * tests/sets.at: Likewise.
2224 * tests/skeletons.at: Likewise.
2225 * tests/synclines.at: Likewise.
2226 * tests/torture.at: Likewise.
2227 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
2228 tends to hang xsltproc.
2229 (Big horizontal): Likewise.
2231 2007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
2233 In XML output, remove redundant class attribute on symbol element.
2234 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
2235 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
2236 look up a symbol to determine whether it's a nonterminal or terminal.
2237 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
2238 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
2240 Add prec/assoc information to XML output.
2241 * src/gram.c (grammar_rules_print_xml): For each rule that has a
2242 %prec, add a percent_prec attribute.
2243 * src/print-xml.c (print_grammar): For each terminal that has a
2244 precedence or associativity, add a prec or assoc attribute.
2246 (xml_puts): Use xml_indent.
2247 (xml_printf): Use xml_indent.
2248 * src/print-xml.h (xml_indent): Prototype.
2250 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
2251 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
2253 2007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
2255 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
2256 (bison:ruleByNumber): ... this for clarity.
2257 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
2258 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
2259 (xsl:template match="reduction"): Update.
2260 (xsl:template match="item"): Update.
2261 (xsl:template match="reduction"): Update.
2263 In the XML output, don't print the list of rules where symbols appear.
2264 Compute it in XSLT instead. Discussed at
2265 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
2266 * data/xslt/bison.xsl (bison:ruleByLhs): New.
2267 (bison:ruleByRhs): New.
2268 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
2270 (xsl:template match="terminal/rule"): Remove.
2271 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
2273 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
2275 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
2276 bison:ruleByRhs and mode="number-link" for rule template.
2277 (xsl:template match="terminal/rule"): Remove.
2278 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
2279 bison:ruleByRhs and mode="number-link" for rule template.
2280 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
2282 (xsl:template match="rule" mode="number-link"): ... this.
2283 * src/print-xml.c (print_grammar): Don't print the list of rules.
2285 2007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
2287 Don't let --report affect XML output; always print all information.
2289 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
2290 * src/conflicts.c (log_resolution): Implement.
2291 * src/print-xml.c (print_core): Implement.
2292 (print_state): Implement.
2293 (print_xml): Implement.
2295 * NEWS (2.3a+): Fix quotes.
2296 * src/parse-gram.y (prologue_declaration): For consistency with -v,
2297 don't let %verbose clear the list specified by --report.
2299 2007-11-26 Akim Demaille <akim@epita.fr>
2301 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
2303 2007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
2305 In the XML output, list useless and unused symbols and rules with the
2306 useful ones and add a "usefulness" attribute. Discussed starting at
2307 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
2308 * src/gram.c (grammar_rules_partial_print_xml): Remove.
2309 (grammar_rules_print_xml): Print all rules instead of just those
2310 useful in the grammar, and add a "usefulness" attribute.
2311 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
2312 * src/print-xml.c (print_rules_useless_in_parser): Remove.
2313 (print_grammar): Print all nonterminals instead of just useful ones,
2314 and add a "usefulness" attribute to nonterminals and terminals.
2315 (print_xml): Don't print a separate "reductions" or
2316 "rules-useless-in-parser" element.
2317 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
2318 (reduce_xml): Remove.
2319 (reduce_token_unused_in_grammar): New.
2320 (reduce_nonterminal_useless_in_grammar): New.
2321 * src/reduce.h (reduce_xml): Remove prototype.
2322 (reduce_token_unused_in_grammar): Add prototype.
2323 (reduce_nonterminal_useless_in_grammar): Add prototype.
2324 * data/xslt/xml2text.xsl: Update for XML changes.
2325 * data/xslt/xml2xhtml.xsl: Update for XML changes.
2326 * tests/reduce.at (Useless Terminals): Update output.
2327 (Useless Rules): Update output.
2328 (Reduced Automaton): Update output.
2330 Say "Terminals unused in grammar" instead of "Unused terminals".
2331 * NEWS (2.3a+): Update.
2332 * doc/bison.texinfo (Understanding): Update example output.
2333 * src/reduce.c (reduce_output): Implement.
2334 * data/xslt/xml2text.xsl: Implement.
2335 * data/xslt/xml2xhtml.xsl: Implement.
2337 2007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
2339 Accept --report-file=FILE to override the default `.output' filename.
2340 * NEWS (2.3a+): Mention.
2341 * doc/bison.texinfo (Bison Options): Add an entry.
2342 * src/files.c (compute_output_file_names): Don't override
2343 spec_verbose_file if already set.
2344 * src/getargs.c (usage): Document --report-file.
2345 (REPORT_FILE_OPTION): New anonymous enum member.
2346 (long_options): Add entry for it.
2347 (getargs): Add case for it setting spec_verbose_file.
2349 * build-aux/cross-options.pl: Don't record a short option just because
2351 * doc/.cvsignore: Add yacc.1.
2353 2007-11-14 Akim Demaille <akim@epita.fr>
2355 * doc/yacc.1.in: New.
2356 * configure.ac, doc/Makefile.am: Adjust.
2357 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
2359 Use AC_SUBST for assignments too.
2360 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
2362 2007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
2364 * src/gram.c: Remove comments that duplicate comments in gram.h.
2366 When reporting useless rules and nonterminals, say "useless in grammar"
2367 instead of "useless", and say "useless in parser" instead of "never
2368 reduced". Discussed starting at
2369 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
2370 * NEWS (2.3a+): Mention this change.
2371 * data/xslt/xml2text.xsl: Update output text and expected input XML
2372 element names to match changes below.
2373 * data/xslt/xml2xhtml.xsl: Likewise.
2374 (xsl:template match="bison-xml-report"): Add missing entry in Table of
2375 Contents: "Rules useless in parser due to conflicts".
2376 * doc/bison.texinfo (Decl Summary): Reword a little.
2377 (Understanding): Update example output for changes below.
2378 * src/gram.c: (rule_useful_p): Rename to...
2379 (rule_useful_in_grammar_p): ... this.
2380 (rule_useless_p): Rename to...
2381 (rule_useless_in_grammar_p): ... this.
2382 (rule_never_reduced_p): Rename to...
2383 (rule_useless_in_parser_p): ... this.
2384 (grammar_rules_print): Update for renames.
2385 (grammar_rules_print_xml): Update for renames.
2386 (grammar_rules_never_reduced_report): Rename to...
2387 (grammar_rules_useless_report): ... this since it is used for either
2388 kind of useless rule.
2389 * src/gram.h: Reword comments and update function names in prototypes.
2390 * src/main.c (main): Say "rule useless in parser due to conflicts".
2391 * src/print-xml.c (print_rules_never_reduced): Rename to...
2392 (print_rules_useless_in_parser): ... this, and rename output XML
2393 element "rules-never-reduced" to "rules-useless-in-parser".
2394 (print_xml): Update for rename.
2395 * src/print.c (print_results): Say "Rules useless in parser due to
2397 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
2398 (nonterminals_reduce): Say "nonterminal useless in grammar".
2399 (reduce_output): Say "Nonterminals useless in grammar".
2400 Say "Rules useless in grammar".
2401 (reduce_xml): Rename output XML element "useless" to
2402 "useless-in-grammar".
2403 (reduce_print): Don't report the count of grammatically useless rules
2404 as "rules never reduced" just because %yacc is specified.
2405 In the correct report of this count, say nonterminal(s) and rule(s)
2406 "useless in grammar".
2407 * tests/conflicts.at (S/R in initial): Update expected output.
2408 (Defaulted Conflicted Reduction): Likewise.
2409 (Unreachable States After Conflict Resolution): Likewise.
2410 * tests/existing.at (GNU pic Grammar): Likewise.
2411 * tests/reduce.at (Useless Nonterminals): Likewise.
2412 (Useless Rules): Likewise.
2413 (Reduced Automaton): Likewise.
2414 (Underivable Rules): Likewise.
2415 (Empty Language): Likewise.
2417 2007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
2419 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
2420 here document and before the EOF so that BSD's implementation of Bourne
2421 shell doesn't parse the delimiter as part of the here document.
2422 * doc/.cvsignore: Add cross-options.texi.
2423 * src/getargs.c (usage): Add a blank line after the warning categories.
2425 2007-11-08 Paolo Bonzini <bonzini@gnu.org>
2427 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
2429 2007-11-05 Akim Demaille <akim@epita.fr>
2431 Remove Id: from bison.1.
2432 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
2433 (perl -0777 -pi -e 's/\.PP\nId): New.
2434 (.x.1): Use it to ignore the version control revision.
2436 2007-11-05 Akim Demaille <demaille@gostai.com>
2438 * build-aux/Makefile.am: Ship cross-options.pl.
2439 * doc/Makefile.am: Always refer to cross-options.texi with
2441 (MAINTAINERCLEANFILES): Add it.
2443 2007-11-04 Akim Demaille <demaille@gostai.com>
2445 Generate the long/short option cross-table.
2446 * build-aux/cross-options.pl: New.
2447 * doc/Makefile.am (cross-options.texi): New.
2448 * doc/bison.texinfo: Use it.
2450 2007-11-04 Akim Demaille <demaille@gostai.com>
2452 Generate bison.1 using help2man.
2453 * doc/common.x, doc/bison.x: New.
2454 * doc/Makefile.am (bison.1, .x.1): New.
2455 The code is taken from autoconf-2.61/man/Makefile.am.
2456 * configure.ac: Look for help2man.
2458 2007-11-04 Akim Demaille <demaille@gostai.com>
2461 * src/getargs.c (usage): Document -W, make it clear that -d,
2462 -g and -x have optional arguments.
2464 2007-11-04 Akim Demaille <demaille@gostai.com>
2466 Find sha1sum when named gsha1sum.
2467 * bootstrap (find_tool): New.
2470 2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
2472 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
2474 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
2475 * NEWS (2.3a+): Mention.
2476 * data/bison.m4 (b4_pure_if): Don't define it here.
2477 * data/c.m4 (b4_identification): Depend on individual skeletons to
2478 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
2479 values of the %define variables api.pure or api.push_pull. Define
2480 YYPURE, YYPUSH, and YYPULL accordingly.
2481 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
2482 glr.cc has already defined b4_pure_flag.
2483 * data/push.c: Define b4_pure_if based on `%define api.pure'.
2484 Remove YYPUSH and YYPULL since they're back in b4_identification again.
2485 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
2486 * doc/bison.texinfo (Pure Decl): Update.
2487 (Push Decl): Update.
2488 (Decl Summary): Add api.pure to %define entry.
2489 In %pure-parser entry, say it's deprecated and reference %define.
2490 (Pure Calling): Update.
2491 (Error Reporting): Update.
2492 (C++ Scanner Interface): Update.
2493 (How Can I Reset the Parser): Update.
2494 (Table of Symbols): In %pure-parser entry, say it's deprecated and
2496 * src/getargs.c (pure_parser): Remove global variable.
2497 * src/getargs.h (pure_parser): Remove extern.
2498 * src/output.c (prepare): Don't define pure_flag muscle.
2499 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
2500 wrapper around `%define api.pure'.
2501 * tests/calc.at (Simple LALR Calculator): Update.
2502 (Simple GLR Calculator): Update.
2503 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
2505 (GLR: Resolve ambiguity, pure, locations): Update.
2506 (GLR: Merge conflicting parses, pure, no locations): Update.
2507 (GLR: Merge conflicting parses, pure, locations): Update.
2508 * tests/glr-regression.at (Uninitialized location when reporting
2510 * tests/input.at (Unused %define api.pure): New test case.
2511 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
2512 AT_PURE_IF and AT_PURE_AND_LOC_IF.
2513 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
2515 2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
2517 %define push_pull -> %define api.push_pull. Discussed starting at
2518 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
2519 * data/push.c: Expect the new name.
2520 * data/yacc.c: Likewise.
2521 * doc/bison.texinfo (Push Decl): Update.
2522 (Decl Summary): Update %define entry.
2523 (Push Parser Function): Update.
2524 (Pull Parser Function): Update.
2525 (Parser Create Function): Update.
2526 (Parser Delete Function): Update.
2527 * tests/calc.at (Simple LALR Calculator): Update.
2528 * tests/input.at (%define enum variables): Update.
2529 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
2530 (Push Parsing: Multiple impure instances): Update.
2531 (Push Parsing: Unsupported Skeletons): Update.
2532 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
2533 (Exploding the Stack Size with Malloc): Update.
2535 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
2538 2007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
2540 For the XML output's terminal element, rename @number to @token-number,
2541 and add @symbol-number. In the nonterminal element, rename @number to
2542 @symbol-number. Discussed starting at
2543 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
2544 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
2546 (xsl:template match="nonterminal"): Likewise.
2547 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
2548 (xsl:template match="nonterminal"): Likewise.
2549 * src/print-xml.c (print_grammar): Implement.
2551 2007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2553 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
2554 2007-10-11 change, the child elements here are items not rules.
2555 (xsl:template match="item"): New.
2556 (xsl:template match="rule"): Update for new reduced itemset.
2557 (xsl:template match="point"): Remove.
2558 (xsl:template match="empty"): For consistency with --graph, don't
2559 output "/* empty */".
2560 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
2561 line-wrap, don't pass a negative value as first-line-length since this
2562 won't work with the following changes.
2563 (xsl:template name="line-wrap"): Simplify slightly.
2564 (xsl:template name="ws-search"): Eliminate recursion.
2565 * src/print_graph.c (print_core): Don't print a reduction's lookahead
2566 set next to an item whose dot is not at the end of the RHS even if it
2567 happens to be associated with the same rule.
2569 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
2571 Add %define lr.keep_unreachable_states.
2572 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
2573 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
2574 * src/main.c (main): Implement it.
2575 * tests/conflicts.at (Unreachable States After Conflict Resolution):
2576 Extend to test it, and fix a typo.
2578 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
2580 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
2581 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
2582 the example .output text.
2583 * tests/regression.at (Extra lookahead sets in report): Improve wording
2586 2007-10-17 Wojciech Polak <polak@gnu.org>
2588 * src/print-xml.c (print_grammar): Renamed
2589 <terminal> and <nonterminal> attributes:
2590 "type" to "number" and "symbol" to "name".
2591 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
2592 Use new attribute names.
2593 (xsl:template match="nonterminal"): Likewise.
2594 * data/xslt/xml2xhtml.xsl: Likewise.
2596 2007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
2598 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
2599 (Option Cross Key): Likewise.
2601 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
2602 next to an item whose dot is not at the end of the RHS even if it
2603 happens to be associated with the same rule.
2604 * src/print.c (print_core): Likewise.
2605 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
2606 (Resolved SR Conflicts): Update output.
2607 * tests/regression.at (Extra lookahead sets in report): New test case.
2609 2007-10-11 Wojciech Polak <polak@gnu.org>
2611 * src/print-xml.c (print_core): Remove item set
2613 * data/xslt/bison.xsl (bison:ruleNumber): New key.
2614 Improve processing time. Suggested by Joel E. Denny.
2615 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
2616 Write xsl:param "required" attribute as comment.
2617 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
2618 (xsl:template match="rule"): Support new reduced itemset.
2619 (xsl:template match="point"): Remove.
2620 * data/xslt/xml2xhtml.xsl: Likewise.
2622 2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
2624 * src/getargs.c (version): Update copyright year.
2626 2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
2628 Make xml2dot.xsl and --graph produce the same output.
2629 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a ` '
2630 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
2632 (xsl:template name="output-node"): Use the new escape template instead
2633 of the string-replace template directly.
2634 (xsl:template name="output-edge"): Likewise.
2635 (xsl:template name="escape"): New, escapes backslashes and newlines in
2636 addition to quotation marks.
2637 * src/graphviz.c (start_graph, output_node, output_edge): Add
2638 whitespace to output for legibility.
2640 Make xml2text.xsl and --report produce the same output, and remove the
2641 XML "conflicts" element since a conflict summary is easily extracted
2643 * data/xslt/bison.xsl: New.
2644 (xsl:template match="state" mode="bison:count-conflicts): New.
2645 * data/xslt/xml2text.xsl: Import bison.xsl.
2646 (xsl:template match="bison-xml-report"): Instead of styling the
2647 "conflicts" element, style the "automaton" element with mode
2648 "conflicts". Unlike the former, the latter lists S/R and R/R
2649 conflicts for a state on the same line.
2650 (xsl:template match="conflicts"): Remove.
2651 (xsl:template match="conflict"): Remove.
2652 (xsl:template match="terminal"): Line-wrap the list of rules in which
2653 the terminal is used.
2654 (xsl:template match="nonterminal"): Likewise for nonterminals.
2655 (xsl:template match="automaton" mode="conflicts"): New.
2656 (xsl:template match="state" mode="conflicts"): New.
2657 (xsl:template name="line-wrap"): New.
2658 (xsl:template name="ws-search"): New.
2659 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
2660 (xsl:template match="bison-xml-report"): Instead of styling the
2661 "conflicts" element, style the "automaton" element with mode
2663 (xsl:template match="conflicts"): Remove.
2664 (xsl:template match="conflict"): Remove.
2665 (xsl:template match="automaton" mode="conflicts"): New.
2666 (xsl:template match="state" mode="conflicts): New.
2667 * src/conflicts.c (conflicts_output_xml): Remove.
2668 * src/conflicts.h (conflicts_output_xml): Remove prototype.
2669 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
2670 * src/print.c (print_grammar): Consistently wrap at the 66th column so
2671 the corresponding XSLT is easier. Also, never wrap between a word and
2672 the comma that follows it.
2674 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
2676 Improve C++ namespace support. Discussed starting at
2677 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
2678 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
2679 b4_namespace_close): New macros that interpret the %define variable
2680 "namespace" so its value can contain "::" to indicate nested
2682 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
2684 * data/lalr1.cc (b4_namespace): Likewise.
2685 * data/location.cc (b4_namespace): Likewise.
2686 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
2687 inside a new table in the general %define entry. Document `%define
2688 namespace' there as well. Point the %name-prefix entry to it since it
2689 explains it more completely in the case of C++.
2690 (C++ Bison Interface): Mention `%define namespace' instead of
2692 (Table of Symbols): Remove the `%define push_pull' entry. The %define
2694 * tests/c++.at (Relative namespace references): New test case.
2695 (Absolute namespace references): New test case.
2696 (Syntactically invalid namespace references): New test case.
2697 * tests/input.at (C++ namespace reference errors): New test case.
2699 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
2701 Add syncline support and location accessor to internal %define
2703 * data/bison.m4 (b4_percent_define_get_loc): New.
2704 (b4_percent_define_get_syncline): New.
2705 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
2706 (b4_percent_define_default): Record defining location as line 1 rather
2707 than 0 for the sake of synchronizing #line's, and define
2708 b4_percent_define_syncline(VARIABLE).
2709 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
2710 * src/muscle_tab.c (muscle_syncline_grow): New.
2711 (muscle_code_grow): Use muscle_syncline_grow.
2712 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
2713 define b4_percent_define_syncline(VARIABLE).
2714 (muscle_percent_define_get_loc): New.
2715 (muscle_percent_define_get_syncline): New.
2716 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
2717 remove some unused variables.
2718 (muscle_percent_define_default): Record defining location as line 1
2719 rather than 0 for the sake of synchronizing #line's, and define
2720 b4_percent_define_syncline(VARIABLE).
2721 (muscle_percent_define_check_values): Use
2722 muscle_percent_define_get_loc.
2723 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
2724 (muscle_percent_define_get_syncline): Prototype.
2725 * tests/skeletons.at (%define Boolean variables: invalid skeleton
2726 defaults): Update output for location change.
2727 (Complaining during macro argument expansion): Extend to test
2728 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
2730 2007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
2732 Fix some error-reporting macro bugs.
2733 * data/bison.m4 (b4_cat): New.
2734 (b4_error, b4_error_at): Use b4_cat to send error directives directly
2735 to stdout so they don't become arguments to other macros. Update
2736 comments and add examples.
2737 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
2739 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
2740 after printing the error directive so that M4 doesn't report subsequent
2741 problems that are induced by this problem.
2742 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
2743 instead of just in them. Recognize @\n in both places. Both expand to
2744 the empty string. Needed by b4_cat.
2745 * tests/skeletons.at (Complaining during macro argument expansion):
2747 (Fatal errors make M4 exit immediately): New test case.
2749 2007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
2751 Implement --print-datadir.
2752 * src/getargs.c (usage): Mention.
2753 (PRINT_DATADIR_OPTION): New anonymous enum member.
2754 (long_options): Add entry for it.
2755 (getargs): Add case for it calling compute_pkgdatadir.
2756 * src/output.c (output_skeleton): Encapsulate data directory
2757 computation from here...
2758 (prepare): ... and from here...
2759 (compute_pkgdatadir): ... into this new function.
2760 * src/output.h (compute_pkgdatadir): Prototype.
2762 2007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
2764 * src/print-xml.c (escape_bufs): New static global variable
2766 (xml_escape_n): ... the static local variable buf here.
2767 (print_xml): Free memory for escape_bufs.
2768 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
2770 2007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
2772 Replace `%push-parser' and `%push-pull-parser' with
2773 `%define push_pull "push"' and `%define push_pull "both"'.
2774 `%define push_pull "pull"' is the default.
2775 * doc/bison.texinfo (Push Decl, Push Parser Function,
2776 Pull Parser Function, Parser Create Function, Parser Delete Function):
2777 Update declarations.
2778 (Decl Summary, Table of Symbols): Replace %push-parser and
2779 %push-pull-parser entries with a %define push_pull entry.
2780 * data/bison.m4 (b4_percent_define_check_values): New macro.
2781 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
2783 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
2785 * data/push.c: ... to here and compute them from the value of the
2786 %define variable push_pull.
2787 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
2788 parsing requests here...
2789 * data/yacc.c: ... hack this to switch to push.c any time
2790 b4_use_push_pull_flag or the %define variable push_pull is set. This
2791 will go away when we mv push.c yacc.c.
2792 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
2793 push parsing is not supported since unused %define variables are
2795 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
2796 * src/muscle_tab.h (muscle_percent_define_check_values): Update
2797 comments for consistency with b4_percent_define_check_values.
2798 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
2800 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
2802 (prologue_declaration): Remove %push-parser and %push-pull-parser
2804 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
2805 * tests/calc.at: Update declarations.
2806 * tests/input.at (%define enum variables): New test case.
2807 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
2809 (Push Parsing: Multiple impure instances): Update declaration.
2810 (Push Parsing: Unsupported Skeletons): New test case.
2811 * tests/torture.at (Exploding the Stack Size with Alloca): Update
2813 (Exploding the Stack Size with Malloc): Update declaration.
2815 2007-09-24 Wojciech Polak <polak@gnu.org>
2817 Add XSLT transformations.
2819 * data/xslt/xml2dot.xsl: Transform XML into DOT.
2820 * data/xslt/xml2text.xsl: Transform XML into plain text.
2821 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
2822 * data/Makefile.am (xsltdir): New variable.
2823 (dist_xslt_DATA): Add xslt/*.xsl files.
2825 2007-09-23 Paul Eggert <eggert@cs.ucla.edu>
2827 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
2828 Problem reported by Wojciech Polak.
2829 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
2830 (xml_printf): Undo change I made on 21 September; that is,
2831 indent 2 spaces, not 1.
2833 2007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
2835 Pacify ./configure --enable-gcc-warnings.
2836 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
2837 `char const *' instead of `char *'.
2838 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
2839 local variable `sep'.
2841 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
2843 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
2845 * src/print-xml.c: Prefer "const" after types; that's more consistent.
2846 (xml_printf): Indent just 1 space for level.
2847 (e_char, xlate_char): Remove.
2848 (xml_escape_string): Rewrite to avoid undefined behavior (used
2849 storage that was freed from the stack).
2850 (xml_escape_n): Don't bother checking for subscript error.
2852 2007-09-21 Wojciech Polak <polak@gnu.org>
2854 Add Bison XML Automaton Report.
2856 Add support for an -x option to generate an XML report.
2857 It is not documented yet.
2858 * src/print-xml.c: New file.
2859 * src/print-xml.h: Likewise.
2860 * lib/timevar.def (TV_XML): New var.
2861 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
2862 * src/conflicts.c: Include print-xml.h.
2863 (solved_conflicts_xml_obstack): New var.
2864 (log_resolution, conflicts_solve, conflicts_free):
2865 Add support for XML report.
2866 (conflicts_output_val): New function.
2867 * src/conflicts.h (conflicts_output_val): New decl.
2868 * src/files.c (spec_xml_file): New var.
2869 (compute_output_file_names, output_file_names_free): Add XML support.
2870 * src/files.h (spec_xml_file): New decl.
2871 * src/getargs.c (xml_flag): New var.
2872 (usage, short_options, long_options, getargs): Add XML support.
2873 * src/getargs.h (xml_flag): New decl.
2874 * src/gram.c: Include print-xml.h.
2875 (rule_lhs_print_xml, rule_rhs_print_xml):
2876 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
2878 * src/gram.h: Declare external ones.
2879 * src/main.c: Include print-xml.h.
2880 (main): Add XML support.
2881 * src/reduce.c: Include print-xml.h.
2882 (reduce_xml): New function.
2883 * src/reduce.h: Declare it.
2884 * src/state.c: Include print-xml.h.
2885 (state_new): Add XML support.
2886 (state_rule_lookahead_tokens_print_xml): New function.
2887 * src/state.h: Declare it.
2888 (struct state): New member solved_conflicts_xml.
2889 * src/symtab.c (symbol_class_get_string): New function.
2890 * src/symtab.h: Declare it.
2892 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
2894 * GNUmakefile: Switch to coreutils's version.
2895 * bootstrap: Likewise.
2896 * Makefile.cfg: Adjust to new GNUmakefile.
2897 * README-hacking: Likewise.
2901 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
2902 Bruno Haible <bruno@clisp.org>
2904 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
2905 and is a script that invokes bison. Tighten the code. Add comments.
2907 2007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
2909 Spell "boolean" as "Boolean". Reported by Akim Demaille.
2910 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
2911 * doc/bison.texinfo (Decl Summary): Fix.
2912 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
2913 * tests/input.at (Boolean %define variables): Update output.
2914 * tests/skeletons.at (%define boolean variables: invalid skeleton
2915 defaults): Rename to...
2916 (%define Boolean variables: invalid skeleton defaults): ... this and
2919 2007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
2921 In impure push mode, don't allow more than one yypstate to be allocated
2922 since multiple impure parsers would corrupt yynerrs.
2923 * data/push.c (yypstate_allocated): New static global variable
2925 (yypull_parse): If yypstate_new returns 0, don't report it as memory
2926 exhaustion if yypstate_allocated is 1, but still return 2.
2927 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
2928 already 1. Otherwise, set it to 1.
2929 (yypstate_delete): Set it to 0.
2930 * tests/push.at (Push Parsing: Multiple impure instances): New test
2933 2007-08-17 Bob Rossi <bob@brasko.net>
2935 * doc/bison.texinfo (Push Decl): Document the push parser.
2936 (Table of Symbols): Ditto.
2938 (Decl Summary): Ditto.
2939 (Multiple Parsers, Push Parser Function, Pull Parser Function,
2940 Parser Create Function, Parser Delete Function):
2941 Add new push parser symbols.
2942 (Table of Symbols): Document push-parser, push-pull-parser,
2943 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
2945 2007-08-15 Paul Eggert <eggert@cs.ucla.edu>
2948 * doc/gpl-3.0.texi: New file.
2949 * doc/gpl.texi: Remove.
2950 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
2951 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
2952 * README-hacking, TODO, bootstrap, bootstrap.conf:
2953 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
2954 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
2955 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
2956 * data/lalr1.cc, data/lalr1.java, data/location.cc:
2957 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
2958 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
2959 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
2960 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
2961 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
2962 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
2963 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
2964 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
2965 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
2966 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
2967 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
2968 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
2969 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
2970 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
2971 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
2972 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
2973 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
2974 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
2975 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
2976 * src/complain.c, src/complain.h, src/conflicts.c:
2977 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
2978 * src/files.h, src/flex-scanner.h, src/getargs.c:
2979 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
2980 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
2981 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
2982 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
2983 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
2984 * src/print.c, src/print.h, src/print_graph.c:
2985 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
2986 * src/reduce.h, src/relation.c, src/relation.h:
2987 * src/revision.h, src/scan-code.h, src/scan-code.l:
2988 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
2989 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
2990 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
2991 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
2992 * tests/Makefile.am, tests/actions.at, tests/c++.at:
2993 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
2994 * tests/existing.at, tests/glr-regression.at:
2995 * tests/headers.at, tests/input.at, tests/java.at:
2996 * tests/local.at, tests/output.at, tests/push.at:
2997 * tests/reduce.at, tests/regression.at, tests/sets.at:
2998 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
3002 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
3004 Get rid of broken %no-parser, -n, and --no-parser implementation and
3006 * TODO: Don't mention them.
3007 * doc/bison.1: Likewise.
3008 * doc/bison.texinfo (Decl Summary): Likewise.
3009 (Bison Options): Likewise.
3010 (Option Cross Key): Likewise.
3011 * src/getargs.c (no_parser_flag): Remove global variable.
3012 (usage): Don't print description of -n and --no-parser.
3013 (long_options): Remove --no-parser entry here.
3014 (getargs): Remove -n case in the switch here.
3015 * src/getargs.h (no_parser_flag): Remove extern.
3016 * tests/regression.at (Web2c Actions): Remove comment that mentions
3019 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
3021 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
3022 name user variables starting with `yy'. Just pass NULL instead of a
3023 dummy local &yylval to yypush_parse.
3024 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
3027 2007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
3029 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
3030 true since it's then always used regardless of whether yyoverflow is
3031 defined. Reported by Christian Burger at
3032 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
3033 * THANKS: Add Christian Burger.
3035 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
3036 node names: say "Decl Summary" not "Bison Declaration Summary".
3038 2007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
3040 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
3041 determine whether this function has already complained about an invalid
3042 value for a %define boolean variable, don't check whether Bison has
3043 ever examined the value. As written, the check was a tautology.
3044 Instead, record and check for this complaint using a separate muscle.
3046 2007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
3048 Fix push parsing memory leak reported by Brandon Lucia at
3049 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
3050 * THANKS: Add Brandon Lucia.
3051 * data/push.c (yypstate_delete): Free the stack if it was reallocated
3052 but the parse never completed and thus freed it.
3053 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
3054 * tests/testsuite.at: Include push.at.
3055 * test/push.at: New.
3056 (Push Parsing: Memory Leak for Early Deletion): New test case.
3058 2007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
3060 Improve handling of multiple S/R conflicts in the same state and of S/R
3061 conflicts involving multiple reductions.
3062 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
3063 set for a state here or Bison will abort if it is reassigned on a
3064 later conflicted reduction in the same state.
3065 Similarly, don't finalize and assign the solved conflicts report here
3066 or it will be lost if it is reassigned on a later conflicted reduction
3068 (set_conflicts): Instead, assign them both here after all S/R conflicts
3069 in the state have been fully examined.
3070 * src/print.c (shift_set): Rename to...
3071 (no_reduce_set): ... this.
3072 (print_reductions): Update for rename, and add %nonassoc error action
3073 tokens to no_reduce_set so that, when printing the first remaining
3074 reduction on an error action token, the reduction is enclosed in
3076 (print_results): Update for rename.
3077 * tests/conflicts.at (Solved conflicts report for multiple reductions
3078 in a state): New test case.
3079 (%nonassoc error actions for multiple reductions in a state): New test
3082 * src/main.c (main): Don't depend on C99 features.
3084 2007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
3086 * build-aux/.cvsignore: Add compile.
3087 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
3090 2007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
3092 * bootstrap (slurp): Create target directories that don't exist.
3093 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
3095 2007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
3097 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
3099 * closure.c (closure): Likewise.
3100 * state.h (reductions): Comment sorting of rules.
3101 (state): Comment sorting of items.
3103 2007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
3105 Fix C++ test cases after recent Gnulib changes. Discussed starting at
3106 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
3107 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
3108 definition in order to avoid Gnulib headers since we don't use config.h
3110 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
3111 rather than AT_DATA so that config.h is included.
3113 2007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
3115 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
3116 instead of fprintf. Guard these functions with #if YYDEBUG instead of
3117 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
3118 and so that YYFPRINTF is guaranteed to be defined here.
3120 2007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
3122 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
3124 (muscle_percent_define_check_values): ... this more helpful function.
3125 Again, it's not used yet, but it will be.
3126 * src/muscle_tab.h: Likewise.
3128 Improve some comments in parser table construction.
3129 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
3130 (generate_states): Don't mention ruleset, which is internal to closure.
3131 * src/closure.c (closure): Explain sorting of core and itemset, which
3132 is required for this function to behave correctly.
3133 * src/closure.h (closure): Mention sorting.
3135 2007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
3137 * src/lalr.c (state_lookahead_tokens_count): For code readability,
3138 move the check for disabled transitions to an aver since conflict
3139 resolution hasn't happened yet.
3141 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
3142 labels a state as inconsistent just because it has error transitions.
3143 The original form of this check appeared in revision 1.1 of lalr.c,
3144 which was committed on 1991-12-21. Now (at least), changing the
3145 consistency label on such a state appears to have no useful effect in
3146 any of the places it is examined, which I enumerate below. The key
3147 point to understanding each item in this enumeration is that a state
3148 with an error transition is labelled consistent in the first place only
3149 if it has no rules, so the check cannot matter for states that have
3150 rules. (1) Labelling a state as inconsistent will cause set_conflicts
3151 to try to identify its conflicts, and a state must have *rules* to have
3152 conflicts. (2) Labelling a state as inconsistent will affect how
3153 action_row sets the default *rule* for the state. (3) Labelling a
3154 state as inconsistent will cause build_relations to add lookback edges
3155 to *rules* in that state.
3156 * src/state.h (struct state): Word the comment for member consistent
3159 2007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
3161 Don't depend on C99 features.
3162 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
3163 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
3164 * src/reader.c (check_and_convert_grammar): Fix for-loop.
3165 * src/state.c (state_mark_reachable_states): Fix for-loop.
3166 (state_remove_unreachable_states): Fix for-loop.
3168 Don't widen struct state with member reachable just to temporarily
3169 record reachability. Instead, use a local bitset.
3170 * src/state.h (struct state): Remove member.
3171 * src/state.c (state_new): Don't initialize it.
3172 (state_mark_reachable_states): Rename to...
3173 (state_record_reachable_states): ... this, and use bitset.
3174 (state_remove_unreachable_states): Use bitset.
3176 2007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
3178 * src/Makefile.am (yacc): Quote target action commands properly so
3179 that the yacc script isn't corrupt. Reported by Hans Aberg at
3180 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
3182 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
3183 the case of pure parsers. Reported by Frans Englich at
3184 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
3185 * THANKS: Add Frans Englich.
3187 * NEWS (2.3a+): In the %code entry, reference section `Bison
3188 Declaration Summary' from the manual now since the %code summary has
3190 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
3191 in the rules section must be terminated by semicolons.
3193 2007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
3195 Extend the front-end API for %define variables to more completely
3196 mirror the back-end. This will be useful in the future.
3197 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
3198 Update comments to mention the new front-end counterparts of these
3200 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
3201 for muscle_string_decode and muscle_location_decode.
3202 (muscle_string_decode): New static function.
3203 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
3204 (muscle_percent_define_get, muscle_percent_define_ifdef): New
3206 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
3207 muscle_percent_define_get to mimic the b4_percent_define_flag_if
3208 implementation more closely.
3209 (muscle_percent_define_invalid_value): New function.
3210 * src/muscle_tab.h (muscle_percent_define_get,
3211 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
3214 2007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
3216 * NEWS (2.3a+): Mention yesterday's state-removal change.
3217 (2.3a): Remove the %language entry, which was added after 2.3a.
3218 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
3219 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
3220 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
3221 tests/existing.at: Update copyright date.
3223 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
3225 If conflict resolution makes states unreachable, remove those states,
3226 report rules that are then unused, and don't report conflicts in those
3228 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
3229 New global function.
3230 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
3232 * src/main.c (main): After conflict resolution, remove the unreachable
3233 states and update all data structures that reference states by number.
3234 * src/state.c (state_new): Initialize each state's reachable member to
3236 (state_mark_reachable_states): New static function.
3237 (state_remove_unreachable_states): New global function.
3238 * src/state.h (struct state): Add member bool reachable.
3239 (state_remove_unreachable_states): Prototype.
3240 * tests/conflicts.at (Unreachable States After Conflict Resolution):
3242 * tests/existing.at (GNU pic Grammar): Update test case output now that
3243 an unused rule is discovered.
3245 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
3247 Minor code cleanup in parser table construction.
3248 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
3249 (new_itemsets, save_reductions): Update for rename to nitemset.
3250 * src/closure.c (nritemset): Rename to...
3251 (nitemset): ... this since the "r" appears to meaningless and isn't
3252 used in the comments.
3253 (closure): Update for rename.
3254 * src/closure.h (nritemset): Update extern to...
3255 (nitemset): ... this.
3256 * src/lalr.c (LA): Fix a typo in comments.
3257 * src/print.c (print_core): Update for rename to nitemset.
3258 * src/print_graph.c (print_graph): Likewise.
3259 * src/state.h: Fix some typos in header comments.
3261 2007-04-04 Paul Eggert <eggert@cs.ucla.edu>
3263 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
3264 still sticks to ASCII. Sorry!
3266 * README-hacking: New file, taken mostly from coreutils, with changes
3267 for Bison. Contains much of the contents of:
3268 * README-cvs: Remove.
3269 * bootstrap: Sync from gnulib.
3270 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
3271 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
3273 2007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
3275 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
3277 (Java Differences): Fix some typos.
3278 * THANKS: Add Sebastian Setzer.
3280 2007-03-07 Paolo Bonzini <bonzini@gnu.org>
3282 * data/java.m4 (b4_single_class_if): Remove.
3283 (b4_abstract_if): Look at "%define abstract".
3285 (b4_union_name): Rename...
3286 (b4_yystype): ... to this. Map to "%define stype".
3287 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
3288 b4_maybe_throws): Fix quoting.
3289 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
3290 * data/lalr1.java (Lexer interface): Always define.
3291 (Lexer interface within parser class): Remove.
3292 (YYLexer class): New, used when "%code lexer" is present.
3293 (constructor): When "%code lexer" is used, pass %lex-param
3294 to the lexer constructor.
3295 (yylex, yyparse): Remove %lex-param from method invocations
3296 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
3298 * doc/bison.texinfo (Java Bison Interface): Mention "%define
3299 abstract". Rename "%define union_name" to "%define stype".
3300 Rename method names according to previous patch.
3301 (Java Scanner Interface): Describe "%code lexer" instead of
3302 "%pure-parser" and "%define single_class".
3303 (Java Differences): Mention "%code lexer".
3305 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
3306 Include scanner here, using macros from tests/local.at.
3307 (AT_DATA_CALC_Y): Remove final argument.
3308 (_AT_CHECK_JAVA_CALC): Likewise.
3309 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
3310 of %locations and %error-verbose.
3311 (main): Test with and without %lex-param.
3312 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
3313 (AT_BISON_OPTION_POPDEFS): Pop it.
3315 2007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3317 DJGPP spefic issue. Inhibit the use of disallowed characters for
3318 file name genertion on Win98, WinXP, etc. These are |<>":?*\
3319 and concern testsuite case 46.
3320 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
3321 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
3322 * djgpp/config.bat: Inhibit the use of disallowed characters.
3324 2007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
3326 Miscellaneous %define and %code cleanup.
3327 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
3328 values are interpreted.
3329 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
3330 documentation a little more.
3331 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
3332 muscle_percent_define_insert, muscle_percent_code_grow): New
3334 * src/muscle_tab.h (muscle_percent_define_insert,
3335 muscle_percent_code_grow): Prototype.
3336 * src/parse-gram.y (prologue_declaration): Use
3337 muscle_percent_define_insert and muscle_percent_code_grow when parsing
3338 %define and %code directives.
3340 Make it easy to share %define boolean variables between the front-end
3341 and back-end. Though not used yet, this will be useful in the future.
3342 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
3343 Bison uses of names rather than just skeleton uses of names.
3344 (b4_percent_define_get, b4_percent_define_ifdef): Rename
3345 b4_percent_define_skeleton_variables(VARIABLE) to
3346 b4_percent_define_bison_variables(VARIABLE).
3347 (b4_percent_code_get, b4_percent_code_ifdef): Rename
3348 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
3349 b4_percent_code_bison_qualifiers(QUALIFIER).
3350 (b4_check_user_names_wrap): Update for renames.
3351 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
3352 muscle_percent_define_default): New functions mimicking
3353 b4_percent_define_flag_if and b4_percent_define_default.
3355 For %define variables, report locations for invalid values and
3357 * data/bison.m4 (b4_percent_define_flag_if): Read
3358 b4_percent_define_loc(VARIABLE) to report the location of an invalid
3360 (b4_percent_define_default): Save a special location in
3361 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
3362 must later be reported as invalid.
3363 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
3365 (muscle_percent_define_insert): Record the location of VARIABLE in
3366 muscle percent_define_loc(VARIABLE), and use it to report the previous
3367 location for a redefinition.
3368 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
3369 (muscle_percent_define_default): Update like b4_percent_define_default.
3370 (muscle_grow_user_name_list): Rename to...
3371 (muscle_user_name_list_grow): ... this for consistency and use
3372 muscle_location_grow.
3373 * src/muscle_tab.h (muscle_location_grow): Prototype.
3374 * tests/input.at (%define errors): Update expected output.
3375 * tests/skeletons.at (%define boolean variables: invalid skeleton
3376 defaults): New test case.
3378 2007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
3380 * src/print.c (lookahead_set, state_default_rule): Remove.
3381 (print_reductions): Replace state_default_rule invocation with
3382 equivalent use of yydefact, which was computed in token_actions in
3384 (print_results): Don't allocate lookahead_set.
3386 2007-02-27 Paolo Bonzini <bonzini@gnu.org>
3388 * data/lalr1.java: Prefix all private members with yy.
3390 2007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
3392 Use YYFPRINTF instead of fprintf where appropriate. Reported by
3393 Sebastien Fricker at
3394 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
3395 * THANKS: Add Sebastien Fricker.
3396 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
3397 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
3398 accept a variable number of arguments.
3400 2007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
3402 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
3404 2007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3406 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
3407 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
3408 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
3410 2007-02-11 Paul Eggert <eggert@cs.ucla.edu>
3412 Undo my 2007-02-07 change, switching back to the c-strcase module
3413 introduced in the 2007-02-03 change. Bruno Haible reported that
3414 the 2007-02-07 change would be dangerous in Turkish if we add a
3415 language whose name contains "i", since "i" is not lowercase "I"
3417 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
3418 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
3419 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
3420 * m4/.cvsignore: Remove strcase.m4.
3421 * src/getargs.c: Revert 2007-02-07 change, as follows.
3422 Include c-strcase.h.
3423 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
3425 2007-02-11 Bruno Haible <bruno@clisp.org>
3427 Enable the Java related testsuite tests when the only Java compiler
3428 found is a gcj < 4.3. Discussed at
3429 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
3430 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
3432 2007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
3434 * data/Makefile.am: Update copyright date.
3435 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
3436 yypstate_new returns NULL.
3437 (yypstate_new): Return NULL if malloc does.
3438 * src/reader.c (packgram): Move translation of rule actions from the
3439 beginning of packgram to...
3440 (check_and_convert_grammar): ... here right before packgram is invoked
3441 so it's easier to write more complete comments, and remove redundant
3444 2007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
3446 As in semantic actions, make @$ in %initial-action, %destructor, and
3447 %printer imply %locations.
3448 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
3450 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
3451 (@$ in %initial-action implies %locations,
3452 @$ in %destructor implies %locations,
3453 @$ in %printer implies %locations): ... these new test cases.
3455 2007-02-07 Paul Eggert <eggert@cs.ucla.edu>
3457 Undo most of the 2007-02-03 change, switching to the strcase module
3458 now that gnulib strcase has been fixed.
3459 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
3460 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
3461 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
3462 * m4/.cvsignore: Add strcase.m4.
3463 * src/getargs.c: Revert 2007-02-03 change, as follows.
3464 Don't include c-strcase.h.
3465 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
3466 strcasecmp has "unspecified behavior" outside the POSIX locale,
3467 but it works fine in practice if at least one argument is ASCII,
3468 as is the case in Bison.
3470 2007-02-07 Paolo Bonzini <bonzini@gnu.org>
3472 * tests/java.at: Skip tests if only one of javac/java is present.
3473 Reported by Joel E. Denny.
3474 * tests/atlocal.in: Adjust copyright years.
3476 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
3478 * data/lalr1.java (Stack): Work around old verifiers that disallow
3479 access to the private fields of an inner class, from the outer class.
3480 We can make Stack's fields public because user code doesn't have access
3481 to the instance of Stack used by parse(). Reported by Paul Eggert.
3483 2007-02-03 Paul Eggert <eggert@cs.ucla.edu>
3485 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
3486 the right spot for these files?
3487 * bootstrap.conf (gnulib_modules): Add c-strcase.
3488 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
3490 * src/getargs.c: Include c-strcase.h.
3491 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
3492 to avoid unspecified behavior.
3494 2007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
3496 * doc/bison.texinfo (Decl Summary): Correct typo.
3498 2007-01-30 Paolo Bonzini <bonzini@gnu.org>
3500 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
3501 Complain if the value does not match empty, "true" or "false".
3502 * data/c++.m4: Adjust default definitions of %define variables.
3503 * data/java.m4: Adjust default definitions of %define variables.
3504 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
3506 * tests/input.at (Boolean %define variables): Test new behavior.
3508 2007-01-29 Paolo Bonzini <bonzini@gnu.org>
3510 * NEWS: Mention java.
3511 * TODO: Remove things that are done.
3512 * bootstrap.conf: Add javacomp-script and javaexec-script.
3513 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
3515 * data/Makefile.am: Add new files.
3516 * data/java-skel.m4: New.
3517 * data/java.m4: New.
3518 * data/lalr1.java: New.
3520 * doc/bison.texinfo: Put "A Complete C++ Example" under
3521 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
3522 under Other Languages.
3524 * src/getargs.c (valid_languages): Add Java.
3525 * src/getargs.h (struct bison_language): Update size of string fields.
3527 * tests/Makefile.am: Add java.at.
3528 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
3529 * tests/java.at: New.
3530 * tests/testsuite.at: Include it.
3532 2007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
3535 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
3536 at_directive_argv arguments so these no longer have to be global
3537 variables. Also, update the implementation for the following changes.
3538 (fail_for_at_directive_too_many_args,
3539 fail_for_at_directive_too_few_args): Add at_directive_name argument.
3540 (at_directive_name): Remove as at_directive_argv[0] will be used for
3542 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
3543 for the directive name.
3544 (at_directive_argc, at_directive_argv): Make these local within
3545 skel_lex instead of global.
3546 (INITIAL): Update directive start action for above changes.
3547 (SC_AT_DIRECTIVE_ARG): Rename to...
3548 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
3549 (SC_AT_DIRECTIVE_SKIP_WS): Update.
3550 (scan_skel): Move yylex_destroy to...
3551 (skel_scanner_free): ... here.
3552 * tests/skeletons.at (installed skeleton file name): Rename to...
3553 (installed skeleton file names): ... this.
3555 2007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
3557 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
3558 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
3559 Summary" not "Directives".
3560 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
3561 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
3562 since the former is now the more complete one.
3563 (Prologue Alternatives): Likewise and do the same for %defines.
3564 (Table of Symbols): Add summary of %code, add summary of %define, and
3565 move full %code documentation to...
3566 (Decl Summary): ... here for consistency with other entries in these
3568 Move %define entry in order to keep this list alphabetized.
3569 Reword %define entry a little to put less emphasis on the skeleton
3570 concept, which most users shouldn't have to think about.
3572 2007-01-26 Paul Eggert <eggert@cs.ucla.edu>
3574 Adjust to recent gnulib changes.
3575 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
3576 Add string.h, string_.h, unistd_.h, wchar_.h.
3577 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
3578 * src/system.h: Don't include <stpcpy.h>; this is now done by
3581 2007-01-23 Paolo Bonzini <bonzini@gnu.org>
3583 Simplify implementation of unqualified %code, implement macros for
3584 uniform treatment of boolean %define flags. Document %define.
3585 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
3586 b4_percent_code_ifdef): New.
3587 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
3588 * data/c++.m4: Define default value for global_tokens_and_yystype.
3589 * data/glr.cc: Likewise.
3590 * data/location.cc: Use b4_percent_define_flag_if.
3592 * doc/bison.texinfo (Decl Summary): Document %define.
3594 * src/parse-gram.y (Unqualified %code): Change muscle name to
3596 (content.opt): Default to empty.
3598 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
3600 Implement support for relative and absolute skeleton file names.
3601 Discussed starting at
3602 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
3603 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
3604 (Bison Options): Document in --skeleton entry.
3605 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
3606 full_skeleton can't necessarily hold all of pkgdatadir.
3607 If the specified skeleton file name contains a `/', don't prepend
3609 * src/parse-gram.y (prologue_declaration): If the specified skeleton
3610 file name contains a `/', prepend the grammar file directory.
3611 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
3612 * skeletons.at: New file.
3613 (relative skeleton file names): New test case.
3614 (installed skeleton file names): New test case.
3615 * tests/testsuite.at: Include skeletons.at.
3617 * bootstrap: Update copyright to 2007.
3619 2007-01-17 Paolo Bonzini <bonzini@gnu.org>
3621 * bootstrap: Remove occurrences of .#bootmp from the files.
3623 2007-01-17 Akim Demaille <akim@epita.fr>
3625 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
3627 Use per-type %printer.
3629 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
3631 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
3632 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
3633 djgpp/config.site, src/files.c, src/files.h, src/main.c,
3634 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
3635 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
3636 tests/glr-regression.at, tests/input.at, tests/local.at,
3637 tests/output.at, tests/torture.at: Update copyright to 2007.
3639 2007-01-16 Akim Demaille <akim@epita.fr>
3641 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
3643 (Calc++ Scanner): Exit with failure if we can't open the input
3645 Accept "-" standing for stdin.
3646 (Calc++ Top Level): Print the result only if the parsing was
3649 2007-01-16 Akim Demaille <akim@epita.fr>
3651 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
3653 2007-01-15 Paolo Bonzini <bonzini@gnu.org>
3654 and Joel E. Denny <jdenny@ces.clemson.edu>
3656 Clean up %define and %code implementation in M4 some. Most
3657 importantly, rename all related macros to be in the b4_percent_define
3658 and b4_percent_code namespaces. Also, complete support for `.' in
3659 %define variable names and %code qualifiers.
3660 * data/bison.m4 (b4_check_user_names): Check for special
3661 "SKELETON-NAMESPACE(name)" macros instead of using two nested
3663 (b4_get_percent_define, b4_get_percent_code): Rename to...
3664 (b4_percent_define_get, b4_percent_code_get): ... these.
3665 Extend documentation with examples.
3666 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
3667 b4_percent_define_skeleton_variables and
3668 b4_percent_code_skeleton_qualifiers.
3669 Expect any value for the %define variable `foo' to be stored in the
3670 macro named `b4_percent_define(foo)'; expect any %code blocks for the
3671 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
3672 expect any unqualified %code blocks to be stored in a macro named
3673 `b4_percent_code_unqualified'.
3674 Use m4_indir so that %define variable names and %code qualifiers can
3675 contain `.', which is allowed by the grammar parser.
3676 (b4_percent_define_default): New macro to set a default value for a
3678 (m4_wrap): Update wrapped code, and fix some underquoting.
3679 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
3680 Expect grammar uses of %define variables and %code qualifiers to be
3681 defined in b4_percent_define_user_variables and
3682 b4_percent_code_user_qualifiers.
3683 * data/c++.m4: Use b4_percent_define_default rather than
3684 m4_define_default. Fix some underquoting. Skeleton usage of %define
3685 variable define_location_comparison now implies skeleton usage of
3686 %define variable filename_type.
3687 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
3688 data/push.c, data/yacc.c: Update macro names.
3689 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
3692 2007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3694 DJGPP specific issues.
3696 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
3697 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
3699 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
3701 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
3702 run parsers in all tests so that Valgrind is invoked during
3703 maintainer-check-valgrind.
3704 (Duplicate representation of merged trees): Free all semantic values.
3705 (Duplicated user destructor for lookahead): Likewise.
3707 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
3709 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
3710 command-line prefix.
3711 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
3712 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
3713 miss Valgrind messages.
3714 (Exploding the Stack Size with Malloc): Likewise.
3716 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
3718 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
3719 locals. Reported by Juan Manuel Guerrero at
3720 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
3721 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
3722 Fix some indentation also.
3723 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
3724 explaining this issue.
3726 2007-01-09 Paolo Bonzini <bonzini@gnu.org>
3727 and Joel E. Denny <jdenny@ces.clemson.edu>
3729 Simplify union and prologue handling, and escape union and lex/parse
3730 params with digraphs.
3731 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
3732 values to the empty string since these are no longer guaranteed
3733 initialized by the front-end.
3734 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
3735 braces around b4_user_stype since this is no longer done by the
3737 * src/files.c, src/files.h (pre_prologue_obstack,
3738 post_prologue_obstack): Remove.
3739 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
3740 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
3741 with digraphs. This fixes lex params and parse params.
3742 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
3743 * src/output.c (prepare): Remove muscle insertion of the prologues.
3744 (output): Remove freeing of pre_prologue_obstack and
3745 post_prologue_obstack.
3746 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
3747 than prologue_augment for prologue parsing so you don't need prologue
3749 (grammar_declaration): For %union RHS, use `braceless' instead of
3750 "{...}" so that braces are already stripped and code is escaped with
3752 * src/reader.c (prologue_augment): Remove.
3753 (reader): Remove initialization of pre_prologue_obstack and
3754 post_prologue_obstack.
3755 * src/reader.h (prologue_augment): Remove.
3757 * data/c.m4: Remove stray parenthesis.
3759 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3761 Remove quotes from variables names in %define directives and from
3762 qualifiers in %code directives, and restrict the characters that are
3763 allowed in them to M4-friendly ones. For %define, continue to support
3764 the quoted form as a deprecated feature. Discussed starting at
3765 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
3766 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
3768 * doc/bison.texinfo (Prologue Alternatives): Update.
3769 (Decl Summary): In %defines entry, update mention of `%code requires'
3770 and `%code provides'.
3771 (C++ Location Values): Update %define uses.
3772 (Calc++ Parser Interface): Likewise.
3773 (Calc++ Parser): Likewise, and update `%code requires' uses.
3774 (Table of Symbols): Update %code documentation.
3775 * src/parse-gram.y (prologue_declaration): For %define variables, use
3776 `variable' instead of `STRING'.
3777 (grammar_declaration): For %code qualifiers, use `ID' instead of
3779 (variable): New nonterminal that takes an `ID' or a `STRING'.
3780 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
3782 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
3783 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
3784 (%define errors): Update %define uses.
3786 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3788 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
3789 instead of muscle_insert for %define values so that M4-special
3790 characters are replaced with digraphs.
3791 * tests/input.at (%define errors): Extend to check weird values.
3793 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3795 Instead of having skeletons declare all valid %define variables and
3796 %code qualifiers, provide macros that retrieve the associated values
3797 and build these lists automatically. Thus Bison will now warn when a
3798 variable or qualifier is not used by the skeleton in the current
3799 invocation regardless of whether it might sometimes be used by that
3800 skeleton in other invocations. Also, move all %define value macros to
3801 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
3802 form, which is replaced by %code.
3803 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
3804 (b4_check_user_names): ... this, and change the series of valid name
3805 arguments to a single list argument for names used in the skeleton
3806 similar to the existing list argument for names used in the grammar.
3807 Warn instead of complaining.
3808 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
3809 values and %code code, to format %code code properly, and to build
3810 lists of all %define variables and %code qualifiers used in the
3811 skeleton: b4_skeleton_percent_define_variables and
3812 b4_skeleton_percent_code_qualifiers.
3813 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
3815 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
3816 the skeleton names lists can finish building first. In place of
3817 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
3818 expect the lists b4_user_percent_define_variables and
3819 b4_user_percent_code_qualifiers.
3820 * data/c++.m4: Where setting default values for b4_parser_class_name,
3821 b4_location_type, b4_filename_type, b4_namespace, and
3822 b4_define_location_comparison, update their names to the
3823 b4_percent_define_ namespace.
3824 * data/glr.c: Don't use b4_check_percent_define_variables and
3825 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
3826 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
3827 (b4_parser_class_name, b4_namespace): Define these using
3828 b4_get_percent_define for parser_class_name and namespace.
3829 * data/location.cc: Use b4_get_percent_define.
3830 * data/push.c: Don't use b4_check_percent_define_variables and
3831 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
3832 * data/yacc.c: Likewise, and don't call m4_exit in
3833 b4_use_push_for_pull_if or m4_wrap code will never execute.
3834 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
3836 (muscle_grow_user_name_list): ... this for consistency with the
3837 terminology used in bison.m4.
3838 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
3839 %define variable names, and rename muscle used_percent_define_variables
3840 to user_percent_define_variables.
3841 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
3842 user_percent_code_qualifiers.
3844 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
3845 {CODE} form is no longer accepted.
3846 * tests/input.at (Reject bad %code qualifiers): Rename to...
3847 (Reject unused %code qualifiers): ... this, and update test output.
3848 (%define error): Update test output.
3850 2007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
3852 Check for unrecognized %define variables similar to checking for
3853 unrecognized %code qualifiers. Check for redefined %define variables.
3854 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
3856 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
3857 (b4_check_percent_define_variables): New, also wraps it.
3858 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
3859 variables using b4_check_percent_define_variables.
3860 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
3861 all those exercised in the test suite and all those listed in the
3862 `Default values' section of c++.m4. Are there others?
3863 * data/push.c, data/yacc.c: Declare no valid %define variables.
3864 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
3865 similar to muscle_find, but it works even when the muscle stores a
3867 (muscle_grow_used_name_list): New function for constructing the used
3868 name list muscles that b4_check_for_unrecognized_names requires.
3869 * src/parse-gram.y (prologue_declaration): Warn if a variable is
3870 %define'd more than once. Define the b4_used_percent_define_variables
3871 muscle with muscle_grow_used_name_list.
3872 (grammar_declaration): Abbreviate %code code with
3873 muscle_grow_used_name_list.
3874 * tests/input.at (%define errors): New.
3876 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3878 Provide warn_at, complain_at, and fatal_at function callbacks to the
3879 skeletons, and use this for %code qualifier complaints.
3880 * data/bison.m4 (b4_error_at): New, invoked by...
3881 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
3882 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
3883 @fatal_at(...@) directives.
3884 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
3885 qualifiers in b4_used_percent_code_qualifiers and to use
3887 * src/location.c, src/location.h (boundary_set_from_string): New global
3889 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
3891 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
3892 to b4_used_percent_code_qualifiers.
3893 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
3895 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
3896 (lineno): Rename to...
3897 (out_lineno): ... this so I don't misunderstand it again.
3898 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
3899 here; these newlines are in the input but not the output file.
3900 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
3901 (at_directive_perform): ... this new static function, and add handling
3902 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
3904 * tests/input.at (Reject bad %code qualifiers): Update test output with
3905 locations and extend.
3907 * tests/output.at (Output file name: [, Output file name: ]): Remove
3908 bogus comment about these tests failing.
3910 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3912 Clean up b4_check_percent_code_qualifiers a little.
3913 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
3914 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
3915 documentation and add examples.
3916 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
3919 2007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
3921 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
3922 unreliable -- especially when they're hidden inside another macro.
3923 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
3924 data/c.m4: Remove m4_divert(-1).
3925 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
3926 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
3927 m4_divert_push(0) and m4_divert_pop(0).
3928 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
3929 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
3930 pushed and popped by m4sugar, should be first on the stack.
3932 Provide warn, complain, and fatal function callbacks to the skeletons.
3933 This provides more flexibility than m4_fatal, improves the error
3934 message format, and captures messages for translation. Discussed
3936 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
3937 * data/bison.m4 (b4_error): New, invoked by...
3938 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
3939 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
3940 directives. Because these M4 macros might be called when the current
3941 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
3942 the previous removal of uses of m4_divert, which caused trouble.
3943 (b4_check_percent_code_qualifiers): Use b4_complain instead of
3944 m4_fatal to report unrecognized %code qualifiers.
3945 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
3946 push parser requests.
3947 * data/glr.c: Use b4_complain instead of m4_fatal to report
3948 non-deterministic push parser requests.
3949 Update @output usage to @output(...@) form.
3950 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
3951 report missing %defines. Update @output usage to @output(...@) form.
3952 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
3954 * src/main.c (main): Invoke skel_scanner_free.
3955 * src/scan-skel.h (skel_scanner_free): Prototype new function.
3956 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
3957 obstack_for_string from flex-scanner.h.
3958 (YY_DECL): Use to declare skel_lex static.
3959 (decode_at_digraphs): Remove; now handled in the new
3960 SC_AT_DIRECTIVE_ARG start condition.
3961 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
3963 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
3964 at_directive_argv): New static globals.
3965 (INITIAL): Use fail_for_invalid_at.
3966 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
3967 recognize the start of a generalized `@directive(...@)' form and
3969 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
3970 directive args (using the new obstack_for_string), to decode the
3971 contained @ diagraphs, and to perform the directive. It recognizes
3972 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
3974 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
3975 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
3977 (scan_skel): Initialize obstack_for_string on the first call.
3978 (skel_scanner_free): New function to free obstack_for_string.
3979 * tests/input.at (Reject bad %code qualifiers): Update test output.
3981 2007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
3983 Consolidate the 4 prologue alternative directives (%code, %requires,
3984 %provides, and %code-top) into a single %code directive with an
3985 optional qualifier field. Discussed at
3986 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
3987 * NEWS (2.3a+): Rewrite the existing entry for the prologue
3989 * doc/bison.texinfo (Prologue Alternatives): Update.
3990 (Decl Summary): Update to %code "requires" and %code "provides".
3991 (Calc++ Parser): Update to %code "requires".
3992 (Table of Symbols): Remove entries for %requires, %provides, and
3993 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
3994 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
3995 are replaced by b4_percent_code_provides and b4_percent_code_requires,
3996 which are skeleton-specific.
3997 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
3998 declare what %code qualifiers it supports and to complain if any other
3999 qualifiers were used in the grammar.
4000 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
4001 and b4_user_code([b4_percent_code_provides]) in place of
4002 b4_user_requires and b4_user_provides.
4003 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
4004 Add b4_user_code([b4_percent_code_top]) and
4005 b4_user_code([b4_percent_code]).
4006 Invoke b4_check_percent_code_qualifiers.
4007 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
4008 PERCENT_REQUIRES): Remove.
4009 (grammar_declaration): Remove RHS's for %code-top, %provides, and
4010 %requires. Rewrite the %code RHS as the unqualified form defining the
4011 muscle b4_percent_code. Add another RHS for the qualified %code form,
4012 which defines muscles of the form b4_percent_code_QUALIFIER and the
4013 b4_used_percent_code_qualifiers muscle.
4014 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
4015 PERCENT_REQUIRES): Remove.
4016 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
4017 %code "requires" and %code "provides".
4018 * tests/input.at (Reject bad %code qualifiers): New.
4020 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
4022 Use the new code_props interface for destructors and printers.
4023 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
4024 printer_location members, and change the type of the destructor and
4025 printer members to code_props.
4026 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
4027 symbol_printer_get, semantic_type_destructor_set,
4028 semantic_type_printer_set, default_tagged_destructor_set,
4029 default_tagless_destructor_set, default_tagged_printer_set,
4030 default_tagless_printer_set): Use code_props in arguments and return
4031 types in place of char const * and location.
4032 (symbol_destructor_location_get, symbol_printer_location_get): Remove
4033 since the locations are now contained in the return of
4034 symbol_destructor_get and symbol_printer_get.
4035 * src/output.c (symbol_destructors_output, symbol_printers_output):
4037 (symbol_code_props_output): ... this to eliminate duplicate code.
4038 (output_skeleton): Update to use symbol_code_props_output.
4039 * src/reader.c (symbol_should_be_used): Update use of
4040 symbol_destructor_get.
4041 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
4042 Update uses of the various _destructor_set and _printer_set functions.
4043 * src/symtab.c: (default_tagged_destructor_location,
4044 default_tagless_destructor_location, default_tagged_printer_location,
4045 default_tagless_printer_location): Remove since we...
4046 (default_tagged_destructor, default_tagless_destructor,
4047 default_tagged_printer, default_tagless_printer): ... change the type
4048 of these to code_props.
4049 (symbol_new, semantic_type_new, symbol_destructor_set,
4050 semantic_type_destructor_set, symbol_destructor_get,
4051 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
4052 symbol_check_alias_consistency, default_tagged_destructor_set,
4053 default_tagless_destructor_set, default_tagged_printer_set,
4054 default_tagless_printer_set): Update.
4055 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
4056 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
4058 (symbol_print): Use SYMBOL_CODE_PRINT.
4060 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
4062 Use the new code_props interface for rule actions.
4063 * src/symlist.h (symbol_list): Replace action, action_location, and
4064 used members with a code_props action_props member.
4065 * src/reader.c (symbol_should_be_used, grammar_rule_check,
4066 grammar_midrule_action, grammar_current_rule_merge_set,
4067 grammar_current_rule_symbol_append, packgram): Update.
4068 * src/scan-code.h (translate_rule_action): Remove, no longer used.
4069 * src/scan-code.l (handle_action_dollar): Update.
4070 (translate_rule_action): Remove, no longer used.
4071 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
4073 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
4075 Use the new code_props interface in parse-gram.y.
4076 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
4077 Update all uses of translate_* functions to use the new code_props
4078 interface and to use gram_scanner_last_string_free and
4079 code_scanner_last_string_free where possible.
4080 (grammar_declaration): symbol_list_destructor_set and
4081 symbol_list_printer_set now perform the translation, so don't do it
4082 here. Use gram_scanner_last_string_free where possible.
4083 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
4084 translate_code): Remove, no longer used.
4085 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
4086 symbol_list_printer_set): Perform code translation here rather than
4087 depending on the caller to do so.
4089 * src/symlist.h (struct symbol_list): Correct some documentation typos.
4090 * src/scan-gram.h (gram_last_string): Remove declaration.
4091 * src/scan-gram.l (last_string): Declare it static.
4093 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
4095 Encapsulate code properties and related functionality for the various
4096 destructors, printers, and actions into a code_props structure and
4097 interface. This patch merely implements code_props in scan-code.h and
4098 scan-code.l. Future patches will rewrite other modules to use it.
4099 Discussed starting at
4100 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
4101 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
4102 consistently initialize const structs that have an empty location
4104 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
4105 to ensure consistency.
4106 * src/scan-code.h (code_props): New structure.
4107 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
4108 function, macro, and const global variable for initializing a
4109 code_props with no code.
4110 (code_props_plain_init, code_props_symbol_action_init,
4111 code_props_rule_action_init, code_props_translate_code): The rest of
4112 the new code_props functional interface. Among other things, the init
4113 functions set the code_props kind field so that
4114 code_props_translate_code will know whether to behave like
4115 translate_symbol_action, translate_rule_action, or translate_code.
4116 These old translate functions must remain until all other modules are
4117 updated to use the new code_props interface.
4118 (code_scanner_last_string_free): New function similar to
4119 gram_scanner_last_string_free.
4120 (code_scanner_free): Add documentation.
4121 * src/scan-code.l: Implement the new interface.
4122 (code_lex): Make it static, add a code_props* argument, and remove the
4124 (last_string): New static global similar to the one in scan-gram.l.
4125 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
4127 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
4128 code_props since Bison may one day use this information for destructors
4130 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
4131 (handle_action_dollar): Use symbol_list_n_get and set used flag
4132 directly since symbol_list_n_used_set is removed.
4133 (translate_action): Add a code_props* argument and remove the rule,
4134 action, and location arguments. Pass the code_props* on to code_lex.
4135 (translate_rule_action, translate_symbol_action, translate_code):
4136 Rewrite as wrappers around the new code_props interface.
4137 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
4138 it would eventually need to break the encapsulation of code_props.
4140 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
4142 * etc/.cvsignore: New.
4144 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
4146 Add maintainer-push-check to run maintainer-check using push parsing in
4147 place of pull parsing where available.
4148 * Makefile.am (maintainer-push-check): New.
4149 * data/bison.m4 (b4_use_push_for_pull_if): New.
4150 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
4151 appropriately based on their existing values.
4152 (yypush_parse): Don't print push-parser-specific diagnostics if push
4153 parsing is being used in place of pull parsing.
4154 * data/yacc.c: If push parsing should replace pull parsing, redirect to
4156 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
4157 variable, and insert b4_use_push_for_pull_flag into muscles.
4158 * tests/Makefile.am (maintainer-push-check): New.
4160 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
4162 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
4163 (whether successful or failed) so that yypush_parse can be invoked
4164 again to start a new parse using the same yypstate.
4165 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
4166 check multiple yypull_parse invocations on the same yypstate. For pull
4167 mode, extend to check multiple yyparse invocations.
4168 (Exploding the Stack Size with Alloca): Extend to try with
4170 (Exploding the Stack Size with Malloc): Likewise.
4172 * tests/calc.at (Simple LALR Calculator): Don't specify
4173 %skeleton "push.c" since %push-pull-parser implies that now.
4174 * tests/headers.at (export YYLTYPE): Don't check for the push
4175 declarations. Otherwise, this test case can't be used to see if push
4176 mode can truly emulate pull mode.
4177 * tests/input.at (Torturing the Scanner): Likewise.
4178 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
4179 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
4180 AT_YACC_IF, which now includes the case of push mode since %skeleton
4181 need not be used for push mode. This will be more intuitive once
4182 push.c is renamed to yacc.c.
4184 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
4186 For push mode, convert yyparse from a macro to a function, invoke yylex
4187 instead of passing a yylexp argument to yypull_parse, and don't
4188 generate yypull_parse or yyparse unless %push-pull-parser is declared.
4189 Discussed starting at
4190 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
4191 * data/bison.m4 (b4_pull_if): New.
4192 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
4193 * data/push.c: Improve M4 quoting a little.
4194 (b4_generate_macro_args, b4_parenthesize): Remove.
4195 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
4196 any time a pull parser is requested.
4197 Don't #define this as a wrapper around yypull_parse. Instead, when
4198 both push and pull are requested, make it a function that does that
4200 (yypull_parse): If there's a b4_prefix, #define this to
4201 b4_prefix[pull_parse] when both push and pull are requested.
4202 Don't define this as a function unless both push and pull are
4204 Remove the yylexp argument and hard-code yylex invocation instead.
4205 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
4207 * src/getargs.c (pull_parser): New global initialized to true.
4208 * getargs.h (pull_parser): extern it.
4209 * src/output.c (prepare): Insert pull_flag muscle.
4210 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
4211 (prologue_declaration): Set both push_parser and pull_parser = true for
4212 %push-pull-parser. Set push_parser = true and pull_parser = false for
4214 * src/scan-gram.l: Don't accept %push_parser as an alternative to
4215 %push-parser since there's no backward-compatibility concern here.
4216 Scan %push-pull-parser.
4217 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
4218 instead of %push-parser.
4219 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
4220 prototype it in the module that calls yyparse.
4221 * tests/input.at (Torturing the Scanner): Likewise.
4222 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
4224 2006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
4226 Update etc/bench.pl. Optimize push mode a little (the yyn change
4227 deserves most of the credit).
4228 * Makefile.am (SUBDIRS): Add etc subdirectory.
4229 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
4230 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
4231 yytoken, yyval, and yyloc declarations to...
4232 (yyparse or yypush_parse): ... here to improve performance. For
4233 yypush_parse invocations after the first, be sure to assign yyn its old
4235 (yypstate_new): Don't bother initializing the yyresult field since the
4236 initial value isn't used.
4237 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
4238 remove the #define that, in push mode, set it to yyps->NAME.
4239 * etc/Makefile.am: New.
4240 * etc/bench.pl: Remove and build it instead from...
4241 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
4242 "tests/bison" from the build directory by default rather than just
4243 invoking "bison" from $PATH.
4244 (calc_grammar): Update push parser code: don't declare yylval globally,
4245 don't define yyparse_wrapper, and don't #define yyparse.
4246 (bench_grammar): Update to check all working combinations of yacc.c,
4247 push.c, impure, pure, pull, and push.
4249 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
4251 For push mode, add pull wrappers around yypush_parse.
4252 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
4253 (yypull_parse): New function wrapping yypush_parse.
4254 (yyparse): New #define wrapping yypull_parse.
4255 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
4257 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
4258 prototype yylex in the module that calls yyparse, and don't prototype
4259 yyparse there. Otherwise, the yyparse expansion won't compile.
4260 * tests/input.at (Torturing the Scanner): Likewise.
4262 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
4264 Enable push parsers to operate in impure mode. Thus, %push-parser no
4265 longer implies %pure-parser. The point of this change is to move
4266 towards being able to test the push parser code by running the entire
4267 test suite as if %push-parser had been declared.
4268 * data/push.c (yypush_parse): For impure mode, remove the
4269 yypushed_char, yypushed_val, and yypushed_loc arguments.
4270 Instead, declare these as local variables initialized to the global
4271 yychar, yylval, and yylloc.
4272 For the first yypush_parse invocation only, restore the initial values
4273 of these global variables when it's time to read a token since they
4274 have been overwritten.
4275 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
4277 * tests/calc.at (Simple LALR(1) Calculator): Always declare
4278 %pure-parser along with %push-parser since this test case was designed
4279 for pure push parsers.
4280 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
4281 (AT_YACC_OR_PUSH_IF): New.
4282 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
4283 add a note that it's still wrong for some cases (as it has been for a
4285 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
4286 %push-parser no longer implies %pure-parser.
4288 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4290 Remove some unnecessary differences between the pull parser code and
4291 the push parser code. This patch enables yynerrs in push mode.
4292 * data/push.c: Reformat M4 a little.
4293 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
4294 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
4295 because push mode is on. Instead, if pure mode is on, move yynerrs
4297 (b4_declare_parser_state_variables): ... here.
4298 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
4299 to yyps->NAME so it can be used in yypush_parse.
4300 (yypush_parse): Don't omit uses of yynerrs in push mode.
4302 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4304 Fix bug such that the first pushed token's value and location are
4305 sometimes overwritten (sometimes by %initial-action) before being used.
4306 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
4307 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
4308 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
4309 more closely mimic the pull parser logic.
4310 Don't copy the pushed token to yychar, yylval, and yylloc until it's
4311 time to read a token, which is after any initialization of yylval and
4313 (gottoken): Rename label to...
4314 (yyread_pushed_token): ... for clarity and to avoid infringing on the
4317 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4319 Rearrange initialization of the parser state variables so that the
4320 skeleton doesn't have to have a copy for pull mode and another for push
4321 mode. This patch also fixes at least a bug such that yylloc was not
4322 initialized (with b4_location_initial_line and
4323 b4_location_initial_column) upon calling yypush_parse. However, that
4324 initialization now overwrites the first token's location;
4325 %initial-action assigning @$ already did the same thing, and both bugs
4326 will be fixed in a later patch.
4327 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
4328 (b4_declare_parser_state_variables): Remove initialization of yytoken,
4329 yyss, yyvs, yyls, and yystacksize.
4330 (yypstate_new): Remove initialization of some yypstate fields: yystate,
4331 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
4333 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
4334 yyps->NAME so it can be used in yypush_parse.
4335 (yyparse or yypush_parse): For yypush_parse, don't print the
4336 "Starting parse" diagnostic for invocations after the first.
4337 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
4338 yypush_parse, only do it for the first invocation.
4339 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
4340 initialization to occur in yypush_parse but only on the first
4343 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
4345 * data/push.c: Add CPP guards around push parser declarations in both
4346 the header and the code file.
4347 In the code file, move the push parser declarations to the same place
4348 they appear in the header file.
4349 Clean up the M4 some, especially the inconsistent underquoting in
4350 some b4_c_function_def and b4_c_function_decl uses.
4352 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
4354 Encapsulate the push parser state variables into an M4 macro so the
4355 push skeleton doesn't have to list them again for pull mode's yyparse.
4356 For push mode, remove yypush_parse's local equivalents of these
4357 variables to eliminate unnecessary copying between the two sets at
4358 run-time. This patch also fixes at least a bug related to multiple
4359 %initial-action invocations in push mode.
4360 * data/push.c (b4_declare_parser_variables): Rename to...
4361 (b4_declare_scanner_communication_variables): ... this for clarity and
4363 (b4_declare_yyparse_variables): Remove and move its contents to the one
4364 spot where it was invoked.
4365 (b4_declare_parser_state_variables): New macro containing the parser
4366 state variables required by push mode.
4367 (struct yypstate): Replace all fields but yynew with
4368 b4_declare_parser_state_variables.
4369 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
4370 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
4371 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
4372 (yyparse or yypush_parse): For yyparse in pull mode, replace local
4373 parser state variable declarations with
4374 b4_declare_parser_state_variables.
4375 Don't initialize parser state variables when calling yypush_parse since
4376 yypstate_new already does that.
4377 Invoke the user's initial action only upon the first yypush_parse
4379 Remove all code that copies between the local parser state variables
4382 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
4384 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
4385 prevent a name collision in a future patch where these names will
4386 sometimes be #define'd.
4387 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
4388 since it no longer has the same name as the existing argument.
4389 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
4391 2006-12-19 Paolo Bonzini <bonzini@gnu.org>
4392 and Joel E. Denny <jdenny@ces.clemson.edu>
4394 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
4395 that the argument is case-insensitive, and there's no `=' here.
4396 For the %skeleton entry, mention that %language is better.
4397 (Bison Options): Likewise for --language and --skeleton. Move the
4398 --skeleton entry so that the `Tuning the parser' section is sorted
4399 alphabetically on long options.
4400 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
4401 %language directive in detail here; cross-reference the %language
4402 documentation instead.
4403 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
4404 `%require "2.3b"' so that the example is always up-to-date.
4405 (Table of Symbols): Add entries for %language and %skeleton.
4406 * examples/extexi (normalize): Instead of replacing every %require
4407 argument with the current Bison version, just substitute for
4408 `@value{VERSION}'. This guarantees that we're testing what actually
4409 appears in the documentation.
4410 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
4411 rather than `@VERSION@'.
4413 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
4415 * NEWS: Reword the %language news a bit, and put it earlier.
4417 * src/getargs.c (skeleton_arg): Last arg is now location const *.
4418 Rewrite to simplify the logic.
4419 (language_argmatch): Likewise.
4420 (program_name): We now own this var.
4421 * src/getargs.h (struct bison_language): Use char[] rather than
4424 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
4426 * src/complain.c (program_name): Remove decl; no longer needed.
4427 * src/main.c (program_name): Remove; now belongs to getargs.
4429 2006-12-18 Paolo Bonzini <bonzini@gnu.org>
4431 * NEWS: Document %language.
4433 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
4435 * data/c-skel.m4, data/c++-skel.m4: New files.
4436 * data/glr.c: Complain on push parsers.
4438 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
4440 (Decl Summary): Document %language and %skeleton.
4441 (Command line): Document -L.
4443 * examples/extexi: Rewrite %require directive.
4444 * examples/calc++/Makefile.am: Pass VERSION to extexi.
4446 * src/files.c (compute_exts_from_gc): Look in language structure
4448 (compute_file_name_parts): Check whether .tab should be added.
4449 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
4450 (language, skeleton_arg, language_argmatch): New.
4451 (long_options): Add --language.
4452 (getargs): Use skeleton_arg, add -L/--language.
4453 * src/getargs.h: Include location.h.
4454 (struct bison_language, language, skeleton_arg, language_argmatch): New.
4455 * src/output.c (prepare): Pick default skeleton from struct language.
4456 Don't dispatch C skeletons here.
4457 * src/parse-gram.y (PERCENT_LANGUAGE): New.
4458 (prologue_declaration): Add "%language" rule, use skeleton_arg.
4459 * src/scan-gram.l ("%language"): New rule.
4461 * tests/calc.at: Test %skeleton and %language.
4462 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
4463 (AT_GLR_IF): Look for %skeleton "glr.cc".
4464 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
4465 (AT_YACC_IF): Reject %language.
4467 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
4469 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
4470 since it wasn't used; only the typedef name 'semantic_type' is needed.
4471 Also, omit trailing white space.
4473 * bootstrap: Sync from coreutils.
4474 (gnulib_extra_files): Add build-aux/announce.gen.
4475 (slurp): Adjust .gitignore files like .cvsignore files.
4476 * build-aux/announce-gen: Remove from CVS, since bootstrap
4479 2006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
4481 Make %push-parser imply %pure-parser. This fixes several bugs; see
4482 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
4483 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
4485 * data/push.c: Don't bother testing b4_push_if when deciding whether
4486 to expand b4_declare_parser_variables globally.
4487 (yypush_parse): Likewise in here.
4489 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
4490 (yy_reduce_print): Reformat M4 for readability.
4492 2006-12-15 Bob Rossi <bob@brasko.net>
4493 and Joel Denny <jdenny@ces.clemson.edu>
4495 * data/push.c (yypstate): Add typedef, and update all uses of
4496 struct yypstate to just yypstate.
4497 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
4499 2006-12-14 Bob Rossi <bob@brasko.net>
4501 * data/push.c (yypush_parse): Declare prototype regardless of
4504 2006-12-14 Bob Rossi <bob@brasko.net>
4506 * data/push.c (yyparse): Remove the prototype and the #define when in
4509 2006-12-13 Bob Rossi <bob@brasko.net>
4511 * data/push.c (yypstate_init): Rename to...
4512 (yypstate_new): ... this and use b4_c_function_def.
4513 (yypstate_delete): New.
4514 (yypush_parse): Change parameters yynval and yynlloc to be const.
4515 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
4516 yypstate_delete functions.
4518 2006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
4520 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
4521 strange test case titles. Reported by Bob Rossi.
4523 2006-12-13 Paul Eggert <eggert@cs.ucla.edu>
4525 * TODO: Add pointer to Sylvain Schmitz's work on static detection
4526 of potential ambiguities in GLR grammers.
4528 2006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
4530 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
4531 `bison ', use m4_index instead of m4_substr since chopping up a string
4532 containing M4-special characters causes problems here.
4534 Fix a couple of bugs related to special characters in user-specified
4535 file names, and make it easier for skeletons to compute output file
4536 names with the same file name prefix as Bison-computed output file
4538 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
4539 b4_parser_file_name and b4_spec_defines_file instead of
4540 @output_parser_name@ and @output_header_name@, which are now redundant.
4541 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
4542 b4_parser_file_name, b4_spec_defines_file, and the new
4543 @basename(FILENAME@) instead of @output_parser_name@ and
4544 @output_header_name@, which inappropriately escaped the file names as
4546 * src/files.c (all_but_ext): Remove static qualifier.
4547 (compute_output_file_names): Move `free (all_but_ext)' to...
4548 (output_file_names_free): ... here since all_but_ext is needed later.
4549 * src/files.h (all_but_ext): Extern.
4550 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
4551 exactly what MUSCLE_INSERT_STRING used to do.
4552 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
4553 characters are escaped properly.
4554 * src/output.c (prepare): Define muscle file_name_all_but_ext as
4556 For pkgdatadir muscle, maintain previous functionality by using
4557 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
4558 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
4559 digraphs would never be expanded. Hopefully no one has M4-special
4560 characters in his Bison installation path.
4561 * src/scan-skel.l: Don't parse @output_header_name@ and
4562 @output_parser_name@ anymore since they're now redundant.
4563 In @output, use decode_at_digraphs.
4564 Parse a new @basename command that invokes last_component.
4565 (decode_at_digraphs): New.
4566 (BASE_QPUTS): Remove unused.
4567 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
4568 (Output file name): New tests.
4570 2006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
4572 Warn about output files that are generated by the skeletons and that
4573 conflict with other output files.
4574 * data/glr.c: Don't generate the header file here when glr.cc does.
4575 * src/files.c (file_names, file_names_count): New static globals.
4576 (compute_output_file_names): Invoke output_file_name_check for files
4577 not generated by the skeletons and remove existing checks.
4578 (output_file_name_check): New function that warns about conflicting
4580 (output_file_names_free): Free file_names.
4581 * src/files.h (output_file_name_check): Declare.
4582 * src/scan-skel.l: Invoke output_file_name_check for files generated by
4584 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
4585 (Conflicting output files): New tests.
4587 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4589 * doc/bison.texinfo: Fix a couple of typos.
4591 2006-12-08 Bob Rossi <bob@brasko.net>
4593 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
4595 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
4597 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
4598 (yypush_parse): Rename yypvars argument to yyps and remove redundant
4600 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
4601 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
4603 2006-12-07 Bob Rossi <bob@brasko.net>
4604 and Joel Denny <jdenny@ces.clemson.edu>
4606 * data/push.c (yypvarsinit): Change return type from void* to struct
4607 yypvars*. No longer cast to void* on return.
4608 (struct yypvars): Remove yylen since it need not be remembered between
4609 yypushparse invocations.
4610 (yypushparse): Don't copy between yylen and pv->yylen.
4612 2006-12-05 Bob Rossi <bob@brasko.net>
4614 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
4615 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
4616 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
4617 (struct yypvars): Remove b4_declare_parser_variables.
4618 (yypvarsinit): Remove init code for removed variables.
4619 (global scope): Do not declare b4_declare_parser_variables if
4621 (yypushparse): Add b4_declare_parser_variables.
4622 Init new local variables, and remove init code for removed
4625 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
4626 and yyparse for other modes.
4627 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
4628 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
4629 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
4630 (AT_PURE_LEX_IF): True if pure or push parser.
4632 2006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
4634 Document Yacc prologue alternatives and default %destructor's and
4635 %printer's as experimental. Don't mention Java yet. Discussed at
4636 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
4637 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
4638 (2.3a): Annotate this entry to say the old forms of these features were
4640 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
4641 Table of Symbols): Say they're experimental. Comment out any mention
4642 of Java (we'll want this back eventually).
4644 2006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
4646 Support a file name argument to %defines. Deprecate `=' in
4647 %file-prefix, %name-prefix, and %output. Discussed at
4648 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
4649 * NEWS (2.3a+): Mention.
4650 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
4651 form of %defines, and remove `=' from entries for %file-prefix,
4652 %name-prefix, and %output.
4653 * src/parse-gram.y (prologue_declaration): Implement.
4654 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
4655 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
4656 all but one occurrence of %name-prefix.
4657 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
4658 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
4659 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
4660 occurrence of each of %file-prefix and %output. Add check for %defines
4662 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
4663 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
4664 Remove the `=' from %output.
4666 2006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
4668 Don't escape $ in test case titles since Autoconf 2.61 now does that
4670 * tests/actions.at (Default %printer and %destructor are not for error
4671 or $undefined): Here.
4672 (Default %printer and %destructor are not for $accept): Here.
4673 * tests/input.at (Invalid $n and @n): Here.
4675 2006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
4677 Rename <!> to <>. Discussed starting at
4678 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
4679 * NEWS (2.3a+): Update.
4680 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
4682 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
4683 * src/scan-gram.l (INITIAL): Implement.
4684 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
4685 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
4687 * tests/actions.at (Default tagless %printer and %destructor,
4688 Default tagged and per-type %printer and %destructor,
4689 Default %printer and %destructor are not for error or $undefined,
4690 Default %printer and %destructor are not for $accept,
4691 Default %printer and %destructor for mid-rule values): Update.
4692 * tests/input.at (Default %printer and %destructor redeclared,
4693 Unused values with default %destructor): Update.
4695 2006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
4697 Don't let %prec take a nonterminal.
4698 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
4700 * tests/input.at (%prec takes a token): New test checking that %prec
4701 won't take a nonterminal.
4703 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
4705 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
4706 it was double-quoted.
4707 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
4708 grammar is maintained with Bison's highest standards.
4709 * src/getargs.c: Fix some typos in Doxygen comments.
4711 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
4713 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
4714 later. Reported by Paul Eggert in
4715 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
4716 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
4717 * src/scan-code.l (translate_action): Don't bother invoking
4718 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
4719 (code_scanner_free): Instead of invoking
4720 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
4722 * src/scan-gram.l (gram_scanner_free): Likewise.
4723 * src/scan-skel.l (scan_skel): Likewise.
4725 2006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
4727 * src/files.c (tr): Change return type to void.
4728 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
4729 has been called previously for the same key.
4730 (muscle_find): Return storage instead of value so that
4731 --enable-gcc-warnings doesn't produce warnings that the return discards
4732 const. aver that the value and storage are the same since storage
4733 could potentially be NULL when value is not.
4734 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
4737 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
4739 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
4740 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
4741 us a slightly cleaner distribution, and also works.
4742 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
4745 2006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
4746 and Paul Eggert <eggert@cs.ucla.edu>
4748 Don't let Bison leak memory except when it complains.
4749 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
4750 (spec_defines_file, dir_prefix): Now char *, not const char *,
4751 since they are freed.
4752 * src/files.c: Likewise.
4753 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
4755 (tr): Now operates in-place. All uses changed.
4756 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
4758 (compute_file_name_parts, compute_output_file_names): Don't store
4759 read-only data in variables that will be freed.
4760 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
4761 src_extension, and header_extension.
4762 (output_file_names_free): New public function to free
4763 spec_verbose_file, spec_graph_file, spec_defines_file,
4764 parser_file_name, and dir_prefix.
4765 * src/getargs.c (getargs): Don't store read-only data in variables that
4767 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
4768 (which previously existed but was unused), and quotearg_free.
4769 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
4770 * src/muscle_tab.c: Likewise.
4771 (muscle_entry): Make the value char const *,
4772 and add a new storage member that is char * and can be freed.
4773 (muscle_entry_free): New private function.
4774 (muscle_init): Use it instead of free.
4775 (muscle_insert, muscle_grow): Update and use new storage member.
4776 (muscle_code_grow): Free the string passed to muscle_grow
4777 since it's not needed anymore.
4778 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
4779 add a new `char *code' member.
4780 ("{...}"): Declare semantic type as code.
4781 * src/scan-code.h (translate_rule_action):
4782 (translate_symbol_action, translate_code, translate_action): Return
4783 `char const *' rather than `char *' since external code should not free
4785 * src/scan-code.l: Likewise.
4786 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
4787 which is "{...}" in the parser.
4788 * tests/Makefile.am (maintainer-check-valgrind): Set
4789 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
4791 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
4793 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
4794 expecting a non-zero exit status sets --leak-check=summary and
4795 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
4796 this case, and we don't want to hear about it.
4798 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
4800 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
4801 instead of from the template, to simplify configuration a bit.
4802 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
4803 and m4/wint_t.m4, as they are needed with the latest gnulib.
4805 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
4807 Disable unset/unused mid-rule value warnings by default, and recognize
4808 --warnings=midrule-values to enable them. Discussed starting at
4809 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
4810 * NEWS (2.3a+): Mention.
4811 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
4812 warnings): Add entry for midrule-values subargument.
4813 * src/reader.c (symbol_should_be_used): Don't return true just because
4814 the value is a set/used mid-rule value unless
4815 --warnings=midrule-values was specified.
4816 * tests/input.at (Unused values, Unused values before symbol
4817 declarations): Run tests with and without --warnings=midrule-values.
4819 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
4820 than LIST_FREE directly.
4822 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
4824 Finish implementing --warnings=error, which should not be implied by
4825 --warnings=all (or by its synonyms -W and --warnings without
4827 * src/complain.c (set_warning_issued): New function to report that
4828 warnings are being treated as errors and to record an error if so.
4830 (warn_at, warn): ... here.
4831 * src/getargs.c (warnings_args, warnings_types): Reorder so that
4832 "error - warnings are errors" does not appear above "all - all of the
4834 (getargs): For -W and --warnings without subarguments, don't let
4835 FLAGS_ARGMATCH set warnings_error in warnings_flag.
4836 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
4838 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
4840 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
4841 empty subargument list. For example: `bison --warnings= parser.y'.
4843 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4845 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
4846 the parser header file so that gcc doesn't warn.
4848 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4850 Split the default %destructor/%printer into two kinds: <*> and <!>.
4851 Discussed starting at
4852 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
4853 * NEWS (2.3a+): Mention.
4854 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
4855 previous change today related to mid-rules.
4856 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
4857 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
4858 (TYPE_TAG_ANY): Add as <*>.
4859 (TYPE_TAG_NONE): Add as <!>.
4860 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
4862 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
4863 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
4864 * src/symlist.c (symbol_list_default_new): Split into tagged and
4866 (symbol_list_destructor_set, symbol_list_printer_set): Split
4867 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
4868 SYMLIST_DEFAULT_TAGLESS.
4869 * src/symlist.h: Update symbol_list_default*_new prototypes.
4870 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
4871 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
4872 * src/symtab.c (default_destructor, default_destructor_location,
4873 default_printer, default_printer_location): Split each into tagged and
4875 (symbol_destructor_get, symbol_destructor_location_get,
4876 symbol_printer_get, symbol_printer_location_get): Implement tagged
4877 default and tagless default cases.
4878 (default_destructor_set, default_printer_set): Split each into tagged
4879 and tagless versions.
4880 * src/symtab.h: Update prototypes.
4881 * tests/actions.at (Default %printer and %destructor): Rename to...
4882 (Default tagless %printer and %destructor): ... this, and extend.
4883 (Per-type %printer and %destructor): Rename to...
4884 (Default tagged and per-type %printer and %destructor): ... this, and
4886 (Default %printer and %destructor for user-defined end token): Extend.
4887 (Default %printer and %destructor are not for error or $undefined):
4889 (Default %printer and %destructor are not for $accept): Update.
4890 (Default %printer and %destructor for mid-rule values): Extend.
4891 * tests/input.at (Default %printer and %destructor redeclared): Extend.
4892 (Unused values with default %destructor): Extend.
4894 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4896 Don't apply the default %destructor/%printer to an unreferenced midrule
4898 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
4899 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
4900 like $@n instead of just @n so that the default %destructor/%printer
4901 logic doesn't see them as user-defined symbols.
4902 (symbol_is_dummy): Check for both forms of the name.
4903 * src/reader.c (packgram): Remove the `$' from each midrule symbol
4904 name for which the midrule value is referenced in any action.
4905 * tests/actions.at (Default %printer and %destructor for mid-rule
4907 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
4908 for change to dummy symbol names.
4910 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
4912 Warn about unset midrule $$ if the corresponding $n is used.
4913 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
4915 (packgram): Before invoking grammar_rule_check on any rule, make sure
4916 all actions have already been scanned in order to set `used' flags.
4917 Otherwise, checking that a midrule's $$ is set will not always work
4918 properly because the midrule check must forward-reference the midrule's
4920 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
4923 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
4925 More improvements to the documentation of the prologue alternatives:
4926 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
4928 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
4929 some text to clarify the relative importance of the new directives and
4930 to show how these directives may be viewed as code labels.
4932 2006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
4934 Similar to the recently removed %before-header, add %code-top as the
4935 alternative to the pre-prologue. Mentioned at
4936 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
4937 Also, let the prologue alternatives appear in the grammar section.
4938 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
4939 (prologue_declaration): Move the existing prologue alternatives to...
4940 (grammar_declaration): ... here and add %code-top.
4941 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
4943 Clean up and extend documentation for the prologue alternatives.
4944 * NEWS (2.3a+): Describe prologue alternatives.
4945 * doc/bison.texinfo (Prologue): Move discussion of prologue
4947 (Prologue Alternatives): ... this new section, and extend it to discuss
4948 all 4 directives in detail.
4949 (Table of Symbols): Clean up discussion of prologue alternatives and
4952 2006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4954 DJGPP specific issues.
4956 * djgpp/config.bat: config.hin has been moved to lib. Adjust
4957 config.bat accordingly.
4958 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
4959 * djgpp/config.site: Likewise.
4961 2006-10-16 Paolo Bonzini <bonzini@gnu.org>
4963 Replace %*-header with %provides, %requires, %code. See discussion at
4964 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
4966 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
4967 (b4_user_start_header): Remove.
4968 * data/glr.c: Use new macros instead of b4_*start_header
4970 * data/glr.cc: Likewise.
4971 * data/lalr1.cc: Likewise.
4972 * data/push.c: Likewise.
4973 * data/yacc.c: Likewise.
4975 * doc/bison.texinfo: Remove %before-header, rename
4976 %{start,end,after}-header to %requires, %provides, %code.
4978 * src/parse-gram.y: Likewise (also rename token names accordingly).
4979 * src/scan-gram.l: Likewise.
4980 * tests/actions.at: Likewise.
4982 2006-10-14 Paul Eggert <eggert@cs.ucla.edu>
4984 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
4985 Problem reported by Joel E. Denny.
4987 2006-10-14 Jim Meyering <jim@meyering.net>
4989 (Sync from coreutils.)
4990 Work also when the working directory (with e.g. coreutils sources)
4991 is version controlled with git, rather than CVS.
4992 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
4994 In messages and comments, say e.g., "checked-out sources",
4995 rather than "CVS sources".
4996 (version_controlled_file): New function. Work for git as well as
4997 for CVS. Don't use grep's -q option.
4998 (slurp): Call it here, in place of CVS-specific code.
5000 2006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
5002 Fix testsuite for ./configure --enable-gcc-warnings:
5003 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
5004 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
5005 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
5006 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
5007 * test/regression.at (Diagnostic that expects two alternatives):
5010 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
5012 * bootstrap.conf (gnulib_modules): Add config-h.
5013 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
5014 worry about HAVE_CONFIG_H.
5015 * lib/abitset.c: Likewise.
5016 * lib/bitset.c: Likewise.
5017 * lib/bitset_stats.c: Likewise.
5018 * lib/bitsetv-print.c: Likewise.
5019 * lib/bitsetv.c: Likewise.
5020 * lib/ebitset.c: Likewise.
5021 * lib/get-errno.c: Likewise.
5022 * lib/lbitset.c: Likewise.
5023 * lib/subpipe.c: Likewise.
5024 * lib/timevar.c: Likewise.
5025 * lib/vbitset.c: Likewise.
5026 * lib/bitset.c: Include "bitset.h" first, to test interface.
5027 * lib/bitset_stats.c: Include "bitset_stats.h" first.
5028 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
5029 * lib/bitsetv.c: Include "bitsetv.h" first.
5030 * lib/get-errno.c: Include "get-errno.h" first.
5031 * m4/.cvsignore: Add config-h.m4.
5032 * tests/actions.at (Default %printer and %destructor for ...):
5033 Adjust expected line numbers in output to reflect removal of #if
5034 HAVE_CONFIG_H lines.
5035 * tests/glr-regression.at (Missed %merge type warnings when ...):
5037 * tests/regression.at (Braced code in declaration in rules section):
5039 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
5040 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
5041 Include <config.h> unconditionally.
5043 * bootstrap: Sync from coreutils, as follows:
5045 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
5047 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
5048 variable was sometimes used without being initialized. This
5049 messed up the installation of the INSTALL file in some cases.
5051 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
5053 * bootstrap (usage, main program, symlink_to_gnulib): Add option
5054 --copy. Inspired by a suggestion from Bruno Haible.
5056 2006-10-03 Jim Meyering <jim@meyering.net>
5058 * bootstrap: Undo last change to this file, since now gnulib-tool
5059 sticks with the automake default in generating dependencies.
5061 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
5063 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
5064 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
5066 * doc/bison.1: Add copyright notice.
5068 * data/glr.c: Don't include <stdarg.h>; not used.
5070 * NEWS: The -g and --graph options now output graphs in Graphviz
5071 DOT format, not VCG format.
5072 * doc/bison.1: Likewise.
5073 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
5074 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
5076 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
5077 * TODO: Remove Graphviz entry.
5078 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
5079 remove vcg.c, vcg.h, vcg_defaults.h.
5080 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
5081 * src/graphviz.c, src/graphviz.h: New files.
5082 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
5083 * src/files.h: Make comment more generic.
5084 * src/main.c (main): Likewise.
5085 * src/print_graph.h: Likewise.
5086 * src/getargs.c (usage): Make usage description more generic.
5087 * src/print_graph.c: Include graphviz.h rather than vcg.h.
5088 (static_graph, fgraph): Remove. All uses changed to pass
5089 arguments instead of sharing a static var.
5090 (print_core, print_actions, print_state, print_graph):
5091 Output graphviz format rather than VCG format.
5092 * tests/.cvsignore: Remove *.vcg; add *.dot.
5093 * tests/output.at: Expect *.dot files, not *.vcg files.
5095 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
5096 accommodates the 2006-10-08 change.
5098 2006-10-11 Bob Rossi <bob@brasko.net>
5100 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
5101 (b4_yyssa, b4_yyerror_range): New macros.
5102 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
5103 (yypvarsinit): Remove init of removed fields.
5104 (yypushparse): Remove use of removed fields; use new macros instead.
5106 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
5108 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
5109 in a push parser. Reindent slightly to match yacc.c better.
5111 2006-10-11 Bob Rossi <bob@brasko.net>
5113 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
5115 (yypvarsinit, yypushparse): Remove init of removed fields.
5116 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
5118 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
5120 * THANKS: Add Paolo Bonzini and Bob Rossi.
5122 2006-10-08 Paolo Bonzini <bonzini@gnu.org>
5124 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
5125 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
5126 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
5127 b4_define_user_cde and uses): Remove.
5128 (b4_comment, b4_prefix, b4_sync_start): New.
5129 * data/bison.m4: New file, with most of the content removed from c.m4.
5130 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
5131 * src/output.c (output_skeleton): Pass bison.m4.
5132 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
5135 2006-10-05 Paul Eggert <eggert@cs.ucla.edu>
5137 Fix test failure reported by Tom Lane in
5138 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
5139 and try to make such failures easier to catch in the future.
5140 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
5141 that's now the caller's responsibility.
5142 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
5143 Set yychar = YYEOF if it's negative.
5144 * tests/actions.at (yylex): Abort if asked to read past EOF.
5145 * tests/conflicts.at (yylex): Likewise.
5146 * tests/cxx-type.at (yylex): Likewise.
5147 * tests/glr-regression.at (yylex): Likewise.
5148 * tests/input.at (yylex): Likewise.
5149 * tests/regression.at (yylex): Likewise.
5150 * tests/torture.at (yylex): Likewise.
5152 2006-10-01 Paul Eggert <eggert@cs.ucla.edu>
5154 Fix problems with translating English-language diagnostics.
5155 * bootstrap: Fix bug introduced in recent bootstrap changes, with
5156 respect to bison-runtime pot generation. The YY_ stuff
5157 wasn't being captured.
5158 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
5159 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
5160 * runtime-po/POTFILES.in: Add data/push.c.
5162 2006-09-29 Paul Eggert <eggert@cs.ucla.edu>
5164 Merge bootstrap changes from coreutils.
5166 2006-09-28 Jim Meyering <jim@meyering.net>
5168 Automatically generated dependencies are important even
5169 when all of the sources in a directory come from gnulib.
5170 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
5171 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
5173 2006-09-23 Jim Meyering <jim@meyering.net>
5175 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
5177 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
5179 * bootstrap: Add support for --force.
5180 (usage): New function. Describe usage less tersely.
5181 (CVS_only_file): New var.
5183 2006-09-21 Paul Eggert <eggert@cs.ucla.edu>
5185 * data/push.c (YYPUSH_MORE): Make it an enum instead.
5186 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
5187 Adjust white space and comments to match GNU style better.
5189 2006-09-20 Bob Rossi <bob@brasko.net>
5191 * data/push.c (yyresult_get): Remove function.
5192 (YYPUSH_MORE): Add #define.
5193 (yypushparse): Modify return value.
5195 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
5197 * stamp-h.in: Remove; no longer needed.
5198 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
5199 Remove config.h, config.hin, intl (no longer created).
5200 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
5203 Sync bootstrap from coreutils, as follows:
5205 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
5207 * bootstrap (symlink_to_gnulib): New function.
5208 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
5209 to copies-of-gnulib.
5210 (cp_mark_as_generated, slurp, gnulib_files):
5211 Avoid making a copy if it's the same as the old version.
5212 (gnulib_files): Add support for this variable (used by Bison).
5214 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
5216 * src/getargs.c (usage): Rework to use conventions similar to
5217 coreutils, to make translation a bit easier and the code a bit
5218 smaller. Problem reported by Tim Van Holder.
5220 2006-09-15 Paul Eggert <eggert@cs.ucla.edu>
5222 Use some of gnulib's new modules, taken from coreutils.
5224 * bootstrap: Sync from coreutils, except add support for gnulib_files.
5225 * bootstrap.conf: New file.
5226 (gnulib_modules): Add configmake, inttypes, unistd.
5227 (XGETTEXT_OPTIONS): Add complain, complain_at,
5228 fatal, fatal_at, warn, warn_at, unexpected_end.
5229 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
5230 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
5232 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
5234 (GNULIB_AUTOCONF_SNIPPET): Remove.
5235 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
5237 * lib/.cvsignore: Add inttypes_.h.
5238 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
5239 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
5240 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
5241 no-longer-necessary initializations.
5242 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
5243 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
5244 use the unistd module.
5245 * src/system.h: Likewise.
5246 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
5247 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
5248 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
5249 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
5250 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
5251 * src/system.h: Include inttypes.h unconditionally, now that we
5252 use the inttypes module. Don't bother to include stdint.h, since
5253 inttypes.h now does that for us.
5254 (LOCALEDIR): Remove, now that we use the configmake module.
5255 * src/getargs.c: Include configmake.h.
5256 * src/main.c: Likewise.
5257 * src/output.c: Likewise.
5258 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
5259 not from $abs_top_builddir, since config.h moved.
5262 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
5263 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
5265 * src/parse-gram.y (symbol_declaration): Don't put statements
5266 before declarations; it's not portable to C89.
5267 * src/scan-code.l (handle_action_at): Likewise.
5269 * src/scan-code.l: Always initialize braces_level; the old code
5270 left it uninitialized and therefore had undefined behavior.
5272 Don't attempt to redefine 'assert', since it runs afoul of
5273 systems where standard headers (mistakenly) include <assert.h>.
5274 Instead, define and use our own alternative, called 'aver'.
5275 * src/reader.c: Don't include assert.h, since we no longer
5277 * src/scan-code.l: Likewise.
5278 * src/system.h (assert): Remove, replacing with....
5279 (aver): New function, taking a bool arg. All uses changed.
5280 * src/tables.c (pack_vector): Ensure that aver arg is bool,
5281 not merely an integer.
5283 2006-09-15 Bob Rossi <bob@brasko.net>
5285 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
5286 * data/c.m4 (YYPUSH): New.
5287 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
5288 * src/getargs.c (push_parser): New var.
5289 * src/getargs.h (push_parser): New declaration.
5290 * src/output.c (prepare): Add macro insertion of `push_flag'.
5291 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
5292 (prologue_declaration): Parse %push-parser.
5293 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
5294 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
5295 list of removed lines from the traces observed.
5296 (AT_CHECK_CALC_LALR): Added push parser tests.
5298 2006-09-13 Paul Eggert <eggert@cs.ucla.edu>
5300 * NEWS: Version 2.3a.
5301 * configure.ac (AC_INIT): Likewise.
5303 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
5304 "#define YYSTYPE int" that caused "make maintainer-check" to fail
5305 due to header ordering dependencies. I don't know why the #define
5308 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
5309 runtime cost when YYDEBUG is not defined, and so that some tests
5310 that used to fail now work. Problem and initial suggestion by
5312 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
5313 * data/glr.cc (b4_parser_class_name):
5314 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
5315 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
5316 (yydebug_) [YYDEBUG]: New member.
5317 (yycdebug_): Now defined only if YYDEBUG.
5318 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
5319 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
5320 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
5322 (debug_stream, set_debug_stream, debug_level, set_debug_level):
5323 Define only if YYDEBUG.
5324 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
5326 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
5327 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
5328 AT_CHECK_CALC_GLR_CC that are working now.
5330 2006-09-12 Paul Eggert <eggert@cs.ucla.edu>
5332 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
5333 We don't need them in glr.cc, and glr.c defines them.
5334 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
5335 assumes that defining it to anything is the same as defining
5336 it to 1. Problem reported by Paolo Bonzini.
5338 2006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
5340 * data/c.m4 (b4_null, b4_case): Define.
5341 * src/output.c (prepare_symbols): Use b4_null.
5342 (user_actions_output): Use b4_case.
5344 2006-09-11 Paul Eggert <eggert@cs.ucla.edu>
5346 * data/glr.c (b4_shared_declarations): Put start-header first,
5347 before any #includes that we generate, so that feature-test
5348 macros work. Problem reported by Michael Deutschmann in
5349 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
5350 * data/lalr1.cc: Likewise.
5351 * doc/bison.texinfo (Prologue): Document that feature-test macros
5352 should be defined before any Bison declarations.
5353 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
5354 that depend on location.hh after, not before, Bison decls, since
5355 we now include location.hh after the first user prologue.
5357 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
5358 Sander Brandenburg in
5359 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
5360 Also, fix minor white space and comment issues.
5361 (Prologue): Mention that it's better to define feature-test macros
5362 before Bison declarations. Problem reported by Michael Deutschmann.
5364 * README-cvs: Fix typo: "&" should be "&&". Problem reported
5366 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
5367 This adjusts to recent gnulib changes.
5369 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
5371 Finish implementation of per-type %destructor/%printer. Discussed
5373 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
5375 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
5376 * NEWS (2.3+): Add a description of this feature to the default
5377 %destructor/%printer description.
5378 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
5379 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
5380 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
5381 list node contains a semantic type.
5382 * src/symtab.c, src/symtab.h: Extend with a table that associates
5383 semantic types with their %destructor's and %printer's.
5384 (semantic_type_from_uniqstr, semantic_type_get,
5385 semantic_type_destructor_set, semantic_type_printer_set): New functions
5386 composing the public interface of that table.
5387 (symbol_destructor_get, symbol_destructor_location_get,
5388 symbol_printer_get, symbol_printer_location_get): If there's no
5389 per-symbol %destructor/%printer, look up the per-type before trying
5391 * tests/actions.at (Per-type %printer and %destructor): New test case.
5392 * tests/input.at (Default %printer and %destructor redeclared):
5393 Extend to check that multiple occurrences of %symbol-default in a
5394 single %destructor/%printer declaration is an error.
5395 (Per-type %printer and %destructor redeclared, Unused values with
5396 per-type %destructor): New test cases.
5398 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
5400 Require default %destructor/%printer to be declared using
5401 %symbol-default instead of an empty symbol list, and start working on
5402 new per-type %destructor/%printer. Discussed at
5403 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
5404 * NEWS (2.3+): Add %symbol-default to example.
5405 * bison.texinfo (Freeing Discarded Symbols): Likewise.
5406 (Table of Symbols): Add entry for %symbol-default.
5407 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
5408 (generic_symlist, generic_symlist_item): New nonterminals for creating
5409 a list in which each item is a symbol, semantic type, or
5411 (grammar_declaration): Use generic_symlist in %destructor and %printer
5412 declarations instead of symbols.1 or an empty list.
5413 (symbol_declaration, precedence_declaration, symbols.1): Update actions
5414 for changes to symbol_list.
5415 * src/reader.c: Update for changes to symbol_list.
5416 * src/scan-code.l: Likewise.
5417 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
5418 * src/symlist.c, src/symlist.h: Extend such that a list node may
5419 represent a semantic type or a %symbol-default in addition to just an
5420 ordinary symbol. Add switched functions for setting %destructor's and
5422 * tests/actions.at, tests/input.at: Add %symbol-default to all default
5423 %destructor/%printer declarations.
5425 2006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
5427 Whether the default %destructor/%printer applies to a particular symbol
5428 isn't a question of whether the user *declares* that symbol (in %token,
5429 for example). It's a question of whether the user by any means
5430 *defines* the symbol at all (by simply using a char token, for
5431 example). $end is defined by Bison whereas any other token with token
5432 number 0 is defined by the user. The error token is always defined by
5433 Bison regardless of whether the user declares it with %token, but we
5434 may one day let the user define error as a nonterminal instead.
5435 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
5436 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
5437 the meaning of "user-defined".
5438 * tests/actions.at (Default %printer and %destructor for user-declared
5439 end token): Rename to...
5440 (Default %printer and %destructor for user-defined end token): ...
5443 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
5444 computation of whether to apply the default, don't maintain a list of
5445 every Bison-defined symbol. Instead, just check for a first character
5446 of '$', which a user symbol cannot have, and check for the error token.
5448 2006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
5450 Don't apply the default %destructor or %printer to the error token,
5451 $undefined, or $accept. This change fits the general rule that the
5452 default %destructor and %printer are only for user-declared symbols,
5453 and it solves several difficulties that are described in the new test
5455 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
5456 * tests/actions.at (Default %printer and %destructor are not for error
5457 or $undefined, Default %printer and %destructor are not for $accept):
5460 2006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
5462 Allow %start after the first rule.
5463 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
5464 when parsing the first rule.
5465 (check_and_convert_grammar): Search for it here after all grammar
5466 declarations have been parsed. Skip midrules, which have dummy LHS
5468 * src/symtab.c (symbol_is_dummy): New function.
5469 * src/symtab.h (symbol_is_dummy): Declare it.
5470 * tests/input.at (%start after first rule): New test.
5472 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
5474 Redo some of the previous commit: add back the ability to use
5475 non-aliased/undeclared string literals since it might be useful to
5476 those declaring %token-table.
5477 * src/reader.c (check_and_convert_grammar): Undo changes in previous
5478 commit: don't worry about complaints from symbols_pack.
5479 * src/symtab.c (symbol_new, symbol_class_set,
5480 symbol_check_alias_consistency): Undo changes in previous commit: count
5481 each string literal as a new symbol and token, assign it a symbol
5482 number, and don't complain about non-aliased string literals.
5483 (symbols_pack): Since symbol_make_alias still does not decrement symbol
5484 and token counts but does still set aliased tokens to the same number,
5485 symbol_pack_processor now leaves empty slots in the symbols array.
5487 * tests/regression.at (Undeclared string literal): Remove test case
5488 added in previous commit since non-aliased string literals are allowed
5490 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
5491 remove unnecessary string literal declarations.
5492 * tests/sets.at (Firsts): Likewise.
5494 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
5496 Don't allow an undeclared string literal, but allow a string literal to
5497 be used before its declaration.
5498 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
5499 symbols_pack complained.
5500 * src/symtab.c (symbol_new): Don't count a string literal as a new
5502 (symbol_class_set): Don't count a string literal as a new token, and
5503 don't assign it a symbol number since symbol_make_alias does that.
5504 (symbol_make_alias): It's not necessary to decrement the symbol and
5505 token counts anymore. Don't assume that an alias declaration occurs
5506 before any uses of the identifier or string, and thus don't assert that
5507 one of them has the highest symbol number so far.
5508 (symbol_check_alias_consistency): Complain if there's a string literal
5509 that wasn't declared as an alias.
5510 (symbols_pack): Bail if symbol_check_alias_consistency failed since
5511 symbol_pack asserts that every token has been assigned a symbol number
5512 although undeclared string literals have not.
5513 * tests/regression.at (String alias declared after use, Undeclared
5514 string literal): New test cases.
5515 (Characters Escapes, Web2c Actions): Declare string literals as
5517 * tests/sets.at (Firsts): Likewise.
5519 2006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
5521 In the grammar scanner, STRING_FINISH unclosed constructs and return
5522 them to the parser in order to improve error messages.
5523 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
5524 SC_BRACED_CODE, SC_PROLOGUE): Implement.
5525 * tests/input.at (Unclosed constructs): New test case.
5526 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
5529 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
5532 2006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
5534 Handle string aliases for character tokens correctly.
5535 * src/symtab.c (symbol_user_token_number_set): If the token has an
5536 alias, check and set its alias's user token number instead of its own,
5537 which is set to indicate the alias. Previously, every occurrence of
5538 the character token in the grammar overwrote that alias indicator with
5540 * tests/input.at (String aliases for character tokens): New test.
5542 2006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
5544 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
5546 2006-08-11 Paul Eggert <eggert@cs.ucla.edu>
5548 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
5549 to prevent failures when building on older platforms.
5550 Check for autopoint failure.
5551 Set XGETTEXT_OPTIONS to values that check for C format strings,
5552 so that translators are warned about them (this also helps
5553 prevent core dumps).
5555 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
5556 function, since it simplifies our code a bit.
5558 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
5559 rather than -W, so we don't get bogus warnings about sign comparisons.
5560 Add -Wpointer-arith, since that warning is useful (it reports code
5561 that does not conform to C89 and that some compilers reject).
5562 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
5563 since it's no longer needed.
5565 2006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
5567 Clean up scanners a bit.
5568 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
5569 definitions so gcc won't warn when obstack_for_string is unused.
5570 * src/scan-code.l: config.h and system.h are already #include'd by
5571 scan-code-c.c, so get rid of them here.
5572 * src/scan-gram.l: Likewise.
5573 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
5574 definitions rather than duplicating the rest of it.
5575 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
5577 2006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
5579 Suppress signed/unsigned comparison warnings for yycheck.
5580 * data/c.m4 (b4_safest_int_type): New macro.
5581 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
5582 a signed int type, cast it to b4_safest_int_type first.
5583 * data/yacc.c: Likewise.
5584 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
5587 2006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
5589 * doc/bison.texinfo: Fix some typos.
5591 2006-08-02 Paul Eggert <eggert@cs.ucla.edu>
5593 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
5594 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
5596 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
5597 the latest gnulib does this a different way.
5598 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
5599 translation was patched, so stop omitting it.
5601 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
5603 Enable declaration of default %printer/%destructor. Make the parser
5604 use these for all user-declared grammar symbols for which the user does
5605 not declare a specific %printer/%destructor. Thus, the parser uses it
5606 for token 0 if the user declares it but not if Bison generates it as
5607 $end. Discussed starting at
5608 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
5609 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
5611 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
5612 * NEWS (2.3+): Mention.
5613 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
5614 declare a %destructor for a mid-rule's semantic value. It's just
5615 impossible to declare one specific to it.
5616 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
5617 code. Describe default %destructor form.
5618 * src/parse-gram.y (grammar_declaration): Parse default
5619 %printer/%destructor declarations.
5620 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
5621 and symbol_destructor_location_get rather than accessing the destructor
5622 and destructor_location members of struct symbol.
5623 (symbol_printers_output): Likewise but for %printer's.
5624 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
5626 * src/symtab.c (default_destructor, default_destructor_location,
5627 default_printer, default_printer_location): New static global
5628 variables to record the default %destructor and %printer.
5629 (symbol_destructor_get, symbol_destructor_location_get,
5630 symbol_printer_get, symbol_printer_location_get): New functions to
5631 compute the appropriate %destructor and %printer for a symbol.
5632 (default_destructor_set, default_printer_set): New functions to set the
5633 default %destructor and %printer.
5634 * src/symtab.h: Prototype all those new functions.
5635 * tests/actions.at (Default %printer and %destructor): New test to
5636 check that the right %printer and %destructor are called, that they're
5637 not called for $end, and that $$ and @$ work correctly.
5638 (Default %printer and %destructor for user-declared end token): New
5639 test to check that the default %printer and %destructor are called for
5640 a user-declared end token.
5641 * tests/input.at (Default %printer and %destructor redeclared, Unused
5642 values with default %destructor): New tests to check related grammar
5643 warnings and errors.
5645 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
5647 Clean up handling of %destructor for the end token (token 0).
5648 Discussed starting at
5649 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
5651 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
5653 Make the skeletons consistent in how they pop the end token and invoke
5655 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
5656 state, which has token number 0, since this would invoke the
5657 %destructor for the end token.
5658 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
5659 until after shifting the end token, or else it won't be popped.
5660 * data/yacc.c (yyparse): Likewise.
5662 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
5663 it's the end token. Upon termination, destroy an unshifted lookahead
5664 even when it's the end token.
5665 * data/lalr1.cc (yy::parser::parse): Likewise.
5666 * data/yacc.c (yyparse): Likewise.
5668 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
5669 value warnings for the end token when the user gives the end token a
5672 * tests/actions.at (Printers and Destructors): Test all the above.
5674 2006-07-24 Paul Eggert <eggert@cs.ucla.edu>
5676 Update to latest gnulib and gettext versions.
5677 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
5679 (gnulib_files): Add m4/warning.m4. Don't worry about files
5680 overwritten by autopoint.
5681 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
5682 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
5684 Don't use autoreconf; instead, invoke autopoint etc. by hand,
5685 so that we can remove the intl files at a better time.
5686 (intl_files_to_remove): Remove aclocal.m4, since it gets
5687 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
5688 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
5689 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
5690 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
5691 Remove datarootdir hack; no longer needed.
5692 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
5693 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
5694 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
5696 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
5697 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
5699 2006-07-20 Paul Eggert <eggert@cs.ucla.edu>
5701 * bootstrap: Adjust to today's change to gnulib-tool by invoking
5702 it with --assume-autoconf='latest-stable'.
5704 2006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
5706 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
5707 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
5709 * src/muscle_tab.h (muscle_grow): Replace the header comments with
5710 those from muscle_tab.c since the old ones are misleading.
5712 2006-07-13 Akim Demaille <akim@epita.fr>
5714 Support %define "KEY" {VALUE}.
5715 * src/scan-code.h, src/scan-code.l (translate_action)
5716 (translate_rule_action, translate_symbol_action, translate_code):
5717 Return char *, not const char *.
5718 * src/parse-gram.y (declaration): Rename as...
5719 (prologue_declaration): this.
5720 (string_content): Remove this nonterminal, use STRING.
5721 (braceless, content, content.opt): New nonterminal.
5723 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
5725 * src/scan-gram.l (getargs.h): Don't include it.
5727 2006-07-12 Paul Eggert <eggert@cs.ucla.edu>
5729 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
5730 rather than a for-loop that declares a local bool variable. This
5731 should work around a compatibility problem with a Cray x1e C++
5732 compiler reported by Hung Nguyen in
5733 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
5734 The for-loop was introduced in the 2004-11-17 change but I don't
5735 know why it was needed.
5737 2006-07-12 Akim Demaille <akim@epita.fr>
5739 * data/c.m4: Comment changes.
5741 2006-07-10 Akim Demaille <akim@lrde.epita.fr>
5743 * src/complain.c (error_message, ERROR_MESSAGE): New.
5745 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
5746 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
5748 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
5750 * NEWS: Instead of %union, you can define and use your own union type
5751 YYSTYPE if your grammar contains at least one <type> tag.
5752 Your YYSTYPE need not be a macro; it can be a typedef.
5753 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
5754 (Union Decl, Decl Summary): Document this.
5755 * data/glr.c (YYSTYPE): Implement this.
5756 * data/glr.cc (YYSTYPE): Likewise.
5757 * data/lalr1.cc (YYSTYPE): Likewise.
5758 * data/yacc.c (YYSTYPE): Likewise.
5759 * src/output.c (prepare): Output tag_seen_flag.
5760 * src/parse-gram.y (declaration, grammar_declaration):
5761 Use 'union_seen' rather than 'typed' to determine whether
5762 %union has been seen, since grammars can now be typed without
5764 (symbol_declaration, type.opt, symbol_def):
5765 Keep track of whether a tag has been seen.
5766 * src/reader.c (union_seen, tag_seen): New vars.
5768 * src/reader.h (union_seen, tag_seen, typed): Likewise.
5769 * src/scan-code.l (untyped_var_seen): New variable.
5770 (handle_action_dollar): Adjust to above changes.
5771 (handle_action_dollar, handle_action_at):
5772 Improve overflow checking for outlandish numbers.
5773 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
5774 avoid new diagnostics generated by above changes.
5775 * tests/regression.at (YYSTYPE typedef): Add test to check
5776 for type tags without %union.
5778 * src/symlist.c (symbol_list_length): Return int, not unsigned
5779 int, since callers expect int. This may need to get revisited
5780 once we have proper integer overflow checking.
5782 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
5783 object is now static.
5785 * src/getargs.c (flags_argmatch): Return void, not int,
5786 to pacify ./configure --enable-gcc-warnings.
5788 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
5789 since last_string is already defined to FLEX_PREFIX (last_string).
5791 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
5793 Implement --warnings/-W.
5794 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
5796 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
5798 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
5799 (warnings_args, warnings_types): New.
5800 (getargs, short_options, long_options): Accept -W/--warnings.
5801 Sort the options by alphabetical order, upper case letter right
5802 before its lower case.
5804 2006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
5806 Change %merge result type clash warnings to errors. Discussed at
5807 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
5808 * src/reader.c (record_merge_function_type): Use complain_at.
5809 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
5810 declared later): Update test case results.
5812 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
5814 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
5815 to be in alphabetical order.
5816 (trace_args): Spelling fixes.
5818 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
5820 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
5821 so they don't collide with user-defined macros.
5822 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
5823 this was never guaranteed, and now that we're using gnulib stdint,
5824 which defines int_fast16_t to long int, the problem is exposed.
5826 2006-07-08 Paul Eggert <eggert@cs.ucla.edu>
5828 * data/c.m4 (b4_basename): Simplify a bit, since we don't
5829 need the full POSIX semantics (and weren't implementing them
5832 Adjust to Autoconf 2.60 and today's gnulib.
5833 * bootstrap (gnulib_modules): Add stdint.
5834 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
5835 no longer copies it.
5836 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
5837 since stdint needs the former and wcwidth (which is now required
5838 by mbswidth) needs the latter.
5839 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
5840 work around a compatibility glitch between gettext 0.14.6 and
5842 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
5843 Do not check for uintptr_t, since new stdint module does the right
5845 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
5846 Add stdint.h, stdint_.h, wcwidth.h.
5847 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
5848 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
5849 stdint.m4, wchar_t.m4, wcwidth.m4.
5850 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
5851 usual order for ../lib/*.h files.
5852 (file_name_split): Use last_component, not base_name, to adjust
5854 * src/parse-gram.h: Include <strverscmp.h> in the usual order
5855 for ../lib/*.h files.
5856 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
5857 Define unconditionally, since we now assume the stdint module.
5858 * src/scan-skel.l: Include <dirname.h>.
5859 (BASE_QPUTS): Use last_component, not base_name.
5860 * src/system.h: Include <unlocked-io.h> in the usual order
5861 for ../lib/*.h files. Include <stdint.h> unconditionally,
5862 since we now use the stdint module.
5863 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
5864 HAVE_UINTPTR_T, since we now use the stdint module.
5865 (base_name): Remove decl, since files now include <dirname.h>
5868 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
5870 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
5872 * data/yacc.c, data/glr.c, data/location.cc: Use them.
5873 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
5875 * tests/calc.at: Adjust.
5877 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
5879 * data/c.m4 (b4_basename): New.
5880 (b4_syncline): Also output the location of its invocation (from
5882 (b4_user_action, b4_define_user_action, b4_user_actions)
5883 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
5884 (b4_user_stype): New.
5885 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
5887 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
5889 In the grammar file, the first column is 1 not 0 on the first line as
5890 on every other line.
5891 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
5892 * tests/input.at (Torturing the Scanner): Update output.
5894 * src/scan-gram.l (scanner_cursor): Declare it static.
5896 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
5898 In warnings, say "previous declaration" rather than "first
5900 * src/symtab.c (redeclaration): Do that here.
5901 * src/reader.c (record_merge_function_type): In the case of a result
5902 type clash, report the previous declaration rather than the very first
5903 one in the grammar file.
5904 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
5905 declared later): Add a third declaration to check this behavior.
5906 * tests/input.at (Incompatible Aliases): Update output.
5908 2006-06-27 Akim Demaille <akim@epita.fr>
5910 * doc/Doxyfile.in: New.
5911 * doc/Makefile.am: Use it.
5912 * src/lalr.h, src/symtab.h: Initial doxygenation.
5914 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
5916 Don't miss %merge result type warnings just because the LHS types are
5917 declared after the %merge. This continues the effort of the previous
5919 * src/reader.c (get_merge_function): Don't set the merger type yet.
5920 (record_merge_function_type): New function for setting the merger type
5921 and checking for clashes.
5922 (grammar_current_rule_merge_set): Set the location of the %merge for
5924 (packgram): Invoke record_merge_function_type for each rule now that
5925 all symbol type declarations have been parsed.
5926 * src/reader.h (merger_list.type_declaration_location): New member
5927 storing the location of the first %merge from which the type for this
5928 merging function was derived.
5929 * src/symlist.h (symbol_list.merger_declaration_location): New member
5930 storing the location of a rule's %merge, if any.
5931 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
5932 declared later): New test to catch the error fixed by the above patch.
5934 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
5936 Get action warnings (grammar_rule_check) right even when symbol
5937 declarations appear after the rules. Discussed at
5938 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
5940 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
5941 Don't mistake the type of $$ in a midrule to be that of its parent
5943 * src/reader.c (grammar_current_rule_end): Don't invoke
5944 grammar_rule_check yet since not all symbol declarations may have been
5946 (grammar_midrule_action): Likewise.
5947 Don't record whether the midrule's $$ has been used yet since actions
5948 haven't been translated yet.
5949 Record the midrule's parent rule and its RHS index within the parent
5951 (grammar_current_rule_action_append): Don't translate the action yet
5952 since not all symbol declarations may have been parsed yet and, thus,
5953 warnings about types for $$, $n, @$, and @n can't be reported yet.
5954 (packgram): Translate the action and invoke grammar_rule_check now that
5955 all symbol declarations have been parsed.
5956 * src/scan-code.l (handle_action_dollar): Now that this is invoked
5957 after parsing the entire grammar file, the symbol list here in the case
5958 of a midrule is actually the midrule's empty RHS, so reference its
5959 parent rule's RHS where necessary.
5960 On the other hand, now that you can already know it's a midrule, you
5961 aren't forced to think $$ has the same type as its parent rule's $$.
5962 (handle_action_at): In the case of a midrule, reference the parent rule
5964 * src/symlist.c (symbol_list_new): Initialize new midrule-related
5966 (symbol_list_length): Now that this is invoked after all rules have
5967 been parsed, a NULL symbol (rather than a NULL symbol list node)
5968 terminates a rule. symbol_list_print already does this correctly.
5969 * src/symlist.h (symbol_list.midrule_parent_rule,
5970 symbol_list.midrule_parent_rhs_index): New members so that midrules can
5971 remember their relationships with their parents.
5972 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
5973 fixed by the above patch.
5974 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
5976 (Unused values): ... this old test case and...
5977 (Unused values before symbol declarations): ... this new test case.
5978 This one is the same as `Unused values' except that all symbol
5979 declarations appear after the rules in order to catch the rest of the
5980 errors fixed by the above patch.
5982 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
5985 * src/reader.c (current_rule): Declare it static since it's no longer
5986 used outside this file.
5987 (grammar_current_rule_action_append): Remove redundant arguments from
5988 translate_rule_action invocation.
5989 * src/reader.h (current_rule): Remove this unused extern.
5990 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
5991 * src/scan-code.l (translate_rule_action): Likewise.
5993 2006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
5995 Clean up yesterday's patch.
5996 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
5998 * src/reader.c (grammar_current_rule_action_append): ... here for
5999 consistency with grammar_current_rule_symbol_append.
6000 * tests/regression.at (Braced code in declaration in rules section):
6001 Make yyerror and yylex static as usual.
6003 2006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
6005 Fix bug that mistakes braced code in a declaration in the rules section
6006 to be a rule action. Mentioned at
6007 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
6008 * src/scan-gram.l: Move midrule action detection from the start of the
6009 scanning of any braced code to...
6010 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
6011 action. For readability, use $2 and @2 rather than the equivalent
6013 * tests/regression.at (Braced code in declaration in rules section):
6014 New test to catch the error fixed by the above patch.
6016 Work on code readability some.
6017 * src/scan-code.l (current_rule): Get rid of this misleading and
6018 redundant declaration: it's actually extern'ed in reader.h.
6019 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
6020 translate_action): Add a rule argument and use it instead of the global
6022 (translate_rule_action): This already receives current_rule through an
6023 argument, so pass it on to translate_action instead of assigning
6024 current_rule to current_rule.
6025 (translate_symbol_action, translate_code): Pass rule = NULL to
6028 2006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
6030 Rename %before-definitions to %start-header and %after-definitions to
6031 %end-header. Don't use these declarations to separate pre-prologue
6032 blocks from post-prologue blocks. Add new order-independent
6033 declarations %before-header and %after-header as alternatives to the
6034 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
6035 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
6036 * NEWS (2.3+): Update for these changes.
6037 * data/glr.c (b4_before_definitions): Update to...
6038 (b4_start_header): ... this.
6039 (b4_after_definitions): Update to...
6040 (b4_end_header): ... this.
6041 * data/glr.cc: Likewise.
6042 * data/lalr1.cc: Likewise.
6043 * data/yacc.c: Likewise.
6044 * doc/bison.texinfo (The prologue): Update names, and replace remaining
6045 prologue blocks with %*-header declarations.
6046 (Calc++ Parser): Likewise.
6047 (Decl Summary): Update names.
6048 (Table of Symbols): Update description.
6049 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
6050 (PERCENT_END_HEADER): ... this.
6051 (PERCENT_BEFORE_DEFINITIONS): Update to...
6052 (PERCENT_START_HEADER): ... this.
6053 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
6054 (declaration): Update token names and m4 macro names.
6055 When parsing %end-header and %start-header, invoke translate_code
6056 before muscle_code_grow, and no longer set global booleans to remember
6057 whether these declarations have been seen.
6058 Parse new %after-header and %before-header.
6059 * src/reader.c (before_definitions, after_definitions): Remove.
6060 (prologue_augment): Accept a new bool argument to specify whether to
6061 augment the pre-prologue or post-prologue.
6062 * src/reader.h (before_definitions, after_definitions): Remove these
6064 (prologue_augment): Add new bool argument.
6065 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
6066 (PERCENT_END_HEADER): ... this.
6067 (PERCENT_BEFORE_DEFINITIONS): Update to...
6068 (PERCENT_START_HEADER): ... this.
6069 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
6070 * tests/actions.at (Printers and Destructors): Update names.
6072 2006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
6074 Add comparison operators for C++ location classes. Discussed at
6075 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
6076 * data/c++.m4 (b4_define_location_comparison): New boolean %define
6077 declaration indicating whether filename_type has an operator==. If
6078 filename_type is `std::string', it defaults to `1', `0' otherwise.
6079 * data/location.cc: Iff b4_define_location_comparison is `1', add
6080 operator== and operator!= for class position and for class location.
6083 * src/scan-action.l: Remove unused file.
6084 * src/symtab.c (symbol_printer_set): Use printer_location not
6085 destructor_location.
6086 * src/symtab.h (struct symbol): Replace incorrect source comment for
6088 * tests/input.at (Incompatible Aliases): Update output with correct
6091 2006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
6093 Don't put the pre-prologue in the header file. For the yacc.c code
6094 file and the glr.c header and code files, move the pre-prologue before
6095 the token definitions. Add new %before-definitions and
6096 %after-definitions to declare code that will go in both the header file
6097 and code file. Discussed at
6098 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
6099 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
6101 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
6102 * NEWS (2.3+): Describe these changes.
6103 * data/glr.c (b4_pre_prologue): Move from within to before...
6104 (b4_shared_declarations): ... this.
6105 Add new b4_before_definitions before b4_token_enums.
6106 Add new b4_after_definitions at the end.
6107 * data/glr.cc (b4_pre_prologue): Replace with...
6108 (b4_before_definitions): ... this in the header file.
6109 (b4_after_definitions): New near the end of the header file.
6110 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
6111 code file right before including the header file.
6112 (b4_before_definitions): New in the previous position of
6113 b4_pre_prologue in the header file.
6114 (b4_after_definitions): New near the end of the header file.
6115 * data/yacc.c: Clean up some m4 quoting especially in the header file.
6116 (b4_token_enums_defines): In the code file, move to right before
6117 YYSTYPE for consistency with the header file.
6118 (b4_before_definitions): New right before b4_token_enums_defines in
6119 both the header and code file.
6120 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
6121 header and code file.
6122 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
6123 of prologues for %union dependencies.
6124 (Decl Summary): In %defines description, mention the effect of
6125 %before-definitions and %after-definitions on the header file.
6126 (Calc++ Parser): Forward declare driver in a %before-definitions rather
6127 than in the pre-prologue so that make check succeeds.
6128 (Table of Symbols): Add entries for %before-definitions and
6130 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
6131 %before-definitions.
6132 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
6133 (declaration): Parse those declarations and append to
6134 b4_before_definitions and b4_after_definitions, respectively.
6135 * src/reader.c (before_definitions, after_definitions): New bools to
6136 track whether those declarations have been seen.
6137 (prologue_augment): Add to the post-prologue if %union,
6138 %before-definitions, or %after-definitions has been seen.
6139 * src/reader.h (before_definitions, after_definitions): New extern's.
6140 * src/scan-gram.l: Scan the new declarations.
6141 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
6142 prologue block in a %before-definitions or a %after-definitions based
6143 on whether the %union is declared.
6144 * tests/regression.at (Early token definitions with --yacc, Early token
6145 definitions without --yacc): Move tests for token definitions into the
6146 post-prologue since token names are no longer defined in the
6149 2006-06-20 Akim Demaille <akim@epita.fr>
6151 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
6152 (symbol_get): Use it.
6153 * src/parse-gram.y: Use it.
6155 2006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
6157 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
6158 build succeeds when configured with --enable-gcc-warnings.
6160 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
6162 * src/parse-gram.y (char_name): New function.
6163 (CHAR, STRING, string_content): For %printer, properly escape.
6164 (ID): Prefer fputs to fprintf.
6165 (id): Reindent to be consistent with other rules.
6166 Properly quote char.
6168 The Translation Project changed its way of publishing translations
6169 to maintainers. I haven't received any responses to my request
6170 for supporting the old way, or for documenting the new way. I
6171 have modified 'bootstrap' to use screen scraping
6172 (in this case, HTML scraping). This is unreliable and inelegant,
6173 but I don't see any better way. Yuck.
6174 * bootstrap (TP_URL, WGET_COMMAND): New vars.
6175 (get_translations): New function, which uses HTML scraping to
6176 deduce locations of latest translations.
6177 Use this function to grab both bison and bison-runtime .po files.
6178 Don't bother priming the pump for the runtime-po domain any more,
6179 as it's now translated better than bison is.
6181 2006-06-19 Akim Demaille <akim@epita.fr>
6183 * src/scan-gram.l: No longer "parse" things after `%union' until
6184 `{'. Rather, return a single "%union" token.
6185 No longer make symbols: return strings, and leave the conversion
6186 to symbols to the parser.
6187 (SC_PRE_CODE, token_type): Remove.
6188 * src/parse-gram.y (%union): New field `character'.
6191 (ID, ID_COLON): Now that the scanner no longer makes them
6192 identifiers, adjust all uses to invoke symbol_get.
6193 (id_colon): New, wraps the conversion from string to symbol.
6194 (%union): Accept a possible union_name.
6195 (symbol): Now can be a char.
6196 * data/c.m4 (b4_union_name): Leave a default value.
6197 * data/glr.c, data/yacc.c: Use it.
6199 2006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
6201 For associating token numbers with token names for "yacc.c", don't use
6202 #define statements unless `--yacc' is specified; always use enum
6203 yytokentype. Most important discussions start at:
6204 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
6205 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
6207 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
6208 * NEWS (2.3+): Mention.
6209 * data/c.m4 (b4_yacc_if): New.
6210 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
6212 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
6213 on token name definitions.
6214 * src/getargs.c (usage): Capitalize `Yacc' in English.
6215 * src/output.c (prepare): Define b4_yacc_flag.
6216 * tests/regression.at (Early token definitions): Test that tokens names
6217 are defined before the pre-prologue not just before the post-prologue.
6218 Remove this test case and copy to...
6219 (Early token definitions with --yacc): ... this to test #define's.
6220 (Early token definitions without --yacc): ... and this to test enums.
6222 2006-06-11 Paul Eggert <eggert@cs.ucla.edu>
6224 * NEWS: Reword the post-2.3 change to not be so optimistic about
6225 removing the old "look-ahead" spelling.
6226 Update previous look-ahead/lookahead change reports.
6227 * REFERENCES: look-ahead -> lookahead (since that's
6228 what he actually wrote).
6229 * doc/refcard.tex: look ahead -> lookahead,
6230 look-ahead -> lookahead
6232 2006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
6234 For consistency, use `lookahead' instead of `look-ahead' or
6235 `look_ahead'. Discussed starting at
6236 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
6238 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
6239 * NEWS: For the next release, note the change to `--report'.
6240 * TODO, doc/bison.1: Update English.
6241 * doc/bison.texinfo: Update English.
6242 (Understanding Your Parser, Bison Options): Document as
6243 `--report=lookahead' rather than `--report=look-ahead'.
6244 * src/conflicts.c: Update English in comments.
6245 (lookahead_set): Rename from look_ahead_set.
6246 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
6247 (resolve_sr_conflict): Rename local look_ahead_tokens to
6248 lookahead_tokens, and update other uses.
6249 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
6250 count_rr_conflicts, conflicts_free): Update uses.
6251 * src/getargs.c (report_args): Move "lookahead" before alternate
6253 (report_types): Update uses.
6254 (usage): For `--report' usage description, state `lookahead' spelling
6255 rather than `look-ahead'.
6256 * src/getargs.h (report.report_lookahead_tokens): Rename from
6257 report_look_ahead_tokens.
6258 * src/lalr.c: Update English in comments.
6259 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
6260 (state_lookahead_tokens_count): Rename from
6261 state_look_ahead_tokens_count.
6262 Rename local n_look_ahead_tokens to n_lookahead_tokens.
6263 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
6264 Rename local n_look_ahead_tokens to n_lookahead_tokens.
6266 Update English in output.
6267 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
6268 * src/print.c: Update English in comments.
6269 (lookahead_set): Rename from look_ahead_set.
6270 (print_reduction): Rename argument lookahead_token from
6272 (print_core, state_default_rule, print_reductions, print_results):
6274 * src/print_graph.c: Update English in comments.
6275 (print_core): Update uses.
6276 * src/state.c: Update English in comments.
6277 (reductions_new): Update uses.
6278 (state_rule_lookahead_tokens_print): Rename from
6279 state_rule_look_ahead_tokens_print, and update other uses.
6280 * src/state.h: Update English in comments.
6281 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
6282 (state_rule_lookahead_tokens_print): Rename from
6283 state_rule_look_ahead_tokens_print.
6284 * src/tables.c: Update English in comments.
6285 (conflict_row, action_row): Update uses.
6286 * tests/glr-regression.at
6287 (Incorrect lookahead during deterministic GLR,
6288 Incorrect lookahead during nondeterministic GLR): Rename
6289 print_look_ahead to print_lookahead.
6290 * tests/torture.at: Update English in comments.
6291 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
6292 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
6293 (Many lookahead tokens): Update uses.
6294 * data/glr.c: Update English in comments.
6295 * lalr1.cc: Likewise.
6297 * src/conflicts.h: Likewise.
6298 * src/lalr.h: Likewise.
6299 * src/main.c: Likewise.
6300 * src/output.c: Likewise.
6301 * src/parse-gram.c: Likewise.
6302 * src/tables.h: Likewise.
6303 * tests/calc.at: Likewise.
6305 2006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
6307 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
6309 2006-06-07 Paul Eggert <eggert@cs.ucla.edu>
6311 * TODO: Add request from Nelson H. F. Beebe to be able to install
6312 Bison without installing the yacc script.
6314 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
6316 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
6317 and yytext if they're already #define'd.
6318 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
6319 * src/scan-code-c.c: ... here.
6320 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
6323 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
6325 Get Bison to build again when configured with --enable-gcc-warnings.
6326 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
6328 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
6329 loc argument as it shadows a global.
6330 * src/scan-gram.l: Remove stray comma that prevents boundary_set
6333 * src/.cvsignore: Add scan-code.c.
6335 2006-06-07 Akim Demaille <akim@epita.fr>
6337 * src/scan-gram.l: Move the "add a trailing ; to actions" code
6339 * src/scan-code.l: here.
6340 * tests/input.at (Torturing the Scanner): Fix another location
6343 2006-06-07 Akim Demaille <akim@epita.fr>
6345 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
6347 2006-06-06 Akim Demaille <akim@epita.fr>
6349 Extract the parsing of user actions from the grammar scanner.
6350 As a consequence, the relation between the grammar scanner and
6351 parser is much simpler. We can also split "composite tokens" back
6353 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
6354 * src/scan-gram.l (add_column_width, adjust_location): Move to and
6356 * src/location.h, src/location.c (add_column_width)
6357 (location_compute): these.
6358 Fix the column count: the initial column is 0.
6359 (location_print): Be robust to ending column being 0.
6360 * src/location.h (boundary_set): New.
6361 * src/main.c: Adjust to scanner_free being renamed as
6363 * src/output.c: Include scan-code.h.
6364 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
6366 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
6367 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
6368 which is now, again, a separate token.
6369 Adjust all dependencies.
6370 Whereever actions with $ and @ are used, use translate_code.
6371 (action): Remove this nonterminal which is now useless.
6372 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
6373 (grammar_current_rule_action_append): Use translate_code.
6374 (packgram): Bound check ruleno, itemno, and rule_length.
6375 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
6376 (last_string, last_braced_code_loc, max_left_semantic_context)
6377 (scanner_initialize, scanner_free, scanner_last_string_free)
6378 (gram_out, gram_lineno, YY_DECL_): Move to...
6379 * src/scan-gram.h: this new file.
6380 (YY_DECL): Rename as...
6382 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
6383 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
6384 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
6385 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
6386 Move these declarations, and...
6387 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
6389 * src/flex-scanner.h: this new file.
6390 * src/scan-gram.l (rule_length, rule_length_overflow)
6391 (increment_rule_length): Remove.
6392 (last_braced_code_loc): Rename as...
6393 (gram_last_braced_code_loc): this.
6394 Adjust to the changes of the parser.
6395 Move all the handling of $ and @ into...
6396 * src/scan-code.l: here.
6397 * src/scan-gram.l (handle_dollar, handle_at): Remove.
6398 (handle_action_dollar, handle_action_at): Move to...
6399 * src/scan-code.l: here.
6400 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
6401 scan-code.h, scan-code-c.c, scan-gram.h.
6402 (EXTRA_bison_SOURCES): Add scan-code.l.
6403 (BUILT_SOURCES): Add scan-code.c.
6404 (yacc): Be robust to white spaces.
6406 * tests/conflicts.at, tests/input.at, tests/reduce.at,
6407 * tests/regression.at: Adjust the column numbers.
6408 * tests/regression.at: Adjust the error message.
6410 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
6412 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
6413 Use Akim's wording from
6414 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
6416 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
6418 Between Bison releases, manually append `+' to the previous Bison
6419 release number, and use that as a signal to automatically print the
6420 ChangeLog's CVS Id keyword from --version. Discussed starting at
6421 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
6422 * ChangeLog: Add Id header.
6423 * configure.ac (AC_INIT): Append `+' to `2.3'.
6424 * src/.cvsignore: Add revision.c.
6425 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
6426 (BUILT_SOURCES): Add revision.c.
6427 (revision.c): New target rule. This file defines a new global variable
6428 named revision. It initializes it with either the Id from ChangeLog
6429 or, if VERSION doesn't contain `+', with the empty string.
6430 * src/getargs.c (version): Print the value of revision.
6431 * src/revision.h: Extern revision.
6433 2006-06-05 Paul Eggert <eggert@cs.ucla.edu>
6435 * NEWS: Version 2.3.
6436 * configure.ac (AC_INIT): Likewise.
6438 2006-05-30 Paul Eggert <eggert@cs.ucla.edu>
6440 * data/glr.c (YYRECOVERING): Define to be a function-like macro
6441 with no arguments, not as an object-like macro. This is for
6442 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
6443 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
6444 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
6447 2006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
6449 * src/getargs.c (usage): Back out yesterday's modification of the
6450 --help output so that we don't have to wait for translation before
6453 2006-05-29 Paul Eggert <eggert@cs.ucla.edu>
6455 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
6456 Problem reported by Akim Demaille.
6458 2006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
6460 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
6462 2006-05-26 Paul Eggert <eggert@cs.ucla.edu>
6464 * data/yacc.c (yy_reduce_print): Omit trailing white space in
6465 generated source code. Problem reported by Frans Englich in
6466 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
6468 2006-05-22 Paul Eggert <eggert@cs.ucla.edu>
6470 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
6471 shell, not within 'make', so that 'make' by an ordinary builder
6472 (using GNU make) does not worry about configuring gzip. This also
6473 works around a bug reported independently by Keith Thompson and by
6474 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
6475 stderr rather than stdout, messing up the build logs.
6477 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
6479 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
6480 to make sure that YYID will never be unused. This fixes a 'make
6481 maintainer-check' failure caused by the recent changes to the 'Trivial
6482 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
6484 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
6486 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
6488 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
6489 state before an empty RHS is always resolved here. Only the location
6490 of that state is guaranteed to be resolved, and that's enough. This
6491 fixes the remaining bug reported by Derek M. Jones in
6492 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
6493 * tests/glr-regression.at (Uninitialized location when reporting
6494 ambiguity): Test the above case.
6495 Also, the embedded comments in this test case claim it checks the case
6496 of an empty RHS that has inherited the initial location. However, the
6497 corresponding LHS was already resolved, so yyresolveLocations didn't
6498 actually have reason to modify it. Fix this by forcing
6499 nondeterministic operation at the beginning of the parse.
6501 2006-05-20 Paul Eggert <eggert@cs.ucla.edu>
6503 * data/c.m4 (b4_yy_symbol_print_generate):
6504 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
6505 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
6506 of the bugs reported today by Derek M Jones in
6507 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
6508 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
6509 defined to be a type name without parens or brackets.
6510 (Location Type): Similarly for YYLTYPE.
6511 * tests/regression.at (Trivial grammars): Put in a test for this
6512 bug that will be caught by 'make maintainer-check' (though not,
6513 alas, by 'make check' unless your compiler is picky).
6515 2006-05-19 Paul Eggert <eggert@cs.ucla.edu>
6517 * NEWS: Version 2.2.
6518 * configure.ac (AC_INIT): Likewise.
6520 2006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
6522 * data/glr.c (yyreportTree): Make room in yystates for the state
6523 preceding the RHS. This fixes the segmentation fault reported by Derek
6525 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
6526 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
6527 to the user. Reported for yyreportTree by Derek M. Jones later in the
6529 * THANKS: Add Derek M. Jones.
6530 Update my email address.
6531 Fix typo in Steve Murphy's name.
6533 2006-05-14 Paul Eggert <eggert@cs.ucla.edu>
6535 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
6536 checking against YYLAST that caused the parser to miss a potential
6537 alternative in its diagnostic.
6538 Problem reported by Maria Jose Moron Fernandez in
6539 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
6540 * data/lalr1.cc (yysyntax_error_): Likewise.
6541 * data/yacc.c (yysyntax_error): Likewise.
6542 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
6543 tokens, in case we run into an older C compiler.
6544 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
6545 Use them to check for the off-by-one error fixed above.
6547 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
6548 YYSIZE_T, not size_t.
6549 * tests/regression.at (Trivial grammars): New test, to catch
6550 the error fixed by the above patch.
6552 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
6554 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
6556 Reported by Steve Murphy.
6558 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
6560 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
6561 * data/glr.cc: b4_location_flag is now b4_locations_flag.
6563 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
6565 Implement --trace=m4.
6566 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
6567 * src/output.c (output_skeleton): When set, pass -dV to m4.
6569 Factor the handling of flags in m4.
6570 * src/output.c (prepare): Rename the muscle names debug, defines,
6571 error_verbose to debug_flag, defines_flag, error_verbose_flag.
6572 * data/c.m4: Adjust.
6573 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
6574 Use b4_define_flag_if to define other b4_FLAG_if macros.
6575 (b4_location_if): As a consequence, rename as...
6576 (b4_locations_if): this, for consistency.
6577 Adjust all the skeletons.
6579 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
6581 * etc/bench.pm: Shorten bench names.
6583 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
6585 * src/output.h, src/output.c (error_verbose): Move to...
6586 * src/getargs.h, src/getargs.c: here.
6588 Adjust dependencies.
6590 2006-05-13 Paul Eggert <eggert@cs.ucla.edu>
6592 * data/c.m4 (b4_copyright): Put the special exception for Bison
6593 skeletons here, so we don't have to put it in each skeleton. All
6594 uses changed. Suggested by Akim Demaille. Also, wrap the
6595 copyright notice, in case it is longer than 80 columns. Replace
6596 comma by newline after title.
6598 2006-05-11 Paul Eggert <eggert@cs.ucla.edu>
6600 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
6601 incompatibility, not a bug. Mention that it wasn't fixed as of
6604 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
6606 * examples/extexi: Enforce the precedence of concatenation over
6608 Reported by Tommy Nordgren.
6610 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
6612 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
6613 with the member "token".
6614 Reported by Martin Nylin.
6616 2006-05-08 Paul Eggert <eggert@cs.ucla.edu>
6618 * data/glr.c: Switch to Bison 2.2 special-exception language in
6619 the copyright notice. Use more-regular format for titles and
6621 * data/glr.cc: Likewise.
6622 * data/location.cc: Likewise.
6623 * data/yacc.cc: Likewise.
6624 * doc/bison.texinfo (Conditions): Document this.
6625 * NEWS: likewise. Upgrade version to 2.2.
6627 2006-04-27 Akim Demaille <akim@lrde.epita.fr>
6629 * data/glr.cc: Remove dead code.
6631 2006-04-25 Paul Eggert <eggert@cs.ucla.edu>
6633 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
6634 that variable and the line breaks the bootstrap. Problem reported
6635 by Juan M. Guerrero.
6637 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
6639 * doc/bison.texinfo (Multiple start-symbols): New.
6641 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
6643 * etc/README, etc/bench.pl: New.
6645 2006-04-03 Akim Demaille <akim@lrde.epita.fr>
6647 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
6649 Reported by Mickael Labau.
6650 * tests/input.at (Torturing the Scanner): Test it.
6652 2006-03-16 Paul Eggert <eggert@cs.ucla.edu>
6654 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
6655 Problem reported by Bob Rossi.
6657 2006-03-13 Paul Eggert <eggert@cs.ucla.edu>
6659 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
6660 and didn't really work.
6661 For the index, use @ifnotinfo, not @iftex.
6662 Minor cleanups of spacing and terminology.
6664 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
6666 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
6667 of AT_NAME_PREFIX when %name-prefix is not used.
6669 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
6671 Apply --prefix to C++ skeletons too: they change the namespace.
6672 The test suite already exercize these cases.
6673 * data/c++.m4 (b4_namespace): New.
6674 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
6675 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
6676 * data/yacc.c, data/glr.c: Remove a useless `[]'.
6677 * doc/bison.texinfo: Document it.
6678 (Option Cross Key): Use @multitable in all formats. It looks
6679 nicer, even in TeX outputs.
6680 (Rules): Use the same code whatever the output type is.
6681 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
6682 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
6683 * tests/calc.at: Use it, instead of hard coding `yy'.
6685 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
6687 * TODO: Remove dead items.
6689 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
6691 * doc/FAQ: Remove, merged into...
6692 * doc/bison.texinfo (FAQ): this.
6693 * doc/Makefile.am (EXTRA_DIST): Adjust.
6695 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
6697 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
6699 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
6700 * doc/bison.texinfo (Calc++ Scanner): Use it.
6702 2006-03-09 Paul Eggert <eggert@cs.ucla.edu>
6704 Fix two nits reported by twlevo, plus one more that I discovered.
6706 * src/assoc.h (assoc_to_string): Give a name to the arg, as
6707 this is the usual Bison style.
6708 * src/location.h (location_print): Likewise.
6710 * src/reader.h (token_name): Likewise.
6712 2006-03-08 Paul Eggert <eggert@cs.ucla.edu>
6714 Fix some nits reported by twlevo.
6715 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
6716 and "POSIX". Use more-modern syntax for URLs. Mention C++
6717 and ask for Java. Don't hardwire OS version numbers. Add
6719 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
6720 * src/conflicts.c (solved_conflicts_obstack): Now static.
6722 2006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
6724 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
6725 page. Say "you can use it" not "you may use it" as on the web page;
6726 we're describing capabilities not granting permission.
6728 2006-03-06 Paul Eggert <eggert@cs.ucla.edu>
6730 * data/glr.c (yyresolveLocations): Rename local variables to avoid
6731 shadowing warnings. Use usual patter for iterating through RHS.
6732 * tests/glr-regression.at
6733 (Uninitialized location when reporting ambiguity):
6734 Modify yylex so that it uses its argument, rather than trying
6735 to rely on ARGSUSED (which doesn't work for gcc with warnings).
6736 const char -> char const.
6738 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
6739 Don't use tabs inside commands; it messes up 'ps'.
6740 Problem reported by twlevo.
6742 2006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
6744 * tests/glr-regression.at (Uninitialized location when reporting
6745 ambiguity): New test case.
6746 * data/glr.c (yyresolveLocations): New function, which uses
6748 (yyresolveValue): Invoke yyresolveLocations before reporting an
6750 * doc/bison.texinfo (Default Action for Locations): Note
6751 YYLLOC_DEFAULT's usage for ambiguity locations.
6752 (GLR Semantic Actions): Cross-reference those notes.
6754 2006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
6756 * tests/glr-regression.at (Leaked semantic values when reporting
6757 ambiguity): Remove unnecessary union and type declarations.
6758 (Leaked lookahead after nondeterministic parse syntax error): New test
6760 * data/glr.c (yyparse): Check for zero stacks remaining before
6761 attempting to shift the lookahead so that you don't lose it.
6763 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
6765 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
6766 * tests/glr-regression.at (Leaked semantic values when reporting
6767 ambiguity): New test case.
6768 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
6769 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
6770 now unnecessary yystackp parameter.
6771 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
6772 destructors can be called.
6774 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
6775 in existing testcases.
6777 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
6779 Don't leak semantic values for parent RHS when a user action cuts the
6780 parser, and clean up related code a bit.
6781 * tests/glr-regression.at (Leaked merged semantic value if user action
6782 cuts parse): Rename to...
6783 (Leaked semantic values if user action cuts parse): ... this. Add check
6784 for leaked parent RHS values.
6785 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
6786 between an unresolved state (non-empty chain of semantic options) and
6787 an incomplete one (signaled by an empty chain).
6788 (yyresolveStates): Document the interface. Move all manipulation of a
6789 successfully or unsuccessfully resolved yyGLRState to...
6790 (yyresolveValue): ... here so that yyresolveValue always leaves a
6791 yyGLRState with consistent data and thus is easier to understand.
6792 Remove the yyvalp and yylocp parameters since they are always just
6793 taken from the yys parameter. When reporting a discarded merged value
6794 in debugging output, note that it is incompletely merged. Document the
6796 (yyresolveAction): If resolving any of the RHS states fails, destroy
6797 them all rather than leaking them. Thus, as long as user actions are
6798 written to clean up the RHS correctly, yyresolveAction always cleans up
6799 the RHS of a semantic option. Document the interface.
6801 2006-02-27 Paul Eggert <eggert@cs.ucla.edu>
6803 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
6804 led to a segmentation fault in GNU Pascal. Problem reported
6807 2006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
6809 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
6810 mid-rule action inside a nonterminal symbol in order to declare a
6811 destructor for its semantic value.
6813 2006-02-16 Paul Eggert <eggert@cs.ucla.edu>
6815 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
6816 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
6817 __cplusplus && ! defined _STDLIB_H && !
6818 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
6819 defined free))]: Include <stdlib.h> rather than rolling our own
6820 declarations of malloc and free, to avoid problems with
6821 incompatible declarations (using 'throw') C++'s stdlib.h. This
6822 should fix Debian bug 340012
6823 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
6824 reported by Guillaume Melquiond.
6826 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
6828 * NEWS: Clarify symbols versus types in unused-value warnings.
6830 * configure.ac (AC_INIT): Bump version number.
6832 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
6834 * NEWS: Version 2.1a.
6835 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
6836 since C99 requires this.
6838 2006-02-11 Paul Eggert <eggert@cs.ucla.edu>
6840 * m4/c-working.m4: New file.
6841 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
6843 2006-02-10 Paul Eggert <eggert@cs.ucla.edu>
6845 * Makefile.maint: Merge from coreutils.
6847 2006-02-09 Paul Eggert <eggert@cs.ucla.edu>
6849 More portability fixes for problems summarized by Nelson H. F. Beebe.
6851 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
6852 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
6853 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
6854 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
6855 messes up because C++ code is compiled in 32-bit mode but linked
6858 2006-02-08 Paul Eggert <eggert@cs.ucla.edu>
6860 More portability fixes for problems summarized by Nelson H. F. Beebe.
6862 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
6863 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
6865 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
6866 nodist_PROGRAMS, since we don't need to actually compile the
6867 example if we're just doing a plain 'make'. This avoids bothering
6868 the installer unnecessarily about problems due to weird C++
6871 2006-02-06 Paul Eggert <eggert@cs.ucla.edu>
6873 More portability fixes for problems summarized by Nelson H. F. Beebe.
6875 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
6876 than #include "...", and compile with -I'.'. The old method was
6877 not portable, according to Posix and the C standard, and it does
6878 not work with Sun C 5.7, where previous #line directives affect
6879 the working directory used in later #include "..." directives.
6881 2006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6883 Various DJGGP specific issues in /djgpp
6885 2006-02-02 Paul Eggert <eggert@cs.ucla.edu>
6887 More portability fixes for problems summarized by Nelson H. F. Beebe.
6889 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
6890 '#include <map>' works and that you can apply ++ to iterators.
6892 2006-02-01 Paul Eggert <eggert@cs.ucla.edu>
6894 Work around portability problems summarized by Nelson H. F. Beebe in
6895 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
6897 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
6898 that '#include <string>' works.
6900 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
6901 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
6902 "warning: sorry: semantics of inline function static data `const
6903 unsigned char translate_table[262]' are wrong (you'll wind up with
6906 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
6907 or, xor to not_, and_, or_, and xor_, respectively. This works
6908 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
6909 random system header somewhere that includes the equivalent of
6912 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
6913 -E" works; it apparently doesn't work with PathScale EKO Compiler
6916 2006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
6918 During deterministic GLR operation, user actions should be able to
6919 influence the parse by changing yychar. To make this easier to fix and
6920 to make glr.c easier to evolve in general, don't maintain yytoken in
6921 parallel with yychar; just compute yytoken when needed.
6922 * tests/glr-regression.at (Incorrect lookahead during deterministic
6923 GLR): Check that setting yychar in a user action has the intended
6925 * data/glr.c (yyGLRStack): Remove yytokenp member.
6926 (yyclearin): Don't set *yytokenp.
6927 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
6928 yychar rather than *yytokenp to determine the current lookahead.
6929 Compute yytoken locally when needed.
6930 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
6933 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
6934 after `--report' documentation.
6936 2006-01-30 Paul Eggert <eggert@cs.ucla.edu>
6938 * src/parse-gram.y (grammar_declaration): Location of printer
6939 symbol is @1, not list->location. Bug reported by twlevo.
6940 * tests/input.at (Incompatible Aliases): Adjust to above change.
6942 2006-01-29 Paul Eggert <eggert@cs.ucla.edu>
6944 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
6945 all the test at once. This makes the output easier to read in the
6948 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
6949 got from <http://bro-ids.org/download.html>. The bug is that
6950 when two actions appeared in succession, the second one was
6951 scanned before the first one was added to the grammar rule
6952 as a midrule action. Bison then output the incorrect warning
6953 "parse.y:905.17-906.36: warning: unused value: $3".
6954 * src/parse-gram.y (BRACED_CODE, action): These are no longer
6955 associated with a value.
6956 (rhs): Don't invoke grammar_current_rule_action_append.
6957 (action): Invoke it here instead.
6958 * src/reader.c (grammar_midrule_action): Now extern.
6959 (grammar_current_rule_action_append): Don't invoke
6960 grammar_midrule_action; that is now the scanner's job.
6961 * src/reader.h (last_string, last_braced_code_loc):
6962 (grammar_midrule_action): New decls.
6963 * src/scan-gram.l (last_string): Now extern, sigh.
6964 (last_braced_code_loc): New extern variable.
6965 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
6966 rule already has an action.
6967 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
6968 * tests/input.at (AT_CHECK_UNUSED_VALUES):
6969 Add some tests to check that the above changes fixed the bug.
6971 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
6973 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
6974 All used changed. Check whether the symbol has a destructor,
6975 not whether it is typed.
6976 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
6977 that the values are still reported as unused. All line numbers
6980 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
6982 Work around a bug in bro 0.8, which underparenthesizes its
6983 definition of YYLLOC_DEFAULT.
6984 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
6986 * data/lalr1.cc: Likewise.
6987 * data/yacc.cc: Likewise.
6989 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
6991 Work around a bug in Pike 7.0, and give the Pike folks a
6992 better way to override the usual int widths.
6993 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
6994 user can override the types.
6995 (short): #undef, to work around a bug in Pike 7.0.
6996 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
6997 (union yyalloc.yyss): Use yytype_int16 rather than short.
6999 (yysigned_char): Remove.
7000 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
7001 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
7002 * tests/regression.at (Web2c Actions): Adjust to above changes.
7004 * src/reader.c (check_and_convert_grammar): New function.
7005 (reader): Close the input file even if something went wrong during
7006 parsing. Minor file descriptor leak reported by twlevo.
7008 * src/assoc.c (assoc_to_string): Use a default: abort (); case
7009 to pacify gcc -Wswitch-default.
7010 * src/scan-gram.l (adjust_location): Use a default: break; case
7011 to pacify gcc -Wswitch-default.
7012 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
7013 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
7014 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
7015 Move these decls to scan-skel.l, since they don't need to be
7017 * src/scan-skel.l: Accept the above decls.
7018 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
7021 2006-01-21 Paul Eggert <eggert@cs.ucla.edu>
7023 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
7024 since we don't want to insist on a version number at the start
7025 of the changelog every time.
7026 * Makefile.maint: Sync from coreutils a bit better.
7027 (sc_trailing_blank): Renamed from sc_trailing_space.
7029 (sc_no_if_have_config_h, sc_require_config_h):
7030 (sc_prohibit_assert_without_use): New rules.
7031 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
7032 (sc_dd_max_sym_length): Fix leading spaces in rule.
7033 (sc_system_h_headers): Prefix with @.
7034 (sc_useless_cpp_parens, m4-check): Output line numbers.
7035 (changelog-check): Allow version only in head.
7036 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
7037 satisfy new Makefile.maint rule.
7038 * data/glr.c: Likewise.
7039 * data/glr.cc: Likewise.
7040 * data/lalr1.cc: Likewise.
7041 * data/yacc.c: Likewise.
7042 * lib/ebitsetv.c: Likewise.
7043 * lib/lbitset.c: Likewise.
7044 * lib/subpipe.c: Likewise.
7045 * lib/timevar.c: Likewise.
7046 * src/system.h: Likewise.
7047 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
7048 * djgpp/Makefile.maint: Add copyright notice.
7049 * djgpp/README.in: Likewise.
7050 * djgpp/config.bat: Likewise.
7051 * djgpp/config.site: Likewise.
7052 * djgpp/config_h.sed: Likewise.
7053 * djgpp/djunpack.bat: Likewise.
7054 * djgpp/config.sed: Fix copyright notice to match standard format.
7055 * djgpp/subpipe.h: Likewise.
7056 * lib/bitsetv-print.c: Likewise.
7057 * lib/bitsetv.c: Likewise.
7058 * lib/subpipe.h: Likewise.
7059 * lib/timevar.c: Likewise.
7060 * lib/timevar.h: Likewise.
7061 * djgpp/subpipe.c: Use standard recipe for config.h.
7062 * lib/abitset.c: Likewise.
7063 * lib/bitset.c: Likewise.
7064 * lib/bitset_stats.c: Likewise.
7065 * lib/bitsetv-print.c: Likewise.
7066 * lib/bitsetv.c: Likewise.
7067 * lib/ebitsetv.c: Likewise.
7068 * lib/get-errno.c: Likewise.
7069 * lib/lbitset.c: Likewise.
7070 * lib/subpipe.c: Likewise.
7071 * lib/timevar.c: Likewise.
7072 * lib/vbitset.c: Likewise.
7073 * tests/local.at: Likewise.
7074 * src/scan-gram.l: Don't include verify.h, since system.h does
7076 * .x-sc_require_config_h: New file.
7077 * .x-sc_unmarked_diagnostics: New file.
7079 2006-01-20 Paul Eggert <eggert@cs.ucla.edu>
7081 Be a bit more systematic about using 'abort'.
7082 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
7083 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
7084 Put 'default: abort ();' before some other case, to satisfy older
7086 * lib/bitset_stats.c (bitset_stats_init): Likewise.
7087 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
7088 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
7089 * src/conflicts.c (resolve_sr_conflict): Likewise.
7090 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
7091 (get_decision_str, get_orientation_str, get_node_alignment_str):
7092 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
7093 (get_linestyle_str, get_arrowstyle_str): Likewise.
7094 * src/conflicts.c (resolve_sr_conflict):
7095 Use a default case rather than one for the one remaining enum
7096 value, to catch invalid enum values as well.
7097 * src/lalr.c (set_goto_map, map_goto):
7098 Prefer "assert (FOO);" to "if (!FOO) abort ();".
7099 * src/nullable.c (nullable_compute, token_definitions_output):
7101 * src/reader.c (packgram, reader): Likewise.
7102 * src/state.c (transitions_to, state_new, state_reduction_find):
7104 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
7105 (symbol_pack): Likewise.
7106 * src/tables.c (conflict_row, pack_vector): Likewise.
7107 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
7108 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
7109 * src/system.h: Don't include <assert.h>.
7110 (assert): New macro.
7112 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
7113 (Destructor Decl, Parser Function, Pure Calling):
7114 Describe rules for braces inside C code more carefully.
7116 2006-01-19 Paul Eggert <eggert@cs.ucla.edu>
7118 Fix some porting glitches found by Nelson H. F. Beebe.
7119 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
7120 compilers that don't understand that abort () does not return.
7121 * src/state.c (transitions_to): Likewise.
7122 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
7123 that '#include <cstdlib>' works.
7124 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
7125 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
7126 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
7127 for the benefit of some pre-C99 compilers.
7129 * bootstrap: Undo changes to gnulib files that autoreconf made.
7131 Minor fixups to get 'make maintainer-check' to work.
7132 * configure.ac: Don't use -Wnested-externs, as it's incompatible
7133 with the new verify.h implementation.
7134 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
7135 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
7136 * data/yacc.c (YYUSE): Likewise.
7137 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
7138 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
7139 * src/parse-gram.y (declaration): Don't pass a string constant
7140 to a function that expects char *, since GCC might complain
7141 about the constant value.
7142 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
7143 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
7144 before #defining them.
7145 * tests/glr-regression.at
7146 (Incorrectly initialized location for empty right-hand side in GLR):
7147 In yyerror, use the msg arg.
7148 (Corrupted semantic options if user action cuts parse):
7149 (Incorrect lookahead during deterministic GLR):
7150 (Incorrect lookahead during nondeterministic GLR):
7151 Don't name a local var 'index'; it shadows string.h's 'index'.
7153 2006-01-19 Akim Demaille <akim@epita.fr>
7155 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
7156 location, not just parts of it.
7158 2006-01-18 Paul Eggert <eggert@cs.ucla.edu>
7160 * NEWS: Document the fact that multiple %unions are now allowed.
7161 * doc/bison.texinfo (Union Decl): Likewise.
7162 * TODO: This feature is now implemented, so remove it from
7165 * Makefile.maint: Merge with coreutils Makefile.maint.
7166 (CVS_LIST): Use build-aux version if available.
7167 (VERSION_REGEXP): New macro.
7168 (syntax-check-rules): Add sc_no_if_have_config_h,
7169 sc_prohibit_assert_without_use, sc_require_config_h,
7170 sc_useless_cpp_parens.
7171 (sc_obsolete_symbols): Check for O_NDELAY.
7172 (sc_dd_max_sym_length): Track coreutils.
7173 (sc_unmarked_diagnostics): Look in all files, not just *.c.
7174 (sc_useless_cpp_parens): New rule.
7175 (news-date-check): Look for version or today's date.
7176 (changelog-check): Don't require version number near head.
7177 (copyright-check): Use current year instead of hardwiring 2005.
7178 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
7179 (announcement): Add --gpg-key-ID.
7181 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
7184 Avoid undefined behavior that addressed just before the start of an
7185 array. Problem reported by twlevo.
7186 * src/reader.c (packgram): Prepend a new sentinel before ritem.
7187 * src/lalr.c (build_relations): Rely on new sentinel.
7188 * src/gram.c (gram_free): Adjust to new sentinel.
7190 2006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
7192 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
7193 yylookaheadNeeds. All uses updated.
7194 (yysplitStack): Rename local yynewLookaheadStatuses to
7195 yynewLookaheadNeeds.
7196 * data/glr-regression.at (Incorrect lookahead during nondeterministic
7197 GLR): In comments, change `lookahead status' to `lookahead need'.
7199 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7201 * data/glr.c (yysplitStack): A little stylistic rewrite.
7203 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7205 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
7207 2006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
7209 * doc/bison.texinfo: Fix some typos.
7210 (GLR Semantic Actions): New subsection discussing special
7211 considerations because GLR semantic actions might be deferred.
7212 (Actions): Mention look-ahead usage of yylval.
7213 (Actions and Locations): Mention look-ahead usage of yylloc.
7214 (Special Features for Use in Actions): Add YYEOF entry and mention it
7215 in the yychar entry.
7216 In the yychar entry, remove mention of the local yychar case (pure
7217 parser) since this is irrelevant information when writing semantic
7218 actions and since it's already discussed in `Table of Symbols' where
7219 yychar is otherwise described as an external variable.
7220 In the yychar entry, don't call it the `current' look-ahead since it
7221 isn't when semantic actions are deferred.
7222 In the yychar and yyclearin entries, add note about deferred semantic
7224 Add yylloc and yylval entries discussing look-ahead usage.
7225 (Look-Ahead Tokens): When discussing yychar, don't call it the
7226 `current' look-ahead, and do mention yylval and yylloc.
7227 (Error Recovery): Cross-reference `Action Features' when mentioning
7229 (Table of Symbols): In the yychar entry, don't call it the `current'
7231 In the yylloc and yylval entries, mention look-ahead usage.
7233 2006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
7235 * tests/glr-regression.at: Update copyright year to 2006.
7237 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
7239 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
7240 use during nondeterministic operation to track which stacks have
7241 actually needed the current lookahead.
7242 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
7243 Allocate, deallocate, resize, and otherwise shuffle space for
7244 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
7245 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
7246 appropriately during nondeterministic operation.
7247 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
7248 members to store the current lookahead to be used by the deferred
7250 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
7251 from which the RHS is taken. Set the lookahead members of the new
7252 yySemanticOption according to the lookahead status for stack yyk.
7253 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
7254 yyaddDeferredAction.
7255 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
7256 members of yySemanticOption before invoking yyuserAction, and then set
7257 them back to their current values afterward.
7258 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
7259 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
7260 * tests/glr-regression.at: Remove `.' from the ends of recent test case
7261 titles for consistency.
7262 (Leaked merged semantic value if user action cuts parse): In order to
7263 suppress lint warnings, use arguments in merge function, and assign
7264 char value < 128 in main.
7265 (Incorrect lookahead during deterministic GLR): New test case.
7266 (Incorrect lookahead during nondeterministic GLR): New test case.
7268 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
7270 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
7271 !yyvaluep as signal that no semantic value is available to print.
7272 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
7273 to print a semantic value.
7275 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
7277 * tests/glr-regression.at: For consistency with my newer test cases,
7280 2006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
7282 * data/glr.c (yyresolveValue): When merging semantic options, if at
7283 least one user action succeeds but a later one cuts the parse, then
7284 destroy the semantic value before returning rather than leaking it.
7285 (yyresolveStates): If a user action cuts the parse and thus
7286 yyresolveValue fails, ignore the (unset) semantic value rather than
7287 corrupting the yyGLRState, and empty the semantic options list since
7288 the user actions should have called all necessary destructors.
7289 Simplify code with YYCHK.
7290 * tests/glr-regression.at (Corrupted semantic options if user action
7291 cuts parse): New test case.
7292 (Undesirable destructors if user action cuts parse): New test case.
7293 Before applying any of this patch, this test case never actually failed
7294 for me... but only because the corrupted semantic options usually
7296 (Leaked merged semantic value if user action cuts parse): New test
7299 2006-01-05 Akim Demaille <akim@epita.fr>
7301 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
7303 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
7305 * data/c.m4 (b4_c_modern): New macro, with a new provision for
7306 _MSC_VER. Problem reported by Cenzato Marco.
7307 (b4_c_function_def): Use it.
7308 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
7310 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
7311 than rolling our own.
7313 2006-01-04 Akim Demaille <akim@epita.fr>
7315 Also warn about non-used mid-rule values.
7316 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
7318 (symbol_list_new): Adjust.
7319 * src/reader.c (symbol_typed_p): New.
7320 (grammar_rule_check): Use it.
7321 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
7323 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
7325 * tests/actions.at (Exotic Dollars): Adjust.
7327 2006-01-04 Akim Demaille <akim@epita.fr>
7329 * src/reader.c (grammar_midrule_action): If $$ is set in a
7330 mid-rule, move the `used' bit to its lhs.
7331 * tests/input.at (Unused values): New.
7332 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
7334 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
7336 * doc/bison.texinfo (Bison Options): Say more accurately what
7338 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
7339 about declarations in the grammar when in Yacc mode, as POSIX does
7340 not require a diagnostic when the grammar uses extensions.
7342 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
7344 Warn about dubious constructions like "%token T T".
7346 * src/symtab.h (struct symbol.declared): New member.
7347 * src/symtab.c (symbol_new): Initialize it to false.
7348 (symbol_class_set): New arg DECLARING, specifying whether
7349 this is a declaration that we want to warn about, if there
7350 is more than one of them. All uses changed.
7352 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
7353 Allow multiple %union directives, whose contents concatenate.
7354 * src/parse-gram.y (grammar_declaration): Likewise.
7355 Use muscle_code_grow, so that we don't need stype_line any more.
7358 * src/muscle_tab.c (muscle_grow): Fix comment.
7360 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
7361 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
7362 Update copyright year to 2006.
7364 2006-01-03 Akim Demaille <akim@epita.fr>
7366 Have glr.cc pass (some of) the calc.at tests.
7367 * data/glr.cc (b4_parse_param_orig): New.
7368 (b4_parse_param): Improve its definition, and bound it more
7369 clearly in the skeleton.
7370 (b4_epilogue): Append, instead of prepending, in order to keep
7372 Simplify the generation of auxiliary functions: locations and
7373 purity are mandated.
7374 (b4_global_tokens_and_yystype): Honor it.
7375 * data/location.cc (c++.m4): Don't include it.
7376 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
7378 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
7380 Be sure to initialize the first position's filename.
7381 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
7383 (AT_CHECK_CALC_GLR_CC): New.
7384 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
7386 2006-01-02 Akim Demaille <akim@epita.fr>
7388 * src/output.c (output_skeleton): Don't hard wire the inclusion of
7390 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
7391 * data/glr.cc: Do not include stack.hh.
7393 2006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
7395 * data/glr.c: Reformat whitespace with tabs.
7396 (b4_lpure_formals): Remove this unused m4 macro.
7397 * tests/cxx-type.at: Reformat whitespace with tabs.
7398 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
7399 since it's a member. Rename type to isNterm for clarity.
7401 2005-12-29 Akim <akim@sulaco.local>
7403 Let glr.cc catch up with symbol_value_print.
7404 * data/glr.cc (b4_yysymprint_generate): Replace by...
7405 (b4_yy_symbol_print_generate): this.
7406 (yy_symbol_print, yy_symbol_value_print): Declare them.
7408 2005-12-28 Paul Eggert <eggert@cs.ucla.edu>
7410 * src/location.h (boundary): Note that a line or column equal
7411 to INT_MAX indicates an overflow.
7412 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
7413 (rule_length_overflow, increment_rule_length, add_column_width):
7415 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
7416 (<SC_BRACED_CODE>"}"):
7417 Use increment_rule_length rather than incrementing it by hand.
7418 (adjust_location, handle_syncline): Diagnose overflow.
7419 (handle_action_dollar, handle_action_at):
7420 Fix bug with monstrosities like $-2147483648.
7421 Remove now-unnecessary checks.
7422 (scan_integer): Verify assumptions and remove now-unnecessary checks.
7423 (convert_ucn_to_byte): Verify assumptions.
7424 (handle_syncline): New arg LOC. All callers changed.
7425 Don't store through a value derived from char const * pointer.
7427 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
7430 2005-12-27 Paul Eggert <eggert@cs.ucla.edu>
7432 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
7433 Remove unnecessary forward static decls.
7435 2005-12-27 Akim Demaille <akim@epita.fr>
7437 * src/reader.c (grammar_current_rule_check): Also check that $$
7439 Take the rule to check as argument, hence rename as...
7440 (grammar_rule_check): this.
7441 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
7443 (grammar_rule_begin, grammar_rule_end): these, for consistency.
7444 (grammar_midrule_action, grammar_symbol_append): Now static.
7445 * tests/torture.at (input): Don't rely on the default action
7446 being always performed.
7447 * tests/calc.at: "Set" $$ even when the action is "cut" with
7449 * tests/actions.at (Exotic Dollars): Instead of using unused
7450 values, check that the warning is issued.
7452 2005-12-22 Paul Eggert <eggert@cs.ucla.edu>
7454 * NEWS: Improve wording for unused-value warnings.
7456 2005-12-22 Akim Demaille <akim@epita.fr>
7458 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
7459 (b4_yysymprint_generate): Rename as...
7460 (b4_yy_symbol_print_generate): this.
7461 Generate yy_symbol_print instead of yysymprint.
7462 Generate also yy_symbol_value_print, and use it.
7464 2005-12-22 Akim Demaille <akim@epita.fr>
7466 * NEWS: Warn about unused values.
7467 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
7469 (symbol_list_n_get, symbol_list_n_used_set): New.
7470 (symbol_list_n_type_name_get): Use symbol_list_n_get.
7471 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
7472 * src/reader.c (grammar_current_rule_check): Check that values are
7474 * src/symtab.c (symbol_print): Accept 0.
7475 * tests/existing.at: Remove the type information.
7477 Remove useless actions (beware of mid-rule actions: perl -000
7478 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
7479 * tests/actions.at (Exotic Dollars): Use unused values.
7480 * tests/calc.at: Likewise.
7481 * tests/glr-regression.at (No users destructors if stack 0 deleted):
7484 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
7487 2005-12-21 Paul Eggert <eggert@cs.ucla.edu>
7489 Undo 2005-12-01 tentative license wording change. The wording is
7490 still being reviewed by the lawyers, and we don't want to wait for
7491 them before publishing a test release. For now, revert to the
7493 * NEWS: Undo 2005-12-01 change.
7494 * data/glr.c: Revert to previous license wording.
7495 * data/glr.cc: Likewise.
7496 * data/lalr1.cc: Likewise.
7497 * data/location.cc: Likewise.
7498 * data/yacc.c: Likewise.
7500 * NEWS: Reword %destructor vs YYABORT etc.
7501 * data/glr.c: Use American spacing, for consistency.
7502 * data/glr.cc: Likewise.
7503 * data/lalr1.cc: Likewise.
7504 * data/yacc.c: Likewise.
7505 * data/yacc.c: Reformat comments slightly.
7506 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
7507 for consistency. Fix some spelling errors and reword recently-included
7509 * tests/cxx-type.at: Cast results of malloc, for C++.
7511 2005-12-21 Joel E. Denny <address@hidden>
7513 * tests/cxx-type.at: Construct a tree, count the parents of shared
7514 nodes, and free each node once and only once. Previously, the memory
7515 for semantic values was leaked instead.
7517 2005-12-21 Joel E. Denny <address@hidden>
7519 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
7520 (yylval, yylloc): If pure, #define to yystackp->yyval and
7521 yystackp->yyloc similar to yychar and yynerrs.
7522 (yyparse): If pure, remove local yylval and yylloc. Add local
7523 yystackp to accommodate pure definitions of yylval and yylloc.
7524 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
7525 yylvalp and yyllocp to &yylval and &yylloc.
7526 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
7527 namespace. Previously, nerrs and char were missing, but lval and lloc
7529 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
7530 yylvalp and yyllocp parameters since, if pure, these are now always
7531 accessible through yystackp. If not pure, they are still accessible
7533 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
7534 `if (YYID (N))' to pacify lint.
7536 2005-12-21 Akim Demaille <akim@epita.fr>
7538 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
7539 destroy the RHS symbols of a rule.
7540 * data/yacc.c (yylen): Initialize to 0.
7541 Keep its value to the number of items to possibly shift.
7542 In particular, a regular successful parse that ends on YYFINAL by
7543 a (internal) YYACCEPT must not have yylen != 0.
7544 (yyerrorlab, yyreturn): Pop the RHS.
7545 Reorder a bit to emphasize the `shifting' bits of code.
7546 (YYPOPSTACK): Now accept a number of items to pop.
7547 * data/lalr1.cc: Likewise.
7548 * data/glr.c: Formatting changes.
7549 Use goto instead of fall through.
7550 * doc/bison.texinfo (Destructor Decl): Complete.
7552 2005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7554 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
7555 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
7556 * djgpp/config.bat: Replace every occurence of the file name
7557 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
7558 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
7559 * djgpp/config.sed: Replace every occurence of the file name
7560 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
7561 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
7562 * djgpp/djunpack.bat: DJGPP specific file.
7563 * djgpp/fnchange.lst: DJGPP specific file.
7564 * djgpp/README.in: Add new information about how to unpack the bison
7565 source on MSDOS and other systems which have 8.3 file name restrictions
7566 using djunpack.bat and fnchange.lst.
7568 2005-12-12 Paul Eggert <eggert@cs.ucla.edu>
7570 * bootstrap (build_cvs_prefix): Remove; unused.
7571 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
7572 when getting gnulib.
7574 2005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
7576 * data/glr.c: Reorder typedef declarations for structs to match order
7577 of struct declarations.
7578 Rename yystack everywhere to yystackp except in yyparse where it's not
7580 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
7582 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
7583 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
7584 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
7587 2005-12-09 Paul Eggert <eggert@cs.ucla.edu>
7589 * tests/sets.at (Accept): Fix typos in regular expression used to
7590 sed out the final state number.
7592 Work around portability problem on Solaris 10: flex-generated
7593 files include <stdio.h> before <config.h>, which messes up
7594 because the latter defines __EXTENSIONS__. Address the problem
7595 by creating two new little files that include <config.h> first,
7596 then include the flex-generated files. Rewrite everyone else
7597 to include <config.h> first, as well.
7598 * lib/timevar.c: Always include "config.h".
7599 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
7600 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
7601 (EXTRA_bison_SOURCES): New macro.
7602 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
7603 * src/system.h: Don't include config.h.
7604 * src/LR0.c: Include <config.h> first.
7605 * src/assoc.c: Likewise.
7606 * src/closure.c: Likewise.
7607 * src/complain.c: Likewise.
7608 * src/conflicts.c: Likewise.
7609 * src/derives.c: Likewise.
7610 * src/files.c: Likewise.
7611 * src/getargs.c: Likewise.
7612 * src/gram.c: Likewise.
7613 * src/lalr.c: Likewise.
7614 * src/location.c: Likewise.
7615 * src/main.c: Likewise.
7616 * src/muscle_tab.c: Likewise.
7617 * src/nullable.c: Likewise.
7618 * src/output.c: Likewise.
7619 * src/parse-gram.y: Likewise.
7620 * src/print.c: Likewise.
7621 * src/print_graph.c: Likewise.
7622 * src/reader.c: Likewise.
7623 * src/reduce.c: Likewise.
7624 * src/relation.c: Likewise.
7625 * src/state.c: Likewise.
7626 * src/symlist.c: Likewise.
7627 * src/symtab.c: Likewise.
7628 * src/tables.c: Likewise.
7629 * src/uniqstr.c: Likewise.
7630 * src/vcg.c: Likewise.
7632 * src/parse-gram.y: Fix minor problems uncovered by lint.
7633 (current_lhs, current_lhs_location): Now static.
7634 (current_assoc): Remove unused variable.
7636 Cleanups so that Bison-generated parsers have less lint.
7637 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
7638 Prepend /*ARGSUSED*/, for lint's sake.
7639 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
7640 definition if 'lint' is defined.
7641 (YYID): New macro (or function, if lint).
7642 All uses of /*CONSTCOND*/0 replaced by YYID(0).
7643 * data/yacc.c: Likewise.
7644 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
7645 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
7646 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
7648 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
7649 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
7650 Use YYID(0) rather than 0, for lint.
7651 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
7652 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
7654 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
7656 * tests/glr-regression.at
7657 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
7658 Close memory leak reported by twlevo.
7660 2005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
7662 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
7664 (yyparse): Iterate another stack in order to call user destructors.
7665 * tests/glr-regression.at (No users destructors if stack 0 deleted):
7667 (Duplicated user destructor for lookahead): This test now is expected
7670 2005-12-01 Paul Eggert <eggert@cs.ucla.edu>
7672 * NEWS: Document the following change.
7673 * data/yacc.c: Say "parser skeleton" rather than "file", since
7674 it's no longer just a file.
7675 * data/glr.c: Grant a special exception for C GLR parsers, that
7676 reads like the already-existing exception for C LALR(1) parsers.
7677 * data/glr.cc: Likewise.
7678 * data/lalr1.cc: Likewise.
7679 * data/location.cc: Likewise.
7680 * data/yacc.c: Reword the "written by" statement to clarify that
7681 it was the parser skeleton, not the entire output file.
7682 * data/glr.c: Written by Paul Hilfinger.
7683 * data/glr.cc: Written by Akim Demaille.
7684 * data/lalr1.cc: Likewise.
7686 2005-11-18 Paul Eggert <eggert@cs.ucla.edu>
7688 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
7689 Fix typos in previous change that broke 'make check'.
7690 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
7692 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
7693 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
7694 We can revert this once things settle down.
7696 * src/conflicts.c (conflicts_print): Don't print file name twice
7697 when %expect fails because there were no conflicts.
7698 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
7700 * tests/conflicts.at (%expect not enough, %expect too much):
7701 (%expect with reduce conflicts): Adjust to new behavior.
7703 2005-11-18 Akim Demaille <akim@epita.fr>
7705 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
7707 * NEWS: Document this.
7708 * doc/bison.texinfo (Expect Decl): Likewise.
7710 2005-11-16 Akim Demaille <akim@epita.fr>
7712 Generalize the display of semantic values and locations in traces.
7713 * data/glr.c (yy_reduce_print): Fix indices (again).
7714 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
7716 * data/lalr1.cc (yyreduce_print): Rename as...
7717 (yy_reduce_print): this.
7718 Display values and locations.
7719 * data/yacc.c (yy_reduce_print): Likewise.
7720 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
7721 (yysymprint): Move higher to be visible from yy_reduce_print).
7723 * tests/calc.at: Adjust the expected length of the traces.
7725 2005-11-14 Akim Demaille <akim@epita.fr>
7727 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
7728 from 1 to N, while values and location start at 0.
7729 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
7731 2005-11-14 Akim Demaille <akim@epita.fr>
7733 * data/glr.c (yy_reduce_print): Fix the $ number.
7735 2005-11-14 Akim Demaille <akim@epita.fr>
7737 "Use" parse parameters.
7738 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
7739 * data/glr.c, data/glr.cc: Use them.
7740 * data/glr.c (YYUSE): Have a C++ definition that supports
7743 2005-11-14 Akim Demaille <akim@epita.fr>
7745 * data/glr.c (yyexpandGLRStack): Declare only if defined.
7747 2005-11-14 Akim Demaille <akim@epita.fr>
7750 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
7752 2005-11-12 Akim Demaille <akim@epita.fr>
7754 Let position and location be PODs.
7755 * data/location.cc (position::initialize, location::initialize): New.
7756 (position::position, location::location): Define only if
7757 b4_location_constructors is defined.
7758 * data/lalr1.cc (b4_location_constructors): Define it for backward
7760 * doc/bison.texinfo (Initial Action Decl): Use initialize.
7762 2005-11-12 Akim Demaille <akim@epita.fr>
7764 * data/lalr1.cc: Move the body of the ctor and dtor into the
7765 parser file (instead of the header).
7766 Wrap the implementations in a "namespace yy".
7768 2005-11-12 Akim Demaille <akim@epita.fr>
7770 Have glr.c include its header file when created.
7771 * data/glr.c (b4_shared_declarations): New.
7772 Output them verbatim in the parser if !%defines, otherwise
7773 output then in the header file, and include it instead.
7775 2005-11-11 Akim Demaille <akim@epita.fr>
7777 * data/glr.c: Comment changes.
7779 2005-11-11 Akim Demaille <akim@epita.fr>
7781 When yydebug, report semantic and location values for reductions.
7782 * data/glr.c (yy_reduce_print): Report the semantic values and the
7784 (YY_REDUCE_PRINT): Adjust.
7785 (yyglrReduce): Use them.
7786 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
7787 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
7788 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
7791 2005-11-10 Akim Demaille <akim@epita.fr>
7793 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
7794 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
7795 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
7797 2005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
7799 * m4/cxx.m4, examples/Makefile.am: Don't build
7800 examples/calc++ if no C++ compiler is available. (trivial change)
7802 2005-11-09 Akim Demaille <akim@epita.fr>
7804 * src/scan-skel.l: Use a couple of asserts.
7806 2005-11-03 Akim Demaille <akim@epita.fr>
7808 In some (weird) cases, the final state number is incorrect.
7809 Reported by Alexandre Duret-Lutz.
7810 * src/LR0.c (state_list_append): Remove the computation of
7812 (save_reductions): Do it here.
7813 (get_state): Alpha conversion.
7814 (generate_states): Use a for loop.
7815 * src/gram.h (item_number_is_rule_number)
7816 (item_number_is_symbol_number): New.
7817 * src/state.c: Use assert.
7818 * src/system.h: Include assert.h.
7819 * tests/sets.at (Accept): New.
7821 2005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7823 * data/glr.c (yyfill): Adjust comment.
7824 (yyresolveAction): Initialize default location properly
7825 for empty right-hand sides.
7826 (yydoAction): Ditto.
7827 Add comment explaining apparently dead code.
7828 * tests/glr-regression.at
7829 (Incorrectly initialized location for empty right-hand side in GLR):
7832 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
7834 * bootstrap (cleanup_gnulib): New function. Use it to clean up
7835 gnulib when interrupted. This fixes some race conditions and
7836 works around some portability problems (one noted by Paul
7839 2005-10-22 Akim <akim@epita.fr>
7841 * Makefile.cfg: Adjust to config -> build-aux.
7844 2005-10-21 Akim Demaille <akim@epita.fr>
7846 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
7848 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
7849 * data/yacc.c (b4_Pure_if): Rename as...
7850 (b4_yacc_pure_if): this.
7851 (YY_SYMBOL_PRINT, yyparse): Adjust.
7852 * doc/bison.texinfo: Formatting changes.
7854 2005-10-21 Akim Demaille <akim@epita.fr>
7856 Finish the transition config -> build-aux.
7857 * configure.ac, Makefile.am: Use build-aux.
7858 * config/prev-version, config/announce-gen, config/Makefile.am:
7860 * build-aux/prev-version, build-aux/announce-gen,
7861 * build-aux/Makefile.am: here.
7863 2005-10-14 Akim Demaille <akim@epita.fr>
7865 * examples/calc++/test: Use set -x only when VERBOSE.
7867 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
7869 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
7870 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
7872 2005-10-13 Akim Demaille <akim@epita.fr>
7874 * src/scan-skel.l: Output the base name parts of the parser and
7876 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7878 Use this to exercise C++ outputs in subdirs.
7879 Reported by Oleg Smolsky.
7881 2005-10-12 Paul Eggert <eggert@cs.ucla.edu>
7883 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
7884 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
7885 Problem reported by John P. Hartmann.
7886 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
7889 2005-10-12 Akim Demaille <akim@epita.fr>
7891 * src/parse-gram.y (version_check): Exit 63 to please missing
7892 (stands for "version mismatch).
7893 * tests/input.at, doc/bison.texinfo: Adjust.
7895 2005-10-10 Paul Eggert <eggert@cs.ucla.edu>
7897 Work around portability problems with Visual Age C compiler
7898 (xlc and xlC_r) reported by John P. Hartmann.
7899 * data/location.cc (initial_column, initial_line): Remove.
7900 All uses replaced by 0 and 1.
7901 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
7902 that xlc complains about.
7903 * src/scan-skel.l (skel_wrap): Likewise.
7904 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
7906 * data/yacc.c (YYMODERN_C): New macro, which also looks at
7907 __STDC_VERSION__. Use it everywhere instead of looking at
7908 __STDC__ and __cplusplus.
7910 2005-10-10 Akim Demaille <akim@epita.fr>
7912 * examples/calc++/test: Be quiet unless VERBOSE.
7914 2005-10-05 Paul Eggert <eggert@cs.ucla.edu>
7916 * data/c.m4 (yydestruct, yysymprint):
7917 Use YYUSE instead of casting to void.
7918 * data/glr.c (YYUSE): New macro.
7919 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
7920 Use it instead of rolling our own.
7921 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
7923 Use /*CONSTCOND*/ to suppress lint warnings.
7924 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
7925 (YY_STACK_PRINT): Use 'false' not '0'.
7927 (yysymprint_, yydestruct_): Use it instead of rolling our own.
7928 * data/yacc.c (YYUSE): New macro.
7929 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
7930 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
7931 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
7934 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
7935 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
7937 2005-10-04 Paul Eggert <eggert@cs.ucla.edu>
7939 Undo the parts of the unlocked-I/O change that substituted
7940 putc or puts for printf. This might hurt performance a bit,
7941 but some people prefer the printf style.
7942 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
7943 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
7944 All uses replaced by YYFPRINTF and YYDPRINTF.
7945 * data/yacc.c: Likewise.
7946 * lib/bitset.c (bitset_print): Likewise.
7947 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
7949 * lib/lbitset.c (debug_lbitset): Likewise.
7950 * src/closure.c (print_firsts, print_fderives): Likewise.
7951 * src/gram.c (grammar_dump): Likewise.
7952 * src/lalr.c (look_ahead_tokens_print): Likewise.
7953 * src/output.c (escaped_output): Likewise.
7954 (user_actions_output): Break apart two printfs.
7955 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
7956 * src/reduce.c (reduce_print): Likewise.
7957 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
7958 * src/system.h: Include unlocked-io.h rathe than stdio.h.
7960 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
7961 Use assignments rather than casts-to-void to suppress
7962 unused-variable warnings. This pacifies 'lint'.
7963 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
7964 unused-variable warnings.
7966 2005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7968 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
7970 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
7972 Use unlocked I/O for a minor performance improvement on hosts like
7973 GNU/Linux and Solaris that support unlocked I/O. The basic idea
7974 is to use the gnlib unlocked-io module, and to prefer putc and
7975 puts to printf when either will work (since the latter doesn't
7976 come in an unlocked flavor).
7977 * bootstrap (gnulib_modules): Add unlocked-io.
7978 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
7979 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
7980 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
7981 and similarly for puts and putc and printf.
7982 * data/yacc.c: Likewise.
7983 * lib/bitset.c (bitset_print): Likewise.
7984 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
7985 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
7987 * lib/lbitset.c (debug_lbitset): Likewise.
7988 * src/closure.c (print_firsts, print_fderives): Likewise.
7989 * src/gram.c (grammar_dump): Likewise.
7990 * src/lalr.c (look_ahead_tokens_print): Likewise.
7991 * src/output.c (escaped_output): Likewise.
7992 (user_actions_output): Coalesce two printfs.
7993 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
7994 * src/reduce.c (reduce_print): Likewise.
7995 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
7996 * src/system.h: Include unlocked-io.h rather than stdio.h.
7998 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
7999 this confuses xgettext.
8001 2005-10-02 Akim Demaille <akim@epita.fr>
8003 * bootstrap (gnulib_modules): Add strverscmp.
8004 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
8005 * m4/.cvsignore: Add strverscmp.m4.
8006 * src/parse-gram.y (%require): New token, new rule.
8007 (version_check): New.
8008 * src/scan-gram.l (%require): Adjust.
8009 * tests/input.at (AT_REQUIRE): New.
8011 * doc/bison.texinfo (Require Decl): New.
8012 (Calc++ Parser): Use %require.
8014 2005-10-02 Akim Demaille <akim@epita.fr>
8016 * data/location.cc: New.
8018 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
8019 Akim Demaille <akim@epita.fr>
8021 Make sure -odir/foo.cc creates dir/location.hh etc.
8022 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
8023 (spec_file_prefix, spec_verbose_file, spec_graph_file)
8024 (spec_defines_file): Now const.
8026 (short_base_name): Remove.
8027 * src/files.c: Adjust.
8028 (dirname.h): Include.
8029 (base_name): Don't prototype it.
8030 (finput): Remove, duplicates gram_in.
8031 (full_base_name, short_base_name): Replace by...
8032 (all_but_ext, all_but_tab_ext): these.
8033 (compute_base_names): Rename as...
8034 (compute_file_name_parts): this.
8035 Update to compute the new variables, including dir_prefix.
8036 Adjust dependencies.
8037 * src/output.c (prepare): Output them.
8038 * src/reader.c: Adjust to use gram_in, not finput.
8039 * src/scan-skel.l (@dir_prefix@): New.
8041 2005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8043 * lib/subpipe.c: New function end_of_output_subpipe() added
8044 to allow support for non-posix systems. This is a no-op function
8047 * lib/subpipe.h: New function end_of_output_subpipe() added
8048 to allow support for non-posix systems. This is a no-op function
8051 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
8052 handle the lack of pipe/fork functionality on non-posix systems.
8054 * djgpp/Makefile.maint: DJGPP specific file.
8056 * djgpp/README.in: DJGPP specific file.
8058 * djgpp/config.bat: DJGPP specific configuration file.
8060 * djgpp/config.sed: DJGPP specific configuration file.
8062 * djgpp/config.site: DJGPP specific configuration file.
8064 * djgpp/config_h.sed: DJGPP specific configuration file.
8066 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
8068 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
8070 2005-10-02 Akim Demaille <akim@epita.fr>
8072 * data/location.cc: New, extract from...
8073 * data/lalr1.cc: here.
8074 (location.hh): Include it after the user prologue, in case the
8075 filename type is defined by the user.
8076 Forward declation location and position before the pre-prologue.
8077 (yyresult_): Rename as...
8078 (yyresult): this, it's a local variable, not an attribute.
8079 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
8081 2005-10-01 Akim Demaille <akim@epita.fr>
8083 * examples/extexi: Restore the #line generation.
8085 2005-09-30 Akim Demaille <akim@epita.fr>,
8086 Alexandre Duret-Lutz <adl@gnu.org>
8088 Move the token type and YYSTYPE in the parser class.
8089 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
8090 (parser::token): New, from the moved free definition of tokens.
8091 (parser::semantic_value): Now a full definition instead of an
8092 indirection to YYSTYPE.
8093 (b4_post_prologue): No longer included in the header file, but
8094 in the implementation file.
8095 * doc/bison.texi (C+ Language Interface): Update.
8096 * src/parse-gram.y: Support unary %define.
8097 * tests/actions.at: Define global_tokens_and_yystype for backward
8098 compatibility until we update the tests.
8099 * tests/calc.at: Idem.
8100 (first_line, first_column, last_line, last_column): Define for lalr1.cc
8101 to simplify the code.
8103 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
8105 Port to SunOS 4.1.4, which lacks strtoul and strerror.
8106 Ah, the good old days! Problem reported by Peter Klein.
8107 * bootstrap (gnulib_modules): Add strerror, strtoul.
8108 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
8109 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
8111 2005-09-29 Akim Demaille <akim@epita.fr>
8113 * data/c.m4 (b4_error_verbose_if): New.
8114 * data/lalr1.cc: Use it.
8115 (YYERROR_VERBOSE_IF): Remove.
8116 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
8117 parser members, replaced by...
8118 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
8120 (yysyntax_error_): Takes the state number as argument.
8121 (yyreduce_print_): Use the argument yyrule, not the former
8124 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
8126 * bootstrap (gnulib_modules): Add verify.
8127 * lib/.cvsignore: Add verify.h.
8128 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
8129 * src/system.h (verify): Remove.
8130 Include verify.h instead.
8131 * src/tables.c (tables_generate): Use new API for 'verify'.
8133 2005-09-21 Paul Eggert <eggert@cs.ucla.edu>
8135 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
8136 local variables whose names begin with 'yy'.
8137 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
8138 Trivial changes from Joel E. Denny.
8140 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
8142 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
8143 don't use alloca any more.
8145 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
8146 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
8147 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
8148 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
8149 to match yacc.c, to test more hosts.
8151 2005-09-20 Paul Eggert <eggert@cs.ucla.edu>
8153 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
8154 doesn't affect behavior.
8155 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
8157 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
8158 This works a bit better with glibc, if user code has already included
8160 * doc/bison.texinfo (Bison Parser): Document that users can't
8161 arbitrarily use malloc and free for other purposes. Document
8162 that <alloca.h> and <malloc.h> might be included.
8163 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
8164 user must declare alloca.
8166 * HACKING (release): Forwarn the Translation Project about
8169 2005-09-20 Akim Demaille <akim@epita.fr>
8171 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
8173 2005-09-19 Paul Eggert <eggert@cs.ucla.edu>
8175 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
8176 (YYSTACK_ALLOC_MAXIMUM): Use it.
8177 (yysyntax_error): New function.
8178 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
8179 multiple syntax errors are reported, and alloca is being used.
8180 Instead, reallocate buffers twice as big each time, so that
8181 we waste at most half the allocated memory. Start with a small
8182 (128-byte) buffer that will suffice in most cases anyway.
8183 Use yysyntax_error to do most of the work.
8185 * doc/bison.texinfo (Error Reporting, Table of Symbols):
8186 yynerrs is the number of errors reported, not the number of
8189 * tests/glr-regression.at (Duplicated user destructor for lookahead):
8190 Mark it as expected to fail.
8191 Cast result of malloc; problem reported by twlevo@xs4all.nl.
8192 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
8193 Don't start user-code symbols with "yy", to avoid name space problems.
8195 2005-09-19 Akim Demaille <akim@epita.fr>
8197 Remove the traits, failed experiment.
8198 It never proved useful, and anyway because of the current
8199 definition, it was not possible to have several specialization of
8200 this traits, making it useless.
8201 * data/lalr1.cc (yy:traits): Remove.
8202 Inline its definitions in the parser class.
8204 2005-09-19 Akim Demaille <akim@epita.fr>
8206 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
8207 least Mac OSX with a /usr/local install of gettext.
8209 2005-09-19 Akim Demaille <akim@epita.fr>
8211 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
8212 and yytoken for similarity with the other skeletons.
8214 2005-09-19 Akim Demaille <akim@epita.fr>
8216 * NEWS, configure.ac: update version number to 2.1a.
8218 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
8220 * NEWS: Version 2.1.
8222 * NEWS: Remove notice of yytname change, since it was never in an
8224 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
8226 * src/output.c (prepare): Likewise.
8227 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
8228 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
8229 is not defined. This is an awful hack, but it's enough for now.
8230 All callers changed.
8231 * tests/glr-regression-at (make_value): Args are const pointers now,
8232 to avoid GCC warning.
8233 (Duplicated user destructor for lookahead): New test. Currently
8234 skipped. It fails on my host but I'm not sure it'll always fail.
8236 2005-09-16 Akim Demaille <akim@epita.fr>
8238 * src/symtab.h (struct symbol): Declare the printer and destructor
8239 as const, to avoid accidental calls to free.
8240 (symbol_destructor_set, symbol_printer_set): Adjust.
8241 * src/symtab.c: Adjust.
8243 2005-09-16 Akim Demaille <akim@epita.fr>
8245 * data/c.m4 (b4_token_enums): New.
8246 (b4_token_defines): Rename as...
8247 (b4_token_enums_defines): this.
8248 (b4_token_defines): New, output only the #defines.
8249 * data/yacc.c, data/glr.c: Adjust.
8250 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
8251 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
8254 2005-09-16 Akim Demaille <akim@epita.fr>
8256 * data/lalr1.cc (yylex_): Remove, inline its code.
8257 (yyreport_syntax_error_): Remove, replaced by...
8258 (yysyntax_error_): this which returns a string and leaves to the
8259 caller the call to the users' error function.
8260 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
8261 Move from members of the parser object...
8262 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
8263 to local variables of the parse function.
8265 2005-09-16 Akim Demaille <akim@epita.fr>
8267 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
8268 since it's in Bison's name space.
8270 2005-09-15 Paul Eggert <eggert@cs.ucla.edu>
8272 * data/glr.c (yyresolveValue): Add default case to pacify
8273 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
8275 * NEWS: Document when yyparse started to return 2.
8276 * doc/bison.texinfo (Parser Function): Document when yyparse
8279 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
8280 (b4_filename_type): Renamed back from b4_file_name_type. All uses
8282 (class position): file_name -> filename (reverting). All uses changed.
8284 2005-09-14 Paul Eggert <eggert@cs.ucla.edu>
8286 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
8287 do anything if $@ exists. This reverts part of the 2005-07-07
8290 2005-09-11 Paul Eggert <eggert@cs.ucla.edu>
8292 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
8293 contains obsolete information and isn't worth distributing as a
8294 separate file anyway.
8295 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
8296 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
8297 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
8298 (yyparse): Abort if user code uses longjmp to throw an unexpected
8301 2005-09-09 Paul Eggert <eggert@cs.ucla.edu>
8303 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
8304 Suggested by twlevo@xs4all.nl.
8306 * data/glr.c (YYCHK1): Do not assume YYE is in range.
8307 This avoids a diagnostic from gcc -Wswitch-enum.
8308 Problem reported by twlevo@xs4all.nl.
8310 * doc/bison.texinfo: Don't use "filename", as per GNU coding
8311 standards. Use "file name" or "file" or "name", depending on
8313 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
8314 not to hack/foo.tab.c.
8315 (Calc++ Top Level): 2nd arg of main is not const.
8316 * data/glr.c: b4_filename -> b4_file_name.
8317 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
8319 (class position): filename -> file_name. All uses changed.
8320 * data/yacc.c: b4_filename -> b4_file_name.
8321 * lib/bitset.h: filename -> file_name in local vars.
8322 * lib/bitset_stats.c: Likewise.
8323 * src/files.c: Likewise.
8324 * src/scan-skel.l ("@output ".*\n): Likewise.
8325 * src/files.c (file_name_split): Renamed from filename_split.
8326 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
8328 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
8330 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
8331 to accommodate latest gnulib.
8333 * tests/glr-regression.at (Duplicate representation of merged trees):
8334 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
8336 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
8339 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
8341 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
8342 All uses changed. Invoke user destructor after an error during a
8343 split parse (trivial change from Joel E. Denny).
8345 * tests/glr-regression.at
8346 (User destructor after an error during a split parse): New test case.
8347 Problem reported by Joel E. Denny in:
8348 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
8350 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
8352 * README-cvs: Give URLs for recommended tools.
8353 Mention Gzip version problem, and bootstrapping issues.
8354 Remove troubleshooting section, as it's somewhat obsolete.
8356 * bootstrap (no_cache): New var, to accommodate different wget
8357 variants. Use it instead of '-C off'. Problem reported by
8360 * data/glr.c (yydestroyStackItem): New function.
8361 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
8362 debugging information. Problem reported by Joel E. Denny.
8364 2005-08-25 Akim Demaille <akim@epita.fr>
8366 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
8368 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
8370 * data/glr.c (yyrecoverSyntaxError, yyreturn):
8371 Don't invoke destructor on unresolved entries.
8372 * tests/glr-regression.at
8373 (User destructor for unresolved GLR semantic value): New test case.
8374 Problem reported by Joel E. Denny in:
8375 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
8377 2005-08-21 Paul Eggert <eggert@cs.ucla.edu>
8379 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
8381 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
8382 lib-prefix.m4, po.m4.
8384 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
8385 in yydestruct diagnostic, since it might not be an error.
8386 Problem reported by Joel Denny near end of
8387 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
8388 * data/lalr1.cc (yyerturn): Likewise.
8389 * data/yacc.c (yyreturn): Likewise.
8390 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
8392 * src/files.c: Remove obsolete FIXME comment.
8394 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
8395 with the other templates, and to fix bogus run-on messages such
8396 as the one reported at the end of
8397 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
8398 All callers changed to avoid the newline.
8399 (yyprocessOneStack): Output two lines rather than one, to accommodate
8400 the above change. This changes the debug output format slightly.
8402 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
8403 reported by Joel E. Denny in
8404 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
8406 * tests/glr-regression.at (Duplicate representation of merged trees):
8407 New test, from Joel E. Denny in:
8408 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
8409 * THANKS: Add Joel E. Denny.
8411 * configure.ac (AC_INIT): Bump to 2.0c.
8413 2005-07-24 Paul Eggert <eggert@cs.ucla.edu>
8415 * NEWS: Version 2.0b.
8417 * Makefile.am (SUBDIRS): Put examples before tests, so that
8418 "make check" doesn't finish with "All 1 tests passed".
8420 * tests/regression.at (Token definitions): Don't rely on
8421 AT_PARSER_CHECK for data that contains backslashes. It currently
8422 uses 'echo', and 'echo' isn't portable if its argument contains
8423 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
8424 that the byte '\0xff' is not printable in the C locale; it is,
8425 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
8426 not printable, so use '\0x81' to test.
8428 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
8429 version of GCC, since the macro is used with non-GCC compilers.
8431 Fix core dump reported by Pablo De Napoli in
8432 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
8433 * tests/regression.at (Invalid inputs with {}): New test.
8434 * src/parse-gram.y (token_name): Translate type before using
8437 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
8438 the user's name space. All uses changed to __attribute__
8440 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
8441 Add __attribute__ ((__noreturn__)).
8443 * etc/clcommit: Remove. We weren't using it, and it failed
8444 "make maintainer-distcheck".
8445 * Makefile.maint: Merge from coreutils.
8446 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
8447 (syntax-check-rules): Change list of rules as described below.
8448 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
8449 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
8450 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
8451 (sc_trailing_space): New rules.
8452 (sc_xalloc_h_in_src): Remove.
8453 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
8454 (sc_space_tab, sc_error_exit_success, sc_changelog):
8455 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
8456 (makefile-check, po-check, author_mark_check):
8457 (makefile_path_separator_check, copyright-check):
8458 Use grep -n, to make it easier to find violations.
8459 Use CVS_LIST and CVS_LIST_EXCEPT.
8460 (header_regexp, h_re): Remove.
8462 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
8463 (my-distcheck): Use more-modern GCC flags.
8464 (signatures, %.asc): Remove.
8465 (rel-files, announcement): Remove signatures.
8466 Restore old updating code, even though we don't use it, so
8467 that we're the same as coreutils.
8468 (alpha, beta, major): Depend on news-date-check.
8469 Make the upload commands.
8471 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
8472 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
8473 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
8474 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
8475 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
8476 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
8477 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
8478 * tests/sets.at: Likewise.
8480 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
8481 we comment out the Autoconf version number.
8482 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
8483 it's error-prone and "make maintainer-distcheck" rejects it.
8485 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
8486 Indent calls to "error" to pacify "make maintainer-distcheck",
8487 when the calls are not intended to be translated.
8488 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
8490 * src/Makefile.am (DEFS): Use +=, to pacify
8491 "make maintainer-distcheck".
8492 (bison_SOURCES): Add scan-skel.h.
8493 (sc_tight_scope): New rule, from coreutils.
8495 * src/files.c (src_extension, header_extension):
8496 Now static, not extern.
8497 * src/getargs.c (short_options): Likewise.
8498 * src/muscle_tab.c (muscle_table): Likewise.
8499 * src/parse-gram.y (current_class, current_type, current_prec):
8501 * src/reader.c (grammar_end, previous_rule_end): Likewise.
8502 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
8503 * src/main.c (main): Cast bindtextdomain and textdomain calls to
8504 void, to avoid warning when NLS is disabled.
8505 * src/output.c: Include scan-skel.h.
8506 (scan_skel): Remove decl, since scan-skel.h does this.
8508 Indent calls to "error" to pacify "make maintainer-distcheck".
8509 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
8510 * src/reader.h (gram_end, gram_lineno): New decls to pacify
8511 "make maintainer-distcheck".
8512 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
8513 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
8514 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
8515 (skel_lex_destroy, scan_skel): Move these decls to...
8516 * src/scan-skel.h: New file.
8517 * src/uniqstr.c (uniqstr_assert):
8518 Indent calls to "error" to pacify "make maintainer-distcheck".
8520 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
8523 * tests/torture.at: Revamp to avoid misuse of atoi that
8524 "make maintainer-distcheck" complained about.
8526 * examples/extexi (message): Don't print a message more than once,
8527 and omit line-number decoration that makes Emacs compile think
8528 that informative messages are worth worrying about.
8530 2005-07-22 Paul Eggert <eggert@cs.ucla.edu>
8532 * configure.ac: Update version number.
8534 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
8536 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
8537 autogenerated by the maintainer.
8538 * examples/calc++/.cvsignore: Add *.yy.
8540 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
8541 * lib/bitset_stats.c (bitset_stats_init): Likewise.
8542 * lib/bitsetv.c (bitsetv_alloc): Likewise.
8544 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
8546 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
8547 from maintainer-distcheck about casting the argument of 'free'.
8549 * NEWS: Mention recent yytname changes.
8550 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
8552 * bootstrap: For translations that have not yet been upgraded to
8553 the new runtime-po domain, prime the pump by extracting the
8554 relevant strings from the obsolete translations. This code can be
8555 removed once the bison-runtime domain has been translated by each
8558 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
8559 now that token names are already quoted.
8561 Fix problem reported by Anthony Heading.
8562 * data/glr.c (YYTOKEN_TABLE): New macro.
8563 (yytname): Define if YYTOKEN_TABLE.
8564 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
8565 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
8566 (YYERROR_VERBOSE): Define the same way the other skeletons do.
8567 * src/output.c (prepare_symbols): Output token_table_flag.
8569 2005-07-21 Paul Eggert <eggert@cs.ucla.edu>
8571 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
8572 again if the first call fails.
8574 * data/glr.c (yytnamerr): New function.
8575 (yyreportSyntaxError): Use it to dequote most string literals.
8576 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
8577 with other skeletons. All uses changed.
8578 (yytnameerr_): New function.
8579 (yyreport_syntax_error): Use it to dequote most string literals.
8580 * data/yacc.c (yytnamerr): New function.
8581 (yyerrlab): Use it to decode most string literals.
8582 * doc/bison.texinfo (Decl Summary, Calling Convention):
8583 Clarify quoting convention of yytname.
8584 * src/output.c (prepare_symbols): Quote all names. This undoes
8585 the 2005-04-17 change, which is now accomplished (mostly) via
8586 changes in the parsers as described above.
8587 * tests/regression.at (Token definitions, Web2c Actions):
8588 Undo most 2005-04-17 change here, too.
8590 2005-07-20 Paul Eggert <eggert@cs.ucla.edu>
8592 Fix more problems reported by twlevo@xs4all.nl.
8593 * tests/cxx-type.at: Don't pipe output of ./types through sed to
8594 remove trailing spaces. This loses the exit status of ./types,
8595 and isn't needed since ./types shouldn't be emitting trailing
8597 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
8598 as the stack isn't valid in that case.
8600 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
8601 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
8602 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
8603 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
8605 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
8606 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
8607 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
8610 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
8611 overly-picky compilers that reject 'char *foo = "bar";'.
8613 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
8614 to FILE * parameter, not to stderr. This fixes a typo introduced
8615 in the 2005-07-12 change.
8617 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
8618 warnings from GCC 4.
8620 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
8621 (yyglrShiftDefer, yysplitStack):
8622 Remove unused parameters b4_pure_formals. All uses changed.
8623 (yyglrShift): Remove unused parameters b4_user_formals.
8625 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
8627 2005-07-18 Paul Eggert <eggert@cs.ucla.edu>
8629 Destructor cleanups and regularization among the three skeletons.
8630 * NEWS: Document the behavior changes.
8631 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
8632 stack before failing, as the cleanup code will do it for us now.
8633 * data/lalr1.cc (yyerrlab): Likewise.
8634 * data/glr.c (yyparse): Pop everything off the stack before
8635 freeing it, so that destructors get called properly.
8636 * data/lalr1.cc (yyreturn): Likewise.
8637 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
8638 This is more consistent.
8639 * doc/bison.texinfo (Destructor Decl): Mention more reasons
8640 why destructors might be called. 1.875 -> 2.1.
8641 (Destructor Decl, Decl Summary, Table of Symbols):
8642 Some English-language cleanups for %destructor.
8643 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
8644 Add output line for destructor of start symbol.
8645 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
8646 because of that same extra output line.
8648 * NEWS: Document minor wording changes in diagnostics of
8649 Bison-generated parsers.
8650 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
8651 Remove unused formals. All uses changed.
8652 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
8653 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
8654 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
8655 Rename yyoverflowab to yyexhaustedlab.
8656 When memory exhaustion occurs during syntax-error reporting,
8657 report it separately rather than in a single diagnostic; this
8659 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
8660 (Memory Exhausted): Renamed from Parser Stack Overflow.
8661 Revamp wording slightly to prefer "memory exhaustion".
8662 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
8664 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
8666 Add i18n support to the GLR skeleton. Partially fix the C++
8667 skeleton; a C++ expert needs to finish this. Remove debugging
8668 msgids; there's little point to having them translated, since they
8669 can be understood only by someone who can read the
8670 (English-language) source code.
8672 Generate runtime-po/bison-runtime.pot automatically, so that we
8673 don't have to worry about garbage getting in that file. We'll
8674 make sure after the next official release that old msgids don't
8676 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
8678 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
8680 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
8681 Fix typos in explanations of the runtime file.
8682 * bootstrap: Change gettext keyword from YYI18N to YY_.
8683 Use standard Makefile.in.in in runtime-po, since we'll arrange
8684 for backward-compatible bison-runtime.po files in a different way.
8685 * data/glr.c (YY_): New macro, from yacc.c.
8686 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
8687 Translate messages intended for users.
8688 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
8689 the wording in the other skeletons. We don't know that the memory
8691 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
8692 Use same method that yacc.c uses.
8693 Don't translate debugging messages.
8694 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
8695 it doesn't work (yet), and requires C++ expertise to fix.
8696 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
8697 Move defn to a more logical place, to be consistent with other
8699 Don't translate debugging messages.
8700 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
8701 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
8702 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
8703 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
8705 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
8706 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
8708 * tests/glr-regression.at (Badly Collapsed GLR States):
8710 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
8711 yylex should return 0 at EOF rather than aborting.
8713 Improve tests for stack overflow in GLR parser.
8714 Problem reported by twlevo@xs4all.nl.
8715 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
8717 (yyStackOverflow): Just longjmp, but with value 2 so that caller
8718 can handle the problem.
8719 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
8720 (yyparse): New local variable yyresult to record the result.
8721 Use result of setjmp to set it, rather than storing itinto
8723 (yyDone): Remove label.
8724 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
8725 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
8726 if YYABORT is used).
8727 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
8728 yyparse status; put status > 1 into diagnostic.
8729 Check that status==2 works.
8730 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
8731 Use exit status 3 for failure to open (which shouldn't happen).
8733 2005-07-17 Paul Eggert <eggert@cs.ucla.edu>
8735 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
8736 1 on syntax error; just let yyparse do its thing.
8737 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
8738 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
8739 (Exploding the Stack Size with Alloca):
8740 (Exploding the Stack Size with Malloc):
8741 Expect exit status 2, not 1, since the parser is supposed to blow
8742 its stack. Problem reported by twlevo@xs4all.nl.
8744 * data/glr.c (yyparse): Don't assume that the initial calls
8745 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
8746 Print a stack-overflow message and fail instead.
8747 Initialize the line-number information before creating the stack,
8748 so that the stack-overflow message can report line zero safely.
8750 2005-07-14 Paul Eggert <eggert@cs.ucla.edu>
8752 Fix problems reported by twlevo@xs4all.nl.
8753 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
8754 (yyuserMerge): Provide a default case if b4_mergers is empty.
8755 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
8756 * tests/glr-regression.at
8757 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
8758 Add casts to pacify C++ compilers.
8759 * tests/glr-regression.at (Improper merging of GLR delayed action
8760 sets): Declare yylex before using it.
8761 * tests/Makefile.am (maintainer-check-g++): Fix a stray
8762 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
8763 test for valgrind; valgrind is independent of g++.
8764 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
8765 for compatibility with POSIX 1003.1-2001 (if running coreutils).
8766 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
8767 Use a destructor, so that we can expand the stack. Change
8768 YYSTYPE to char * so that we can free it. Cast result of malloc.
8770 2005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8772 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
8773 a valgrind failure. Problem reported by twlevo@xs4all.nl.
8775 2005-07-13 Paul Eggert <eggert@cs.ucla.edu>
8777 * PACKAGING: New file, suggested by Bruno Haible and taken from
8778 similar wording in gettext's PACKAGING file.
8779 * NEWS: Mention PACKAGING.
8780 * Makefile.am (EXTRA_DIST): Add PACKAGING.
8782 2005-07-12 Paul Eggert <eggert@cs.ucla.edu>
8784 * NEWS: Document recent i18n improvements.
8785 * bootstrap: Get runtime translations into runtime-po.
8786 Create runtime-po files automatically, if possible.
8787 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
8788 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
8789 does not infringe on the user's name space.
8790 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
8791 * doc/bison.texinfo (Internationalization): Revamp the English
8792 and Texinfo syntax a bit, to try to make it clearer.
8793 (Bison Options, Option Cross Key): Mention --print-localedir.
8794 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
8795 YYENABLE_NLS. Quote a bit more.
8796 * runtime-po/.cvsignore: New file.
8797 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
8798 * runtime-po/Rules-quot: Remove; now created by bootstrap.
8799 * runtime-po/quot.sed: Likewise.
8800 * runtime-po/boldquot.sed: Likewise.
8801 * runtime-po/en@quot.header: Likewise.
8802 * runtime-po/en@boldquot.header: Likewise.
8803 * runtime-po/insert-header.sin: Likewise.
8804 * runtime-po/remove-potcdate.sin: Likewise.
8805 * runtime-po/Makevars: Likewise.
8806 * runtime-po/LINGUAS: Likewise.
8807 * runtime-po/de.po: Likewise; we will rely on the translation project
8808 to maintain this, so "bootstrap" should get it.
8809 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
8811 * src/main.c (main): Bind the bison-runtime domain, too.
8813 2005-07-12 Bruno Haible <bruno@clisp.org>
8815 * data/yacc.c: Include <libintl.h> when NLS is enabled.
8816 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
8817 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
8818 * runtime-po: New directory.
8819 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
8820 $(DOMAIN).pot-update rule, so that old messages are never dropped.
8821 * runtime-po/Rules-quot: New file, copied from po/.
8822 * runtime-po/quot.sed: Likewise.
8823 * runtime-po/boldquot.sed: Likewise.
8824 * runtime-po/en@quot.header: Likewise.
8825 * runtime-po/en@boldquot.header: Likewise.
8826 * runtime-po/insert-header.sin: Likewise.
8827 * runtime-po/remove-potcdate.sin: Likewise.
8828 * runtime-po/Makevars: New file.
8829 * runtime-po/POTFILES.in: New file.
8830 * runtime-po/LINGUAS: New file.
8831 * runtime-po/bison-runtime.pot: New file.
8832 * runtime-po/de.po: New file.
8833 * m4/bison.m4: New file.
8834 * Makefile.am (SUBDIRS): Add runtime-po.
8835 (aclocaldir, aclocal_DATA): New variables.
8836 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
8838 * src/getargs.c (usage): Document --print-localedir option.
8839 (PRINT_LOCALEDIR_OPTION): New enum item.
8840 (long_options): Add --print-localedir option.
8841 (getargs): Handle --print-localedir option.
8842 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
8843 (Internationalization): New section.
8845 2005-07-12 Akim Demaille <akim@epita.fr>
8847 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
8848 for consistency with the rest of the code.
8849 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
8852 2005-07-12 Akim Demaille <akim@epita.fr>
8854 * src/parse-gram.y: Use %printer instead of YYPRINT.
8856 2005-07-12 Akim Demaille <akim@epita.fr>
8858 * src/symtab.h, src/symtab.c (symbol_print): New.
8859 * src/symlist.h, src/symlist.c (symbol_list_print): New.
8860 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
8862 2005-07-12 Akim Demaille <akim@epita.fr>
8864 * data/glr.c (b4_syncline): Fix (swap) the definitions of
8865 b4_at_dollar and b4_dollar_dollar.
8867 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
8869 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
8870 and Pennello's paper.
8872 2005-07-09 Paul Eggert <eggert@cs.ucla.edu>
8874 * data/yacc.c (yyparse): Undo previous patch. Instead,
8875 set yylsp[0] and yyvsp[0] only if the initial action
8876 sets yylloc and yylval, respectively.
8878 * data/yacc.c (yyparse): In the initial action, set
8879 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
8880 This avoids the use of undefined variables if the initial
8881 action does not set yylloc and/or yylval.
8883 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
8885 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
8886 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
8887 Remove from CVS. These files are automatically generated.
8888 * examples/extexi: Clarify that this file is now part of Bison,
8889 not GNU M4, and that it works with any POSIX-compatible Awk.
8890 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
8891 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
8892 so that we also get calc++-parser.yy. Geneate it.
8893 Use $(AWK), not gawk, since any conforming Awk will do.
8894 Put comment before action, since older 'make' can't handle comment
8896 $(BUILT_SOURCES): List all built sources, not just some of them.
8897 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
8898 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
8899 $($(calc_sources_generated)): Remove unnecessary test for existence
8900 of target. (This had a shell syntax error anyway; a stray "x".)
8901 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
8903 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
8905 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
8906 implied by the other modules.
8908 2005-07-06 Akim Demaille <akim@epita.fr>
8910 Bind examples/calc++ to the package.
8911 * examples/calc++/Makefile: Remove, replaced by...
8912 * examples/calc++/Makefile.am: ... this new file.
8913 * examples/calc++/test: Remove input.
8914 * examples/calc++/compile: Remove.
8915 * examples/Makefile.am: New.
8916 * configure.ac, Makefile.am: Adjust.
8917 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
8919 2005-07-05 Paul Eggert <eggert@cs.ucla.edu>
8921 * data/glr.c (yyFail): Drastically simplify; since the format argument
8922 never had any % directives, we can simply pass it to yyerror.
8923 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
8924 be modified later, as that is the usual style in glr.c.
8925 Problems reported by Paul Hilfinger.
8927 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
8928 and size overflow errors.
8929 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
8930 in case the user prolog sets feature-test macros like _GNU_SOURCE.
8931 (YYSIZEMAX): New macro.
8932 (yystpcpy): New function, taken from yacc.c.
8933 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
8934 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
8935 so that we don't have to maintain their signatures.
8936 (yyFail): Check for buffer overflow, by using vsnprintf rather
8937 than vsprintf. Allocate a bigger buffer if possible.
8938 Report an error if buffer allocation fails.
8939 (yyStackOverflow): New function.
8940 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
8941 the initialization was successful. It might fail if storage was
8943 (yyexpandGLRStack): Add more checks for storage allocation failure.
8944 Use yyStackOverflow to report failures.
8945 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
8946 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
8947 Don't assume stack number fits in int.
8948 (yysplitStack): Check for storage allocation failure.
8949 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
8950 can print diagnostics on storage allocation failure. All callers
8952 (yyresolveValue): Use yybool for boolean.
8953 (yyreportSyntaxError): Check for size-calculation overflow.
8954 This code is taken from yacc.c.
8955 (yyparse): Check for storage allocation errors when allocating
8958 2005-07-05 Akim Demaille <akim@epita.fr>
8960 Extract calc++ from the documentation.
8961 * doc/bison.texinfo (Calc++): Add the extraction marks.
8962 * examples/extexi: New, from the aborted GNU Programming 2E.
8963 Separate the different paragraph of a file with empty lines.
8964 * examples/Makefile: Use it to extract the whole calc++ example.
8966 2005-06-24 Akim Demaille <akim@epita.fr>
8968 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
8971 2005-06-22 Akim Demaille <akim@epita.fr>
8973 * doc/bison.texinfo (C++ Language Interface): First stab.
8974 (C++ Parsers): Remove.
8976 2005-06-22 Akim Demaille <akim@epita.fr>
8978 * data/lalr1.cc (yylex_): Honor %lex-param.
8980 2005-06-22 Akim Demaille <akim@epita.fr>
8982 Start a set of simple examples.
8983 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
8984 * examples/calc++/calc++-driver.hh,
8985 * examples/calc++/calc++-parser.yy,
8986 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
8987 * examples/calc++/compile, examples/calc++/test: New.
8989 2005-06-09 Paul Eggert <eggert@cs.ucla.edu>
8991 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
8992 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
8993 which stems from the 2005-05-27 patch.
8995 2005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8997 * data/glr.c: Modify treatment of unused parameters to permit use
8998 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
9000 2005-05-30 Paul Eggert <eggert@cs.ucla.edu>
9002 Fix infringement on user name space reported by Janos Zoltan Szabo.
9003 * data/yacc.c (yyparse): strlen -> yystrlen.
9005 2005-05-30 Akim Demaille <akim@epita.fr>
9007 * data/lalr1.cc (_): New.
9008 Translate the various messages.
9010 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
9012 Fix infringement on user name space reported by Bruno Haible.
9013 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
9014 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
9015 the user's name space.
9016 (alloca): Include <stdlib.h> to get it, if it's not built in.
9017 (YYMALLOC, YYFREE): Define only if needed.
9018 (malloc, free): Declare, but only if needed, as this infringes on
9019 the user name space.
9021 2005-05-25 Paul Eggert <eggert@cs.ucla.edu>
9023 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
9024 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
9026 * lib/ebitset.c (min, max): Undef before defining.
9027 * lib/vbitset.c (min, max): Likewise.
9028 * lib/subpipe.c (create_subpipe): Save local variables in case
9029 vfork clobbers them.
9031 2005-05-24 Bruno Haible <bruno@clisp.org>
9033 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
9034 error message syntax used by gcc-4.0.
9036 2005-05-23 Paul Eggert <eggert@cs.ucla.edu>
9038 * README: Mention m4 1.4.3. Remove obsolete advice about
9039 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
9041 * bootstrap: Remove workaround for problem I encountered with
9042 gettext 0.14.1; it seems to be fixed now.
9044 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
9046 * NEWS: Version 2.0a.
9048 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
9049 the previous change.
9051 Various maintainer cleanups.
9052 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
9053 conftest*, for benefit of CVS commands run at the same time as
9054 "configure". Add build-aux, since "bootstrap" now creates it and
9056 * Makefile.cfg (move_if_change): Remove.
9057 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
9058 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
9059 (po_repo, do-po-update, po-update, wget_files, get-targets):
9060 (config.guess-url_prefix, config.sub-url_prefix):
9061 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
9062 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
9063 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
9065 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
9066 this is now the recommended name.
9067 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
9068 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
9069 ylwrap. These files now go into build-aux.
9070 * config/move-if-change: Remove.
9071 * config/prev-version.txt: Bump from 1.75 to 2.0.
9073 * bootstrap: Add stdio-safer, unistd-safer modules.
9074 Remove m4/glibc2.m4 (introduced by latest gnulib, but
9076 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
9077 fopen-safer.c, stdio-safer.h, unistd-safer.h.
9078 * lib/subpipe.c: Include "unistd-safer.h".
9079 (create_subpipe): Make sure all the newly-created
9080 file descriptors are > 2, so that diagnostics don't
9081 get sent down them (which might cause Bison to hang, in theory).
9082 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
9083 * src/files.c (xfopen): Use fopen_safer, not fopen.
9085 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
9086 yesterday's yacc.c fix.
9088 2005-05-21 Paul Eggert <eggert@cs.ucla.edu>
9090 * data/glr.c, data/lalr1.cc: Update copyright date.
9092 Fix a destructor bug reported by Wolfgang Spraul in
9093 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
9094 * data/yacc.c (yyabortlab): Don't call destructor, and
9095 don't set yychar to EMPTY.
9096 (yyoverflowlab): Don't call destructor.
9097 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
9098 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
9099 since we no longer output the message "discarding lookahead token
9102 2005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
9104 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
9105 fix a small glitch in debugging output.
9106 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
9107 after YY_SYMBOL_PRINT where needed.
9109 (struct yyGLRState): Add some comments.
9110 (struct yySemanticOption): Add some comments.
9111 (union yyGLRStackItem): Add comment.
9113 (yymergeOptionSets): Correct this to properly perform the union,
9114 avoiding infinite reported by Michael Rosien.
9117 * tests/glr-regression.at: Add test for GLR merging error reported
9120 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
9122 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
9123 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
9124 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
9125 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
9126 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
9127 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
9128 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
9129 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
9130 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
9131 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
9132 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
9133 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
9134 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
9135 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
9136 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
9137 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
9138 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
9139 src/derives.h, src/files.c, src/files.h, src/getargs.c,
9140 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
9141 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
9142 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
9143 src/output.h, src/parse-gram.c, src/parse-gram.h,
9144 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
9145 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
9146 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
9147 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
9148 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
9149 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
9150 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
9151 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
9152 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
9153 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
9154 tests/reduce.at, tests/regression.at, tests/sets.at,
9155 tests/synclines.at, tests/testsuite.at, tests/torture.at:
9156 Update FSF postal mail address.
9158 2005-05-11 Paul Eggert <eggert@cs.ucla.edu>
9160 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
9161 Problem reported by Ralf Menzel.
9163 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
9165 * tests/actions.at: Test that stack overflow invokes destructors.
9166 From Marcus Holland-Moritz.
9167 * data/yacc.c (yyerrlab): Move the code that destroys the stack
9169 (yyreturn): to here. That way, destructors are called properly
9170 even if the stack overflows, or the user calls YYACCEPT or
9171 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
9172 (yyoverflowlab): Destroy the lookahead.
9174 2005-04-24 Paul Eggert <eggert@cs.ucla.edu>
9176 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
9178 2005-04-17 Paul Eggert <eggert@cs.ucla.edu>
9180 * NEWS: Bison-generated C parsers no longer quote literal strings
9181 associated with tokens.
9182 * src/output.c (prepare_symbols): Don't escape strings,
9183 since users don't want to see C escapes.
9184 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
9186 * tests/input.at (Torturing the Scanner): Likewise.
9187 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
9189 2005-04-16 Paul Eggert <eggert@cs.ucla.edu>
9191 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
9192 the data size is known to be too small and we can't increase it.
9193 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
9195 2005-04-15 Paul Eggert <eggert@cs.ucla.edu>
9197 * src/parse-gram.y: Include quotearg.h.
9198 (string_as_id): Quote $1 before using it as a key, since the
9199 lexer no longer quotes it for us.
9200 (string_content): Don't strip quotes, since lexer no longer
9202 * src/scan-gram.l: Include quotearg.h.
9204 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
9205 a key, since the rest of the lexer doesn't quote it.
9206 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
9207 * tests/regression.at (Token definitions): Check for backslashes
9210 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
9211 (YYSIZE_T): Define to unsigned long int when using an older compiler.
9212 (yyparse): Revamp code to generate long syntax error message, to
9213 make it easier to translate, and to avoid problems with arithmetic
9214 overflow. Change "virtual memory" to "memory" in diagnostic, since
9215 we don't know whether the memory is virtual.
9217 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
9219 * NEWS: Bison-generated C parsers now use the _ macro to
9221 * data/yacc.c (_) [!defined _]: New macro.
9222 All English strings wrapped inside this macro.
9223 * doc/bison.texinfo (Bison Parser): Document _.
9224 * po/POTFILES.in: Include src/parse-gram.c, since it now
9225 includes translateable strings that parse-gram.y doesn't.
9227 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
9229 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
9230 reverting the 2004-10-11 change to this function.
9231 (symbol_check_alias_consistency): Don't call symbol_type_set
9232 if the type name is already correct.
9233 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
9235 2005-03-25 Paul Eggert <eggert@cs.ucla.edu>
9237 * tests/regression.at (Token definitions): Don't use a token named
9238 c, as that generates a "#define c ..." that runs afoul of buggy
9239 stdlib.h that uses the identifier c as a member of struct
9240 drand48_data. Problem reported by Horst Wente.
9242 2005-03-21 Paul Eggert <eggert@cs.ucla.edu>
9244 * bootstrap: Change translation URL from
9245 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
9246 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
9247 redirection glitches. Problem reported by twlevo@xs4all.nl.
9249 2005-03-20 Paul Eggert <eggert@cs.ucla.edu>
9251 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
9252 after operands; POSIX says this isn't portable for the c99 command.
9254 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
9256 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
9257 immediately if a data overrun has occurred; this may help us track
9258 down what may be a spurious failure on MacOS.
9260 2005-03-17 Paul Eggert <eggert@cs.ucla.edu>
9262 Respond to problems reported by twlevo@xs4all.nl.
9264 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
9266 * src/vcg.h: Comment fix.
9267 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
9268 (G_CMAX): Change to -1 instead of INT_MAX.
9270 * data/yacc.c (yyparse): Omit spaces before #line.
9272 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
9274 * src/tables.c (state_number_to_vector_number): Put it inside an
9275 "#if 0", since it's not currently used. Problem reported by
9278 2005-03-06 Paul Eggert <eggert@cs.ucla.edu>
9280 * src/output.c (escaped_output): Renamed from
9281 escaped_file_name_output, since we now use it for symbol tags as
9282 well. All uses changed.
9283 (symbol_destructors_output, symbol_printers_output):
9284 Escape symbol tags too.
9285 Problem reported by Matyas Forstner in
9286 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
9288 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
9290 * src/output.c (user_actions_output, token_definitions_output,
9291 symbol_destructors_output, symbol_printers_output): Likewise.
9292 * src/reader.c (prologue_augment): Likewise.
9293 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
9295 * src/vcg.c (output_edge): Don't quote linestyle arg.
9296 Problem reported by twlevo@xs4all.nl.
9298 2005-02-28 Paul Eggert <eggert@cs.ucla.edu>
9300 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
9301 example, reported by Derek M Jones. Also, make the example even
9302 more outrageous, to better illustrate how bad the problem is.
9304 2005-02-24 Paul Eggert <eggert@cs.ucla.edu>
9306 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
9307 putsym. Typo reported by Sebastian Piping.
9309 2005-02-23 Paul Eggert <eggert@cs.ucla.edu>
9311 * doc/bison.texinfo (Language and Grammar): some -> same
9312 (Epilogue): int he -> in the
9313 Typos reported by Sebastian Piping via Justin Pence.
9315 2005-02-07 Paul Eggert <eggert@cs.ucla.edu>
9317 * tests/glr-regression.at (Improper handling of embedded actions
9318 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
9319 embedded actions and $-N in GLR parsers", work around an Autoconf bug
9320 with dollar signs in test names.
9321 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
9322 for a similar reason.
9324 2005-01-28 Paul Eggert <eggert@cs.ucla.edu>
9326 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
9327 wants to redefine G_VIEW.
9329 2005-01-27 Paul Eggert <eggert@cs.ucla.edu>
9331 * src/vcg.c (get_view_str): Remove case for normal_view.
9332 Problem reported by twlevo@xs4all.nl.
9334 2005-01-24 Paul Eggert <eggert@cs.ucla.edu>
9336 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
9337 Problem reported by twlevo@xs4all.nl.
9339 * doc/bison.texinfo: Change @dircategory from "GNU programming
9340 tools" to "Software development". Requested by Richard Stallman
9343 2005-01-23 Paul Eggert <eggert@cs.ucla.edu>
9345 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
9346 Problem reported by twlevo@xs4all.nl.
9348 2005-01-21 Paul Eggert <eggert@cs.ucla.edu>
9350 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
9351 keyword; it's not needed with modern compilers, and it doesn't
9352 affect correctness with older compilers. Suggested by
9355 2005-01-17 Paul Eggert <eggert@cs.ucla.edu>
9357 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
9358 gcc -Wswitch-default.
9359 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
9360 * data/yacc.c (yyparse): Likewise.
9362 2005-01-12 Paul Eggert <eggert@cs.ucla.edu>
9364 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
9365 already. Let config.h define any nonstandard values.
9367 2005-01-10 Paul Eggert <eggert@cs.ucla.edu>
9369 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
9370 for the benefit of slower hosts. Problem reported by
9373 2005-01-07 Paul Eggert <eggert@cs.ucla.edu>
9375 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
9376 being defined and not used.
9377 * data/lalr1.cc (yyparse): Likewise.
9378 Use "if (false)" rather than "if (0)".
9380 2005-01-05 Paul Eggert <eggert@cs.ucla.edu>
9382 * TODO: Mention that we should allow NUL bytes in tokens.
9384 2005-01-02 Paul Eggert <eggert@cs.ucla.edu>
9386 * src/scan-skel.l (<<EOF>>): Don't close standard output.
9387 Problem reported by Hans Aberg.
9389 2005-01-01 Paul Eggert <eggert@cs.ucla.edu>
9391 * src/getargs.c (version): Happy new year; update overall
9392 program copyright date from 2004 to 2005.
9394 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
9395 Problem reported by Hans Aberg.
9396 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
9397 (Output file names.): Add a test for the case when standard output
9400 2004-12-26 Paul Eggert <eggert@cs.ucla.edu>
9402 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
9403 to fix an oversight in the Bison 2.0 manual.
9405 2004-12-25 Paul Eggert <eggert@cs.ucla.edu>
9407 * NEWS: Version 2.0. Reformat the existing news items since
9408 1.875, so that related items are grouped together.
9409 * configure.ac (AC_INIT): Bump version to 2.0.
9410 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
9412 * tests/torture.at (Exploding the Stack Size with Alloca): Set
9413 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
9414 otherwise, we're not testing alloca. Unfortunately there's no
9415 simple way to consult HAVE_ALLOCA here.
9417 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
9420 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
9421 hand. This avoids a warning about comparing int to size_t when
9422 GCC warnings are enabled.
9424 2004-12-22 Paul Eggert <eggert@cs.ucla.edu>
9426 * NEWS: Bison-generated parsers no longer default to using the
9427 alloca function (when available) to extend the parser stack, due
9428 to widespread problems in unchecked stack-overflow detection.
9429 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
9430 responsibility to set it to a positive value. This lets the user
9431 specify a value that is not a preprocessor constant.
9432 * data/yacc.c (YYMAXDEPTH): Likewise.
9433 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
9434 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
9435 to be a compile-time constant. However, explain the constraints on it.
9436 Also, explain the constraints on YYINITDEPTH.
9437 (Table of Symbols): Explain that alloca is no longer the default.
9438 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
9441 * doc/bison.texinfo (Location Default Action): Mention that n must
9442 be zero when k is zero. Suggested by Frank Heckenbach.
9444 2004-12-22 Akim Demaille <akim@epita.fr>
9446 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
9447 (parser::state_type, parser::semantic_type, parser::location_type):
9448 Private, not public.
9449 (parser::parse): Return ints, not bool.
9450 Returning a bool introduces a problem: 0 corresponds to false, and
9451 it seems weird to return false on success. Returning true changes
9452 the conventions for yyparse.
9453 Alternatively we could return void and send an exception.
9454 There is no clear consensus (yet?).
9455 (state_stack, semantic_stack, location_stack): Rename as...
9456 (state_stack_type, semantic_stack_type, location_stack_type): these.
9457 Private, not public.
9458 * tests/c++.at: New.
9459 * tests/testsuite.at, tests/Makefile.am: Adjust.
9461 2004-12-21 Akim Demaille <akim@epita.fr>
9463 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
9465 2004-12-21 Akim Demaille <akim@epita.fr>
9467 Don't impose std::string for filenames.
9469 * data/lalr1.cc (b4_filename_type): New.
9470 (position::filename): Use it.
9471 (parser.hh): Move the inclusion of stack.hh and location.hh below
9472 the user code, so that needed headers for the filename type can be
9474 Forward declare them before the user code.
9475 * tests/Makefile.am (check-local, installcheck-local): Pass
9476 TESTSUITEFLAGS to the TESTSUITE.
9478 2004-12-20 Akim Demaille <akim@epita.fr>
9480 Use more STL like names: my_class instead of MyClass.
9482 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
9483 (SemanticStack, SemanticType, StateStack, StateType)
9484 (TokenNumberType, Stack, Slice, Traits, Parser::location)
9485 (Parser::value): Rename as...
9486 (location_stack, location_type, rhs_number_type, semantic_stack)
9487 (semantic_type, state_stack, state_type, token_number_type, stack)
9488 (slice, traits, parser::yylloc, parser::yylval): these.
9490 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
9492 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
9494 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
9495 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
9497 2004-12-17 Paul Eggert <eggert@cs.ucla.edu>
9499 Remove uses of 'short int' and 'unsigned short int'. This raises
9500 some arbitrary limits. It uses more memory but nowadays that's
9501 not much of an issue.
9503 This change does not affect the generated parsers; that's a different
9504 task, as some users will want to conserve memory there.
9506 Ideally we should use size_t to represent all object counts, and
9507 something like ptrdiff_t to represent signed differences of object
9508 counts; but that will require more code-cleanup than I have the
9509 time to do right now.
9511 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
9512 Use size_t, not int or short int, to count objects.
9513 * src/closure.c (nritemset, closure): Likewise.
9514 * src/closure.h (nritemset, closure): Likewise.
9515 * src/nullable.c (nullable_compute): Likewise.
9516 * src/print.c (print_core): Likewise.
9517 * src/print_graph.c (print_core): Likewise.
9518 * src/state.c (state_compare, state_hash): Likewise.
9519 * src/state.h (struct state): Likewise.
9520 * src/tables.c (default_goto, goto_actions): Likewise.
9522 * src/gram.h (rule_number, rule): Use int, not short int.
9523 * src/output.c (prepare_rules): Likewise.
9524 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
9525 errs, reductions): Likewise.
9526 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
9528 * src/tables.c (vector_number, tally, action_number,
9529 ACTION_NUMBER_MINIMUM): Likewise.
9530 * src/output.c (muscle_insert_short_int_table): Remove.
9532 2004-12-17 Akim Demaille <akim@epita.fr>
9534 * data/lalr1.cc: Extensive Doxygenation.
9535 (error_): Rename as...
9536 (error): this, since it is visible to the user.
9538 (Parser::message): Now an automatic variable from...
9539 (Parser::yyreport_syntax_error_): here.
9540 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
9542 * tests/input.at: Escape $.
9544 2004-12-16 Paul Eggert <eggert@cs.ucla.edu>
9546 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
9547 Parenthesize rhs to avoid obscure problems with mistakes like
9548 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
9549 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
9550 b4_rhs_location): Likewise.
9551 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
9552 b4_rhs_location): Likewise.
9554 2004-12-16 Akim Demaille <akim@epita.fr>
9556 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
9557 yacc.c: be sure to stay within yycheck_.
9558 * tests/actions.at: Re-enable C++ tests.
9560 2004-12-16 Akim Demaille <akim@epita.fr>
9562 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
9565 2004-12-16 Akim Demaille <akim@epita.fr>
9567 Use #define to handle the %name-prefix.
9569 * data/glr.c, data/yacc.c: Comment changes.
9570 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
9571 so that one can refer to yylex in the parser file, and have it
9572 renamed, as is the case with other skeletons.
9574 2004-12-16 Akim Demaille <akim@epita.fr>
9576 Move lalr1.cc internals into yy*.
9578 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
9579 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
9580 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
9581 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
9582 (empty_, final_, terror_, errcode_, ntokens_)
9583 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
9584 (looka_, ilooka_, error_range_, nerrs_):
9586 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
9587 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
9588 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
9589 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
9590 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
9591 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
9592 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
9593 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
9596 2004-12-15 Paul Eggert <eggert@cs.ucla.edu>
9598 Fix some problems reported by twlevo at xs4all.
9599 * src/symtab.c (symbol_new): Report an error if the input grammar
9600 contains too many symbols. This is better than calling abort() later.
9601 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
9602 (struct node, struct graph):
9603 Rename member expand to stretch. All uses changed.
9604 (struct graph): Remove member layoutalgorithm. All uses removed.
9605 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
9606 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
9608 (N_STRETCH): Rename from N_EXPAND. All uses changed.
9610 2004-12-15 Akim Demaille <akim@epita.fr>
9612 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
9613 Add more Doxygen comments.
9614 (symprint_, stack_print_, reduce_print_, destruct_, pop)
9615 (report_syntax_error_, translate_): Rename as...
9616 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
9617 (yypop_, yyreport_syntax_error_, yytranslate_): this.
9619 2004-12-15 Akim Demaille <akim@epita.fr>
9621 * data/lalr1.cc (lex_): Rename as...
9623 Move the trace here.
9624 Take the %name-prefix into account.
9625 Reported by Alexandre Duret-Lutz.
9627 2004-12-15 Akim Demaille <akim@epita.fr>
9629 Simplify the C++ parser constructor.
9631 * data/lalr1.cc (debug_): Rename as...
9632 (yydebug_): so that the parser's internals are always in the yy*
9635 (b4_parse_param_decl): Remove the leading comma as it is now only
9636 called as unique argument list.
9637 (Parser::Parser): Remove the constructor accepting a location and
9638 an initial debugging level.
9639 Remove from the other ctor the argument for the debugging level.
9640 (debug_level_type, debug_level, set_debug_level): New.
9642 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
9645 2004-12-15 Akim Demaille <akim@epita.fr>
9647 Remove b4_root related material: failure experiment
9648 (which goal was to allow to derive from a class).
9650 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
9651 definitions and uses.
9653 2004-12-14 Paul Eggert <eggert@cs.ucla.edu>
9655 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
9656 not 2, since it's not portable to subtract 1 from the start of an
9657 array. The new item 0 is never set or used. All uses changed.
9659 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
9660 the default definition of YYLLOC_DEFAULT. Problem reported
9661 by Frank Heckenbach.
9663 2004-12-12 Paul Eggert <eggert@cs.ucla.edu>
9665 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
9666 the normal case and one for the error case. Just use the
9667 first one uniformly. Problem reported by Frank Heckenbach.
9668 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
9669 use exactly the same macro in both places.
9670 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
9671 so that the normal-case YYRHSLOC works for the error case too.
9673 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
9674 (YYLLOC_DEFAULT): Use the same macro as glr.c.
9675 * doc/bison.texinfo (Location Default Action): Don't claim that
9676 we have an array of locations. Use the same macro for both glr
9677 and lalr parsers. Mention YYRHSLOC. Mention what happens when
9680 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
9682 * HACKING: Update email addresses to send announcements to.
9684 * configure.ac (AC_INIT): Bump version to 1.875f.
9686 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
9688 * NEWS: Version 1.875e.
9689 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
9691 * src/scan-skel.l: Include "complain.h", for "fatal".
9693 * src/relation.h (relation_print, relation_digraph):
9694 Relation sizes are of type relation_node, not size_t (this is
9695 merely a doc fix, since the two types are equivalent).
9696 (relation_transpose): Relation sizes are of type relation_node,
9698 * src/relation.c: Likewise.
9699 (top, infinity): Now of type relation_node, not int.
9700 (traverse, relation_transpose): Use relation_node, not int.
9702 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
9703 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
9704 (yyparse): Remove unused local introduced in 2004-10-25 patch.
9706 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
9707 specifying whether the test should be skipped. Use it tp
9708 specify that the [%defines %skeleton "lalr1.cc"] tests currently
9709 fail on some hosts, and should be skipped.
9711 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
9713 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
9714 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
9715 unless otherwise specified below.
9717 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
9718 to allocate kernel_base, kernel_items, kernel_size, since
9719 they needn't be initialized to 0.
9720 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
9721 * src/closure.c (new_closure): Likewise, for itemset.
9722 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
9723 * src/lalr.c (set_goto_map): Likewise, for temp_map.
9724 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
9725 (build_relations): Likewise for edge, states1, includes.
9726 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
9727 * src/reader.c (packgram): Likewise, for ritem, rules.
9728 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
9729 * src/relation.c (relation_digraph): Likewise for VERTICES.
9730 (relation_transpose): Likewise for new_R, end_R.
9731 * src/symtab.c (symbols_token_translations_init): Likewise for
9733 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
9734 (token_actions): Likewise for yydefact, actrow, conflrow,
9736 (save_column): Likewise for froms[symno], tos[symno].
9737 (goto_actions): Likewise for state_count.
9738 (pack_table): Likewise for base, pos, check.
9739 (tables_generate): Likewise for width.
9741 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
9742 for initial core. Just have a separate core, so we needn't worry
9743 about whether kernel_size and kernel_base are initialized.
9745 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
9746 kernel_size, kernel_items): Remove unnecessary initialization.
9747 * src/conflicts.c (conflicts): Likewise.
9748 * src/derives.c (derives): Likewise.
9749 * src/muscle_tablc (muscle_insert): Likewise.
9750 * src/relation.c (relation_digraph): Likewise.
9751 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
9752 conflrow, conflict_table, conflict_list, table, check):
9755 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
9756 This is because all callers pass unsigned int.
9757 * src/closure.h (new_closure): Likewise.
9759 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
9760 (build_relations): Initialize includes[i] in all cases.
9761 * src/reader.c (packgram): Always initialize rules[ruleno].prec
9762 and rules[ruleno].precsym. Initialize members in order.
9763 * src/relation.c (relation_transpose): Always initialize new_R[i]
9765 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
9767 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
9768 conflict_list[0] was always 0, but now it isn't initialized.
9770 * src/table.c (table_grow): When conflict_table grew, the grown
9771 area wasn't cleared. Fix this.
9773 * lib/.cvsignore: Add strdup.c, strdup.h.
9774 * m4/.cvsignore: Add strdup.m4.
9776 2004-12-07 Paul Eggert <eggert@cs.ucla.edu>
9778 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
9779 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
9780 GOTO_NUMBER_MAXIMUM, since we occasionally compute
9781 ngotos + 1 without checking for overflow.
9782 (build_relations): Use END_NODE, not -1, to denote end of edges.
9783 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
9784 build_relations): Use goto_number, not int, for goto numbers.
9785 * src/tables.c (save_column, default_goto): Likewise.
9787 2004-11-23 Akim Demaille <akim@epita.fr>
9789 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
9790 of #defining from yystype.
9791 Don't typedef yystype, C++ does not need it.
9792 This lets it possible to forward declare it as union.
9794 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
9796 * bootstrap (gnulib_modules): Add extensions.
9797 Problem reported by Jim Meyering.
9799 2004-11-22 Paul Eggert <eggert@cs.ucla.edu>
9801 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
9802 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
9803 src/system.h, src/tables.c: XFREE -> free, to accommodate
9804 recent change to gnulib xalloc.h.
9805 Problem reported by Jim Meyering.
9807 2004-11-17 Akim Demaille <akim@epita.fr>
9809 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
9811 2004-11-17 Akim Demaille <akim@epita.fr>,
9812 Alexandre Duret-Lutz <adl@gnu.org>
9814 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
9817 Use it instead of cdebug_.
9818 (Parser::debug_stream, Parser::set_debug_stream): New.
9819 (Parser::symprint_): Define cdebug_ for temporary backward
9821 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
9824 2004-11-17 Akim Demaille <akim@epita.fr>
9826 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
9827 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
9828 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
9829 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
9831 2004-10-27 Paul Eggert <eggert@cs.ucla.edu>
9833 * data/glr.c (yyloc_default): Remove; not used.
9834 Problem reported by Frank Heckenbach.
9836 2004-10-25 Akim Demaille <akim@epita.fr>
9838 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
9839 Introduce another definition to address simple location arrays.
9840 (yyGLRStack): New member: yyerror_range.
9841 (yyrecoverSyntaxError, yyparse): Update it.
9842 (yyrecoverSyntaxError): Use it when shifting the error token to
9843 have an accurate range, equivalent to the one computed by both
9844 yacc.c and lalr1.cc.
9845 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
9846 that column numbers start at column 0, as per GNU Coding
9847 Standards, the others tests, and the doc.
9848 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
9849 Adjust to the above change (first column is 0).
9850 And adjust the location of the "<error>", now covering the whole
9853 2004-10-22 Akim Demaille <akim@epita.fr>
9854 and Paul Eggert <eggert@cs.ucla.edu>
9856 Remove some arbitrary limits on goto numbers and relations.
9857 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
9858 initial values, since they're never used.
9859 (set_goto_map): ngotos is now unsigned, so test for overflow
9860 by seeing whether it wraps around to zero.
9861 * src/lalr.h (goto_number): Now size_t, not short int.
9862 (GOTO_NUMBER_MAXIMUM): Remove.
9863 * src/relation.c (relation_print, traverse, relation_transpose):
9864 Check for END_NODE rather than looking at sign.
9865 * src/relation.h (END_NODE): New macro.
9866 (relation_node): Now size_t, not short int.
9868 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
9870 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
9871 keyword, not an identifier. Problem reported by Baron Schwartz in
9872 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
9874 2004-10-11 Akim Demaille <akim@epita.fr>
9876 * src/symtab.c (symbol_check_alias_consistency): Also check
9877 type names, destructors, and printers.
9878 Reported by Alexandre Duret-Lutz.
9879 Recode the handling of associativity and precedence in terms
9880 of symbol_precedence_set.
9881 Accept no redeclaration at all, not even equal to the previous
9883 (redeclaration): New.
9884 Use it to factor redeclaration complaints.
9885 (symbol_make_alias): Don't set the type of the alias, let
9886 symbol_check_alias_consistency do it as for other features.
9887 * src/symtab.h (symbol): Add new member prec_location, and
9889 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
9890 * tests/input.at (Incompatible Aliases): New.
9892 2004-10-09 Paul Eggert <eggert@cs.ucla.edu>
9894 .cvsignore fixes to accommodate gnulib changes,
9895 and the practice of naming build directories "_build".
9896 * .cvsignore: Add "_*". Sort.
9897 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
9898 * m4/.cvsignore: Add "*_gl.m4".
9900 2004-10-06 Akim Demaille <akim@epita.fr>
9902 * src/parse-gram.y (add_param): Fix the truncation of trailing
9905 2004-10-05 Akim Demaille <akim@epita.fr>
9907 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
9908 whether the reducion was empty or not. This leaves room to
9909 improve the use of YYLLOC_DEFAULT in such a case.
9910 lalr1.cc is still experimental, so changing this is acceptable.
9911 And finally, there are probably not many users who changed the
9912 handling of locations in GLR, so changing is admissible too.
9914 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
9915 empty reduction, set @$ to an empty location ending the previously
9917 Adjust uses to make sure the code is triggered on empty
9919 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
9920 expected output: empty reductions have empty locations.
9922 2004-09-29 Akim Demaille <akim@epita.fr>
9924 * data/lalr1.cc: Move towards a more standard C++ coding style
9925 for templates: Class < T > -> Class<T>.
9927 2004-09-29 Akim Demaille <akim@epita.fr>
9929 * data/lalr1.cc: Reinstall the former ctor, for sake of
9930 compatibility, but warn it will be removed.
9931 Move towards a more standard C++ coding style (i.e., type *var ->
9934 2004-09-27 Paul Eggert <eggert@cs.ucla.edu>
9936 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
9937 since it's less likely to work if NULs are involved in the future.
9939 2004-09-27 Akim Demaille <akim@epita.fr>
9941 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
9943 2004-09-27 Akim Demaille <akim@epita.fr>
9945 * data/lalr1.cc (b4_parse_param_decl_1): New.
9946 (b4_parse_param_decl): Use it to have different names between attribute
9948 (b4_cc_constructor_call): Likewise.
9950 2004-09-24 Akim Demaille <akim@epita.fr>
9952 * src/parse-gram.y (add_param): Strip the leading and trailing
9953 blanks from a formal argument declaration.
9954 (YY_LOCATION_PRINT): New.
9956 2004-09-24 Akim Demaille <akim@epita.fr>
9958 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
9961 2004-09-24 Akim Demaille <akim@epita.fr>
9963 * doc/bison.texinfo (Table of Symbols): Sort.
9965 2004-09-21 Akim Demaille <akim@epita.fr>
9967 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
9968 the useless parentheses.
9969 Suggested by Paul Eggert.
9971 2004-09-20 Akim Demaille <akim@epita.fr>
9973 Let the initial-action act on the look-ahead, and use it for the
9974 "initial push" (corresponding to an hypothetical beginning-of-file).
9975 And let lalr1.cc honor %initial-action.
9977 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
9979 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
9980 (Parser::Parser): Remove the ctor that used to initialize it.
9981 (Parser::parse): Like in the other skeletons, issue the "starting
9982 parse" message before any action.
9983 Honor %initial-action.
9984 Initialize the stacks with the lookahead.
9985 * data/yacc.c: Let $$ and @$ in %initial-action designate the
9987 Push them in the stacks.
9988 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
9990 2004-09-20 Akim Demaille <akim@epita.fr>
9992 * doc/bison.texinfo (Initial Action Decl): New.
9994 2004-09-20 Akim Demaille <akim@epita.fr>
9996 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
9997 clearer criterion to define it.
9998 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
9999 When reducing on an empty RHS, use the latest stacked location as
10001 yylloc is not always available.
10002 * data/glr.c: Likewise.
10003 Also, honor initial-actions.
10005 2004-09-20 Akim Demaille <akim@epita.fr>
10007 * data/yacc.c (YY_LOCATION_PRINT): New.
10008 Define when we know YYLTYPE's structure, i.e., when the default
10009 YYLLOC_DEFAULT is used.
10010 * data/c.m4 (b4_yysymprint_generate): Use it.
10011 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
10012 value of the result.
10013 (error_start_): Replace with...
10014 (error_range_): this location array.
10015 This allows to replace code relying on the implementation of
10016 locations by portable code.
10017 * data/yacc.c (yylerrsp): Replace with...
10018 (yyerror_range): this.
10019 Every time a token is popped, update yyerror_range[0], to have an
10020 accurate location for the error token.
10021 * data/glr.c (YY_LOCATION_PRINT): New.
10022 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
10023 deference a pointer.
10024 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
10025 report the location in %printers.
10027 * src/scan-skel.l: Instead of abort, report error messages to ease
10028 understanding skeleton scanning failures.
10030 2004-09-16 Akim Demaille <akim@epita.fr>
10032 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
10033 (iterator, const_iterator): these, to be more in the C++ spirit.
10034 Also, return reverse iterators so that when displaying the stack
10035 we display its bottom first.
10036 (Parser::stack_print_, Parser::reduce_print_): Match the messages
10038 We should probably use vector here though.
10040 2004-09-16 Akim Demaille <akim@epita.fr>
10042 Have more complete shift traces.
10044 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
10045 to report Shifts instead of ad hoc YYDPRINTF invocations,
10046 including for the error token.
10047 * data/lalr1.cc (symprint_): Output the location.
10048 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
10049 output the location within the %printer.
10050 Activate GLR tests, at least to make sure they compile properly.
10051 They still don't pass though.
10052 * tests/calc.at: Adjust expect verbose output, since now "Entering
10053 state..." is on a different line than the "Shifting" message.
10055 2004-09-08 Akim Demaille <akim@epita.fr>
10057 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
10058 Bison directive from the Bison file to the invocation of this
10059 macro, so that these directives are passed to
10060 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
10061 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
10062 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
10063 the extra Bison directives instead of the whole series.
10064 Change the grammar so that there are recoverable errors, and
10065 unrecoverable errors. Now we can have the parser give up before
10066 consuming the whole input. As a result we now can observe that
10067 the lookahead is freed when needed.
10068 Change the parser source to parse argv[1] instead of a hard coded
10070 Simplify yylex, and give a value and location to EOF.
10071 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
10072 passed directives already coded in the file.
10073 Add some tests to check the location of "error".
10074 For some tests, the C++ parser is correct, and not yacc.c.
10075 For other tests, they provide different, but unsatisfying, values,
10076 so keep the C++ value so that at least one parser is "correct"
10077 according to the test suite.
10078 (Actions after errors): Remove, this is subsumed by the
10079 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
10081 2004-09-06 Akim Demaille <akim@epita.fr>
10083 * data/lalr1.cc: Adjust the indentation of the labels.
10084 (Parser::pop): New.
10087 2004-09-06 Akim Demaille <akim@epita.fr>
10089 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
10090 argument, an informative message.
10091 Call YY_SYMBOL_PRINT.
10092 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
10093 * data/lalr1.cc (destruct_): Likewise.
10094 In addition, no longer depend on b4_yysymprint_generate and
10095 b4_yydestruct_generate to generate these functions, do it "by
10098 2004-09-03 Akim Demaille <akim@epita.fr>
10100 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
10101 invoked, yydestruct the lookahead.
10102 * tests/calc.at (Calculator $1): Update the expected lengths of
10103 traces: there is an added line for the discarded lookahead.
10104 * doc/bison.texinfo (Destructor Decl): Some rewording.
10105 Define "discarded" symbols.
10107 2004-09-02 Akim Demaille <akim@epita.fr>
10109 * data/lalr1.cc (translate_, destruct_): No reason to be static.
10111 2004-09-02 Akim Demaille <akim@epita.fr>
10113 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
10114 (YYDSYMPRINTF): Rename as...
10115 (YY_SYMBOL_PRINT): this.
10116 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
10118 Use it instead of direct symprint_ calls.
10119 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
10122 2004-09-02 Akim Demaille <akim@epita.fr>
10124 * data/lalr1.cc (b4_yysymprint_generate): New.
10125 (symprint_): New member function, defined when YYDEBUG.
10126 Use it consistently instead of token/nterm debugging output by
10128 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
10129 %printer calls to use cdebug_ when using lalr1.cc.
10131 2004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
10133 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
10134 with #ifdef YYDEBUG.
10136 2004-08-26 Akim Demaille <akim@epita.fr>
10138 * doc/bison.texinfo (Implementing Loops): Rename as...
10139 (Implementing Gotos/Loops): this.
10141 2004-08-13 Paul Eggert <eggert@cs.ucla.edu>
10143 Adjust to latest gnulib.
10144 * bootstrap (gnulib_modules): Add xalloc-die.
10145 Set LC_ALL=C so that file names sort consistently.
10146 Prefer the gnulib copies of gettext.m4, glibc21.m4,
10147 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
10148 uintmax_t.m4, ulonglong.m4.
10149 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
10150 po.m4 since we are now using _gl.m4 instead.
10152 2004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
10154 * src/scan-action.l: Remove. Scanning of semantic actions is
10155 handled in scan-gram.l.
10157 2004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
10159 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
10161 * src/location.h (struct): The file member is a uniqstr.
10162 (equal_boundaries): Use UNIQSTR_EQ for comparison.
10164 2004-07-22 Paul Eggert <eggert@cs.ucla.edu>
10166 Fix bug with non-%union parsers that have printers or destructors,
10167 which led to a Bison core dump. Reported by Peter Fales in
10168 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
10170 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
10171 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
10172 not to our own type.
10173 * src/output.c (symbol_destructors_output, symbol_printers_output):
10174 Don't assume %union.
10175 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
10176 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
10177 UNION-FLAG. All callers changed.
10178 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
10179 Use type char, not unsigned int, when declaring an array of char;
10180 this lets us remove a cast.
10181 (Printers and Destructors): Add non-%union test cases.
10183 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
10185 * doc/bison.texinfo: Minor editorial changes, mostly to the new
10186 GLR writeups. E.g., avoid frenchspacing and the future tense,
10187 change "lookahead" to "look-ahead", and change "wrt" to "with
10190 2004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10192 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
10193 New sections, split off from the GLR Parsers section. Put the new
10194 Simple GLR Parser near the start of the GLR section, for clarity.
10195 Rewrite connective text.
10197 2004-06-21 Frank Heckenbach <frank@g-n-u.de>
10199 * doc/bison.texinfo (Simple GLR Parsers): New section.
10201 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
10203 * NEWS, TODO, doc/bison.texinfo:
10204 Use "look-ahead" instead of "lookahead", to be consistent.
10205 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
10206 while we're fixing "look-ahead".
10207 * src/conflicts.c (shift_set): Renamed from shiftset.
10208 (look_ahead_set): Renamed from lookaheadset.
10209 * src/print.c: Likewise.
10210 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
10211 name for "lookahead".
10212 (report_types, usage): Likewise.
10213 * src/getargs.h (report_look_ahead_tokens): Renamed from
10215 * src/lalr.c (compute_look_ahead_tokens): Renamed from
10216 compute_lookaheads.
10217 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
10218 (look_ahead_tokens_print): Renamed from lookaheads_print.
10219 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
10220 state_rule_lookaheads_print.
10221 * src/state.h: Likewise.
10222 (reductions.look_ahead_tokens): Renamed from lookaheads.
10223 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
10224 AT_DATA_LOOKAHEADS_GRAMMAR.
10226 2004-06-03 Paul Eggert <eggert@cs.ucla.edu>
10228 * README: Update location of patched M4 distribution.
10230 2004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
10232 Don't assume the C++ compiler takes the same arguments as the C compiler
10234 * configure.ac (O0CXXFLAGS): New var.
10235 * tests/atlocal.in (CXXFLAGS): Use it.
10237 2004-05-29 Paul Eggert <eggert@cs.ucla.edu>
10239 Fix some "make check" problems with C++ reported by
10240 Albert Chin-A-Young for Tru64 C++ in this thread:
10241 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
10243 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
10244 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
10245 Output to a .cc file for C++, not to a .c file.
10246 * tests/calc.at (AT_CHECK_CALC): Likewise.
10247 * tests/regression.at (AT_CHECK_DANCER): Likewise.
10248 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
10250 2004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
10252 * tests/calc.at, tests/actions.at: Workaround for SGI
10253 C++ compiler. (trivial change)
10255 2004-05-27 Paul Eggert <eggert@cs.ucla.edu>
10257 Spent a few hours checking out which prerequisite versions the
10258 current sources actually require. I went all the way back to
10259 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
10260 a seemingly endless set of combinations of versions more recent
10261 than that. The bottom line is that the current sources require
10262 fairly recent versions of the build tools, and it'll be some work
10264 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
10265 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
10266 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
10267 Add comments explaining why those particular versions are
10270 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
10271 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
10272 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
10274 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
10275 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
10277 2004-05-26 Paul Eggert <eggert@cs.ucla.edu>
10279 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
10280 0.11.5. Suggested by Bruno Haible.
10281 * bootstrap: Remove gettext version checking.
10283 * doc/bison.texinfo (Decl Summary): Also mention that %union
10284 can depend on prerequisite types. Problem reported by Tim
10287 2004-05-25 Paul Eggert <eggert@cs.ucla.edu>
10289 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
10290 * README-alpha: Don't tell people not to package this.
10292 * bootstrap: Don't assume $(...) works; use `...` instead.
10293 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
10296 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
10297 put into the -d output file, and mention what to do if YYSTYPE is
10298 defined as a macro.
10300 2004-05-24 Paul Eggert <eggert@cs.ucla.edu>
10302 Undo change made earlier today: it caused autopoint to not bring
10303 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
10306 * bootstrap: Check that gettext version matches what's in
10307 configure.ac. Warn users to ignore robots.txt ERROR 404.
10308 * bootstrap: Undo today's earlier change (logged below).
10309 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
10311 The gettext version checking is causing more trouble than it's
10312 curing; remove it. Problem reported by Paul Hilfinger.
10314 * bootstrap: Issue a warning that one can expect a message
10315 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
10316 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
10318 2004-05-23 Paul Eggert <eggert@cs.ucla.edu>
10320 Ensure that the C++ compiler used for testing actually works on a
10321 simple test program; if not, skip the C++-related tests. Problem
10322 reported by Vin Shelton in:
10323 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
10325 * m4/cxx.m4: New file.
10326 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
10327 * tests/atlocal.in (BISON_CXX_WORKS): Add.
10328 * tests/local.at (AT_COMPILE_CXX): Use it.
10330 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
10332 * data/glr.c (yylloc): Output this macro even if locations are not
10333 being generated, as the GLR parser needs it even in that case.
10334 Problem reported by Troy A. Johnson
10335 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
10337 * configure.ac (AC_INIT): Update to 1.875e.
10339 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
10341 * NEWS: Version 1.875d.
10342 * configure.ac (AC_INIT): Likewise.
10343 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
10345 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
10346 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
10347 lalr1.cc runs afoul of the first, and the last two are no longer
10348 supported by GCC 3.4.0.
10349 * README: Mention GNU m4 1.4 or later; mention m4 patches.
10350 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
10352 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
10354 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
10355 unsigned int, for compatibility with latest gnulib hash module.
10356 * src/state.c (state_hash, state_hasher): Likewise.
10357 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
10358 * src/uniqstr.c (hash_uniqstr): Likewise.
10360 2004-05-03 Paul Eggert <eggert@cs.ucla.edu>
10362 * NEWS: Unescaped newlines are no longer allowed in char & strings.
10364 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
10365 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
10366 character and string literals.
10367 (unexpected_end): New function.
10368 (unexpected_eof): Use it.
10369 (unexpected_newline): New function.
10370 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
10373 * NEWS: Document %expect-rr.
10375 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
10376 Fix typo by replacing $1 with $option.
10377 Remove more 'intl'-related files.
10378 Don't DEFUN AM_INTL_SUBDIR twice.
10380 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
10381 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
10383 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
10384 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
10385 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
10386 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
10387 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
10388 * src/.cvsignore: Add *.output.
10390 * src/parse-gram.y: Put copyright notice inside %{ %} so it
10391 gets copied to the output file.
10393 2004-04-28 Paul Eggert <eggert@twinsun.com>
10395 Get files from the gnulib and po repositories, instead of relying
10396 on them being in our CVS. Upgrade to latest versions of gnulib
10399 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
10400 * bootstrap: Bootstrap from gnulib and po repositories.
10401 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
10402 * README-cvs: Document these changes. Remove version numbers from
10403 mentions of build tools, since they change so often. Mention Flex.
10405 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
10406 (gl_USE_SYSTEM_EXTENSIONS): Add.
10407 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
10408 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
10410 (AC_ISC_POSIX): Remove; we no longer support this
10411 ancient OS, as it gets in the way of latest Autoconf & gnulib.
10412 (AC_HEADER_STDC): Remove: we now assume C89 or better.
10413 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
10414 Do not check for C89 headers, except for locale.h which is used
10415 by the Yacc library and must port to K&R hosts.
10416 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
10417 Do not check for C89 functions, except for setlocale which is
10418 used by the Yacc library.
10419 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
10420 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
10421 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
10422 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
10423 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
10424 AM_GNU_GETTEXT): Remove; now done by:
10425 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
10426 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
10429 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
10430 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
10431 Define to empty, as gnulib.mk will do the rest for us.
10432 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
10434 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
10435 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
10437 * src/files.c: Include gnulib's xstrndup.h.
10439 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
10440 (REALLOC): Use xnrealloc, for likewise.
10441 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
10442 (strnlen, memrchr): Remove decls; functions no longer used.
10443 Include <stpcpy.h>.
10445 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
10446 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
10447 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
10448 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
10449 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
10450 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
10451 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
10452 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
10453 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
10454 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
10455 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
10456 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
10457 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
10458 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
10459 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
10460 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
10461 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
10462 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
10463 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
10464 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
10465 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
10466 Remove, as these files are now generated automatically
10467 by bootstrap or automake.
10469 * po/ChangeLog: Remove: all but one entry was a duplicate
10470 of this file, and I moved that 2000-11-02 entry here.
10472 * config/.cvsignore: Add Makefile, depcomp, install-sh.
10473 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
10474 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
10475 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
10476 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
10477 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
10478 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
10479 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
10480 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
10481 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
10482 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
10484 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
10485 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
10486 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
10487 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
10488 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
10489 * src/.cvsignore: Remove *_.c.
10492 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
10493 support it. (The latest stable gzip doesn't.)
10495 2004-04-27 Paul Eggert <eggert@twinsun.com>
10497 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
10498 case, as stos_ is now used by destructors due to the 2004-02-09
10501 Remove more K&R C support.
10502 * lib/libiberty.y (PARAMS): Remove. All uses removed.
10503 * lib/subpipe.c (errno): Remove decl.
10504 Include <stdlib.h> unconditionally.
10505 (EXIT_FAILURE): Remove macro.
10506 * src/complain.c (vfprintf, strerror): Remove.
10507 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
10509 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
10510 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
10511 (strchr, strspn, memchr): Remove decls.
10512 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
10513 unconditionally. Do not declare perror.
10514 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
10517 * src/complain.c (_): Remove useless defn, as system.h defines this.
10519 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
10520 with latest obstack.h.
10521 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
10522 to procedure types, as obstack.h now does that for us.
10523 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
10525 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
10526 so that this include file can stand alone.
10527 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
10528 does this now. Include subpipe.h first after config.h, to
10529 test whether it can stand alone.
10531 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
10532 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
10533 unused declaration.
10535 * tests/synclines.at (%union synch line): Put a dummy member in
10536 the union, because empty unions aren't allowed in C. Caught
10539 2004-04-13 Jim Meyering <jim@meyering.net>
10541 * src/conflicts.c (conflicts_print): Correct format string typo:
10542 use `%%' to produce literal `%'. (trivial change)
10544 2004-03-30 Paul Eggert <eggert@twinsun.com>
10546 * src/getargs.c (version): Update copyright year to 2004.
10548 * data/c.m4 (b4_int_type): Use 'short int' rather than
10549 'short', and similarly for 'long', 'unsigned', etc.
10550 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
10551 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
10552 yy_yypstack, yydumpstack): Likewise.
10553 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
10554 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
10556 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
10557 yy_stack_print, yyparse): Likewise.
10558 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
10559 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
10560 * lib/bitset.c (bitset_print): Likewise.
10561 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
10562 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
10563 * lib/bitsetv.c (bitsetv_dump): Likewise.
10564 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
10565 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
10567 * src/LR0.c (allocate_itemsets): Likewise.
10568 * src/gram.h (rule_number, rule): Likewise.
10569 * src/lalr.h (goto_number): Likewise.
10570 * src/nullable.c (nullable_compute): Likewise.
10571 * src/output.c (prepare_rules): Likewise.
10572 * src/relation.c (relation_print, relation_digraph): Likewise.
10573 * src/relation.h (relation_node): Likewise.
10574 * src/state.h (state_number, transitions, errs, reductions,
10575 struct state): Likewise.
10576 * src/symtab.h (symbol_number, struct symbol): Likewise.
10577 * src/tables.c (vector_number, tally, action_number,
10578 default_goto, goto_actions): Likewise.
10579 * tests/existing.at (GNU Cim Grammar): Likewise.
10580 * tests/regression.at (Web2c Actions): Likewise.
10582 * src/output.c (muscle_insert_short_int_table): Renamed from
10583 muscle_insert_short_table. All uses changed.
10585 2004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10587 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
10588 (declaration): Replace expected_conflicts with expected_sr_conflicts.
10589 Add %expect-rr rule.
10591 * src/scan-gram.l: Recognize %expect-rr.
10593 * src/conflicts.h (expected_sr_conflicts): Rename from
10594 expected_conflicts.
10595 (expected_rr_conflicts): Declare.
10597 * src/conflicts.c (expected_sr_conflicts): Rename from
10598 expected_conflicts.
10599 (expected_rr_conflicts): Define.
10600 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
10602 Use expected_sr_conflicts in place of expected_conflicts.
10603 Warn if expected_rr_conflicts used in non-GLR parser.
10605 * doc/bison.texinfo: Add documentation for %expect-rr.
10607 2004-03-08 Paul Eggert <eggert@gnu.org>
10609 Add support for hex token numbers. Suggested by Odd Arild Olsen in
10610 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
10612 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
10614 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
10615 * src/scan-gram.l (scan_integer): New function.
10617 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
10618 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
10619 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
10620 Say "long int", not "long", for uniformity with GNU style.
10622 2004-02-25 Paul Eggert <eggert@twinsun.com>
10624 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
10625 compilers. This fixes a problem with Intel's C++ compiler being
10626 chatty, reported by Guido Trentalancia in
10627 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
10629 2004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
10631 Support %destructor and merge error locations in lalr1.cc.
10633 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
10634 (Parser::stos_): Define unconditionally.
10635 (Parser::destruct_): New method. Generate its body with
10636 b4_yydestruct_generate.
10637 (Parser::error_start_): New attribute.
10638 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
10639 token which are discarded.
10640 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
10641 error_start_ when erroneous token are discarded.
10642 (Parser::parse) <yyerrlab1>: Compute the location of the error
10643 token so that it covers all the discarded tokens.
10644 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
10645 it can be called with `%skeleton "lalr1.cc"', and do that.
10647 2004-02-02 Paul Eggert <eggert@twinsun.com>
10649 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
10650 $(top_srcdir)/lib and ../lib. This fixes a bug reported
10651 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
10652 There's no need to mention top_builddir since Automake does that
10654 (INCLUDES): Remove, as Automake says it's obsolescent.
10655 Contents migrated into AM_CPPFLAGS as described above.
10656 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
10658 2004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10660 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
10661 (yyreportSyntaxError): Handle case where lookahead token is
10664 2004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10666 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
10667 resulting parsers are compilable with C++.
10669 2003-12-23 Paul Eggert <eggert@twinsun.com>
10671 * config/depcomp, config/install-sh: Sync with Automake 1.8.
10672 * src/output.c (output_skeleton): Rename local var.
10673 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
10674 Bison tokens, as this runs afoul of the 2003-10-07 change that
10675 disallowed NUL bytes in character constants or string literals.
10677 * tests/local.at: Require Autoconf 2.59's Autotest.
10678 * tests/testsuite.at: Don't include local.at, since we now assume
10679 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
10681 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
10682 multiple inclusion warnings.
10684 2003-12-02 Akim Demaille <akim@epita.fr>
10686 * doc/bison.texinfo (How Can I Reset the Parser): More about start
10690 2003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
10692 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
10694 2003-10-07 Paul Eggert <eggert@twinsun.com>
10696 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
10697 if testsuite doesn't exist.
10699 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
10700 literals, unfortunately.
10701 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
10702 Complain about NUL bytes in character constants or string literals.
10704 2003-10-05 Paul Eggert <eggert@twinsun.com>
10706 * NEWS: Don't document %no-default-prec, as it's still
10708 * doc/bison.texinfo: Document %no-default-prec only if
10709 the defaultprec flag is set. Normally it's not.
10711 2003-10-04 Paul Eggert <eggert@twinsun.com>
10713 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
10714 non-modifiable lvalue, instead of a modifiable one.
10715 * doc/bison.texinfo (Actions): Document that $$ can
10716 be assigned to. Do not claim that $$ and $N are
10717 array element references: user code should not rely on this.
10719 2003-10-01 Paul Eggert <eggert@twinsun.com>
10721 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
10722 (grammar_declaration): Use it.
10723 * src/scan-gram.l: New token %no-default-prec.
10724 * tests/conflicts.at: Revamp tests to use %no-default-prec.
10725 * NEWS, doc/bison.texinfo: Document the above.
10727 2003-10-01 Akim Demaille <akim@epita.fr>
10729 VCG no longer supports long_straight_phase.
10731 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
10732 * src/print_graph.c (print_graph): Adjust.
10734 2003-09-30 Frank Heckenbach <frank@g-n-u.de>
10735 and Paul Eggert <eggert@twinsun.com>
10737 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
10738 Table of Symbols): Document %default-prec.
10739 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
10740 (grammar_declaration): Set default_prec on %default-prec.
10741 * src/scan-gram.l (%default-prec): New token.
10742 * src/reader.h (default_prec): New flag.
10743 * src/reader.c: Likewise.
10744 (packgram): Handle it.
10745 * tests/conflicts.at (%default-prec without %prec,
10746 %default-prec with %prec, %default-prec 1): New tests.
10748 2003-09-30 Paul Eggert <eggert@twinsun.com>
10750 * tests/testsuite.at: Include local.at, not input.at, fixing
10751 a typo in the 2003-08-25 patch.
10753 2003-08-27 Akim Demaille <akim@epita.fr>
10755 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
10758 2003-08-26 Akim Demaille <akim@epita.fr>
10760 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
10761 "<\#" to avoid magic from Gnus when posting parts of this script.
10763 2003-08-26 Akim Demaille <akim@epita.fr>
10765 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
10766 (Parser::parse): here.
10767 Adjust: nerrs and errstatus is now replaced by...
10768 (Parser::nerrs_, Parser::errstatus_): New.
10770 2003-08-25 Akim Demaille <akim@epita.fr>
10772 * config/announce-gen, Makefile.cfg: New.
10773 * Makefile.am: Adjust.
10774 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
10775 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
10777 2003-08-25 Akim Demaille <akim@epita.fr>
10779 When reducing initial empty rules, Bison parser read an initial
10780 location that is not defined. This results in garbage, and that
10781 affects Bison's own parser. Therefore we need (i) to extend Bison
10782 to support a means to initialize this location, and (ii) to use
10783 this CVS Bison to fix CVS Bison's parser.
10785 * src/reader.h, reader.c (epilogue_augment): Remove, replace
10787 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
10788 * src/parse-gram.y: Adjust.
10789 (%initial-action): New.
10790 (%error-verbose): Since we require CVS Bison, there is no reason
10792 * src/scan-gram.l: Adjust.
10793 * src/Makefile.am (YACC): New, to make sure we use our own parser.
10794 * data/yacc.c (yyparse): Use b4_initial_action.
10796 2003-08-25 Akim Demaille <akim@epita.fr>
10798 * doc/bison.texinfo: Don't promote stdout for error messages.
10800 2003-08-25 Akim Demaille <akim@epita.fr>
10802 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
10803 From Alexandre Duret-Lutz.
10805 2003-08-25 Akim Demaille <akim@epita.fr>
10809 2003-08-25 Akim Demaille <akim@epita.fr>
10811 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
10814 2003-08-25 Akim Demaille <akim@epita.fr>
10816 * data/lalr1.cc (Parser::reduce_print_): New.
10819 2003-08-25 Akim Demaille <akim@epita.fr>
10821 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
10822 error recovery loops. This patch is based on
10823 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
10824 Also, augment the similarity between lalr1.cc and yacc.c.
10825 Note: the locations of error recovery rules are not correct yet.
10827 * data/lalr1.cc: Comment changes to augment the similarity between
10828 lalr1.cc and yacc.c.
10829 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
10830 (yyerrlab1): Remove, but where it used to be (now the bottom part of
10831 yyerrlab), when hitting EOF, pop the whole stack here instead of
10832 merely falling thru the default error handling mechanism.
10833 (yyerrorlab): New label, with the old contents of YYERROR,
10834 plus the following change: pop the stack of rhs corresponding
10835 to the production that invoked YYERROR. That is how Yacc
10836 behaves (required by POSIX).
10837 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
10840 2003-08-25 Akim Demaille <akim@epita.fr>
10842 Tune local.at so that people can "autom4te -l autotest calc.at -o
10843 calc" for instance, to extract a sub test suite.
10845 * tests/testsuite.at: Move the initialization, Autotest version
10846 requirement, and AT_TESTED invocation into...
10847 * tests/local.at: here.
10848 * tests/testsuite.at: Include it for compatibility with Autoconf
10850 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
10853 2003-08-04 Paul Eggert <eggert@twinsun.com>
10855 Rework code slightly to avoid gcc -Wtraditional warnings.
10856 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
10857 The returned value is now stored in *YY0. All callers changed.
10858 * src/output.c (merge_output): Adjust to the above change.
10860 2003-07-26 Paul Eggert <eggert@twinsun.com>
10862 * data/glr.c (YYASSERT): New macro.
10863 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
10864 yyresolveStates, yyprocessOneStack):
10865 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
10866 Derived from a suggestion by Frank Heckenbach.
10868 2003-07-25 Paul Eggert <eggert@twinsun.com>
10870 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
10871 for portability to K&R C (after ansi2knr, presumably). See
10872 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
10873 by Frank Heckenbach, though I have omitted the structure-initialization
10874 part of his glr-knr.diff patch since I recall that the Portable
10875 C Compiler didn't require that change.
10877 Let the user specify how to allocate and free memory.
10878 Derived from a suggestion by Frank Heckenbach in
10879 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
10880 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
10881 All uses of free, malloc, realloc changed to use these macros,
10882 and unnecessary casts removed.
10883 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
10885 2003-07-06 Matthias Mann <MatthiasMann@gmx.de>
10887 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
10888 use s.empty() rather than s == "" to test for empty string; see
10889 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
10892 2003-06-25 Akim Demaille <akim@epita.fr>
10894 * config/depcomp, config/install-sh: Update from masters.
10896 2003-06-20 Paul Eggert <eggert@twinsun.com>
10898 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
10899 and return properly parenthesized result.
10900 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
10901 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
10902 Remove unnecessary parentheses from uses.
10903 * doc/bison.texinfo (Location Default Action): Describe the
10904 conventions for parentheses.
10906 2003-06-19 Paul Eggert <eggert@twinsun.com>
10908 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
10909 yyreportTree): Do not assume that size_t is the same width as int,
10910 when printing sizes. Print sizes using an unsigned format.
10911 Problem reported by Frank Heckenbach in
10912 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
10914 Port to Forte Developer 7 C compiler.
10915 * data/glr.c (struct YYLTYPE): If locations are not being used,
10916 declare a single dummy member, as empty structs do not conform
10918 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
10919 the Forte Developer 7 C compiler complains that end-of-loop
10920 code is not reached.
10922 2003-06-17 Paul Eggert <eggert@twinsun.com>
10924 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
10925 avoid warnings from picky compilers about redefinition of PARAMS.
10927 2003-06-17 Paul Eggert <eggert@twinsun.com>
10931 * NEWS: Document 1.875b.
10933 * lib/bbitset.h: Do not include config.h; that's the includer's job.
10934 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
10935 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
10936 Don't use 'index' in comments, as it's a builtin fn on some hosts.
10937 * lib/bitset_stats.c: Include gettext.h unconditionally, as
10938 per recent gettext manual's suggestion.
10939 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
10940 Use prototypes, not old-style definitions.
10941 * lib/lbitset.c (lbitset_unused_clear): Likewise.
10942 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
10943 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
10944 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
10945 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
10946 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
10947 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
10948 vbitset_or_and_cmp, vbitset_copy): Likewise.
10950 * lib/libiberty.h: Do not include config.h; that's the includer's job.
10951 Do not include <stdlib.h>.
10952 (PARAMS): Define unconditionally for C89.
10953 (ATTRIBUTE_NORETURN): Remove.
10954 (ATTRIBUTE_UNUSED): Define unconditionally.
10956 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
10957 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
10958 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
10959 * lib/vbitset.c, lib/vbitset.h: New files.
10960 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
10961 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
10964 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
10965 `How Can I Reset @code{yyparse}', since texinfo does not allow
10966 arbitrary @ in node names.
10968 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
10969 shouldn't be needed according to the gettext 0.12.1 documentation
10970 but which seem to be needed anyway: codeset.m4 glibc21.m4
10971 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
10972 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
10973 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
10975 * lib/.cvsignore: Add stdbool.h.
10976 * m4/.cvsignore: Add nls.m4, po.m4.
10978 Upgrade to CVS gnulib.
10979 * stdbool_.h: File renamed from stdbool.h.in.
10980 * configure.ac (AM_STDBOOL_H): Invoke this instead of
10982 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
10983 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
10984 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
10985 (MOSTLYCLEANFILES): New var.
10986 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
10987 (stdbool.h): New rule.
10988 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
10989 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
10990 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
10991 m4/quote.m4: Upgrade to today's gnulib.
10993 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
10994 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
10995 the tests right now.
10996 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
10997 yyerror are declared before use; C99 requires this.
10999 2003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11001 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
11003 (yyrecoverSyntaxError): Correct the logic for setting and testing
11005 Correct comment on handling EOF.
11006 Allow states with only a default reduction, rather than failing
11007 (I can't quite reconstruct why these were not allowed before).
11009 Fixes to avoid problem that $-N rules in GLR parsers can cause
11010 buffer overruns, corrupting state.
11012 * src/output.c (prepare_rules): Output max_left_semantic_context
11014 * src/reader.h (max_left_semantic_context): New variable declaration.
11015 * src/scan-gram.l (max_left_semantic_context): Define.
11016 (handle_action_dollar): Update max_left_semantic_context.
11017 * data/glr.c (YYMAXLEFT): New definition.
11018 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
11019 (yyresolveAction): Ditto.
11021 Fixes to problems with location handling in GLR parsers reported by
11022 Frank Heckenbach (2003/06/05).
11024 * data/glr.c (YYLTYPE): Make trivial if locations not used.
11025 (YYRHSLOC): Add parentheses, and define only if locations used.
11026 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
11027 locations not used.
11028 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
11029 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
11031 * tests/cxx-type.at: Exercise location information; update tests
11032 to differentiate output with and without locations.
11033 Remove forward declarations of yylex and yyerror---caused errors
11034 because default YYLTYPE not yet defined.
11035 Change semantic actions to compute strings, rather than printing
11036 them directly (to test proper passing of semantics values). Change
11037 output to prefix notation and update test data and expected results.
11038 (yylex): Track locations.
11039 (stmtMerge): Return value rather than printing, and include arguments
11042 2003-06-03 Paul Eggert <eggert@twinsun.com>
11044 Avoid warnings generated by GCC 2.95.4 when Bison is
11045 configured with --enable-gcc-warnings.
11046 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
11047 yy::]b4_parser_class_name[::translate_,
11048 yy::Stack::operator[] (unsigned),
11049 yy::Stack::operator[] (unsigned) const,
11050 yy::Slice::operator[] (unsigned),
11051 yy::Slice::operator[] (unsigned) const):
11052 Rename local vars to avoid warnings.
11053 * tests/glr-regression.at (Improper handling of embedded actions
11054 and $-N in GLR parsers): Remove unused local variable from yylex.
11055 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
11056 (void) as arg when not pure, since we now assume C89 when building
11057 Bison. Pacify GCC by using parameter.
11059 2003-06-02 Paul Eggert <eggert@twinsun.com>
11061 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
11062 yy::Location::lines, yy::Location::columns): Rename arguments
11063 to avoid shadowing; this removes a warning generated by GCC 3.3.
11065 2003-06-01 Paul Eggert <eggert@twinsun.com>
11067 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
11068 to g++, as GCC 3.3 complains if you do it.
11069 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
11070 everything that WARNING_CFLAGS has, except omit warnings
11071 not suitable for C++.
11072 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
11073 * tests/atlocal.in (CXXFLAGS): New var.
11074 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
11076 Fix a GLR parser bug I reported in February; see
11077 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
11078 The problem was that GLR parsers did not conform to the C standard,
11079 because actions like { $1 = $2 + $3; } expanded to expressions
11080 that invoked YYFILL in separate subexpressions, and YYFILL assigned
11081 to a local variable. The C standard says that expressions
11082 like (var = f ()) + (var = f ()) have undefined behavior.
11083 Another problem was that GCC sometimes issues warnings that
11084 yyfill and its parameters are unused.
11086 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
11087 as possibly unused.
11088 (yyfill): New function.
11090 (yyuserAction): Change type of yynormal to bool, so that it matches
11091 the new yyfill signature. Mark it as possibly unused.
11094 Follow up on a bug I reported in February, where a Bison-generated
11095 parser can loop. Provide a test case and a fix for yacc.c. I
11096 don't have a fix for lalr1.cc or for glr.c, unfortunately.
11097 The original bug report is in:
11098 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
11100 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
11101 macro's size was becoming unwieldy.
11102 (yyerrlab): Do not discard an empty lookahead symbol, as this
11103 might destroy garbage.
11104 (yyerrorlab): New label, with the old contents of YYERROR,
11105 plus the following change: pop the stack of rhs corresponding
11106 to the production that invoked YYERROR. That is how Yacc
11107 behaves, and POSIX requires this behavior.
11108 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
11109 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
11110 Define 'alarm' to do nothing if unistd.h is not available.
11111 Add a new rule "exp: '-' error;" to test the above change to
11112 data/yacc.c. Use 'alarm' to abort any test taking longer than
11113 10 seconds, as it's probably looping.
11114 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
11115 Also, the new yacc.c generates two fewer diagnostics for an
11118 2003-05-24 Paul Eggert <eggert@twinsun.com>
11120 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
11121 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
11122 This fixes a problem reported by John Bowman when the Compaq/HP
11123 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
11124 -ansi -Wall -gall).
11125 * data/yacc.c (union yyalloc): Likewise.
11126 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
11128 Switch from 'int' to 'bool' where that makes sense.
11130 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
11131 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
11132 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
11133 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
11134 Return or accept bool, not int. All callers changed.
11135 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
11136 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
11137 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
11138 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
11139 bitset_or_and_cmp_): Likewise.
11140 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
11141 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
11142 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
11143 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
11144 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
11145 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
11146 bitset_stats_or_and_cmp): Likewise.
11147 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
11148 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
11149 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
11150 ebitset_xor_cmp): Likewise.
11151 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
11152 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
11153 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
11154 lbitset_xor_cmp): Likewise.
11155 * lib/bbitset.h: Include <stdbool.h>.
11156 (struct bitset_vtable): The following members now return bool, not
11157 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
11158 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
11160 * src/conflicts.c (count_rr_conflicts): Likewise.
11161 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
11163 * lib/ebitset.c (ebitset_obstack_init): Likewise.
11164 * lib/lbitset.c (lbitset_obstack_init): Likewise.
11165 * src/getargs.c (debug_flag, defines_flag, locations_flag,
11166 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
11167 graph_flag): Likewise.
11168 * src/getargs.h (debug_flag, defines_flag, locations_flag,
11169 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
11170 graph_flag): Likewise.
11171 * src/output.c (error_verbose): Likewise.
11172 * src/output.h (error_verbose): Likewise.
11173 * src/reader.c (start_flag, typed): Likewise.
11174 * src/reader.h (typed): Likewise.
11175 * src/getargs.c (LOCATIONS_OPTION): New constant.
11176 (long_options, getargs): Use it.
11177 * src/lalr.c (build_relations): Use bool, not int.
11178 * src/nullable.c (nullable_compute): Likewise.
11179 * src/print.c (print_reductions): Likewise.
11180 * src/tables.c (action_row, pack_vector): Likewise.
11181 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
11182 * src/output.c (prepare): Use it.
11183 * src/output.c (token_definitions_output,
11184 symbol_destructors_output, symbol_destructors_output): Use string,
11185 not boolean integer, to keep track of whether to output separator.
11186 * src/print_graph.c (print_core): Likewise.
11187 * src/state.c (state_rule_lookaheads_print): Likewise.
11189 * config/install-sh: Sync from automake 1.7.5.
11191 2003-05-14 Paul Eggert <eggert@twinsun.com>
11193 * src/parse-gram.y (rules_or_grammar_declaration): Require a
11194 semicolon after a grammar declaration, in the interest of possible
11195 future changes to the Bison input language.
11196 Do not allow a stray semicolon at the start of the grammar.
11197 (rhses.1): Allow one or more semicolons after any rule, including
11198 just before "|" as required by POSIX.
11199 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
11202 2003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
11204 %parse-param support for lalr1.cc.
11206 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
11207 b4_cc_constructor_calls, b4_cc_constructor_call,
11208 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
11210 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
11211 parse-param arguments.
11212 (yy::b4_parser_class_name): Declare instance variables to
11213 hold parse-param arguments.
11214 * tests/calc.at: s/value/semantic_value/ because value clashes
11215 with a member of yy::b4_parser_class_name. Adjust C++ code
11216 to handle %parse-param. Enable %parse-param test in C++.
11218 2003-05-12 Paul Eggert <eggert@twinsun.com>
11220 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
11221 English a bit. Fix fclose typo. Change "const char" to "char
11222 const", and use ANSI C rather than K&R for "main". Suggest
11223 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
11224 and suggest yy_switch_to_buffer.
11226 2003-05-05 Paul Eggert <eggert@twinsun.com>
11228 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
11229 C89. This avoids a diagnostic on compilers that define __STDC__
11230 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
11231 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
11233 2003-05-03 Paul Eggert <eggert@twinsun.com>
11235 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
11236 Do not overrun array bounds.
11237 This should fix a bug reported today by Olatunji Oluwabukunmi in
11238 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
11240 2003-04-29 Akim Demaille <akim@epita.fr>
11242 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
11243 * src/getargs.c, src/getargs.h: here, as bool, not int.
11244 (nondeterministic_parser): New.
11245 * src/parse-gram.y, src/scan-gram.l: Support
11246 %nondeterministic-parser.
11247 * src/output.c (prepare): Use nondeterministic_parser instead
11248 of glr_parser where appropriate.
11249 * src/tables.c (conflict_row, action_row, save_row)
11250 (token_actions, token_actions, pack_vector): Ditto.
11252 2003-04-29 Akim Demaille <akim@epita.fr>
11254 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
11256 2003-04-29 Akim Demaille <akim@epita.fr>
11258 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
11259 with %pure-parser and %locations to exercise the patch from Yakov
11262 2003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
11264 * data/yacc.c: (b4_lex_param): Corrected for the case where
11265 %lex-param is provided and %pure-parser isn't.
11267 2003-04-27 Paul Eggert <eggert@twinsun.com>
11269 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
11270 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
11271 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
11272 if it is not defined.
11273 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
11275 2003-04-26 Paul Eggert <eggert@twinsun.com>
11277 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
11278 Declare to be of type suitable for the ninf value itself, not of
11279 type suitable for the corresponding table, since the latter might
11280 be unsigned but the ninf value might be negative. This fixes a
11281 bug reported by Alexandre Duret-Lutz in
11282 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
11284 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
11285 invokes it. We shouldn't invoke it twice because it will attempt
11286 to put error.o in the archive twice. This fixes a glitch reported
11287 by Martin Mokrejs in
11288 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
11290 2003-04-21 Paul Eggert <eggert@twinsun.com>
11292 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
11295 2003-04-21 Yakov Markovitch <Markovitch@iso.ru>
11297 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
11298 Fix obvious typo that results in uncompilable GLR parsers
11299 when both %pure-parser and %locations are used. (trivial change)
11301 2003-04-17 Paul Eggert <eggert@twinsun.com>
11303 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
11304 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
11305 Do not insert the expected token via unput, as this runs afoul
11306 of a POSIX-compatibility bug in flex 2.5.31.
11307 All uses changed to BEGIN the parent state,
11308 since we no longer insert the expected token via unput.
11309 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
11310 that is no longer emitted after the above change.
11312 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
11313 the first one. This change is from Paul Hilfinger, and it fixes
11314 regression reported by Werner Lemberg in
11315 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
11317 (resolve_sr_conflict): Don't invoke state_errs_set
11318 unless one or more tokens have been explicitly made errors.
11319 Otherwise, the above change causes Bison to abort.
11321 * tests/existing.at (GNU pic Grammar): New test case, taken from
11324 2003-03-31 Akim Demaille <akim@epita.fr>
11326 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
11328 2003-03-31 Akim Demaille <akim@epita.fr>
11330 * src/output.c (prepare_symbols): Avoid trailing spaces in the
11333 2003-03-31 Akim Demaille <akim@epita.fr>
11335 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
11336 From Paul Hilfinger.
11338 2003-03-29 Akim Demaille <akim@epita.fr>
11340 * m4/error.m4: Do not put under dynamic conditions some code which
11341 expansion is under static control.
11343 2003-03-29 Akim Demaille <akim@epita.fr>
11345 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
11347 2003-03-29 Akim Demaille <akim@epita.fr>
11349 * doc/bison.texinfo (Strings are Destroyed): New.
11351 2003-03-13 Paul Eggert <eggert@twinsun.com>
11353 * .cvsignore: Add configure.lineno.
11354 * src/.cvsignore: Add yacc.
11355 * tests/.cvsignore: Add testsuite.log.
11356 * doc/fdl.texi: Sync with latest FSF version.
11358 2003-03-12 Paul Eggert <eggert@twinsun.com>
11360 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
11361 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
11362 cursor, instead of leaving it undefined. This fixes a bug
11363 reported by Tim Van Holder in
11364 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
11365 * tests/input.at (Torturing the Scanner): Test the scanner on
11366 an empty input file, which was Tim Van Holder's test case.
11368 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
11369 <sys/resource.h> can be included, include sys/time.h and
11370 sys/times.h first, if available. This works around the SunOS
11371 4.1.4 porting bug reported by Bruce Becker in
11372 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
11374 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
11375 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
11376 AC_HEADER_SYS_WAIT.
11378 Merge changes from gnulib. This was prompted because the CVS
11379 snapshot didn't build on Solaris 7 due to strnlen problems.
11381 These changes need to be merged back into gnulib:
11382 * lib/hash.c: Include <stdbool.h> unconditionally.
11383 * m4/onceonly.m4 (m4_quote): New macro.
11384 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
11385 Quote AC_FOREACH variable-expansions properly.
11386 The 2003-01-03 obstack.h change also needs merging.
11387 {end of changes requiring merging}
11389 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
11390 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
11391 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
11392 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
11393 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
11394 New files, imported from gnulib.
11395 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
11398 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
11399 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
11402 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
11404 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
11405 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
11406 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
11407 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
11408 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
11409 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
11410 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
11411 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
11412 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
11413 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
11414 (jm_PREREQ_ARGMATCH): Remove.
11415 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
11416 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
11418 * src/system.h: Include <stdbool.h> unconditionally.
11420 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
11421 assuming at least C89 in the bitset code for some time now.
11423 2003-03-03 Akim Demaille <akim@epita.fr>
11427 2003-03-02 Akim Demaille <akim@epita.fr>
11429 * doc/bison.texinfo (Table of Symbols): Reactivate the
11430 documentation for %lex-param, and %parse-param.
11432 2003-03-02 Akim Demaille <akim@epita.fr>
11434 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
11435 generate verbose error messages.
11436 Use the number of tokens as an upper bound in yytname, as it
11437 cannot be a non terminal.
11439 2003-03-02 Akim Demaille <akim@epita.fr>
11441 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
11444 2003-03-02 Akim Demaille <akim@epita.fr>
11446 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
11447 Use them to exercise yycheck overrun.
11448 Based on Andrew Suffield's grammar.
11450 2003-03-02 Akim Demaille <akim@epita.fr>
11452 Create tests/local.at for Bison generic testing macros.
11454 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
11455 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
11457 * tests/calc.at (AT_CHECK_CALC): Adjust.
11458 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
11459 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
11460 * tests/local.at: here.
11461 (AT_COMPILE_CXX): Tags the tests using it as c++.
11462 Ignore the test if CXX is not functional.
11464 2003-03-01 Paul Eggert <eggert@twinsun.com>
11466 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
11467 not loc->end, since loc->end might contain garbage and this leads
11468 to undefined behavior on some platforms.
11469 (id_loc, token_start): Use (IF_LINTed) initial values that do not
11470 depend on *loc, so that the reader doesn't give the the false
11471 impression that *loc is initialized.
11472 (<INITIAL>"%%"): Do not bother setting code_start, since its value
11473 does not survive the return.
11475 2003-03-01 Akim Demaille <akim@epita.fr>
11477 * src/scan-gram.l (code_start): Always initialize it when entering
11478 into yylex, as SC_EPILOGUE is activated *before* the corresponding
11479 yylex invocation. An alternative would be making it static, but
11480 then it starts with the second %%'s beginning, instead of its end.
11482 2003-02-28 Paul Eggert <eggert@twinsun.com>
11484 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
11485 around a UnixWare 7.1.1 porting bug reported by John Hughes in
11486 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
11488 2003-02-26 Paul Eggert <eggert@twinsun.com>
11490 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
11491 Remove Sequent/Pyramid discussion (nobody uses them any more).
11492 Merge VMS and MS-DOS discussion; these ports may well be dead
11493 but let's keep mentioning them for now. Put <> around email
11494 addresses. Add copyright notice.
11496 2003-02-24 Paul Eggert <eggert@twinsun.com>
11498 * data/glr.c (yy_reduce_print): yylineno -> yylno,
11499 to avoid collision with flex use of yylineno.
11500 Problem reported by Bruce Lilly in
11501 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
11502 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
11503 * data/yacc.c (yy_reduce_print): Likewise.
11505 * config/depcomp: Sync with Automake 1.7.3.
11507 2003-02-21 Akim Demaille <akim@epita.fr>
11509 * data/lalr1.cc: Use temporary variables instead of casts to
11510 change integer types.
11511 Suggested by Paul Eggert.
11513 2003-02-21 Akim Demaille <akim@epita.fr>
11515 * doc/bison.texinfo: Use "location" consistently to refer to @n,
11516 to avoid confusions with lalr1.cc's notion of Position.
11517 Suggested by Paul Eggert.
11519 2003-02-20 Akim Demaille <akim@epita.fr>
11521 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
11522 before initial_columns.
11523 (location.hh): Use consistent variable names when defining the
11525 Use "last" so that we subtract from Positions, not from unsigned.
11527 2003-02-20 Akim Demaille <akim@epita.fr>
11529 * data/lalr1.cc (position.hh): New subfile, including the extended
11530 and Doxygen'ed documentation of class Position.
11531 (location.hh): Use it.
11532 Document a` la Doxygen.
11533 With the help of Benoit Perrot.
11535 2003-02-20 Akim Demaille <akim@epita.fr>
11537 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
11539 Redefine AT_YYERROR_SEES_LOC_IF using it.
11540 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
11542 Don't use the location in yy::Parser::error_ and
11543 yy::Parser::print_ when not %locations.
11544 Activate more lalr1.cc tests.
11546 2003-02-19 Akim Demaille <akim@epita.fr>
11548 * data/lalr1.cc: When displaying a line number, be sure to make it
11551 2003-02-19 Akim Demaille <akim@epita.fr>
11553 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
11555 (YYABORT, YYACCEPT, YYERROR): New.
11556 * tests/calc.at: Renable the lalr1.cc test.
11558 2003-02-19 Akim Demaille <akim@epita.fr>
11560 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
11561 error recovery, mixing with/without pops and discarding of the
11564 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
11566 2003-02-17 Paul Eggert <eggert@twinsun.com>
11568 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
11569 * tests/testsuite.at (AT_COMPILE): Use them.
11570 This fixes the testsuite problem reported by Robert Lentz in
11571 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
11573 2003-02-12 Paul Eggert <eggert@twinsun.com>
11575 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
11576 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
11577 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
11578 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
11579 Check for malloc failure, for consistency with yacc.c.
11580 (yytname_size): Remove, for consistency with yacc.c.
11582 The bug still remains in data/lalr1.cc, as I didn't have time
11585 2003-02-06 Akim Demaille <akim@epita.fr>
11587 * configure.ac (GXX): Rename as...
11588 (CXX): this, to keep the original Autoconf semantics.
11590 * data/lalr1.cc: Fix b4_copyright invocations.
11591 If YYDEBUG is not defined, don't depend upon name_ being defined.
11592 (location.hh): Include string and iostream.
11593 (Position::filename): New member.
11594 (Position::Position ()): New.
11595 (operator<< (Position)): New.
11596 (operator- (Position, int)): New.
11597 (Location::first, Location::last): Rename as...
11598 (Location::begin, Location::end): these, to mock the conventional
11600 (operator<< (Location)): New.
11601 * tests/atlocal.in (CXX): New.
11602 * tests/testsuite.at (AT_COMPILE_CXX): New.
11603 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
11604 locations in a more synthetic way.
11605 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
11607 Adjust the C locations to match those from Emacs: first column is
11609 Change all the expected results.
11610 Conform to the GCS: simplify the locations when applicable.
11611 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
11612 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
11613 these CPP macros with the m4 macros new defined by...
11614 (AT_CHECK_PUSHDEFS): this, i.e.:
11615 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
11616 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
11618 (AT_CHECK_POPDEFS): Undefine them.
11619 (AT_CHECK_CALC_LALR1_CC): New.
11620 Use it for the first lalr1.cc test.
11622 2003-02-04 Akim Demaille <akim@epita.fr>
11624 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
11625 Location as is defined.
11627 2003-02-04 Akim Demaille <akim@epita.fr>
11629 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
11630 name_ being defined.
11632 2003-02-03 Paul Eggert <eggert@twinsun.com>
11634 * src/gram.h (start_symbol): Remove unused decl.
11636 Use more-consistent naming conventions for local vars.
11638 * src/derives.c (derives_compute): Change type of local var from
11639 int to rule_number.
11640 * src/gram.c (grammar_rules_partial_print): Likewise.
11641 * src/print.c (print_core): Likewise.
11642 * src/reduce.c (reduce_grammar_tables): Likewise.
11644 * src/gram.c (grammar_dump): Change name of item_number *
11645 local var from r to rp.
11646 * src/nullable.c (nullable_compute): Likewise.
11648 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
11650 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
11651 for symbol or symbol_number var.
11652 * src/reader.c (grammar_start_symbol_set): Likewise.
11653 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
11655 * src/state.c (transitions_to): Likewise.
11656 * src/state.h: Likewise.
11657 * src/tables.c (symbol_number_to_vector_number): Likewise.
11659 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
11662 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
11665 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
11668 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
11669 Use str, not s, for char * var. Use ch, not c, for character var.
11670 Use size for size var.
11672 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
11674 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
11676 * src/uniqstr.h: Likewise.
11678 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
11679 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
11680 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
11681 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
11682 param to have same name as that of enum, so that we don't use
11683 "s" to stand for a non-state.
11685 2003-02-02 Akim Demaille <akim@epita.fr>
11687 * src/scan-skel.l: Scan more than one inert character per yylex
11690 2003-02-01 Paul Eggert <eggert@twinsun.com>
11694 * po/LINGUAS: Add ms.
11696 2003-01-30 Akim Demaille <akim@epita.fr>
11698 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
11700 2003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11702 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
11705 Changes in response to error report by S. Eken: GLR mode does not
11706 handle negative $ indices or $ indices in embedded rules correctly.
11707 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
11709 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
11710 (b4_rhs_location): Ditto.
11711 (yyfill): New function to copy from stack tree into array
11713 (yyuserAction): Modify to allow incremental move of semantic values
11714 to rhs array when in GLR mode.
11715 Define YYFILL to use in user-defined actions to fill semantic array
11717 Remove dummy use of yystack, as there is now a guaranteed use.
11718 (yydoAction): Modify to allow incremental move of semantic values
11719 to rhs array when in GLR mode.
11720 (yyresolveAction): Ditto.
11721 (yyglrShiftDefer): Update comment.
11722 (yyresolveStates): Use X == NULL for pointers, not !X.
11723 (yyglrReduce): Ditto.
11724 (yydoAction): Ditto
11726 * tests/glr-regr1.at: Rename to ...
11727 * tests/glr-regression.at: Add new regression test for the problems
11728 described above (adapted from S. Eken).
11729 Update copyright notice.
11730 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
11731 * tests/Makefile.am: Ditto.
11733 2003-01-28 Paul Eggert <eggert@twinsun.com>
11735 * data/lalr1.cc: Do not use @output_header_name@ unless
11736 b4_defines_flag is set. This fixes two bugs reported by
11738 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
11739 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
11741 2003-01-21 Paul Eggert <eggert@twinsun.com>
11743 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
11744 we don't need to worry about yyerrlab1 being reported as an
11745 "unused label" by non-GCC C compilers. The downside is that if
11746 locations are used then a couple of statements are duplicated each
11747 time YYERROR is invoked, but the upside is that the warnings
11749 (yyerrlab1): Move code to YERROR.
11750 (yyerrlab2): Remove. Change uses back to yyerrlab1.
11751 This reverts some of the 2002-12-27 change.
11753 2003-01-17 Paul Eggert <eggert@twinsun.com>
11755 * src/output.c (symbol_printers_output): Fix typo that led
11756 to core dump. Problem reported by Antonio Rus in
11757 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
11759 2003-01-13 Akim Demaille <akim@epita.fr>,
11760 Quoc Peyrot <chojin@lrde.epita.fr>,
11761 Robert Anisko <anisko_r@lrde.epita.fr>
11763 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
11764 when the stacks contain one element, as the loop would otherwise
11765 free the last state, and then use the top state (the one we just
11766 popped). This means that the initial elements will not be freed
11767 explicitly, as is the case in yacc.c; it is not a problem, as
11768 these elements have fake values.
11770 2003-01-11 Paul Eggert <eggert@twinsun.com>
11772 * NEWS: %expect-violations are now just warnings, reverting
11773 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
11774 bootstrapping problem reported by Matthias Klose; see
11775 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
11776 * src/conflicts.c (conflicts_print): Likewise.
11777 * tests/conflicts.at (%expect not enough, %expect too much,
11778 %expect with reduce conflicts): Likewise.
11779 * doc/bison.texinfo (Expect Decl): Document this. Also mention
11780 that the warning is enabled if the number of conflicts changes
11781 (not necessarily increases).
11783 * src/getargs.c (version): Update copyright year.
11785 2003-01-09 Akim Demaille <akim@epita.fr>
11787 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
11789 2003-01-08 Paul Eggert <eggert@twinsun.com>
11791 * Makefile.maint (WGETFLAGS):
11792 New macro, containing "-C off" to disable proxy caches.
11793 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
11794 (rel-check): Use $(WGET) instead of wget.
11796 2003-01-06 Paul Eggert <eggert@twinsun.com>
11798 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
11799 the GLR paper of Scott, Johnstone and Hussain.
11801 2003-01-04 Paul Eggert <eggert@twinsun.com>
11803 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
11804 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
11805 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
11806 (EXTRA_LIBRARIES): New var, for liby.a.
11807 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
11808 (EXTRA_SCRIPTS): New var, for yacc.
11810 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
11811 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
11812 Problem reported by Nelson H. F. Beebe.
11814 2003-01-03 Paul Eggert <eggert@twinsun.com>
11816 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
11817 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
11818 when compiling Bison 1.875's `bitset bset = obstack_alloc
11819 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
11821 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
11822 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
11823 grow to a huge size with typical invocation.
11825 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
11826 Use the pattern recommended by Autoconf 2.57, except also protect
11827 against double-definition.
11828 * src/system.h: Likewise.
11829 Portability issues reported by Nelson H. F. Beebe.
11831 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
11832 All uses changed. Provide a definition in both C and C++.
11833 (yytrue, yyfalse): Define even if defined (__cplusplus).
11835 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
11836 Reported by Nelson H. F. Beebe.
11838 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
11840 2003-01-02 Paul Eggert <eggert@twinsun.com>
11842 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
11843 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
11844 Bug reported by Nelson H. F. Beebe.
11846 2003-01-01 Paul Eggert <eggert@twinsun.com>
11850 2002-12-30 Paul Eggert <eggert@twinsun.com>
11852 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
11854 (<INITIAL>","): Here. This causes stray "," to be treated
11857 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
11858 last brace in braced code when not in Yacc mode, for compatibility
11859 with Bison 1.35. This resurrects the 2001-12-15 patch to
11862 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
11863 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
11865 2002-12-28 Paul Eggert <eggert@twinsun.com>
11867 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
11868 that of SYM's type. This fixes Debian bug 168069, reported by
11871 2002-12-28 Paul Eggert <eggert@twinsun.com>
11875 Switch back to the Yacc style of conflict reports, undoing some
11876 of the 2002-07-30 change.
11877 * doc/bison.texinfo (Understanding): Use Yacc style for
11878 conflict reports. Also, use new way of locating rules.
11879 * src/conflicts.c (conflict_report):
11880 Renamed from conflict_report_yacc, removing the old
11881 'conflict_report'. Translate the entire conflict report at once,
11882 so that we don't assume that "," has the same interpretation in
11884 (conflicts_output): Use Yacc-style conflict report for each state,
11885 instead of our more-complicated style.
11886 (conflicts_print): Use Yacc-style conflict report, except print
11887 the input file name when not emulating Yacc.
11888 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
11889 Conflicted Reduction, %expect not enough, %expect too much,
11890 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
11891 * tests/existing.at (GNU Cim Grammar): Likewise.
11892 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
11894 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
11895 fatal): Don't invoke fflush; it's not needed and it might even be
11896 harmful for stdout, as stdout might not be open.
11897 * src/reduce.c (reduce_print): Likewise.
11899 2002-12-27 Paul Eggert <eggert@twinsun.com>
11901 Fix a bug where error locations were not being recorded correctly.
11902 This problem was originally reported by Paul Hilfinger in
11903 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
11905 * data/yacc.c (yyparse): New local var yylerrsp, to record the
11906 top of the location stack's error locations.
11907 (yyerrlab): Set it. When discarding a token, push its location
11908 onto yylerrsp so that we don't lose track of the error's end.
11909 (yyerrlab1): Now is only the target of YYERROR, so that we can
11910 properly record the location of the action that failed. For GCC
11911 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
11912 GCC warning about yyerrlab1 being unused if YYERROR is unused.
11913 (yyerrlab2): New label, which yyerrlab now falls through to.
11914 Compute the error's location by applying YYLLOC_DEFAULT to
11915 the locations of all the symbols that went into the error.
11916 * doc/bison.texinfo (Location Default Action): Mention that
11917 YYLLOC_DEFAULT is also invoked for syntax errors.
11918 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
11919 Error locations include the locations of all the tokens that were
11920 discarded, not just the last token.
11922 2002-12-26 Paul Eggert <eggert@twinsun.com>
11924 * src/files.c: Include quote.h.
11925 (compute_output_file_names): Warn if we detect conflicting
11926 outputs to the same file. This should catch the misunderstanding
11927 exemplified by Debian Bug 165349, reported by Bruce Stephens..
11929 * src/conflicts.c (conflicts_print): If the user specifies
11930 "%expect N", report an error if there are any reduce/reduce
11931 conflicts. This is what the manual says should happen.
11932 This fixes Debian bug 130890, reported by Anthony DeRobertis.
11933 * tests/conflicts.at (%expect with reduce conflicts): New test.
11935 Don't use m4_include on relative file names, as it doesn't work as
11936 desired if there happens to be a file with that name under ".".
11938 * m4sugar/version.m4: Remove; it was included but it wasn't used.
11939 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
11940 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
11941 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
11942 * src/output.c (output_skeleton): Use full path names when
11943 specifying a file to include; don't rely on include path, as
11944 it's unreliable when the working file contains a file with
11947 2002-12-25 Paul Eggert <eggert@twinsun.com>
11949 Remove obsolete references to bison.simple and bison.hairy.
11950 Problem mentioned by Aubin Mahe in
11951 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
11952 * data/glr.c: Comment fix.
11953 * doc/bison.1: Remove references. Also, mention "yacc".
11955 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
11958 * src/parse-gram.y (declaration): Use enum "report_states" rather
11959 than its numeric value 1.
11961 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
11962 opening a new one. This fixes Debian bug 165349, reported by
11965 2002-12-24 Paul Eggert <eggert@twinsun.com>
11969 * Makefile.maint (cvs-update): Don't assume that the shell
11970 supports $(...), as Solaris sh doesn't.
11972 * src/parse-gram.y (lloc_default): Remove test for empty
11973 nonterminals at the end, since it didn't change the result.
11975 2002-12-24 Paul Eggert <eggert@twinsun.com>
11977 If the user does not define YYSTYPE as a macro, Bison now declares it
11978 using typedef instead of defining it as a macro. POSIX requires this.
11979 For consistency, YYLTYPE is also declared instead of defined.
11981 %union directives can now have a tag before the `{', e.g., the
11982 directive `%union foo {...}' now generates the C code
11983 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
11984 The default union tag is `YYSTYPE', for compatibility with Solaris 9
11985 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
11986 instead of `yyltype'.
11988 `yystype' and `yyltype' are now obsolescent macros instead of being
11989 typedefs or tags; they are no longer documented and will be
11990 withdrawn in a future release.
11992 * data/glr.c (b4_location_type): Remove.
11993 (YYSTYPE): Renamed from yystype.
11994 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
11995 (struct YYLTYPE): Renamed from struct yyltype.
11996 (YYLTYPE): Renamed from yyltype.
11997 (yyltype, yystype): New (and obsolescent) macros,
11998 for backward compatibility.
11999 * data/yacc.c: Likewise.
12001 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
12002 does not specify a union tag. This is for compatibility with
12005 * src/parse-gram.y (add_param): 2nd arg is now char * not char
12006 const *, since it is now modified by stripping surrounding { }.
12007 (current_braced_code): Remove.
12008 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
12009 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
12010 trailing " {...}". Now of type <chars>.
12011 (grammar_declaration): Adjust to bundled tokens.
12012 (code_content): Remove; stripping is now done by add_param.
12013 (print_token_value): Print contents of bundled tokens.
12014 (token_name): New function.
12016 * src/reader.h (braced_code, current_braced_code): Remove.
12017 (token_name): New decl.
12019 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
12020 token_type, not braced_code code_kind. All uses changed.
12021 (SC_PRE_CODE): New state, for scanning after a keyword that
12022 has (or usually has) an immediately-following braced code.
12023 (token_type): New local var, to keep track of which token type
12024 to return when scanning braced code.
12025 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
12026 <INITIAL>"%parse-param", <INITIAL>"%printer",
12027 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
12028 instead of returning a token type immediately.
12029 (<INITIAL>"{"): Set token type.
12030 (<SC_BRACED_CODE>"}"): Use it.
12031 (handle_action_dollar, handle_action_at): Now returns bool
12032 indicating success. Fail if ! current_rule; this prevents a core dump.
12033 (handle_symbol_code_dollar, handle_symbol_code_at):
12034 Remove; merge body into caller.
12035 (handle_dollar, handle_at): Complain in invalid contexts.
12037 * NEWS, doc/bison.texinfo: Document the above.
12038 * NEWS: Fix years and program names in copyright notice.
12040 2002-12-17 Paul Eggert <eggert@twinsun.com>
12042 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
12043 Reporting, Table of Symbols): Omit mentions of %lex-param and
12044 %parse-param from the documentation for now.
12046 2002-12-15 Paul Eggert <eggert@twinsun.com>
12048 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
12049 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
12050 lookahead symbol, and which sets yychar in parser actions) and it
12051 disagreed with the Bison documentation. Bug
12052 reported by Andrew Walrond.
12054 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
12055 as the caller now does that.
12056 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
12057 (YYEMPTY): Parenthesize right hand side, since others use it.
12058 (yyparse): Don't assume that our generated code is the only code
12061 2002-12-13 Paul Eggert <eggert@twinsun.com>
12065 POSIX requires a "yacc" command.
12066 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
12067 (MOSTLYCLEANFILES): Add yacc.
12069 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
12070 as an alias for bison y.
12072 * po/LINGUAS: Add da.
12074 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
12075 problem with latest <getopt.h>.
12076 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
12078 * doc/fdl.texi: Upgrade to 1.2.
12079 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
12080 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
12081 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
12083 * config/install-sh: Sync with autotools.
12085 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
12086 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
12087 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
12088 locations are requested.
12089 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
12090 locations are requested.
12092 2002-12-12 Paul Eggert <eggert@twinsun.com>
12094 Remove unportable casts and storage allocation tricks.
12095 While we're at it, remove almost all casts, since they
12096 usually aren't needed and are a sign of trouble.
12098 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
12100 * src/derives.c (derives_compute): Do not subtract NTOKENS from
12101 the pointer DSET returned by malloc; this isn't portable.
12102 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
12103 Similarly for DERIVES.
12104 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
12105 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
12106 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
12108 * src/derives.c (derives_compute): Do not bother invoking
12109 int_of_rule_number, since rule numbers are integers.
12111 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
12112 rather than XMALLOC (char, N).
12114 * src/files.c (filename_split): Rewrite to avoid cast.
12116 * src/gram.h (symbol_number_as_item_number,
12117 item_number_as_symbol_number, rule_number_as_item_number,
12118 item_number_as_rule_number):
12119 Now inline functions rather than macros, to avoid casts.
12120 * src/state.h (state_number_as_int): Likewise.
12121 * src/tables.c (state_number_to_vector_number,
12122 symbol_number_to_vector_number): Likewise.
12124 * src/gram.h (int_of_rule_number): Remove; no longer used.
12126 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
12127 since the resulting storage is always stored into.
12129 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
12132 * src/muscle_tab.c (muscle_m4_output):
12133 Now inline. Return bool, not int.
12134 * src/state.c (state_compare): Likewise.
12135 * src/symtab.c (symbol_check_defined,
12136 symbol_check_alias_consistency, symbol_pack, symbol_translation,
12137 hash_compare_symbol, hash_symbol):
12139 * src/uniqstr.c (uniqstr_print): Likewise.
12140 * src/muscle_tab.c (muscle_m4_output_processor):
12141 New function, to avoid casts.
12142 * src/state.c (state_comparator, stage_hasher): Likewise.
12143 * src/symtab.c (symbol_check_defined_processor,
12144 symbol_check_alias_consistency_processor, symbol_pack_processor,
12145 symbol_translation_processor, hash_symbol_comparator,
12146 hash_symbol_hasher): Likewise.
12147 * src/uniqstr.c (uniqstr_print_processor): Likewise.
12148 * src/muscle_tab.c (muscles_m4_output):
12149 Use new functions instead of casting old functions unportably.
12150 * src/state.c (state_hash_new): Likewise.
12151 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
12152 symbols_token_translations_init):
12154 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
12156 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
12157 var instead of casting to long, to avoid casts.
12158 (prepare_states): Use MALLOC rather than alloca, so that we don't
12159 have to worry about alloca.
12160 * src/state.c (state_hash_lookup): Likewise.
12162 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
12163 local var instead of casting to unsigned char, to avoid casts.
12165 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
12166 STATE_ALLOC): Remove.
12167 (transitions_new, errs_new, reductions_new, state_new): Use malloc
12168 rather than calloc, and use offsetof to avoid allocating slightly
12170 (state_new): Initialize all members.
12172 * src/state.c (state_hash): Use unsigned accumulator, not signed.
12174 * src/symtab.c (symbol_free): Remove; unused.
12175 (symbol_get): Remove cast in lhs of assignment.
12176 (symbols_do): Now static. Accept generic arguments, not
12177 hashing-related ones.
12179 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
12180 (symbol_processor): Remove.
12181 (symbols_do): Remove decl; now static.
12183 * src/system.h (alloca): Remove; decl no longer needed.
12184 (<stddef.h>): Include, for offsetof.
12185 (<inttypes.>, <stdint.h>): Include if available.
12186 (uintptr_t): New type, if system lacks it.
12187 (CALLOC, MALLOC, REALLOC): New macros.
12188 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
12191 * src/tables.c (table_size): Now int, to pacify GCC.
12192 (table_grow, table_ninf_remap): Use signed table size.
12193 (save_row): Don't bother initializing locals when not needed.
12194 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
12195 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
12197 * src/vcg.h: Correct misspellings.
12199 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
12202 * src/getargs.c (getargs): Don't assume EOF == -1.
12204 2002-12-09 Paul Eggert <eggert@twinsun.com>
12206 Change identifier spellings to avoid collisions with names
12207 that are reserved by POSIX.
12209 Don't use names ending in _t, since POSIX reserves them.
12210 For consistency, remove _e and _s endings -- they're weren't
12211 needed to remove ambiguity. All uses changed.
12212 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
12213 turn was just renamed from struniq_t.
12214 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
12215 which in turn was just renamed from struniq_processor_t.
12216 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
12217 in turn was renamed from hash_compare_struniq_t.
12218 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
12219 (state_list): Renamed from state_list_t.
12220 * src/assoc.h (assoc): Renamed from assoc_t.
12221 * src/conflicts.c (enum conflict_resolution): Renamed from
12222 enum conflict_resolution_e.
12223 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
12224 (rule_list): Renamed from rule_list_t.
12225 * src/getargs.h (enum trace): Renamed from enum trace_e.
12226 (enum report): Renamed from enum report_e.
12227 * src/gram.h (item_number): Renamed from item_number_t.
12228 (rule_number): Renamed from rule_number_t.
12229 (struct rule_s): Remove the "rule_s" part; not used.
12230 (rule): Renamed from rule_t.
12231 (rule_filter): Renamed from rule_filter_t.
12232 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
12233 (goto_list): Renamed from goto_list_t.
12234 * src/lalr.h (goto_number): Renamed from goto_number_t.
12235 * src/location.h (location): Renamed from location_t.
12236 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
12237 and moved here from:
12238 * src/muscle_tab.h (muscle_entry_t): here.
12239 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
12240 (rule_list): Renamed from rule_list_t.
12241 * src/print_graph.c (static_graph): Renamed from graph.
12242 * src/reader.h (braced_code): Renamed from braced_code_t.
12243 Remove brace_code_e tag.
12244 * src/relation.h (relation_node): Renamed from relation_node_t.
12245 (relation_nodes): Renamed from relation_nodes_t.
12246 (relation): Renamed from relation_t.
12247 * src/state.h (state_number): Renamed from state_number_t.
12248 (struct state): Renamed from struct state_s.
12249 (state): Renamed from state_t.
12250 (transitions): Renamed from transitions_t. Unused (and
12251 misspelled) transtion_s tag removed.
12252 (errs): Renamed from errs_t. Unused errs_s tag removed.
12253 (reductions): Renamed from reductions_t. Unused tag
12254 reductions_s removed.
12255 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
12256 (struct symbol_list): Renamed from struct symbol_list_s.
12257 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
12258 (struct symbol): Renamed from struct symbol_s.
12259 (symbol): Renamed from symbol_t.
12260 * src/tables.c (vector_number): Renamed from vector_number_t.
12261 (action_number): Renamed from action_t.
12262 * src/tables.h (base_number): Renamed from base_t.
12263 * src/vcg.h (enum color): Renamed from enum color_e.
12264 (enum textmode): Renamed from enum textmode_e.
12265 (enum shape): Renamed from enum shape_e.
12266 (struct colorentry): Renamed from struct colorentry_s.
12267 (struct classname): Renamed from struct classname_s.
12268 (struct infoname): Renamed from struct infoname_s.
12269 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
12270 (enum decision): Renamed from enum decision_e.
12271 (enum orientation): Renamed from enum orientation_e.
12272 (enum alignment): Renamed from enum alignment_e.
12273 (enum arrow_mode): Renamed from enum arrow_mode_e.
12274 (enum crossing_type): Renamed from enum crossing_type_e.
12275 (enum view): Renamed from enum view_e.
12276 (struct node): Renamed from struct node_s.
12277 (node): Renamed from node_t.
12278 (enum linestyle): Renamed from enum linestyle_e.
12279 (enum arrowstyle): Renamed from enum arrowstyle_e.
12280 (struct edge): Renamed from struct edge.
12281 (edge): Renamed from edge_t.
12282 (struct graph): Renamed from struct graph_s.
12283 (graph): Renamed from graph_t.
12284 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
12285 Rename value_t -> value.
12286 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
12287 value_t_as_yystype -> value_as_yystype.
12289 Don't include <errno.h> in the mainstream code, since it
12290 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
12291 * lib/get-errno.c, lib/get-errno.h: New files.
12292 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
12294 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
12295 * src/output.c (output_skeleton): Likewise.
12296 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
12298 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
12300 (handle_action_dollar, handle_action_at): Likewise.
12301 * src/system.h: Do not include <errno.h>.
12302 (TAB_EXT): Renamed from EXT_TAB.
12303 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
12305 Avoid str[a-z]*, since <string.h> reserves that name space.
12306 Change all instances of "struniq" in names to "uniqstr", and
12307 likewise for "STRUNIQ" and "UNIQSTR".
12308 * src/uniqstr.c: Renamed from src/struniq.c.
12309 * src/uniqstr.h: Renamed from src/struniq.h.
12310 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
12311 * src/files.c (strsuffix): Remove; unused.
12312 (concat2): Renamed from stringappend. Now static.
12313 * src/files.h (strsuffix, stringappend): Remove; unused.
12314 * src/parse-gram.y (<chars>): Renamed from <string>.
12315 (<uniqstr>): Renamed from <struniq>.
12316 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
12317 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
12318 (struct graph_s.expand): Renamed from struct graph_s.stretch.
12319 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
12320 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
12321 (N_EXPAND): Renamed from N_STRETCH.
12323 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
12324 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
12325 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
12327 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
12328 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
12329 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
12330 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
12331 (BASE_MAXIMUM): Renamed from BASE_MAX.
12332 (BASE_MINIMUM): Renamed from BASE_MIN.
12333 (ACTION_MAX): Remove; unused.
12334 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
12335 Unnecessary casts removed from above defines.
12338 Fix misspelling in names.
12339 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
12340 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
12344 * lib/timevar.c (timevar_report): Renamed from time_report,
12345 for consistency with other names.
12346 * lib/timevar.h (timevar_report): New decl.
12347 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
12350 Sort include-file uses.
12352 Reorder all include files under src to be in the order "system.h".
12353 then the ../lib include files in angle brackets (alphabetized),
12354 then the . include files in double-quotes (alphabetized). Fix
12355 dependency breakages encountered in this process, as follows:
12356 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
12357 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
12358 * src/state.h: Include "symtab.h".
12360 2002-12-08 Paul Eggert <eggert@twinsun.com>
12362 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
12363 since this causes problems when __file__ contains character
12364 sequences like "@" that are treated specially by src/scan-skel.l.
12365 Instead, just use the file's basename. This fixes the bug
12366 reported by Martin Mokrejs in
12367 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
12369 2002-12-06 Paul Eggert <eggert@twinsun.com>
12371 Add support for rules that do not have trailing semicolons, as
12372 POSIX requires. Improve the quality of locations in Bison
12375 * src/location.c: Include <quotearg.h>.
12376 (empty_location): Now const.
12377 (location_print): New function. Follow the recommendation of the
12378 GNU Coding Standards for locations that span file boundaries.
12379 * src/location.h: Do not include <quotearg.h>; no longer needed.
12380 (boundary): New type.
12381 (location_t): Use it. This allows locations to span file boundaries.
12382 All member uses changed: file -> start.file or end.file (as needed),
12383 first_line -> start.line, first_column -> start.column,
12384 last_line -> end.line, last_column -> end.column.
12385 (equal_boundaries): New function.
12386 (LOCATION_RESET, LOCATION_STEP): Remove.
12387 (LOCATION_PRINT): Remove. All callers changed to use location_print.
12388 (empty_location): Now const.
12389 (location_print): New decl.
12390 * src/parse-gram.y (lloc_default): New function, which handles
12391 empty locations more accurately.
12392 (YYLLOC_DEFAULT): Use it.
12393 (%token COLON): Remove.
12394 (%token ID_COLON): New token.
12396 (declarations, rules): Remove trailing semicolon.
12397 (declaration, rules_or_grammar_declaration):
12398 Allow empty (";") declaration.
12399 (symbol_def): Remove empty actions; no longer needed.
12400 (rules_or_grammar_declaration): Remove trailing semicolon.
12401 (semi_colon.opt): Remove.
12402 * src/reader.h: Include location.h.
12403 (scanner_cursor): New decl.
12404 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
12406 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
12408 (STEP): Remove. No longer needed, now that adjust_location does
12409 the work. All uses removed.
12410 (scanner_cursor): New var.
12411 (adjust_location): Renamed from extend_location. It now sets
12412 *loc and adjusts the scanner cursor. All uses changed.
12413 Don't bother testing for CR.
12414 (handle_syncline): Remove location arg; now updates scanner cursor.
12415 All callers changed.
12416 (unexpected_end_of_file): Now accepts start boundary of token or
12417 comment, not location. All callers changed. Update scanner cursor,
12419 (SC_AFTER_IDENTIFIER): New state.
12420 (context_state): Renamed from c_context. All uses changed.
12421 (id_loc, code_start, token_start): New local vars.
12422 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
12423 processing of Yacc white space and equivalents here.
12424 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
12425 instead of returning ID immediately, since we need to search for
12426 a subsequent colon.
12427 (<INITIAL>"'", "\""): Save token_start.
12428 (<INITIAL>"%{", "{", "%%"): Save code_start.
12429 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
12430 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
12431 BEGIN context_state at end, not INITIAL.
12432 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
12433 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
12434 Return correct token start.
12435 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
12436 the start of a character, string or multiline comment is found.
12437 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
12438 Reduction): Adjust reported locations to match the more-precise
12439 results now expected.
12440 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
12441 * tests/reduce.at (Useless Rules, Reduced Automaton,
12442 Underivable Rules): Likewise.
12443 * tests/regression.at (Invalid inputs): No longer `expecting ";"
12444 or "|"' now that so many other tokens are allowed by the new grammar.
12446 * src/complain.h (current_file): Remove duplicate decl;
12447 current_file is now owned by files.h.
12448 * src/complain.c, src/scan-gram.l: Include files.h.
12450 2002-12-06 Paul Eggert <eggert@twinsun.com>
12452 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
12453 promotes to int; it might be unsigned int.
12454 * data/yacc.c (yy_reduce_print): Likewise.
12456 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
12457 be #defined in the prologue, not in the Bison declarations.
12458 This fixes Debian Bug 102878, reported by Shaul Karl.
12460 2002-12-02 Paul Eggert <eggert@twinsun.com>
12462 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
12463 * lib/strtoul.c: New file, from gnulib.
12464 This fixes a porting bug reported by Peter Klein in
12465 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
12467 2002-11-30 Paul Eggert <eggert@twinsun.com>
12469 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
12470 and put only a forward declaration in the prologue. This is for
12471 consistency with the other scanner helper functions.
12473 Type clashes now generate warnings, not errors, since it
12474 appears that POSIX may allow some grammars with type clashes.
12475 * src/reader.c (grammar_current_rule_check): Warn about
12476 type clashes instead of complaining.
12477 * tests/input.at (Type Clashes): Expect warnings, not complaints.
12479 Add Yacc library, since POSIX requires it.
12480 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
12481 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
12482 * lib/main.c, lib/yyerror.c: New files.
12484 gram_error can be static; it need not be extern.
12485 * src/reader.h (gram_error): Remove decl.
12486 * src/parse-gram.y (gram_error): Now static. Add static decl.
12487 (print_token_value): Omit parameter names from forward decl,
12490 2002-11-29 Paul Eggert <eggert@twinsun.com>
12492 * doc/bison.texinfo: Emphasize that yylex and yyerror must
12493 be declared before being used. E.g., one should typically
12494 declare them in the prologue. Use GNU coding style in examples.
12495 Put "const" consistently after the type it modifies. Mention
12496 that C99 supports "inline". Mention that yyerror traditionally
12499 %parse-param and %lex-param now take just one argument, the
12500 declaration; the argument name is deduced from the declaration.
12502 * doc/bison.texinfo (Parser Function, Pure Calling, Error
12503 Reporting, Table of Symbols): Document this.
12504 * src/parse-gram.y (add_param): New function.
12506 (declaration): Implement new rule for %parse-param and %lex-param.
12507 * src/scan-gram.l: "," now elicits a warning, rather than being
12508 a token; this is more compatible with byacc.
12509 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
12511 2002-11-27 Paul Eggert <eggert@twinsun.com>
12513 Rename identifiers to avoid real and potential collisions.
12515 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
12516 to avoid collision with lex macro described by Bruce Lilly in
12517 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
12518 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
12519 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
12520 * src/parse-gram.y (print_token_value): Renamed from yyprint.
12522 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
12523 The name "yycontrol" violates the name space rules, and this stuff
12524 wasn't being used anyway.
12525 (input): Remove action; this stuff wasn't being used.
12526 (gram_error): Rename local variable yylloc -> loc.
12527 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
12528 (YY_DECL): Don't use "yy" at start of local variables.
12529 All uses changed, e.g., yylloc -> loc.
12530 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
12531 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
12532 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
12533 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
12535 * src/parse-gram.y (gram_error): loc is now const *.
12536 * src/reader.h (gram_error): Likewise.
12538 2002-11-24 Paul Eggert <eggert@twinsun.com>
12542 * tests/actions.at (Actions after errors): Use an output format
12543 more similar to that of the Printers and Destructors test.
12544 Test the position of the ';' token too.
12545 (Printers and Destructors): Likewise.
12546 (Printers and Destructors: %glr-parser): Remove for now, to avoid
12547 unnecessarily alarming people when the test fails.
12549 * data/yacc.c (yyerrlab1): Move this label down, so that the
12550 parser does not discard the lookahead token if the user code
12551 invokes YYERROR. This change is required for POSIX conformance.
12553 * lib/error.c: Sync with gnulib.
12555 2002-11-22 Paul Eggert <eggert@twinsun.com>
12557 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
12558 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
12559 * lib/xmalloc.c: Likewise.
12561 2002-11-20 Paul Eggert <eggert@twinsun.com>
12563 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
12565 2002-11-20 Paul Eggert <eggert@twinsun.com>
12567 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
12568 should use `if (! x) abort ();' rather than `assert (x);', and
12569 anyway it's one less thing to worry about configuring.
12571 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
12572 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
12573 and replace all instances of assert with abort.
12574 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
12575 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
12577 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
12578 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
12579 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
12580 hash_find_entry, hash_rehash, hash_insert): Likewise.
12581 * src/conflicts.c (resolve_sr_conflict): Likewise.
12582 * src/lalr.c (set_goto_map, map_goto): Likewise.
12583 * src/nullable.c (nullable_compute): Likewise.
12584 * src/output.c (prepare_rules, token_definitions_output): Likewise.
12585 * src/reader.c (packgram, reader): Likewise.
12586 * src/state.c (state_new, state_free, state_transitions_set,
12587 state_reduction_find): Likewise.
12588 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
12589 symbol_pack): Likewise.
12590 * src/tables.c (conflict_row, pack_vector): Likewise.
12591 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
12592 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
12593 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
12594 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
12596 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
12597 (ARGMATCH_CONSTRAINT): New macro.
12598 (ARGMATCH_ASSERT): Use it.
12600 * src/system.h (verify): New macro.
12601 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
12602 rather than assert.
12603 * src/tables.c (tables_generate): Likewise.
12605 * src/struniq.c (struniq_assert): Now returns void, and aborts
12606 if the assertion is false.
12607 (struniq_assert_p): Remove.
12608 * src/struniq.h: Likewise.
12610 2002-11-18 Paul Eggert <eggert@twinsun.com>
12612 * data/glr.c (yygetLRActions): Replace `yyindex' with
12613 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
12614 This fixes the regression with Sun ONE Studio 7 cc that I reported in
12615 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
12617 2002-11-18 Akim Demaille <akim@epita.fr>
12619 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
12621 From Tim Van Holder.
12623 2002-11-17 Paul Eggert <eggert@twinsun.com>
12625 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
12626 to "SyntaxError" for consistency with my 2002-11-15 change.
12628 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
12629 not define to {}, since this breaks the common use of `YYDPRINTF
12630 ((...));' if a single statement is desired (e.g. before `else').
12631 Work around GCC warnings by surrounding corresponding calls with
12633 (yyhasResolvedValue): Remove unused function.
12634 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
12636 (yyreportSyntaxError): Renamed from yyreportParseError.
12637 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
12639 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
12640 extern when possible. Remove unused initializations.
12642 2002-11-16 Akim Demaille <akim@epita.fr>
12644 Augment the similarity between GLR and LALR traces.
12646 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
12647 (YY_REDUCE_PRINT): New.
12648 (yyparse): Use them.
12649 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
12651 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
12652 state reached after the reduction/recovery, since...
12653 (yyparse, yyprocessOneStack): Report the state we are entering in.
12655 2002-11-16 Akim Demaille <akim@epita.fr>
12657 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
12658 Add support for --trace=skeleton.
12659 * src/scan-skel.l: %option debug.
12660 Scan strings of non-@ or \n instead of character by character.
12661 (scan_skel): Handle trace_skeleton.
12663 (@output_parser_name@, @output_header_name@): ``Restore'' their
12664 support (used to be M4 macros).
12665 * data/yacc.c: Quote larger chunks, a la glr.c.
12666 * data/lalr1.cc: Likewise.
12667 The header guards are no longer available, so use some other
12668 string than `YYLSP_NEEDED'.
12670 2002-11-16 Akim Demaille <akim@epita.fr>
12672 Make the ``Printers and Destructors'' test more verbose, taking
12673 `yacc.c''s behavior as (possibly wrong) reference.
12675 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
12676 instead of fprint on stdout.
12677 Set and report the last_line of the symbols.
12678 Consistently display values and locations.
12680 2002-11-16 Paul Eggert <eggert@twinsun.com>
12682 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
12684 2002-11-15 Paul Eggert <eggert@twinsun.com>
12686 * tests/actions.at (Actions after errors): New test case.
12688 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
12689 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
12690 tests/action.at, tests/calc.at, tests/conflicts.at,
12691 tests/cxx-type.at, tests/regression.at:
12692 "parse error" -> "syntax error" for POSIX compatibility.
12693 "parsing stack overflow..." -> "parser stack overflow" so
12694 that code matches Bison documentation.
12696 2002-11-15 Akim Demaille <akim@epita.fr>
12698 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
12699 take two BRACED_CODE, not two string_content.
12700 Free the scanner's obstack when we are done.
12701 (code_content): New.
12702 * tests/calc.at: Adjust.
12703 * doc/bison.texinfo: Adjust.
12704 Also, make sure to include the `,' for these declarations.
12706 2002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
12708 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
12709 definition; avoids potential autoreconf problems.
12711 2002-11-15 Akim Demaille <akim@epita.fr>
12713 Always check the value returned by yyparse.
12715 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
12716 returned by yyparse.
12717 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
12719 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
12720 returned by yyparse.
12722 2002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12724 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
12727 2002-11-14 Paul Eggert <eggert@twinsun.com>
12729 * src/output.c (output_skeleton): Call xfopen instead of
12730 duplicating xfopen's body.
12732 Fix bugs reported by Nelson H. F. Beebe in
12733 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
12735 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
12736 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
12737 Group compiler. Instead, use "$CC -E bar.c". Include the .h
12738 file twice in the grammar, as an extra check.
12740 * tests/input.at (Torturing the Scanner): Surround the
12741 backslash-newline tests with "#if 0", to make it less likely that
12742 we'll run into compiler bugs. Bring back solitary \ inside
12743 comment, but add a closing comment to work around HP C bug. Don't
12744 test backslash-newline in C character constant.
12746 2002-11-14 Akim Demaille <akim@epita.fr>
12748 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
12749 status of the compiler.
12750 Calling `exit 1' is no longer needed.
12751 Reported by Nelson H. F. Beebe.
12753 2002-11-14 Akim Demaille <akim@epita.fr>
12755 * tests/atlocal.in (CPPFLAGS): We have config.h.
12756 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
12758 * tests/actions.at, tests/calc.at, tests/conflicts.at,
12759 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
12760 * tests/regression.at, tests/torture.at: Use them for all the
12761 grammars that are to be compiled.
12762 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
12763 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
12764 * doc/bison.texinfo (GLR Parsers): Document `inline'.
12766 2002-11-14 Akim Demaille <akim@epita.fr>
12768 * doc/bison.texinfo: Various formatting changes (alignments in
12769 samples, additional @group/@end group, GCS in samples.
12770 Use @deffn instead of simple @table to define the directives,
12771 macros, variables etc.
12773 2002-11-13 Paul Eggert <eggert@twinsun.com>
12775 Fix some bugs reported by Albert Chin-A-Young in
12776 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
12778 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
12779 -o c"; the HP C compiler chatters during compilation.
12780 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
12781 * tests/headers.at (export YYLTYPE): Likewise.
12783 * tests/input.at (Torturing the Scanner): Remove lines containing
12784 solitary backslashes, as they tickle a bug in the HP C compiler.
12786 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
12787 comments, since they're not portable. Use GNU coding style.
12789 2002-11-13 Akim Demaille <akim@epita.fr>
12791 * data/yacc.c: Leave bigger chunks of quoted text.
12792 (YYDSYMPRINTF): New.
12793 Use it to report symbol activities.
12794 * data/glr.c (YYDSYMPRINTF): New.
12797 2002-11-12 Paul Eggert <eggert@twinsun.com>
12801 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
12802 (yyglrReduce): Return yyok, not 0.
12803 This should avoid the enumerated-type warnings reported
12804 by Nelson H. F. Beebe in
12805 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
12807 * lib/bbitset.h (BITSET_INLINE): Remove.
12808 * lib/bitset.h [! BITSET_INLINE]: Remove.
12809 (bitset_set, bitset_reset, bitset_test): Rename local vars
12810 to avoid shadowing warnings by GCC.
12812 * data/glr.c (inline): Remove #define. It's the user's
12813 responsibility to #define it away, just like 'const'.
12814 This fixes one of the bugs reported by Nelson H. F. Beebe in
12815 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
12817 * Makefile.maint (po-check): Scan .l and .y files instead of the
12818 .c and the .h files that they generate. This fixes the bug
12819 reported by Tim Van Holder in:
12820 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
12821 Look for N_ as well as for _. Try to avoid matching #define for
12823 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
12824 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
12825 * src/scan-gram.l: Revamp regular expressions so that " and '
12826 do not confuse xgettext.
12828 * src/struniq.h (struniq_new): Do not declare the return type
12829 to be 'const'; this violates the C standard.
12830 * src/struniq.c (struniq_new): Likewise.
12832 2002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
12834 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
12835 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
12838 2002-11-12 Akim Demaille <akim@epita.fr>
12840 * Makefile.maint: Sync with Autoconf:
12841 (local_updates): New.
12843 2002-11-12 Akim Demaille <akim@epita.fr>
12845 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
12847 2002-11-12 Akim Demaille <akim@epita.fr>
12849 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
12852 2002-11-12 Akim Demaille <akim@epita.fr>
12854 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
12857 2002-11-12 Akim Demaille <akim@epita.fr>
12859 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
12860 Use it to test the GLR parser.
12862 2002-11-12 Akim Demaille <akim@epita.fr>
12864 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
12866 * data/glr.c (yystos): New.
12867 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
12868 (YYDSYMPRINT): New.
12869 (yyval): Don't define it, it is handled via M4.
12870 (yyrecoverParseError): Free verbosely the discarded symbols.
12871 * data/yacc.c (yysymprint): Remove, rather...
12872 (b4_yysymprint_generate): invoke.
12873 * data/c.m4 (b4_yysymprint_generate): New.
12874 Accept pointers as arguments, as opposed to the version from
12876 (b4_yydestruct_generate): Likewise.
12877 * tests/cations.at (Printers and Destructors): Use Bison directives
12878 instead of CPP macros.
12879 Don't rely on internal details.
12881 2002-11-12 Akim Demaille <akim@epita.fr>
12883 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
12884 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
12885 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
12886 it against YYEMPTY and so forth), work on yytoken (i.e., set
12887 it to YYEMPTY etc.).
12888 (yydestruct): Replace with a b4_yydestruct_generate invocation.
12889 (b4_symbol_actions): Remove.
12890 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
12891 for 0, end-of-input.
12893 2002-11-12 Akim Demaille <akim@epita.fr>
12895 * doc/bison.texinfo (Destructor Decl): New.
12897 2002-11-12 Akim Demaille <akim@epita.fr>
12899 * src/tables.c (tables_generate): Use free for pointers that
12900 cannot be NULL, not XFREE.
12901 (pack_vector): Use assert, not fatal, for bound violations.
12902 * src/state.c (state_new): Likewise.
12903 * src/reader.c (reader): Likewise.
12904 * src/lalr.c (set_goto_map): Likewise.
12905 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
12908 2002-11-12 Akim Demaille <akim@epita.fr>
12910 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
12912 * src/scan-gram.l (last_string): Is global to the file, not to
12914 * src/parse-gram.y (input): Don't append the epilogue here,
12915 (epilogue.opt): do it here, and free the scanner's obstack.
12916 * src/reader.c (epilogue_set): Rename as...
12917 (epilogue_augment): this.
12918 * data/c.m4 (b4_epilogue): Defaults to empty.
12920 2002-11-12 Akim Demaille <akim@epita.fr>
12922 * src/getargs.c (long_options): Remove duplicates.
12923 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
12925 * doc/bison.rnh: Remove.
12926 * doc/bison.texinfo (VMS Invocation): Remove.
12928 2002-11-12 Akim Demaille <akim@epita.fr>
12930 * src/struniq.h, src/struniq.c (struniq_t): Is const.
12931 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
12933 Use struniq for symbols.
12935 * src/symtab.h (symbol_t): The tag member is a struniq.
12936 (symbol_type_set): Adjust.
12937 * src/symtab.c (symbol_new): Takes a struniq.
12938 (symbol_free): Don't free the tag member.
12939 (hash_compare_symbol_t, hash_symbol_t): Rename as...
12940 (hash_compare_symbol, hash_symbol): these.
12941 Use the fact that tags as struniqs.
12942 (symbol_get): Use struniq_new.
12943 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
12945 * src/reader.h (merger_list, grammar_currentmerge_set): The name
12946 and type members are struniqs.
12947 * src/reader.c (get_merge_function)
12948 (grammar_current_rule_merge_set): Adjust.
12949 (TYPE, current_type): Are struniq.
12951 Use struniq for file names.
12953 * src/files.h, src/files.c (infile): Split into...
12954 (grammar_file, current_file): these.
12955 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
12956 * src/reduce.c (reduce_print): Likewise.
12957 * src/getargs.c (getargs): Likewise.
12958 * src/complain.h, src/complain.c: Likewise.
12959 * src/main.c (main): Call struniqs_new early enough to use it for
12961 Don't free the input file name.
12963 2002-11-12 Akim Demaille <akim@epita.fr>
12965 * src/symtab.c (symbol_free): Remove dead deactivated code:
12966 type_name are properly removed.
12967 Don't use XFREE to free items that cannot be NULL.
12968 * src/struniq.h, src/struniq.c: New.
12969 * src/main.c (main): Initialize/free struniqs.
12970 * src/parse-gram.y (%union): Add astruniq member.
12972 * src/scan-gram.l (<{tag}>): Return a struniq.
12973 Free the obstack bit that used to store it.
12974 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
12976 2002-11-11 Paul Eggert <eggert@twinsun.com>
12978 Revamp to fix many (but not all) of the C- and M4-related quoting
12979 problems. Among other things, this fixes the Bison bug reported
12980 by Jan Hubicka when processing the Bash grammar; see:
12981 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
12983 Use new @ escapes consistently. Represent brackets with @{ and @}
12984 rather than @<:@ and @:>@, since this works a bit better with dumb
12985 editors like vi. Represent @ with @@, since @ is now consistently
12986 an escape. Use @oline@ and @ofile@ rather than __oline__ and
12987 __ofile__, to avoid unexpected expansions. Similarly, use @output
12988 rather than #output.
12990 * data/c.m4 (b4_copyright): Omit file name from comment, since
12991 the file name could contain "*/".
12992 (b4_synclines_flag): Don't quote the 2nd argument; it should already
12993 be quoted. All uses changed.
12995 * data/glr.c: Use new @ escapes consistently.
12996 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
12997 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
12998 Remove, since they couldn't handle arbitrary characters in file
13000 * data/lalr1.cc: Likewise.
13001 * data/yacc.c: Likewise.
13003 * src/files.c (output_infix): Remove; all uses removed.
13004 * src/files.h: Likewise.
13006 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
13007 mishandled funny characters in file names, and anyway it isn't
13009 * data/yacc.c: Likewise.
13010 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
13012 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
13013 * data/yacc.c: Likewise.
13015 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
13017 (muscle_init): Quote filename as a C string.
13018 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
13019 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
13020 * src/output.c (escaped_file_name_output): New function.
13021 (prepare_symbols): Quote tokens for M4.
13022 (prepare): Don't insert output_infix, output_prefix,
13023 output_parser_name, output_header_name; this is now down by scan-skel.
13024 Insert skeleton as a C string.
13026 * src/output.c (user_actions_output, symbol_destructors_output,
13027 symbol_printers_output): Quote filenames for C and M4.
13028 * src/reader.c (prologue_augment, epilogue_set): Likewise.
13030 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
13031 escapes other than \\ and \'; this simplifies the code.
13032 (<SC_STRING>): Likewise, for \\ and \".
13033 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
13034 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
13035 Use new escapes @{ and @} for [ and ].
13037 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
13038 them with auto vars.
13039 Switch to new escape scheme, where @ is the escape character uniformly.
13040 Abort if a stray escape character is found. Avoid unbounded input
13041 buffer when parsing non-escaped text.
13043 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
13044 __oline__, #output, $@, and @{ do not have unintended meanings.
13046 2002-11-09 Paul Eggert <eggert@twinsun.com>
13048 Fix the test failure due to GCC warnings described in
13049 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
13050 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
13051 evaluate to 0 if it's impossible for NINF to be in the respective
13053 (yygetLRActions, yyrecoverParseError): Use them.
13055 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
13056 counted in the token inserted at end of file. Now takes
13057 location_t *, not location_t, so that the location can be
13058 adjusted. All uses changed.
13060 * tests/regression.at (Invalid inputs): Adjust wording in
13061 diagnostic to match the new behavior.
13063 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
13064 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
13065 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
13066 abort ();'. This reduces the runtime of the "Many lookaheads"
13067 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
13070 2002-11-07 Paul Eggert <eggert@twinsun.com>
13072 * src/parse-gram.y (CHARACTER): Remove unused token.
13075 * src/scan-gram.l: Remove stack option. We no longer use the
13076 stack, since the stack was never deeper than 1; instead, use the
13077 new auto var c_context to record the stacked value.
13079 Remove nounput option. At an unexpected end of file, we now unput
13080 the minimal input necessary to end cleanly; this simplifies the
13083 Avoid unbounded token sizes where this is easy.
13085 (unexpected_end_of_file): New function.
13086 Use it to systematize the error message on unexpected EOF.
13087 (last-string): Now auto, not static.
13088 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
13089 (scanner_last_string_free): Remove; not used.
13090 (percent_percent_count): Move decl to just before use.
13091 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
13092 not the (never otherwised-used) CHARACTER.
13094 2002-11-07 Akim Demaille <akim@epita.fr>
13096 Let yyerror always receive the msg as last argument, so that
13097 yyerror can be variadic.
13099 * data/yacc.c (b4_yyerror_args): New.
13100 Use it when calling yyerror.
13101 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
13102 Use it when calling yyerror.
13103 * doc/bison.texinfo (Error Reporting): Adjust.
13104 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
13105 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
13107 2002-11-06 Akim Demaille <akim@epita.fr>
13109 #line should have quoted strings.
13110 Ideally, this should be done by m4_quotearg.
13112 * src/scan-skel.l: Include quotearg.h.
13114 * src/output.c (symbol_printers_output)
13115 (symbol_destructors_output): Quote the file name.
13117 2002-11-06 Akim Demaille <akim@epita.fr>
13119 * tests/regression.at (Invalid inputs): Adjust to the recent
13122 2002-11-06 Akim Demaille <akim@epita.fr>
13124 Restore --no-lines.
13125 Reported by Jim Kent.
13127 * data/c.m4 (b4_syncline): New.
13128 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
13129 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
13130 * src/output.c (user_actions_output): Likewise.
13131 (prepare): Define 'b4_synclines_flag'.
13132 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
13134 2002-11-06 Akim Demaille <akim@epita.fr>
13136 * src/main.c (main): Free `infile'.
13137 * src/scan-gram.l (handle_syncline): New.
13139 * src/output.c (user_actions_output, symbol_destructors_output)
13140 (symbol_printers_output): Use the location's file name, not
13142 * src/reader.c (prologue_augment, epilogue_set): Likewise.
13144 2002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13146 * src/tables.c (matching_state): Don't allow states to match if
13147 either has GLR conflict entries.
13149 2002-11-05 Paul Eggert <eggert@twinsun.com>
13151 * src/scan-gram.l: Use more accurate diagnostics, e.g.
13152 "integer out of range" rather than "invalid value".
13153 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
13156 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
13157 Also, remove one static variable in the scanner.
13159 * src/scan-gram.l (braces_level): Now auto, not static.
13160 Initialize to zero if the compiler is being picky.
13161 (INITIAL): Clear braces_level instead of incrementing it.
13162 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
13163 as POSIX 1003.1-2001 requires.
13164 * src/system.h (IF_LINT): New macro, taken from coreutils.
13165 * configure.ac: Define "lint" if --enable-gcc-warnings.
13167 2002-11-05 Akim Demaille <akim@epita.fr>
13169 * src/scan-gram.l: When it starts with `%', complain about the
13170 whole directive, not just that `invalid character: %'.
13172 2002-11-04 Akim Demaille <akim@epita.fr>
13174 * Makefile.maint: Update from Autoconf.
13175 (update, cvs-update, po-update, do-po-update): New.
13177 2002-11-04 Akim Demaille <akim@epita.fr>
13179 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
13181 Have yyerror `use' its arguments.
13182 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
13183 returns true when location & yacc & pure & parse-param.
13184 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
13186 2002-11-04 Akim Demaille <akim@epita.fr>
13188 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
13190 * src/scan-gram.l: Use [\'] instead of ['] to pacify
13193 Use quote, not quote_n since LOCATION_PRINT no longer uses the
13196 2002-11-03 Paul Eggert <eggert@twinsun.com>
13198 * src/reader.c (get_merge_function, grammar_current_rule_check):
13199 Use consistent diagnostics for reporting type name clashes.
13200 Quote the types with <>, for consistency with Yacc.
13201 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
13203 2002-11-03 Akim Demaille <akim@epita.fr>
13205 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
13207 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
13208 (b4_parse_param): Remove.
13209 Use b4_identification.
13210 Propagate b4_pure_args where needed to pass them to yyerror.
13211 * data/glr.m4 (b4_parse_param): Remove.
13212 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
13213 (b4_lpure_formals): New.
13214 Use b4_identification.
13215 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
13216 b4_user_formals and b4_user_args.
13217 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
13218 (yyreportAmbiguity): When using a pure parser, also need
13219 the location, and the parse-params.
13221 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
13222 When using a pure parser, also need the parse-params.
13224 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
13225 (%pure-parser + %parse-param) LALR and GLR parsers.
13226 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
13227 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
13228 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
13229 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
13230 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
13231 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
13232 * doc/bison.texinfo: Untabify the whole file.
13233 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
13234 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
13235 (Error Reporting): Adjust to these new directives.
13236 Document %error-verbose, deprecate YYERROR_VERBOSE.
13238 2002-11-03 Akim Demaille <akim@epita.fr>
13240 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
13241 AT_CHECK_CALC_GLR invocations to use % directives, instead of
13242 command line options.
13243 * tests/cxx-type.at: Formatting changes.
13245 2002-11-03 Paul Eggert <eggert@twinsun.com>
13247 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
13248 to count columns correctly, and to check for invalid inputs.
13250 Use mbsnwidth to count columns correctly. Account for tabs, too.
13251 Include mbswidth.h.
13252 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
13253 (extend_location): New function.
13254 (YY_LINES): Remove.
13256 Handle CRLF in C code rather than in Lex code.
13257 (YY_INPUT): New macro.
13258 (no_cr_read): New function.
13260 Scan UCNs, even though we don't fully handle them yet.
13261 (convert_ucn_to_byte): New function.
13263 Handle backslash-newline correctly in C code.
13264 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
13265 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
13267 (tag, splice): New EREs. Do not allow NUL or newline in tags.
13268 Use {splice} wherever C allows backslash-newline.
13269 YY_STEP after space, newline, vertical-tab.
13270 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
13272 (letter, id): Don't assume ASCII; e.g., spell out a-z.
13274 ({int}, handle_action_dollar, handle_action_at): Check for integer
13277 (YY_STEP): Omit trailing semicolon, so that it's more like C.
13279 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
13280 as well as \000. Check for UCHAR_MAX, not 255.
13281 Allow \x with an arbitrary positive number of digits, as in C.
13282 Check for overflow here.
13283 Allow \? and UCNs, for compatibility with C.
13285 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
13286 with quote slot used by complain_at.
13288 * tests/input.at: Add tests for backslash-newline, m4 quotes
13289 in symbols, long literals, and funny escapes in strings.
13291 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
13292 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
13293 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
13294 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
13295 * m4/mbswidth.m4: New file, from GNU coreutils.
13297 * doc/bison.texinfo (Grammar Outline): Document // comments.
13298 (Symbols): Document that trigraphs have no special meaning in Bison,
13299 nor is backslash-newline allowed.
13300 (Actions): Document that trigraphs have no special meaning.
13302 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
13305 2002-11-02 Paul Eggert <eggert@twinsun.com>
13307 * src/reader.c: Don't include quote.h; not needed.
13308 (get_merge_function): Reword warning to be consistent with
13309 type clash diagnostic in grammar_current_rule_check.
13311 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
13312 bug in trigraph handling.
13314 * src/output.c (prepare_symbols): When printing token names,
13315 escape "[" as "@<:@" and likewise for "]".
13317 * src/system.h (errno): Remove declaration, as we are now
13318 assuming C89 or better, and C89 guarantees errno.
13320 2002-10-30 Paul Eggert <eggert@twinsun.com>
13322 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
13323 Check for close failures.
13324 * src/files.h (xfclose): Return void, not int, since it always
13326 * src/files.c (xfclose): Likewise. Report I/O error if ferror
13328 * src/output.c (output_skeleton): Use xfclose rather than fclose
13329 and ferror. xfclose now checks ferror.
13331 * data/glr.c (YYLEFTMOST_STATE): Remove.
13332 (yyreportTree): Use a stack-based leftmost state. This avoids
13333 our continuing battles with bogus warnings about initializers.
13335 2002-10-30 Akim Demaille <akim@epita.fr>
13337 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
13340 2002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13342 * tests/glr-regr1.at: New test for reported regressions.
13343 * tests/testsuite.at: Add glr-regr1.at test.
13344 * tests/Makefile.am: Add glr-regr1.at test.
13346 2002-10-24 Paul Eggert <eggert@twinsun.com>
13350 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
13351 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
13352 we use malloc. Don't assume 'A' through 'Z' are contiguous.
13353 Don't assume strdup exists; POSIX says its an XSI extension.
13354 Check for buffer overflow on input.
13356 2002-10-24 Akim Demaille <akim@epita.fr>
13358 * src/output.c (output_skeleton): Don't disable M4sugar comments
13359 too soon: it results in comments being expanded.
13360 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
13363 2002-10-24 Akim Demaille <akim@epita.fr>
13365 * data/yacc.c (m4_int_type): New.
13366 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
13367 char' as only yacc.c wants K&R portability.
13368 * data/glr.c (yysigned_char): Remove.
13369 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
13370 Reported by Quoc Peyrot.
13372 2002-10-23 Paul Eggert <eggert@twinsun.com>
13374 * src/main.c (main): With --trace=time, report times even if a
13375 non-fatal error occurs. Formerly, the times were reported in some
13376 such cases but not in others.
13377 * src/reader.c (reader): Just return if a complaint has been issued,
13378 instead of exiting, so that 'main' can report times.
13380 2002-10-22 Akim Demaille <akim@epita.fr>
13382 * src/system.h: Include sys/types.
13383 Reported by Bert Deknuydt.
13385 2002-10-23 Paul Eggert <eggert@twinsun.com>
13387 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
13388 Suggested by Art Haas.
13390 2002-10-22 Paul Eggert <eggert@twinsun.com>
13392 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
13393 decl; not needed any more.
13394 * src/main.c (main): Use return to exit, undoing yesterday's change.
13395 The last OS that we could find where this wouldn't work is
13396 SunOS 3.5, and that's too old to worry about now.
13398 * data/glr.c (struct yyltype): Define members even when not
13399 doing locations. This is more consistent with yacc.c, and it
13400 works around the following bug reports:
13401 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
13402 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
13404 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
13405 @acronym consistently. Standardize on "Yacc" instead of "YACC",
13406 "Algol" instead of "ALGOL". Give a bit more history about BNF.
13408 2002-10-22 Akim Demaille <akim@epita.fr>
13410 * data/README: New.
13412 2002-10-21 Paul Eggert <eggert@twinsun.com>
13414 Be consistent about 'bool'; the old code used an enum in one
13415 module and an int in another, and this violates the C standard.
13416 * m4/stdbool.m4: New file, from coreutils 4.5.3.
13417 * configure.ac (AC_HEADER_STDBOOL): Add.
13418 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
13419 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
13420 * src/symtab.c (hash_compare_symbol_t): Likewise.
13421 * src/system.h (bool, false, true): Use a definition consistent
13422 with ../lib/hash.c. All uses changed.
13424 * src/complain.c (warning_issued): Renamed from warn_message_count,
13425 so that we needn't worry about integer overflow (!).
13426 Now of type bool. All uses changed.
13427 (complaint_issued): Renamed from complain_message_count; likewise.
13429 * src/main.c (main): Use exit to exit with failure.
13431 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
13432 rather than 1 and 0.
13433 * src/main.c (main): Likewise.
13434 * src/getargs.c (getargs): Likewise.
13435 * src/reader.c (reader): Likewise.
13437 * src/getarg.c (getargs): Remove duplicate code for
13438 "Try `bison --help'".
13440 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
13441 What was that "2" for?
13443 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
13444 * src/getargs.c (usage): Likewise.
13446 * src/getargs.c (getargs): When there are too few operands, report
13447 the last one. When there are too many, report the first extra
13448 one. This is how diffutils does it.
13450 2002-10-20 Paul Eggert <eggert@twinsun.com>
13452 Remove K&R vestiges.
13453 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
13454 * src/complain.c (VA_START): Remove. Assume prototypes.
13455 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
13456 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
13457 fatal): Assume prototypes.
13458 * src/complain.h: Assume prototypes.
13459 * src/system.h (PARAMS): Remove.
13460 Include <limits.h> unconditionally, since it's guaranteeed even
13461 for a freestanding C89 compiler.
13462 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
13463 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
13465 2002-10-20 Akim Demaille <akim@epita.fr>
13467 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
13468 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
13469 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
13470 (yyresolveStates, yyresolveAction, yyresolveStack)
13471 (yyprocessOneStack): Use them.
13472 (yy_reduce_print): New.
13473 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
13475 2002-10-20 Akim Demaille <akim@epita.fr>
13477 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
13478 arguments and output `void'.
13479 (b4_c_function): Rename as...
13480 (b4_c_function_def): this.
13481 (b4_c_function_decl, b4_c_ansi_function_def)
13482 (b4_c_ansi_function_decl): New.
13483 Change the interpretation of the arguments: before `int, foo', now
13485 * data/yacc.c (yyparse): Prototype and define thanks to these.
13486 Adjust b4_c_function_def uses.
13487 * data/glr.c (yyparse): Likewise, but ANSI only.
13489 2002-10-20 Akim Demaille <akim@epita.fr>
13491 * src/output.c (prepare): Move the definition of `tokens_number',
13492 `nterms_number', `undef_token_number', `user_token_number_max'
13494 (prepare_tokens): Here.
13495 (prepare_tokens): Rename as...
13496 (prepare_symbols): this.
13497 (prepare): Move the definition of `rules_number' to...
13498 (prepare_rules): here.
13499 (prepare): Move the definition of `last', `final_state_number',
13500 `states_number' to...
13501 (prepare_states): here.
13502 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
13504 2002-10-20 Akim Demaille <akim@epita.fr>
13506 * src/tables.h, src/tables.c, src/output.c: Comment changes.
13508 2002-10-20 Akim Demaille <akim@epita.fr>
13510 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
13513 2002-10-20 Akim Demaille <akim@epita.fr>
13515 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
13516 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
13518 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
13520 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
13521 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
13524 2002-10-19 Paul Eggert <eggert@twinsun.com>
13526 Do not create a temporary file, as that involves security and
13527 cleanup headaches. Instead, use a pair of pipes.
13528 Derived from a suggestion by Florian Krohm.
13529 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
13530 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
13531 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
13532 (BISON_PREREQ_SUBPIPE): Add.
13533 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
13534 Add subpipe.h, subpipe.c.
13535 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
13536 * po/POTFILES.in: Add lib/subpipe.c.
13537 * src/output.c: Include "subpipe.h".
13538 (m4_invoke): Remove decl.
13539 (scan_skel): New decl.
13540 (output_skeleton): Use pipe rather than temporary file for m4 input.
13541 Check that m4sugar.m4 is readable, to avoid deadlock.
13542 Check for pipe I/O error.
13543 * src/scan-skel.l (readpipe): Remove decl.
13544 (scan_skel): New function, to be used in place of m4_invoke.
13545 Read from stream rather than file.
13547 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
13548 float, as this generates a warning on Solaris 8 + GCC 3.2 with
13549 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
13550 this generates a more-accurate value anyway.
13552 * lib/timevar.c (timervar_accumulate): Rename locals to
13553 avoid confusion with similarly-named more-global.
13554 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
13556 * src/output.c (prepare): Use xstrdup to convert char const *
13557 to char *, to avoid GCC warning.
13559 2002-10-19 Akim Demaille <akim@epita.fr>
13561 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
13562 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
13563 Use them to have `calc.y' ready for %pure-parser.
13564 * data/yacc.c (YYLEX): Pass a yylex return type to
13565 b4_c_function_call.
13567 2002-10-19 Akim Demaille <akim@epita.fr>
13569 Prototype support of %lex-param and %parse-param.
13571 * src/parse-gram.y: Add the definition of the %lex-param and
13572 %parse-param tokens, plus their rules.
13573 Drop the `_' version of %glr-parser.
13575 * src/scan-gram.l (INITIAL): Scan them.
13576 * src/muscle_tab.c: Comment changes.
13577 (muscle_insert, muscle_find): Rename `pair' as `probe'.
13578 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
13579 (muscle_entry_s): The `value' member is no longer const.
13580 Adjust all dependencies.
13581 * src/muscle_tab.c (muscle_init): Adjust: use
13582 MUSCLE_INSERT_STRING.
13583 Initialize the obstack earlier.
13584 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
13585 (muscle_pair_list_grow): New.
13586 * data/c.m4 (b4_c_function_call, b4_c_args): New.
13587 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
13588 * tests/calc.at: Use %locations, not --locations.
13589 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
13591 2002-10-19 Akim Demaille <akim@epita.fr>
13593 * src/getargs.c (usage): Take status as argument and exit
13595 Report the traditional `Try ... --help' message when status != 0.
13596 (usage, version): Don't take a FILE * as arg, it is pointless.
13597 (getargs): When there is an incorrect number of arguments, make it
13598 an error, and report it GNUlically thanks to `usage ()'.
13600 2002-10-18 Paul Eggert <eggert@twinsun.com>
13602 * data/glr.c (yyreportParseError): Don't assume that sprintf
13603 yields the length of the printed string, as this is not true
13604 on SunOS 4.1.4. Reported by Peter Klein.
13606 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
13607 * tests/conflicts.at (%nonassoc and eof): Likewise.
13608 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
13610 2002-10-17 Akim Demaille <akim@epita.fr>
13612 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
13613 * src/getargs.c (trace_types, trace_args): Adjust.
13614 * src/reader.c (grammar_current_rule_prec_set)
13615 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
13616 Standardize error messages.
13617 And s/@prec/%prec/!
13618 (reader): Use trace_flag to enable scanner/parser debugging,
13619 instead of an adhoc scheme.
13620 * src/scan-gram.l: Remove trailing debugging code.
13622 2002-10-16 Paul Eggert <eggert@twinsun.com>
13624 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
13627 * NEWS: Officially drop support for building Bison with K&R C,
13628 since it didn't work anyway and it's not worth worrying about.
13629 * Makefile.maint (wget_files): Remove ansi2knr.c.
13630 (ansi2knr.c-url_prefix): Remove.
13631 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
13632 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
13633 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
13635 2002-10-15 Paul Eggert <eggert@twinsun.com>
13637 Stop using the "enum_" trick for K&R-style function definitions;
13638 it confused me, and I was the author! Instead, assume that people
13639 who want to use K&R C compilers (when using these modules in GCC,
13640 perhaps?) will run ansi2knr.
13642 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
13643 All uses of "enum_" changed to "enum ".
13644 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
13645 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
13647 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
13648 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
13649 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
13650 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
13651 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
13652 abitset_not, abitset_ones, abitset_or, abitset_or_and,
13653 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
13654 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
13655 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
13656 Use function prototypes; this removes the need for declaring
13657 static functions simply to provide their prototypes.
13658 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
13659 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
13660 bitset_count_, bitset_create, bitset_dump, bitset_first,
13661 bitset_free, bitset_init, bitset_last, bitset_next,
13662 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
13663 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
13664 bitset_print, bitset_release_memory, bitset_toggle_,
13665 bitset_type_choose, bitset_type_get, bitset_type_name_get,
13666 debug_bitset): Likewise.
13667 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
13668 * lib/bitset_stats.c (bitset_log_histogram_print,
13669 bitset_percent_histogram_print, bitset_stats_and,
13670 bitset_stats_and_cmp, bitset_stats_and_or,
13671 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
13672 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
13673 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
13674 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
13675 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
13676 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
13677 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
13678 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
13679 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
13680 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
13681 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
13682 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
13683 bitset_stats_zero): Likewise.
13684 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
13685 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
13686 bitsetv_dump, debug_bitsetv): Likewise.
13687 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
13688 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
13689 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
13690 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
13691 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
13692 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
13693 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
13694 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
13695 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
13696 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
13697 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
13699 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
13700 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
13701 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
13702 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
13703 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
13704 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
13705 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
13706 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
13707 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
13708 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
13709 lbitset_xor_cmp, lbitset_zero): Likewise.
13711 2002-10-14 Akim Demaille <akim@epita.fr>
13715 2002-10-14 Akim Demaille <akim@epita.fr>
13717 * tests/Makefile.am (maintainer-check-posix): New.
13719 2002-10-14 Akim Demaille <akim@epita.fr>
13721 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
13724 2002-10-14 Akim Demaille <akim@epita.fr>
13726 * src/tables.c (table_ninf_remap): base -> tab.
13727 Reported by Matt Rosing.
13729 2002-10-14 Paul Eggert <eggert@twinsun.com>
13731 * tests/action.at, tests/calc.at, tests/conflicts.at,
13732 tests/cxx-type.at, tests/headers.at, tests/input.at,
13733 tests/regression.at, tests/synclines.at, tests/torture.at:
13734 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
13735 so that the tests still work even if POSIXLY_CORRECT is set.
13736 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
13738 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
13739 for portability to K&R hosts. Fix typo: signed char is guaranteed
13740 only to 127, not to 128.
13741 * data/glr.c (yysigned_char): New type.
13742 * data/yacc.c (yysigned_char): Likewise.
13743 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
13745 2002-10-13 Paul Eggert <eggert@twinsun.com>
13747 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
13748 true due to limited range of data type" warning from GCC.
13750 * data/c.m4 (b4_token_defines): Protect against double-inclusion
13751 by wrapping enum yytokentype's definition inside #ifndef
13752 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
13754 2002-10-13 Akim Demaille <akim@epita.fr>
13756 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
13757 Un yy- yyrhs to avoid the name clash with the global YYRHS.
13759 2002-10-13 Akim Demaille <akim@epita.fr>
13761 * Makefile.maint: Update from Autoconf 2.54.
13762 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
13764 2002-10-13 Akim Demaille <akim@epita.fr>
13766 * src/print.c (print_state): Separate the list of solved conflicts
13767 from the other items.
13768 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
13770 2002-10-13 Akim Demaille <akim@epita.fr>
13772 Let nondeterministic skeletons be usable with deterministic
13775 With the patch, GAWK compiled by GCC without -O2 passes its test
13776 suite using a GLR parser driven by LALR tables. It fails with -O2
13777 because `struct stat' gives two different answers on my machine:
13778 88 (definition of an auto var) and later 96 (memset on this var).
13779 Hence the stack is badly corrumpted. The headers inclusion is to
13780 blame: if I move the awk.h inclusion before GLR's system header
13781 inclusion, the two struct stat have the same size.
13783 * src/tables.c (pack_table): Always create conflict_table.
13784 (token_actions): Always create conflict_list.
13785 * data/glr.c (YYFLAG): Remove, unused.
13787 2002-10-13 Akim Demaille <akim@epita.fr>
13789 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
13791 (VALGRIND, GXX): New.
13792 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
13793 * tests/bison.in: Run $PREBISON a pre-command.
13794 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
13795 (maintainer-check-g++): New.
13796 * Makefile.am (maintainer-check): New.
13798 2002-10-13 Akim Demaille <akim@epita.fr>
13800 * data/glr.c: Formatting changes.
13801 Tweak some trace messages to match yacc.c's.
13803 2002-10-13 Akim Demaille <akim@epita.fr>
13805 GLR parsers sometimes raise parse errors instead of performing the
13807 Reported by Charles-Henry de Boysson.
13809 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
13810 check the length of the traces when %glr.
13811 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
13813 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
13815 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
13816 (yyltype): Remove the yy prefix from the member names.
13817 (yytable): Complete its comment.
13818 (yygetLRActions): Map error action number from YYTABLE from
13820 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
13821 (which was a bug: it should have been YYTABEL_NINF, and yet it was
13822 not satisfying as we could compare an YYACTION computed from
13823 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
13824 only value for error actions.
13825 (yyreportParseError): In verbose parse error messages, don't issue
13826 `error' in the list of expected tokens.
13827 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
13828 next action to perform to match glr.c's decoding.
13829 (yytable): Complete its comment.
13831 2002-10-13 Paul Eggert <eggert@twinsun.com>
13833 Fix problem reported by Henrik Grubbstroem in
13834 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
13835 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
13836 because the Bison parser reads the second action before reducing
13838 * src/scan-gram.l (rule_length): New static var.
13839 Use it to keep track of the rule length in the scanner, since
13840 we can't expect the parser to be in lock-step sync with the scanner.
13841 (handle_action_dollar, handle_action_at): Use this var.
13842 * tests/actions.at (Exotic Dollars): Test for the problem.
13844 2002-10-12 Paul Eggert <eggert@twinsun.com>
13846 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
13847 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
13848 Include <sys/time.h> when checking for clock_t and struct tms.
13849 Use same include order as source.
13850 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
13851 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
13853 * lib/timevar.c: Update copyright date and clarify comments.
13854 (get_time) [IN_GCC]: Keep the GCC version for reference.
13856 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
13857 GCC version as of today, then merge Bison's changes.
13858 Change "GCC" to "Bison" in copyright notice. timevar.def's
13859 author is Akim, so change that too.
13861 * src/reader.c (grammar_current_rule_check):
13862 Don't worry about the default action if $$ is untyped.
13863 Prevents bogus warnings reported by Jim Gifford in
13864 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
13866 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
13867 * data/glr.c, data/lalr1.cc, data/yacc.c:
13868 Output token definitions before the first part of user declarations.
13869 Fixes compatibility problem reported by Jim Gifford for kbd in
13870 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
13872 2002-10-11 Paul Eggert <eggert@twinsun.com>
13874 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
13875 (yyparse): here. This undoes some of the 2002-07-25 change.
13876 Compatibility problem reported by Ralf S. Engelschall with
13877 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
13879 2002-10-11 Akim Demaille <akim@epita.fr>
13881 * tests/regression.at Characters Escapes): New.
13882 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
13884 Reported by Jan Nieuwenhuizen.
13886 2002-10-11 Akim Demaille <akim@epita.fr>
13890 2002-10-10 Paul Eggert <eggert@twinsun.com>
13892 Portability fixes for bitsets; this also avoids several GCC
13895 * lib/abitset.c: Include <stddef.h>, for offsetof.
13896 * lib/lbitset.c: Likewise.
13898 * lib/abitset.c (abitset_bytes): Return a size that is aligned
13899 properly for vectors of objects. Do not assume that adding a
13900 header size to a multiple of a word size yields a value that is
13901 properly aligned for the whole union.
13902 * lib/bitsetv.c (bitsetv_alloc): Likewise.
13904 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
13905 unique names for structures.
13906 * lib/ebitset.c (ebitset_bytes): Likewise.
13907 * lib/lbitset.c (lbitset_bytes): Likewise.
13909 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
13910 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
13911 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
13912 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
13913 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
13914 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
13915 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
13916 to improve the type-checking that GCC can do.
13917 * lib/bitset.c (bitset_op4_cmp): Likewise.
13918 * lib/bitset_stats.c (bitset_stats_count,
13919 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
13920 bitset_stats_copy, bitset_stats_disjoint_p,
13921 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
13922 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
13923 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
13924 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
13925 bitset_stats_and_or_cmp, bitset_stats_andn_or,
13926 bitset_stats_andn_or_cmp, bitset_stats_or_and,
13927 bitset_stats_or_and_cmp): Likewise.
13928 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
13929 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
13930 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
13931 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
13933 * lib/abitset.h: Include bitset.h, not bbitset.h.
13934 * lib/ebitset.h: Likewise.
13935 * lib/lbitset.h: Likewise.
13937 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
13938 All instances of parameters of type enum bitset_opts are now of
13939 type enum_bitset_opts, to conform to the C Standard, and similarly
13940 for enum_bitset_type.
13941 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
13942 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
13944 Do not use "struct bitset_struct" to mean different things in
13945 different modules. Not only is this confusing, it violates
13946 the C Standard, which requires that structure types in different
13947 modules must be compatible if one is to be passed to the other.
13948 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
13949 All instances of "struct bitset_struct *" replaced with "bitset".
13950 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
13951 (union bitset_union, struct abitset_struct, struct ebitset_struct,
13952 struct lbitset_struct, struct bitset_stats_struct): New types.
13953 All uses of struct bitset_struct changed to union bitset_union,
13955 * lib/abitset.c (struct abitset_struct, abitset,
13956 struct bitset_struct): Remove.
13957 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
13958 struct bitset_struct): Remove.
13959 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
13960 bitset_struct): Remove.
13961 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
13964 Do not call a function of type T using a call that assumes the
13965 function is of a different type U. Standard C requires that a
13966 function must be called with a type that is compatible with its
13968 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
13970 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
13972 * lib/ebitset.c (PFV): Remove.
13973 * lib/lbitset.c (PFV): Likewise.
13974 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
13975 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
13977 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
13978 (ebitset_vtable): Use them.
13979 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
13980 lbitset_xor): New functions.
13981 (lbitset_vtable): Use them.
13983 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
13986 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
13988 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
13989 Use offsetof, for simplicity.
13991 2002-10-06 Paul Eggert <eggert@twinsun.com>
13993 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
13994 the same width as int. This reapplies a hunk of the 2002-08-12 patch
13995 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
13996 which was inadvertently undone by the 2002-09-30 patch.
13997 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
13998 the same width as int.
14000 2002-10-04 Paul Eggert <eggert@twinsun.com>
14004 * configure.ac (AC_INIT), NEWS: Increment version number.
14006 * doc/bison.texinfo: Minor spelling, grammar, and white space
14008 (Symbols): Mention that any negative value returned from yylex
14009 signifies end-of-input. Warn about negative chars. Mention
14010 the portable Standard C character set.
14012 The GNU coding standard says CFLAGS and YFLAGS are reserved
14013 for the installer to set.
14014 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
14015 * src/Makefile.am (AM_CFLAGS): Likewise.
14016 (AM_YFLAGS): Renamed from YFLAGS.
14018 Fix some MAX and MIN problems.
14019 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
14020 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
14021 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
14022 * src/reader.c (reader): Use it.
14024 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
14025 POSIX 1003.1-2001 has removed fgrep.
14027 2002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
14029 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
14030 interpreted as signed.
14031 * lib/ebitset.c (ebitset_list): Fix bug.
14033 2002-10-01 Paul Eggert <eggert@twinsun.com>
14035 More fixes for 64-bit hosts and large bitsets.
14037 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
14038 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
14039 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
14040 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
14041 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
14042 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
14043 bitset_count_): Likewise.
14044 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
14045 bitset_first, bitset_last): Likewise.
14046 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
14047 bitset_stats_list_reverse, bitset_stats_size,
14048 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
14050 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
14051 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
14052 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
14053 bitsetv_reflexive_transitive_closure): Likewise.
14054 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
14055 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
14057 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
14060 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
14061 Use size_t, not unsigned int, to count bytes.
14062 * lib/abitset.h (abitset_bytes): Likewise.
14063 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
14065 * lib/bitset.h (bitset_bytes): Likewise.
14066 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
14067 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
14068 * lib/bitsetv.c (bitsetv_alloc): Likewise.
14069 * lib/ebitset.c (ebitset_bytes): Likewise.
14070 * lib/ebitset.h (ebitset_bytes): Likewise.
14071 * lib/lbitset.c (lbitset_bytes): Likewise.
14072 * lib/lbitset.h (lbitset_bytes): Likewise.
14074 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
14075 abitset_subset_p, abitset_disjoint_p, abitset_and,
14076 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
14077 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
14078 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
14079 abitset_or_and, abitset_or_and_cmp):
14080 Use bitset_windex instead of unsigned int.
14081 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
14082 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
14083 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
14084 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
14086 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
14088 * lib/bitset.c (bitset_print):
14089 Use proper printf formats for widths of integer types.
14090 * lib/bitset_stats.c (bitset_percent_histogram_print,
14091 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
14092 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
14093 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
14094 * lib/lbitset.c (lbitset_bytes): Likewise.
14096 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
14097 BITSET_SIZE_MAX): New macros.
14098 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
14099 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
14100 to BITSET_WINDEX_MAX.
14102 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
14103 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
14104 since we now return the bitset_bindex type (not int).
14106 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
14107 when computing sizes.
14108 * lib/ebitset.c (ebitset_elts_grow): Likewise.
14110 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
14111 and avoid cast to unsigned.
14113 2002-09-30 Akim Demaille <akim@epita.fr>
14115 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
14116 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
14117 Updates from Michael Hayes.
14119 2002-09-30 Art Haas <ahaas@neosoft.com>
14121 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
14123 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
14126 2002-09-27 Akim Demaille <akim@epita.fr>
14130 2002-09-27 Akim Demaille <akim@epita.fr>
14132 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
14133 (Because of AC_LIBSOURCE).
14135 2002-09-27 Akim Demaille <akim@epita.fr>
14137 Playing with Autoscan.
14139 * configure.ac: Remove the old LIBOBJ tweaks.
14140 (AC_REPLACE_FUNCS): Add strrchr and strtol.
14141 * lib/strrchr.c: New.
14142 * lib/strtol.c: New, from the Coreutils 4.5.1.
14144 2002-09-27 Akim Demaille <akim@epita.fr>
14146 Playing with Autoscan.
14148 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
14149 * lib/Makefile.am (libbison_a_SOURCES): No longer include
14150 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
14151 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
14154 2002-09-24 Akim Demaille <akim@epita.fr>
14156 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
14157 (Frequently Asked Questions, Parser Stack Overflow): New.
14159 2002-09-13 Akim Demaille <akim@epita.fr>
14161 Playing with autoscan.
14163 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
14164 * src/files.c (skeleton_find): Remove, unused.
14165 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
14166 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
14168 2002-09-13 Akim Demaille <akim@epita.fr>
14170 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
14171 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
14173 2002-09-13 Akim Demaille <akim@epita.fr>
14175 * configure.ac: Require 2.54.
14176 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
14177 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
14178 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
14179 Remove, provided by Autoconf macros.
14181 2002-09-12 Akim Demaille <akim@epita.fr>
14183 * m4/prereq.m4: Update, from Coreutils 4.5.1.
14185 2002-09-12 Akim Demaille <akim@epita.fr>
14187 * m4/prereq.m4: Update, from Fileutils 4.1.5.
14188 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
14189 Reported by Martin Mokrejs.
14191 2002-09-10 Akim Demaille <akim@epita.fr>
14193 * src/parse-gram.y: Associate a human readable string to each
14195 * tests/regression.at (Invalid inputs): Adjust.
14197 2002-09-10 Gary V. Vaughan <gary@gnu.org>
14199 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
14200 with an Autoconf-2.5x style configure.ac.
14202 2002-09-06 Paul Eggert <eggert@twinsun.com>
14204 * doc/bison.texinfo (Conditions): Make explicit that the GPL
14205 exception applies only to yacc.c. This is a modification of a
14206 patch originally suggested by Akim Demaille.
14208 2002-09-06 Akim Demaille <akim@epita.fr>
14210 * data/c.m4 (b4_copyright): Move the GPL exception comment from
14212 * data/yacc.c: here.
14214 * data/lalr1.cc (struct yyltype): Don't define it, since we use
14216 (b4_ltype): Default to yy::Location from location.hh.
14218 2002-09-04 Jim Meyering <jim@meyering.net>
14220 * data/yacc.c: Guard the declaration of yytoknum also with
14221 `#ifdef YYPRINT', so it is declared only when used.
14223 2002-09-04 Akim Demaille <akim@epita.fr>
14225 * configure.in: Rename as...
14226 * configure.ac: this.
14229 2002-09-04 Akim Demaille <akim@epita.fr>
14231 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
14232 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
14233 translate maintainer only messages.
14235 2002-08-12 Paul Eggert <eggert@twinsun.com>
14239 * Makefile.am (SUBDIRS): Remove intl.
14240 (DISTCLEANFILES): Remove.
14241 * NEWS: Mention that GNU M4 is now required. Clarify what is
14242 meant by "larger grammars". Mention the pt_BR translation.
14243 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
14244 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
14245 Bump version from 0.11.2 to 0.11.5.
14246 (BISON_PREREQ_STAGE): Remove.
14247 (AM_GNU_GETTEXT): Use external gettext.
14248 (AC_OUTPUT): Remove intl/Makefile.
14250 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
14252 * data/glr.c: Include string.h, for strlen.
14253 (yyreportParseError): Use size_t for yysize.
14254 (yy_yypstack): No longer nested inside yypstates, as nested
14255 functions are not portable. Do not assume size_t is the
14257 (yypstates): Do not assume that ptrdiff_t is the same width
14258 as int, and similarly for yyposn and YYINDEX.
14260 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
14262 * lib/Makefile.am (INCLUDES): Do not include from the intl
14263 directory, which has been removed.
14264 * src/Makefile.am (INCLUDES): Likewise.
14266 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
14267 (bitsets_sources, additional_bitsets_sources, timevars_sources):
14270 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
14271 * tests/Makefile.am (EXTRA_DIST): Likewise.
14273 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
14274 Do not assume that bitset_windex is the same width as unsigned.
14276 * lib/abitset.c (abitset_unused_clear): Do not assume that
14277 bitset_word is the same width as int.
14278 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
14279 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
14280 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
14281 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
14282 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
14284 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
14285 portability to one's complement hosts!).
14286 * lib/ebitset.c (ebitset_op1): Likewise.
14287 * lib/lbitset.c (lbitset_op1): Likewise.
14289 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
14290 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
14291 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
14292 Sync with fileutils.
14293 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
14294 lib/gettext.h: Sync with diffutils.
14296 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
14297 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
14299 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
14300 PROTOTYPES to check for prototypes, and "defined __STDC__" to
14303 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
14304 size_t; the old version tried to do this but casted improperly.
14305 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
14306 (bitset_test): Now returns int, not unsigned long.
14308 * lib/bitset_stats.c: Include "gettext.h".
14310 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
14311 name locals "index", as it generates unnecessary warnings on some
14312 hosts that have an "index" function.
14314 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
14315 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
14316 they need translation.
14317 * src/LR0.c (state_list_append, new_itemsets, get_state,
14318 append_states, generate_states): Likewise.
14319 * src/assoc.c (assoc_to_string): Likewise.
14320 * src/closure.c (print_closure, set_firsts, closure): Likewise.
14321 * src/gram.c (grammar_dump): Likewise.
14322 * src/injections.c (injections_compute): Likewise.
14323 * src/lalr.c (lookaheads_print): Likewise.
14324 * src/relation.c (relation_transpose): Likewise.
14325 * src/scan-gram.l: Likewise.
14326 * src/tables.c (table_grow, pack_vector): Likewise.
14328 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
14329 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
14330 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
14331 * m4/mbstate_t.m4: Sync with fileutils.
14332 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
14334 * po/LINGUAS: Add pt_BR.
14335 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
14336 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
14338 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
14340 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
14342 * src/complain.c (strerror_r): Remove decl; not needed.
14343 (strerror): Use same pattern as ../lib/error.c.
14345 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
14347 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
14349 * src/main.c (main): Cast result of bindtextdomain and textdomain
14350 to void, to avoid a GCC warning when --disable-nls is in effect.
14352 * src/scan-gram.l: Use strings rather than escapes when possible,
14353 to minimize the number of warnings from xgettext.
14354 (handle_action_dollar, handle_action_at): Don't use isdigit,
14355 as it mishandles negative chars and it may not work as expected
14356 outside the C locale.
14358 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
14359 this is a GCC extension and is not portable to other compilers.
14361 * src/system.h (alloca): Use same pattern as ../lib/error.c.
14362 Do not include <ctype.h>; no longer needed.
14363 Do not include <malloc.h>; no longer needed (and generates
14364 warnings on OpenBSD 3.0).
14366 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
14369 * tests/regression.at: Do not use 'cc -c input.c -o input';
14370 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
14372 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
14373 exit status as failure, not just exit status 1. Sun C exits
14374 with status 2 sometimes.
14376 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
14377 Use it for the two large tests.
14379 2002-08-02 Akim Demaille <akim@epita.fr>
14381 * src/conflicts.c (conflicts_output): Don't output rules never
14382 reduced here, since anyway that computation doesn't work.
14383 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
14384 (rule_useless_p, rule_never_reduced_p): New.
14385 (grammar_rules_partial_print): Use a filter instead of a range.
14386 Display the title only if needed.
14387 (grammar_rules_print): Adjust.
14388 (grammar_rules_never_reduced_report): New.
14389 * src/tables.c (action_row): Move the computation of rules never
14391 (token_actions): here.
14392 * src/main.c (main): Make the parser before making the report, so
14393 that rules never reduced are computed.
14394 Call grammar_rules_never_reduced_report.
14395 * src/print.c (print_results): Report rules never reduced.
14396 * tests/conflicts.at, tests/reduce.at: Adjust.
14398 2002-08-01 Akim Demaille <akim@epita.fr>
14400 Instead of attaching lookaheads and duplicating the rules being
14401 reduced by a state, attach the lookaheads to the reductions.
14403 * src/state.h (state_t): Remove the `lookaheads',
14404 `lookaheads_rule' member.
14405 (reductions_t): Add a `lookaheads' member.
14406 Use a regular array for the `rules'.
14407 * src/state.c (reductions_new): Initialize the lookaheads member
14409 (state_rule_lookaheads_print): Adjust.
14410 * src/state.h, src/state.c (state_reductions_find): New.
14411 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
14412 (count_rr_conflicts): Adjust.
14413 * src/lalr.c (LArule): Remove.
14414 (add_lookback_edge): Adjust.
14415 (state_lookaheads_count): New.
14416 (states_lookaheads_initialize): Merge into...
14417 (initialize_LA): this.
14418 (lalr_free): Adjust.
14419 * src/main.c (main): Don't free nullable and derives too early: it
14420 is used by --verbose.
14421 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
14423 2002-08-01 Akim Demaille <akim@epita.fr>
14425 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
14427 (set_derives, free_derives): Rename as...
14428 (derives_compute, derives_free): this.
14429 Adjust all dependencies.
14430 * src/nullable.c (set_nullable, free_nullable): Rename as...
14431 (nullable_compute, nullable_free): these.
14432 (rule_list_t): Store rule_t *, not rule_number_t.
14433 * src/state.c (state_rule_lookaheads_print): Directly compare rule
14434 pointers, instead of their numbers.
14435 * src/main.c (main): Call nullable_free, and derives_free earlier,
14436 as they were lo longer used.
14438 2002-08-01 Akim Demaille <akim@epita.fr>
14440 * lib/timevar.c (get_time): Include children time.
14441 * src/lalr.h (LA, LArule): Don't export them: used with the
14443 * src/lalr.c (LA, LArule): Static.
14444 * src/lalr.h, src/lalr.c (lalr_free): New.
14445 * src/main.c (main): Call it.
14446 * src/tables.c (pack_vector): Check whether loc is >= to the
14448 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
14449 (tables_generate): do it, since that's also it which allocates
14451 Don't free LA and LArule, main does.
14453 2002-07-31 Akim Demaille <akim@epita.fr>
14455 Separate parser tables computation and output.
14457 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
14458 (conflict_list, conflict_list_cnt, table, check, table_ninf)
14459 (yydefgoto, yydefact, high): Move to...
14460 * src/tables.h, src/tables.c: here.
14461 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
14462 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
14463 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
14464 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
14465 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
14466 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
14467 (action_row, save_row, token_actions, save_column, default_goto)
14468 (goto_actions, sort_actions, matching_state, pack_vector)
14469 (table_ninf_remap, pack_table, prepare_actions): Move to...
14470 * src/tables.c: here.
14471 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
14472 * src/output.c (token_actions, output_base, output_conflicts)
14473 (output_check): Merge into...
14474 (prepare_actions): this.
14475 (actions_output): Rename as...
14476 (user_actions_output): this.
14477 * src/main.c (main): Call tables_generate and tables_free.
14479 2002-07-31 Akim Demaille <akim@epita.fr>
14481 Steal GCC's --time-report support.
14483 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
14484 stolen/adjusted from GCC.
14485 * m4/stage.m4: Remove time related checks.
14486 * m4/timevar.m4: New.
14487 * configure.in: Adjust.
14488 * src/system.h: Adjust to using timevar.h.
14489 * src/getargs.h, src/getargs.c: Support trace_time for
14491 * src/main.c (stage): Remove.
14492 (main): Replace `stage' invocations with timevar calls.
14493 * src/output.c: Insert pertinent timevar calls.
14495 2002-07-31 Akim Demaille <akim@epita.fr>
14497 Let --trace have arguments.
14499 * src/getargs.h (enum trace_e): New.
14500 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
14501 (long_options, short_options): --trace/-T takes an optional
14503 Change all the uses of trace_flag to reflect the new flags.
14504 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
14506 Strengthen `stage' portability.
14508 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
14509 * configure.in: Use it.
14510 Don't check for malloc.h and sys/times.h.
14511 * src/system.h: Include them when appropriate.
14512 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
14513 times and struct tms are available.
14515 2002-07-30 Akim Demaille <akim@epita.fr>
14517 In verbose parse error message, don't report `error' as an
14519 * tests/actions.at (Printers and Destructors): Adjust.
14520 * tests/calc.at (Calculator $1): Adjust.
14521 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
14522 error message, do not report the parser accepts the error token in
14525 2002-07-30 Akim Demaille <akim@epita.fr>
14527 Normalize conflict related messages.
14529 * src/complain.h, src/complain.c (warn, complain): New.
14530 * src/conflicts.c (conflicts_print): Use them.
14531 (conflict_report_yacc): New, extracted from...
14532 (conflicts_print): here.
14533 * tests/conflicts.at, tests/existing.at: Adjust.
14535 2002-07-30 Akim Demaille <akim@epita.fr>
14537 Report rules which are never reduced by the parser: those hidden
14540 * src/LR0.c (save_reductions): Don't make the final state too
14541 different: save its reduction (accept) instead of having a state
14542 without any action (no shift or goto, no reduce).
14543 Note: the final state is now a ``regular'' state, i.e., the
14544 parsers now contain `reduce 0' as default reduction.
14545 Nevertheless, since they decide to `accept' when yystate =
14546 final_state, they still will not reduce rule 0.
14547 * src/print.c (print_actions, print_reduction): Adjust.
14548 * src/output.c (action_row): Track reduced rules.
14549 (token_actions): Report rules never reduced.
14550 * tests/conflicts.at, tests/regression.at: Adjust.
14552 2002-07-30 Akim Demaille <akim@epita.fr>
14554 `stage' was accidently included in a previous patch.
14555 Initiate its autoconfiscation.
14557 * configure.in: Look for malloc.h and sys/times.h.
14558 * src/main.c (stage): Adjust.
14559 Report only when trace_flag.
14561 2002-07-29 Akim Demaille <akim@epita.fr>
14563 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
14565 (errs_t): symbol_t*, not symbol_number_t.
14566 (reductions_t): rule_t*, not rule_number_t.
14567 (FOR_EACH_SHIFT): New.
14568 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
14569 * src/print.c, src/print_graph.c: Adjust.
14571 2002-07-29 Akim Demaille <akim@epita.fr>
14573 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
14575 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
14576 (endtoken, accept): these.
14577 * src/reader.c (reader): Set endtoken's default tag to "$end".
14578 Set undeftoken's tag to "$undefined" instead of "$undefined.".
14579 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
14582 2002-07-29 Akim Demaille <akim@epita.fr>
14584 * src/reduce.c (reduce_grammar): When the language is empty,
14585 complain about the start symbol, not the axiom.
14587 * tests/reduce.at (Empty Language): New.
14589 2002-07-26 Akim Demaille <akim@epita.fr>
14591 * src/reader.h, src/reader.c (gram_error): ... can't get
14592 yycontrol without making too strong assumptions on the parser
14594 * src/output.c (prepare_tokens): Use the real 0th value of
14595 token_translations instead of `0'.
14596 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
14598 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
14599 for the time being: %locations ought to provide it to yyerror.
14601 2002-07-25 Akim Demaille <akim@epita.fr>
14603 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
14604 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
14605 * tests/regression.at (Web2c Actions): Adjust.
14607 2002-07-25 Akim Demaille <akim@epita.fr>
14609 Stop storing rules from 1 to nrules + 1.
14611 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
14612 * src/nullable.c, src/output.c, src/print.c, src/reader.c
14613 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
14614 Iterate from 0 to nrules.
14615 Use rule_number_as_item_number and item_number_as_rule_number.
14616 Adjust to `derive' now containing possibly 0.
14617 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
14618 Handle the `- 1' part in rule numbers from/to item numbers.
14619 * src/conflicts.c (log_resolution): Fix the message which reversed
14621 * src/output.c (action_row): Initialize default_rule to -1.
14622 (token_actions): Adjust.
14623 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
14625 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
14627 2002-07-25 Akim Demaille <akim@epita.fr>
14629 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
14630 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
14631 (b4_c_knr_arg_decl): New.
14632 * data/yacc.c: Use it to define yysymprint, yydestruct, and
14633 yyreport_parse_error.
14635 2002-07-25 Akim Demaille <akim@epita.fr>
14637 * data/yacc.c (yyreport_parse_error): New, extracted from...
14639 (yydestruct, yysymprint): Move above yyparse.
14642 2002-07-25 Akim Demaille <akim@epita.fr>
14644 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
14646 (b4_sint_type, b4_uint_type): these.
14647 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
14648 * tests/regression.at (Web2c Actions): Adjust.
14650 2002-07-25 Akim Demaille <akim@epita.fr>
14652 * src/gram.h (TIEM_NUMBER_MAX): New.
14653 (item_number_of_rule_number, rule_number_of_item_number): Rename
14655 (rule_number_as_item_number, item_number_as_rule_number): these.
14656 Adjust dependencies.
14657 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
14658 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
14659 (symbol_number_to_vector_number): New.
14660 (order): Of vector_number_t* type.
14661 (base_t, BASE_MAX, BASE_MIN): New.
14662 (froms, tos, width, pos, check): Of base_t type.
14663 (action_number_t, ACTION_MIN, ACTION_MAX): New.
14664 (actrow): Of action_number_t type.
14665 (conflrow): Of unsigned int type.
14666 (table_ninf, base_ninf): New.
14667 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
14668 (muscle_insert_int_table, muscle_insert_base_table)
14669 (muscle_insert_rule_number_table): New.
14670 (prepare_tokens): Output `toknum' as int_table.
14671 (action_row): Returns a rule_number_t.
14672 Use ACTION_MIN, not SHRT_MIN.
14673 (token_actions): yydefact is rule_number_t*.
14674 (table_ninf_remap): New.
14675 (pack_table): Use it for `base' and `table'.
14676 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
14678 (YYPACT_NINF, YYTABLE_NINF): these.
14679 (yypact, yytable): Compute their types instead of hard-coded
14681 * tests/regression.at (Web2c Actions): Adjust.
14683 2002-07-19 Akim Demaille <akim@epita.fr>
14685 * src/scan-gram.l (id): Can start with an underscore.
14687 2002-07-16 Akim Demaille <akim@epita.fr>
14689 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
14690 Adjust all former `associativity' dependencies.
14691 * src/symtab.c (symbol_new): Default associativity is `undef', not
14693 (symbol_check_alias_consistence): Adjust.
14695 2002-07-09 Akim Demaille <akim@epita.fr>
14697 * doc/bison.texinfo: Properly set the ``header'' part.
14698 Use @dircategory ``GNU programming tools'' as per Texinfo's
14702 2002-07-09 Akim Demaille <akim@epita.fr>
14704 * lib/quotearg.h: Protect against multiple inclusions.
14705 * src/location.h (location_t): Add a `file' member.
14706 (LOCATION_RESET, LOCATION_PRINT): Adjust.
14707 * src/complain.c (warn_at, complain_at, fatal_at): Drop
14708 `error_one_per_line' support.
14710 2002-07-09 Akim Demaille <akim@epita.fr>
14712 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
14713 * src/reader.c (lineno): Remove.
14714 Adjust all dependencies.
14715 (get_merge_function): Take a location and use complain_at.
14716 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
14717 * tests/regression.at (Invalid inputs, Mixing %token styles):
14720 2002-07-09 Akim Demaille <akim@epita.fr>
14722 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
14723 recovery rule, and forbid extensions when --yacc.
14724 (gram_error): Use complain_at.
14725 * src/reader.c (reader): Exit if there were parse errors.
14727 2002-07-09 Akim Demaille <akim@epita.fr>
14729 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
14730 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
14731 Reported by R Blake <blakers@mac.com>.
14733 2002-07-09 Akim Demaille <akim@epita.fr>
14735 * data/yacc.c: Output the copyright notive in the header.
14737 2002-07-03 Akim Demaille <akim@epita.fr>
14739 * src/output.c (froms, tos): Are state_number_t.
14740 (save_column): sp, sp1, and sp2 are state_number_t.
14741 (prepare): Rename `final' as `final_state_number', `nnts' as
14742 `nterms_number', `nrules' as `rules_number', `nstates' as
14743 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
14745 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
14746 * data/lalr1.cc (nsym_): Remove, unused.
14748 2002-07-03 Akim Demaille <akim@epita.fr>
14750 * src/lalr.h, src/lalr.c (goto_number_t): New.
14751 * src/lalr.c (goto_list_t): New.
14753 * src/nullable.c (rule_list_t): New.
14755 * src/types.h: Remove.
14757 2002-07-03 Akim Demaille <akim@epita.fr>
14759 * src/closure.c (print_fderives): Use rule_rhs_print.
14760 * src/derives.c (print_derives): Use rule_rhs_print.
14761 (rule_list_t): New, replaces `shorts'.
14762 (set_derives): Add comments.
14763 * tests/sets.at (Nullable, Firsts): Adjust.
14765 2002-07-03 Akim Demaille <akim@epita.fr>
14767 * src/output.c (prepare_actions): Free `tally' and `width'.
14768 (prepare_actions): Allocate and free `order'.
14769 * src/symtab.c (symbols_free): Free `symbols'.
14770 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
14771 * src/output.c (m4_invoke): Move to...
14772 * src/scan-skel.l: here.
14773 (<<EOF>>): Close yyout, and free its name.
14775 2002-07-03 Akim Demaille <akim@epita.fr>
14777 Fix some memory leaks, and fix a bug: state 0 was examined twice.
14779 * src/LR0.c (new_state): Merge into...
14780 (state_list_append): this.
14781 (new_states): Merge into...
14782 (generate_states): here.
14783 (set_states): Don't ensure a proper `errs' state member here, do it...
14784 * src/conflicts.c (conflicts_solve): here.
14785 * src/state.h, src/state.c: Comment changes.
14786 (state_t): Rename member `shifts' as `transitions'.
14787 Adjust all dependencies.
14788 (errs_new): For consistency, also take the values as argument.
14789 (errs_dup): Remove.
14790 (state_errs_set): New.
14791 (state_reductions_set, state_transitions_set): Assert that no
14792 previous value was assigned.
14794 (states_free): Use it.
14795 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
14796 temporary storage: use `errs' and `nerrs' as elsewhere.
14797 (set_conflicts): Allocate and free this `errs'.
14799 2002-07-02 Akim Demaille <akim@epita.fr>
14801 * lib/libiberty.h: New.
14802 * lib: Update the bitset implementation from upstream.
14803 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
14804 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
14805 * src/main.c: Adjust bitset stats calls.
14807 2002-07-01 Paul Eggert <eggert@twinsun.com>
14809 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
14810 char, so that negative chars don't collide with $.
14812 2002-06-30 Akim Demaille <akim@epita.fr>
14814 Have the GLR tests be `warning' checked, and fix the warnings.
14816 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
14817 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
14818 (yyremoveDeletes): `yyi' and `yyj' are size_t.
14819 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
14820 (yyaddDeferredAction): static.
14821 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
14822 (yyreportParseError): yyprefix is const.
14823 yytokenp is used only when verbose.
14824 (yy__GNUC__): Replace with __GNUC__.
14825 (yypdumpstack): yyi is size_t.
14826 (yypreference): Un-yy local variables and arguments, to avoid
14827 clashes with `yyr1'. Anyway, we are not in the user name space.
14828 (yytname_size): be an int, as is compared with ints.
14829 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
14831 * tests/cxx-gram.at: Use quotation to protect $1.
14832 Use AT_COMPILE to enable warnings hunts.
14833 Prototype yylex and yyerror.
14835 Include `string.h', not `strings.h'.
14836 Produce and prototype stmtMerge only when used.
14837 yylex takes a location.
14839 2002-06-30 Akim Demaille <akim@epita.fr>
14841 We spend a lot of time in quotearg, in particular when --verbose.
14843 * src/symtab.c (symbol_get): Store a quoted version of the key.
14844 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
14845 Adjust all callers.
14847 2002-06-30 Akim Demaille <akim@epita.fr>
14849 * src/state.h (reductions_t): Rename member `nreds' as num.
14850 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
14851 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
14853 2002-06-30 Akim Demaille <akim@epita.fr>
14855 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
14856 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
14857 (shifts_to): Rename as...
14858 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
14859 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
14860 (TRANSITION_IS_DISABLED, transitions_to): these.
14862 2002-06-30 Akim Demaille <akim@epita.fr>
14864 * src/print.c (print_shifts, print_gotos): Merge into...
14865 (print_transitions): this.
14866 (print_transitions, print_errs, print_reductions): Align the
14867 lookaheads columns.
14868 (print_core, print_transitions, print_errs, print_state,
14869 print_grammar): Output empty lines separator before, not after.
14870 (state_default_rule_compute): Rename as...
14871 (state_default_rule): this.
14872 * tests/conflicts.at (Defaulted Conflicted Reduction),
14873 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
14874 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
14876 2002-06-30 Akim Demaille <akim@epita.fr>
14878 Display items as we display rules.
14880 * src/gram.h, src/gram.c (rule_lhs_print): New.
14881 * src/gram.c (grammar_rules_partial_print): Use it.
14882 * src/print.c (print_core): Likewise.
14883 * tests/conflicts.at (Defaulted Conflicted Reduction),
14884 (Unresolved SR Conflicts): Adjust.
14885 (Unresolved SR Conflicts): Adjust and rename as...
14886 (Resolved SR Conflicts): this, as was meant.
14887 * tests/regression.at (Web2c Report): Adjust.
14889 2002-06-30 Akim Demaille <akim@epita.fr>
14891 * src/print.c (state_default_rule_compute): New, extracted from...
14892 (print_reductions): here.
14893 Pessimize, but clarify the code.
14894 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
14896 2002-06-30 Akim Demaille <akim@epita.fr>
14898 * src/output.c (action_row): Let default_rule be always a rule
14901 2002-06-30 Akim Demaille <akim@epita.fr>
14903 * src/closure.c (print_firsts, print_fderives, closure):
14904 Use BITSET_EXECUTE.
14905 * src/lalr.c (lookaheads_print): Likewise.
14906 * src/state.c (state_rule_lookaheads_print): Likewise.
14907 * src/print_graph.c (print_core): Likewise.
14908 * src/print.c (print_reductions): Likewise.
14909 * src/output.c (action_row): Likewise.
14910 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
14912 2002-06-30 Akim Demaille <akim@epita.fr>
14914 * src/print_graph.c: Use report_flag.
14916 2002-06-30 Akim Demaille <akim@epita.fr>
14918 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
14920 * src/relation.h, src/relation.c (traverse, relation_digraph)
14921 (relation_print, relation_transpose): New.
14923 2002-06-30 Akim Demaille <akim@epita.fr>
14925 * src/state.h, src/state.c (shifts_to): New.
14926 * src/lalr.c (build_relations): Use it.
14928 2002-06-30 Akim Demaille <akim@epita.fr>
14930 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
14931 (item_number_of_rule_number, rule_number_of_item_number): New.
14932 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
14933 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
14934 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
14935 Propagate their use.
14936 Much remains to be done, in particular wrt `shorts' from types.h.
14938 2002-06-30 Akim Demaille <akim@epita.fr>
14940 * src/symtab.c (symbol_new): Initialize the `printer' member.
14942 2002-06-30 Akim Demaille <akim@epita.fr>
14944 * src/LR0.c (save_reductions): Remove, replaced by...
14945 * src/state.h, src/state.c (state_reductions_set): New.
14946 (reductions, errs): Rename as...
14947 (reductions_t, errs_t): these.
14948 Adjust all dependencies.
14950 2002-06-30 Akim Demaille <akim@epita.fr>
14952 * src/LR0.c (state_list_t, state_list_append): New.
14953 (first_state, last_state): Now symbol_list_t.
14954 (this_state): Remove.
14955 (new_itemsets, append_states, save_reductions): Take a state_t as
14957 (set_states, generate_states): Adjust.
14958 (save_shifts): Remove, replaced by...
14959 * src/state.h, src/state.c (state_shifts_set): New.
14960 (shifts): Rename as...
14962 Adjust all dependencies.
14963 * src/state.h (state_t): Remove the `next' member.
14965 2002-06-30 Akim Demaille <akim@epita.fr>
14967 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
14970 2002-06-30 Akim Demaille <akim@epita.fr>
14972 Use hash.h for the state hash table.
14974 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
14975 (allocate_storage): Use state_hash_new.
14976 (free_storage): Use state_hash_free.
14977 (new_state, get_state): Adjust.
14978 * src/lalr.h, src/lalr.c (states): Move to...
14979 * src/states.h (state_t): Remove the `link' member, no longer
14981 * src/states.h, src/states.c: here.
14982 (state_hash_new, state_hash_free, state_hash_lookup)
14983 (state_hash_insert, states_free): New.
14984 * src/states.c (state_table, state_compare, state_hash): New.
14985 * src/output.c (output_actions): Do not free states now, since we
14986 still need to know the final_state number in `prepare', called
14987 afterwards. Do it...
14988 * src/main.c (main): here: call states_free after `output'.
14990 2002-06-30 Akim Demaille <akim@epita.fr>
14992 * src/state.h, src/state.c (state_new): New, extracted from...
14993 * src/LR0.c (new_state): here.
14994 * src/state.h (STATE_ALLOC): Move to...
14995 * src/state.c: here.
14996 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
14997 * src/state.h, src/state.c: here.
14999 2002-06-30 Akim Demaille <akim@epita.fr>
15001 * src/reader.c (gensym): Rename as...
15002 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
15003 (getsym): Rename as...
15004 (symbol_get): this.
15006 2002-06-30 Akim Demaille <akim@epita.fr>
15008 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
15009 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
15010 * src/output.c, src/print.c, src/print_graph.c: Propagate.
15011 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
15013 2002-06-30 Akim Demaille <akim@epita.fr>
15015 Make the test suite pass with warnings checked.
15017 * tests/actions.at (Printers and Destructors): Improve.
15018 Avoid unsigned vs. signed issues.
15019 * tests/calc.at: Don't exercise the scanner here, do it...
15020 * tests/input.at (Torturing the Scanner): here.
15022 2002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15024 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
15025 reorganize first lines parallel to yacc.c.
15027 2002-06-28 Akim Demaille <akim@epita.fr>
15029 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
15030 (b4_token_enum, b4_token_defines): New, factored from...
15031 * data/lalr1.cc, data/yacc.c, glr.c: here.
15033 2002-06-28 Akim Demaille <akim@epita.fr>
15035 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
15037 * src/output.c (merger_output): static.
15039 2002-06-28 Akim Demaille <akim@epita.fr>
15041 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
15042 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
15044 * src/output.c (save_row): Initialize all the variables to pacify GCC.
15046 2002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15048 Accumulated changelog for new GLR parsing features.
15050 * src/conflicts.c (count_total_conflicts): Change name to
15051 conflicts_total_count.
15052 * src/conflicts.h: Ditto.
15053 * src/output.c (token_actions): Use the new name.
15054 (output_conflicts): Change conflp => conflict_list_heads, and
15055 confl => conflict_list for better readability.
15056 * data/glr.c: Use the new names.
15057 * NEWS: Add self to GLR announcement.
15059 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
15061 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
15064 * data/bison.glr: Change name to glr.c
15065 * data/glr.c: Renamed from bison.glr.
15066 * data/Makefile.am: Add glr.c
15070 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
15071 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
15073 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15075 * data/bison.glr: Be sure to restore the
15076 current #line when returning to the skeleton contents after having
15077 exposed the input file's #line.
15079 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15081 * data/bison.glr: Bring up to date with changes to bison.simple.
15083 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15085 * data/bison.glr: Correct definitions that use b4_prefix.
15086 Various reformatting.
15087 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
15088 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
15089 yytokenp argument; now part of stack.
15090 (yychar): Define to behave as documented.
15091 (yyclearin): Ditto.
15093 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15095 * src/reader.h: Add declaration for free_merger_functions.
15097 * src/reader.c (merge_functions): New variable.
15098 (get_merge_function): New function.
15099 (free_merger_functions): New function.
15100 (readgram): Check for %prec that is not followed by a symbol.
15101 Handle %dprec and %merge declarations.
15102 (packgram): Initialize dprec and merger fields in rules array.
15104 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
15105 conflict_list_cnt, conflict_list_free): New variables.
15106 (table_grow): Also grow conflict_table.
15107 (prepare_rules): Output dprec and merger tables.
15108 (conflict_row): New function.
15109 (action_row): Output conflict lists for GLR parser. Don't use
15110 default reduction in conflicted states for GLR parser so that there
15111 are spaces for the conflict lists.
15112 (save_row): Also save conflict information.
15113 (token_actions): Allocate conflict list.
15114 (merger_output): New function.
15115 (pack_vector): Pack conflict table, too.
15116 (output_conflicts): New function to output yyconflp and yyconfl.
15117 (output_check): Allocate conflict_tos.
15118 (output_actions): Output conflict tables, also.
15119 (output_skeleton): Output b4_mergers definition.
15120 (prepare): Output b4_max_rhs_length definition.
15121 Use 'bison.glr' as default skeleton for GLR parsers.
15123 * src/gram.c (glr_parser): New flag.
15124 (grammar_free): Call free_merger_functions.
15126 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
15127 all pairs of conflicting reductions, rather than just all tokens
15128 causing conflicts. Needed to size conflict tables.
15129 (conflicts_output): Modify call to count_rr_conflicts for new
15131 (conflicts_print): Ditto.
15132 (count_total_conflicts): New function.
15134 * src/reader.h (merger_list): New type.
15135 (merge_functions): New variable.
15137 * src/lex.h (tok_dprec, tok_merge): New token types.
15139 * src/gram.h (rule_s): Add dprec and merger fields.
15140 (glr_parser): New flag.
15142 * src/conflicts.h (count_total_conflicts): New function.
15144 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
15146 * doc/bison.texinfo (Generalized LR Parsing): New section.
15147 (GLR Parsers): New section.
15148 (Language and Grammar): Mention GLR parsing.
15149 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
15150 Correct typo ("tge" -> "the").
15152 * data/bison.glr: New skeleton for GLR parsing.
15154 * tests/cxx-gram.at: New tests for GLR parsing.
15156 * tests/testsuite.at: Include cxx-gram.at.
15158 * tests/Makefile.am: Add cxx-gram.at.
15160 * src/parse-gram.y:
15162 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
15164 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
15166 2002-06-27 Akim Demaille <akim@epita.fr>
15168 * src/options.h, src/options.c: Remove.
15169 * src/getargs.c (short_options, long_options): New.
15171 2002-06-27 Akim Demaille <akim@epita.fr>
15173 * data/bison.simple, data/bison.c++: Rename as...
15174 * data/yacc.c, data/lalr1.cc: these.
15175 * doc/bison.texinfo (Environment Variables): Remove.
15177 2002-06-25 Raja R Harinath <harinath@cs.umn.edu>
15179 * src/getargs.c (report_argmatch): Initialize strtok().
15181 2002-06-20 Akim Demaille <akim@epita.fr>
15183 * data/bison.simple (b4_symbol_actions): New, replaces...
15184 (b4_symbol_destructor, b4_symbol_printer): these.
15185 (yysymprint): Be sure to call YYPRINT only for tokens, and using
15186 user token numbers.
15188 2002-06-20 Akim Demaille <akim@epita.fr>
15190 * data/bison.simple (yydestructor): Rename as...
15191 (yydestruct): this.
15193 2002-06-20 Akim Demaille <akim@epita.fr>
15195 * src/symtab.h, src/symtab.c (symbol_type_set)
15196 (symbol_destructor_set, symbol_precedence_set): The location is
15198 Adjust all callers.
15200 2002-06-20 Akim Demaille <akim@epita.fr>
15202 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
15204 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
15206 * src/symtab.h, src/symtab.c (symbol_class_set)
15207 (symbol_user_token_number_set): Likewise.
15208 Adjust all callers.
15209 Promote complain_at.
15210 * tests/input.at (Type Clashes): Adjust.
15212 2002-06-20 Akim Demaille <akim@epita.fr>
15214 * data/bison.simple (YYLEX): Fix the declaration when
15217 2002-06-20 Akim Demaille <akim@epita.fr>
15219 * data/bison.simple (yysymprint): Don't print the token number,
15221 * tests/actions.at (Destructors): Rename as...
15222 (Printers and Destructors): this.
15223 Also exercise %printer.
15225 2002-06-20 Akim Demaille <akim@epita.fr>
15227 * data/bison.simple (YYDSYMPRINT): New.
15228 Use it to remove many of the #if YYDEBUG/if (yydebug).
15230 2002-06-20 Akim Demaille <akim@epita.fr>
15232 * src/symtab.h, src/symtab.c (symbol_t): printer and
15233 printer_location are new members.
15234 (symbol_printer_set): New.
15235 * src/parse-gram.y (PERCENT_PRINTER): New token.
15236 Handle its associated rule.
15237 * src/scan-gram.l: Adjust.
15238 (handle_destructor_at, handle_destructor_dollar): Rename as...
15239 (handle_symbol_code_at, handle_symbol_code_dollar): these.
15240 * src/output.c (symbol_printers_output): New.
15241 (output_skeleton): Call it.
15242 * data/bison.simple (yysymprint): New. Cannot be named yyprint
15243 since there are already many grammar files with a user `yyprint'.
15244 Replace the calls to YYPRINT to calls to yysymprint.
15245 * tests/calc.at: Adjust.
15246 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
15247 taking advantage of parser very internal details (stack size!).
15249 2002-06-20 Akim Demaille <akim@epita.fr>
15251 * src/scan-gram.l: Complete the scanner with the missing patterns
15253 Use `quote' and `symbol_tag_get' where appropriate.
15255 2002-06-19 Akim Demaille <akim@epita.fr>
15257 * tests/actions.at (Destructors): Augment to test locations.
15258 * data/bison.simple (yydestructor): Pass it the current location
15259 if locations are enabled.
15260 Prototype only when __STDC__ or C++.
15261 Change the argument names to move into the yy name space: there is
15264 2002-06-19 Akim Demaille <akim@epita.fr>
15266 * data/bison.simple (b4_pure_if): New.
15267 Use it instead of #ifdef YYPURE.
15269 2002-06-19 Akim Demaille <akim@epita.fr>
15271 * data/bison.simple (b4_location_if): New.
15272 Use it instead of #ifdef YYLSP_NEEDED.
15274 2002-06-19 Akim Demaille <akim@epita.fr>
15276 Prepare @$ in %destructor, but currently don't bind it in the
15277 skeleton, as %location use is not cleaned up yet.
15279 * src/scan-gram.l (handle_dollar, handle_destructor_at)
15280 (handle_action_at): New.
15281 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
15282 a braced_code_t and a location as additional arguments.
15283 (handle_destructor_dollar): Instead of requiring `b4_eval', just
15284 unquote one when outputting `b4_dollar_dollar'.
15286 * data/bison.simple (b4_eval): Remove.
15287 (b4_symbol_destructor): Adjust.
15288 * tests/input.at (Invalid @n): Adjust.
15290 2002-06-19 Zack Weinberg <zack@codesourcery.com>
15292 * doc/bison.texinfo: Document ability to have multiple
15295 2002-06-18 Akim Demaille <akim@epita.fr>
15297 * src/files.c (compute_base_names): When computing the output file
15298 names from the input file name, strip the directory part.
15300 2002-06-18 Akim Demaille <akim@epita.fr>
15302 * data/bison.simple.new: Comment changes.
15303 Reported by Andreas Schwab.
15305 2002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
15307 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
15308 there are no `label `yyoverflowlab' defined but not used' warnings
15309 when yyoverflow is defined.
15311 2002-06-18 Akim Demaille <akim@epita.fr>
15313 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
15315 (symbol_destructor_set): Adjust.
15316 * src/output.c (symbol_destructors_output): Output the destructor
15318 Output the symbol name.
15319 * data/bison.simple (b4_symbol_destructor): Adjust.
15321 2002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
15322 and Akim Demaille <akim@epita.fr>
15324 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
15325 what's left on the stack when the error recovery hits EOF.
15326 * tests/actions.at (Destructors): Complete to exercise this case.
15328 2002-06-17 Akim Demaille <akim@epita.fr>
15330 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
15331 arguments is really empty, not only equal to `[]'.
15332 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
15334 (symbol_destructor_set): New.
15335 * src/output.c (symbol_destructors_output): New.
15336 * src/reader.h (brace_code_t, current_braced_code): New.
15337 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
15338 (handle_dollar): Rename as...
15339 (handle_action_dollar): this.
15340 (handle_destructor_dollar): New.
15341 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
15342 (grammar_declaration): Use it.
15343 * data/bison.simple (yystos): Is always defined.
15344 (yydestructor): New.
15345 * tests/actions.at (Destructors): New.
15346 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
15348 2002-06-17 Akim Demaille <akim@epita.fr>
15350 * src/symlist.h, src/symlist.c (symbol_list_length): New.
15351 * src/scan-gram.l (handle_dollar, handle_at): Compute the
15352 rule_length only when needed.
15353 * src/output.c (actions_output, token_definitions_output): Output
15355 * src/symtab.c: Don't access directly to the symbol tag, use
15357 * src/parse-gram.y: Use symbol_list_free.
15359 2002-06-17 Akim Demaille <akim@epita.fr>
15361 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
15362 (symbol_list_prepend, get_type_name): Move to...
15363 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
15364 (symbol_list_prepend, symbol_list_n_type_name_get): here.
15365 Adjust all callers.
15366 (symbol_list_free): New.
15367 * src/scan-gram.l (handle_dollar): Takes a location.
15368 * tests/input.at (Invalid $n): Adjust.
15370 2002-06-17 Akim Demaille <akim@epita.fr>
15372 * src/reader.h, src/reader.c (symbol_list_new): Export it.
15373 (symbol_list_prepend): New.
15374 * src/parse-gram.y (%union): `list' is a new member.
15375 (symbols.1): New, replaces...
15376 (terms_to_prec.1, nterms_to_type.1): these.
15377 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
15378 Take a location as additional argument.
15379 Adjust all callers.
15381 2002-06-15 Akim Demaille <akim@epita.fr>
15383 * src/parse-gram.y: Move %token in the declaration section so that
15384 we don't depend upon CVS Bison.
15386 2002-06-15 Akim Demaille <akim@epita.fr>
15388 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
15389 * src/print.c (print_core): Use it.
15391 2002-06-15 Akim Demaille <akim@epita.fr>
15393 * src/conflicts.c (log_resolution): Accept the rule involved in
15394 the sr conflicts instead of the lookahead number that points to
15396 (flush_reduce): Accept the current lookahead vector as argument,
15397 instead of the index in LA.
15398 (resolve_sr_conflict): Accept the current number of lookahead
15399 bitset to consider for the STATE, instead of the index in LA.
15400 (set_conflicts): Adjust.
15401 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
15403 2002-06-15 Akim Demaille <akim@epita.fr>
15405 * src/state.h (state_t): Replace the `lookaheadsp' member, a
15406 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
15407 Adjust all dependencies.
15408 * src/lalr.c (initialize_lookaheads): Split into...
15409 (states_lookaheads_count, states_lookaheads_initialize): these.
15412 2002-06-15 Akim Demaille <akim@epita.fr>
15414 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
15416 (grammar_rules_print): here.
15417 * src/reduce.c (reduce_output): Use it.
15418 * tests/reduce.at (Useless Rules, Reduced Automaton)
15419 (Underivable Rules): Adjust.
15421 2002-06-15 Akim Demaille <akim@epita.fr>
15423 Copy BYacc's nice way to report the grammar.
15425 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
15427 Don't print the rules' location, it is confusing and useless.
15428 (rule_print): Use grammar_rhs_print.
15429 * src/print.c (print_grammar): Use grammar_rules_print.
15431 2002-06-15 Akim Demaille <akim@epita.fr>
15433 Complete and rationalize `useless thing' warnings.
15435 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
15436 (symbol_tag_print): New.
15437 Use them everywhere in place of accessing directly the tag member.
15438 * src/gram.h, src/gram.c (rule_print): New.
15439 Use it where a rule used to be printed `by hand'.
15440 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
15441 (reduce_grammar_tables): Report the useless rules.
15442 (reduce_print): Useless things are a warning, not an error.
15444 * tests/reduce.at (Useless Nonterminals, Useless Rules):
15445 (Reduced Automaton, Underivable Rules): Adjust.
15446 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
15447 * tests/conflicts.at (Unresolved SR Conflicts)
15448 (Solved SR Conflicts): Adjust.
15450 2002-06-15 Akim Demaille <akim@epita.fr>
15452 Let symbols have a location.
15454 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
15456 Adjust all callers.
15457 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
15458 Use location_t, not int.
15459 * src/symtab.c (symbol_check_defined): Take advantage of the
15461 * tests/regression.at (Invalid inputs): Adjust.
15463 2002-06-15 Akim Demaille <akim@epita.fr>
15465 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
15466 (input): Don't try to initialize yylloc here, do it in the
15468 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
15469 * src/gram.h (rule_t): Change line and action_line into location
15470 and action_location, of location_t type.
15471 Adjust all dependencies.
15472 * src/location.h, src/location.c (empty_location): New.
15473 * src/reader.h, src/reader.c (grammar_start_symbol_set)
15474 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
15475 (grammar_current_rule_symbol_append)
15476 (grammar_current_rule_action_append): Expect a location as argument.
15477 * src/reader.c (grammar_midrule_action): Adjust to attach an
15478 action's location as dummy symbol location.
15479 * src/symtab.h, src/symtab.c (startsymbol_location): New.
15480 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
15483 2002-06-14 Akim Demaille <akim@epita.fr>
15485 Grammar declarations may be found in the grammar section.
15487 * src/parse-gram.y (rules_or_grammar_declaration): New.
15488 (declarations): Each declaration may end with a semicolon, not
15490 (grammar_declaration): `"%union"'.
15491 (grammar): Branch to rules_or_grammar_declaration.
15493 2002-06-14 Akim Demaille <akim@epita.fr>
15495 * src/main.c (main): Invoke scanner_free.
15497 2002-06-14 Akim Demaille <akim@epita.fr>
15499 * src/output.c (m4_invoke): Extracted from...
15500 (output_skeleton): here.
15503 2002-06-14 Akim Demaille <akim@epita.fr>
15505 * src/parse-gram.y (directives, directive, gram)
15506 (grammar_directives, precedence_directives, precedence_directive):
15508 (declarations, declaration, grammar, grammar_declaration)
15509 (precedence_declaration, precedence_declarator): these.
15510 (symbol_declaration): New.
15512 2002-06-14 Akim Demaille <akim@epita.fr>
15514 * src/files.c (action_obstack): Remove, unused.
15515 (output_obstack): Remove it, and all its dependencies, as it is no
15517 * src/reader.c (epilogue_set): Build the epilogue in the
15519 * src/output.h, src/output.c (muscle_obstack): Move to...
15520 * src/muscle_tab.h, src/muscle_tab.h: here.
15521 (muscle_init): Initialize muscle_obstack.
15522 (muscle_free): New.
15523 * src/main.c (main): Call it.
15525 2002-06-14 Akim Demaille <akim@epita.fr>
15527 * src/location.h: New, extracted from...
15528 * src/reader.h: here.
15529 * src/Makefile.am (noinst_HEADERS): Merge into
15530 (bison_SOURCES): this.
15532 * src/parse-gram.y: Use location_t instead of Bison's.
15533 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
15534 Use location_t instead of ints.
15536 2002-06-14 Akim Demaille <akim@epita.fr>
15538 * data/bison.simple, data/bison.c++: Be sure to restore the
15539 current #line when returning to the skeleton contents after having
15540 exposed the input file's #line.
15542 2002-06-12 Akim Demaille <akim@epita.fr>
15544 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
15546 * tests/actions.at (Exotic Dollars): New.
15548 2002-06-12 Akim Demaille <akim@epita.fr>
15550 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
15552 * tests/input.at (Torturing the Scanner): New.
15554 2002-06-11 Akim Demaille <akim@epita.fr>
15556 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
15557 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
15558 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
15559 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
15560 * src/reader.c (reader): Use it.
15562 2002-06-11 Akim Demaille <akim@epita.fr>
15564 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
15565 Adjust all callers.
15566 (scanner_last_string_free): New.
15568 2002-06-11 Akim Demaille <akim@epita.fr>
15570 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
15571 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
15572 (last_string, YY_OBS_FREE): New.
15573 Use them when returning an ID.
15575 2002-06-11 Akim Demaille <akim@epita.fr>
15577 Have Bison grammars parsed by a Bison grammar.
15579 * src/reader.c, src/reader.h (prologue_augment): New.
15580 * src/reader.c (copy_definition): Remove.
15582 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
15583 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
15584 (grammar_current_rule_prec_set, grammar_current_rule_check)
15585 (grammar_current_rule_symbol_append)
15586 (grammar_current_rule_action_append): Export.
15587 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
15588 (symbol_list_action_append): Remove.
15589 Hook the routines from reader.
15590 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
15591 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
15593 * src/reader.c (read_declarations): Remove, unused.
15595 * src/parse-gram.y: Handle the epilogue.
15596 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
15597 (grammar_start_symbol_set): this.
15598 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
15599 * src/reader.c (readgram): Remove, unused.
15600 (reader): Adjust to insert eoftoken and axiom where appropriate.
15602 * src/reader.c (copy_dollar): Replace with...
15603 * src/scan-gram.h (handle_dollar): this.
15604 * src/parse-gram.y: Remove `%thong'.
15606 * src/reader.c (copy_at): Replace with...
15607 * src/scan-gram.h (handle_at): this.
15609 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
15612 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
15615 * src/reader.h, src/reader.c (grammar_rule_end): New.
15617 * src/parse.y (current_type, current_class): New.
15618 Implement `%nterm', `%token' support.
15619 Merge `%term' into `%token'.
15620 (string_as_id): New.
15621 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
15624 * src/parse-gram.y: Be sure to handle properly the beginning of
15627 * src/parse-gram.y: Handle %type.
15628 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
15630 * src/parse-gram.y: More directives support.
15631 * src/options.c: No longer handle source directives.
15633 * src/parse-gram.y: Fix %output.
15635 * src/parse-gram.y: Handle %union.
15636 Use the prologue locations.
15637 * src/reader.c (parse_union_decl): Remove.
15639 * src/reader.h, src/reader.c (epilogue_set): New.
15640 * src/parse-gram.y: Use it.
15642 * data/bison.simple, data/bison.c++: b4_stype is now either not
15643 defined, then default to int, or to the contents of %union,
15644 without `union' itself.
15646 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
15648 * src/output.c (actions_output): Don't output braces, as they are
15649 already handled by the scanner.
15651 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
15652 characters to themselves.
15654 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
15655 that the epilogue has a proper #line.
15657 * src/parse-gram.y: Handle precedence/associativity.
15659 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
15661 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
15662 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
15663 at all to define terminals that cannot be emitted.
15665 * src/scan-gram.l: Escape M4 characters.
15667 * src/scan-gram.l: Working properly with escapes in user
15668 strings/characters.
15670 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
15671 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
15673 Use more modest sizes, as for the time being the parser does not
15674 release memory, and therefore the process swallows a huge amount
15677 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
15678 stricter %token grammar.
15680 * src/symtab.h (associativity): Add `undef_assoc'.
15681 (symbol_precedence_set): Do nothing when passed an undef_assoc.
15682 * src/symtab.c (symbol_check_alias_consistence): Adjust.
15684 * tests/regression.at (Invalid %directive): Remove, as it is now
15686 (Invalid inputs): Adjust to the new error messages.
15687 (Token definitions): The new grammar doesn't allow too many
15690 * src/lex.h, src/lex.c: Remove.
15691 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
15692 (copy_character, copy_string2, copy_string, copy_identifier)
15693 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
15694 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
15695 (parse_action): Remove.
15696 * po/POTFILES.in: Adjust.
15698 2002-06-11 Akim Demaille <akim@epita.fr>
15700 * src/reader.c (parse_action): Don't store directly into the
15701 rule's action member: return the action as a string.
15702 Don't require `rule_length' as an argument: compute it.
15703 (grammar_current_rule_symbol_append)
15704 (grammar_current_rule_action_append): New, eved out from
15706 Remove `action_flag', `rulelength', unused now.
15708 2002-06-11 Akim Demaille <akim@epita.fr>
15710 * src/reader.c (grammar_current_rule_prec_set).
15711 (grammar_current_rule_check): New, eved out from...
15713 Remove `xaction', `first_rhs': useless.
15714 * tests/input.at (Type clashes): New.
15715 * tests/existing.at (GNU Cim Grammar): Adjust.
15717 2002-06-11 Akim Demaille <akim@epita.fr>
15719 * src/reader.c (grammar_midrule_action): New, Eved out from
15722 2002-06-11 Akim Demaille <akim@epita.fr>
15724 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
15726 (readgram): Use them as replacement of inlined code, crule and
15729 2002-06-11 Akim Demaille <akim@epita.fr>
15731 * src/reader.c (grammar_end, grammar_symbol_append): New.
15732 (readgram): Use them.
15733 Make the use of `p' as local as possible.
15735 2002-06-10 Akim Demaille <akim@epita.fr>
15737 GCJ's parser requires the tokens to be defined before the prologue.
15739 * data/bison.simple: Output the token definition before the user's
15741 * tests/regression.at (Braces parsing, Duplicate string)
15742 (Mixing %token styles): Check the output from bison.
15743 (Early token definitions): New.
15745 2002-06-10 Akim Demaille <akim@epita.fr>
15747 * src/symtab.c (symbol_user_token_number_set): Don't complain when
15748 assigning twice the same user number to a token, so that we can
15750 * src/lex.c (lex): here.
15751 Also use `symbol_class_set' instead of hand written code.
15752 * src/reader.c (parse_assoc_decl): Likewise.
15754 2002-06-10 Akim Demaille <akim@epita.fr>
15756 * src/symtab.c, src/symtab.c (symbol_class_set)
15757 (symbol_user_token_number_set): New.
15758 * src/reader.c (parse_token_decl): Use them.
15759 Use a switch instead of ifs.
15760 Use a single argument.
15762 2002-06-10 Akim Demaille <akim@epita.fr>
15764 Remove `%thong' support as it is undocumented, unused, duplicates
15765 `%token's job, and creates useless e-mail traffic with people who
15766 want to know what it is, why it is undocumented, unused, and
15767 duplicates `%token's job.
15769 * src/reader.c (parse_thong_decl): Remove.
15770 * src/options.c (option_table): Remove "thong".
15771 * src/lex.h (tok_thong): Remove.
15773 2002-06-10 Akim Demaille <akim@epita.fr>
15775 * src/symtab.c, src/symtab.c (symbol_type_set)
15776 (symbol_precedence_set): New.
15777 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
15778 (value_components_used): Remove, unused.
15780 2002-06-09 Akim Demaille <akim@epita.fr>
15782 Move symbols handling code out of the reader.
15784 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
15785 (axiom): Move to...
15786 * src/symtab.h, src/symtab.c: here.
15788 * src/gram.c (start_symbol): Remove: use startsymbol->number.
15789 * src/reader.c (startval): Rename as...
15790 * src/symtab.h, src/symtab.c (startsymbol): this.
15791 * src/reader.c: Adjust.
15793 * src/reader.c (symbol_check_defined, symbol_make_alias)
15794 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
15795 (token_translations_init)
15797 * src/symtab.c: here.
15798 * src/reader.c (packsymbols): Move to...
15799 * src/symtab.h, src/symtab.c (symbols_pack): here.
15800 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
15803 2002-06-03 Akim Demaille <akim@epita.fr>
15805 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
15808 2002-06-03 Akim Demaille <akim@epita.fr>
15810 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
15811 structs with non literals.
15812 * src/scan-skel.l: never-interactive.
15813 * src/conflicts.c (enum conflict_resolution_e): No trailing
15815 * src/getargs.c (usage): Split long literal strings.
15816 Reported by Hans Aberg.
15818 2002-05-28 Akim Demaille <akim@epita.fr>
15820 * data/bison.c++: Use C++ ostreams.
15821 (cdebug_): New member.
15823 2002-05-28 Akim Demaille <akim@epita.fr>
15825 * src/output.c (output_skeleton): Be sure to allocate enough room
15826 for `/' _and_ for `\0' in full_skeleton.
15828 2002-05-28 Akim Demaille <akim@epita.fr>
15830 * data/bison.c++: Catch up with bison.simple:
15831 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15832 and Paul Eggert <eggert@twinsun.com>: `error' handing.
15833 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
15834 and popping traces.
15836 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15838 * src/output.c (output_skeleton): Put an explicit path in front of
15839 the skeleton file name, rather than relying on the -I directory,
15840 to partially alleviate effects of having a skeleton file lying around
15841 in the current directory.
15843 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15845 * src/conflicts.c (log_resolution): Correct typo:
15846 obstack_printf should be obstack_fgrow1.
15848 2002-05-26 Akim Demaille <akim@epita.fr>
15850 * src/state.h (state_t): `solved_conflicts' is a new member.
15851 * src/LR0.c (new_state): Set it to 0.
15852 * src/conflicts.h, src/conflicts.c (print_conflicts)
15853 (free_conflicts, solve_conflicts): Rename as...
15854 (conflicts_print, conflicts_free, conflicts_solve): these.
15856 * src/conflicts.c (enum conflict_resolution_e)
15857 (solved_conflicts_obstack): New, used by...
15858 (log_resolution): this.
15859 Adjust to attach the conflict resolution to each state.
15860 Complete the description with the precedence/associativity
15862 (resolve_sr_conflict): Adjust.
15863 * src/print.c (print_state): Output its solved_conflicts.
15864 * tests/conflicts.at (Unresolved SR Conflicts)
15865 (Solved SR Conflicts): Exercise --report=all.
15867 2002-05-26 Akim Demaille <akim@epita.fr>
15869 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
15870 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
15871 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
15872 (token_number_t, item_number_as_token_number)
15873 (token_number_as_item_number, muscle_insert_token_number_table):
15875 (symbol_number_t, item_number_as_symbol_number)
15876 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
15877 these, since it is more appropriate.
15879 2002-05-26 Akim Demaille <akim@epita.fr>
15881 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
15883 * data/bison.simple (yystos) [YYDEBUG]: New.
15884 (yyparse) [YYDEBUG]: Display the symbols which are popped during
15886 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
15888 2002-05-25 Akim Demaille <akim@epita.fr>
15890 * doc/bison.texinfo (Debugging): Split into...
15891 (Tracing): this new section, its former contents, and...
15892 (Understanding): this new section.
15893 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
15895 (report_flag): this.
15896 Adjust all dependencies.
15897 (report_args, report_types, report_argmatch): New.
15898 (usage, getargs): Report/support -r, --report.
15900 (struct option_table_struct): Rename as..,
15901 (struct option_table_s): this.
15902 Rename the `set_flag' member to `flag' to match with getopt_long's
15904 * src/options.c (option_table): Split verbose into an entry for
15905 %verbose, and another for --verbose.
15906 Support --report/-r, so remove -r from the obsolete --raw.
15907 * src/print.c: Attach full item sets and lookaheads reports to
15908 report_flag instead of trace_flag.
15909 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
15911 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15912 and Paul Eggert <eggert@twinsun.com>
15914 * data/bison.simple (yyparse): Correct error handling to conform to
15915 POSIX and yacc. Specifically, after syntax error is discovered,
15916 do not reduce further before shifting the error token.
15917 Clean up the code a bit by removing the labels yyerrdefault,
15918 yyerrhandle, yyerrpop.
15919 * NEWS: Document the above.
15921 2002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15923 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
15924 type; it isn't always big enough, since it doesn't necessarily
15925 include non-terminals.
15926 (yytranslate): Expand definition of yy_token_number_type, so that
15927 the latter can be removed.
15928 (yy_token_number_type): Remove, only one use.
15929 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
15930 don't use TokenNumberType as element type.
15932 * tests/regression.at: Modify expected output to agree with change
15933 to yyr1 and yytranslate.
15935 2002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
15937 * src/reader.c (parse_action): Use copy_character instead of
15940 2002-05-13 Akim Demaille <akim@epita.fr>
15942 * tests/regression.at (Token definitions): Prototype yylex and
15945 2002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15947 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
15948 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
15950 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
15952 2002-05-07 Akim Demaille <akim@epita.fr>
15954 * tests/synclines.at: Be sure to prototype yylex and yyerror to
15955 avoid GCC warnings.
15957 2002-05-07 Akim Demaille <akim@epita.fr>
15961 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
15962 over the RHS of each rule.
15963 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
15964 * src/state.h (state_t): Member `nitems' is unsigned short.
15965 * src/LR0.c (get_state): Adjust.
15966 * src/reader.c (packgram): Likewise.
15967 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
15969 (muscle_insert_int_table): Remove, unused.
15970 (prepare_rules): Remove `max'.
15972 2002-05-06 Akim Demaille <akim@epita.fr>
15974 * src/closure.c (print_firsts): Display of the symbol tags.
15975 (bitmatrix_print): Move to...
15976 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
15978 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
15980 2002-05-06 Akim Demaille <akim@epita.fr>
15982 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
15985 2002-05-06 Akim Demaille <akim@epita.fr>
15987 * src/LR0.c (new_state, get_state): Instead of using the global
15988 `kernel_size' and `kernel_base', have two new arguments:
15989 `core_size' and `core'.
15992 2002-05-06 Akim Demaille <akim@epita.fr>
15994 * src/reader.c (packgram): No longer end `ritem' with a 0
15995 sentinel: it is not used.
15997 2002-05-05 Akim Demaille <akim@epita.fr>
15999 New experimental feature: display the lookaheads in the report and
16002 * src/print (print_core): When --trace-flag, display the rules
16004 * src/print_graph.c (print_core): Likewise.
16005 Swap the arguments.
16008 2002-05-05 Akim Demaille <akim@epita.fr>
16010 * tests/torture.at (Many lookaheads): New test.
16012 2002-05-05 Akim Demaille <akim@epita.fr>
16014 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
16015 (GENERATE_MUSCLE_INSERT_TABLE): this.
16016 (output_int_table, output_unsigned_int_table, output_short_table)
16017 (output_token_number_table, output_item_number_table): Replace with...
16018 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
16019 (muscle_insert_short_table, muscle_insert_token_number_table)
16020 (muscle_insert_item_number_table): these.
16021 Adjust all callers.
16022 (prepare_tokens): Don't free `translations', since...
16023 * src/reader.h, src/reader.c (grammar_free): do it.
16025 * src/gram.h, src/gram.c (grammar_free): here.
16026 * data/bison.simple, data/bison.c++: b4_token_number_max is now
16029 2002-05-05 Akim Demaille <akim@epita.fr>
16031 * src/output.c (output_unsigned_int_table): New.
16032 (prepare_rules): `i' is unsigned.
16033 `prhs', `rline', `r2' are unsigned int.
16034 Rename muscle `rhs_number_max' as `rhs_max'.
16035 Output muscles `prhs_max', `rline_max', and `r2_max'.
16037 * data/bison.simple, data/bison.c++: Adjust to use these muscles
16038 to compute types instead of constant types.
16039 * tests/regression.at (Web2c Actions): Adjust.
16041 2002-05-04 Akim Demaille <akim@epita.fr>
16043 * src/symtab.h (SALIAS, SUNDEF): Rename as...
16044 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
16045 Adjust dependencies.
16046 * src/output.c (token_definitions_output): Be sure not to output a
16047 `#define 'a'' when fed with `%token 'a' "a"'.
16048 * tests/regression.at (Token definitions): New.
16050 2002-05-03 Paul Eggert <eggert@twinsun.com>
16052 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
16055 2002-05-03 gettextize <bug-gnu-gettext@gnu.org>
16057 * Makefile.am (SUBDIRS): Remove intl.
16058 (EXTRA_DIST): Add config/config.rpath.
16060 2002-05-03 Akim Demaille <akim@epita.fr>
16062 * data/bison.simple (m4_if): Don't output empty enums.
16063 And actually, output valid enum definitions :(.
16065 2002-05-03 Akim Demaille <akim@epita.fr>
16067 * configure.bat: Remove, completely obsolete.
16068 * Makefile.am (EXTRA_DIST): Adjust.
16069 Don't distribute config.rpath...
16070 * config/Makefile.am (EXTRA_DIST): Do it.
16072 2002-05-03 Akim Demaille <akim@epita.fr>
16074 * configure.in (GETTEXT_VERSION): New.
16075 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
16077 2002-05-03 Akim Demaille <akim@epita.fr>
16079 * data/bison.simple (b4_token_enum): New.
16080 (b4_token_defines): Use it to output tokens both as #define and
16082 Suggested by Paul Eggert.
16083 * src/output.c (token_definitions_output): Don't output spurious
16086 2002-05-03 Akim Demaille <akim@epita.fr>
16088 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
16090 2002-05-02 Robert Anisko <robert@lrde.epita.fr>
16092 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
16093 Update the stack class, give a try to deque as the default container.
16095 2002-05-02 Akim Demaille <akim@epita.fr>
16097 * data/bison.simple (yyparse): Do not implement @$ = @1.
16098 (YYLLOC_DEFAULT): Adjust to do it.
16099 * doc/bison.texinfo (Location Default Action): Fix.
16101 2002-05-02 Akim Demaille <akim@epita.fr>
16103 * src/reader.c (parse_braces): Merge into...
16104 (parse_action): this.
16106 2002-05-02 Akim Demaille <akim@epita.fr>
16108 * configure.in (ALL_LINGUAS): Remove.
16109 * po/LINGUAS, hr.po: New.
16111 2002-05-02 Akim Demaille <akim@epita.fr>
16113 Remove the so called hairy (semantic) parsers.
16115 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
16116 * src/gram.h, src/gram.c (semantic_parser): Remove.
16117 (rule_t): Remove the guard and guard_line members.
16118 * src/lex.h (token_t): remove tok_guard.
16119 * src/options.c (option_table): Remove %guard and %semantic_parser
16121 * src/output.c, src/output.h (guards_output): Remove.
16123 (token_definitions_output): Don't output the `T'
16125 (output_skeleton): Don't output the guards.
16126 * src/files.c, src/files.c (attrsfile): Remove.
16127 * src/reader.c (symbol_list): Remove the guard and guard_line
16129 Adjust dependencies.
16130 (parse_guard): Remove.
16131 * data/bison.hairy: Remove.
16132 * doc/bison.texinfo (Environment Variables): Remove occurrences of
16135 2002-05-02 Akim Demaille <akim@epita.fr>
16137 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
16138 (parse_guard): Rename the formal argument `stack_offset' as
16139 `rule_length', which is more readable.
16141 (copy_at, copy_dollar): Instead of outputting the hard coded
16142 values of $$, $n and so forth, output invocation to b4_lhs_value,
16143 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
16144 Note: this patch partially drops `semantic-parser' support: it
16145 always does `rule_length - n', where semantic parsers ought to
16147 * data/bison.simple, data/bison.c++ (b4_lhs_value)
16148 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
16150 2002-05-02 Akim Demaille <akim@epita.fr>
16152 * configure.in (AC_INIT): Bump to 1.49b.
16153 (AM_INIT_AUTOMAKE): Short invocation.
16155 2002-05-02 Akim Demaille <akim@epita.fr>
16159 2002-05-01 Akim Demaille <akim@epita.fr>
16161 * src/skeleton.h: Remove.
16163 2002-05-01 Akim Demaille <akim@epita.fr>
16165 * src/skeleton.h: Fix the #endif.
16166 Reported by Magnus Fromreide.
16168 2002-04-26 Paul Eggert <eggert@twinsun.com>
16170 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
16171 Define if we define YYSTYPE and YYLTYPE, respectively.
16172 (YYCOPY): Fix [] quoting problem in the non-GCC case.
16174 2002-04-25 Robert Anisko <robert@lrde.epita.fr>
16176 * src/scan-skel.l: Postprocess quadrigraphs.
16178 * src/reader.c (copy_character): New function, used to output
16179 single characters while replacing `[' and `]' with quadrigraphs, to
16180 avoid troubles with M4 quotes.
16181 (copy_comment): Output characters with copy_character.
16182 (read_additionnal_code): Likewise.
16183 (copy_string2): Likewise.
16184 (copy_definition): Likewise.
16186 * tests/calc.at: Exercise M4 quoting.
16188 2002-04-25 Akim Demaille <akim@epita.fr>
16190 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
16191 between `!' and the command.
16192 Reported by Paul Eggert.
16194 2002-04-24 Robert Anisko <robert@lrde.epita.fr>
16196 * tests/calc.at: Exercise prologue splitting.
16198 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
16199 `b4_post_prologue' instead of `b4_prologue'.
16201 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
16203 (output): Free pre_prologue_obstack and post_prologue_obstack.
16204 * src/files.h, src/files.c (attrs_obstack): Remove.
16205 (pre_prologue_obstack, post_prologue_obstack): New.
16206 * src/reader.c (copy_definition): Add a parameter to specify the
16207 obstack to fill, instead of using attrs_obstack unconditionally.
16208 (read_declarations): Pass pre_prologue_obstack to copy_definition if
16209 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
16211 2002-04-23 Paul Eggert <eggert@twinsun.com>
16213 * data/bison.simple: Remove unnecessary commentary and white
16214 space differences from 1_29-branch.
16215 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
16217 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
16218 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
16219 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
16220 constructors or destructors.
16222 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
16224 2002-04-23 Akim Demaille <akim@epita.fr>
16226 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
16227 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
16228 location with columns.
16229 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
16230 All reported by Paul Eggert.
16232 2002-04-22 Akim Demaille <akim@epita.fr>
16234 * src/reduce.c (dump_grammar): Move to...
16235 * src/gram.h, src/gram.c (grammar_dump): here.
16236 Be sure to separate long item numbers.
16237 Don't read the members of a rule's prec if its nil.
16239 2002-04-22 Akim Demaille <akim@epita.fr>
16241 * src/output.c (table_size, table_grow): New.
16242 (MAXTABLE): Remove, replace uses with table_size.
16243 (pack_vector): Instead of dying when the table is too big, grow it.
16245 2002-04-22 Akim Demaille <akim@epita.fr>
16247 * data/bison.simple (yyr1): Its type is that of a token number.
16248 * data/bison.c++ (r1_): Likewise.
16249 * tests/regression.at (Web2c Actions): Adjust.
16251 2002-04-22 Akim Demaille <akim@epita.fr>
16253 * src/reader.c (token_translations_init): 256 is now the default
16254 value for the error token, i.e., it will be assigned another
16255 number if the user assigned 256 to one of her tokens.
16256 (reader): Don't force 256 to error.
16257 * doc/bison.texinfo (Symbols): Adjust.
16258 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
16259 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
16260 etc. instead of 10, 20, 30 (which was used to `jump' over error
16261 (256) and undefined (2)).
16263 2002-04-22 Akim Demaille <akim@epita.fr>
16265 Propagate more token_number_t.
16267 * src/gram.h (token_number_as_item_number)
16268 (item_number_as_token_number): New.
16269 * src/output.c (GENERATE_OUTPUT_TABLE): New.
16270 Use it to create output_item_number_table and
16271 output_token_number_table.
16272 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
16273 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
16274 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
16275 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
16277 2002-04-22 Akim Demaille <akim@epita.fr>
16279 * src/output.h, src/output.c (get_lines_number): Remove.
16281 2002-04-19 Akim Demaille <akim@epita.fr>
16283 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
16285 (Debugging): More details about enabling the debugging features.
16286 (Table of Symbols): Describe $$, $n, @$, and @n.
16287 Suggested by Tim Josling.
16289 2002-04-19 Akim Demaille <akim@epita.fr>
16291 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
16293 2002-04-10 Akim Demaille <akim@epita.fr>
16295 * src/system.h: Rely on HAVE_LIMITS_H.
16296 Suggested by Paul Eggert.
16298 2002-04-09 Akim Demaille <akim@epita.fr>
16300 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
16301 full stderr, and strip it according to the bison options, instead
16302 of composing the error message from different bits.
16303 This makes it easier to check for several error messages.
16304 Adjust all the invocations.
16305 Add an invocation exercising the error token.
16306 Add an invocation demonstrating a stupid error message.
16307 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
16309 Error message are for stderr, not stdout.
16311 2002-04-09 Akim Demaille <akim@epita.fr>
16313 * src/gram.h, src/gram.c (error_token_number): Remove, use
16315 * src/reader.c (reader): Don't specify the user token number (2)
16316 for $undefined, as it uselessly prevents using it.
16317 * src/gram.h (token_number_t): Move to...
16318 * src/symtab.h: here.
16319 (state_t.number): Is a token_number_t.
16320 * src/print.c, src/reader.c: Use undeftoken->number instead of
16322 (Even though this 2 is not the same as above: the number of the
16323 undeftoken remains being 2, it is its user token number which
16325 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
16326 `user_token_number_max'.
16327 Output `undef_token_number'.
16328 * data/bison.simple, data/bison.c++: Use them.
16329 Be sure to map invalid yylex return values to
16330 `undef_token_number'. This saves us from gratuitous SEGV.
16332 * tests/conflicts.at (Solved SR Conflicts)
16333 (Unresolved SR Conflicts): Adjust.
16334 * tests/regression.at (Web2c Actions): Adjust.
16336 2002-04-08 Akim Demaille <akim@epita.fr>
16338 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
16340 Remove the duplicate `typedefs'.
16341 (RhsNumberType): Fix the declaration and various other typos.
16343 * data/bison.simple: Use __ofile__.
16344 * src/scan-skel.l: Handle __ofile__.
16346 2002-04-08 Akim Demaille <akim@epita.fr>
16348 * src/gram.h (item_number_t): New, the type of item numbers in
16349 RITEM. Note that it must be able to code symbol numbers as
16350 positive number, and the negation of rule numbers as negative
16352 Adjust all dependencies (pretty many).
16353 * src/reduce.c (rule): Remove this `short *' pointer: use
16355 * src/system.h (MINSHORT, MAXSHORT): Remove.
16356 Include `limits.h'.
16357 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
16358 (shortcpy): Remove.
16359 (MAXTABLE): Move to...
16360 * src/output.c (MAXTABLE): here.
16361 (prepare_rules): Use output_int_table to output rhs.
16362 * data/bison.simple, data/bison.c++: Adjust.
16363 * tests/torture.at (Big triangle): Move the limit from 254 to
16365 * tests/regression.at (Web2c Actions): Ajust.
16367 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
16368 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
16369 passes, but produces negative #line number, once fixed, GCC is
16370 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
16372 * src/state.h (state_h): Code input lines on ints, not shorts.
16374 2002-04-08 Akim Demaille <akim@epita.fr>
16376 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
16377 and then the grammar.
16379 2002-04-08 Akim Demaille <akim@epita.fr>
16381 * src/system.h: No longer using strndup.
16383 2002-04-07 Akim Demaille <akim@epita.fr>
16385 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
16386 * src/output.c (output_table_data): Return the longest number.
16387 (prepare_tokens): Output `token_number_max').
16388 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
16390 Use them to define yy_token_number_type/TokenNumberType.
16391 Use this type for yytranslate.
16392 * tests/torture.at (Big triangle): Push the limit from 124 to
16394 * tests/regression.at (Web2c Actions): Adjust.
16396 2002-04-07 Akim Demaille <akim@epita.fr>
16398 * tests/torture.at (Big triangle): New.
16399 (GNU AWK Grammar, GNU Cim Grammar): Move to...
16400 * tests/existing.at: here.
16402 2002-04-07 Akim Demaille <akim@epita.fr>
16404 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
16406 Adjust dependencies.
16408 2002-04-07 Akim Demaille <akim@epita.fr>
16410 * src/reader.c: Normalize increments to prefix form.
16412 2002-04-07 Akim Demaille <akim@epita.fr>
16414 * src/reader.c, symtab.c: Remove debugging code.
16416 2002-04-07 Akim Demaille <akim@epita.fr>
16418 Rename all the `bucket's as `symbol_t'.
16420 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
16421 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
16422 * src/symtab.c, src/symtab.h (bucket): Rename as...
16424 (symbol_list_new, bucket_check_defined, bucket_make_alias)
16425 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
16426 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
16427 (buckets_new, buckets_free, buckets_do): Rename as...
16428 (symbol_list_new, symbol_check_defined, symbol_make_alias)
16429 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
16430 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
16431 (symbols_new, symbols_free, symbols_do): these.
16433 2002-04-07 Akim Demaille <akim@epita.fr>
16435 Use lib/hash for the symbol table.
16437 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
16439 * src/lex.c (lex): Set the `number' member of new terminals.
16440 * src/reader.c (bucket_check_defined, bucket_make_alias)
16441 (bucket_check_alias_consistence, bucket_translation): New.
16442 (reader, grammar_free, readgram, token_translations_init)
16443 (packsymbols): Adjust.
16444 (reader): Number the predefined tokens.
16445 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
16446 for predefined tokens.
16447 * src/symtab.h (bucket): Remove all the hash table related
16449 * src/symtab.c (symtab): Replace by...
16450 (bucket_table): this.
16451 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
16452 (buckets_new, buckets_do): New.
16454 2002-04-07 Akim Demaille <akim@epita.fr>
16456 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
16457 (start_symbol, max_user_token_number, semantic_parser)
16458 (error_token_number): Initialize.
16459 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
16462 (errtoken, eoftoken, undeftoken, axiom): Extern.
16464 2002-04-07 Akim Demaille <akim@epita.fr>
16466 * src/gram.h (rule_s): prec and precsym are now pointers
16467 to the bucket giving the priority/associativity.
16468 Member `associativity' removed: useless.
16469 * src/reduce.c, src/conflicts.c: Adjust.
16471 2002-04-07 Akim Demaille <akim@epita.fr>
16473 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
16474 Properly escape the symbols' TAG when outputting them.
16476 2002-04-07 Akim Demaille <akim@epita.fr>
16478 * src/lalr.h (LA): Is a bitsetv, not bitset*.
16480 2002-04-07 Akim Demaille <akim@epita.fr>
16482 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
16483 (LArule): this, which is an array to rule_t*.
16484 * src/print.c, src/conflicts.c: Adjust.
16486 2002-04-07 Akim Demaille <akim@epita.fr>
16488 * src/gram.h (rule_t): Rename `number' as `user_number'.
16489 `number' is a new member.
16490 Adjust dependencies.
16491 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
16493 2002-04-07 Akim Demaille <akim@epita.fr>
16495 As a result of the previous patch, it is no longer needed
16496 to reorder ritem itself.
16498 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
16500 2002-04-07 Akim Demaille <akim@epita.fr>
16502 Be sure never to walk through RITEMS, but use only data related to
16503 the rules themselves. RITEMS should be banished.
16505 * src/output.c (output_token_translations): Rename as...
16506 (prepare_tokens): this.
16507 In addition to `translate', prepare the muscles `tname' and
16508 `toknum', which were handled by...
16509 (output_rule_data): this.
16510 Remove, and move the remainder of its outputs into...
16511 (prepare_rules): this new routines, which also merges content from
16512 (output_gram): this.
16513 (prepare_rules): Be sure never to walk through RITEMS.
16514 (output_stos): Rename as...
16515 (prepare_stos): this.
16516 (output): Always invoke prepare_states, after all, just don't use it
16517 in the output if you don't need it.
16519 2002-04-07 Akim Demaille <akim@epita.fr>
16521 * src/LR0.c (new_state): Display `nstates' as the name of the
16522 newly created state.
16523 Adjust to initialize first_state and last_state if needed.
16524 Be sure to distinguish the initial from the final state.
16525 (new_states): Create the itemset of the initial state, and use
16527 * src/closure.c (closure): Now that the initial state has its
16528 items properly set, there is no need for a special case when
16529 creating `ruleset'.
16531 As a result, now the rule 0, reducing to $axiom, is visible in the
16532 outputs. Adjust the test suite.
16534 * tests/conflicts.at (Solved SR Conflicts)
16535 (Unresolved SR Conflicts): Adjust.
16536 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
16537 * tests/conflicts.at (S/R in initial): New.
16539 2002-04-07 Akim Demaille <akim@epita.fr>
16541 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
16542 the RHS of the rules.
16543 * src/output.c (output_gram): Likewise.
16545 2002-04-07 Akim Demaille <akim@epita.fr>
16547 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
16549 Adjust all dependencies.
16550 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
16551 `number' of the buckets too.
16552 * src/gram.h: Include `symtab.h'.
16553 (associativity): Move to...
16554 * src/symtab.h: here.
16555 No longer include `gram.h'.
16557 2002-04-07 Akim Demaille <akim@epita.fr>
16559 * src/gram.h, src/gram.c (rules_rhs_length): New.
16560 (ritem_longest_rhs): Use it.
16561 * src/gram.h (rule_t): `number' is a new member.
16562 * src/reader.c (packgram): Set it.
16563 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
16564 the end of `rules', and count them out of `nrules'.
16565 (reduce_output, dump_grammar): Adjust.
16566 * src/print.c (print_grammar): It is no longer needed to check for
16567 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
16568 * tests/reduce.at (Reduced Automaton): New test.
16570 2002-04-07 Akim Demaille <akim@epita.fr>
16572 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
16573 lacking `+ 1' to nrules, Bison reported as useless a token if it
16574 was used solely to set the precedence of the last rule...
16576 2002-04-07 Akim Demaille <akim@epita.fr>
16578 * data/bison.c++, data/bison.simple: Don't output the current file
16579 name in #line, to avoid useless diffs between two identical
16580 outputs under different names.
16582 2002-04-07 Akim Demaille <akim@epita.fr>
16584 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
16585 Normalize loops to using `< nrules + 1', not `<= nrules'.
16587 2002-04-07 Akim Demaille <akim@epita.fr>
16591 2002-04-07 Akim Demaille <akim@epita.fr>
16593 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
16594 bucket.value as bucket.number.
16596 2002-04-07 Akim Demaille <akim@epita.fr>
16598 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
16599 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
16600 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
16601 RHS, instead of being an index in RITEMS.
16603 2002-04-04 Paul Eggert <eggert@twinsun.com>
16605 * doc/bison.texinfo: Update copyright date.
16606 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
16607 (Symbols): Warn about running Bison in one character set,
16608 but compiling and/or running in an incompatible one.
16609 Warn about character code 256, too.
16611 2002-04-03 Paul Eggert <eggert@twinsun.com>
16613 * src/bison.data (YYSTACK_ALLOC): Depend on whether
16614 YYERROR_VERBOSE is nonzero, not whether it is defined.
16616 Merge changes from bison-1_29-branch.
16618 2002-03-20 Paul Eggert <eggert@twinsun.com>
16620 Merge fixes from Debian bison_1.34-1.diff.
16622 * configure.in (AC_PREREQ): 2.53.
16624 2002-03-20 Akim Demaille <akim@epita.fr>
16626 * src/conflicts.c (log_resolution): Argument `resolution' is const.
16628 2002-03-19 Paul Eggert <eggert@twinsun.com>
16630 * src/bison.simple (YYCOPY): New macro.
16631 (YYSTACK_RELOCATE): Use it.
16632 Remove Type arg; no longer needed. All callers changed.
16633 (yymemcpy): Remove; no longer needed.
16635 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
16636 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
16638 2002-03-19 Akim Demaille <akim@epita.fr>
16640 Test and fix the #line outputs.
16642 * tests/atlocal.at (GCC): New.
16643 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
16644 (Prologue synch line, %union synch line, Postprologue synch line)
16645 (Action synch line, Epilogue synch line): New tests.
16646 * src/reader.c (parse_union_decl): Define the muscle stype_line.
16647 * data/bison.simple, data/bison.c++: Use it.
16649 2002-03-19 Akim Demaille <akim@epita.fr>
16651 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
16652 (Solved SR Conflicts, %expect not enough, %expect right)
16653 (%expect too much): Move to...
16654 * tests/conflicts.at: this new file.
16656 2002-03-19 Akim Demaille <akim@epita.fr>
16658 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
16659 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
16660 that we can move to enums for instance.
16661 * src/output.c (token_definitions_output): Output a list of
16662 `token-name, token-number' instead of the #define.
16663 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
16665 2002-03-14 Akim Demaille <akim@epita.fr>
16667 Use Gettext 0.11.1.
16669 2002-03-09 Robert Anisko <robert@lrde.epita.fr>
16671 * data/bison.c++: Make the user able to add members to the generated
16672 parser by subclassing.
16674 2002-03-05 Robert Anisko <robert@lrde.epita.fr>
16676 * src/reader.c (read_additionnal_code): `c' should be an integer, not
16678 Reported by Nicolas Tisserand and Nicolas Burrus.
16680 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
16682 * src/reader.c: Warn about lacking semi-colons, do not complain.
16684 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
16686 * data/bison.c++: Remove a debug line.
16688 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
16690 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
16691 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
16692 provide a default implementation.
16694 2002-03-04 Akim Demaille <akim@epita.fr>
16696 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
16697 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
16698 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
16699 * tests/semantic.at (Parsing Guards): Similarly.
16700 * src/reader.at (readgram): Complain if the last rule is not ended
16703 2002-03-04 Akim Demaille <akim@epita.fr>
16705 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
16706 * src/closure.c: here.
16707 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
16709 * src/warshall.h, src/warshall.c: Remove.
16710 * tests/sets.at (Broken Closure): Adjust.
16712 2002-03-04 Akim Demaille <akim@epita.fr>
16714 * src/output.c (output_skeleton): tempdir is const.
16715 bytes_read is unused.
16717 2002-03-04 Akim Demaille <akim@epita.fr>
16719 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
16720 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
16722 From Michael Hayes.
16724 2002-03-04 Akim Demaille <akim@epita.fr>
16726 * src/closure.c (closure): `r' is unused.
16728 2002-03-04 Akim Demaille <akim@epita.fr>
16730 * tests/sets.at (Broken Closure): Add the ending `;'.
16731 * src/reader.at (readgram): Complain if a rule is not ended with a
16734 2002-03-04 Akim Demaille <akim@epita.fr>
16736 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
16737 (count_sr_conflicts): Use bitset_count.
16738 * src/reduce.c (inaccessable_symbols): Ditto.
16739 (bits_size): Remove.
16740 * src/warshall.h, src/warshall.c: Convert to bitsetv.
16742 2002-03-04 Akim Demaille <akim@epita.fr>
16744 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
16745 * src/reduce.c: Remove the `bitset_zero's following the
16746 `bitset_create's, as now it is performed by the latter.
16748 2002-03-04 Akim Demaille <akim@epita.fr>
16750 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
16751 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
16752 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
16753 latest sources from Michael.
16755 2002-03-04 Akim Demaille <akim@epita.fr>
16757 * src/output.c (output): Don't free the grammar.
16758 * src/reader.c (grammar_free): New.
16759 * src/main.c (main): Call it and don't free symtab here.
16761 2002-03-04 Akim Demaille <akim@epita.fr>
16763 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
16765 Reported by Benoit Perrot.
16767 2002-03-04 Akim Demaille <akim@epita.fr>
16769 Use bitset operations when possible, not loops over bits.
16771 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
16773 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
16774 * src/reduce.c (useless_nonterminals): Formatting changes.
16775 * src/warshall.c (TC): Use bitset_or.
16777 2002-03-04 Akim Demaille <akim@epita.fr>
16779 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
16780 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
16783 2002-03-04 Akim Demaille <akim@epita.fr>
16785 * src/lalr.c (F): Now a bitset*.
16786 Adjust all dependencies.
16788 2002-03-04 Akim Demaille <akim@epita.fr>
16790 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
16791 Adjust all dependencies.
16793 2002-03-04 Akim Demaille <akim@epita.fr>
16795 * src/L0.c, src/LR0.h (nstates): Be size_t.
16796 Adjust comparisons (signed vs unsigned).
16797 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
16799 Adjust all dependencies.
16801 2002-03-04 Akim Demaille <akim@epita.fr>
16803 * src/closure.c (firsts): Now, also a bitset.
16804 Adjust all dependencies.
16805 (varsetsize): Remove, now unused.
16806 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
16808 2002-03-04 Akim Demaille <akim@epita.fr>
16810 * src/print.c: Convert to use bitset.h, not hand coded iterations
16813 2002-03-04 Akim Demaille <akim@epita.fr>
16815 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
16817 2002-03-04 Akim Demaille <akim@epita.fr>
16819 * src/closure.c (ruleset): Be a bitset.
16820 (rulesetsize): Remove.
16822 2002-03-04 Akim Demaille <akim@epita.fr>
16824 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
16825 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
16826 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
16827 * src/closure.c (fderives): Be an array of bitsets.
16829 2002-02-28 Robert Anisko <robert@lrde.epita.fr>
16831 * data/bison.c++: Merge the two generated headers. Insert a copyright
16832 notice in each output file.
16834 2002-02-28 Akim Demaille <akim@epita.fr>
16836 * data/bison.c++: Copy the prologue of bison.simple to fetch
16837 useful M4 definitions, such as b4_header_guard.
16839 2002-02-25 Akim Demaille <akim@epita.fr>
16841 * src/getargs.c (version): Give the name of the authors, and use a
16842 translator friendly scheme for the bgr
16845 2002-02-25 Akim Demaille <akim@epita.fr>
16847 * src/output.c (header_output): Remove, now handled completely via
16850 2002-02-25 Akim Demaille <akim@epita.fr>
16852 * m4/m4.m4: New, from CVS Autoconf.
16853 * configure.in: Invoke it.
16854 * src/output.c (output_skeleton): Use its result instead of the
16857 2002-02-25 Akim Demaille <akim@epita.fr>
16859 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
16861 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
16862 * src/output.c (output_skeleton): Use mkstemp to create a real
16864 Move the filling of `skeleton' and its muscle to...
16866 (output): Move the definition of the prologue muscle to...
16868 * src/system.h (DEFAULT_TMPDIR): New.
16870 2002-02-14 Paul Eggert <eggert@twinsun.com>
16872 Remove the support for C++ namespace cleanliness; it was
16873 causing more problems than it was curing, since it didn't work
16874 properly on some nonstandard C++ compilers. This can wait
16875 for a proper C++ parser.
16877 * NEWS: Document this.
16878 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
16879 of C++, as it's treated like C now.
16880 * src/bison.simple (YYSTD): Remove.
16881 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
16882 Treat C++ just like Standard C instead of trying to support
16883 namespace cleanliness.
16885 2002-02-14 Akim Demaille <akim@epita.fr>
16887 * tests/regression.at (else): Adjust to Andreas' change.
16889 2002-02-14 Akim Demaille <akim@epita.fr>
16891 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
16893 2002-02-13 Andreas Schwab <schwab@suse.de>
16895 * src/output.c (output_rule_data): Don't output NULL, it might
16896 not be defined yet.
16898 2002-02-11 Robert Anisko <robert@lrde.epita.fr>
16900 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
16901 (Copyright notice): Update.
16903 2002-02-11 Akim Demaille <akim@epita.fr>
16905 * tests/regression.at (%nonassoc and eof): Don't include
16906 nonportable headers.
16908 2002-02-08 Robert Anisko <robert@lrde.epita.fr>
16910 * data/bison.c++: Correct error recovery. Make the user able to
16911 initialize the starting location.
16913 2002-02-07 Akim Demaille <akim@epita.fr>
16915 * tests/input.at: New.
16917 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
16919 * data/bison.c++: Replace some direct m4 expansions by constants. Be
16920 more consistent when naming methods and variables. Put preprocessor
16921 directives around tables only needed for debugging.
16923 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
16925 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
16927 (yy::b4_name::parse): Use print_.
16929 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
16931 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
16933 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
16935 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
16937 (yy::b4_name::parse): Build verbose error messages, and use error_.
16939 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
16941 * data/bison.c++: Fix m4 quoting in comments.
16943 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
16945 * data/bison.c++: Adjust the parser code. Fix some muscles that were
16946 not expanded by m4.
16948 2002-02-05 Akim Demaille <akim@epita.fr>
16950 * data/bison.c++: Adjust to the M4 back end.
16951 More is certainly needed.
16953 2002-02-05 Akim Demaille <akim@epita.fr>
16955 Give a try to M4 as a back end.
16957 * lib/readpipe.c: New, from wdiff.
16958 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
16960 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
16961 specific values. Now it is m4 that performs the lookup.
16962 * src/parse-skel.y: Remove.
16963 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
16964 * src/output.c (actions_output, guards_output)
16965 (token_definitions_output): No longer keeps track of the output
16966 line number, hence remove the second argument.
16967 (guards_output): Check against the guard member of a rule, not the
16970 (output_skeleton): Don't look for the skeleton location, let m4 do
16972 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
16974 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
16975 (prepare): Given that for the time being changesyntax is not
16976 usable in M4, rename the muscles using `-' to `_'.
16977 Define `defines_flag', `output_parser_name' and `output_header_name'.
16978 * src/output.h (actions_output, guards_output)
16979 (token_definitions_output): Adjust prototypes.
16980 * src/scan-skel.l: Instead of scanning the skeletons, it now
16981 processes the output of m4: `__oline__' and `#output'.
16982 * data/bison.simple: Adjust to be used by M4(sugar).
16983 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
16985 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
16986 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
16987 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
16988 shamelessly stolen from CVS Autoconf.
16990 2002-02-05 Akim Demaille <akim@epita.fr>
16992 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
16993 * configure.in: Check for the declarations of free and malloc.
16994 * src/muscle_tab.c: Adjust.
16996 2002-02-05 Akim Demaille <akim@epita.fr>
16998 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
16999 which have no values.
17001 2002-02-05 Akim Demaille <akim@epita.fr>
17003 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
17006 2002-01-29 Paul Eggert <eggert@twinsun.com>
17008 * src/bison.simple (YYSIZE_T): Do not define merely because
17009 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
17010 On some platforms, <alloca.h> does not declare YYSTD (size_t).
17012 2002-01-27 Akim Demaille <akim@epita.fr>
17014 Fix `%nonassoc and eof'.
17016 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
17017 which were not properly copied! Replace
17018 memcpy (res->errs, src->errs, src->nerrs);
17020 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
17022 * tests/regression.at (%nonassoc and eof): Adjust to newest
17023 Autotest: `.' is not in the PATH.
17025 2002-01-27 Akim Demaille <akim@epita.fr>
17027 * tests/sets.at (AT_EXTRACT_SETS): New.
17028 (Nullable): Use it.
17031 2002-01-26 Akim Demaille <akim@epita.fr>
17033 * tests/actions.at, tests/calc.at, tests/headers.at,
17034 * tests/torture.at: Adjust to the newest Autotest which no longer
17035 forces `.' in the PATH.
17037 2002-01-25 Akim Demaille <akim@epita.fr>
17039 * tests/regression.at (%nonassoc and eof): New.
17040 Suggested by Robert Anisko.
17042 2002-01-24 Akim Demaille <akim@epita.fr>
17044 Bison dumps core when trying to complain about broken input files.
17045 Reported by Cris van Pelt.
17047 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
17048 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
17050 (Invalid inputs): Strengthen: exercise parse_percent_token.
17052 2002-01-24 Robert Anisko <robert.anisko@epita.fr>
17054 * src/Makefile.am: Add bison.c++.
17055 * src/bison.c++: New skeleton.
17057 2002-01-21 Paolo Bonzini <bonzini@gnu.org>
17061 2002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
17063 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
17065 2002-01-20 Marc Autret <marc@gnu.org>
17067 * src/files.c (compute_output_file_names): Fix
17069 2002-01-20 Marc Autret <marc@gnu.org>
17071 * tests/output.at: New test.
17072 * src/files.c (compute_base_names): Don't map extensions when
17073 the YACC flag is set, use defaults.
17074 Reported by Evgeny Stambulchik.
17076 2002-01-20 Marc Autret <marc@gnu.org>
17078 * src/system.h: Need to define __attribute__ away for non-GCC
17079 compilers as well (i.e., the vendor C compiler).
17080 Suggested by Albert Chin-A-Young.
17082 2002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
17084 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
17085 canonical definition.
17086 * src/system.h: Use the canonical definition for PARAMS (avoids
17087 a conflict with the macro from lib/hash.h).
17089 2002-01-11 Akim Demaille <akim@epita.fr>
17091 * configure.in: Use AC_FUNC_STRNLEN.
17092 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
17094 2002-01-09 Akim Demaille <akim@epita.fr>
17096 * src/files.c, src/files.h (output_infix): New.
17097 (tab_extension): Remove.
17098 (compute_base_names): Compute the former, drop the latter.
17099 * src/output.c (prepare): Insert the muscles `output-infix', and
17101 * src/parse-skel.y (string, string.1): New.
17102 (section.header): Use it.
17103 (section.yacc): Remove.
17104 (prefix): Remove too.
17105 * src/scan-skel.l: Adjust.
17106 * src/bison.simple, src/bison.hairy: Adjust.
17108 2002-01-09 Akim Demaille <akim@epita.fr>
17110 * configure.in (WERROR_CFLAGS): Compute it.
17111 * src/Makefile.am (CFLAGS): Pass it.
17112 * tests/atlocal.in (CFLAGS): Idem.
17113 * src/files.c: Fix a few warnings.
17114 (get_extension_index): Remove, unused.
17116 2002-01-08 Akim Demaille <akim@epita.fr>
17118 * src/getargs.c (AS_FILE_NAME): New.
17119 (getargs): Use it to convert DOSish file names.
17120 * src/files.c (base_name): Rename as full_base_name to avoid
17121 clashes with `base_name ()'.
17122 (filename_split): New.
17123 (compute_base_names): N-th rewrite, using filename_split.
17125 2002-01-08 Akim Demaille <akim@epita.fr>
17127 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
17128 New, stolen from the Fileutils 4.1.
17129 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
17130 * configure.in: Check for the presence of memrchr, and of its
17133 2002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
17135 * lib/hash.h (__P): Added definition for this macro.
17136 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
17137 BUILT_SOURCES, to ensure they are generated first.
17138 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
17139 %error-verbose to allow bootstrapping with bison 1.30x.
17141 2002-01-06 Akim Demaille <akim@epita.fr>
17143 * src/reader.c (parse_braces): Don't fetch the next char, the
17144 convention is to fetch on entry.
17145 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
17146 'switch' without a following semicolon.
17147 * tests/regression.at (braces parsing): New.
17149 2002-01-06 Akim Demaille <akim@epita.fr>
17151 Bison is dead wrong in its RR conflict reports.
17153 * tests/torture.at (GNU Cim Grammar): New.
17154 * src/conflicts.c (count_rr_conflicts): Fix.
17156 2002-01-06 Akim Demaille <akim@epita.fr>
17158 Creating package.m4 from configure.ac causes too many problems.
17160 * tests/Makefile.am (package.m4): Create it by hand,
17161 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
17163 2002-01-06 Akim Demaille <akim@epita.fr>
17165 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
17168 2002-01-04 Paul Eggert <eggert@twinsun.com>
17170 * doc/bison.texinfo (Debugging):
17171 Remove YYSTDERR; it's no longer defined or used.
17172 Also, s/cstdio.h/cstdio/.
17174 2002-01-03 Akim Demaille <akim@epita.fr>
17176 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
17178 2002-01-03 Akim Demaille <akim@epita.fr>
17180 * src/parse-skel.y (process_skeleton): Don't bind the parser's
17181 tracing code to --trace, wait for a better --trace option, with
17184 2002-01-03 Akim Demaille <akim@epita.fr>
17186 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
17187 The ISO C++ standard is extremely clear about it: stderr is
17188 considered a macro, not a regular symbol (see table 94 `Header
17189 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
17190 Therefore std:: does not apply to it. It still does with fprintf.
17191 Also, s/cstdio.h/cstdio/.
17193 2002-01-03 Akim Demaille <akim@epita.fr>
17195 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
17196 for non system headers.
17198 2002-01-02 Akim Demaille <akim@epita.fr>
17200 Equip the skeleton chain with location tracking, runtime trace,
17201 pure parser and scanner.
17203 * src/parse-skel.y: Request a pure parser, locations, and prefix
17205 (%union): Having several members with the same type does not help
17206 type mismatches, simplify.
17207 (YYPRINT, yyprint): New.
17208 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
17209 (skel_error): this.
17211 * src/scan-skel.l: Adjust to these changes.
17212 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
17213 (LOCATION_PRINT, skel_control_t): New.
17215 2001-12-30 Akim Demaille <akim@epita.fr>
17217 * src/parse-skel.y: Get rid of the shift/reduce conflict:
17218 replace `gb' with BLANKS.
17219 * src/scan-skel.l: Adjust.
17221 2001-12-30 Akim Demaille <akim@epita.fr>
17223 * src/system.h: We don't need nor want bcopy.
17224 Throw away MS-DOS crap: we don't need getpid.
17225 * configure.in: We don't need strndup. It was even causing
17226 problems: because Flex includes the headers *before* us,
17227 _GNU_SOURCE is not defined by config.h, and therefore strndup was
17229 * lib/xstrndup.c: New.
17230 * src/scan-skel.l: Use it.
17231 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
17232 * src/parse-skel.y: Use %directives instead of #defines.
17234 2001-12-30 Akim Demaille <akim@epita.fr>
17236 * src/skeleton.h: New.
17237 * src/output.c (output_parser, output_master_parser): Remove, dead
17239 * src/output.h (get_lines_number, actions_output, guards_output)
17240 (token_definitions_output): Prototype them.
17241 * src/parse-skel.y: Add the license notice.
17242 Include output.h and skeleton.h.
17243 (process_skeleton): Returns void, and takes a single parameter.
17244 * src/scan-skel.l: Add the license notice.
17245 Include skeleton.h.
17246 Don't use %option yylineno: it seems that then Flex imagines
17247 REJECT has been used, and therefore it won't reallocate its
17248 buffers (which makes no other sense to me than a bug). It results
17249 in warnings for `unused: yy_flex_realloc'.
17251 2001-12-30 Robert Anisko <robert.anisko@epita.fr>
17253 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
17254 (MUSCLE_INSERT_PREFIX): ...to there.
17255 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
17256 (MUSCLE_INSERT_PREFIX): Move from here...
17258 * src/bison.hairy: Add a section directive. Put braces around muscle
17259 names. This parser skeleton is still broken, but Bison should not
17260 choke on a bad muscle 'syntax'.
17261 * src/bison.simple: Add a section directive. Put braces around muscle
17264 * src/files.h (strsuffix, stringappend): Add declarations.
17265 (tab_extension): Add declaration.
17266 (short_base_name): Add declaration.
17268 * src/files.c (strsuffix, stringappend): No longer static. These
17269 functions are used in the skeleton parser.
17270 (tab_extension): New.
17271 (compute_base_names): Use the computations done in this function
17272 to guess if the generated parsers should have '.tab' in their
17274 (short_base_name): No longer static.
17276 * src/output.c (output_skeleton): New.
17277 (output): Disable call to output_master_parser, and give a try to
17278 a new skeleton handling system.
17279 (guards_output, actions_output): No longer static.
17280 (token_definitions_output, get_lines_number): No longer static.
17282 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
17284 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
17287 * src/parse-skel.y: New file.
17288 * src/scan-skel.l: New file.
17290 2001-12-29 Akim Demaille <akim@epita.fr>
17292 %name-prefix is broken.
17294 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
17295 Adjust all dependencies.
17296 * tests/headers.at (export YYLTYPE): Strengthen this test: use
17299 Renaming yylval but not yylloc is not consistent. Now we do.
17301 * src/bison.simple: Prefix yylloc if used.
17302 * doc/bison.texinfo (Decl Summary): Document that.
17304 2001-12-29 Akim Demaille <akim@epita.fr>
17306 * doc/bison.texinfo: Promote `%long-directive' over
17308 Remove all references to fixed-output-files, yacc is enough.
17310 2001-12-29 Akim Demaille <akim@epita.fr>
17312 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
17313 user prologue. These are defaults.
17314 * tests/actions.at (Mid-rule actions): Make sure the user can
17315 define YYDEBUG and YYERROR_VERBOSE.
17317 2001-12-29 Akim Demaille <akim@epita.fr>
17319 * src/output.c (header_output): Don't forget to export YYLTYPE and
17321 * tests/headers.at (export YYLTYPE): New, make sure it does.
17322 * tests/regression.at (%union and --defines, Invalid CPP headers):
17324 * tests/headers.at: here.
17326 2001-12-29 Akim Demaille <akim@epita.fr>
17328 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
17330 2001-12-29 Akim Demaille <akim@epita.fr>
17332 * tests/actions.at (Mid-rule actions): Output on a single line
17333 instead of several.
17335 2001-12-29 Akim Demaille <akim@epita.fr>
17337 * doc/bison.texinfo: Formatting changes.
17339 2001-12-29 Akim Demaille <akim@epita.fr>
17341 Don't store the token defs in a muscle, just be ready to output it
17342 on command. Now possible via `symbols'. Fixes a memory leak.
17344 * src/output.c (token_definitions_output): New.
17345 (output_parser, header_output): Use it.
17346 * src/reader.c (symbols_save): Remove.
17348 2001-12-29 Akim Demaille <akim@epita.fr>
17350 * src/bison.simple: Do not provide a default for YYSTYPE and
17351 YYLTYPE before the user's prologue. Otherwise it's hardly... a
17354 2001-12-29 Akim Demaille <akim@epita.fr>
17356 Mid-rule actions are simply... ignored!
17358 * src/reader.c (readgram): Be sure to attach mid-rule actions to
17359 the empty-rule associated to the dummy symbol, not to the host
17361 * tests/actions.at (Mid-rule actions): New.
17363 2001-12-29 Akim Demaille <akim@epita.fr>
17367 * src/reader.c (reader): Free grammar.
17369 2001-12-29 Akim Demaille <akim@epita.fr>
17373 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
17374 since it allocates it for each state, although only one is needed.
17375 (allocate_storage): Do it here.
17377 2001-12-29 Akim Demaille <akim@epita.fr>
17379 * src/options.h, src/options.c (create_long_option_table): Rename
17381 (long_option_table_new): this, with a clearer prototype.
17382 (percent_table): Remove, unused,
17383 * src/getargs.c (getargs): Adjust.
17385 2001-12-29 Akim Demaille <akim@epita.fr>
17387 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
17388 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
17391 2001-12-29 Akim Demaille <akim@epita.fr>
17393 * src/lalr.c (build_relations): Rename `states' as `states1'.
17394 Sorry, I don't understand exactly what it is, no better name...
17396 2001-12-29 Akim Demaille <akim@epita.fr>
17398 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
17399 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
17400 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
17403 2001-12-29 Akim Demaille <akim@epita.fr>
17405 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
17408 2001-12-29 Akim Demaille <akim@epita.fr>
17410 * src/reader.c, src/reader.h (user_toknums): Remove.
17411 Adjust all users to use symbols[i]->user_token_number.
17413 2001-12-29 Akim Demaille <akim@epita.fr>
17415 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
17416 Adjust all users to use symbols[i]->prec or ->assoc.
17418 2001-12-29 Akim Demaille <akim@epita.fr>
17420 * src/reader.c, src/reader.h (tags): Remove.
17421 Adjust all users to use symbols[i]->tag.
17423 2001-12-29 Akim Demaille <akim@epita.fr>
17425 * src/gram.h, src/gram.c (symbols): New, similar to state_table
17427 * src/reader.c (packsymbols): Fill this table.
17429 * src/conflicts.c (resolve_sr_conflict): Adjust.
17430 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
17432 Use symbols[i]->tag instead of tags[i].
17434 2001-12-29 Akim Demaille <akim@epita.fr>
17436 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
17437 In addition, put a comment in there, to replace...
17438 * tests/regression.at (%union and C comments): Remove.
17440 2001-12-29 Akim Demaille <akim@epita.fr>
17442 * tests/regression.at (Web2c Actions): Blindly move the actual
17443 output as expected output. The contents *seem* right to me, but I
17444 can't pretend reading perfectly parser tables... Nonetheless, all
17445 the other tests pass correctly, the table look OK, even though the
17446 presence of `$axiom' is to be noted: AFAICS it is useless (but
17449 2001-12-29 Akim Demaille <akim@epita.fr>
17451 * src/reader.c (readgram): Don't add the rule 0 if there were no
17452 rules read. In other words, add it _after_ having performed
17453 grammar sanity checks.
17454 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
17456 2001-12-29 Akim Demaille <akim@epita.fr>
17458 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
17459 visible, and some states have now a different number.
17461 2001-12-29 Akim Demaille <akim@epita.fr>
17463 * src/reader.c (readgram): Bind the initial rule's lineno to that
17465 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
17466 (Solved SR Conflicts): Adjust rule 0's line number.
17468 2001-12-29 Akim Demaille <akim@epita.fr>
17470 Fix the `GAWK Grammar' failure.
17472 * src/LR0.c (final_state): Initialize to -1 so that we do compute
17473 the reductions of the first state which was mistakenly confused
17474 with the final state because precisely final_state was initialized
17476 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
17477 now noticed by Bison.
17478 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
17479 have a reduction on $default.
17481 2001-12-29 Akim Demaille <akim@epita.fr>
17483 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
17485 * src/closure.c (print_closure): Likewise.
17486 * src/derives.c (print_derives): Likewise.
17487 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
17490 2001-12-29 Akim Demaille <akim@epita.fr>
17492 * src/lalr.c (lookaheads_print): New.
17493 (lalr): Call it when --trace-flag.
17494 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
17497 2001-12-29 Akim Demaille <akim@epita.fr>
17499 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
17500 when walking through ritem, even via rule->rhs.
17501 * src/reduce.c (dump_grammar, useful_production, reduce_output)
17502 (useful_production, useless_nonterminals): Likewise.
17503 (reduce_grammar_tables): Likewise, plus update nritems.
17504 * src/nullable.c (set_nullable): Likewise.
17505 * src/lalr.c (build_relations): Likewise.
17506 * tests/sets.at (Nullable): Adjust.
17507 Fortunately, now, the $axiom is no longer nullable.
17509 2001-12-29 Akim Demaille <akim@epita.fr>
17511 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
17513 * src/gram.c (ritem_longest_rhs): Likewise.
17514 * src/reduce.c (nonterminals_reduce): Likewise.
17515 * src/print_graph.c (print_graph): Likewise.
17516 * src/output.c (output_rule_data): Likewise.
17517 * src/nullable.c (set_nullable): Likewise.
17519 2001-12-29 Akim Demaille <akim@epita.fr>
17521 * src/output.c: Comment changes.
17523 2001-12-27 Paul Eggert <eggert@twinsun.com>
17525 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
17526 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
17527 Sparc, as they were causing more porting problems than the
17528 (minor) performance improvement was worth.
17530 Also, catch up with 1.31's YYSTD.
17532 2001-12-27 Akim Demaille <akim@epita.fr>
17534 * src/output.c (output_gram): Rely on nritems, not the
17535 0-sentinel. See below.
17536 Use -1 as separator, not 0.
17537 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
17538 Rely on -1 as separator in yyrhs, instead of 0.
17539 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
17540 twice `Now at end of input', therefore there are two lines less to
17543 2001-12-27 Akim Demaille <akim@epita.fr>
17545 * tests/regression.at (Unresolved SR Conflicts):
17546 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
17549 2001-12-27 Akim Demaille <akim@epita.fr>
17551 * src/LR0.c (new_state): Recognize the final state by the fact it
17552 is reached by eoftoken.
17553 (insert_start_shifting_state, insert_eof_shifting_state)
17554 (insert_accepting_state, augment_automaton): Remove, since now
17555 these states are automatically computed from the initial state.
17556 (generate_states): Adjust.
17557 * src/print.c: When reporting a rule number to the user, substract
17558 1, so that the axiom rule is rule 0, and the first user rule is 1.
17559 * src/reduce.c: Likewise.
17560 * src/print_graph.c (print_core): For the time being, just as for
17561 the report, depend upon --trace-flags to dump the full set of
17563 * src/reader.c (readgram): Once the grammar read, insert the rule
17564 0: `$axiom: START-SYMBOL $'.
17565 * tests/set.at: Adjust: rule 0 is now displayed, and since the
17566 number of the states has changed (the final state is no longer
17567 necessarily the last), catch up.
17569 2001-12-27 Akim Demaille <akim@epita.fr>
17571 Try to make the use of the eoftoken valid. Given that its value
17572 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
17573 is used instead of > 0 where appropriate, (ii), depend upon nritems
17574 instead of the 0-sentinel.
17576 * src/gram.h, src/gram.c (nritems): New.
17577 Expected to be duplication of nitems, but for the time being...
17578 * src/reader.c (packgram): Assert nritems and nitems are equal.
17579 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
17580 * src/closure.c (print_closure, print_fderives): Likewise.
17581 * src/gram.c (ritem_print): Likewise.
17582 * src/print.c (print_core, print_grammar): Likewise.
17583 * src/print_graph.c: Likewise.
17585 2001-12-27 Akim Demaille <akim@epita.fr>
17587 * src/main.c (main): If there are complains after grammar
17588 reductions, then output the report anyway if requested, then die.
17589 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
17590 * src/reader.c (eoftoken): New.
17591 (parse_token_decl): If the token being defined has value `0', it
17593 (packsymbols): No longer hack `tags' to insert `$' by hand.
17594 Be sure to preserve the value of the eoftoken.
17595 (reader): Make sure eoftoken is defined.
17596 Initialize nsyms to 0: now eoftoken is created just like the others.
17597 * src/print.c (print_grammar): Don't special case the eof token.
17598 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
17599 lie anyway, albeit pleasant.
17600 * tests/calc.at: Exercise error messages with eoftoken.
17601 Change the grammar so that empty input is invalid.
17602 Adjust expectations.
17603 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
17605 2001-12-27 Akim Demaille <akim@epita.fr>
17607 * configure.in: Check the protos of strchr ans strspn.
17608 Replace strchr if needed.
17609 * src/system.h: Provide the protos of strchr, strspn and memchr if
17611 * lib/strchr.c: New.
17612 * src/reader.c (symbols_save): Use strchr.
17614 2001-12-27 Akim Demaille <akim@epita.fr>
17616 * src/print.c, src/print_graph.c (escape): New.
17617 Use it to quote the TAGS outputs.
17618 * src/print_graph.c (print_state): Now errors are in red, and
17619 reductions in green.
17620 Prefer high to wide: output the state number on a line of its own.
17622 2001-12-27 Akim Demaille <akim@epita.fr>
17624 * src/state.h, src/state.c (reductions_new): New.
17625 * src/LR0.c (set_state_table): Let all the states have a
17626 `reductions', even if reduced to 0.
17627 (save_reductions): Adjust.
17628 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
17629 * src/print.c (print_reductions, print_actions): Adjust.
17630 * src/output.c (action_row): Adjust.
17632 2001-12-27 Akim Demaille <akim@epita.fr>
17634 * src/state.h, src/state.c (errs_new, errs_dup): New.
17635 * src/LR0.c (set_state_table): Let all the states have an errs,
17636 even if reduced to 0.
17637 * src/print.c (print_errs, print_reductions): Adjust.
17638 * src/output.c (output_actions, action_row): Adjust.
17639 * src/conflicts.c (resolve_sr_conflict): Adjust.
17641 2001-12-27 Akim Demaille <akim@epita.fr>
17643 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
17645 2001-12-27 Akim Demaille <akim@epita.fr>
17647 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
17648 * src/print.c: here.
17649 (lookaheadset, shiftset): New, used as additional storage by
17651 (print_results): Adjust.
17652 (print_shifts, print_gotos, print_errs): New, extracted from...
17653 (print_actions): here.
17654 * src/print_graph.c (print_actions): Remove dead code.
17656 2001-12-27 Akim Demaille <akim@epita.fr>
17658 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
17661 2001-12-27 Akim Demaille <akim@epita.fr>
17663 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
17664 (build_relations): Adjust.
17666 2001-12-27 Akim Demaille <akim@epita.fr>
17668 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
17671 2001-12-27 Akim Demaille <akim@epita.fr>
17673 * src/reader.c (packgram): Catch nitems overflows.
17675 2001-12-27 Akim Demaille <akim@epita.fr>
17677 * src/files.c, src/files.h (guard_obstack): Remove.
17678 * src/output.c (output): Adjust.
17679 * src/reader.c (parse_braces): New, factoring...
17680 (copy_action, copy_guard): these two which are renamed as...
17681 (parse_action, parse_guard): these.
17682 As a voluntary consequence, using braces around guards is now
17685 2001-12-27 Akim Demaille <akim@epita.fr>
17687 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
17688 * src/reader.c (symbol_list): `guard' and `guard_line' are new
17690 (symbol_list_new): Adjust.
17691 (copy_action): action_line is the first line, not the last.
17692 (copy_guard): Just as for actions, store the `action' only, not
17693 the switch/case/break flesh.
17694 Don't parse the user action that might follow the guard, let...
17695 (readgram): do it, i.e., now, there can be an action after a
17697 In other words the guard is just explicitly optional.
17698 (packgram): Adjust.
17699 * src/output.c (guards_output): New.
17700 (output_parser): Call it when needed.
17701 (output): Also free the guard and attrs obstacks.
17702 * src/files.c, src/files.h (obstack_save): Remove.
17703 (output_files): Remove.
17704 As a result, if one needs the former `.act' file, using an
17705 appropriate skeleton which requires actions and guards is now
17707 * src/main.c (main): Adjust.
17708 * tests/semantic.at: New.
17709 * tests/regression.at: Use `input.y' as input file name.
17710 Avoid 8+3 problems by requiring input.c when the test needs the
17713 2001-12-27 Akim Demaille <akim@epita.fr>
17715 * src/reader.c (symbol_list_new): Be sure to initialize all the
17718 2001-12-27 Akim Demaille <akim@epita.fr>
17720 All the hacks using a final pseudo state are now useless.
17722 * src/LR0.c (set_state_table): state_table holds exactly nstates.
17723 * src/lalr.c (nLA): New.
17724 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
17725 instead of lookaheadsp from the pseudo state (nstate + 1).
17727 2001-12-27 Akim Demaille <akim@epita.fr>
17729 * src/output.c (action_row, token_actions): Use a state_t instead
17730 of a integer, and nlookaheads instead of the following state's
17733 2001-12-27 Akim Demaille <akim@epita.fr>
17735 * src/conflicts.c (log_resolution, flush_shift)
17736 (resolve_sr_conflict, set_conflicts, solve_conflicts)
17737 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
17738 (conflicts_print, print_reductions): Use a state_t instead of an
17739 integer when referring to a state.
17740 As much as possible, depend upon nlookaheads, instead of the
17741 `lookaheadsp' member of the following state (since lookaheads of
17742 successive states are successive, the difference between state n + 1
17743 and n served as the number of lookaheads for state n).
17744 * src/lalr.c (add_lookback_edge): Likewise.
17745 * src/print.c (print_core, print_actions, print_state)
17746 (print_results): Likewise.
17747 * src/print_graph.c (print_core, print_actions, print_state)
17748 (print_graph): Likewise.
17749 * src/conflicts.h: Adjust.
17751 2001-12-27 Akim Demaille <akim@epita.fr>
17753 * src/bison.hairy: Formatting/comment changes.
17755 Remove `register' indications.
17756 Add plenty of `static'.
17758 2001-12-27 Akim Demaille <akim@epita.fr>
17760 * src/output.c (prepare): Drop the muscle `ntbase' which
17761 duplicates ntokens.
17762 * src/bison.simple: Formatting/comment changes.
17763 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
17764 is an undocumented synonym.
17766 2001-12-22 Akim Demaille <akim@epita.fr>
17768 * src/output.c (output_table_data): Change the prototype to use
17769 `int' for array ranges: some invocations do pass an int, not a
17771 Reported by Wayne Green.
17773 2001-12-22 Akim Demaille <akim@epita.fr>
17775 Some actions of web2c.y are improperly triggered.
17776 Reported by Mike Castle.
17778 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
17779 * tests/regression.at (Web2c): Rename as...
17780 (Web2c Report): this.
17781 (Web2c Actions): New.
17783 2001-12-22 Akim Demaille <akim@epita.fr>
17785 Reductions in web2c.y are improperly reported.
17786 Reported by Mike Castle.
17788 * src/conflicts.c (print_reductions): Fix.
17789 * tests/regression.at (Web2c): New.
17791 2001-12-18 Akim Demaille <akim@epita.fr>
17793 Some host fail on `assert (!"foo")', which expands to
17794 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
17795 Reported by Nelson Beebee.
17797 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
17798 `#define it_succeeded 0' and `assert (it_succeeded)'.
17800 2001-12-17 Marc Autret <autret_m@epita.fr>
17802 * src/bison.simple: Don't hard code the skeleton line and filename.
17803 * src/output.c (output_parser): Rename 'line' as 'output_line'.
17804 New line counter 'skeleton_line' (skeleton-line muscle).
17806 2001-12-17 Paul Eggert <eggert@twinsun.com>
17808 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
17809 YYDEBUG must be defined to a nonzero value.
17811 * src/bison.simple (yytname): Do not assume that the user defines
17812 YYDEBUG to a properly parenthesized expression.
17814 2001-12-17 Akim Demaille <akim@epita.fr>
17816 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
17817 nlookaheads is a new member.
17819 * src/lalr.h (nlookaheads): Remove this orphan declaration.
17820 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
17823 2001-12-17 Akim Demaille <akim@epita.fr>
17825 * src/files.h, src/files.c (open_files, close_files): Remove.
17826 * src/main.c (main): Don't open/close files, nor invoke lex_free,
17828 * src/reader.c (reader): Do it.
17830 2001-12-17 Akim Demaille <akim@epita.fr>
17832 * src/conflicts.c (print_reductions): Formatting changes.
17834 2001-12-17 Akim Demaille <akim@epita.fr>
17836 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
17837 (flush_reduce): New.
17838 (resolve_sr_conflict): Adjust.
17840 2001-12-17 Akim Demaille <akim@epita.fr>
17842 * src/output.c (output_obstack): Be static and rename as...
17843 (format_obstack): this, to avoid any confusion with files.c's
17845 * src/reader.h (muscle_obstack): Move to...
17846 * src/output.h: here, since it's defined in output.c.
17848 2001-12-17 Akim Demaille <akim@epita.fr>
17850 * src/output.c (action_row, save_column, default_goto)
17851 (sort_actions, matching_state, pack_vector): Better variable
17854 2001-12-17 Akim Demaille <akim@epita.fr>
17856 * src/output.c: Various formatting changes.
17858 2001-12-17 Akim Demaille <akim@epita.fr>
17860 * src/files.c (output_files): Free the output_obstack.
17861 * src/main.c (main): Call print and print_graph conditionally.
17862 * src/print.c (print): Work unconditionally.
17863 * src/print_graph.c (print_graph): Work unconditionally.
17864 * src/conflicts.c (log_resolution): Output only if verbose_flag.
17866 2001-12-16 Marc Autret <autret_m@epita.fr>
17868 * src/output.c (actions_output): Fix. When we use %no-lines,
17869 there is one less line per action.
17871 2001-12-16 Marc Autret <autret_m@epita.fr>
17873 * src/bison.simple: Remove a useless #line directive.
17874 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
17875 * src/output.c (get_lines_number): New.
17876 (output_parser): Adjust, now takes care about the lines of a
17878 Fix line numbering.
17879 (actions_output): Computes the number of lines taken by actions.
17880 (output_master_parser): Insert new skeleton which is the name of
17881 the output parser file name.
17883 2001-12-15 Marc Autret <autret_m@epita.fr>
17885 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
17887 2001-12-15 Marc Autret <autret_m@epita.fr>
17889 * src/output.c (output_gram): Keep track of the hairy one.
17891 2001-12-15 Akim Demaille <akim@epita.fr>
17893 Make `make distcheck' work.
17895 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
17896 system.h which uses libgettext.h.
17898 2001-12-15 Akim Demaille <akim@epita.fr>
17900 * src/nullable.c (set_nullable): Useless rules must be skipped,
17901 otherwise, since we range over their symbols, we might look at a
17902 nonterminal which no longer ``exists'', i.e., it is not counted in
17903 `nvars', hence we overflow our arrays.
17905 2001-12-15 Akim Demaille <akim@epita.fr>
17907 The header can also be produced directly, without any obstack!
17910 * src/files.c, src/files.h (defines_obstack): Remove.
17911 (compute_header_macro): Global.
17912 (defines_obstack_save): Remove.
17913 * src/reader.c (parse_union_decl): No longer output to
17914 defines_obstack: its content can be found in the `stype' muscle
17916 (output_token_translations): Merge into...
17917 (symbols_output): this.
17919 (symbols_save): this.
17921 * src/output.c (header_output): New.
17924 2001-12-15 Akim Demaille <akim@epita.fr>
17926 * src/reader.c (parse_union_decl): Instead of handling two obstack
17927 simultaneously, use one to define the `stype' muscle, and use the
17928 value of the latter to fill defines_obstack.
17929 (copy_comment): Remove.
17930 (copy_comment2): Work for a single obstack.
17932 (copy_comment): this.
17934 2001-12-15 Akim Demaille <akim@epita.fr>
17936 * src/lex.c, src/lex.h (xgetc): No longer static.
17937 * src/reader.c (parse_union_decl): Revamp.
17939 2001-12-15 Akim Demaille <akim@epita.fr>
17941 Still making progress in separating Bison into (i) input, (ii)
17942 process, (iii) output: now we can directly output the parser file
17943 without using table_obstack at all.
17945 * src/files.c, src/files.h (table_obstack): Bye bye.
17946 (parser_file_name): New.
17947 * src/files.c (compute_output_file_names): Compute it.
17948 * src/output.c (actions_output, output_parser)
17949 (output_master_parser): To a file instead of an obstack.
17951 2001-12-15 Akim Demaille <akim@epita.fr>
17953 Attach actions to rules, instead of pre-outputting them to
17956 * src/gram.h (rule_t): action and action_line are new members.
17957 * src/reader.c (symbol_list): Likewise.
17958 (copy_action): Save the actions within the rule.
17959 (packgram): Save them in rule_table.
17960 * src/output.c (actions_output): New.
17961 (output_parser): Use it on `%%actions'.
17962 (output_rule_data): Don't free rule_table.
17964 (prepare): Don't save the `action' muscle.
17965 * src/bison.simple: s/%%action/%%actions/.
17967 2001-12-15 Akim Demaille <akim@epita.fr>
17969 * src/reader.c (copy_action): When --yacc, don't append a `;'
17970 to the user action: let it fail if lacking.
17971 Suggested by Arnold Robbins and Tom Tromey.
17973 2001-12-14 Akim Demaille <akim@epita.fr>
17975 * src/lex.c (literalchar): Simply return the char you decoded, non
17976 longer mess around with obstacks and int pointers.
17977 Adjust all callers.
17979 2001-12-14 Akim Demaille <akim@epita.fr>
17981 * src/lex.c (literalchar): Don't escape the special characters,
17982 just decode them, and keep them as char (before, eol was output as
17983 the 2 char string `\n' etc.).
17984 * src/output.c (output_rule_data): Use quotearg to output the
17987 2001-12-13 Paul Eggert <eggert@twinsun.com>
17989 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
17990 Do not infringe on the global user namespace when using C++.
17991 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
17992 All uses of `fprintf' and `stderr' changed.
17994 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
17996 2001-12-13 Akim Demaille <akim@epita.fr>
17998 The computation of nullable is broken: it doesn't handle empty
18001 * tests/torture.at (GNU AWK Grammar): New.
18002 * tests/sets.at (Nullable): New.
18003 * src/nullable.c (set_nullable): Instead of blindly looping over
18004 `ritems', loop over the rules, and then over their rhs's.
18006 Work around Autotest bugs.
18008 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
18009 frame, because Autotest understand lines starting with a `+' as
18010 traces from the shell. Then, they are not processed properly.
18011 Admittedly an Autotest bug, but we don't have time to wait for
18012 Autotest to catch up.
18013 * tests/regression.at (Broken Closure): Adjust to the new table
18016 * tests/sets.at: here.
18018 2001-12-13 Akim Demaille <akim@epita.fr>
18020 * src/closure.c (closure): Use nrules instead of playing tricks
18021 with BITS_PER_WORD.
18023 2001-12-13 Akim Demaille <akim@epita.fr>
18025 * src/print.c (print_actions): Output the handling of `$' as the
18026 traces do: shifting the token EOF. Before EOF was treated as a
18028 * tests/regression.at: Adjust some tests.
18029 * src/print_graph.c (print_core): Complete the set of items via
18030 closure. The next-to-final and final states are still unsatisfying,
18031 but that's to be addressed elsewhere.
18032 No longer output the rule numbers, but do output the state number.
18033 A single loop for the shifts + gotos is enough, but picked a
18034 distinct color for each.
18035 (print_graph): Initialize and finalize closure.
18037 2001-12-13 Akim Demaille <akim@epita.fr>
18039 * src/reader.c (readgram): Remove dead code, an strip useless
18041 (get_type): Remove, unused.
18043 2001-12-12 Akim Demaille <akim@epita.fr>
18045 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
18046 on that of lib/error.c.
18048 2001-12-12 Akim Demaille <akim@epita.fr>
18050 Some hosts don't like `/' in includes.
18052 * src/system.h: Include libgettext.h without qualifying the path.
18053 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
18056 2001-12-11 Marc Autret <autret_m@epita.fr>
18058 * src/output.c (output_parser): Remove useless muscle.
18060 2001-12-11 Marc Autret <autret_m@epita.fr>
18062 * src/bison.simple: Remove #line just before %%epilogue. It
18063 is now handled in ...
18064 * src/reader.c (read_additionnal_code): Add the output of a
18065 #line for the epilogue.
18067 2001-12-10 Marc Autret <autret_m@epita.fr>
18069 * src/reader.c (copy_definition): Re-use CPP-outed code which
18070 replace precedent remove.
18071 * src/bison.simple: Remove #line before %%prologue because
18072 %%input-line is wrong at this time.
18074 2001-12-10 Marc Autret <autret_m@epita.fr>
18076 * src/reader.c (symbols_output): Clean up.
18077 * src/output.c (output_gram, output): Clean up.
18079 2001-12-10 Akim Demaille <akim@epita.fr>
18081 * src/lalr.c (initialize_lookaheads): New. Extracted from...
18082 * src/LR0.c (set_state_table): here.
18083 * src/lalr.c (lalr): Call it.
18085 2001-12-10 Akim Demaille <akim@epita.fr>
18087 * src/state.h (shifts): Remove the `number' member: shifts are
18088 attached to state, hence no longer need to be labelled with a
18091 2001-12-10 Akim Demaille <akim@epita.fr>
18093 Now that states have a complete set of members, the linked list of
18094 shifts is useless: just fill directly the state's shifts member.
18096 * src/state.h (shifts): Remove the `next' member.
18097 * src/LR0.c (first_state, last_state): Remove.
18098 Adjust the callers.
18099 (augment_automaton): Don't look for the shifts that must be added
18100 a shift on EOF: it is those of the state we looked for! But now,
18101 since shifts are attached, it is no longer needed to looking
18102 merely by its id: its number.
18104 2001-12-10 Akim Demaille <akim@epita.fr>
18106 * src/LR0.c (augment_automaton): Better variable locality.
18107 Remove an impossible branch: if there is a state corresponding to
18108 the start symbol being shifted, then there is shift for the start
18109 symbol from the initial state.
18111 2001-12-10 Akim Demaille <akim@epita.fr>
18113 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
18114 only when appropriate: when insert_start_shifting_state' is not
18116 * tests/regression.at (Rule Line Numbers): Adjust.
18118 2001-12-10 Akim Demaille <akim@epita.fr>
18120 * src/LR0.c (augment_automaton): Now that all states have shifts,
18121 merge the two cases addition shifts to the initial state.
18123 2001-12-10 Akim Demaille <akim@epita.fr>
18125 * src/lalr.c (set_state_table): Move to...
18127 * src/lalr.c (lalr): Don't call it...
18128 * src/LR0.c (generate_states): do it.
18129 * src/LR0.h (first_state): Remove, only the table is used.
18131 2001-12-10 Akim Demaille <akim@epita.fr>
18133 * src/LR0.h (first_shift, first_reduction): Remove.
18134 * src/lalr.c: Don't use first_shift: find shifts through the
18137 2001-12-10 Akim Demaille <akim@epita.fr>
18139 * src/LR0.c: Attach shifts to states as soon as they are
18141 * src/lalr.c (set_state_table): Instead of assigning shifts to
18142 state, just assert that the mapping was properly done.
18144 2001-12-10 Akim Demaille <akim@epita.fr>
18146 * src/LR0.c (insert_start_shift): Rename as...
18147 (insert_start_shifting_state): this.
18148 (insert_eof_shifting_state, insert_accepting_state): New.
18149 (augment_automaton): Adjust.
18150 Better locality of the variables.
18151 When looking if the start_symbol is shifted from the initial
18152 state, using `while (... symbol != start_symbol ...)' sounds
18153 better than `while (... symbol < start_symbol ...)': If fail
18154 to see how the order between symbols could be relevant!
18156 2001-12-10 Akim Demaille <akim@epita.fr>
18158 * src/getargs.h: Don't declare `spec_name_prefix' and
18159 `spec_file_prefix', declared by src/files.h.
18160 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
18161 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
18162 * src/output.c (prepare): Adjust.
18163 * src/reader.c (symbols_output): Likewise.
18164 * src/vmsgetargs.c: Vaguely adjust, but who cares?
18166 2001-12-10 Akim Demaille <akim@epita.fr>
18168 * src/muscle_tab.c (muscle_init): NULL is a better default than
18171 2001-12-10 Akim Demaille <akim@epita.fr>
18173 * src/reader.c (reader): Calling symbols_output once is enough.
18175 2001-12-10 Akim Demaille <akim@epita.fr>
18177 Now that states have a complete set of members, the linked list of
18178 reductions is useless: just fill directly the state's reductions
18181 * src/state.h (struct reductions): Remove member `number' and
18183 * src/LR0.c (first_reduction, last_reduction): Remove.
18184 (save_reductions): Don't link the new reductions, store them in
18186 * src/lalr.c (set_state_table): No need to attach reductions to
18187 states, it's already done.
18188 * src/output.c (output_actions): No longer free the shifts, then
18189 the reductions, then the states: free all the states and their
18192 2001-12-10 Akim Demaille <akim@epita.fr>
18194 * src/options.c (OPTN, DRTV, BOTH): New.
18195 (option_table): Use them.
18197 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
18198 the job of system.h.
18199 * src/options.c: Don't include stdio.h and xalloc.h for the same
18202 2001-12-10 Akim Demaille <akim@epita.fr>
18204 * src/output.c (output, prepare): Make sure the values of the
18205 muscles `action' and `prologue' are 0-terminated.
18207 2001-12-10 Akim Demaille <akim@epita.fr>
18209 Clean up GCC warnings.
18211 * src/reader.c (copy_action): `buf' is not used.
18212 (parse_skel_decl): Be static.
18213 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
18214 * src/options.h (create_long_option_table): Have a real prototype.
18215 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
18216 (hash_delete_at): Return const void *.
18217 Adjust casts to preserve the const.
18219 2001-12-10 Akim Demaille <akim@epita.fr>
18221 * configure.in: Require 2.52g.
18222 M4 is not needed, but AUTOM4TE is.
18223 * m4/m4.m4: Remove.
18224 * tests/Makefile.am: Adjust.
18226 2001-12-10 Akim Demaille <akim@epita.fr>
18228 One structure for states is enough, even though theoretically
18229 there are LR(0) states and LALR(1) states.
18231 * src/lalr.h (state_t): Remove.
18232 (state_table): Be state_t **, not state_t *.
18233 * src/state.h (core, CORE_ALLOC): Rename as...
18234 (state_t, STATE_ALLOC): this.
18235 Add the LALR(1) members: shifts, reductions, errs.
18236 * src/LR0.c (state_table): Rename as...
18237 (state_hash): this, to avoid name clashes with the global
18239 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
18240 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
18242 2001-12-10 Akim Demaille <akim@epita.fr>
18244 Bison dumps core on bash.y.
18245 Reported by Pascal Bart.
18247 * src/warshall.c (bitmatrix_print): New.
18249 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
18250 j must be the outer loop.
18251 * tests/regression.at (Broken Closure): New.
18253 2001-12-05 Akim Demaille <akim@epita.fr>
18255 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
18257 Reported by Peter Hamorsky.
18259 2001-12-05 Akim Demaille <akim@epita.fr>
18261 * src/conflicts.c (err_table): Remove.
18262 (resolve_sr_conflict): Adjust.
18263 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
18265 (state_t.reductions, state_t.shifts): this.
18267 2001-12-05 Akim Demaille <akim@epita.fr>
18269 * src/reduce.c (reduce_grammar_tables): No longer disable the
18270 removal of useless rules via CPP but via `if (0)', so that the
18271 compiler still check the code is valid.
18272 For instance, it should have noticed `rline' no longer exists: use
18273 the `line' member of rule_t.
18274 * src/gram.c (dummy, rline): Remove, unused.
18276 2001-12-05 Akim Demaille <akim@epita.fr>
18278 * src/output.c (pack_vector): Use assert, not berror.
18279 * src/main.c (berror): Remove, unused.
18281 2001-12-05 Akim Demaille <akim@epita.fr>
18283 New experimental feature: if --verbose --trace output all the
18284 items of a state, not only its kernel.
18286 * src/print.c (print_core): If `trace_flag', then invoke closure
18287 before outputting the items of the state (print_core is no longer
18288 a correct name them).
18289 (print_results): Invoke new_closure/free_closure if needed.
18291 2001-12-05 Akim Demaille <akim@epita.fr>
18293 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
18294 * src/closure.c, src/closure.h (itemsetsize): Rename as...
18295 (nitemset): for consistency with the rest of the project.
18297 2001-12-05 Akim Demaille <akim@epita.fr>
18299 * src/closure.c (print_closure): Improve.
18300 (closure): Use it for printing input and output.
18302 2001-12-05 Akim Demaille <akim@epita.fr>
18304 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
18305 indexed by nonterminals.
18307 2001-12-05 Akim Demaille <akim@epita.fr>
18309 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
18311 * src/warshall.h: Remove accidental duplication of the content.
18313 2001-12-05 Akim Demaille <akim@epita.fr>
18315 * src/closure.c (set_fderives): De-obfuscate.
18317 2001-12-05 Akim Demaille <akim@epita.fr>
18319 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
18321 2001-12-05 Akim Demaille <akim@epita.fr>
18323 * src/closure.c (set_firsts): De-obfuscate.
18325 2001-12-05 Akim Demaille <akim@epita.fr>
18327 * src/output.c (action_row): De-obfuscate
18328 using the good o' techniques: arrays not pointers, variable
18329 locality, BITISSET, RESETBIT etc.
18331 2001-12-05 Akim Demaille <akim@epita.fr>
18333 Pessimize the code to simplify it: from now on, all the states
18334 have a valid SHIFTS, which NSHIFTS is possibly 0.
18336 * src/LR0.c (shifts_new): Be global and move to..
18337 * src/state.c, src/state.h: here.
18338 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
18339 * src/print_graph: Adjust.
18341 2001-12-05 Akim Demaille <akim@epita.fr>
18343 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
18344 * src/conflicts.c: Use it.
18345 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
18346 incorrectly ``simplified''.
18348 2001-12-05 Akim Demaille <akim@epita.fr>
18350 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
18351 using the good o' techniques: arrays not pointers, variable
18352 locality, BITISSET, RESETBIT etc.
18354 2001-12-05 Akim Demaille <akim@epita.fr>
18356 * src/state.h (SHIFT_SYMBOL): New.
18357 * src/conflicts.c: Use it to deobfuscate.
18359 2001-12-05 Akim Demaille <akim@epita.fr>
18361 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
18362 (print_reductions): De-obfuscate using the good o' techniques:
18363 arrays not pointers, variable locality, BITISSET.
18365 2001-12-05 Akim Demaille <akim@epita.fr>
18367 * src/conflicts.c (print_reductions): Arrays, not pointers.
18370 2001-12-05 Akim Demaille <akim@epita.fr>
18372 * src/conflicts.c (print_reductions): Pessimize, but clarify.
18374 2001-12-05 Akim Demaille <akim@epita.fr>
18376 * src/conflicts.c (print_reductions): Improve variable locality.
18378 2001-12-05 Akim Demaille <akim@epita.fr>
18380 * src/conflicts.c (print_reductions): Pessimize, but clarify.
18382 2001-12-05 Akim Demaille <akim@epita.fr>
18384 * src/conflicts.c (print_reductions): Improve variable locality.
18386 2001-12-05 Akim Demaille <akim@epita.fr>
18388 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
18389 * src/lalr.c: Use them.
18391 2001-12-05 Akim Demaille <akim@epita.fr>
18393 * src/LR0.c (augment_automaton): Formatting changes.
18394 Better variable locality.
18396 2001-12-05 Akim Demaille <akim@epita.fr>
18398 * src/lalr.c (matrix_print): New.
18399 (transpose): Use it.
18400 Use arrays instead of pointers.
18402 2001-12-05 Akim Demaille <akim@epita.fr>
18404 * src/lalr.c (maxrhs): Move to...
18405 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
18406 * src/lalr.c (build_relations): Adjust.
18408 2001-12-05 Akim Demaille <akim@epita.fr>
18410 * src/lalr.c (transpose): Free the memory allocated to the
18411 argument, as it is replaced by the results by the unique caller.
18412 (build_relations): Merely invoke transpose: it handles the memory
18414 Improve variable locality.
18415 Avoid variables used as mere abbreviations.
18416 (compute_lookaheads): Use arrays instead of pointers.
18418 2001-12-05 Akim Demaille <akim@epita.fr>
18420 * src/lalr.c (initialize_F): Improve variable locality.
18421 Avoid variables used as mere abbreviations.
18423 2001-12-05 Akim Demaille <akim@epita.fr>
18425 * src/derives.c (print_derives): Display the ruleno.
18426 * src/lalr.c (initialize_F, transpose): Better variable locality
18427 to improve readability.
18428 Avoid variables used as mere abbreviations.
18430 2001-12-05 Akim Demaille <akim@epita.fr>
18432 * src/lalr.c (traverse): Use arrays instead of pointers.
18434 2001-12-05 Akim Demaille <akim@epita.fr>
18436 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
18437 the handling of squeue.
18438 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
18440 2001-12-05 Akim Demaille <akim@epita.fr>
18442 Because useless nonterminals are now kept alive (instead of being
18443 `destroyed'), we now sometimes examine them, and store information
18444 related to them. Hence we need to know their number, and adjust
18445 memory allocations.
18447 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
18449 * src/LR0.c (allocate_itemsets): The memory allocated to
18450 `symbol_count' was used for two different purpose: once to count
18451 the number of occurrences of each symbol, and later reassigned to
18452 `shift_symbol', containing the symbol that can be shifted from a
18454 Deobfuscate, i.e., allocate, use and free `symbol_count' here
18456 (new_itemsets): Allocate `shift_symbol' here.
18457 (allocate_itemsets): symbol_count includes useless nonterminals.
18458 Make room for them.
18459 (free_storage): Use `free', not `XFREE', for pointers that cannot
18462 2001-12-05 Akim Demaille <akim@epita.fr>
18464 * src/nullable.c (set_nullable): Deobfuscate the handling of
18466 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
18468 2001-12-05 Akim Demaille <akim@epita.fr>
18470 * src/gram.c, src/gram.h (ritem_print): New.
18471 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
18472 (This useless function was defined only to work around VMS linkers
18473 that can't handle compilation units with variables only).
18474 * src/reduce.c (dump_grammar): Use it to trace the construction of
18477 2001-12-04 Paul Eggert <eggert@twinsun.com>
18479 * src/bison.simple (union yyalloc): Change member names
18480 to be the same as the stack names.
18481 (yyparse): yyptr is now union yyalloc *, not char *.
18482 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
18483 and may generate better code on some machines.
18484 (yystpcpy): Use prototype if __STDC__ is defined, not just
18485 if __cplusplus is defined.
18487 2001-11-30 Akim Demaille <akim@epita.fr>
18489 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
18490 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
18491 Gettext doesn't compile cleanly, and dies with -Werror.
18492 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
18493 Include WARNING_CFLAGS here.
18494 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
18495 before being defined.
18497 2001-11-27 Paul Eggert <eggert@twinsun.com>
18499 * lib/quotearg.h (quotearg_n, quotearg_n_style):
18500 First arg is int, not unsigned.
18501 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
18502 (SIZE_MAX, UINT_MAX): New macros.
18503 (quotearg_n_options): Abort if N is negative.
18504 Avoid overflow check on hosts where size_t is 64 bits and int
18505 is 32 bits, as overflow is impossible there.
18506 Fix off-by-one typo that caused unnecessary reallocation.
18508 2001-11-29 Paul Eggert <eggert@twinsun.com>
18510 Name space cleanup in generated parser.
18512 * doc/bison.texinfo (Bison Parser): Discuss system headers
18513 and their effect on the user name space.
18515 * src/bison.simple:
18516 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
18517 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
18518 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
18520 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
18521 on user names when possible.
18523 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
18524 Simplify test for whather <alloca.h> exists.
18526 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
18528 (<stdio.h>): Include if YYDEBUG.
18530 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
18531 ! defined (yyoverflow) && ! defined (yymemcpy).
18533 (yymemcpy, yyparse): Rename local variables as needed so that
18534 they all begin with 'yy'.
18536 (yystrlen, yystpcpy): New functions.
18538 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
18541 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
18542 instead of relying on string.h functions. Use YYSTACK_ALLOC
18543 and YYSTACK_FREE instead of malloc and free.
18545 2001-11-30 Akim Demaille <akim@epita.fr>
18547 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
18548 before their first uses.
18549 (YYBISON, YYPURE): Move to the top of the output.
18551 2001-11-30 Akim Demaille <akim@epita.fr>
18553 * tests/reduce.at (Useless Nonterminals): Fix.
18555 2001-11-30 Akim Demaille <akim@epita.fr>
18557 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
18558 if body instead of `;' to pacify GCC's warnings.
18560 2001-11-30 Akim Demaille <akim@epita.fr>
18562 Instead of mapping the LHS of unused rules to -1, keep the LHS
18563 valid, but flag the rules as invalid.
18565 * src/gram.h (rule_t): `useful' is a new member.
18566 * src/print.c (print_grammar): Adjust.
18567 * src/derives.c (set_derives): Likewise.
18568 * src/reader.c (packgram, reduce_output): Likewise.
18569 * src/reduce.c (reduce_grammar_tables): Likewise.
18570 * tests/reduce.at (Underivable Rules, Useless Rules): New.
18572 2001-11-30 Akim Demaille <akim@epita.fr>
18574 * src/reduce.c (reduce_output): Formatting changes.
18575 * src/print.c (print_results, print_grammar): Likewise.
18576 * tests/regression.at (Rule Line Numbers)
18577 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
18579 2001-11-30 Akim Demaille <akim@epita.fr>
18581 * src/reduce.c (nonterminals_reduce): Instead of throwing away
18582 useless nonterminals, move them at the end of the symbol arrays.
18583 (reduce_output): Adjust.
18584 * tests/reduce.at (Useless Nonterminals): Adjust.
18586 2001-11-30 Akim Demaille <akim@epita.fr>
18588 * src/reduce.c: Various comment/formatting changes.
18589 (nonterminals_reduce): New, extracted from...
18590 (reduce_grammar_tables): here.
18591 (reduce_grammar): Call nonterminals_reduce.
18593 2001-11-29 Paul Eggert <eggert@twinsun.com>
18595 * src/bison.simple (YYSTACK_REALLOC): Remove.
18596 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
18597 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
18599 (union yyalloc): New type.
18600 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
18601 an arbitrary restriction on hosts where size_t is wider than int.
18603 (yyparse): Don't dump core if alloca or malloc fails; instead, report
18604 a parser stack overflow. Allocate just one block of memory for all
18605 three stacks, instead of allocating three blocks; this typically is
18606 faster and reduces fragmentation.
18608 Do not limit the number of items in the stack to a value that fits
18609 in 'int', as this is an arbitrary limit on hosts with 64-bit
18610 size_t and 32-bit int.
18612 2001-11-29 Marc Autret <autret_m@epita.fr>
18614 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
18615 of defining YYERROR_VERBOSE.
18616 [AT_DATA]: $4 is now out of C declarations in the prologue.
18618 2001-11-28 Marc Autret <autret_m@epita.fr>
18620 * src/reader.c (parse_dquoted_param): New.
18621 (parse_skel_decl): Use it.
18622 * src/lex.h: Add its prototype.
18623 * src/lex.c (literalchar): Become not static.
18625 2001-11-28 Marc Autret <autret_m@epita.fr>
18627 * src/output.h: And put its extern declaration here.
18628 * src/output.c (error_verbose): Define here.
18629 (prepare): Echo name modification.
18630 * src/getargs.h: Clean its extern declaration.
18631 * src/getargs.c (error_verbose_flag): Remove.
18632 (getargs): Remove case 'e'.
18633 * src/options.c (option_table): 'error-verbose' is now seen as simple
18637 * src/reader.c (read_declarations): Remove case tok_include.
18638 (parse_include_decl): Remove.
18639 * src/lex.h (token_t): Remove tok_include.
18640 * src/options.c (option_table): 'include' is now a simple command line
18643 2001-11-28 Marc Autret <autret_m@epita.fr>
18645 * src/bison.simple: Adjust muscle names.
18646 * src/muscle_tab.c (muscle_init): Also rename the muscles.
18647 * src/output.c (prepare): s/_/-/ for the muscles names.
18648 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
18650 2001-11-28 Marc Autret <autret_m@epita.fr>
18652 * src/bison.simple: Fix debug.
18653 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
18655 2001-11-28 Akim Demaille <akim@epita.fr>
18657 * src/LR0.c (shifts_new): New.
18658 (save_shifts, insert_start_shift, augment_automaton): Use it.
18660 2001-11-28 Akim Demaille <akim@epita.fr>
18662 * src/closure.c (closure): `b' and `ruleno' denote the same value:
18665 2001-11-28 Akim Demaille <akim@epita.fr>
18667 * src/closure.c (closure): Instead of looping over word in array
18668 then bits in words, loop over bits in array.
18670 2001-11-28 Akim Demaille <akim@epita.fr>
18672 * src/closure.c (closure): No longer optimize the special case
18673 where all the bits of `ruleset[r]' are set to 0, to make the code
18676 2001-11-28 Akim Demaille <akim@epita.fr>
18678 * src/closure.c (closure): `r' and `c' are new variables, used to
18679 de-obfuscate accesses to RULESET and CORE.
18681 2001-11-28 Akim Demaille <akim@epita.fr>
18683 * src/reduce.c (reduce_print): Use ngettext.
18684 (dump_grammar): Improve the trace accuracy.
18686 2001-11-28 Akim Demaille <akim@epita.fr>
18688 * src/reduce.c (dump_grammar): Don't translate trace messages.
18690 2001-11-28 Akim Demaille <akim@epita.fr>
18692 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
18693 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
18694 as all tags are free'ed afterwards.
18695 From Enrico Scholz.
18697 2001-11-27 Paul Eggert <eggert@twinsun.com>
18699 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
18700 use alloca when we didn't want to, and vice versa.
18702 2001-11-27 Marc Autret <autret_m@epita.fr>
18704 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
18706 * src/output.c (prepare): Remove its update.
18708 2001-11-27 Marc Autret <autret_m@epita.fr>
18710 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
18711 Use %error-verbose.
18713 2001-11-27 Marc Autret <autret_m@epita.fr>
18715 * src/bison.simple: Remove YYERROR_VERBOSE using.
18716 Use %%error_verbose.
18717 (yyparse): Likewise.
18718 * src/output.c (prepare): Give its final value.
18719 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
18720 * src/getargs.h: Add its extern declaration.
18721 * src/getargs.c (error_verbose_flag): New int.
18722 (getargs): Update to catch new case.
18723 * src/options.c (option_table): 'error-verbose' is a new option.
18724 (shortopts): Update.
18726 2001-11-27 Akim Demaille <akim@epita.fr>
18728 * src/system.h: Use intl/libgettext.h.
18729 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
18731 2001-11-27 Akim Demaille <akim@epita.fr>
18733 * tests/torture.at (Exploding the Stack Size with Malloc):
18734 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
18736 2001-11-27 Akim Demaille <akim@epita.fr>
18738 * src/files.c: Include error.h.
18739 Reported by Hans Aberg.
18741 2001-11-26 Marc Autret <autret_m@epita.fr>
18743 * src/reader.c (parse_include_decl): New, not yet implemented.
18744 (read_declarations): Add case tok_include.
18745 * src/getargs.h (include): Add its extern definition.
18746 * src/getargs.c (include): New const char *.
18747 (getargs): Add case '-I'.
18748 * src/options.c (option_table): Add include as command line and
18750 * src/lex.h (token_t): Add tok_include.
18752 2001-11-26 Akim Demaille <akim@epita.fr>
18754 * src/reader.c (readgram): Make sure rules for mid-rule actions
18755 have a lineno equal to that of their host rule.
18756 Reported by Hans Aberg.
18757 * tests/regression.at (Rule Line Numbers): New.
18759 2001-11-26 Akim Demaille <akim@epita.fr>
18761 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
18764 2001-11-26 Akim Demaille <akim@epita.fr>
18766 * src/complain.c, src/complain.h (error): Remove, provided by
18769 2001-11-26 Akim Demaille <akim@epita.fr>
18771 * src/reader.c (read_declarations): Don't abort on tok_illegal,
18772 issue an error message.
18773 * tests/regression.at (Invalid %directive): New.
18774 Reported by Hans Aberg.
18776 2001-11-26 Akim Demaille <akim@epita.fr>
18778 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
18779 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
18781 2001-11-26 Akim Demaille <akim@epita.fr>
18783 * src/conflicts.c (conflicts_print): Don't complain at all when
18784 there are no reduce/reduce conflicts, and as many shift/reduce
18785 conflicts as expected.
18786 * tests/regression.at (%expect right): Adjust.
18788 2001-11-23 Akim Demaille <akim@epita.fr>
18790 * lib/alloca.c: Update, from fileutils.
18792 2001-11-23 Akim Demaille <akim@epita.fr>
18794 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
18796 2001-11-23 Akim Demaille <akim@epita.fr>
18798 * src/system.h: Include alloca.h.
18799 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
18801 2001-11-23 Akim Demaille <akim@epita.fr>
18803 * src/print_graph.c (print_actions): Remove `rule', unused.
18804 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
18805 pacify GCC's signed < unsigned warnings.
18806 * src/closure.c (itemsetsize): Likewise.
18807 * src/reader.c (symbol_list_new): Static.
18809 2001-11-23 Akim Demaille <akim@epita.fr>
18811 Attaching lineno to buckets is stupid, since only one copy of each
18812 symbol is kept, only the line of the first occurrence is kept too.
18814 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
18815 * src/reader.c (rline_allocated): Remove, unused.
18816 (symbol_list): Have a `line' member.
18817 (symbol_list_new): New.
18818 (readgram): Use it.
18819 * src/print.c (print_grammar): Output the rule line numbers.
18820 * tests/regression.at (Solved SR Conflicts)
18821 (Unresolved SR Conflicts): Adjust.
18822 Reported by Hans Aberg.
18824 2001-11-22 Marc Autret <autret_m@epita.fr>
18826 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
18828 2001-11-22 Marc Autret <autret_m@epita.fr>
18830 * src/muscle_tab.c (muscle_init): Remove initialization of
18832 * src/output.c (output_master_parser): Do it here.
18834 2001-11-20 Akim Demaille <akim@epita.fr>
18837 * configure.in (ALL_LINGUAS): Adjust.
18838 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
18839 longer contains strings to translate.
18841 2001-11-19 Akim Demaille <akim@epita.fr>
18843 * src/conflicts.c (conflicts_print): Add a missing \n.
18845 2001-11-19 Akim Demaille <akim@epita.fr>
18847 * src/nullable.c (nullable_print): New.
18848 (set_nullable): Call it when tracing.
18849 Better locality of variables.
18851 2001-11-19 Akim Demaille <akim@epita.fr>
18853 * src/print.c (print_actions): Better locality of variables.
18855 2001-11-19 Akim Demaille <akim@epita.fr>
18857 * src/derives.c (print_derives): Fix and enrich.
18858 * src/closure.c (print_fderives): Likewise.
18860 2001-11-19 Akim Demaille <akim@epita.fr>
18862 * src/closure.c (itemsetend): Remove, replaced with...
18863 (itemsetsize): new.
18865 2001-11-19 Akim Demaille <akim@epita.fr>
18867 * src/LR0.c (kernel_end): Remove, replaced with...
18868 (kernel_size): new.
18870 2001-11-19 Akim Demaille <akim@epita.fr>
18872 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
18875 2001-11-19 Akim Demaille <akim@epita.fr>
18877 * src/closure.c (closure): Use arrays instead of pointers to clarify.
18879 2001-11-19 Akim Demaille <akim@epita.fr>
18881 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
18883 * src/LR0.c: Likewise.
18884 (allocate_itemsets): Use arrays instead of pointers to clarify.
18886 2001-11-19 Akim Demaille <akim@epita.fr>
18888 * src/getargs.c (statistics_flag): Replace with...
18890 (longopts): Accept --trace instead of --statistics.
18891 * src/getargs.h, src/options.c: Adjust.
18892 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
18893 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
18895 2001-11-19 Akim Demaille <akim@epita.fr>
18897 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
18898 pointers to clarify the code.
18899 (save_reductions, save_shifts): Factor common parts of alternatives.
18901 2001-11-19 Akim Demaille <akim@epita.fr>
18903 * src/LR0.c (new_state, get_state): Complete TRACE code.
18904 * src/closure.c: Include `reader.h' to get `tags', needed by the
18906 Rename the conditional DEBUG as TRACE.
18907 Output consistently TRACEs to stderr, not stdout.
18908 * src/derives.c: Likewise.
18909 * src/reduce.c: (inaccessable_symbols): Using if is better style
18911 Use `#if TRACE' instead of `#if 0' for tracing code.
18913 2001-11-19 Akim Demaille <akim@epita.fr>
18915 * src/system.h (LIST_FREE, shortcpy): New.
18916 * src/LR0.c: Use them.
18917 * src/output.c (free_itemsets, free_reductions, free_shifts):
18918 Remove, replaced by LIST_FREE.
18920 2001-11-19 Akim Demaille <akim@epita.fr>
18922 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
18923 (REDUCTIONS_ALLOC): New.
18924 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
18927 2001-11-19 Akim Demaille <akim@epita.fr>
18929 * src/LR0.c (new_state): Complete trace code.
18930 * src/nullable.c (set_nullable): Don't translate traces.
18932 2001-11-19 Akim Demaille <akim@epita.fr>
18934 * src/print_graph.c (print_core): Better locality of variables.
18935 * src/print.c (print_core): Likewise.
18937 2001-11-19 Akim Demaille <akim@epita.fr>
18939 * src/vcg.c: You do the output, so you are responsible of the
18940 handling of VCG syntax, in particular: use quotearg.
18941 * src/print_graph.c: Don't.
18942 (print_actions): Don't output the actions as part of the nodes,
18943 since that's the job of the edges.
18944 (print_state): Don't output by hand: fill the node description,
18945 and ask for its output.
18947 2001-11-19 Akim Demaille <akim@epita.fr>
18949 * src/bison.simple (yyparse): When verbosely reporting an error,
18950 no longer put additional quotes around token names.
18951 * tests/calc.at: Adjust.
18953 2001-11-19 Akim Demaille <akim@epita.fr>
18955 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
18956 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
18957 * src/output.c: Adjust.
18959 2001-11-19 Akim Demaille <akim@epita.fr>
18961 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
18963 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
18965 2001-11-19 Akim Demaille <akim@epita.fr>
18967 * src/gram.h (rule_t): New.
18969 (rrhs, rlhs): Remove, part of state_t.
18970 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
18971 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
18972 * src/reader.c, src/reduce.c: Adjust.
18974 2001-11-19 Akim Demaille <akim@epita.fr>
18976 * src/reader.c (symbols_output): New, extracted from...
18977 (packsymbols): Here.
18980 2001-11-19 Akim Demaille <akim@epita.fr>
18982 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
18983 (maxrhs): this new function.
18985 2001-11-19 Akim Demaille <akim@epita.fr>
18987 * src/lalr.c (F): New macro to access the variable F.
18990 2001-11-19 Akim Demaille <akim@epita.fr>
18992 * src/lalr.h (LA): New macro to access the variable LA.
18993 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18994 * src/lalr.c: Adjust.
18996 2001-11-19 Akim Demaille <akim@epita.fr>
18998 * src/lalr.c (initialize_LA): Only initialize LA. Let...
18999 (set_state_table): handle the `lookaheads' members.
19001 2001-11-19 Akim Demaille <akim@epita.fr>
19003 * src/lalr.h (lookaheads): Removed array, whose contents is now
19005 (state_t): this structure.
19006 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
19009 2001-11-19 Akim Demaille <akim@epita.fr>
19011 * src/lalr.h (consistent): Removed array, whose contents is now
19013 (state_t): this structure.
19014 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
19017 2001-11-19 Akim Demaille <akim@epita.fr>
19019 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
19020 contents are now members of...
19021 (state_t): this structure.
19022 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
19025 2001-11-19 Akim Demaille <akim@epita.fr>
19027 * src/lalr.h (state_t): New.
19028 (state_table): Be a state_t * instead of a core **.
19029 (accessing_symbol): Remove, part of state_t.
19030 * src/lalr.c: Adjust.
19031 (set_accessing_symbol): Merge into...
19032 (set_state_table): this.
19033 * src/print_graph.c, src/conflicts.c: Adjust.
19035 2001-11-14 Akim Demaille <akim@epita.fr>
19037 * tests/calc.at, tests/output.at, tests/regression.at,
19038 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
19039 now the tests are run in private dirs, therefore AC_CLEANUP and
19040 family can be simplified to 0-ary.
19041 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
19042 use abs. path to find config.h.
19043 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
19044 stderr, there can be way too much random noise.
19045 Instead pass -Werror to GCC and rely on the exit status.
19046 Reported by Wolfram Wagner.
19048 2001-11-14 Akim Demaille <akim@epita.fr>
19050 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
19051 defined only if yyoverflow is defined, to avoid `warning: unused
19053 Reported by The Test Suite.
19055 2001-11-14 Akim Demaille <akim@epita.fr>
19057 * src/print.c: Include reduce.h.
19058 Reported by Hans Aberg.
19060 2001-11-14 Akim Demaille <akim@epita.fr>
19062 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
19063 Revert a previous patch: these are really const.
19064 * src/conflicts.c (conflict_report): Additional useless pair of
19065 braces to pacify GCC's warnings for `if () if () {} else {}'.
19066 * src/lex.c (parse_percent_token): Replace equal_offset with
19069 Be sure to strdup `arg' when used, since there is no reason for
19070 token_buffer not to change.
19072 2001-11-14 Akim Demaille <akim@epita.fr>
19074 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
19076 * src/main.c (main): Use them.
19077 Suggested by Hans Aberg.
19079 2001-11-12 Akim Demaille <akim@epita.fr>
19081 * src/system.h (ngettext): Now that we use ngettext, be sure to
19082 provide a default definition when NLS are not used.
19084 2001-11-12 Akim Demaille <akim@epita.fr>
19086 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
19087 Use @kbd to denote user input.
19088 (Language and Grammar): ANSIfy the example.
19089 Adjust its layout for info/notinfo.
19090 (Location Tracking Calc): Output error messages to stderr.
19091 Output locations in a more GNUtically correct way.
19092 Fix a couple of Englishos.
19093 Adjust @group/@end group pairs.
19095 2001-11-12 Akim Demaille <akim@epita.fr>
19097 %expect was not functioning at all.
19099 * src/conflicts.c (expected_conflicts): Set to -1.
19100 (conflict_report): Use ngettext.
19101 (conflicts_print): Check %expect and make its violation an error.
19102 * doc/bison.texinfo (Expect Decl): Adjust.
19103 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
19104 * tests/regression.at (%expect not enough, %expect right)
19105 (%expect too much): New.
19107 2001-11-12 Akim Demaille <akim@epita.fr>
19109 * tests/regression.at (Conflicts): Rename as...
19110 (Unresolved SR Conflicts): this.
19111 (Solved SR Conflicts): New.
19113 2001-11-12 Akim Demaille <akim@epita.fr>
19115 * src/reduce.c (print_results): Rename as...
19116 (reduce_output): This.
19117 Output to OUT, passed as argument, instead of output_obstack.
19118 (dump_grammar): Likewise.
19119 (reduce_free): New.
19121 (reduce_grammar): No longer call reduce_output, since...
19122 * src/print.c (print_results): do it.
19123 * src/main.c (main): Call reduce_free;
19125 2001-11-12 Akim Demaille <akim@epita.fr>
19127 * src/conflicts.c (print_reductions): Accept OUT as argument.
19128 Output to it, not to output_obstack.
19129 * src/print.c (print_actions): Adjust.
19131 2001-11-12 Akim Demaille <akim@epita.fr>
19133 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
19134 the result instead of using...
19135 (src_total, rrc_total, src_count, rrc_count): Remove.
19136 (any_conflicts): Remove.
19137 (print_conflicts): Split into...
19138 (conflicts_print, conflicts_output): New.
19139 * src/conflicts.h: Adjust.
19140 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
19141 * src/print.c (print_grammar): Issue `\n' between two rules.
19142 * tests/regression.at (Conflicts): New.
19143 Reported by Tom Lane.
19145 2001-11-12 Akim Demaille <akim@epita.fr>
19147 * tests/regression.at (Invalid input): Remove, duplicate with
19148 ``Invalid input: 1''.
19150 2001-11-12 Akim Demaille <akim@epita.fr>
19152 * tests/torture.at (AT_DATA_STACK_TORTURE)
19153 (Exploding the Stack Size with Alloca)
19154 (Exploding the Stack Size with Malloc): New.
19156 2001-11-12 Akim Demaille <akim@epita.fr>
19158 * src/bison.simple (YYSTACK_REALLOC): New.
19159 (yyparse) [!yyoverflow]: Use it and free the old stack.
19160 Reported by Per Allansson.
19162 2001-11-12 Pascal Bart <pascal.bart@epita.fr>
19164 * src/bison.simple: Define type yystype instead of YYSTYPE, and
19165 define CPP macro, which substitute YYSTYPE by yystype.
19166 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
19167 with yyltype/YYLTYPE. This allows inclusion of the generated
19168 header within the parser if the compiler, such as GGC, accepts
19169 multiple equivalent #defines.
19172 2001-11-05 Akim Demaille <akim@epita.fr>
19174 * src/reader.c (symbols_output): New, extracted from...
19175 (packsymbols): here.
19178 2001-11-05 Akim Demaille <akim@epita.fr>
19180 * src/lex.c (parse_percent_token): s/quotearg/quote/.
19182 2001-11-05 Akim Demaille <akim@epita.fr>
19184 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
19187 2001-11-05 Akim Demaille <akim@epita.fr>
19189 * src/options.h (struct option_table_struct): set_flags is void*.
19190 * src/options.c (longopts): Support `--output' and `%output'.
19192 * src/lex.h (tok_setopt): Remove, replaced with...
19193 (tok_intopt, tok_stropt): these new guys.
19194 * src/lex.c (getopt.h): Not needed.
19195 (token_buffer, unlexed_token_buffer): Not const.
19196 (percent_table): Promote `-' over `_' in directive names.
19197 Active `%name-prefix', `file-prefix', and `output'.
19198 (parse_percent_token): Accept possible arguments to directives.
19199 Promote `-' over `_' in directive names.
19201 2001-11-04 Akim Demaille <akim@epita.fr>
19203 * doc/bison.texinfo (Decl Summary): Split the list into
19204 `directives for grammars' and `directives for bison'.
19206 Add description of `%name-prefix', `file-prefix', and `output'.
19207 Promote `-' over `_' in directive names.
19208 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
19209 Simplify the description of `--name-prefix'.
19210 Promote `-' over `_' in directive names.
19211 Promote `--output' over `--output-file'.
19212 Fix the description of `--defines'.
19213 * tests/output.at: Exercise %file-prefix and %output.
19215 2001-11-02 Akim Demaille <akim@epita.fr>
19217 * doc/refcard.tex: Update.
19219 2001-11-02 Akim Demaille <akim@epita.fr>
19221 * src/symtab.h (SUNDEF): New.
19222 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
19223 stand for `uninitialized', instead of 0.
19224 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
19225 * src/lex.c (lex): Adjust.
19227 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
19229 Let yylex return it instead of a plain 0.
19230 Reported by Dick Streefland.
19232 2001-11-02 Akim Demaille <akim@epita.fr>
19234 * tests/regression.at (Mixing %token styles): New test.
19236 2001-11-02 Akim Demaille <akim@epita.fr>
19238 * src/reader.c (parse_thong_decl): Formatting changes.
19239 (token_translations_init): New, extracted from...
19240 (packsymbols): Here.
19243 2001-11-01 Akim Demaille <akim@epita.fr>
19245 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
19246 Check that `9foo.y' produces correct cpp guards.
19247 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
19251 2001-11-01 Akim Demaille <akim@epita.fr>
19253 * tests/regression.at (Invalid input: 2): New.
19254 * src/lex.c (unlexed_token_buffer): New.
19255 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
19259 2001-11-01 Akim Demaille <akim@epita.fr>
19261 * tests/calc.at: Catch up with 1.30.
19262 * configure.in: Bump to 1.49a.
19263 Adjust to newer Autotest.
19265 2001-10-19 Pascal Bart <pascal.bart@epita.fr>
19267 * src/conflicts.c: Move global variables rrc_total and src_total ...
19268 (print_conflicts): here.
19269 * src/output.c (output): Free global variable user_toknums.
19270 * src/lex.c (token_obstack): Become static.
19272 2001-10-18 Akim Demaille <akim@epita.fr>
19274 * tests/atlocal.in (GCC): Add.
19275 * tests/calc.at: s/m4_match/m4_bmatch/.
19276 s/m4_patsubst/m4_bpatsubst/.
19277 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
19278 * configure.in: AC_SUBST(GCC).
19280 2001-10-14 Marc Autret <autret_m@epita.fr>
19282 * src/options.c (create_long_option_table): Fix.
19284 2001-10-10 Akim Demaille <akim@epita.fr>
19286 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
19288 2001-10-04 Akim Demaille <akim@epita.fr>
19290 * src/reader.c (parse_union_decl): Push the caracters in
19291 union_obstack, not attrs_obstack.
19293 2001-10-04 Akim Demaille <akim@epita.fr>
19295 Merge in the branch 1.29.
19297 * src/reader.c (packsymbols): Use a temporary obstack for
19298 `%%tokendef', since output_stack is already used elsewhere.
19300 2001-10-02 Akim Demaille <akim@epita.fr>
19304 2001-10-02 Akim Demaille <akim@epita.fr>
19308 2001-10-02 Akim Demaille <akim@epita.fr>
19310 * tests/regression.at (Invalid CPP headers): New.
19311 From Alexander Belopolsky.
19312 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
19314 2001-10-02 Akim Demaille <akim@epita.fr>
19316 * tests/regression.at (Invalid input): New.
19317 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
19320 2001-10-02 Akim Demaille <akim@epita.fr>
19322 * tests/calc.at: Now that --debug works, the tests must be adjusted.
19324 2001-10-02 Akim Demaille <akim@epita.fr>
19326 * src/output.c (output_parser): Assert `skeleton'.
19327 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
19331 2001-10-01 Marc Autret <autret_m@epita.fr>
19333 * src/lex.h: Echo modifications.
19334 * src/lex.c (unlex): Parameter is now token_t.
19337 2001-10-01 Marc Autret <autret_m@epita.fr>
19339 * src/main.c: Include lex.h.
19342 2001-09-29 Akim Demaille <akim@epita.fr>
19344 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
19346 2001-09-28 Akim Demaille <akim@epita.fr>
19348 * tests/testsuite.at: Update to newer Autotest.
19349 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
19351 2001-09-27 Akim Demaille <akim@epita.fr>
19353 Position independent wrapper.
19355 * tests/bison: Remove.
19356 * tests/bison.in: New.
19357 * configure.in: Adjust.
19359 2001-09-27 Paul Eggert <eggert@twinsun.com>
19361 Port quotearg fixes from tar 1.13.24.
19363 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
19365 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
19366 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
19368 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
19369 * m4/mbrtowc.m4: New file.
19370 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
19371 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
19373 2001-09-27 Akim Demaille <akim@epita.fr>
19377 2001-09-27 Akim Demaille <akim@epita.fr>
19381 2001-09-25 Akim Demaille <akim@epita.fr>
19383 * src/system.h: Include `xalloc.h'.
19384 Remove it from the C files.
19385 * src/files.c (output_files): Free the obstacks.
19386 * src/lex.c (init_lex): Rename as...
19389 * src/main.c (main): Use it.
19391 2001-09-24 Marc Autret <autret_m@epita.fr>
19393 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
19394 to output informations in fout (FILE*).
19395 (open_graph, close_graph): Likewise.
19396 (output_graph, output_edge, output_node): Likewise.
19397 * src/vcg.h: Update function prototypes.
19398 * src/print_graph.c (print_graph): Open output graph file.
19399 (print_actions): Adjust.
19400 * src/files.h: Remove extern declaration.
19401 * src/files.c: Remove graph_obstack declaration.
19402 (open_files): Remove graph_obstack initialization.
19403 (output_files): Remove graph_obstack saving.
19405 2001-09-24 Marc Autret <autret_m@epita.fr>
19407 * src/files.c (compute_output_file_names): Fix.
19409 2001-09-24 Marc Autret <autret_m@epita.fr>,
19410 Akim Demaille <akim@epita.fr>
19412 * src/reader.c (reader): Remove call to free_symtab ().
19413 * src/main.c (main): Call it here.
19415 * src/conflicts.c (initialize_conflicts): Rename as...
19416 (solve_conflicts): this.
19417 * src/print.c (print_core, print_actions, print_state)
19418 (print_grammar): Dump to a file instead a `output_obstack'.
19419 (print_results): Dump `output_obstack', and then proceed with the
19421 * src/files.c (compute_output_file_names, close_files): New.
19422 (output_files): Adjust.
19423 * src/main.c (main): Adjust.
19425 2001-09-23 Marc Autret <autret_m@epita.fr>
19427 * src/files.c (compute_header_macro): Computes header macro name
19428 from spec_defines_file when given.
19430 2001-09-23 Marc Autret <autret_m@epita.fr>
19432 * src/files.c (output_files): Add default extensions.
19434 2001-09-22 Akim Demaille <akim@epita.fr>
19436 * src/conflicts.c (finalize_conflicts): Rename as...
19437 (free_conflicts): this.
19439 2001-09-22 Akim Demaille <akim@epita.fr>
19441 * src/gram.c (gram_free): Rename back as...
19443 (output_token_translations): Free `token_translations'.
19444 * src/symtab.c (free_symtab): Free the tag field.
19446 2001-09-22 Akim Demaille <akim@epita.fr>
19448 Remove `translations' as it is always set to true.
19450 * src/gram.h: Adjust.
19451 * src/reader.c (packsymbols, parse_token_decl): Adjust
19452 * src/print.c (print_grammar): Adjust.
19453 * src/output.c (output_token_translations): Adjust.
19454 * src/lex.c (lex): Adjust.
19455 * src/gram.c: Be sure the set pointers to NULL.
19456 (dummy): Rename as...
19459 2001-09-22 Akim Demaille <akim@epita.fr>
19461 * configure.in: Invoke AM_LIB_DMALLOC.
19462 * src/system.h: Use dmalloc.
19463 * src/LR0.c: Be sure to have pointers initialized to NULL.
19464 (allocate_itemsets): Allocate kernel_items only if needed.
19466 2001-09-22 Akim Demaille <akim@epita.fr>
19468 * configure.in: Bump to 1.29b.
19469 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
19470 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
19471 need xmalloc.c in calc.y.
19474 2001-09-21 Akim Demaille <akim@epita.fr>
19477 * Makefile.maint, config/config.guess, config/config.sub,
19478 * config/missing: Update from masters.
19479 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
19481 * configure.in (ALL_LINGUAS): Add `tr'.
19483 2001-09-21 Akim Demaille <akim@epita.fr>
19485 * tests/Makefile.am (package.m4): Move to...
19486 ($(srcdir)/$(TESTSUITE)): here.
19488 2001-09-20 Akim Demaille <akim@epita.fr>
19490 * src/complain.c: No longer try to be standalone: use system.h.
19491 Don't assume __STDC__ is defined to 1. Just test if it is defined.
19492 * src/complain.h: Likewise.
19493 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
19494 Remove the unused variable `n'.
19495 From Albert Chin-A-Young.
19497 2001-09-18 Marc Autret <autret_m@epita.fr>
19499 * doc/bison.1: Update.
19500 * doc/bison.texinfo (Bison Options): Update --defines and --graph
19502 (Option Cross Key): Update.
19505 2001-09-18 Marc Autret <autret_m@epita.fr>
19507 * tests/regression.at: New test (comment in %union).
19509 2001-09-18 Marc Autret <autret_m@epita.fr>
19511 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
19513 Reported by Keith Browne.
19515 2001-09-18 Marc Autret <autret_m@epita.fr>
19517 * tests/output.at: Add tests for --defines and --graph.
19519 2001-09-18 Marc Autret <autret_m@epita.fr>
19521 * tests/output.at: Removes tests of %{header,src}_extension features.
19523 2001-09-18 Akim Demaille <akim@epita.fr>
19525 * tests/Makefile.am (package.m4): New.
19526 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
19527 (_AT_CHECK_CALC_ERROR): Likewise.
19528 Factor the `, ' part of verbose error messages.
19530 2001-09-18 Marc Autret <autret_m@epita.fr>
19532 * src/getargs.c (longopts): Declare --defines and --graph as options
19533 with optional arguments.
19534 * src/files.h: Add extern declarations.
19535 * src/files.c (spec_graph_file, spec_defines_file): New.
19536 (output_files): Update.
19537 Remove CPP-outed code.
19539 2001-09-18 Marc Autret <autret_m@epita.fr>
19541 Turn off %{source,header}_extension feature.
19543 * src/files.c (compute_exts_from_gf): Update.
19544 (compute_exts_from_src): Update.
19545 (output_files): CPP-out useless code.
19546 * src/files.h: Remove {header,source}_extension extern declarations.
19547 * src/reader.c (parse_dquoted_param): CPP-out.
19548 (parse_header_extension_decl): Remove.
19549 (parse_source_extension_decl): Remove.
19550 (read_declarations): Remove cases tok_{hdrext,srcext}.
19551 * src/lex.c (percent_table): Remove {header,source}_extension entries.
19552 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
19554 2001-09-10 Akim Demaille <akim@epita.fr>
19556 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
19557 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
19558 (AT_CHECK_OUTPUT): this.
19559 Merely check ls' exit status, its output is useless.
19561 2001-09-10 Akim Demaille <akim@epita.fr>
19563 * tests/calc.at: Use m4_match.
19564 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
19566 2001-09-10 Marc Autret <autret_m@epita.fr>,
19567 Akim Demaille <akim@epita.fr>
19569 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
19571 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
19573 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
19574 * src/lex.h: Adjust prototype.
19575 (token_t): Add `tok_undef'.
19576 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
19577 (parse_percent_token): Now returns token_t.
19578 Add default statement in switch.
19579 (lex): Separate `c' as an input variable, from the token_t result
19581 (unlexed): Is a token_t.
19583 2001-09-10 Akim Demaille <akim@epita.fr>
19585 * configure.in: Bump to 1.29a.
19587 2001-09-07 Akim Demaille <akim@epita.fr>
19591 2001-08-30 Akim Demaille <akim@epita.fr>
19593 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
19594 * m4/atconfig.m4: Remove.
19595 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
19596 * tests/bison: New.
19597 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
19598 m4_if, m4_patsubst, and m4_regexp.
19599 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
19600 `input' file instead of echo.
19602 2001-08-29 Akim Demaille <akim@epita.fr>
19606 2001-08-29 Akim Demaille <akim@epita.fr>
19610 2001-08-29 Paul Eggert <eggert@twinsun.com>
19612 * src/bison.simple (yyparse): Don't take the address of an
19613 item before the start of an array, as that doesn't conform to
19616 2001-08-29 Robert Anisko <anisko_r@epita.fr>
19618 * doc/bison.texinfo (Location Tracking Calc): New node.
19620 2001-08-29 Paul Eggert <eggert@twinsun.com>
19622 * src/output.c (output): Do not define const, as this now
19623 causes more problems than it cures.
19625 2001-08-29 Akim Demaille <akim@epita.fr>
19627 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
19629 Be sure to tag the `detailmenu'.
19631 2001-08-29 Akim Demaille <akim@epita.fr>
19633 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
19634 download in a tmp dir.
19636 2001-08-28 Marc Autret <autret_m@epita.fr>
19638 * config/depcomp: New file.
19640 2001-08-28 Marc Autret <autret_m@epita.fr>
19642 * doc/bison.1 (mandoc): Adjust.
19643 From Juan Manuel Guerrero.
19645 2001-08-28 Marc Autret <autret_m@epita.fr>
19647 * src/print_graph.c (print_state): Fix.
19649 2001-08-27 Marc Autret <autret_m@epita.fr>
19651 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
19653 Echo modifications to the functions prototypes.
19654 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
19656 2001-08-27 Marc Autret <autret_m@epita.fr>
19658 * src/vcg.c: Include `xalloc.h'.
19659 (add_colorentry): New.
19660 (add_classname): New.
19661 (add_infoname): New.
19662 * src/vcg.h: Add new prototypes.
19664 2001-08-27 Akim Demaille <akim@epita.fr>
19666 * Makefile.maint: Sync. again with CVS Autoconf.
19668 2001-08-27 Akim Demaille <akim@epita.fr>
19670 * Makefile.maint: Formatting changes.
19671 (po-update, cvs-update, update): New targets.
19674 2001-08-27 Akim Demaille <akim@epita.fr>
19676 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
19677 * Makefile.maint: Sync. with CVS Autoconf.
19679 2001-08-27 Marc Autret <autret_m@epita.fr>
19681 * src/vcg.h (struct infoname_s): New.
19682 (struct colorentry_s): New.
19683 (graph_s): New fields {vertical,horizontal}_order in structure.
19684 Add `infoname' field.
19685 Add `colorentry' field;
19686 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
19687 (G_HORIZONTAL_ORDER): New.
19689 (G_COLORENTRY): New.
19690 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
19691 Add output of `infoname'.
19692 Add output of `colorentry'.
19694 2001-08-27 Marc Autret <autret_m@epita.fr>
19696 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
19697 This one shadowed a global parameter.
19699 2001-08-24 Marc Autret <autret_m@epita.fr>
19701 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
19702 instead of `unsigned'.
19703 (print_state): Do not call obstack_object_size () in obstack_grow ()
19704 to avoid macro variables shadowing.
19706 2001-08-23 Marc Autret <autret_m@epita.fr>
19708 * src/lex.c (percent_table): Typo: s/naem/name/.
19710 Normalize new options declarations.
19712 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
19714 * tests/suite.at: Exercise %header_extension and %source_extension.
19716 2001-08-16 Marc Autret <autret_m@epita.fr>
19718 * src/reader.c (parse_dquoted_param): New.
19719 (parse_header_extension_decl): Use it.
19720 (parse_source_extension_decl): Likewise.
19722 2001-08-16 Marc Autret <autret_m@epita.fr>
19724 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
19725 (get_xxxx_str): Use assert () instead of complain ().
19726 Remove return invokations in default cases.
19727 (get_decision_str): Modify default behaviour. Remove second argument.
19728 Echo modifications on calls.
19729 (output_graph): Fix.
19731 2001-08-16 Marc Autret <autret_m@epita.fr>
19733 * src/getargs.c (usage): Update with ``-g, --graph''.
19735 2001-08-16 Marc Autret <autret_m@epita.fr>
19737 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
19738 (Option Cross Key): Likewise.
19739 * doc/bison.1: Update.
19741 2001-09-25 Pascal Bart <pascal.bart@epita.fr>
19743 * src/output.c (output_master_parser): Don't finish action_obstack.
19744 (output_parser): Don't care about the muscle action, here.
19745 (prepare): Copy the action_obstack in the action muscle.
19746 (output): Free action_obstack.
19748 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
19750 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
19751 will contain `%union' declaration.
19752 (parse_union_decl): Delete #line directive output.
19753 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
19754 informations about %union.
19755 (parse_union_decl): Copy the union_obstack in the muscle stype.
19756 * src/bison.simple: Add new #line directive.
19757 Add typdef %%stype YYSTYPE.
19759 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
19761 * src/bison.simple: Add new `#line' directive.
19763 2001-09-22 Pascal Bart <pascal.bart@epita.fr>
19765 * src/bison.simple: New `#line' directive.
19766 * src/output.c (output_parser): Support new dynamic muscle input_line.
19768 2001-09-22 Marc Autret <autret_m@epita.fr>
19770 * src/output.c (output_master_parser): New.
19771 (output_parser): Be more re-entrant.
19773 2001-09-21 Marc Autret <autret_m@epita.fr>
19775 * src/reader.c (copy_definition, parse_union_decl): Update and use
19777 (copy_action): Likewise.
19778 Use obstack_1grow ().
19779 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
19781 2001-09-21 Marc Autret <autret_m@epita.fr>
19783 * src/options.c (option_table): Adjust.
19784 * src/lex.c (parse_percent_token): Fix.
19786 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
19788 * src/options.c (symtab.h): Include it, need by lex.h.
19790 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
19792 * src/lex.c (parse_percent_token): Change type of variable `tx', which
19793 is now an option_table_struct*.
19794 (option_strcmp): New function option_strcmp.
19795 (parse_percent_token): Call option_strcmp.
19796 * src/getargs.c (xalloc.h, options.h): Include it.
19797 (getargs): Call create_long_option_table.
19798 (getargs): Free longopts at the end of the function.
19799 (shortopts): Move in options.c.
19800 * src/options.c (create_long_option_table): New function. Convert
19801 information from option_table to option structure.
19802 * src/reader.c (options.h): Include it.
19804 * src/Makefile.am: Adjust.
19805 * src/options.c (option_table): Create from longopts and percent_table.
19806 * src/getargs.c (longopts): Delete.
19807 * src/lex.c (struct percent_table_struct): Delete.
19808 (percent_table): Delete.
19809 (options.h): Include it.
19810 * src/options.c: Create.
19811 * src/options.h: Create.
19812 Declare enum opt_access_e.
19813 Define struct option_table_struct.
19815 2001-09-20 Marc Autret <autret_m@epita.fr>
19817 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
19820 2001-09-19 Pascal Bart <pascal.bart@epita.fr>
19822 * src/bison.simple: s/%%filename/%%skeleton.
19823 * src/muscle_tab.c (getargs.h): Include it.
19824 (muscle_init): Insert new muscle skeleton.
19826 2001-09-18 Pascal Bart <pascal.bart@epita.fr>
19828 * src/output.c (output_parser): Delete unused variable actions_dumped.
19830 2001-09-07 Pascal Bart <pascal.bart@epita.fr>
19832 * src/output.c (output): Delete call to reader_output_yylsp.
19833 * src/reader.c (reader): Likewise.
19834 * src/reader.h: Delete declaration of reader_output_yylsp.
19836 2001-09-02 Marc Autret <autret_m@epita.fr>
19838 * src/reader.c: Include muscle_tab.h.
19839 (parse_union_decl): Update.
19840 (parse_macro_decl): Rename parse_muscle_decl.
19841 Update to use renamed functions and variable.
19842 (read_declarations, copy_action, read_additionnal_code, : Updated
19843 with correct variables and functions names.
19844 (packsymbols, reader): Likewise.
19846 * src/reader.h (muscle_obstack): Extern declaration update.
19848 * src/output.c: Include muscle_tab.h
19849 In all functions using macro_insert, change by using muscle_insert ().
19850 (macro_obstack): Rename muscle_obstack.
19851 Echo modifications in the whole file.
19852 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
19853 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
19854 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
19856 * src/muscle_tab.h: Update double inclusion macros.
19857 (macro_entry_s): Rename muscle_entry_s.
19860 * src/muscle_tab.c: Include muscle_tab.h.
19861 Rename macro_tabble to muscle_table.
19862 (mhash1, mhash2, mcmp): Use muscle_entry.
19863 (macro_init): Rename muscle_init. Update.
19864 (macro_insert): Rename muscle_insert. Update.
19865 (macro_find): Rename muscle_find. Update.
19867 * src/main.c: Include muscle_tab.h.
19868 (main): Call muscle_init ().
19869 * src/Makefile.am (bison_SOURCES): Echo modifications.
19871 2001-09-02 Marc Autret <autret_m@epita.fr>
19873 Now the files macro_tab.[ch] are named muscle_tab.[ch].
19875 * src/muscle_tab.c, src/muscle_tab.h: Add files.
19877 2001-09-02 Marc Autret <autret_m@epita.fr>
19879 * src/macrotab.c, src/macrotab.h: Remove.
19881 2001-09-01 Pascal Bart <pascal.bart@epita.fr>
19883 * src/reader.c (copy_guard): Use muscle to specify the `#line'
19886 2001-09-01 Marc Autret <autret_m@epita.fr>
19888 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
19889 to an explicit value to activate the feature. We do it here.
19891 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
19893 * src/output.c (prepare): Delete the `filename' muscule insertion.
19894 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
19895 (parse_union_decl): Likewise.
19896 * src/macrotab.c (macro_init): Initialize filename by infile.
19898 2001-08-31 Marc Autret <autret_m@epita.fr>
19900 * src/bison.simple (YYLSP_NEEDED): New definition.
19901 * src/output.c (prepare): Add macro insertion of `locations_flag'
19903 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
19905 * src/output.c (prepare): Delete insertion of previous muscles,
19906 and insert the `prefix' muscles.
19907 * src/macrotab.c (macro_init): Likewise.
19908 (macro_init): Initialization prefix directive by `yy'.
19909 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
19910 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
19911 yylval, yydebug, yyerror, yynerrs and yyparse.
19912 New directive `#define' to substitute yydebug, ... with option
19915 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
19917 * src/main.c (main): Standardize.
19918 * src/output.c (output_table_data, output_parser): Likewise.
19919 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
19921 2001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
19923 * src/reader.c (read_additionnal_code): Rename %%user_code to
19925 * src/output.c (output): Rename %%declarations to %%prologue.
19926 * src/bison.simple: Echo modifications.
19928 2001-08-31 Marc Autret <autret_m@epita.fr>
19930 * src/reader.c (readgram): CleanUp.
19931 (output_token_defines): Likewise.
19932 (packsymbols): Likewise.
19933 (reader): Likewise.
19934 * src/output.c (output): CPP-out useless code.
19936 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
19938 * src/reader.c (reader): Delete obsolete call to function
19939 output_trailers and output_headers.
19940 * src/output.h: Remove obsolete functions prototypes of output_headers
19941 and output_trailers.
19943 2001-08-30 Pascal Bart <pascal.bart@epita.fr>
19945 * src/main.c: Include macrotab.h.
19946 * src/macrotab.h (macro_entry_s): Constify fields.
19947 Adjust functions prototypes.
19948 * src/macrotab.c (macro_insert): Constify key and value.
19949 (macro_find): Constify key.
19950 (macro_insert): Include 'xalloc.h'
19951 (macro_insert): Use XMALLOC.
19952 (macro_find): Constify return value.
19953 * src/output.c (output_table_data): Rename table to table_data.
19954 (output_parser): Constify macro_key, macro_value.
19956 2001-08-30 Marc Autret <autret_m@epita.fr>
19958 * src/reader.c (parse_skel_decl): New.
19959 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
19960 * src/lex.h (token_t): New token `tok_skel'.
19961 * src/lex.c (percent_table): Add skeleton option entry.
19964 2001-08-29 Marc Autret <autret_m@epita.fr>
19966 * src/bison.simple: Add %%user_code directive at the end.
19967 * src/reader.c (read_additionnal_code): New.
19969 * src/output.c (output_program): Remove.
19972 2001-08-28 Marc Autret <autret_m@epita.fr>
19974 * src/output.c (output_actions): Clean up.
19975 (output_gram): CPP-out useless code.
19976 * src/reader.c (reader): Clean up, CPP-out useless code.
19978 2001-08-28 Pascal Bart <pascal.bart@epita.fr>
19980 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
19982 * src/bison.simple: Add `%%definitions'.
19984 2001-08-28 Marc Autret <autret_m@epita.fr>
19986 * config/depcomp: New file.
19988 2001-08-27 Paul Eggert <eggert@twinsun.com>
19990 * src/bison.simple (yyparse): Don't take the address of an
19991 item before the start of an array, as that doesn't conform to
19994 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
19996 * src/output.c (output): Remove the initialization of the macro
19997 obstack. It was done too late here.
19999 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
20001 (reader): Initialize the macro obstack here, since we need it to grow
20002 '%define' directives.
20004 * src/reader.h: Declare the macro obstack as extern.
20006 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
20008 * src/output.c (output_parser): Fix. Store single '%' characters in
20009 the output obstack instead of throwing them away.
20011 2001-08-27 Akim Demaille <akim@epita.fr>
20013 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
20015 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20017 * lib/Makefile.am: Adjust.
20019 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20021 * src/bison.simple: Update and add '%%' directives.
20023 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20025 * src/reader.c (reader): Remove calls to 'output_headers' and
20026 'output_trailers'. Remove some C output.
20027 (readgram): Disable a piece of code that was writing a default
20028 definition for 'YYSTYPE'.
20029 (reader_output_yylsp): Remove.
20030 (packsymbols): Output token defintions to a macro.
20031 (copy_definition): Disable C output.
20033 * src/reader.c (parse_macro_decl): New function used to parse macro
20035 (copy_string2): Put the body of copy_string into this new function.
20036 Add a parameter to let the caller choose whether he wants to copy the
20037 string delimiters or not.
20038 (copy_string): Be a simple call to copy_string2 with the last argument
20040 (read_declarations): Add case for macro definition.
20041 (copy_identifier): New.
20042 (parse_macro_decl): Read macro identifiers using copy_identifier
20045 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20047 * src/output.c (prepare): Add prefixed names.
20048 (output_parser): Output semantic actions.
20049 (output_parser): Fix bug on '%%line' directives.
20051 * src/output.c (output_headers): Remove. The C code printed by this
20052 function should now be in the skeletons.
20053 (output_trailers): Remove.
20054 (output): Disable call to 'reader_output_yylsp'.
20055 (output_rule_data): Do not output tables to the table obstack.
20057 * src/output.c: Remove some C dedicated output.
20058 Improve the use of macro and output obstacks.
20059 (output_defines): Remove.
20061 * src/output.c (output_token_translations): Associate 'translate'
20062 table with a macro. No output to the table obstack.
20063 (output_gram): Same for 'rhs' and 'prhs'.
20064 (output_stos): Same for 'stos'.
20065 (output_rule_data): Same for 'r1' and 'r2'.
20066 (token_actions): Same for 'defact'.
20067 (goto_actions): Same for 'defgoto'.
20068 (output_base): Same for 'pact' and 'pgoto'.
20069 (output_table): Same for 'table'.
20070 (output_check): Same for 'check'.
20072 * src/output.c (output_table_data): New function.
20073 (output_short_table): Remove.
20074 (output_short_or_char_table): Remove.
20076 * src/output.c (output_parser): Replace most of the skeleton copy code
20077 with something new. Skeletons are now processed character by character
20078 rather than line by line, and Bison looks for '%%' macros. This is the
20079 first step in making Bison's output process (a lot) more flexible.
20080 (output_parser): Use the macro table.
20082 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20084 * src/main.c (main): Initialize the macro table.
20086 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20088 * src/lex.c (percent_table): Add tok_define.
20089 * src/lex.h: Add tok_define.
20091 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20093 * src/macrotab.c: New file.
20094 * src/macrotab.h: New file.
20095 * src/Makefile.am: Update.
20097 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20099 * lib/hash.c: New file.
20100 * lib/hash.h: New file.
20101 * lib/Makefile.am: Update.
20103 2001-08-15 Akim Demaille <akim@epita.fr>
20107 2001-08-15 Marc Autret <autret_m@epita.fr>
20109 * src/reader.c (readgram): Indent output macro YYSTYPE.
20110 (packsymbols): Likewise.
20111 (output_token_defines): Likewise.
20112 * src/files.c: Standardize.
20113 (compute_header_macro): New.
20114 (defines_obstack_save): New. Use compute_header_macro.
20115 (output_files): Update. Use defines_obstack_save.
20117 2001-08-15 Akim Demaille <akim@epita.fr>
20119 * doc/bison.texinfo (Table of Symbols): Document
20120 YYSTACK_USE_ALLOCA.
20122 2001-08-15 Akim Demaille <akim@epita.fr>
20124 * missing: Update from CVS Automake.
20125 * config/config.guess, config/config.sub, config/texinfo.tex:
20126 Update from gnu.org.
20128 2001-08-15 Akim Demaille <akim@epita.fr>
20130 * Makefile.maint: Sync with CVS Autoconf.
20132 2001-08-14 Pascal Bart <pascal.bart@epita.fr>
20134 * doc/bison.texinfo: Include GNU Free Documentation License from
20136 * doc/fdl.texi: Add to package.
20138 2001-08-14 Marc Autret <autret_m@epita.fr>
20140 Turn on %{source,header}_extension features.
20142 * src/lex.c (percent_table): Un-CPP out header_extension and
20144 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
20145 (compute_exts_from_src): Remove conditions. It restores priorities
20148 2001-08-14 Marc Autret <autret_m@epita.fr>
20150 * src/files.c (compute_base_names): Add extensions computing when
20151 `--file-prefix' used.
20152 Standardize function calls.
20154 2001-08-13 Marc Autret <autret_m@epita.fr>
20156 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
20157 defining it (defined but null disables alloca).
20159 2001-08-13 Marc Autret <autret_m@epita.fr>
20161 * src/bison.simple (_yy_memcpy): CPP reformat.
20163 2001-08-13 Pascal Bart <pascal.bart@epita.fr>
20165 * tests/atconfig.in (CPPFLAGS): Fix.
20167 2001-08-10 Pascal Bart <pascal.bart@epita.fr>
20169 * doc/bison.texinfo: Include GNU General Public License from
20171 * doc/gpl.texi: Add to package.
20173 2001-08-10 Marc Autret <autret_m@epita.fr>
20175 * src/print_graph.h: Fix.
20176 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
20178 2001-08-10 Akim Demaille <akim@epita.fr>
20180 * src/system.h: Provide default declarations for stpcpy, strndup,
20183 2001-08-10 Robert Anisko <anisko_r@epita.fr>
20185 * doc/bison.texinfo (Locations): Update @$ stuff.
20187 2001-08-09 Robert Anisko <anisko_r@epita.fr>
20189 * src/bison.simple (YYLLOC_DEFAULT): Update.
20192 2001-08-08 Marc Autret <autret_m@epita.fr>
20194 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
20195 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
20196 Reported by Fabrice Bauzac.
20198 2001-08-08 Marc Autret <autret_m@epita.fr>
20200 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
20201 * src/vcg.c (output_node): Fix.
20202 * src/vcg.h: Cleanup.
20203 * src/print_graph.c: Add comments.
20204 (node_output_size): New global variable. Simplify the formatting of
20205 the VCG graph output.
20206 (print_actions): Unused code is now used. It notifies the final state
20207 and no action states in the VCG graph. It also give the reduce actions.
20208 The `shift and goto' edges are red and the `go to state' edges are
20210 Get the current node name and node_obstack by argument.
20211 (node_obstack): New variable.
20212 (print_state): Manage node_obstack.
20213 (print_core): Use node_obstack given by argument.
20214 A node is not only computed here but in print_actions also.
20215 (print_graph): CPP out useless code instead of commenting it.
20217 2001-08-07 Pascal Bart <pascal.bart@epita.fr>
20219 * tests/atconfig.in (CPPFLAGS): Fix.
20221 2001-08-07 Akim Demaille <akim@epita.fr>
20223 * src/print_graph.c (quote): New.
20224 (print_core): Use it.
20226 2001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
20228 * src/vcg.c (complain.h): Include it.
20229 Unepitaize `return' invocations.
20230 [NDEBUG] (main): Remove.
20231 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
20232 * src/files.c (open_files): Initialize graph_obstack.
20233 * src/print_graph.c (print_actions): CPP out useless code.
20234 (print_core): Don't output the last `\n' in labels.
20236 * src/files.c (output_files): Output the VCG file.
20237 * src/main.c (main): Invoke print_graph ();
20239 2001-08-06 Marc Autret <autret_m@epita.fr>
20241 Automaton VCG graph output.
20242 Using option ``-g'' or long option ``--graph'', you can generate
20243 a gram_filename.vcg file containing a VCG description of the LALR (1)
20244 automaton of your grammar.
20246 * src/main.c: Call to print_graph() function.
20247 * src/getargs.h: Update.
20248 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
20249 (graph_flag): New flag.
20250 (longopts): Update.
20251 (getargs): Add case `g'.
20252 * src/files.c (graph_obstack): New obstack struct.
20253 (open_files): Initialize new obstack.
20254 (output_files): Saves graph_obstack if required.
20255 * src/files.h (graph_obstack): New extern declaration.
20256 * src/Makefile.am: Add new source files.
20258 2001-08-06 Marc Autret <autret_m@epita.fr>
20260 * src/print_graph.c, src/print_graph.h (graph): New.
20261 * src/vcg.h: New file.
20262 * src/vcg.c: New file, VCG graph handling.
20264 2001-08-06 Marc Autret <autret_m@epita.fr>
20266 Add of %source_extension and %header_extension which specify
20267 the source or/and the header output file extension.
20269 * src/files.c (compute_base_names): Remove initialisation of
20270 src_extension and header_extension.
20271 (compute_exts_from_gf): Update.
20272 (compute_exts_from_src): Update.
20273 (output_files): Update.
20274 * src/reader.c (parse_header_extension_decl): New.
20275 (parse_source_extension_decl): New.
20276 (read_declarations): New case statements for the new tokens.
20277 * src/lex.c (percent_table): Add entries for %source_extension
20278 and %header_extension.
20279 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
20281 2001-08-06 Marc Autret <autret_m@epita.fr>
20283 * configure.in: Bump to 1.28c.
20284 * doc/bison.texinfo: Texinfo thingies.
20286 2001-08-04 Pascal Bart <pascal.bart@epita.fr>
20288 * tests/atconfig.in (CPPFLAGS): Add.
20289 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
20291 2001-08-03 Akim Demaille <akim@epita.fr>
20295 2001-08-03 Akim Demaille <akim@epita.fr>
20297 * tests/Makefile.am (check-local): Ship testsuite.
20298 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
20299 Include `string.h'.
20301 2001-08-03 Akim Demaille <akim@epita.fr>
20303 * configure.in: Try using -Wformat when compiling.
20305 2001-08-03 Akim Demaille <akim@epita.fr>
20307 * configure.in: Bump to 1.28b.
20309 2001-08-03 Akim Demaille <akim@epita.fr>
20311 * src/complain.c: Adjust strerror_r portability issues.
20313 2001-08-03 Akim Demaille <akim@epita.fr>
20317 2001-08-03 Akim Demaille <akim@epita.fr>
20319 * src/getargs.c, src/getarg.h (skeleton)): Constify.
20320 * src/lex.c (literalchar): Avoid name clashes on `buf'.
20321 * src/getargs.c: Include complain.h.
20322 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
20323 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
20325 2001-08-03 Akim Demaille <akim@epita.fr>
20327 * src/reader.c (readgram): Display hidden chars in error messages.
20329 2001-08-03 Akim Demaille <akim@epita.fr>
20331 Update to gettext 0.10.39.
20333 2001-08-03 Akim Demaille <akim@epita.fr>
20335 * lib/strspn.c: New.
20337 2001-08-01 Marc Autret <autret_m@epita.fr>
20339 * doc/bison.texinfo: Update.
20340 * doc/bison.1 (mandoc): Update.
20341 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
20342 * src/files.c: Support output files extensions computing.
20343 (src_extension): New static variable.
20344 (header_extension): New static variable.
20345 (tr): New function.
20346 (get_extension_index): New function, gets the index of an extension
20347 filename in a string.
20348 (compute_exts_from_gf): New function, computes extensions from the
20349 grammar file extension.
20350 (compute_exts_from_src): New functions, computes extensions from the
20351 C source file extension, file given by ``-o'' option.
20352 (compute_base_names): Update.
20353 (output_files): Update.
20355 2001-08-01 Robert Anisko <anisko_r@epita.fr>
20357 * doc/bison.texi: Document @$.
20358 (Locations): New section.
20360 2001-07-18 Akim Demaille <akim@epita.fr>
20362 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
20363 * config/prev-version.txt, config/move-if-change: New.
20364 * Makefile.am: Adjust.
20366 2001-07-08 Pascal Bart <pascal.bart@epita.fr>
20368 * src/bison.simple (yyparse): Suppress warning `comparaison
20369 between signed and unsigned'.
20371 2001-07-05 Pascal Bart <pascal.bart@epita.fr>
20373 * src/getargs.h (raw_flag): Remove.
20374 * src/getargs.c: Die on `-r'/`--raw'.
20375 * src/lex.c (parse_percent_token): Die on `%raw'.
20376 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
20377 * tests/calc.at: Suppress test with option `--raw'.
20379 2001-07-14 Akim Demaille <akim@epita.fr>
20382 * configure.in: Require Autoconf 2.50.
20383 Update to gettext 0.10.38.
20385 2001-03-16 Akim Demaille <akim@epita.fr>
20387 * doc/bison.texinfo: ANSIfy the examples.
20389 2001-03-16 Akim Demaille <akim@epita.fr>
20391 * getargs.c (skeleton): New variable.
20392 (longopts): --skeleton is a new option.
20393 (shortopts, getargs): -S is a new option.
20394 * getargs.h: Declare skeleton.
20395 * output.c (output_parser): Use it.
20397 2001-03-16 Akim Demaille <akim@epita.fr>
20399 * m4/strerror_r.m4: New.
20400 * m4/error.m4: Run AC_FUNC_STRERROR_R.
20401 * lib/error.h, lib/error.c: Update.
20403 2001-03-16 Akim Demaille <akim@epita.fr>
20405 * src/getargs.c (longopts): Clean up.
20407 2001-02-21 Akim Demaille <akim@epita.fr>
20409 * src/reader.c (gensym): `gensym_count' is your own.
20410 Use a static buf to create the symbol name, as token_buffer is no
20413 2001-02-08 Akim Demaille <akim@epita.fr>
20415 * src/conflicts.c (conflict_report): Be sure not to append to res
20416 between two calls, which could happen if both first sprintf were
20417 skipped, but not the first cp += strlen.
20419 2001-02-08 Akim Demaille <akim@epita.fr>
20421 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
20422 New, from fileutils 4.0.37.
20423 * configure.in: Require Autoconf 2.49c. I took some time before
20424 making this decision. This is the only way out for portability
20425 issues in Bison, it would mean way too much duplicate effort to
20426 import in Bison features implemented in 2.49c since 2.13.
20427 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
20429 2001-02-02 Akim Demaille <akim@epita.fr>
20431 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
20432 * lib/xalloc.h, lib/xmalloc.c: Update.
20434 2001-01-19 Akim Demaille <akim@epita.fr>
20436 Get rid of the ad hoc handling of token_buffer in the scanner: use
20439 * src/lex.c (token_obstack): New.
20440 (init_lex): Initialize it. No longer call...
20441 (grow_token_buffer): this. Remove it.
20442 Adjust all the places which used it to use the obstack.
20444 2001-01-19 Akim Demaille <akim@epita.fr>
20446 * src/lex.h: Rename all the tokens:
20447 s/\bENDFILE\b/tok_eof/g;
20448 s/\bIDENTIFIER\b/tok_identifier/g;
20450 Let them be enums, not #define, to ease debugging.
20451 Adjust all the code.
20453 2001-01-18 Akim Demaille <akim@epita.fr>
20455 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
20456 * src/lex.c (maxtoken, grow_token_buffer): Static.
20458 2001-01-18 Akim Demaille <akim@epita.fr>
20460 Since we now use obstacks, more % directives can be enabled.
20462 * src/lex.c (percent_table): Also accept `%yacc',
20463 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
20465 Handle the actions for `%semantic_parser' and `%pure_parser' here,
20466 instead of returning a token.
20467 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
20468 * src/reader.c (read_declarations): Adjust.
20469 * src/files.c (open_files): Don't call `compute_base_names', don't
20470 compute `attrsfile' since they depend upon data which might be
20471 *in* the input file now.
20472 (output_files): Do it here.
20473 * src/output.c (output_headers): Document the fact that this patch
20474 introduces a guaranteed SEGV for semantic parsers.
20475 * doc/bison.texinfo: Document them.
20476 * tests/suite.at: Exercise these %options.
20478 2000-12-20 Akim Demaille <akim@epita.fr>
20480 Also handle the output file (--verbose) with obstacks.
20482 * files.c (foutput): Remove.
20483 (output_obstack): New.
20484 Adjust all dependencies.
20485 * src/conflicts.c: Return a string.
20486 * src/system.h (obstack_grow_string): Rename as...
20487 (obstack_sgrow): this. Be ready to work with non literals.
20488 (obstack_fgrow4): New.
20490 2000-12-20 Akim Demaille <akim@epita.fr>
20492 * src/files.c (open_files): Fix the computation of short_base_name
20493 in the case of `-o foo.tab.c'.
20495 2000-12-20 Akim Demaille <akim@epita.fr>
20497 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
20498 (copy_dollar): Now that everything uses obstacks, get rid of the
20501 2000-12-20 Akim Demaille <akim@epita.fr>
20503 * src/files.c (open_files): Actually the `.output' file is based
20504 on the short_base_name, not base_name.
20505 * tests/suite.at (Checking output file names): Adjust.
20507 2000-12-20 Akim Demaille <akim@epita.fr>
20509 * src/bison.s1: Remove, we now use directly...
20510 * src/bison.simple: this.
20511 * src/Makefile.am: Use pkgdata instead of data.
20513 2000-12-20 Akim Demaille <akim@epita.fr>
20515 * src/files.c (guard_obstack): New.
20516 (open_files): Initialize it.
20517 (output_files): Dump it...
20518 * src/files.h: Export it.
20519 * src/reader.c (copy_guard): Use it.
20521 2000-12-19 Akim Demaille <akim@epita.fr>
20523 * src/files.c (outfile, defsfile, actfile): Removed as global
20525 (open_files): Don't compute them.
20526 (output_files): Adjust.
20527 (base_name, short_base_name): Be global.
20528 Adjust dependencies.
20530 2000-12-19 Akim Demaille <akim@epita.fr>
20532 * src/files.c (strsuffix): New.
20533 (stringappend): Be just like strcat but allocate.
20534 (base_names): Eve out from open_files.
20535 Try to simplify the rather hairy computation of base_name and
20537 (open_files): Use it.
20538 * tests/suite.at (Checking output file names): New test.
20540 2000-12-19 Akim Demaille <akim@epita.fr>
20542 * src/system.h (obstack_grow_literal_string): Rename as...
20543 (obstack_grow_string): this.
20544 * src/output.c (output_parser): Recognize `%% actions' instead of
20546 * src/bison.s1: s/$/%% actions/.
20547 * src/bison.hairy: Likewise.
20549 2000-12-19 Akim Demaille <akim@epita.fr>
20551 * src/output.c (output_parser): Compute the `#line' lines when
20553 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
20554 Suggested by Hans Aberg.
20556 2000-12-19 Akim Demaille <akim@epita.fr>
20558 Let the handling of the skeleton files be local to the procedures
20561 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
20563 (fparser, open_extra_files): Remove.
20564 (open_files, output_files): Don't take care of fparser.
20565 * src/files.h: Adjust.
20566 * src/output.c (output_parser): Open and close the file to the
20568 * src/reader.c (read_declarations): When %semantic_parser, open
20571 2000-12-19 Akim Demaille <akim@epita.fr>
20573 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
20574 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
20576 2000-12-19 Akim Demaille <akim@epita.fr>
20578 * src/files.c (open_files): Yipee! We no longer need all the code
20579 looking for `/tmp' since we have no tmp file.
20581 2000-12-19 Akim Demaille <akim@epita.fr>
20583 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
20585 * src/files.c (open_files): Less dependency on MSDOS etc.
20587 2000-12-14 Akim Demaille <akim@epita.fr>
20589 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
20590 Provide a default definition.
20591 Use it when executing the default @ action.
20592 * src/reader.c (reader_output_yylsp): No longer include
20593 `timestamp' and `text' in the default YYLTYPE.
20595 2000-12-12 Akim Demaille <akim@epita.fr>
20597 * src/reader.c (copy_definition, parse_union_decl, copy_action)
20598 (copy_guard): Quote the file names.
20599 Reported by Laurent Mascherpa.
20601 2000-12-12 Akim Demaille <akim@epita.fr>
20603 * src/output.c (output_headers, output_program, output): Be sure
20604 to escape special characters when outputting filenames.
20605 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
20606 (output_headers): Don't depend on them, Use ACTSTR.
20608 2000-11-17 Akim Demaille <akim@epita.fr>
20610 * lib/obstack.h: Formatting changes.
20611 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
20612 prevents type checking.
20613 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
20614 cast the value to (void *): assigning a `foo *' to a `void *'
20616 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
20617 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
20620 2000-11-17 Akim Demaille <akim@epita.fr>
20622 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
20624 (suite.m4, regression.m4, calc.m4): these.
20625 * tests/atgeneral.m4: Update from CVS Autoconf.
20627 2000-11-17 Akim Demaille <akim@epita.fr>
20629 * tests/regression.m4 (%union and --defines): New test,
20630 demonstrating a current bug in the obstack implementation.
20632 2000-11-17 Akim Demaille <akim@epita.fr>
20634 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
20636 Use them to declare the variables which are global or local to
20639 2000-11-17 Akim Demaille <akim@epita.fr>
20641 * acconfig.h: Remove, no longer used.
20643 2000-11-07 Akim Demaille <akim@epita.fr>
20645 * src: s/Copyright (C)/Copyright/g.
20647 2000-11-07 Akim Demaille <akim@epita.fr>
20649 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
20651 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
20653 2000-11-07 Akim Demaille <akim@epita.fr>
20655 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
20656 Merge in a single CPP if/else.
20658 2000-11-07 Akim Demaille <akim@epita.fr>
20660 * src/output.c (output): Remove useless variables.
20661 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
20662 argument `data' for consistency with the prototypes.
20663 Qualify it `const'.
20664 (obstack_copy, obstack_copy0): Rename the second argument as
20665 `address' for consistency. Qualify it `const'.
20666 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
20667 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
20668 `const' their input argument (`data' or `address').
20669 Adjust the corresponding macros to include `const' in casts.
20671 2000-11-03 Akim Demaille <akim@epita.fr>
20673 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
20674 s/PFILE1/BISON_HAIRY/.
20675 Adjust dependencies.
20677 2000-11-03 Akim Demaille <akim@epita.fr>
20679 For some reason, this was not applied.
20681 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
20682 `unlink': it's no longer used.
20684 2000-11-03 Akim Demaille <akim@epita.fr>
20686 * src/files.c (skeleton_find): New function, eved out of...
20687 (open_files, open_extra_files): here.
20689 2000-11-03 Akim Demaille <akim@epita.fr>
20691 Don't use `atexit'.
20693 * src/files.c (obstack_save): New function.
20694 (done): Rename as...
20695 (output_files): this.
20696 Use `obstack_save'.
20697 * src/main.c (main): Don't use `atexit' to register `done', since
20698 it no longer has to remove tmp files, just call `output_files'
20699 when there are no errors.
20701 2000-11-02 Akim Demaille <akim@epita.fr>
20703 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
20704 `unlink': it's no longer used.
20705 * src/files.h: Formatting changes.
20707 2000-11-02 Akim Demaille <akim@epita.fr>
20709 Remove the last uses of mktemp and unlink/delete.
20711 * src/files.c (fdefines, ftable): Removed.
20712 (defines_ostack, table_obstack): New.
20713 Adjust dependencies of the former into uses of the latter.
20714 * src/output.c (output_short_or_char_table, output_short_table):
20715 Convert to using obstacks.
20716 * src/reader.c (copy_comment2): Accept one FILE * and two
20718 (output_token_defines, reader_output_yylsp): Use obstacks.
20719 * src/system.h (obstack_fgrow3): New.
20720 * po/POTFILES.in: Adjust.
20722 2000-11-01 Akim Demaille <akim@epita.fr>
20724 Change each use of `fattrs' into a use of `attrs_obstack'.
20726 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
20727 * src/files.c (fattrs): Remove.
20728 (attrs_obstack): New.
20729 Adjust all dependencies.
20730 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
20732 2000-11-01 Akim Demaille <akim@epita.fr>
20734 Introduce obstacks.
20735 Change each use of `faction' into a use of `action_obstack'.
20737 * lib/obstack.h, lib/obstack.c: New files.
20738 * src/files.c (faction): Remove.
20739 (action_obstack): New.
20740 Adjust all dependencies.
20742 2000-10-20 Akim Demaille <akim@epita.fr>
20744 * lib/quote.h (PARAMS): New macro. Use it.
20746 2000-10-16 Akim Demaille <akim@epita.fr>
20748 * src/output.c (output_short_or_char_table): New function.
20749 (output_short_table, output_token_translations): Use it.
20750 (goto_actions): Use output_short_table.
20752 2000-10-16 Akim Demaille <akim@epita.fr>
20754 * src/symtab.c (bucket_new): New function.
20757 * src/output.c (output_short_table): New argument to display the
20758 comment associated with the table.
20759 Adjust dependencies.
20760 (output_gram): Use it.
20761 (output_rule_data): Nicer output layout for YYTNAME.
20763 2000-10-16 Akim Demaille <akim@epita.fr>
20765 * src/lex.c (read_typename): New function.
20767 * src/reader.c (copy_dollar): Likewise.
20769 2000-10-16 Akim Demaille <akim@epita.fr>
20771 * src/reader.c (copy_comment2): Expect the input stream to be on
20772 the `/' which is suspected to open a comment, instead of being
20773 called after `//' or `/*' was read.
20774 (copy_comment, copy_definition, parse_union_decl, copy_action)
20775 (copy_guard): Adjust.
20777 2000-10-16 Akim Demaille <akim@epita.fr>
20779 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
20780 `read_signed_integer'.
20782 2000-10-16 Akim Demaille <akim@epita.fr>
20784 * src/reader.c (copy_dollar): New function.
20785 (copy_guard, copy_action): Use it.
20787 2000-10-16 Akim Demaille <akim@epita.fr>
20789 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
20790 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
20791 New files, from Fileutils 4.0.27.
20792 * src/main.c (printable_version): Remove.
20793 * src/lex.c, src/reader.c: Use `quote'.
20795 2000-10-04 Akim Demaille <akim@epita.fr>
20797 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
20799 2000-10-04 Akim Demaille <akim@epita.fr>
20801 * doc/bison.texinfo: Various typos spotted by Neil Booth.
20803 2000-10-04 Akim Demaille <akim@epita.fr>
20805 When a literal string is used to define two different tokens,
20806 `bison -v' segfaults.
20807 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
20809 * tests/regression.m4: New file.
20810 Include the core of the sample provided by Piotr Gackiewicz.
20811 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
20814 2000-10-04 Akim Demaille <akim@epita.fr>
20816 * src/reader.c (parse_expect_decl): Keep `count' within the size
20820 2000-10-02 Paul Eggert <eggert@twinsun.com>
20822 * bison.s1 (yyparse): Assign the default value
20823 unconditionally, to avoid a GCC warning and make the parser a
20826 2000-10-02 Akim Demaille <akim@epita.fr>
20828 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
20831 2000-10-02 Akim Demaille <akim@epita.fr>
20833 * src/derives.c, src/print.c, src/reduce.c: To ease the
20834 translation, move some `\n' out of the translated strings.
20836 2000-10-02 Akim Demaille <akim@epita.fr>
20838 The location tracking mechanism is precious for parse error
20839 messages. Nevertheless, it is enabled only when `@n' is used in
20840 the grammar, which is a different issue (you can use it in error
20841 message, but not in the grammar per se). Therefore, there should
20842 be another means to enable it.
20844 * src/getargs.c (getargs): Support `--locations'.
20845 (usage): Report it.
20846 * src/getargs.h (locationsflag): Export it.
20847 * src/lex.c (percent_table): Support `%locations'.
20848 * src/reader.c (yylsp_needed): Remove this variable, now replaced
20849 with `locationsflag'.
20850 * doc/bison.texinfo: Document `--locations' and `%locations'.
20852 * tests/calc.m4: Test it.
20854 For regularity of the names, replace each
20855 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
20856 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
20857 In addition replace each `flag' with `_flag'.
20859 2000-10-02 Akim Demaille <akim@epita.fr>
20861 Also test parse error messages, including with YYERROR_VERBOSE.
20863 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
20865 Use it to check the computations.
20866 Use it to check `nonassoc' is honored.
20867 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
20868 `--yyerror-verbose'.
20869 (_AT_CHECK_CALC): Adjust to this option.
20870 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
20872 2000-10-02 Akim Demaille <akim@epita.fr>
20874 Test also `--verbose', `--defines' and `--name-prefix'. Testing
20875 the latter demonstrates a flaw in the handling of non debugging
20876 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
20877 was used in order to simplify:
20893 unfortunately this leads to a CPP conflict when
20894 `--name-prefix=foo' is used since it produces `#define yydebug
20897 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
20898 (YYDPRINTF): New macro.
20900 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
20902 Also test `--verbose', `--defines' and `--name-prefix'.
20904 2000-10-02 Akim Demaille <akim@epita.fr>
20906 Improve the readability of the produced parsers.
20908 * src/bison.s1: Formatting changes.
20909 Improve the comment related to the `$' mark.
20910 (yydefault): Don't fall through to `yyresume': `goto' there.
20911 * src/output.c (output_parser): When the `$' is met, skip the end
20913 New variable, `number_of_dollar_signs', to check there's exactly
20914 one `$' in the parser skeleton.
20916 2000-10-02 Akim Demaille <akim@epita.fr>
20918 * lib/xstrdup.c: New file, from the fileutils.
20919 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
20920 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
20921 instead of strlen + xmalloc + strcpy.
20922 * src/symtab.c (copys): Remove, use xstrdup instead.
20924 2000-10-02 Akim Demaille <akim@epita.fr>
20926 * src/gram.h (associativity): New enum type which replaces the
20927 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
20928 `right_assoc', `left_assoc' and `non_assoc'.
20929 Adjust all dependencies.
20930 * src/reader.c: Formatting changes.
20931 (LTYPESTR): Don't define it, use it as a literal in
20932 `reader_output_yylsp'.
20933 * src/symtab.h (symbol_class): New enum type which replaces the
20934 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
20935 `sunknown', `stoken and `snterm'.
20937 2000-10-02 Akim Demaille <akim@epita.fr>
20939 * src/getargs.c (fixed_outfiles): Rename as...
20940 (yaccflag): for consistency and accuracy.
20941 Adjust dependencies.
20943 2000-10-02 Akim Demaille <akim@epita.fr>
20945 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
20946 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
20947 difficult and introduced a lot of core dump. It turns out that
20948 Bison used an implementation of `xmalloc' based on `calloc', and
20949 at various places it does depend upon the initialization to 0. I
20950 have not tried to isolate the pertinent places, and all the former
20951 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
20952 someone should address this issue.
20954 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
20955 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
20957 Adjust dependencies.
20958 * src/warshall.h: New file.
20961 2000-10-02 Akim Demaille <akim@epita.fr>
20963 Various anti-`extern in *.c' changes.
20965 * src/system.h: Include `assert.h'.
20967 2000-10-02 Akim Demaille <akim@epita.fr>
20969 * src/state.h (nstates, final_state, first_state, first_shift)
20970 (first_reduction): Move their exportation from here...
20971 * src/LR0.h: to here.
20972 Adjust dependencies.
20973 * src/getargs.c (statisticsflag): New variable.
20974 Add support for `--statistics'.
20975 Adjust dependencies.
20977 Remove a lot of now useless `extern' statements in most files.
20979 2000-10-02 Akim Demaille <akim@epita.fr>
20981 * src/LR0.h: New file.
20984 2000-10-02 Akim Demaille <akim@epita.fr>
20986 * src/print.h: New file.
20988 * src/print.c: Formatting and ordering changes.
20989 (verbose, terse): Replace with...
20990 (print_results): this new function.
20991 Adjust dependencies.
20993 2000-10-02 Akim Demaille <akim@epita.fr>
20995 * src/conflicts.c (conflict_report): New function.
20996 (conflict_log, verbose_conflict_log): Replace with...
20997 (print_conflicts): this function.
20998 Adjust dependencies.
20999 * src/conflicts.h: New file.
21000 Propagate its inclusion.
21002 2000-10-02 Akim Demaille <akim@epita.fr>
21004 * src/nullable.h: New file.
21005 Propagate its inclusion.
21006 * src/nullable.c: Formatting changes.
21008 2000-10-02 Akim Demaille <akim@epita.fr>
21010 * src/reduce.h: New file.
21011 Propagate its inclusion.
21012 * src/reduce.c: Topological sort and other formatting changes.
21013 (bool, TRUE, FALSE): Move their definition to...
21014 * src/system.h: here.
21016 2000-10-02 Akim Demaille <akim@epita.fr>
21018 * src/files.c: Formatting changes.
21019 (tryopen, tryclose, openfiles): Rename as...
21020 (xfopen, xfclose, open_files): this.
21021 (stringappend): static.
21022 * src/files.h: Complete the list of exported symbols.
21025 2000-10-02 Akim Demaille <akim@epita.fr>
21027 * src/reader.h: New file.
21028 Propagate its use instead of tedious list of `extern' and
21030 * src/reader.c: Formatting changes, topological sort,
21033 2000-10-02 Akim Demaille <akim@epita.fr>
21035 * src/lex.h: Prototype `lex.c' exported functions.
21036 * src/reader.c: Adjust.
21037 * src/lex.c: Formatting changes.
21038 (safegetc): Rename as...
21041 2000-10-02 Akim Demaille <akim@epita.fr>
21043 * src/lalr.h: New file.
21044 Propagate its inclusion instead of prototypes and `extern'.
21045 * src/lalr.c: Formatting changes, topological sorting etc.
21047 2000-10-02 Akim Demaille <akim@epita.fr>
21049 * src/output.c (token_actions): Introduce a temporary array,
21050 YYDEFACT, that makes it possible for this function to use
21051 output_short_table.
21053 2000-10-02 Akim Demaille <akim@epita.fr>
21055 `user_toknums' is output as a `short[]' in `output.c', while it is
21056 defined as a `int[]' in `reader.c'. For consistency with the
21057 other output tables, `user_toknums' is now defined as a table of
21060 * src/reader.c (user_toknums): Be a short table instead of an int
21062 Adjust dependencies.
21064 Factor the short table outputs.
21066 * src/output.c (output_short_table): New function.
21067 * src/output.c (output_gram, output_stos, output_rule_data)
21068 (output_base, output_table, output_check): Use it.
21070 2000-10-02 Akim Demaille <akim@epita.fr>
21072 * src/output.c (output): Topological sort of the functions, in
21073 order to get rid of the `static' prototypes.
21074 No longer use `register'.
21075 * src/output.h: New file.
21076 Propagate its inclusion in files explicitly prototyping functions
21079 2000-09-21 Akim Demaille <akim@epita.fr>
21081 * src/atgeneral.m4: Update from Autoconf.
21083 2000-09-21 Akim Demaille <akim@epita.fr>
21085 * src/closure.h: New file.
21086 * src/closure.c: Formatting changes, topological sort over the
21087 functions, use of closure.h.
21088 (initialize_closure, finalize_closure): Rename as...
21089 (new_closure, free_closure): these. Adjust dependencies.
21090 * src/LR0.c: Formatting changes, topological sort, use of
21092 (initialize_states): Rename as...
21093 (new_states): this.
21094 * src/Makefile.am (noinst_HEADERS): Adjust.
21096 2000-09-20 Akim Demaille <akim@epita.fr>
21098 * src/acconfig.h: Don't protect config.h against multiple
21100 Don't define PARAMS.
21101 * src/system.h: Define PARAMS.
21102 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
21103 purpose of config.h. system.h must not try to fix wrong
21104 definitions in config.h.
21106 2000-09-20 Akim Demaille <akim@epita.fr>
21108 * src/derives.h: New file.
21109 * src/main.c, src/derives.h: Use it.
21110 Formatting changes.
21111 * src/Makefile.am (noinst_HEADERS): Adjust.
21113 2000-09-20 Akim Demaille <akim@epita.fr>
21115 * tests/atgeneral.m4: Update from Autoconf.
21116 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
21117 (AT_CHECK_CALC): New macros.
21118 Use these macros to test bison with options `', `--raw',
21119 `--debug', `--yacc', `--yacc --debug'.
21121 2000-09-19 Akim Demaille <akim@epita.fr>
21123 * src/output.c: Formatting changes.
21124 * src/machine.h: Remove, leaving its contents in...
21125 * src/system.h: here.
21127 Adjust all dependencies on stdio.h and machine.h.
21128 * src/getargs.h: New file.
21129 Let all `extern' declarations about getargs.c be replaced with
21130 inclusion of `getargs.h'.
21131 * src/Makefile.am (noinst_HEADERS): Adjust.
21133 * tests/calc.m4 (yyin): Be initialized in main, not on the global
21135 (yyerror): Returns void, not int.
21136 * doc/bison.texinfo: Formatting changes.
21138 2000-09-19 Akim Demaille <akim@epita.fr>
21140 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
21143 2000-09-18 Akim Demaille <akim@epita.fr>
21145 * configure.in: Append WARNING_CFLAGS to CFLAGS.
21146 * src/Makefile.am (INCLUDES): Don't.
21147 Be ready to fetch headers in lib/.
21149 2000-09-18 Akim Demaille <akim@epita.fr>
21151 * doc/bison.texinfo: Update the copyright.
21152 ANSIfy and GNUify the examples.
21153 Remove the old menu.
21155 2000-09-18 Akim Demaille <akim@epita.fr>
21157 First set of tests: use the `calc' example from the documentation.
21159 * src/bison.s1 (yyparse): Condition the code using `yytname' which
21160 is defined only when YYDEBUG is.
21161 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
21162 * src/files.c (tryopen, tryclose): Formatting changes.
21163 Move to the top and be static.
21164 * src/reader.c (read_signed_integer): Likewise.
21165 * tests/calc.m4: New file.
21166 * Makefile.am, suite.m4: Adjust.
21167 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
21169 2000-09-18 Akim Demaille <akim@epita.fr>
21171 Add support for an Autotest test suite for Bison.
21173 * m4/m4.m4, m4/atconfig.m4: New files.
21174 * m4/Makefile.am (EXTRA_DIST): Adjust.
21175 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
21177 * src/getargs.c: Display a more standard --version message.
21178 * src/reader.c (reader): Formatting changes.
21179 No longer depend upon VERSION_STRING.
21180 * configure.in: No longer use `dnl'.
21181 Set up the test suite and the new directory `tests/.
21182 (VERSION_STRING): Remove.
21184 2000-04-14 Akim Demaille <akim@epita.fr>
21186 * src/reader.c (copy_comment2): New function, same as former
21187 `copy_comment', but outputs into two FILE *.
21188 (copy_comment): Use it.
21189 (parse_union_decl): Use it.
21190 (get_type, parse_start_decl): Use the same `invalid' message.
21191 (parse_start_decl, parse_union_decl): Use the same `multiple'
21193 (parse_union_decl, copy_guard, copy_action): Use the same
21194 `unmatched' message.
21195 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
21197 2000-03-31 Akim Demaille <akim@epita.fr>
21199 * src/files.c (tryopen, tryclose): Move to the top.
21202 2000-03-31 Akim Demaille <akim@epita.fr>
21204 * src/main.c (main): Don't call `done', exit does it.
21206 2000-03-31 Akim Demaille <akim@epita.fr>
21208 * allocate.c: s/return (foo)/return foo/.
21209 * lalr.c: Likewise.
21211 * output.c: Likewise.
21212 * reader.c: Likewise.
21213 * symtab.c: Likewise.
21214 * vmsgetargs.c: Likewise.
21216 2000-03-31 Akim Demaille <akim@epita.fr>
21218 Clean up the error reporting functions.
21220 * src/report.c: New file.
21221 * src/report.h: Likewise.
21222 * src/Makefile.am: Adjust.
21223 * m4/error.m4: New file.
21224 * m4/Makefile.am: Adjust.
21225 * configure.in (jm_PREREQ_ERROR): Call it.
21226 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
21228 (fatal, fatals): Remove. All callers use complain.c::fatal.
21229 (warn, warni, warns, warnss, warnss): Remove. All callers use
21230 complain.c::complain.
21231 (toomany): Remove, use fatal instead.
21232 * src/files.c (done): No argument, use complain_message_count.
21233 * src/main.c (main): Register `done' to `atexit'.
21235 * src/getargs.c (usage): More `fputs', less `fprintf'.
21237 2000-03-28 Akim Demaille <akim@epita.fr>
21239 * lib/: New directory.
21240 * Makefile.am (SUBDIRS): Adjust.
21241 * configure.in: Adjust.
21242 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
21244 * src/alloca.c: Moved to lib/.
21245 * src/getopt.c: Likewise.
21246 * src/getopt1.c: Likewise.
21247 * src/getopt.h: Likewise.
21248 * src/ansi2knr.c: Likewise.
21249 * src/ansi2knr.1: Likewise.
21250 * src/Makefile.am: Adjust.
21251 * lib/Makefile.am: New file.
21253 2000-03-28 Akim Demaille <akim@epita.fr>
21255 * src/getargs.c (usage): Refresh the help message.
21257 2000-03-17 Akim Demaille <akim@epita.fr>
21259 * src/getopt1.c: Updated from textutils 2.0e
21260 * src/getopt.c: Likewise.
21261 * src/getopt.h: Likewise.
21263 2000-03-17 Akim Demaille <akim@epita.fr>
21265 * src/Makefile.am (bison.simple): Fix the awk program: quote only
21266 the file name, not the whole `#line LINE FILE'.
21268 2000-03-17 Akim Demaille <akim@epita.fr>
21270 On syntax errors, report the token on which we choked.
21272 * src/bison.s1 (yyparse): In the label yyerrlab, when
21273 YYERROR_VERBOSE, add yychar in msg.
21275 2000-03-17 Akim Demaille <akim@epita.fr>
21277 * src/reader.c (copy_at): New function.
21278 (copy_guard): Use it.
21279 (copy_action): Use it.
21281 2000-03-17 Akim Demaille <akim@epita.fr>
21283 Be kind to translators, save some useless translations.
21285 * src/main.c (banner): New function.
21286 (fatal_banner): Use it.
21287 (warn_banner): Use it.
21289 2000-03-17 Akim Demaille <akim@epita.fr>
21291 * src/reader.c (copy_definition): Use copy_string and
21292 copy_comment. Removed now unused `match', `ended',
21294 (copy_comment, copy_string): Moved, to be visible from
21297 2000-03-17 Akim Demaille <akim@epita.fr>
21299 * src/reader.c (copy_string): Declare `static inline'. No
21300 problems with inline, since it is checked by configure.
21301 (copy_comment): Likewise.
21303 2000-03-17 Akim Demaille <akim@epita.fr>
21305 * src/reader.c (packsymbols): Formatting changes.
21307 2000-03-17 Akim Demaille <akim@epita.fr>
21309 * src/reader.c (copy_comment): New function, factored out from:
21310 (copy_action): Use it. Removed now unused `match', `ended',
21312 (copy_guard): Likewise.
21314 2000-03-17 Akim Demaille <akim@epita.fr>
21316 * src/reader.c (copy_string): New function, factored out from:
21317 (copy_action): Use it.
21318 (copy_guard): Likewise.
21320 2000-03-17 Akim Demaille <akim@epita.fr>
21322 Change the handling of @s so that they behave exactly like $s.
21323 There is now a pseudo variable @$ (readble and writable), location
21324 of the lhs of the rule (by default ranging from the location of
21325 the first symbol of the rhs, to the location of the last symbol,
21326 or, if the rhs is empty, YYLLOC).
21328 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
21330 (yyparse): When providing a default semantic action, provide a
21331 default location action.
21332 (after the $): No longer change `*YYLSP', just stack YYLOC the
21333 same way you stack YYVAL.
21334 * src/reader.c (read_declarations): Use warns.
21335 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
21336 (copy_action, case '@'): Likewise.
21337 Use a standard error message, to save useless work from
21340 2000-03-17 Akim Demaille <akim@epita.fr>
21342 * src/bison.s1: Formatting and cosmetics changes.
21343 * src/reader.c: Likewise.
21344 Update the Copyright notice.
21346 2000-03-17 Akim Demaille <akim@epita.fr>
21348 * src/bison.s1 (#line): All set to `#line' only, since the
21349 Makefile now handles them.
21351 2000-03-16 Akim Demaille <akim@epita.fr>
21353 * src/output.c (output_rule_data): Output the documentation of
21354 some of the tables.
21355 (Copyright notice): Update.
21356 Formatting changes.
21358 2000-03-16 Akim Demaille <akim@epita.fr>
21360 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
21361 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
21362 One `#if YYDEBUG' remains, since it uses variables which are
21363 defined only if `YYDEBUG != 0'.
21365 2000-03-16 Akim Demaille <akim@epita.fr>
21367 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
21368 and related variables so that the similarities are highlighted.
21370 2000-03-16 Akim Demaille <akim@epita.fr>
21372 * src/bison.s1: Properly indent CPP directives.
21374 2000-03-16 Akim Demaille <akim@epita.fr>
21376 * src/bison.s1: Properly indent the `alloca' CPP section.
21378 2000-03-16 Akim Demaille <akim@epita.fr>
21380 Do not hard code values of directories in `configure.in'.
21381 Update the `configure' tool chain.
21383 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
21385 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
21386 (AC_OUTPUT): Add m4/Makefile.
21387 Bump to bison 1.28a, 1.29 has never been released.
21388 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
21389 handled via src/Makefile.am.
21390 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
21391 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
21393 * Makefile.am (SUBDIRS): Add m4.
21394 (ACLOCAL_AM_FLAGS): New variable.
21395 (AUTOMAKE_OPTIONS): Add check-news.
21396 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
21397 the proper line number and file name.
21398 (DEFS): Propagate the location of bison library files and of the
21400 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
21402 * acinclude.m4: Remove, replaced by the directory m4.
21403 * m4/Makefile.am (EXTRA_DIST): New variable.
21404 * m4/gettext.m4: New file, from the fileutils.
21405 * m4/lcmessage.m4: Likewise
21406 * m4/progtest.m4: Likewise.
21407 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
21409 2000-03-10 Akim Demaille <akim@epita.fr>
21412 Formatting changes of various comments.
21413 Respect the GNU coding standards at various places.
21414 Don't use `_()' when no translation is needed.
21416 1999-12-13 Jesse Thilo <jthilo@gnu.org>
21419 OS/2 honors TMPDIR environment variable.
21421 1999-12-13 Jesse Thilo <jthilo@gnu.org>
21423 * doc/bison.texinfo: Tweaked spelling and grammar.
21425 Removed reference to price of printed copy.
21426 Mention BISON_SIMPLE and BISON_HAIRY.
21428 1999-12-13 Jesse Thilo <jthilo@gnu.org>
21430 * configure.in, NEWS:
21431 Bison 1.29 released.
21433 1999-10-27 Jesse Thilo <jthilo@gnu.org>
21435 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
21436 Added reference card.
21438 1999-07-26 Jesse Thilo <jthilo@gnu.org>
21440 * po/ru.po: Added Russian translation.
21442 1999-07-26 Jesse Thilo <jthilo@gnu.org>
21444 * configure.in: Added Russian translation.
21446 1999-07-06 Jesse Thilo <jthilo@gnu.org>
21448 * configure.in, NEWS, README:
21449 Released version 1.28.
21451 1999-06-14 Jesse Thilo <jthilo@gnu.org>
21454 Squashed redefinition warning on some systems.
21456 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
21457 Have configure build version string instead of relying on ANSI string
21460 1999-06-14 Jesse Thilo <jthilo@gnu.org>
21462 * po/POTFILES.in: Got rid of version.c.
21464 1999-06-14 Jesse Thilo <jthilo@gnu.org>
21466 * acconfig.h, configure.in:
21467 Have configure build version string instead of relying on ANSI string
21470 1999-06-08 Jesse Thilo <jthilo@gnu.org>
21473 Dropped mention of `+' for long-named options.
21475 1999-05-30 Jesse Thilo <jthilo@gnu.org>
21477 * src/files.c: Added <unistd.h> for unlink().
21479 * src/Makefile.am, src/system.h:
21482 1999-05-30 Jesse Thilo <jthilo@gnu.org>
21484 * README: Added a FAQ list.
21486 * configure.in, acconfig.h:
21489 1999-05-30 Jesse Thilo <jthilo@gnu.org>
21491 * doc/FAQ, doc/Makefile.am:
21494 1999-05-19 Jesse Thilo <jthilo@gnu.org>
21496 * src/alloc.h, src/symtab.h, src/version.c:
21497 Protected inclusion of "config.h" with HAVE_CONFIG_H.
21499 1999-04-18 Jesse Thilo <jthilo@gnu.org>
21501 * src/.cvsignore, src/Makefile.am:
21502 Reorganized: sources in `src', documentation in `doc'.
21504 * src/lex.c (literalchar):
21505 fixed the code for escaping double quotes (thanks
21508 1999-04-18 Jesse Thilo <jthilo@gnu.org>
21510 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
21511 Adjusted paths to reflect directory reorganization.
21513 1999-04-18 Jesse Thilo <jthilo@gnu.org>
21515 * doc/.cvsignore, doc/Makefile.am:
21516 Reorganized: sources in `src', documentation in `doc'.
21518 1999-04-18 Jesse Thilo <jthilo@gnu.org>
21521 Updated AC_INIT file to reflect directory reorganization.
21523 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
21524 Reorganized: sources in `src', documentation in `doc'.
21526 1999-04-13 Jesse Thilo <jthilo@gnu.org>
21529 Don't declare calloc() and realloc() if not necessary.
21531 1999-04-13 Jesse Thilo <jthilo@gnu.org>
21533 * configure.in, acconfig.h, acinclude.m4:
21534 Don't declare calloc() and realloc() if not necessary.
21536 1999-03-23 Jesse Thilo <jthilo@gnu.org>
21538 * po/.cvsignore: Added i18n support.
21540 1999-03-23 Jesse Thilo <jthilo@gnu.org>
21542 * acconfig.h, configure.in, Makefile.am:
21543 Added i18n support.
21545 1999-03-22 Jesse Thilo <jthilo@gnu.org>
21547 * src/bison.s1: Fixed #line numbers.
21549 1999-03-15 Jesse Thilo <jthilo@gnu.org>
21551 * po/es.po, po/fr.po, po/nl.po, po/de.po:
21552 Added PO files from Translation Project.
21554 1999-03-03 Jesse Thilo <jthilo@gnu.org>
21557 Added support for non-ANSI compilers (ansi2knr).
21559 1999-02-16 Jesse Thilo <jthilo@gnu.org>
21561 * configure.in: Bumped version number to 1.27.
21564 Added `bison.simple' to list of files removed by `make distclean'.
21566 1999-02-12 Jesse Thilo <jthilo@gnu.org>
21568 * src/files.c, src/files.h:
21569 Defined locations of parser files in config.h instead of Makefile.
21571 1999-02-12 Jesse Thilo <jthilo@gnu.org>
21573 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
21574 Defined locations of parser files in config.h instead of Makefile.
21576 1999-02-09 Jesse Thilo <jthilo@gnu.org>
21579 Removed inappropriate use of $< macro.
21581 1999-02-05 Jesse Thilo <jthilo@gnu.org>
21583 * po/Makefile.in.in, po/POTFILES.in:
21584 Add `po' directory skeleton.
21586 1999-01-27 Jesse Thilo <jthilo@gnu.org>
21588 * README: Document help-bison list.
21590 * configure.in: Add check for mkstemp().
21592 1999-01-20 Jesse Thilo <jthilo@gnu.org>
21594 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
21595 Hush a few compiler warnings.
21598 Add tryclose(), which verifies that fclose was successful.
21599 Hush a couple of compiler warnings.
21601 1999-01-20 Jesse Thilo <jthilo@gnu.org>
21603 * Makefile.am, OChangeLog:
21604 ChangeLog is now automatically generated. Include the old version as
21607 1999-01-14 Jesse Thilo <jthilo@gnu.org>
21609 * 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:
21610 Update FSF address.
21612 1999-01-14 Jesse Thilo <jthilo@gnu.org>
21614 * doc/bison.texinfo: Fix formatting glitch.
21616 * doc/bison.texinfo: Update FSF address.
21618 1999-01-14 Jesse Thilo <jthilo@gnu.org>
21620 * acconfig.h: Update FSF address.
21622 1999-01-08 Jesse Thilo <jthilo@gnu.org>
21625 Don't define PACKAGE here, since config.h defines it.
21627 1998-12-30 Jesse Thilo <jthilo@gnu.org>
21629 * src/reader.c: Update copyright date.
21632 Ditch sprintf to statically-sized buffers in fatal/warn functions in
21633 favor of output directly to stderr (avoids buffer overruns).
21635 * src/reader.c: Some checks for premature EOF.
21637 * 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:
21638 Use prototypes if the compiler understands them.
21640 * src/files.c: Honor TMPDIR on Unix hosts.
21641 Use prototypes if the compiler understands them.
21644 Fix a couple of buffer overrun bugs.
21645 Use prototypes if the compiler understands them.
21647 * src/system.h: Include unistd.h and ctype.h.
21648 Use #ifdef instead of #if for NLS symbols.
21650 1998-12-30 Jesse Thilo <jthilo@gnu.org>
21652 * doc/bison.texinfo:
21653 Delete comment "consider using @set for edition number, etc..." since
21654 we now are doing so.
21656 1998-12-30 Jesse Thilo <jthilo@gnu.org>
21659 Use prototypes if the compiler understands them.
21661 * NEWS: Document 1.26 highlights.
21663 * Makefile.am: Require Automake 1.3 or later.
21666 Use prototypes if the compiler understands them.
21668 1998-12-29 Jesse Thilo <jthilo@gnu.org>
21671 Use VERSION symbol from automake for version number.
21673 1998-12-29 Jesse Thilo <jthilo@gnu.org>
21675 * acconfig.h, configure.in, version.cin:
21676 Use VERSION symbol from automake for version number.
21678 1998-11-28 Jesse Thilo <jthilo@gnu.org>
21681 Distribute original version of simple parser (bison.s1), not built
21682 version (bison.simple).
21684 1998-11-28 Jesse Thilo <jthilo@gnu.org>
21686 * doc/bison.texinfo: Add info dir entry.
21688 * doc/bison.texinfo:
21689 Let automake put version number into documentation.
21691 1998-11-26 Jesse Thilo <jthilo@gnu.org>
21693 * src/bison.cld, src/build.com, src/vmshlp.mar:
21694 Add non-RCS files from /gd/gnu/bison.
21696 1998-11-26 Jesse Thilo <jthilo@gnu.org>
21699 Document the BISON_HAIRY and BISON_SIMPLE variables.
21701 1998-11-25 Jesse Thilo <jthilo@gnu.org>
21703 * src/version.c: Build version.c automatically.
21706 Fix token numbering (used to start at 258, not 257).
21708 * src/system.h: Include config.h.
21710 * src/getargs.c: Update bug report address.
21712 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
21713 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
21715 1998-11-25 Jesse Thilo <jthilo@gnu.org>
21718 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
21720 * configure.in, version.cin:
21721 Build version.c automatically.
21723 * AUTHORS: Add AUTHORS file.
21725 * README: Update bug report address.
21728 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
21730 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
21731 Add automake stuff.
21733 1998-11-25 Jesse Thilo <jthilo@gnu.org>
21735 * doc/bison.texinfo: Clean up some formatting.
21737 1998-05-05 Richard Stallman <rms@gnu.org>
21739 * doc/bison.texinfo:
21740 Explain better why to make a pure parser.
21742 1998-01-05 Richard Stallman <rms@gnu.org>
21744 * src/files.c (openfiles):
21745 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
21746 find a temporary directory, if possible. Do not unlink files while
21749 1997-08-25 Richard Stallman <rms@gnu.org>
21751 * src/reader.c (stack_offset;):
21752 Change some warni to warns.
21754 * src/lex.c (literalchar): Use warns, not warni.
21756 1997-06-28 Richard Stallman <rms@gnu.org>
21758 * src/bison.s1: Add a Bison version comment.
21760 * src/main.c (fatal, warn, berror):
21763 1997-06-28 Richard Stallman <rms@gnu.org>
21765 * Makefile.in (bison_version): New variable.
21766 (dist): Use that variable.
21767 (bison.s1): Substitute the Bison version into bison.simple.
21769 * bison.simple: Add a Bison version comment.
21771 1997-06-18 Richard Stallman <rms@gnu.org>
21773 * src/main.c (fatal, warn, berror):
21774 Make error messages standard.
21775 (toomany): Improve error message text.
21777 * 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:
21778 new.h renamed to alloc.h.
21780 1997-06-18 Richard Stallman <rms@gnu.org>
21782 * Makefile.in: new.h renamed to alloc.h.
21784 1997-05-24 Richard Stallman <rms@gnu.org>
21786 * src/lex.c (literalchar):
21787 Fix the code for escaping \, " and '.
21789 (lex): Avoid trouble when there are many chars
21790 to discard in a char literal with just several chars in it.
21792 1997-05-17 Richard Stallman <rms@gnu.org>
21795 Use malloc, if using alloca is troublesome.
21796 (YYSTACK_USE_ALLOCA): New flag macro.
21797 Define it for some systems and compilers.
21798 (YYSTACK_ALLOC): New macro.
21799 (yyparse): Use YYSTACK_ALLOC to allocate stack.
21800 If it was malloc'd, free it.
21802 1997-05-17 Richard Stallman <rms@gnu.org>
21805 Use malloc, if using alloca is troublesome.
21806 (YYSTACK_USE_ALLOCA): New flag macro.
21807 Define it for some systems and compilers.
21808 (YYSTACK_ALLOC): New macro.
21809 (yyparse): Use YYSTACK_ALLOC to allocate stack.
21810 If it was malloc'd, free it.
21812 1997-04-23 Richard Stallman <rms@gnu.org>
21815 (alloca) [__hpux]: Always define as __builtin_alloca.
21817 1997-04-23 Richard Stallman <rms@gnu.org>
21820 (alloca) [__hpux]: Always define as __builtin_alloca.
21822 1997-04-22 Richard Stallman <rms@gnu.org>
21825 [__hpux]: Include alloca.h (right for HPUX 10)
21826 instead of declaring alloca (right for HPUX 9).
21828 * src/bison.s1 (__yy_memcpy):
21829 Declare arg `count' as unsigned int.
21830 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
21832 1997-04-22 Richard Stallman <rms@gnu.org>
21835 [__hpux]: Include alloca.h (right for HPUX 10)
21836 instead of declaring alloca (right for HPUX 9).
21838 * bison.simple (__yy_memcpy):
21839 Declare arg `count' as unsigned int.
21840 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
21842 1997-01-03 Richard Stallman <rms@gnu.org>
21844 * src/allocate.c: [__STDC__ or _MSC_VER]:
21845 Declare calloc and realloc to return void *.
21847 1997-01-02 Richard Stallman <rms@gnu.org>
21850 [_MSC_VER]: Include stdlib.h and process.h.
21851 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
21853 * src/main.c (main): Return FAILURE as a value.
21854 (printable_version): Declare arg as int, not char.
21856 1997-01-02 Richard Stallman <rms@gnu.org>
21858 * Makefile.in (dist):
21859 Explicitly check for symlinks, and copy them.
21861 1996-12-19 Richard Stallman <rms@gnu.org>
21864 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
21866 1996-12-18 Paul Eggert <eggert@gnu.org>
21868 * src/bison.s1 (yyparse):
21869 If __GNUC__ and YYPARSE_PARAM are both defined,
21870 declare yyparse to have a void * argument.
21872 1996-12-18 Paul Eggert <eggert@gnu.org>
21874 * bison.simple (yyparse):
21875 If __GNUC__ and YYPARSE_PARAM are both defined,
21876 declare yyparse to have a void * argument.
21878 1996-12-17 Richard Stallman <rms@gnu.org>
21880 * src/reduce.c (nbits): Add some casts.
21882 1996-08-12 Richard Stallman <rms@gnu.org>
21884 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
21886 1996-08-12 Richard Stallman <rms@gnu.org>
21888 * bison.simple: Test _MSDOS as well as _MSDOS_.
21890 1996-07-31 Richard Stallman <rms@gnu.org>
21893 [__sun && __i386]: Include alloca.h.
21895 1996-07-31 Richard Stallman <rms@gnu.org>
21898 [__sun && __i386]: Include alloca.h.
21900 1996-07-30 Richard Stallman <rms@gnu.org>
21902 * src/bison.s1: Comment change.
21904 * src/bison.s1: Test _MSDOS_, not MSDOS.
21906 1996-07-30 Richard Stallman <rms@gnu.org>
21908 * bison.simple: Comment change.
21910 * bison.simple: Test _MSDOS_, not MSDOS.
21912 1996-06-01 Richard Stallman <rms@gnu.org>
21914 * 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:
21915 Insert `_' macro around many string constants.
21918 Insert `_' macro around many string constants.
21920 (main): Call setlocale, bindtextdomain and textdomain.
21922 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
21923 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
21924 [ENABLE_NLS]: Include libintl.h.
21925 [ENABLE_NLS] (gettext): Define.
21926 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
21927 (N_, PACKAGE, LOCALEDIR): New macros.
21929 1996-06-01 Richard Stallman <rms@gnu.org>
21931 * POTFILES.in: New file.
21933 * Makefile.in (allocate.o):
21934 Define target explicitly.
21936 * Makefile.in (CFLAGS): Set to @CFLAGS@.
21937 (LDFLAGS): Set to @LDFLAGS@.
21938 (configure): Run autoconf only if preceding `cd' succeeds.
21939 (bison.s1): Redirect output to temporary file then move the
21940 temporary to the target, rather than redirecting directly to bison.s1.
21941 (clean): Remove config.status and config.log.
21942 (distclean): Don't remove config.status here.
21944 1996-05-12 Richard Stallman <rms@gnu.org>
21947 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
21949 1996-05-12 Richard Stallman <rms@gnu.org>
21952 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
21954 1996-05-11 Richard Stallman <rms@gnu.org>
21956 * src/bison.s1 (__yy_memcpy):
21957 Really reorder the args, as was supposedly done on Feb 14 1995.
21958 (yyparse): Calls changed accordingly.
21960 1996-05-11 Richard Stallman <rms@gnu.org>
21962 * Makefile.in (dist): Don't use $(srcdir).
21964 * bison.simple (__yy_memcpy):
21965 Really reorder the args, as was supposedly done on Feb 14 1995.
21966 (yyparse): Calls changed accordingly.
21968 1996-01-27 Richard Stallman <rms@gnu.org>
21970 * src/output.c (output_rule_data):
21971 Test YYERROR_VERBOSE in the conditional
21972 around the definition of ttyname.
21974 1995-12-29 Richard Stallman <rms@gnu.org>
21977 Fix line numbers in #line commands.
21979 1995-12-29 Richard Stallman <rms@gnu.org>
21982 Fix line numbers in #line commands.
21984 1995-12-27 Richard Stallman <rms@gnu.org>
21986 * src/bison.s1 (YYPARSE_PARAM_DECL):
21987 In C++, make it always null.
21988 (YYPARSE_PARAM_ARG): New macro.
21989 (yyparse): Use YYPARSE_PARAM_ARG.
21991 1995-12-27 Richard Stallman <rms@gnu.org>
21993 * bison.simple (YYPARSE_PARAM_DECL):
21994 In C++, make it always null.
21995 (YYPARSE_PARAM_ARG): New macro.
21996 (yyparse): Use YYPARSE_PARAM_ARG.
21998 1995-11-29 Richard Stallman <rms@gnu.org>
22000 * doc/bison.texinfo:
22001 Describe literal string tokens, %raw, %no_lines, %token_table.
22003 1995-11-29 Daniel Hagerty <hag@gnu.org>
22005 * doc/bison.texinfo: Fixed update date
22007 1995-10-16 Richard Stallman <rms@gnu.org>
22009 * src/version.c: Version 1.25.
22011 1995-10-16 Richard Stallman <rms@gnu.org>
22013 * NEWS: *** empty log message ***
22015 1995-10-16 Richard Stallman <rms@gnu.org>
22017 * doc/bison.1, doc/bison.rnh:
22020 1995-10-15 Richard Stallman <rms@gnu.org>
22022 * src/vmsgetargs.c, src/getargs.c:
22023 Added -n, -k, and -raw switches.
22024 (noparserflag, toknumflag, rawtoknumflag): New variables.
22026 * src/symtab.h (SALIAS):
22027 New #define for adding aliases to %token.
22028 (struct bucket): Added `alias' field.
22030 * src/reduce.c (reduce_grammar):
22031 Revise error message.
22032 (print_notices): Remove final `.' from error message.
22034 * src/reader.c (reader_output_yylsp):
22036 (readgram): Use `#if 0' around code that accepted %command
22037 inside grammar rules: The documentation doesn't allow it,
22038 and it will fail since the %command processors scan for the next %.
22039 (parse_token_decl): Extended the %token
22040 declaration to allow a multi-character symbol as an alias.
22041 (parse_thong_decl): New function.
22042 (read_declarations): Added %thong declarations.
22043 (read_declarations): Handle NOOP to deal with allowing
22044 % declarations as another means to specify the flags.
22045 (readgram): Allow %prec prior to semantics embedded in a rule.
22046 (skip_to_char, read_declarations, copy_definition)
22047 (parse_token_decl, parse_start_decl, parse_type_decl)
22048 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
22049 (get_type_name, copy_guard, copy_action, readgram)
22050 (get_type, packsymbols): Revised most error messages.
22051 Changed `fatal' to `warnxxx' to avoid aborting for error.
22052 Revised and use multiple warnxxx functions to avoid using VARARGS1.
22053 (read_declarations): Improve the error message for
22054 an invalid character. Do not abort.
22055 (read_declarations, copy_guard, copy_action): Use
22056 printable_version to avoid unprintable characters in printed output.
22057 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
22058 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
22059 Allow the type of a non-terminal can be given
22060 more than once, as long as all specifications give the same type.
22063 (output_headers, output_trailers, output, output_gram)
22064 (output_rule_data): Implement noparserflag variable.
22065 Implement toknumflag variable.
22066 (output): Call reader_output_yylsp to output LTYPESTR.
22068 * src/main.c (main):
22069 If reader sees an error, don't process the grammar.
22070 (fatals): Updated to not use VARARGS1.
22071 (printable_version, int_to_string, warn, warni, warns, warnss)
22072 (warnsss): New error reporting functions. Avoid abort for error.
22075 Added THONG and NOOP for alias processing.
22076 Added SETOPT for the new code that allows setting options with %flags.
22079 Include getopt.h. Add some extern decls.
22080 (safegetc): New function to deal with EOF gracefully.
22081 (literalchar); new function to deal with reading \ escapes.
22082 (lex): Use literalchar.
22083 (lex): Implemented "..." tokens.
22084 (literalchar, lex, parse_percent_token): Made tokenbuffer
22085 always contain the token. This includes growing the token
22086 buffer while reading an integer.
22087 (parse_percent_token): Replaced if-else statement with percent_table.
22088 (parse_percent_token): Added % declarations as another
22089 way to specify the flags -n, -l, and -r. Also added hooks for
22090 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
22091 major changes to files.c.
22092 (lex) Retain in the incoming stream a character following
22094 (skip_white_space, lex): Revised most error messages
22095 and changed fatal to warn to avoid aborting.
22096 (percent_table): Added %thong declarations.
22098 * src/gram.h: Comment changes.
22100 * src/files.c (openfiles, open_extra_files, done):
22102 and actfile file. Handle noparserflag. Both for -n switch.
22104 * src/conflicts.c (resolve_sr_conflict):
22105 Remove use of alloca.
22107 1995-06-01 Jim Meyering <meyering@gnu.org>
22109 * doc/bison.texinfo: *** empty log message ***
22111 1995-05-06 Richard Stallman <rms@gnu.org>
22113 * src/bison.s1: Comment change.
22115 1995-05-06 Richard Stallman <rms@gnu.org>
22117 * bison.simple: Comment change.
22119 1995-05-03 Richard Stallman <rms@gnu.org>
22121 * src/version.c: Version now 1.24.
22123 * src/bison.s1: Change distribution terms.
22125 * src/version.c: Version now 1.23.
22127 1995-05-03 Richard Stallman <rms@gnu.org>
22129 * doc/bison.texinfo:
22130 Rewrite "Conditions for Using Bison".
22131 Update version to 1.24.
22133 1995-05-03 Richard Stallman <rms@gnu.org>
22135 * bison.simple: Change distribution terms.
22137 1995-02-23 Richard Stallman <rms@gnu.org>
22139 * src/files.c: Test __VMS_POSIX as well as VMS.
22141 1995-02-14 Jim Meyering <meyering@gnu.org>
22143 * src/bison.s1 (__yy_memcpy):
22144 Renamed from __yy_bcopy to avoid
22145 confusion. Reverse FROM and TO arguments to be consistent with
22148 1995-02-14 Jim Meyering <meyering@gnu.org>
22150 * bison.simple (__yy_memcpy):
22151 Renamed from __yy_bcopy to avoid
22152 confusion. Reverse FROM and TO arguments to be consistent with
22155 1994-11-10 David J. MacKenzie <djm@gnu.org>
22161 * Makefile.in (DISTFILES): Include NEWS.
22163 * Makefile.in (DISTFILES):
22164 Include install-sh, not install.sh.
22166 * configure.in: Update to Autoconf v2 macro names.
22168 1994-10-05 David J. MacKenzie <djm@gnu.org>
22170 * Makefile.in: fix typo
22172 * Makefile.in (prefix, exec_prefix):
22173 Let configure set them.
22175 1994-09-28 David J. MacKenzie <djm@gnu.org>
22177 * Makefile.in: Set datadir to $(prefix)/share.
22179 1994-09-15 Richard Stallman <rms@gnu.org>
22182 Update copyright notice and GPL version.
22184 1994-09-15 Richard Stallman <rms@gnu.org>
22187 Update copyright notice and GPL version.
22189 1994-07-12 Richard Stallman <rms@gnu.org>
22191 * src/reduce.c, src/reader.c:
22194 1994-05-05 David J. MacKenzie <djm@gnu.org>
22196 * Makefile.in: entered into RCS
22198 1994-03-26 Richard Stallman <rms@gnu.org>
22200 * src/bison.s1: entered into RCS
22202 1994-03-26 Richard Stallman <rms@gnu.org>
22204 * bison.simple: entered into RCS
22206 1994-03-25 Richard Stallman <rms@gnu.org>
22208 * src/main.c: entered into RCS
22210 1994-03-24 Richard Stallman <rms@gnu.org>
22212 * src/conflicts.c: entered into RCS
22214 1994-01-02 Richard Stallman <rms@gnu.org>
22216 * Makefile.in: *** empty log message ***
22218 1993-11-21 Richard Stallman <rms@gnu.org>
22220 * src/bison.s1: *** empty log message ***
22222 1993-11-21 Richard Stallman <rms@gnu.org>
22224 * doc/bison.texinfo: entered into RCS
22226 * doc/bison.texinfo: *** empty log message ***
22228 1993-11-21 Richard Stallman <rms@gnu.org>
22230 * bison.simple: *** empty log message ***
22232 1993-10-25 David J. MacKenzie <djm@gnu.org>
22234 * doc/bison.texinfo: *** empty log message ***
22236 1993-10-19 Richard Stallman <rms@gnu.org>
22238 * src/bison.s1: *** empty log message ***
22240 1993-10-19 Richard Stallman <rms@gnu.org>
22242 * bison.simple: *** empty log message ***
22244 1993-10-14 Richard Stallman <rms@gnu.org>
22246 * src/bison.s1: *** empty log message ***
22248 1993-10-14 Richard Stallman <rms@gnu.org>
22250 * bison.simple: *** empty log message ***
22252 1993-09-14 David J. MacKenzie <djm@gnu.org>
22254 * doc/bison.texinfo: *** empty log message ***
22256 1993-09-13 Noah Friedman <friedman@gnu.org>
22258 * Makefile.in: *** empty log message ***
22260 1993-09-10 Richard Stallman <rms@gnu.org>
22262 * src/conflicts.c: *** empty log message ***
22264 * src/system.h: entered into RCS
22266 1993-09-10 Richard Stallman <rms@gnu.org>
22268 * doc/bison.1: entered into RCS
22270 1993-09-06 Noah Friedman <friedman@gnu.org>
22272 * src/version.c: entered into RCS
22274 1993-09-06 Noah Friedman <friedman@gnu.org>
22276 * Makefile.in: *** empty log message ***
22278 1993-07-30 David J. MacKenzie <djm@gnu.org>
22280 * Makefile.in: *** empty log message ***
22282 1993-07-24 Richard Stallman <rms@gnu.org>
22284 * src/bison.s1: *** empty log message ***
22286 1993-07-24 Richard Stallman <rms@gnu.org>
22288 * bison.simple: *** empty log message ***
22290 1993-07-08 David J. MacKenzie <djm@gnu.org>
22292 * Makefile.in: *** empty log message ***
22294 1993-07-04 Richard Stallman <rms@gnu.org>
22296 * src/bison.s1: *** empty log message ***
22298 1993-07-04 Richard Stallman <rms@gnu.org>
22300 * bison.simple: *** empty log message ***
22302 1993-06-26 David J. MacKenzie <djm@gnu.org>
22304 * src/getargs.c: entered into RCS
22306 1993-06-26 David J. MacKenzie <djm@gnu.org>
22308 * doc/bison.texinfo: *** empty log message ***
22310 * doc/bison.1: New file.
22312 1993-06-25 Richard Stallman <rms@gnu.org>
22314 * src/getargs.c: New file.
22316 1993-06-16 Richard Stallman <rms@gnu.org>
22318 * src/bison.s1: *** empty log message ***
22320 1993-06-16 Richard Stallman <rms@gnu.org>
22322 * bison.simple: *** empty log message ***
22324 1993-06-03 Richard Stallman <rms@gnu.org>
22326 * src/bison.s1: New file.
22328 1993-06-03 Richard Stallman <rms@gnu.org>
22330 * doc/bison.texinfo: *** empty log message ***
22332 1993-06-03 Richard Stallman <rms@gnu.org>
22334 * bison.simple: New file.
22336 1993-05-19 Richard Stallman <rms@gnu.org>
22338 * doc/bison.texinfo: New file.
22340 1993-05-07 Noah Friedman <friedman@gnu.org>
22342 * Makefile.in: *** empty log message ***
22344 1993-04-28 Noah Friedman <friedman@gnu.org>
22346 * src/reader.c: *** empty log message ***
22348 1993-04-23 Noah Friedman <friedman@gnu.org>
22350 * src/alloc.h: entered into RCS
22352 1993-04-20 David J. MacKenzie <djm@gnu.org>
22354 * src/version.c: *** empty log message ***
22356 * src/files.c, src/allocate.c:
22359 * src/reader.c: *** empty log message ***
22361 * src/lex.c: entered into RCS
22363 * src/conflicts.c: New file.
22365 * src/symtab.c: entered into RCS
22367 * src/alloc.h: New file.
22369 * src/LR0.c: entered into RCS
22371 1993-04-18 Noah Friedman <friedman@gnu.org>
22373 * src/reader.c: New file.
22375 * src/version.c: *** empty log message ***
22377 1993-04-18 Noah Friedman <friedman@gnu.org>
22379 * Makefile.in: *** empty log message ***
22381 1993-04-17 Noah Friedman <friedman@gnu.org>
22383 * Makefile.in: *** empty log message ***
22385 1993-04-15 Richard Stallman <rms@gnu.org>
22387 * src/main.c, src/files.c:
22390 1993-04-15 Noah Friedman <friedman@gnu.org>
22392 * configure.in: entered into RCS
22394 * configure.in: *** empty log message ***
22396 * configure.in: New file.
22398 1993-04-14 Richard Stallman <rms@gnu.org>
22400 * Makefile.in: New file.
22402 1993-04-13 Richard Stallman <rms@gnu.org>
22404 * src/version.c: New file.
22406 1993-03-25 Richard Stallman <rms@gnu.org>
22408 * src/output.c: entered into RCS
22410 1992-09-25 Richard Stallman <rms@gnu.org>
22412 * configure.bat: entered into RCS
22414 1992-06-22 Richard Stallman <rms@gnu.org>
22416 * src/vmsgetargs.c: entered into RCS
22418 1992-06-22 Richard Stallman <rms@gnu.org>
22420 * doc/bison.rnh: entered into RCS
22422 1992-04-20 David J. MacKenzie <djm@gnu.org>
22424 * README: entered into RCS
22426 1992-01-22 Richard Stallman <rms@gnu.org>
22428 * src/machine.h: entered into RCS
22430 1991-12-21 Richard Stallman <rms@gnu.org>
22432 * src/lalr.c, src/closure.c:
22435 1991-12-20 Richard Stallman <rms@gnu.org>
22437 * src/state.h: entered into RCS
22439 1991-12-18 Richard Stallman <rms@gnu.org>
22441 * src/print.c, src/nullable.c, src/derives.c:
22444 1991-11-03 David J. MacKenzie <djm@gnu.org>
22446 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
22449 1988-09-09 Richard Stallman <rms@gnu.org>
22451 * src/bison.hairy: entered into RCS
22453 1987-12-16 Richard Stallman <rms@gnu.org>
22455 * REFERENCES: entered into RCS
22460 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
22461 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
22462 Free Software Foundation, Inc.
22464 Copying and distribution of this file, with or without
22465 modification, are permitted provided the copyright notice and this
22466 notice are preserved.