1 2008-11-13 Akim Demaille <demaille@gostai.com>
6 2008-11-13 Akim Demaille <demaille@gostai.com>
9 * data/lalr1.cc, data/yacc.c: Fix the description of the
10 yytranslate and yytoknum tables.
12 2008-11-13 Akim Demaille <demaille@gostai.com>
14 Define make_symbol in the header.
15 To reach good performances these functions should be inlined (yet this is
16 to measure precisely). To this end they must be available to the caller.
18 * data/lalr1.cc (b4_symbol_constructor_definition_): Qualify
19 location_type with the class name.
20 Since will now be output in the header, declare "inline".
21 No longer use b4_symbol_constructor_specializations, but
22 b4_symbol_constructor_definitions in the header.
23 Don't call it in the *.cc file.
25 2008-11-13 Akim Demaille <demaille@gostai.com>
27 Define yytranslate in the header for lex_symbol.
28 * data/lalr1.cc: Move the invocation of b4_yytranslate_definition
29 into the header file when using %define lex_symbol.
30 (yytranslate_): Declare inline.
32 2008-11-13 Akim Demaille <demaille@gostai.com>
34 Define the constructors of symbol_type in b4_symbol_constructor_definitions.
35 The constructors are called by the make_symbol functions, which a
36 forthcoming patch will move elsewhere. Hence the interest of putting them
39 The stack_symbol_type does not need to be moved, it is used only by the
42 * data/lalr1.cc: Move symbol_type and symbol_base_type
44 (b4_symbol_constructor_definitions): here.
47 2008-11-13 Akim Demaille <demaille@gostai.com>
49 Make it easier to move the definition of yytranslate_.
50 Forthcoming changes will make it possible to use yytranslate_
51 from outside the parser implementation file.
53 * data/lalr1.cc (b4_yytranslate_definition): New.
56 2008-11-13 Akim Demaille <demaille@gostai.com>
58 Remove useless class specification.
59 * data/lalr1.cc (b4_symbol_constructor_specialization_): No need
60 to refer to the class name to use a type defined by the class for
61 arguments of member functions.
63 2008-11-13 Akim Demaille <demaille@gostai.com>
65 Finer input type for yytranslate.
66 This patch is debatable: the tradition expects yylex to return an int
67 which happens to correspond to token_number (which is an enum). This
68 allows for instance to return characters (such as '*' etc.). But this
69 goes against the stronger typing I am trying to have with the new
70 lex interface which return a symbol_type. So in this case, feed
71 yytranslate_ with a token_type.
73 * data/lalr1.cc (yytranslate_): When in %define lex-symbol,
76 2008-11-13 Akim Demaille <demaille@gostai.com>
78 Honor lex-params in %define lex_symbol mode.
79 * data/lalr1.cc: Use b4_lex_param.
81 2008-11-13 Akim Demaille <demaille@gostai.com>
84 * src/output.c (symbol_definitions_output): Rename symbol
85 attributes type_name and has_type_name as type and has_type.
86 * data/lalr1.cc: Adjust uses.
88 2008-11-13 Akim Demaille <demaille@gostai.com>
90 Use b4_type_names for the union type.
91 The union used to compute the size of the variant used to iterate over the
92 type of all the symbols, with a lot of redundancy. Now iterate over the
93 lists of symbols having the same type-name.
95 * data/lalr1.cc (b4_char_sizeof_): New.
96 (b4_char_sizeof): Use it.
97 Adjust to be called with a list of numbers instead of a single
99 Adjust its caller for new-line issues.
101 2008-11-13 Akim Demaille <demaille@gostai.com>
103 Define the "identifier" of a symbol.
104 Symbols may have several string representations, for instance if they
105 have an alias. What I call its "id" is a string that can be used as
106 an identifier. May not exist.
108 Currently the symbols which have the "tag_is_id" flag set are those that
109 don't have an alias. Look harder for the id.
111 * src/output.c (is_identifier): Move to...
112 * src/symtab.c (is_identifier): here.
113 * src/symtab.h, src/symtab.c (symbol_id_get): New.
114 * src/output.c (symbol_definitions_output): Use it to define "id"
116 Remove the definition of "tag_is_id".
117 * data/lalr1.cc: Use the "id" and "has_id" whereever "tag" and
118 "tag_is_id" were used to produce code.
119 We still use "tag" for documentation.
121 2008-11-11 Akim Demaille <demaille@gostai.com>
123 Locations are no longer required by lalr1.cc.
124 * data/lalr1.cc (_b4_args, b4_args): New.
125 Adjust all uses of locations to make them optional.
126 * tests/c++.at (AT_CHECK_VARIANTS): No longer use the locations.
127 (AT_CHECK_NAMESPACE): Check the use of locations.
128 * tests/calc.at (_AT_DATA_CALC_Y): Adjust to be usable with or
129 without locations with lalr1.cc.
131 * tests/output.at: Check lalr1.cc with and without location
133 * tests/regression.at (_AT_DATA_EXPECT2_Y, _AT_DATA_DANCER_Y):
136 2008-11-11 Akim Demaille <demaille@gostai.com>
139 * tests/local.at (AT_FULL_COMPILE): New.
140 * tests/actions.at, tests/calc.at, tests/regression.at: Use it.
142 2008-11-11 Akim Demaille <demaille@gostai.com>
144 Support parens in calc++.
145 * doc/bison.texinfo (Calc++ Scanner, Calc++ Parser): Support parens.
146 * examples/calc++/test (run): Check the expected output.
150 2008-11-11 Akim Demaille <demaille@gostai.com>
152 Simplify lalr1.cc since %defines is mandatory.
153 * data/lalr1.cc: Remove useless calls to b4_defines_if.
155 2008-11-11 Akim Demaille <demaille@gostai.com>
158 * TODO (yysyntax_error): New item.
160 2008-11-11 Akim Demaille <demaille@gostai.com>
163 * data/lalr1.cc: Use b4_error_verbose_if instead of #if
166 2008-11-11 Akim Demaille <demaille@gostai.com>
168 Support i18n of the parse error messages.
169 * TODO (lalr1.cc/I18n): Remove.
170 * data/lalr1.cc (yysyntax_error_): Support the translation of the
171 error messages, as done in yacc.c.
172 Stay within the yy* pseudo namespace.
174 2008-11-11 Akim Demaille <demaille@gostai.com>
177 * TODO (single stack, yysyntax_error): New.
179 2008-11-11 Akim Demaille <demaille@gostai.com>
181 Make it possible to return a symbol_type from yylex.
182 * data/lalr1.cc (b4_lex_symbol_if): New.
183 (parse): When lex_symbol is defined, expected yylex to return the
185 * etc/bench.pl.in (generate_grammar_list): Extend to support this
187 (bench_variant_parser): Exercise it.
189 2008-11-11 Akim Demaille <demaille@gostai.com>
191 Remove useless bench case.
192 * etc/bench.pl.in (bench_variant_parser): VARIANT_DESTROY is
195 2008-11-11 Akim Demaille <demaille@gostai.com>
197 Improve display of directives.
198 * etc/bench.pl.in (parse_term): Don't add useless eol.
200 2008-11-11 Akim Demaille <demaille@gostai.com>
202 Use string_cast in the bench.
203 * etc/bench.pl.in (generate_grammar_list): Define and use
206 2008-11-11 Akim Demaille <demaille@gostai.com>
208 Replace yychar with a Boolean.
209 * data/lalr1.cc (parse::yychar): Replace by...
210 (parse::yyempty): this.
212 2008-11-11 Akim Demaille <demaille@gostai.com>
217 2008-11-11 Akim Demaille <demaille@gostai.com>
219 Let yytranslate handle the eof case.
220 * data/lalr1.cc (yytranslate_): Handle the EOF case.
222 No longer expect yychar to be equal to yyeof_, rather, test the
223 lookahead's (translated) kind.
225 2008-11-11 Akim Demaille <demaille@gostai.com>
227 yychar cannot be empty in yyerrlab.
228 * TODO (yychar == yyempty_): New.
229 * data/lalr1.cc: Remove the handling of this case.
230 This eases forthcoming changes related to yychar and yytranslate.
232 2008-11-11 Akim Demaille <demaille@gostai.com>
234 Bench: syntactic sugar for %define/#define.
235 * etc/bench.pl.in (parse_dirs): Support %d and #d with arguments.
236 (&bench_push_parser, bench_variant_parser): Use this feature.
240 2008-11-11 Akim Demaille <demaille@gostai.com>
242 Less memory pressure on the "list" bench.
243 * etc/bench.pl.in (generate_grammar_list): Do not accumulate all
244 the values, to limit memory pressure.
246 2008-11-11 Akim Demaille <demaille@gostai.com>
248 Introduce make_symbol.
249 make_symbol provides a means to construct a full symbol (kind, value,
250 location) in a single shot. It is meant to be a Symbol constructor,
251 parameterized by the symbol kind so that overloading would prevent
252 incorrect kind/value pairs. Unfortunately parameterized constructors do
253 not work well in C++ (unless the parameter also appears as an argument,
254 which is not acceptable), hence the use of a function instead of a
257 * data/lalr1.cc (b4_symbol_constructor_declaration_)
258 (b4_symbol_constructor_declarations)
259 (b4_symbol_constructor_specialization_)
260 (b4_symbol_constructor_specializations)
261 (b4_symbol_constructor_definition_)
262 (b4_symbol_constructor_definitions): New.
263 Use them where appropriate to generate declaration, declaration of
264 the specializations, and implementations of the templated
265 overloaded function "make_symbol".
266 (variant::variant): Always define a default ctor.
267 Also provide a copy ctor.
268 (symbol_base_type, symbol_type): New ctor overloads for value-less
270 (symbol_type): Now public, so that functions such as yylex can use
273 2008-11-11 Akim Demaille <demaille@gostai.com>
275 Inform m4 whether a tag is a valid id.
276 * src/output.c (is_identifier): New.
277 (symbol_definitions_output): Use it to define tag_is_id.
278 But maybe this should be done at m4 level?
280 2008-11-11 Akim Demaille <demaille@gostai.com>
282 Test 214 was failing: it greps with a pattern containing [ ]*
283 which obviously meant to catch spaces and tabs, but contained only
284 spaces. Tabulations in sources are a nuisance, so to simplify the
285 matter, get rid of all the tabulations in the Java sources. The
286 other skeletons will be treated equally later.
288 * data/java.m4, data/lalr1.java: Untabify.
289 * tests/java.at: Simplify AT_CHECK_JAVA_GREP invocations:
290 tabulations are no longer generated.
292 2008-11-11 Paolo Bonzini <bonzini@gnu.org>
294 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
295 * configure.ac: Adjust usage.
296 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
297 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
298 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
300 2008-11-10 Di-an Jan <dianj@freeshell.org>
302 Workaround Java's ``code too large'' problem for parser tables
303 in most cases, by using one function per initialization.
304 * data/java.m4 (b4_typed_parser_table, b4_integral_parser_table): New.
305 * data/lalr1.java (yypact_, yydefact_, yypgoto_, yydefgoto_,
306 yytable_, yycheck_, yystos_, yytoken_number_, yyr1_, yyr2_, yyrhs_
307 yyprhs_, yyrline_, yytranslate_table_): Use b4_integral_parser_table.
308 (yytname_): Use b4_typed_parser_table.
309 * doc/bison.texinfo (Java Bison Interface): Add note on Java's
310 ``code too large'' error.
312 2008-11-10 Di-an Jan <dianj@freeshell.org>
314 * NEWS: Document them.
316 General Java skeleton improvements.
317 * configure.ac (gt_JAVACOMP): Request target of 1.4, which allows
318 using gcj < 4.3 in the testsuite, according to comments in
319 gnulib/m4/javacomp.m4.
320 * data/java.m4 (stype, parser_class_name, lex_throws, throws,
321 location_type, position_type): Remove extraneous brackets from
322 b4_percent_define_default.
323 (b4_lex_param, b4_parse_param): Remove extraneous brackets from
324 m4_define and m4_define_default.
325 * data/lalr1.java (b4_pre_prologue): Change to b4_user_post_prologue,
326 which marks the end of user code with appropriate syncline, like all
328 (b4_user_post_prologue): Add. Don't silently drop.
330 (parse): Inline yylex.
331 * doc/bison.texinfo (bisonVersion, bisonSkeleton): Document.
332 (%{...%}): Fix typo of %code imports.
333 * tests/java.at (AT_JAVA_COMPILE): Add "java" keyword.
335 Support annotations on parser class with %define annotations.
336 * data/lalr1.java (annotations): Add to parser class modifier.
337 * doc/bison.texinfo (Java Parser Interface): Document
339 (Java Declarations Summary): Document %define annotations.
340 * tests/java.at (Java parser class modifiers): Test annotations.
342 Do not generate code for %error-verbose unless requested.
343 * data/lalr1.java (errorVerbose): Rename to yyErrorVerbose.
344 Make private. Make conditional on %error-verbose.
345 (getErrorVerbose, setErrorVerbose): New.
346 (yytnamerr_): Make conditional on %error-verbose.
347 (yysyntax_error): Make some code conditional on %error-verbose.
348 * doc/bison.texinfo (Java Bison Interface): Remove the parts
349 about %error-verbose having no effect.
350 (getErrorVerbose, setErrorVerbose): Document.
352 Move constants for token names to Lexer interface.
353 * data/lalr1.java (Lexer): Move EOF, b4_token_enums(b4_tokens) here.
354 * data/java.m4 (b4_token_enum): Indent for move to Lexer interface.
355 (parse): Qualify EOF to Lexer.EOF.
356 * doc/bison.texinfo (Java Parser Interface): Move documentation of
357 EOF and token names to Java Lexer Interface.
358 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove Calc qualifier.
361 * data/lalr1.java (Lexer.yyerror): Use longer parameter name.
362 (yyerror): Change to public. Add Javadoc comments. Use longer
363 parameter names. Make the body rather than the declarator
364 conditional on %locations.
365 * doc/bison.texinfo (yyerror): Document. Don't mark as protected.
367 Allow user to add code to the constructor with %code init.
368 * data/java.m4 (b4_init_throws): New, for %define init_throws.
369 * data/lalr1.java (YYParser.YYParser): Add b4_init_throws.
370 Add %code init to the front of the constructor body.
371 * doc/bison.texinfo (YYParser.YYParser): Document %code init
372 and %define init_throws.
373 (Java Declarations Summary): Document %code init and
375 * tests/java.at (Java %parse-param and %lex-param): Adjust grep.
376 (Java constructor init and init_throws): Add tests.
378 2008-11-10 Akim Demaille <demaille@gostai.com>
381 * TODO (-D): is implemented.
382 (associativity): Same precedence must have the same associativity.
383 For instance, how can a * b / c be parsed if * is %left and / is
385 (YYERRORCODE, YYFAIL, YYBACKUP): New.
387 2008-11-10 Akim Demaille <demaille@gostai.com>
391 2008-11-10 Akim Demaille <demaille@gostai.com>
393 More information about the symbols.
394 * src/output.c (type_names_output): Document all the symbols,
395 including those that don't have a type-name.
396 (symbol_definitions_output): Define "is_token" and
398 * data/lalr1.cc (b4_type_action_): Skip symbols that have an empty
399 type-name, now that they are defined too in b4_type_names.
401 2008-11-10 Akim Demaille <demaille@gostai.com>
405 2008-11-10 Akim Demaille <demaille@gostai.com>
407 Make parser::yytranslate static.
408 Small speedup (1%) on the list grammar. And makes yytranslate_ available
409 in non member functions.
411 * data/lalr1.cc (yytranslate_): Does not need to be a instance
414 2008-11-10 Akim Demaille <demaille@gostai.com>
416 Avoid trailing spaces.
417 * data/c.m4: b4_comment(TEXT): Don't indent empty lines.
418 * data/lalr1.cc: Don't indent before rule and symbol actions, as
419 they can be empty, and anyway this incorrectly indents the first
422 2008-11-10 Akim Demaille <demaille@gostai.com>
426 2008-11-10 Akim Demaille <demaille@gostai.com>
428 Use "enum" for integral constants.
429 This is just nicer to read, I observed no speedup.
431 * data/lalr1.cc (yyeof_, yylast_, yynnts_, yyempty_, yyfinal_)
432 (yterror_, yyerrcode_, yyntokens_): Define as members of an enum.
433 (yyuser_token_number_max_, yyundef_token_): Move into...
434 (yytranslate_): here.
436 2008-11-10 Akim Demaille <demaille@gostai.com>
438 Shortcuts in bench directives.
439 * etc/bench.pl.in (parse_dirs): New.
441 (bench_variant_parser, bench_fusion_parser): Use %s and %d.
442 Create the benches in "benches/".
444 2008-11-10 Akim Demaille <demaille@gostai.com>
447 * data/lalr1.cc: here.
449 2008-11-10 Akim Demaille <demaille@gostai.com>
451 Adjust verbose message to using emacs.
452 * etc/bench.pl.in: Inform compilation-mode when we change the
454 (generate_grammar_list): Recognize %define "variant" in addition
457 2008-11-10 Akim Demaille <demaille@gostai.com>
459 Classify symbols by type-name.
460 * src/uniqstr.h (UNIQSTR_CMP): New.
461 * src/output.c (symbol_type_name_cmp, symbols_by_type_name)
462 (type_names_output): New.
463 (muscles_output): Use it.
464 * data/lalr1.cc (b4_symbol_action_): Remove.
465 (b4_symbol_case_, b4_type_action_): New.
466 Adjust uses of b4_symbol_action_ to use b4_type_action_.
468 2008-11-10 Akim Demaille <demaille@gostai.com>
470 Change the handling of the symbols in the skeletons.
471 Before we were using tables which lines were the symbols and which
472 columns were things like number, tag, type-name etc. It is was
473 difficult to extend: each time a column was added, all the numbers had
474 to be updated (you asked for colon $2, not for "tag"). Also, it was
475 hard to filter these tables when only a subset of the symbols (say the
476 tokens, or the nterms, or the tokens that have and external number
477 *and* a type-name) was of interest.
479 Now instead of monolithic tables, we define one macro per cell. For
480 instance "b4_symbol(0, tag)" is a macro name which contents is
481 self-decriptive. The macro "b4_symbol" provides easier access to
484 * src/output.c (type_names_output): Remove.
485 (symbol_numbers_output, symbol_definitions_output): New.
486 (muscles_output): Call them.
487 (prepare_symbols): Define b4_symbols_number.
489 2008-11-10 Akim Demaille <demaille@gostai.com>
492 * src/getargs.h, src/getargs.c (trace_muscle): New.
493 (trace_types, trace_args): Support it.
494 * src/output.c (output_skeleton): Use it.
496 2008-11-10 Akim Demaille <demaille@gostai.com>
499 * src/output.c (muscles_output): New, extracted from...
500 (output_skeleton): here.
503 2008-11-10 Akim Demaille <demaille@gostai.com>
507 2008-11-10 Akim Demaille <demaille@gostai.com>
509 Update the variant example.
510 * examples/variant.yy: Formatting changes.
513 2008-11-10 Akim Demaille <demaille@gostai.com>
515 Support constructor with an argument.
516 This improves the "list" bench by 2%.
518 * data/lalr1.cc (variant::build): Add an overloaded version with
520 * tests/c++.at (AT_CHECK_VARIANT): Check it.
522 2008-11-10 Akim Demaille <demaille@gostai.com>
525 * tests/c++.at (AT_CHECK_VARIANTS): New.
526 Use it with and without %define assert.
528 2008-11-10 Akim Demaille <demaille@gostai.com>
530 Add %precedence support.
531 Unfortunately it is not possible to reuse the %prec directive. This
532 is because to please POSIX, we do not require to end the rules with a
533 semicolon. As a result,
537 is ambiguous: either a rule which precedence is that of baz, or a rule,
538 and then a declaration of the precedence of the token baz.
540 * doc/bison.texinfo: Document %precedence.
541 (Precedence Only): New.
542 * src/assoc.h, src/assoc.c (precedence_assoc): New.
543 * src/conflicts.c (resolve_sr_conflict): Support it.
544 * src/scan-gram.l, src/parse-gram.y (%precedence): New token.
546 * tests/calc.at: Use %precedence for NEG.
547 * tests/conflicts.at (%precedence does not suffice)
548 (%precedence suffices): New tests.
550 2008-11-09 Akim Demaille <demaille@gostai.com>
552 Make benches in a sub dirs.
553 * etc/bench.pl.in ($dir): New.
555 Check the use of constructors with an argument.
556 (bench_variant_parser): Fix.
558 2008-11-09 Akim Demaille <demaille@gostai.com>
562 2008-11-09 Akim Demaille <demaille@gostai.com>
566 2008-11-09 Akim Demaille <demaille@gostai.com>
568 Require the generation of parse-gram.output.
569 * src/Makefile.am (YACC): Pass --report=all.
571 2008-11-09 Akim Demaille <demaille@gostai.com>
575 2008-11-09 Akim Demaille <demaille@gostai.com>
578 * TODO: Remove obsolete items.
581 2008-11-09 Akim Demaille <demaille@gostai.com>
584 * etc/bench.pl.in (parse, parse_expr, parse_term, parse_fact)
585 (@token, $grammar, $bench): New.
586 (generate_grammar_variant): Rename as...
587 (generate_grammar_list): this.
588 (generate_grammar): Adjust.
589 (bench_grammar): Rename as...
591 Use it in the various bench-marking routines.
592 (-b, -g): New options.
594 2008-11-09 Akim Demaille <demaille@gostai.com>
596 Use a static hierarchy for symbols in the C++ parser.
597 * data/lalr1.cc (symbol_base_type, symbol_type)
598 (stack_symbol_type): Make it a static hierarchy.
601 2008-11-09 Akim Demaille <demaille@gostai.com>
603 bench.pl -d, --directive.
604 * etc/bench.pl.in (@directive): New.
605 (&bench_grammar): Use it.
606 (&bench_list_grammar): New, to provide access to the "variant"
609 (getopts): Support -d, --directive.
611 2008-11-09 Akim Demaille <demaille@gostai.com>
613 Use inline for small operations.
614 * data/lalr1.cc (symbol_base_type, symbol_type)
615 (stack_symbol_type): Declare constructor and other operations as
617 (yy_destroy_): Inline.
619 2008-11-09 Akim Demaille <demaille@gostai.com>
621 Introduce a hierarchy for symbols.
622 * data/lalr1.cc (symbol_base_type, symbol_type): New.
623 (data_type): Rename as...
624 (stack_symbol_type): this.
625 Derive from symbol_base_type.
626 (yy_symbol_value_print_): Merge into...
627 (yy_symbol_print_): this.
630 (yydestruct_): Rename as...
632 (b4_symbols_actions, YY_SYMBOL_PRINT): Adjust.
633 (parser::parse): yyla is now of symbol_type.
634 Use its type member instead of yytoken.
636 2008-11-09 Akim Demaille <demaille@gostai.com>
638 Rename data_type and stack_symbol_type.
639 * data/lalr1.cc (data_type): Rename as...
640 (stack_symbol_type): this.
642 2008-11-09 Akim Demaille <demaille@gostai.com>
644 Handle semantic value and location together.
645 * data/lalr1.cc (b4_symbol_actions): Bounce $$ and @$ to
646 yydata.value and yydata.location.
647 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_)
648 (YY_SYMBOL_PRINT): Now take semantic value and location as a
651 (yydestruct_): New overload for a stack symbol.
653 2008-11-09 Akim Demaille <demaille@gostai.com>
655 Push a complete symbol, not connected parts.
656 * data/lalr1.cc (yypush_): Take a data_type&, not disconnected
657 state, value and location.
660 2008-11-09 Akim Demaille <demaille@gostai.com>
662 Agregate yylval and yylloc.
663 * data/lalr1.cc (parser::yylval, parser::yylloc): Replace by...
664 (parser::yyla): this.
666 2008-11-09 Akim Demaille <demaille@gostai.com>
668 Rely on the state stack to display reduction traces.
669 To display rhs symbols before a reduction, we used information about the rule
670 reduced, which required the tables yyrhs and yyprhs. Now use rely only on the
671 state stack to get the same information.
673 * data/lalr1.cc (b4_rhs_data, b4_rhs_state): New.
675 (parser::yyrhs_, parser::yyprhs_): Remove.
676 (parser::yy_reduce_print_): Use the state stack.
678 2008-11-09 Akim Demaille <demaille@gostai.com>
680 Fuse yyval and yyloc into yylhs.
681 * data/lalr1.cc (b4_lhs_value, b4_lhs_location): Adjust to using
683 (parse): Replace yyval and yyloc with yylhs.value and
685 After a user action, compute yylhs.state earlier.
686 (yyerrlab1): Do not play tricks with yylhs.location, rather, use a
689 2008-11-09 Di-an Jan <dianj@freeshell.org>
691 Remove unused variable.
692 * src/output.c (type_names_output): Remove unused variable sep.
694 2008-11-09 Paolo Bonzini <bonzini@gnu.org>
696 Change tests/output.at quoting.
697 * tests/output.at (AT_CHECK_OUTPUT): Use conventional m4 quoting when
700 2008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
702 Don't add a semicolon to actions for %skeleton or %language.
703 It breaks Java test cases as reported by Akim Demaille.
704 * src/scan-code.l: Implement.
706 2008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
708 Clean up %skeleton and %language priority implementation.
709 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
710 remove static qualifier because others will soon need to see it.
711 (language_prio): Likewise.
712 (getargs): Use command_line_prio rather than 0.
713 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
715 (skeleton_prio): Extern it.
716 (language_prio): Extern it.
717 * src/parse-gram.y: Use grammar_prio rather than 1.
719 2008-11-07 Akim Demaille <demaille@gostai.com>
721 Moving push traces into yypush_.
722 * data/lalr1.cc (yypush_): Now takes a optional trace message.
725 2008-11-07 Akim Demaille <demaille@gostai.com>
727 The single-stack C++ parser is now the standard one.
728 * data/lalr1.cc: Rename as...
729 * data/lalr1-split.cc: this.
730 * data/lalr1-fusion.cc: Rename as...
731 * data/lalr1.cc: this.
732 * etc/bench.pl.in: Adjust.
734 2008-11-07 Akim Demaille <demaille@gostai.com>
736 Avoid empty-if warnings.
737 Reported by Quentin Hocquet.
739 * data/lalr1-fusion.cc (YY_SYMBOL_PRINT, YY_REDUCE_PRINT)
740 (YY_STACK_PRINT): Provide some contents even when !YYDEBUG.
742 2008-11-07 Akim Demaille <demaille@gostai.com>
744 Pass command line location to skeleton_arg and language_argmatch.
745 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
746 The location argument is now mandatory.
747 Adjust all dependencies.
748 (getargs): Use command_line_location.
750 2008-11-07 Akim Demaille <demaille@gostai.com>
753 * src/getargs.c (usage): Document -D.
754 Fix help string for --locations.
755 (command_line_location): New.
756 (short_options, long_options, getargs): Support -D, --define.
757 (getargs): Move -d support at the right place.
758 * doc/bison.texinfo (Bison Options): Update.
759 * tests/input.at (%define, --define): New.
761 2008-11-07 Akim Demaille <demaille@gostai.com>
763 Initialize the muscle table before parsing the command line.
764 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
765 (getargs): Define file_name.
766 * src/main.c (main): Initialize muscle_tab before calling
768 * src/muscle_tab.c (muscle_init): No longer define file_name, as
769 its value is not available yet.
771 2008-11-07 Akim Demaille <demaille@gostai.com>
773 Locations without columns for command line arguments.
774 * src/location.c (location_print): Don't display negative columns.
775 * src/location.h: Document this.
777 2008-11-07 Akim Demaille <demaille@gostai.com>
780 * src/getargs.c (usage): Fix help string for -W.
782 2008-11-07 Akim Demaille <demaille@gostai.com>
784 Handle more general types of option arguments.
785 * build-aux/cross-options.pl: The argument ends at the first
786 space, not the first non-symbol character.
787 Use @var for each word appearing the argument description.
789 2008-11-07 Akim Demaille <demaille@gostai.com>
791 Destroy the variants that remain on the stack in case of error.
792 * data/lalr1-fusion.cc (yydestruct_): Invoke the variant's
794 Display the value only if yymsg is nonnull.
795 (yyreduce): Invoke yydestruct_ when popping lhs symbols.
797 2008-11-07 Akim Demaille <demaille@gostai.com>
799 Add "%define assert" to variants.
800 This is used to help the user catch cases where some value gets
801 ovewritten by a new one. This should not happen, as this will
804 Unfortunately this uncovered a bug in the C++ parser itself: the
805 lookahead value was not destroyed between two calls to yylex. For
806 instance if the previous lookahead was a std::string, and then an int,
807 then the value of the std::string was correctly taken (i.e., the
808 lookahead was now an empty string), but std::string structure itself
811 This is now done in variant::build(other&) (which is used to take the
812 value of the lookahead): other is not only stolen from its value, it
813 is also destroyed. This incurs a new performance penalty of a few
814 percent, and union becomes faster again.
816 * data/lalr1-fusion.cc (variant::build(other&)): Destroy other.
817 (b4_variant_if): New.
818 (variant::built): New.
819 Use it whereever the status of the variant changes.
820 * etc/bench.pl.in: Check the penalty of %define assert.
822 2008-11-07 Akim Demaille <demaille@gostai.com>
824 Use "%define variant" in bench.pl.
825 * etc/bench.pl.in: No longer use the pseudo directive %variants,
826 just use %define variants.
828 2008-11-07 Akim Demaille <demaille@gostai.com>
831 * src/parse-gram.h, src/parse-gram.c: Regen.
833 2008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
835 Fix user actions without a trailing semicolon.
836 Reported by Sergei Steshenko at
837 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
838 * THANKS (Sergei Steshenko): Add.
839 * src/scan-code.l (SC_RULE_ACTION): Fix it.
840 * tests/regression.at (Fix user actions without a trailing semicolon):
843 2008-11-04 Akim Demaille <demaille@gostai.com>
845 Use b4_copyright_years.
846 * data/yacc.c (b4_copyright_years): New.
847 Fix its value according to the comments in the file.
848 Use it and undefine it.
850 2008-11-04 Akim Demaille <demaille@gostai.com>
853 * data/lalr1-fusion.cc, src/parse-gram.y: here.
855 2008-11-04 Akim Demaille <demaille@gostai.com>
858 * data/lalr1-fusion.cc: here.
860 2008-11-04 Akim Demaille <demaille@gostai.com>
862 Use strict on bench.pl.
863 * etc/bench.pl.in (&run, &generate_grammar): New.
864 Rename the grammar generating functions for consistency.
865 Change the interface so that the list of benches to run is passed
866 as (optionless) arguments.
867 (&compile): Use &run.
869 2008-11-04 Akim Demaille <demaille@gostai.com>
871 Remove spurious initial empty lines.
872 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
873 * data/yacc.c: End the @output lines with an @.
875 2008-11-04 Akim Demaille <demaille@gostai.com>
877 Improve the display of sizes.
878 * etc/bench.p.in: Higher precision.
879 Sort by decreasing size.
881 2008-11-04 Akim Demaille <demaille@gostai.com>
883 Don't memcpy C++ structures.
884 * data/lalr1-fusion.cc (b4_symbol_variant): Adjust additional
886 (variant::build): New overload for
887 copy-construction-that-destroys.
888 (variant::swap): New.
889 (parser::yypush_): Use it in variant mode.
891 2008-11-04 Akim Demaille <demaille@gostai.com>
893 Better defaults for bench.pl.
894 * etc/bench.pl.in ($verbose, $cflags, $iterations): Change the
896 Adjust &verbose uses.
899 2008-11-04 Akim Demaille <demaille@gostai.com>
901 Make variant.yy more complex.
902 std::list cannot be copied via memcpy, they are more demanding than
903 std::string. Use one std::list to strengthen the test.
905 * examples/variant.yy: Use lalr1-fusion.cc, not lalr1.cc.
907 Create a list of strings, instead of a single large string.
909 2008-11-04 Akim Demaille <demaille@gostai.com>
912 * etc/bench.pl.in (--bench, $bench): New.
914 2008-11-04 Akim Demaille <demaille@gostai.com>
917 * data/lalr1-fusion.cc (destroy): Use as() in its definition.
918 Define it after as().
920 2008-11-04 Akim Demaille <demaille@gostai.com>
923 * data/lalr1-fusion.cc (b4_rhs_location): Remove useless parens.
925 2008-11-04 Akim Demaille <demaille@gostai.com>
927 Issue missing synclines after user actions.
928 * data/c.m4 (b4_case): Issue synclines on the output file.
930 2008-11-04 Akim Demaille <demaille@gostai.com>
932 Remove trailing empty line.
933 * data/lalr1-fusion.cc: Don't add an empty line after the user's
936 2008-11-04 Akim Demaille <demaille@gostai.com>
938 Fix output of copyright years.
939 * data/bison.m4 (b4_copyright): Fix the indentation of the
940 copyright year paragraph.
941 Use b4_copyright_years when no years are given.
942 * data/lalr1.cc, data/lalr1-fusion.cc, data/location.cc
943 (b4_copyright_years): New.
946 2008-11-04 Akim Demaille <demaille@gostai.com>
948 Avoid the spurious initial empty line.
949 * data/lalr1-fusion.cc, data/location.cc: Put a trailing "@" at
950 the end of @output request to suppress the empty line that
953 2008-11-04 Akim Demaille <demaille@gostai.com>
955 Remove parser::rhs_number_type.
956 * data/lalr1-fusion.cc (rhs_number_type): No longer define it.
957 (yyrhs_): Use b4_table_define.
959 2008-11-04 Akim Demaille <demaille@gostai.com>
962 * data/lalr1-fusion.cc: Use an int to iterate up to an int.
964 2008-11-04 Akim Demaille <demaille@gostai.com>
966 Factor the declaration of the integer tables.
967 * data/lalr1-fusion.cc (b4_table_define): New.
970 2008-11-03 Akim Demaille <demaille@gostai.com>
972 Fix indentation of tables in lalr1.cc
973 * data/lalr1-fusion.cc: Fix the indentation.
975 2008-11-03 Akim Demaille <demaille@gostai.com>
977 Destroy the lhs symbols after reduction.
978 * data/lalr1-fusion.cc (parse): After the user action, when in
979 variant mode, destroy the lhs symbols.
981 2008-11-03 Akim Demaille <demaille@gostai.com>
983 Simplify yysyntax_error_ use.
984 * data/lalr1-fusion.cc (yysyntax_error_): Always pass it the token
985 type, but make it unnamed in the declaration when it is not used.
987 2008-11-03 Akim Demaille <demaille@gostai.com>
989 Let yy::variant::build return an lvalue.
990 * data/lalr1-fusion.cc (variant::build): Return a reference to the
993 2008-11-03 Akim Demaille <demaille@gostai.com>
995 Define yy::variant only when needed.
996 * data/lalr1-fusion.cc (yy::variant): Define only if variants are
999 2008-11-03 Akim Demaille <demaille@gostai.com>
1001 Bench the three-stack lalr1.cc.
1002 * etc/bench.pl.in: Bench the three-stack lalr1.cc vs. the
1005 2008-11-03 Akim Demaille <demaille@gostai.com>
1007 Fail on parse error in calc++.
1008 * doc/bison.texinfo (calc++.cc): Propagate failures to the exit
1010 * examples/calc++/test ($me, $number, $exit, run): New.
1011 Use them to propagate errors to the exit status.
1013 2008-11-03 Akim Demaille <demaille@gostai.com>
1015 Don't specify the skeleton twice in the example.
1016 * examples/calc++/Makefile.am: Don't pass -S to Bison, the grammar
1017 file does what is needed.
1019 2008-11-03 Akim Demaille <demaille@gostai.com>
1021 bench: Improve output.
1022 * etc/bench.pl.in (bench_grammar): Tune the printf format.
1024 2008-11-03 Akim Demaille <demaille@gostai.com>
1026 bench: check impact of %debug on variants.
1027 * etc/bench.pl.in (variant_grammar): Fix the computation of
1029 Generate a grammar file that can work with or without %debug.
1030 Do use the @directive.
1031 (bench_variant_parser): Check impact of %debug.
1032 (@directives): Rename all the occurrences to...
1033 (@directive): this, for consistency.
1035 2008-11-03 Akim Demaille <demaille@gostai.com>
1037 bench: report the size too.
1038 * etc/bench.pl.in ($iterations): Defaults to -3.
1039 (&bench_grammar): Require hireswallclock.
1040 Compute and display the size of the result.
1043 2008-11-03 Akim Demaille <demaille@gostai.com>
1045 bench: More use of the verbosity level.
1046 * etc/bench.pl.in ($verbose, &verbose): New.
1048 More POD documentation.
1050 2008-11-03 Akim Demaille <demaille@gostai.com>
1052 bench.pl: a command line interface
1053 * etc/bench.pl.in: More doc.
1054 Some fixes in the documentation.
1055 ($cflags, $iterations, &help, &getopt): New.
1057 (&variant_grammar): Let the number of stages be 10 times what is
1060 2008-11-03 Akim Demaille <demaille@gostai.com>
1062 Bench the use of Boost.Variants.
1063 * etc/bench.pl.in ($cxx, &variant_grammar, &bench_variant_parser):
1065 (&compile): Be ready to compile C++ parsers.
1066 (&bench_push_parser): Move debug information to the outermost
1068 * THANKS: Add Michiel De Wilde.
1070 2008-11-03 Akim Demaille <demaille@gostai.com>
1072 bench.pl: Pass directives as a list instead of as a string.
1073 * etc/bench.pl.in (&directives): New.
1074 (&triangular_grammar, &calc_grammar): Use it to format the Bison
1076 (&triangular_grammar): Do use the directives (were ignored).
1077 (&bench_grammar, &bench_push_parser): Adjust to pass lists of
1080 2008-11-03 Akim Demaille <demaille@gostai.com>
1082 Improve genericity of bench.pl.
1083 * etc/bench.pl.in (&bench_grammar): Take the set of benches as
1085 (&bench_push_parser): New.
1088 2008-11-03 Akim Demaille <demaille@gostai.com>
1090 Add documentation to bench.pl.
1091 * etc/bench.pl.in: Comment changes.
1093 2008-11-03 Akim Demaille <demaille@gostai.com>
1095 Fuse the three stacks into a single one.
1096 In order to make it easy to perform benchmarks to ensure that there are no
1097 performance loss, lalr1.cc is forked into lalr1-fusion.cc. Eventually,
1098 lalr1-fusion.cc will replace lalr1.cc.
1100 Meanwhile, to make sure that lalr1-fusion.cc is correctly exercized by the
1101 test suite, the user must install a symbolic link from lalr1.cc to it.
1103 Instead of having three stacks (state, value, location), use a stack
1104 of triples. This considerably simplifies the code (and it will be
1105 easier not to require locations as currently does the C++ parser),
1106 and also gives a 10% speedup according to etc/bench (probably mainly since
1107 memory allocation is done once instead of three times).
1109 Another motivation is to make it easier to destruct properly
1110 semantic values: now that they are bound to their state (hence
1111 symbol type) it will be easier to call the appropriate destructor.
1113 These changes should probably benefit the C parser too.
1115 * data/lalr1.cc: Copy as... * data/lalr1-fusion.cc: this new
1117 (b4_rhs_value, b4_rhs_location): New definitions overriding those
1119 (state_stack_type, semantic_stack_type, location_stack_type)
1120 (yystate_stack_, yysemantic_stack_, yylocation_stack_): Remove.
1121 (data_type, stack_type, yystack_): New.
1122 (YYLLOC_DEFAULT, yypush_): Adjust.
1123 (yyerror_range): Now based on data_type, not location_type.
1125 2008-11-03 Akim Demaille <demaille@gostai.com>
1127 Push the state, value, and location at the same time.
1128 This is needed to prepare a forthcoming patch that fuses the three
1131 * data/lalr1.cc (parser::yypush_): New.
1132 (parser::yynewstate): Change the semantics: instead of arriving to
1133 this label when value and location have been pushed, but yystate
1134 is to be pushed on the state stack, now the three of them must
1135 have been pushed before. yystate still must be the new state.
1136 This allows to use yypush_ everywhere instead of individual
1137 handling of the stacks.
1139 2008-11-03 Akim Demaille <demaille@gostai.com>
1141 Prefer references to pointers.
1142 * data/lalr1.cc (b4_symbol_actions): New, overrides the default C
1143 definition to use references instead of pointers.
1144 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_):
1145 Take the value and location as references.
1148 2008-11-03 Akim Demaille <demaille@gostai.com>
1150 stack::size instead of stack::height.
1151 * data/lalr1.cc (stack::height): Rename as...
1152 (stack::size): this.
1153 Fix the output type.
1156 2008-11-03 Akim Demaille <demaille@gostai.com>
1158 Use variants to support objects as semantic values.
1159 This patch was inspired by work by Michiel De Wilde. But he used Boost
1160 variants which (i) requires Boost on the user side, (ii) is slow, and
1161 (iii) has useless overhead (the parser knows the type of the semantic value
1162 there is no reason to duplicate this information as Boost.Variants do).
1164 This implementation reserves a buffer large enough to store the largest
1165 objects. yy::variant implements this buffer. It was implemented with
1168 * src/output.c (type_names_output): New.
1169 (output_skeleton): Invoke it.
1170 * data/c++.m4 (b4_variant_if): New.
1171 (b4_symbol_value): If needed, provide a definition for variants.
1172 * data/lalr1.cc (b4_symbol_value, b4_symbol_action_)
1173 (b4_symbol_variant, _b4_char_sizeof_counter, _b4_char_sizeof_dummy)
1174 (b4_char_sizeof, yy::variant): New.
1175 (parser::parse): If variants are requested, define
1176 parser::union_type, parser::variant, change the definition of
1177 semantic_type, construct $$ before running the user action instead
1178 of performing a default $$ = $1.
1179 * examples/variant.yy: New.
1180 Based on an example by Michiel De Wilde.
1182 2008-11-03 Akim Demaille <demaille@gostai.com>
1184 Parameterize the extraction of semantic values.
1185 To make future changes easier, no longer rely on ".TYPE" being the
1186 way to get a semantic value.
1188 * data/c.m4 (b4_symbol_value): New.
1190 * data/c++.m4, data/yacc.c: Use it.
1191 * data/glr.c: Use b4_symbol_value.
1195 2008-11-03 Akim Demaille <demaille@gostai.com>
1197 Prepare easier M4 changes.
1198 * data/lalr1.cc: Use escaped [] instead of literals to prepare
1201 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1203 Initiate further development.
1204 * NEWS: Create an empty section for new entries.
1205 * gnulib: Update submodule to HEAD.
1207 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1209 * NEWS: Version 2.4.
1211 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1213 Prepare for next release.
1214 * NEWS: Briefly mention changes since 2.3b.
1215 * README: Say GNU m4 1.4.6, which we've been requiring in release
1216 announcements already, not 1.4.3, which breaks the build.
1218 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1220 Say %language is experimental.
1221 We're thinking of extending it's effect on output file naming. See the
1223 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
1224 * NEWS: Say it's experimental.
1225 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
1226 recommend it over %skeleton for now.
1227 (Bison Options): Likewise.
1228 (C++ Bison Interface): Use %skeleton not %language.
1229 (Calc++ Parser): Use %skeleton not %language.
1230 * src/getargs.c (usage): Say it's experimental.
1232 2008-11-01 Di-an Jan <dianj@freeshell.org>
1233 Paolo Bonzini <bonzini@gnu.org>
1235 Support all Java parser class modifiers.
1236 * data/java.m4 (b4_percent_define_get3): New.
1237 (b4_final_if, b4_strictfp_if): New.
1238 * data/lalr1.java (final, strictfp, extends, implements): Support.
1239 * doc/bison.texinfo (final, strictfp, extends, implements): Add
1241 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
1242 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
1243 (AT_CHECK_JAVA_GREP): New.
1244 (Java parser class modifiers): New test.
1245 (Java parser class extends and implements): New test.
1247 Model exception propagation better with throws and lex_throws.
1248 * data/java.m4 (b4_list2): New.
1249 (throws): Change default.
1250 * data/lalr1.java (yyaction): Add throws.
1251 (parse): Add lex_throws in addition to throws.
1252 * doc/bison.texinfo (throws, lex_throws): Add documentation.
1253 * tests/java.at (Java throws specifications): New test.
1255 Improve documentation for Java parsers.
1256 * doc/bison.texinfo (Java Parsers): Add subsections.
1257 Don't quote first argument of %define.
1258 (Java Bison Interface): Document output files. Move documentation
1259 of parser class and merge into Java Parser Interface. Document
1260 features that error out. Document directives with no effect.
1261 Move note about Javadoc higher.
1262 (Java Semantic Values): Explicitly mention stype.
1263 Document that generic types cannot be used.
1264 (Java Location Values): Use @deftypeivar. Document constructors.
1265 Correct return value for toString.
1266 (Java Parser Interface): List undocumented constants/fields.
1267 Move documentation of fields added by %parse-param closer to list
1268 of members. Document that token names are added as fields.
1269 Document constructors accurately. Remove error method.
1270 (Java Scanner Interface): Move note on %pure-parser to Java Bison
1271 Interface. Describe %code lexer and yylex accutately.
1272 Remove documentation that does not match the code.
1273 (Java Action Features): New.
1274 (Java Differences): Add reference. Add item on semantic values.
1275 Add note about @{ ... @}. Clarify %% epilogue placement.
1276 (Java Declarations Summary): New.
1279 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
1280 (b4_remove_comma): Quote test argument.
1281 (b4_identification): Remove "bison" field.
1282 * tests/java.at (Java parser class and package names): New test.
1283 (Java %parse-param and %lex-param): New test.
1284 (Java stype, position_class and location_class): New test.
1286 2008-10-31 Di-an Jan <dianj@freeshell.org>
1288 * data/lalr1.jave: Update copyright years.
1289 (YYParser): Correct name of "generated from" file in Javadoc:
1290 use b4_file_name instead of @ofile@.
1291 (Location constructor): Correct Javadoc parameter name.
1292 (yylloc): Add missing opening m4 quote after b4_location_if.
1293 This removes a stray [ in the Javadoc of Lexer.getStartPos.
1294 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
1295 (YYParser constructor): Correct Javadoc parameter name.
1297 2008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
1299 Always put auxiliary code files in the same dir as other output files.
1300 * src/files.c (compute_file_name_parts): When the user specifies
1301 --output but not --file-prefix, extract the directory prefix from the
1302 file prefix not from the grammar file name. This affects the location
1303 of files like location.hh generated by the C++ skeleton. The includes
1304 in the other output files require this fix.
1305 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
1306 for expected output files.
1307 (Output files): Add a test for the above.
1309 2008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
1311 * gnulib: Update submodule to HEAD.
1313 2008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
1315 Update copyright year.
1316 * src/files.c: Here.
1318 2008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
1320 Don't overwrite the input file.
1321 * src/files.c (output_file_name_check): Fatal error if using input file
1323 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
1325 (Conflicting output files): Add test.
1327 2008-10-28 Akim Demaille <demaille@gostai.com>
1330 * data/lalr1.cc: Formatting changes.
1332 2008-10-28 Akim Demaille <demaille@gostai.com>
1334 Don't define debugging functions when !YYDEBUG.
1335 * data/lalr1.cc (debug_stream, set_debug_stream)
1336 (debug_level_type, debug_level, set_debug_level): Don't
1337 declare them when YYDEBUG is not defined.
1338 The implementation are already YYDEBUG-aware.
1340 2008-10-28 Akim Demaille <demaille@gostai.com>
1342 Prefer "continue" for empty loop bodies.
1343 * etc/bench.pl.in: Use "continue" instead of {}.
1345 2008-10-28 Akim Demaille <demaille@gostai.com>
1347 Space and comments changes.
1348 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
1349 * data/c.m4, data/lalr1.cc: Space changes.
1351 2008-10-28 Akim Demaille <demaille@gostai.com>
1353 Make gnulib a submodule.
1355 * .gitmodules (gnulib): New.
1357 2008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
1359 Fix yyerror_range for user-defined location type in C++. Reported by
1361 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
1362 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
1363 * THANKS (Georg Sauthoff): Add.
1365 2008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
1367 Update several administrative files mainly to facilitate releasing.
1368 * HACKING (Administrivia): Make the git-merge-changelog notes more
1370 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
1371 (Release Procedure): Update for git and add numerous details that were
1373 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
1374 * maint.mk (announcement): Don't list bison as a bootstrap tool so
1375 that announcements don't claim we bootstrapped with whatever bison
1376 happened to be in PATH. Add flex as a bootstrap tool.
1377 * Makefile.maint: Remove, previously replaced by maint.mk.
1378 * Makefile.cfg: Remove, and migrate settings to...
1379 * cfg.mk: ... here for the sake of `make announcement'.
1380 * bootstrap.conf (gnulib_modules): Add announce-gen.
1381 * README: Say GNU Bison instead of just Bison. Suggested by Karl
1384 2008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
1386 Small but important bugfixes for the Java skeleton.
1387 * data/lalr1.java (yyerror): Change Location to b4_location_type.
1388 (yy_symbol_print): Call toString on yyvaluep.
1390 2008-08-29 Akim Demaille <demaille@gostai.com>
1392 Clarify UPDATED use.
1393 * doc/bison.texinfo: It refers to the last edition of this file,
1394 not to the release date of Bison.
1395 Reported by Joel E. Denny.
1397 2008-08-29 Akim Demaille <demaille@gostai.com>
1399 * README: Update FAQ pointer.
1400 Reported by Joel E. Denny.
1402 2008-08-27 Eric Blake <ebb9@byu.net>
1404 Resync m4sugar from autoconf.
1405 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
1406 (m4_init): Adjust to latest m4.git changes.
1407 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
1409 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
1410 (_m4_list_cmp): Reduce side effects.
1412 2008-08-27 Akim Demaille <demaille@gostai.com>
1414 Check yyerrok in calc.at.
1415 * tests/calc.at (calc.y): Use yyerrok on "( error )".
1416 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
1419 2008-08-27 Akim Demaille <demaille@gostai.com>
1421 Support yyerrok in lalr1.cc.
1422 YYBACKUP is still to import back into lalr1.cc.
1423 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
1425 2008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
1427 For maintainer-check*, don't recompile for a $(VERSION) update.
1429 (_is-dist-target): Override the one in GNUmakefile.
1430 * Makefile.am (EXTRA_DIST): Add cfg.mk.
1432 2008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
1434 Update for recent change to gnulib.
1435 * src/parse-gram.y: Don't include strverscmp.h. It comes from
1438 2008-08-15 Eric Blake <ebb9@byu.net>
1440 Remaining m4sugar merge from autoconf.
1441 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
1442 * data/m4sugar/foreach.m4: New file, copied from autoconf.
1443 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
1444 * src/output.c (output_skeleton): Tell m4 how to find it.
1446 Partial m4sugar merge from autoconf: m4_map.
1447 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
1448 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
1449 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
1450 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
1452 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
1454 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
1457 2008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
1459 Keep .version and PACKAGE_VERSION in sync.
1460 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
1461 dependency, and add comments justifying this in more detail. Discussed
1463 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
1465 2008-08-06 Eric Blake <ebb9@byu.net>
1467 Partial m4sugar merge from autoconf: m4_shiftn.
1468 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
1469 (m4_shift2, m4_shift3): New macros.
1470 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
1471 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
1472 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
1473 * data/java.m4 (b4_remove_comma): Likewise.
1475 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
1476 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
1477 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
1478 (m4_init): Consolidate wrapped text into single m4_wrap.
1479 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
1482 2008-08-05 Eric Blake <ebb9@byu.net>
1484 Partial m4sugar merge from autoconf: builtins, version.m4.
1485 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
1486 (m4_prepend): Remove, as it is unused and inherently quadratic,
1487 whereas m4_append is linear in newer m4.
1488 (m4_mkstemp): New builtin.
1489 (m4_symbols): Make rename conditional.
1490 (m4_version_prereq): Ensure fatal error if used in bison, which
1491 intentionally lacks version.m4.
1493 Fix comments in m4sugar.
1494 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
1496 2008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
1498 Update for recent .gitignore fix in Gnulib.
1499 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
1500 anchored .gitignore entries.
1502 2008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
1504 Set gnu or gnits strictness.
1505 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
1506 development and gnits strictness for releases. Based on Eric Blake's
1508 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
1510 2008-07-31 Paolo Bonzini <bonzini@gnu.org>
1512 * NEWS: Clarify documentation of %language.
1514 2008-07-31 Paolo Bonzini <bonzini@gnu.org>
1516 Support usage of git-merge-changelog.
1517 * .gitattributes: New.
1518 * HACKING: Document usage of git-merge-changelog.
1519 * bootstrap: Install git-merge-changelog entries in .git/config
1522 2008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
1524 Remove remaining dependence on CVS Id keyword.
1525 * ChangeLog: For the sake of people still using CVS, don't use dollars
1527 * data/xslt/bison.xsl: Remove Id from header comments, where it was
1529 * data/xslt/xml2dot.xsl: Likewise.
1530 * data/xslt/xml2text.xsl: Likewise.
1531 * data/xslt/xml2xhtml.xsl: Likewise.
1532 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
1533 * doc/Makefile.am (neutralize): Remove, no longer needed.
1534 (.x.1): Don't use neutralize.
1535 (edit): Don't substitute for ID.
1536 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
1538 2008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
1540 Fix dependence on computed configure variables.
1541 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
1542 $(top_srcdir)/configure.ac so that changes to computed variables, such
1543 as PACKAGE_VERSION, are seen.
1544 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
1546 2008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
1548 Update copyright dates for recent changes.
1549 * Makefile.am: Here.
1550 * src/Makefile.am: Here.
1551 * src/reduce.c: Here.
1552 * tests/reduce.at: Here.
1554 2008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
1556 Use git-version-gen for version names between releases.
1557 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
1558 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
1559 * .prev-version: New.
1560 * .version.in: Remove.
1561 * ChangeLog: Remove the Id previously used for capturing the CVS
1563 * GNUmakefile: Remove, now copied from Gnulib.
1564 * Makefile.am: Add code suggested by comments in
1565 build-aux/git-version-gen.
1566 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
1567 .prev-version, and .version.
1568 * NEWS (2.3b+): Rename to...
1569 (?.?): ... this because we're dropping the "+" version naming scheme,
1570 but, in general, we still can't be sure of our next release name.
1571 * bootstrap: Add a quick hack to remove from .gitignore the
1572 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
1573 entry. This should really be fixed in gnulib instead.
1574 * bootstrap.conf (gnulib_modules): Add gnumakefile.
1575 * configure.ac (AC_INIT): Set version name by invoking
1576 build-aux/git-version-gen.
1577 (AC_CONFIG_FILES): Remove .version, now generated by
1578 build-aux/git-version-gen.
1579 * maint.mk: New, copied from coreutils.
1580 * doc/.cvsignore (bison.1): Add.
1581 * doc/.gitignore (/bison.1): Add.
1582 * doc/bison.1: Remove, generated.
1583 * src/.cvsignore (revision.c): Remove.
1584 * src/.gitignore (/revision.c): Remove.
1585 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
1586 (BUILT_SOURCES): Remove revision.c.
1587 (revision.c): Remove.
1588 * src/getargs.c (version): Don't print revision after the VERSION.
1589 * src/revision.h: Remove.
1591 2008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
1593 Fix untranslatable composition of sentences. Reported by Goran
1595 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
1596 * THANKS (Goran Uddeborg): Add.
1597 * src/reduce.c (reduce_print): Report the number of nonterminals and
1598 rules useless in the grammar in separate sentences.
1599 * tests/reduce.at (Useless Rules): Update output.
1600 (Reduced Automaton): Likewise.
1601 (Underivable Rules): Likewise.
1602 (Empty Language): Likewise.
1604 2008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
1606 Fix some .gitignore and .cvsignore problems.
1607 * bootstrap (insert_sorted_if_absent): Replace all uses with...
1608 (insert_vc_ignore): ... this new function, which prepends `/' to all
1609 .gitignore entries before passing them to insert_sorted_if_absent.
1610 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
1611 .cvsignore files are maintained even though Bison developers run
1612 bootstrap while using Git.
1613 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
1616 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
1617 unneeded. Reported by Eric Blake.
1618 * lib/.gitignore (/*~): Add.
1619 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
1620 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
1622 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
1624 2008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
1626 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
1627 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
1628 * bootstrap.conf (gnulib_modules): Add unsetenv.
1629 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
1630 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
1632 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
1633 the first argument because it may become position-dependent, and unset
1634 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
1635 Add comments explaining these issues in more detail.
1637 2008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
1639 Add .gitignore everywhere based on .cvsignore.
1641 * build-aux/.gitignore: New.
1642 * data/.gitignore: New.
1643 * doc/.gitignore: New.
1644 * etc/.gitignore: New.
1645 * examples/.gitignore: New.
1646 * examples/calc++/.gitignore: New.
1647 * lib/.gitignore: New.
1648 * m4/.gitignore: New.
1649 * po/.gitignore: New.
1650 * runtime-po/.gitignore: New.
1651 * src/.gitignore: New.
1652 * tests/.gitignore: New.
1654 2008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
1656 * NEWS (2.3b+): New section, empty for now.
1657 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
1659 2008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
1661 * NEWS (2.3b): Update release date since there has been a delay in
1662 getting the announcements and tarballs out.
1664 2008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
1666 * NEWS: Version 2.3b.
1667 * configure.ac (AC_INIT): Likewise.
1668 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
1670 2008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
1672 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
1673 been doing it for years.
1674 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
1675 (Release Procedure): Add FIXME about make alpha being unmaintained.
1677 2008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
1679 * data/yacc.c: Reformat m4 a little for readability.
1680 * src/lalr.c (build_relations): Correct comment.
1682 2008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1684 DJGPP specific issue.
1685 * djgpp/config.sed: Fixes required to run configure scripts generated
1688 2008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
1690 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
1691 coordinator@translationproject.org.
1693 2008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
1695 * THANKS: Add Eric Blake.
1697 2008-04-23 Eric Blake <ebb9@byu.net>
1699 Revert prior patch, by working around autoconf regression.
1700 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
1701 ("Output file name: ("): Uncomment test.
1702 ("Output file name: )"): Likewise.
1703 Based on an idea from Noah Misch.
1705 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1707 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
1708 2.61. Reported by Juan Manuel Guerrero at
1709 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
1710 * tests/output.at ("Output file name: ("): Comment out test case for
1712 ("Output file name: )"): Likewise.
1714 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1716 * GNUmakefile: Update git-version-gen invocation so make dist
1719 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1721 Update to the current gnulib CVS repository, and fix trigraph handling
1723 * bootstrap: Update gnulib CVS repository URL.
1724 (symlink_to_dir): Encapsulate the code that guarantees the destination
1725 directory exists into...
1726 (check_dst_dir): ... this new function, and...
1727 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
1728 fail when copying files into lib/uniwidth/.
1729 * src/output.c (prepare_symbols): When writing yytname muscles, where
1730 symbol names will be encoded in C-string literals, tell quotearg to
1731 escape trigraphs. This used to be the default in gnulib.
1732 * tests/regression.at (Token definitions): Because of the change in
1733 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
1734 escapes trigraphs in symbol names. Thus, yytname no longer has
1735 trigraphs unnecessarily doubly escaped. Update test case output.
1736 Extend test case to be sure Bison's own error messages will no longer
1737 have trigraphs in symbol names unnecessarily escaped once.
1739 2008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
1741 Fix make dist infinite loop reported by Juan Manuel Guerrero at
1742 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
1743 * .cvsignore: Add .version.
1745 * bootstrap.conf (gnulib_modules): Add git-version-gen.
1746 * configure.ac (AC_CONFIG_FILES): Add .version.
1747 * build-aux/.cvsignore: Add git-version-gen.
1749 2008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
1751 * NEWS (2.3a+): Mention that -g now takes an argument.
1752 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
1753 consistency. Update the -g and -x entries now that they take
1754 arguments. Use brackets to indicate optional arguments.
1755 * src/getargs.c (usage): Explain the relationship between arguments of
1756 long and short options more completely. Document --defines and -d
1757 separately since the former takes an argument but, for POSIX Yacc, the
1759 (short_options): Let -W take an optional argument like --warnings.
1760 (getargs): Sort cases.
1762 2008-02-28 Akim Demaille <demaille@gostai.com>
1764 * doc/bison.texinfo: Fix a few typos.
1766 2008-02-28 Akim Demaille <akim@epita.fr>
1768 * doc/bison.texinfo (Bison Options): Document -W.
1769 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
1771 2008-02-28 Akim Demaille <akim@epita.fr>
1773 * src/getargs.c (short_options): Split and sort for readability.
1774 -g and -x take optional arguments, just like their long options.
1775 * build-aux/cross-options.pl: Use /x to make the regexp easier to
1777 Fix the handling of $opt which resulted in all the argument to be
1778 considered as optional.
1780 2008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
1782 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
1783 say its interface is experimental.
1784 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
1786 (Bison Options): In the -L and --language entry, mention Java.
1787 (Java Bison Interface): Say the interface is experimental.
1788 * src/getargs.c (usage): Mention -L and --language.
1790 * NEWS (2.3a+): Say the push parsing interface is experimental.
1791 * doc/bison.texinfo (Push Decl): Likewise.
1792 (Decl Summary): Likewise in the "%define api.push_pull" entry.
1793 (Push Parser Function): Likewise.
1794 (Pull Parser Function): Likewise.
1795 (Parser Create Function): Likewise.
1796 (Parser Delete Function): Likewise.
1797 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
1798 yypull_parse, and yypush_parse entries.
1800 * NEWS (2.3a+): Mention XML support, and say the schema is
1802 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
1803 * src/getargs.c (usage): Say the XML schema is experimental.
1805 * NEWS (2.3a+): Say option instead of flag.
1807 2008-02-21 Wojciech Polak <polak@gnu.org>
1809 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
1812 2008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
1814 Fix impure push parser compile error reported by Bob Rossi at
1815 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
1816 * data/yacc.c: Clean up whitespace in the output a little.
1817 (yypstate_allocated): Define for impure push parsers regardless of
1818 whether the pull interface is also requested.
1819 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
1820 check impure push parsers without the pull interface.
1822 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
1823 yyerror takes arguments specified by %parse-param while yypstate_new
1825 * doc/bison.texinfo (Parser Create Function): Document that
1826 yypstate_new returns 0 for multiple impure parser instances.
1827 * tests/push.at (Push Parsing: Multiple impure instances): Update
1828 expected stderr output.
1830 2008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
1832 * runtime-po/POTFILES.in (push.c): Remove.
1834 2008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
1836 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
1837 * data/push.c: Rename to...
1838 * data/yacc.c: ... this, overwriting it.
1839 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
1840 `%push-pull-parser' -> `%define api.push_pull "both"'.
1841 Remove old yacc.c tests, and update push.c tests to yacc.c.
1843 2008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
1845 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
1846 `"%code top" blocks' instead of `%code "top" blocks'.
1847 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
1848 Clean up whitespace in the output a little.
1850 2008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
1852 Fix documentation problems reported by Tim Josling at
1853 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
1854 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
1855 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
1856 integers. Explain the effect of literal string aliases on error
1857 messages. Copy token 0 documentation from the C++ skeleton
1860 2008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
1862 Accept a token number in a %left, %right, or %nonassoc for POSIX
1863 conformance. Reported by Tim Josling at
1864 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
1865 * NEWS (2.3a+): Mention.
1866 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
1867 and code numbers are treated by precedence declarations.
1868 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
1870 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
1872 (symbol.prec): New, just like symbol but allows INT.
1873 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
1875 * tests/regression.at (Token number in precedence declaration): New
1878 2008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1880 DJGPP specific issues.
1881 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
1882 be changed. Copyright timestamp adjusted.
1883 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
1884 be changed. Copyright timestamp adjusted.
1885 * djgpp/config.site: Copyright timestamp adjusted.
1886 * djgpp/config_h.sed: Copyright timestamp adjusted.
1887 * djgpp/djunpack.bat: Copyright timestamp adjusted.
1888 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
1889 filename translation list.
1890 * djgpp/subpipe.c (init_subpipe): Check the environment variables
1891 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
1892 files shall be created. Before trying to use the temp dir where the
1893 environment variable points to check that the dir really exists. If
1894 not default to the cwd as temp dir. Copyright timestamp adjusted.
1895 * djgpp/subpipe.h: Copyright timestamp adjusted.
1896 * djgpp/testsuite.sed: Copyright timestamp adjusted.
1898 2008-01-30 Paul Eggert <eggert@cs.ucla.edu>
1900 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
1902 2008-01-09 Paul Eggert <eggert@cs.ucla.edu>
1904 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
1905 Problem reported by Claudio Saavedra in
1906 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
1908 2008-01-05 Wojciech Polak <polak@gnu.org>
1910 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
1911 document's title with the input grammar file name.
1913 2007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
1915 Automate regression testing of the XML/XSLT implementation. Discussed
1917 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
1918 * configure.ac (XSLTPROC): New substitution.
1919 * Makefile.am (maintainer-xml-check): New phony target invoking...
1920 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
1921 invoking make maintainer-check with BISON_TEST_XML=1.
1922 * tests/atlocal.in (XSLTPROC): New.
1923 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
1924 not to report reachable memory when Bison is expected to have a
1925 non-zero exit status and (2) to compare XML/XSLT output with --graph
1926 and --report=all output for every working grammar when
1928 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
1929 (AT_BISON_CHECK_XML): New.
1930 (AT_QUELL_VALGRIND): New.
1931 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
1932 (AT_CHECK): ... don't redefine this since this was the old way to
1934 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
1935 AT_BISON_CHECK invocations.
1936 * tests/c++.at: Likewise.
1937 * tests/calc.at: Likewise.
1938 * tests/conflicts.at: Likewise.
1939 * tests/cxx-type.at: Likewise.
1940 * tests/existing.at: Likewise.
1941 * tests/glr-regression.at: Likewise.
1942 * tests/headers.at: Likewise.
1943 * tests/input.at: Likewise.
1944 * tests/java.at: Likewise.
1945 * tests/output.at: Likewise.
1946 * tests/push.at: Likewise.
1947 * tests/reduce.at: Likewise.
1948 * tests/regression.at: Likewise.
1949 * tests/sets.at: Likewise.
1950 * tests/skeletons.at: Likewise.
1951 * tests/synclines.at: Likewise.
1952 * tests/torture.at: Likewise.
1953 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
1954 tends to hang xsltproc.
1955 (Big horizontal): Likewise.
1957 2007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
1959 In XML output, remove redundant class attribute on symbol element.
1960 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
1961 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
1962 look up a symbol to determine whether it's a nonterminal or terminal.
1963 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
1964 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
1966 Add prec/assoc information to XML output.
1967 * src/gram.c (grammar_rules_print_xml): For each rule that has a
1968 %prec, add a percent_prec attribute.
1969 * src/print-xml.c (print_grammar): For each terminal that has a
1970 precedence or associativity, add a prec or assoc attribute.
1972 (xml_puts): Use xml_indent.
1973 (xml_printf): Use xml_indent.
1974 * src/print-xml.h (xml_indent): Prototype.
1976 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
1977 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
1979 2007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
1981 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
1982 (bison:ruleByNumber): ... this for clarity.
1983 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
1984 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
1985 (xsl:template match="reduction"): Update.
1986 (xsl:template match="item"): Update.
1987 (xsl:template match="reduction"): Update.
1989 In the XML output, don't print the list of rules where symbols appear.
1990 Compute it in XSLT instead. Discussed at
1991 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
1992 * data/xslt/bison.xsl (bison:ruleByLhs): New.
1993 (bison:ruleByRhs): New.
1994 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
1996 (xsl:template match="terminal/rule"): Remove.
1997 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
1999 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
2001 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
2002 bison:ruleByRhs and mode="number-link" for rule template.
2003 (xsl:template match="terminal/rule"): Remove.
2004 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
2005 bison:ruleByRhs and mode="number-link" for rule template.
2006 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
2008 (xsl:template match="rule" mode="number-link"): ... this.
2009 * src/print-xml.c (print_grammar): Don't print the list of rules.
2011 2007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
2013 Don't let --report affect XML output; always print all information.
2015 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
2016 * src/conflicts.c (log_resolution): Implement.
2017 * src/print-xml.c (print_core): Implement.
2018 (print_state): Implement.
2019 (print_xml): Implement.
2021 * NEWS (2.3a+): Fix quotes.
2022 * src/parse-gram.y (prologue_declaration): For consistency with -v,
2023 don't let %verbose clear the list specified by --report.
2025 2007-11-26 Akim Demaille <akim@epita.fr>
2027 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
2029 2007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
2031 In the XML output, list useless and unused symbols and rules with the
2032 useful ones and add a "usefulness" attribute. Discussed starting at
2033 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
2034 * src/gram.c (grammar_rules_partial_print_xml): Remove.
2035 (grammar_rules_print_xml): Print all rules instead of just those
2036 useful in the grammar, and add a "usefulness" attribute.
2037 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
2038 * src/print-xml.c (print_rules_useless_in_parser): Remove.
2039 (print_grammar): Print all nonterminals instead of just useful ones,
2040 and add a "usefulness" attribute to nonterminals and terminals.
2041 (print_xml): Don't print a separate "reductions" or
2042 "rules-useless-in-parser" element.
2043 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
2044 (reduce_xml): Remove.
2045 (reduce_token_unused_in_grammar): New.
2046 (reduce_nonterminal_useless_in_grammar): New.
2047 * src/reduce.h (reduce_xml): Remove prototype.
2048 (reduce_token_unused_in_grammar): Add prototype.
2049 (reduce_nonterminal_useless_in_grammar): Add prototype.
2050 * data/xslt/xml2text.xsl: Update for XML changes.
2051 * data/xslt/xml2xhtml.xsl: Update for XML changes.
2052 * tests/reduce.at (Useless Terminals): Update output.
2053 (Useless Rules): Update output.
2054 (Reduced Automaton): Update output.
2056 Say "Terminals unused in grammar" instead of "Unused terminals".
2057 * NEWS (2.3a+): Update.
2058 * doc/bison.texinfo (Understanding): Update example output.
2059 * src/reduce.c (reduce_output): Implement.
2060 * data/xslt/xml2text.xsl: Implement.
2061 * data/xslt/xml2xhtml.xsl: Implement.
2063 2007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
2065 Accept --report-file=FILE to override the default `.output' filename.
2066 * NEWS (2.3a+): Mention.
2067 * doc/bison.texinfo (Bison Options): Add an entry.
2068 * src/files.c (compute_output_file_names): Don't override
2069 spec_verbose_file if already set.
2070 * src/getargs.c (usage): Document --report-file.
2071 (REPORT_FILE_OPTION): New anonymous enum member.
2072 (long_options): Add entry for it.
2073 (getargs): Add case for it setting spec_verbose_file.
2075 * build-aux/cross-options.pl: Don't record a short option just because
2077 * doc/.cvsignore: Add yacc.1.
2079 2007-11-14 Akim Demaille <akim@epita.fr>
2081 * doc/yacc.1.in: New.
2082 * configure.ac, doc/Makefile.am: Adjust.
2083 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
2085 Use AC_SUBST for assignments too.
2086 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
2088 2007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
2090 * src/gram.c: Remove comments that duplicate comments in gram.h.
2092 When reporting useless rules and nonterminals, say "useless in grammar"
2093 instead of "useless", and say "useless in parser" instead of "never
2094 reduced". Discussed starting at
2095 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
2096 * NEWS (2.3a+): Mention this change.
2097 * data/xslt/xml2text.xsl: Update output text and expected input XML
2098 element names to match changes below.
2099 * data/xslt/xml2xhtml.xsl: Likewise.
2100 (xsl:template match="bison-xml-report"): Add missing entry in Table of
2101 Contents: "Rules useless in parser due to conflicts".
2102 * doc/bison.texinfo (Decl Summary): Reword a little.
2103 (Understanding): Update example output for changes below.
2104 * src/gram.c: (rule_useful_p): Rename to...
2105 (rule_useful_in_grammar_p): ... this.
2106 (rule_useless_p): Rename to...
2107 (rule_useless_in_grammar_p): ... this.
2108 (rule_never_reduced_p): Rename to...
2109 (rule_useless_in_parser_p): ... this.
2110 (grammar_rules_print): Update for renames.
2111 (grammar_rules_print_xml): Update for renames.
2112 (grammar_rules_never_reduced_report): Rename to...
2113 (grammar_rules_useless_report): ... this since it is used for either
2114 kind of useless rule.
2115 * src/gram.h: Reword comments and update function names in prototypes.
2116 * src/main.c (main): Say "rule useless in parser due to conflicts".
2117 * src/print-xml.c (print_rules_never_reduced): Rename to...
2118 (print_rules_useless_in_parser): ... this, and rename output XML
2119 element "rules-never-reduced" to "rules-useless-in-parser".
2120 (print_xml): Update for rename.
2121 * src/print.c (print_results): Say "Rules useless in parser due to
2123 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
2124 (nonterminals_reduce): Say "nonterminal useless in grammar".
2125 (reduce_output): Say "Nonterminals useless in grammar".
2126 Say "Rules useless in grammar".
2127 (reduce_xml): Rename output XML element "useless" to
2128 "useless-in-grammar".
2129 (reduce_print): Don't report the count of grammatically useless rules
2130 as "rules never reduced" just because %yacc is specified.
2131 In the correct report of this count, say nonterminal(s) and rule(s)
2132 "useless in grammar".
2133 * tests/conflicts.at (S/R in initial): Update expected output.
2134 (Defaulted Conflicted Reduction): Likewise.
2135 (Unreachable States After Conflict Resolution): Likewise.
2136 * tests/existing.at (GNU pic Grammar): Likewise.
2137 * tests/reduce.at (Useless Nonterminals): Likewise.
2138 (Useless Rules): Likewise.
2139 (Reduced Automaton): Likewise.
2140 (Underivable Rules): Likewise.
2141 (Empty Language): Likewise.
2143 2007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
2145 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
2146 here document and before the EOF so that BSD's implementation of Bourne
2147 shell doesn't parse the delimiter as part of the here document.
2148 * doc/.cvsignore: Add cross-options.texi.
2149 * src/getargs.c (usage): Add a blank line after the warning categories.
2151 2007-11-08 Paolo Bonzini <bonzini@gnu.org>
2153 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
2155 2007-11-05 Akim Demaille <akim@epita.fr>
2157 Remove Id: from bison.1.
2158 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
2159 (perl -0777 -pi -e 's/\.PP\nId): New.
2160 (.x.1): Use it to ignore the version control revision.
2162 2007-11-05 Akim Demaille <demaille@gostai.com>
2164 * build-aux/Makefile.am: Ship cross-options.pl.
2165 * doc/Makefile.am: Always refer to cross-options.texi with
2167 (MAINTAINERCLEANFILES): Add it.
2169 2007-11-04 Akim Demaille <demaille@gostai.com>
2171 Generate the long/short option cross-table.
2172 * build-aux/cross-options.pl: New.
2173 * doc/Makefile.am (cross-options.texi): New.
2174 * doc/bison.texinfo: Use it.
2176 2007-11-04 Akim Demaille <demaille@gostai.com>
2178 Generate bison.1 using help2man.
2179 * doc/common.x, doc/bison.x: New.
2180 * doc/Makefile.am (bison.1, .x.1): New.
2181 The code is taken from autoconf-2.61/man/Makefile.am.
2182 * configure.ac: Look for help2man.
2184 2007-11-04 Akim Demaille <demaille@gostai.com>
2187 * src/getargs.c (usage): Document -W, make it clear that -d,
2188 -g and -x have optional arguments.
2190 2007-11-04 Akim Demaille <demaille@gostai.com>
2192 Find sha1sum when named gsha1sum.
2193 * bootstrap (find_tool): New.
2196 2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
2198 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
2200 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
2201 * NEWS (2.3a+): Mention.
2202 * data/bison.m4 (b4_pure_if): Don't define it here.
2203 * data/c.m4 (b4_identification): Depend on individual skeletons to
2204 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
2205 values of the %define variables api.pure or api.push_pull. Define
2206 YYPURE, YYPUSH, and YYPULL accordingly.
2207 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
2208 glr.cc has already defined b4_pure_flag.
2209 * data/push.c: Define b4_pure_if based on `%define api.pure'.
2210 Remove YYPUSH and YYPULL since they're back in b4_identification again.
2211 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
2212 * doc/bison.texinfo (Pure Decl): Update.
2213 (Push Decl): Update.
2214 (Decl Summary): Add api.pure to %define entry.
2215 In %pure-parser entry, say it's deprecated and reference %define.
2216 (Pure Calling): Update.
2217 (Error Reporting): Update.
2218 (C++ Scanner Interface): Update.
2219 (How Can I Reset the Parser): Update.
2220 (Table of Symbols): In %pure-parser entry, say it's deprecated and
2222 * src/getargs.c (pure_parser): Remove global variable.
2223 * src/getargs.h (pure_parser): Remove extern.
2224 * src/output.c (prepare): Don't define pure_flag muscle.
2225 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
2226 wrapper around `%define api.pure'.
2227 * tests/calc.at (Simple LALR Calculator): Update.
2228 (Simple GLR Calculator): Update.
2229 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
2231 (GLR: Resolve ambiguity, pure, locations): Update.
2232 (GLR: Merge conflicting parses, pure, no locations): Update.
2233 (GLR: Merge conflicting parses, pure, locations): Update.
2234 * tests/glr-regression.at (Uninitialized location when reporting
2236 * tests/input.at (Unused %define api.pure): New test case.
2237 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
2238 AT_PURE_IF and AT_PURE_AND_LOC_IF.
2239 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
2241 2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
2243 %define push_pull -> %define api.push_pull. Discussed starting at
2244 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
2245 * data/push.c: Expect the new name.
2246 * data/yacc.c: Likewise.
2247 * doc/bison.texinfo (Push Decl): Update.
2248 (Decl Summary): Update %define entry.
2249 (Push Parser Function): Update.
2250 (Pull Parser Function): Update.
2251 (Parser Create Function): Update.
2252 (Parser Delete Function): Update.
2253 * tests/calc.at (Simple LALR Calculator): Update.
2254 * tests/input.at (%define enum variables): Update.
2255 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
2256 (Push Parsing: Multiple impure instances): Update.
2257 (Push Parsing: Unsupported Skeletons): Update.
2258 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
2259 (Exploding the Stack Size with Malloc): Update.
2261 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
2264 2007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
2266 For the XML output's terminal element, rename @number to @token-number,
2267 and add @symbol-number. In the nonterminal element, rename @number to
2268 @symbol-number. Discussed starting at
2269 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
2270 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
2272 (xsl:template match="nonterminal"): Likewise.
2273 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
2274 (xsl:template match="nonterminal"): Likewise.
2275 * src/print-xml.c (print_grammar): Implement.
2277 2007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2279 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
2280 2007-10-11 change, the child elements here are items not rules.
2281 (xsl:template match="item"): New.
2282 (xsl:template match="rule"): Update for new reduced itemset.
2283 (xsl:template match="point"): Remove.
2284 (xsl:template match="empty"): For consistency with --graph, don't
2285 output "/* empty */".
2286 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
2287 line-wrap, don't pass a negative value as first-line-length since this
2288 won't work with the following changes.
2289 (xsl:template name="line-wrap"): Simplify slightly.
2290 (xsl:template name="ws-search"): Eliminate recursion.
2291 * src/print_graph.c (print_core): Don't print a reduction's lookahead
2292 set next to an item whose dot is not at the end of the RHS even if it
2293 happens to be associated with the same rule.
2295 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
2297 Add %define lr.keep_unreachable_states.
2298 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
2299 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
2300 * src/main.c (main): Implement it.
2301 * tests/conflicts.at (Unreachable States After Conflict Resolution):
2302 Extend to test it, and fix a typo.
2304 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
2306 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
2307 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
2308 the example .output text.
2309 * tests/regression.at (Extra lookahead sets in report): Improve wording
2312 2007-10-17 Wojciech Polak <polak@gnu.org>
2314 * src/print-xml.c (print_grammar): Renamed
2315 <terminal> and <nonterminal> attributes:
2316 "type" to "number" and "symbol" to "name".
2317 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
2318 Use new attribute names.
2319 (xsl:template match="nonterminal"): Likewise.
2320 * data/xslt/xml2xhtml.xsl: Likewise.
2322 2007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
2324 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
2325 (Option Cross Key): Likewise.
2327 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
2328 next to an item whose dot is not at the end of the RHS even if it
2329 happens to be associated with the same rule.
2330 * src/print.c (print_core): Likewise.
2331 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
2332 (Resolved SR Conflicts): Update output.
2333 * tests/regression.at (Extra lookahead sets in report): New test case.
2335 2007-10-11 Wojciech Polak <polak@gnu.org>
2337 * src/print-xml.c (print_core): Remove item set
2339 * data/xslt/bison.xsl (bison:ruleNumber): New key.
2340 Improve processing time. Suggested by Joel E. Denny.
2341 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
2342 Write xsl:param "required" attribute as comment.
2343 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
2344 (xsl:template match="rule"): Support new reduced itemset.
2345 (xsl:template match="point"): Remove.
2346 * data/xslt/xml2xhtml.xsl: Likewise.
2348 2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
2350 * src/getargs.c (version): Update copyright year.
2352 2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
2354 Make xml2dot.xsl and --graph produce the same output.
2355 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a ` '
2356 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
2358 (xsl:template name="output-node"): Use the new escape template instead
2359 of the string-replace template directly.
2360 (xsl:template name="output-edge"): Likewise.
2361 (xsl:template name="escape"): New, escapes backslashes and newlines in
2362 addition to quotation marks.
2363 * src/graphviz.c (start_graph, output_node, output_edge): Add
2364 whitespace to output for legibility.
2366 Make xml2text.xsl and --report produce the same output, and remove the
2367 XML "conflicts" element since a conflict summary is easily extracted
2369 * data/xslt/bison.xsl: New.
2370 (xsl:template match="state" mode="bison:count-conflicts): New.
2371 * data/xslt/xml2text.xsl: Import bison.xsl.
2372 (xsl:template match="bison-xml-report"): Instead of styling the
2373 "conflicts" element, style the "automaton" element with mode
2374 "conflicts". Unlike the former, the latter lists S/R and R/R
2375 conflicts for a state on the same line.
2376 (xsl:template match="conflicts"): Remove.
2377 (xsl:template match="conflict"): Remove.
2378 (xsl:template match="terminal"): Line-wrap the list of rules in which
2379 the terminal is used.
2380 (xsl:template match="nonterminal"): Likewise for nonterminals.
2381 (xsl:template match="automaton" mode="conflicts"): New.
2382 (xsl:template match="state" mode="conflicts"): New.
2383 (xsl:template name="line-wrap"): New.
2384 (xsl:template name="ws-search"): New.
2385 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
2386 (xsl:template match="bison-xml-report"): Instead of styling the
2387 "conflicts" element, style the "automaton" element with mode
2389 (xsl:template match="conflicts"): Remove.
2390 (xsl:template match="conflict"): Remove.
2391 (xsl:template match="automaton" mode="conflicts"): New.
2392 (xsl:template match="state" mode="conflicts): New.
2393 * src/conflicts.c (conflicts_output_xml): Remove.
2394 * src/conflicts.h (conflicts_output_xml): Remove prototype.
2395 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
2396 * src/print.c (print_grammar): Consistently wrap at the 66th column so
2397 the corresponding XSLT is easier. Also, never wrap between a word and
2398 the comma that follows it.
2400 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
2402 Improve C++ namespace support. Discussed starting at
2403 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
2404 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
2405 b4_namespace_close): New macros that interpret the %define variable
2406 "namespace" so its value can contain "::" to indicate nested
2408 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
2410 * data/lalr1.cc (b4_namespace): Likewise.
2411 * data/location.cc (b4_namespace): Likewise.
2412 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
2413 inside a new table in the general %define entry. Document `%define
2414 namespace' there as well. Point the %name-prefix entry to it since it
2415 explains it more completely in the case of C++.
2416 (C++ Bison Interface): Mention `%define namespace' instead of
2418 (Table of Symbols): Remove the `%define push_pull' entry. The %define
2420 * tests/c++.at (Relative namespace references): New test case.
2421 (Absolute namespace references): New test case.
2422 (Syntactically invalid namespace references): New test case.
2423 * tests/input.at (C++ namespace reference errors): New test case.
2425 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
2427 Add syncline support and location accessor to internal %define
2429 * data/bison.m4 (b4_percent_define_get_loc): New.
2430 (b4_percent_define_get_syncline): New.
2431 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
2432 (b4_percent_define_default): Record defining location as line 1 rather
2433 than 0 for the sake of synchronizing #line's, and define
2434 b4_percent_define_syncline(VARIABLE).
2435 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
2436 * src/muscle_tab.c (muscle_syncline_grow): New.
2437 (muscle_code_grow): Use muscle_syncline_grow.
2438 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
2439 define b4_percent_define_syncline(VARIABLE).
2440 (muscle_percent_define_get_loc): New.
2441 (muscle_percent_define_get_syncline): New.
2442 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
2443 remove some unused variables.
2444 (muscle_percent_define_default): Record defining location as line 1
2445 rather than 0 for the sake of synchronizing #line's, and define
2446 b4_percent_define_syncline(VARIABLE).
2447 (muscle_percent_define_check_values): Use
2448 muscle_percent_define_get_loc.
2449 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
2450 (muscle_percent_define_get_syncline): Prototype.
2451 * tests/skeletons.at (%define Boolean variables: invalid skeleton
2452 defaults): Update output for location change.
2453 (Complaining during macro argument expansion): Extend to test
2454 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
2456 2007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
2458 Fix some error-reporting macro bugs.
2459 * data/bison.m4 (b4_cat): New.
2460 (b4_error, b4_error_at): Use b4_cat to send error directives directly
2461 to stdout so they don't become arguments to other macros. Update
2462 comments and add examples.
2463 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
2465 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
2466 after printing the error directive so that M4 doesn't report subsequent
2467 problems that are induced by this problem.
2468 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
2469 instead of just in them. Recognize @\n in both places. Both expand to
2470 the empty string. Needed by b4_cat.
2471 * tests/skeletons.at (Complaining during macro argument expansion):
2473 (Fatal errors make M4 exit immediately): New test case.
2475 2007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
2477 Implement --print-datadir.
2478 * src/getargs.c (usage): Mention.
2479 (PRINT_DATADIR_OPTION): New anonymous enum member.
2480 (long_options): Add entry for it.
2481 (getargs): Add case for it calling compute_pkgdatadir.
2482 * src/output.c (output_skeleton): Encapsulate data directory
2483 computation from here...
2484 (prepare): ... and from here...
2485 (compute_pkgdatadir): ... into this new function.
2486 * src/output.h (compute_pkgdatadir): Prototype.
2488 2007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
2490 * src/print-xml.c (escape_bufs): New static global variable
2492 (xml_escape_n): ... the static local variable buf here.
2493 (print_xml): Free memory for escape_bufs.
2494 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
2496 2007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
2498 Replace `%push-parser' and `%push-pull-parser' with
2499 `%define push_pull "push"' and `%define push_pull "both"'.
2500 `%define push_pull "pull"' is the default.
2501 * doc/bison.texinfo (Push Decl, Push Parser Function,
2502 Pull Parser Function, Parser Create Function, Parser Delete Function):
2503 Update declarations.
2504 (Decl Summary, Table of Symbols): Replace %push-parser and
2505 %push-pull-parser entries with a %define push_pull entry.
2506 * data/bison.m4 (b4_percent_define_check_values): New macro.
2507 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
2509 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
2511 * data/push.c: ... to here and compute them from the value of the
2512 %define variable push_pull.
2513 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
2514 parsing requests here...
2515 * data/yacc.c: ... hack this to switch to push.c any time
2516 b4_use_push_pull_flag or the %define variable push_pull is set. This
2517 will go away when we mv push.c yacc.c.
2518 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
2519 push parsing is not supported since unused %define variables are
2521 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
2522 * src/muscle_tab.h (muscle_percent_define_check_values): Update
2523 comments for consistency with b4_percent_define_check_values.
2524 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
2526 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
2528 (prologue_declaration): Remove %push-parser and %push-pull-parser
2530 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
2531 * tests/calc.at: Update declarations.
2532 * tests/input.at (%define enum variables): New test case.
2533 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
2535 (Push Parsing: Multiple impure instances): Update declaration.
2536 (Push Parsing: Unsupported Skeletons): New test case.
2537 * tests/torture.at (Exploding the Stack Size with Alloca): Update
2539 (Exploding the Stack Size with Malloc): Update declaration.
2541 2007-09-24 Wojciech Polak <polak@gnu.org>
2543 Add XSLT transformations.
2545 * data/xslt/xml2dot.xsl: Transform XML into DOT.
2546 * data/xslt/xml2text.xsl: Transform XML into plain text.
2547 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
2548 * data/Makefile.am (xsltdir): New variable.
2549 (dist_xslt_DATA): Add xslt/*.xsl files.
2551 2007-09-23 Paul Eggert <eggert@cs.ucla.edu>
2553 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
2554 Problem reported by Wojciech Polak.
2555 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
2556 (xml_printf): Undo change I made on 21 September; that is,
2557 indent 2 spaces, not 1.
2559 2007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
2561 Pacify ./configure --enable-gcc-warnings.
2562 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
2563 `char const *' instead of `char *'.
2564 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
2565 local variable `sep'.
2567 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
2569 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
2571 * src/print-xml.c: Prefer "const" after types; that's more consistent.
2572 (xml_printf): Indent just 1 space for level.
2573 (e_char, xlate_char): Remove.
2574 (xml_escape_string): Rewrite to avoid undefined behavior (used
2575 storage that was freed from the stack).
2576 (xml_escape_n): Don't bother checking for subscript error.
2578 2007-09-21 Wojciech Polak <polak@gnu.org>
2580 Add Bison XML Automaton Report.
2582 Add support for an -x option to generate an XML report.
2583 It is not documented yet.
2584 * src/print-xml.c: New file.
2585 * src/print-xml.h: Likewise.
2586 * lib/timevar.def (TV_XML): New var.
2587 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
2588 * src/conflicts.c: Include print-xml.h.
2589 (solved_conflicts_xml_obstack): New var.
2590 (log_resolution, conflicts_solve, conflicts_free):
2591 Add support for XML report.
2592 (conflicts_output_val): New function.
2593 * src/conflicts.h (conflicts_output_val): New decl.
2594 * src/files.c (spec_xml_file): New var.
2595 (compute_output_file_names, output_file_names_free): Add XML support.
2596 * src/files.h (spec_xml_file): New decl.
2597 * src/getargs.c (xml_flag): New var.
2598 (usage, short_options, long_options, getargs): Add XML support.
2599 * src/getargs.h (xml_flag): New decl.
2600 * src/gram.c: Include print-xml.h.
2601 (rule_lhs_print_xml, rule_rhs_print_xml):
2602 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
2604 * src/gram.h: Declare external ones.
2605 * src/main.c: Include print-xml.h.
2606 (main): Add XML support.
2607 * src/reduce.c: Include print-xml.h.
2608 (reduce_xml): New function.
2609 * src/reduce.h: Declare it.
2610 * src/state.c: Include print-xml.h.
2611 (state_new): Add XML support.
2612 (state_rule_lookahead_tokens_print_xml): New function.
2613 * src/state.h: Declare it.
2614 (struct state): New member solved_conflicts_xml.
2615 * src/symtab.c (symbol_class_get_string): New function.
2616 * src/symtab.h: Declare it.
2618 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
2620 * GNUmakefile: Switch to coreutils's version.
2621 * bootstrap: Likewise.
2622 * Makefile.cfg: Adjust to new GNUmakefile.
2623 * README-hacking: Likewise.
2627 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
2628 Bruno Haible <bruno@clisp.org>
2630 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
2631 and is a script that invokes bison. Tighten the code. Add comments.
2633 2007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
2635 Spell "boolean" as "Boolean". Reported by Akim Demaille.
2636 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
2637 * doc/bison.texinfo (Decl Summary): Fix.
2638 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
2639 * tests/input.at (Boolean %define variables): Update output.
2640 * tests/skeletons.at (%define boolean variables: invalid skeleton
2641 defaults): Rename to...
2642 (%define Boolean variables: invalid skeleton defaults): ... this and
2645 2007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
2647 In impure push mode, don't allow more than one yypstate to be allocated
2648 since multiple impure parsers would corrupt yynerrs.
2649 * data/push.c (yypstate_allocated): New static global variable
2651 (yypull_parse): If yypstate_new returns 0, don't report it as memory
2652 exhaustion if yypstate_allocated is 1, but still return 2.
2653 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
2654 already 1. Otherwise, set it to 1.
2655 (yypstate_delete): Set it to 0.
2656 * tests/push.at (Push Parsing: Multiple impure instances): New test
2659 2007-08-17 Bob Rossi <bob@brasko.net>
2661 * doc/bison.texinfo (Push Decl): Document the push parser.
2662 (Table of Symbols): Ditto.
2664 (Decl Summary): Ditto.
2665 (Multiple Parsers, Push Parser Function, Pull Parser Function,
2666 Parser Create Function, Parser Delete Function):
2667 Add new push parser symbols.
2668 (Table of Symbols): Document push-parser, push-pull-parser,
2669 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
2671 2007-08-15 Paul Eggert <eggert@cs.ucla.edu>
2674 * doc/gpl-3.0.texi: New file.
2675 * doc/gpl.texi: Remove.
2676 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
2677 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
2678 * README-hacking, TODO, bootstrap, bootstrap.conf:
2679 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
2680 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
2681 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
2682 * data/lalr1.cc, data/lalr1.java, data/location.cc:
2683 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
2684 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
2685 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
2686 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
2687 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
2688 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
2689 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
2690 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
2691 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
2692 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
2693 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
2694 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
2695 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
2696 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
2697 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
2698 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
2699 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
2700 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
2701 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
2702 * src/complain.c, src/complain.h, src/conflicts.c:
2703 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
2704 * src/files.h, src/flex-scanner.h, src/getargs.c:
2705 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
2706 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
2707 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
2708 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
2709 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
2710 * src/print.c, src/print.h, src/print_graph.c:
2711 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
2712 * src/reduce.h, src/relation.c, src/relation.h:
2713 * src/revision.h, src/scan-code.h, src/scan-code.l:
2714 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
2715 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
2716 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
2717 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
2718 * tests/Makefile.am, tests/actions.at, tests/c++.at:
2719 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
2720 * tests/existing.at, tests/glr-regression.at:
2721 * tests/headers.at, tests/input.at, tests/java.at:
2722 * tests/local.at, tests/output.at, tests/push.at:
2723 * tests/reduce.at, tests/regression.at, tests/sets.at:
2724 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
2728 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
2730 Get rid of broken %no-parser, -n, and --no-parser implementation and
2732 * TODO: Don't mention them.
2733 * doc/bison.1: Likewise.
2734 * doc/bison.texinfo (Decl Summary): Likewise.
2735 (Bison Options): Likewise.
2736 (Option Cross Key): Likewise.
2737 * src/getargs.c (no_parser_flag): Remove global variable.
2738 (usage): Don't print description of -n and --no-parser.
2739 (long_options): Remove --no-parser entry here.
2740 (getargs): Remove -n case in the switch here.
2741 * src/getargs.h (no_parser_flag): Remove extern.
2742 * tests/regression.at (Web2c Actions): Remove comment that mentions
2745 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
2747 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
2748 name user variables starting with `yy'. Just pass NULL instead of a
2749 dummy local &yylval to yypush_parse.
2750 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
2753 2007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
2755 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
2756 true since it's then always used regardless of whether yyoverflow is
2757 defined. Reported by Christian Burger at
2758 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
2759 * THANKS: Add Christian Burger.
2761 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
2762 node names: say "Decl Summary" not "Bison Declaration Summary".
2764 2007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
2766 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
2767 determine whether this function has already complained about an invalid
2768 value for a %define boolean variable, don't check whether Bison has
2769 ever examined the value. As written, the check was a tautology.
2770 Instead, record and check for this complaint using a separate muscle.
2772 2007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
2774 Fix push parsing memory leak reported by Brandon Lucia at
2775 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
2776 * THANKS: Add Brandon Lucia.
2777 * data/push.c (yypstate_delete): Free the stack if it was reallocated
2778 but the parse never completed and thus freed it.
2779 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
2780 * tests/testsuite.at: Include push.at.
2781 * test/push.at: New.
2782 (Push Parsing: Memory Leak for Early Deletion): New test case.
2784 2007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
2786 Improve handling of multiple S/R conflicts in the same state and of S/R
2787 conflicts involving multiple reductions.
2788 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
2789 set for a state here or Bison will abort if it is reassigned on a
2790 later conflicted reduction in the same state.
2791 Similarly, don't finalize and assign the solved conflicts report here
2792 or it will be lost if it is reassigned on a later conflicted reduction
2794 (set_conflicts): Instead, assign them both here after all S/R conflicts
2795 in the state have been fully examined.
2796 * src/print.c (shift_set): Rename to...
2797 (no_reduce_set): ... this.
2798 (print_reductions): Update for rename, and add %nonassoc error action
2799 tokens to no_reduce_set so that, when printing the first remaining
2800 reduction on an error action token, the reduction is enclosed in
2802 (print_results): Update for rename.
2803 * tests/conflicts.at (Solved conflicts report for multiple reductions
2804 in a state): New test case.
2805 (%nonassoc error actions for multiple reductions in a state): New test
2808 * src/main.c (main): Don't depend on C99 features.
2810 2007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
2812 * build-aux/.cvsignore: Add compile.
2813 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
2816 2007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
2818 * bootstrap (slurp): Create target directories that don't exist.
2819 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
2821 2007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
2823 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
2825 * closure.c (closure): Likewise.
2826 * state.h (reductions): Comment sorting of rules.
2827 (state): Comment sorting of items.
2829 2007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
2831 Fix C++ test cases after recent Gnulib changes. Discussed starting at
2832 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
2833 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
2834 definition in order to avoid Gnulib headers since we don't use config.h
2836 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
2837 rather than AT_DATA so that config.h is included.
2839 2007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
2841 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
2842 instead of fprintf. Guard these functions with #if YYDEBUG instead of
2843 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
2844 and so that YYFPRINTF is guaranteed to be defined here.
2846 2007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
2848 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
2850 (muscle_percent_define_check_values): ... this more helpful function.
2851 Again, it's not used yet, but it will be.
2852 * src/muscle_tab.h: Likewise.
2854 Improve some comments in parser table construction.
2855 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
2856 (generate_states): Don't mention ruleset, which is internal to closure.
2857 * src/closure.c (closure): Explain sorting of core and itemset, which
2858 is required for this function to behave correctly.
2859 * src/closure.h (closure): Mention sorting.
2861 2007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
2863 * src/lalr.c (state_lookahead_tokens_count): For code readability,
2864 move the check for disabled transitions to an aver since conflict
2865 resolution hasn't happened yet.
2867 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
2868 labels a state as inconsistent just because it has error transitions.
2869 The original form of this check appeared in revision 1.1 of lalr.c,
2870 which was committed on 1991-12-21. Now (at least), changing the
2871 consistency label on such a state appears to have no useful effect in
2872 any of the places it is examined, which I enumerate below. The key
2873 point to understanding each item in this enumeration is that a state
2874 with an error transition is labelled consistent in the first place only
2875 if it has no rules, so the check cannot matter for states that have
2876 rules. (1) Labelling a state as inconsistent will cause set_conflicts
2877 to try to identify its conflicts, and a state must have *rules* to have
2878 conflicts. (2) Labelling a state as inconsistent will affect how
2879 action_row sets the default *rule* for the state. (3) Labelling a
2880 state as inconsistent will cause build_relations to add lookback edges
2881 to *rules* in that state.
2882 * src/state.h (struct state): Word the comment for member consistent
2885 2007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
2887 Don't depend on C99 features.
2888 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
2889 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
2890 * src/reader.c (check_and_convert_grammar): Fix for-loop.
2891 * src/state.c (state_mark_reachable_states): Fix for-loop.
2892 (state_remove_unreachable_states): Fix for-loop.
2894 Don't widen struct state with member reachable just to temporarily
2895 record reachability. Instead, use a local bitset.
2896 * src/state.h (struct state): Remove member.
2897 * src/state.c (state_new): Don't initialize it.
2898 (state_mark_reachable_states): Rename to...
2899 (state_record_reachable_states): ... this, and use bitset.
2900 (state_remove_unreachable_states): Use bitset.
2902 2007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
2904 * src/Makefile.am (yacc): Quote target action commands properly so
2905 that the yacc script isn't corrupt. Reported by Hans Aberg at
2906 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
2908 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
2909 the case of pure parsers. Reported by Frans Englich at
2910 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
2911 * THANKS: Add Frans Englich.
2913 * NEWS (2.3a+): In the %code entry, reference section `Bison
2914 Declaration Summary' from the manual now since the %code summary has
2916 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
2917 in the rules section must be terminated by semicolons.
2919 2007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
2921 Extend the front-end API for %define variables to more completely
2922 mirror the back-end. This will be useful in the future.
2923 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
2924 Update comments to mention the new front-end counterparts of these
2926 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
2927 for muscle_string_decode and muscle_location_decode.
2928 (muscle_string_decode): New static function.
2929 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
2930 (muscle_percent_define_get, muscle_percent_define_ifdef): New
2932 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
2933 muscle_percent_define_get to mimic the b4_percent_define_flag_if
2934 implementation more closely.
2935 (muscle_percent_define_invalid_value): New function.
2936 * src/muscle_tab.h (muscle_percent_define_get,
2937 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
2940 2007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
2942 * NEWS (2.3a+): Mention yesterday's state-removal change.
2943 (2.3a): Remove the %language entry, which was added after 2.3a.
2944 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
2945 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
2946 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
2947 tests/existing.at: Update copyright date.
2949 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
2951 If conflict resolution makes states unreachable, remove those states,
2952 report rules that are then unused, and don't report conflicts in those
2954 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
2955 New global function.
2956 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
2958 * src/main.c (main): After conflict resolution, remove the unreachable
2959 states and update all data structures that reference states by number.
2960 * src/state.c (state_new): Initialize each state's reachable member to
2962 (state_mark_reachable_states): New static function.
2963 (state_remove_unreachable_states): New global function.
2964 * src/state.h (struct state): Add member bool reachable.
2965 (state_remove_unreachable_states): Prototype.
2966 * tests/conflicts.at (Unreachable States After Conflict Resolution):
2968 * tests/existing.at (GNU pic Grammar): Update test case output now that
2969 an unused rule is discovered.
2971 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
2973 Minor code cleanup in parser table construction.
2974 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
2975 (new_itemsets, save_reductions): Update for rename to nitemset.
2976 * src/closure.c (nritemset): Rename to...
2977 (nitemset): ... this since the "r" appears to meaningless and isn't
2978 used in the comments.
2979 (closure): Update for rename.
2980 * src/closure.h (nritemset): Update extern to...
2981 (nitemset): ... this.
2982 * src/lalr.c (LA): Fix a typo in comments.
2983 * src/print.c (print_core): Update for rename to nitemset.
2984 * src/print_graph.c (print_graph): Likewise.
2985 * src/state.h: Fix some typos in header comments.
2987 2007-04-04 Paul Eggert <eggert@cs.ucla.edu>
2989 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
2990 still sticks to ASCII. Sorry!
2992 * README-hacking: New file, taken mostly from coreutils, with changes
2993 for Bison. Contains much of the contents of:
2994 * README-cvs: Remove.
2995 * bootstrap: Sync from gnulib.
2996 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
2997 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
2999 2007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
3001 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
3003 (Java Differences): Fix some typos.
3004 * THANKS: Add Sebastian Setzer.
3006 2007-03-07 Paolo Bonzini <bonzini@gnu.org>
3008 * data/java.m4 (b4_single_class_if): Remove.
3009 (b4_abstract_if): Look at "%define abstract".
3011 (b4_union_name): Rename...
3012 (b4_yystype): ... to this. Map to "%define stype".
3013 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
3014 b4_maybe_throws): Fix quoting.
3015 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
3016 * data/lalr1.java (Lexer interface): Always define.
3017 (Lexer interface within parser class): Remove.
3018 (YYLexer class): New, used when "%code lexer" is present.
3019 (constructor): When "%code lexer" is used, pass %lex-param
3020 to the lexer constructor.
3021 (yylex, yyparse): Remove %lex-param from method invocations
3022 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
3024 * doc/bison.texinfo (Java Bison Interface): Mention "%define
3025 abstract". Rename "%define union_name" to "%define stype".
3026 Rename method names according to previous patch.
3027 (Java Scanner Interface): Describe "%code lexer" instead of
3028 "%pure-parser" and "%define single_class".
3029 (Java Differences): Mention "%code lexer".
3031 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
3032 Include scanner here, using macros from tests/local.at.
3033 (AT_DATA_CALC_Y): Remove final argument.
3034 (_AT_CHECK_JAVA_CALC): Likewise.
3035 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
3036 of %locations and %error-verbose.
3037 (main): Test with and without %lex-param.
3038 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
3039 (AT_BISON_OPTION_POPDEFS): Pop it.
3041 2007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3043 DJGPP spefic issue. Inhibit the use of disallowed characters for
3044 file name genertion on Win98, WinXP, etc. These are |<>":?*\
3045 and concern testsuite case 46.
3046 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
3047 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
3048 * djgpp/config.bat: Inhibit the use of disallowed characters.
3050 2007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
3052 Miscellaneous %define and %code cleanup.
3053 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
3054 values are interpreted.
3055 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
3056 documentation a little more.
3057 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
3058 muscle_percent_define_insert, muscle_percent_code_grow): New
3060 * src/muscle_tab.h (muscle_percent_define_insert,
3061 muscle_percent_code_grow): Prototype.
3062 * src/parse-gram.y (prologue_declaration): Use
3063 muscle_percent_define_insert and muscle_percent_code_grow when parsing
3064 %define and %code directives.
3066 Make it easy to share %define boolean variables between the front-end
3067 and back-end. Though not used yet, this will be useful in the future.
3068 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
3069 Bison uses of names rather than just skeleton uses of names.
3070 (b4_percent_define_get, b4_percent_define_ifdef): Rename
3071 b4_percent_define_skeleton_variables(VARIABLE) to
3072 b4_percent_define_bison_variables(VARIABLE).
3073 (b4_percent_code_get, b4_percent_code_ifdef): Rename
3074 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
3075 b4_percent_code_bison_qualifiers(QUALIFIER).
3076 (b4_check_user_names_wrap): Update for renames.
3077 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
3078 muscle_percent_define_default): New functions mimicking
3079 b4_percent_define_flag_if and b4_percent_define_default.
3081 For %define variables, report locations for invalid values and
3083 * data/bison.m4 (b4_percent_define_flag_if): Read
3084 b4_percent_define_loc(VARIABLE) to report the location of an invalid
3086 (b4_percent_define_default): Save a special location in
3087 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
3088 must later be reported as invalid.
3089 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
3091 (muscle_percent_define_insert): Record the location of VARIABLE in
3092 muscle percent_define_loc(VARIABLE), and use it to report the previous
3093 location for a redefinition.
3094 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
3095 (muscle_percent_define_default): Update like b4_percent_define_default.
3096 (muscle_grow_user_name_list): Rename to...
3097 (muscle_user_name_list_grow): ... this for consistency and use
3098 muscle_location_grow.
3099 * src/muscle_tab.h (muscle_location_grow): Prototype.
3100 * tests/input.at (%define errors): Update expected output.
3101 * tests/skeletons.at (%define boolean variables: invalid skeleton
3102 defaults): New test case.
3104 2007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
3106 * src/print.c (lookahead_set, state_default_rule): Remove.
3107 (print_reductions): Replace state_default_rule invocation with
3108 equivalent use of yydefact, which was computed in token_actions in
3110 (print_results): Don't allocate lookahead_set.
3112 2007-02-27 Paolo Bonzini <bonzini@gnu.org>
3114 * data/lalr1.java: Prefix all private members with yy.
3116 2007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
3118 Use YYFPRINTF instead of fprintf where appropriate. Reported by
3119 Sebastien Fricker at
3120 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
3121 * THANKS: Add Sebastien Fricker.
3122 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
3123 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
3124 accept a variable number of arguments.
3126 2007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
3128 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
3130 2007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3132 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
3133 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
3134 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
3136 2007-02-11 Paul Eggert <eggert@cs.ucla.edu>
3138 Undo my 2007-02-07 change, switching back to the c-strcase module
3139 introduced in the 2007-02-03 change. Bruno Haible reported that
3140 the 2007-02-07 change would be dangerous in Turkish if we add a
3141 language whose name contains "i", since "i" is not lowercase "I"
3143 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
3144 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
3145 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
3146 * m4/.cvsignore: Remove strcase.m4.
3147 * src/getargs.c: Revert 2007-02-07 change, as follows.
3148 Include c-strcase.h.
3149 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
3151 2007-02-11 Bruno Haible <bruno@clisp.org>
3153 Enable the Java related testsuite tests when the only Java compiler
3154 found is a gcj < 4.3. Discussed at
3155 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
3156 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
3158 2007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
3160 * data/Makefile.am: Update copyright date.
3161 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
3162 yypstate_new returns NULL.
3163 (yypstate_new): Return NULL if malloc does.
3164 * src/reader.c (packgram): Move translation of rule actions from the
3165 beginning of packgram to...
3166 (check_and_convert_grammar): ... here right before packgram is invoked
3167 so it's easier to write more complete comments, and remove redundant
3170 2007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
3172 As in semantic actions, make @$ in %initial-action, %destructor, and
3173 %printer imply %locations.
3174 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
3176 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
3177 (@$ in %initial-action implies %locations,
3178 @$ in %destructor implies %locations,
3179 @$ in %printer implies %locations): ... these new test cases.
3181 2007-02-07 Paul Eggert <eggert@cs.ucla.edu>
3183 Undo most of the 2007-02-03 change, switching to the strcase module
3184 now that gnulib strcase has been fixed.
3185 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
3186 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
3187 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
3188 * m4/.cvsignore: Add strcase.m4.
3189 * src/getargs.c: Revert 2007-02-03 change, as follows.
3190 Don't include c-strcase.h.
3191 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
3192 strcasecmp has "unspecified behavior" outside the POSIX locale,
3193 but it works fine in practice if at least one argument is ASCII,
3194 as is the case in Bison.
3196 2007-02-07 Paolo Bonzini <bonzini@gnu.org>
3198 * tests/java.at: Skip tests if only one of javac/java is present.
3199 Reported by Joel E. Denny.
3200 * tests/atlocal.in: Adjust copyright years.
3202 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
3204 * data/lalr1.java (Stack): Work around old verifiers that disallow
3205 access to the private fields of an inner class, from the outer class.
3206 We can make Stack's fields public because user code doesn't have access
3207 to the instance of Stack used by parse(). Reported by Paul Eggert.
3209 2007-02-03 Paul Eggert <eggert@cs.ucla.edu>
3211 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
3212 the right spot for these files?
3213 * bootstrap.conf (gnulib_modules): Add c-strcase.
3214 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
3216 * src/getargs.c: Include c-strcase.h.
3217 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
3218 to avoid unspecified behavior.
3220 2007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
3222 * doc/bison.texinfo (Decl Summary): Correct typo.
3224 2007-01-30 Paolo Bonzini <bonzini@gnu.org>
3226 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
3227 Complain if the value does not match empty, "true" or "false".
3228 * data/c++.m4: Adjust default definitions of %define variables.
3229 * data/java.m4: Adjust default definitions of %define variables.
3230 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
3232 * tests/input.at (Boolean %define variables): Test new behavior.
3234 2007-01-29 Paolo Bonzini <bonzini@gnu.org>
3236 * NEWS: Mention java.
3237 * TODO: Remove things that are done.
3238 * bootstrap.conf: Add javacomp-script and javaexec-script.
3239 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
3241 * data/Makefile.am: Add new files.
3242 * data/java-skel.m4: New.
3243 * data/java.m4: New.
3244 * data/lalr1.java: New.
3246 * doc/bison.texinfo: Put "A Complete C++ Example" under
3247 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
3248 under Other Languages.
3250 * src/getargs.c (valid_languages): Add Java.
3251 * src/getargs.h (struct bison_language): Update size of string fields.
3253 * tests/Makefile.am: Add java.at.
3254 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
3255 * tests/java.at: New.
3256 * tests/testsuite.at: Include it.
3258 2007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
3261 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
3262 at_directive_argv arguments so these no longer have to be global
3263 variables. Also, update the implementation for the following changes.
3264 (fail_for_at_directive_too_many_args,
3265 fail_for_at_directive_too_few_args): Add at_directive_name argument.
3266 (at_directive_name): Remove as at_directive_argv[0] will be used for
3268 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
3269 for the directive name.
3270 (at_directive_argc, at_directive_argv): Make these local within
3271 skel_lex instead of global.
3272 (INITIAL): Update directive start action for above changes.
3273 (SC_AT_DIRECTIVE_ARG): Rename to...
3274 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
3275 (SC_AT_DIRECTIVE_SKIP_WS): Update.
3276 (scan_skel): Move yylex_destroy to...
3277 (skel_scanner_free): ... here.
3278 * tests/skeletons.at (installed skeleton file name): Rename to...
3279 (installed skeleton file names): ... this.
3281 2007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
3283 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
3284 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
3285 Summary" not "Directives".
3286 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
3287 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
3288 since the former is now the more complete one.
3289 (Prologue Alternatives): Likewise and do the same for %defines.
3290 (Table of Symbols): Add summary of %code, add summary of %define, and
3291 move full %code documentation to...
3292 (Decl Summary): ... here for consistency with other entries in these
3294 Move %define entry in order to keep this list alphabetized.
3295 Reword %define entry a little to put less emphasis on the skeleton
3296 concept, which most users shouldn't have to think about.
3298 2007-01-26 Paul Eggert <eggert@cs.ucla.edu>
3300 Adjust to recent gnulib changes.
3301 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
3302 Add string.h, string_.h, unistd_.h, wchar_.h.
3303 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
3304 * src/system.h: Don't include <stpcpy.h>; this is now done by
3307 2007-01-23 Paolo Bonzini <bonzini@gnu.org>
3309 Simplify implementation of unqualified %code, implement macros for
3310 uniform treatment of boolean %define flags. Document %define.
3311 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
3312 b4_percent_code_ifdef): New.
3313 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
3314 * data/c++.m4: Define default value for global_tokens_and_yystype.
3315 * data/glr.cc: Likewise.
3316 * data/location.cc: Use b4_percent_define_flag_if.
3318 * doc/bison.texinfo (Decl Summary): Document %define.
3320 * src/parse-gram.y (Unqualified %code): Change muscle name to
3322 (content.opt): Default to empty.
3324 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
3326 Implement support for relative and absolute skeleton file names.
3327 Discussed starting at
3328 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
3329 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
3330 (Bison Options): Document in --skeleton entry.
3331 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
3332 full_skeleton can't necessarily hold all of pkgdatadir.
3333 If the specified skeleton file name contains a `/', don't prepend
3335 * src/parse-gram.y (prologue_declaration): If the specified skeleton
3336 file name contains a `/', prepend the grammar file directory.
3337 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
3338 * skeletons.at: New file.
3339 (relative skeleton file names): New test case.
3340 (installed skeleton file names): New test case.
3341 * tests/testsuite.at: Include skeletons.at.
3343 * bootstrap: Update copyright to 2007.
3345 2007-01-17 Paolo Bonzini <bonzini@gnu.org>
3347 * bootstrap: Remove occurrences of .#bootmp from the files.
3349 2007-01-17 Akim Demaille <akim@epita.fr>
3351 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
3353 Use per-type %printer.
3355 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
3357 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
3358 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
3359 djgpp/config.site, src/files.c, src/files.h, src/main.c,
3360 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
3361 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
3362 tests/glr-regression.at, tests/input.at, tests/local.at,
3363 tests/output.at, tests/torture.at: Update copyright to 2007.
3365 2007-01-16 Akim Demaille <akim@epita.fr>
3367 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
3369 (Calc++ Scanner): Exit with failure if we can't open the input
3371 Accept "-" standing for stdin.
3372 (Calc++ Top Level): Print the result only if the parsing was
3375 2007-01-16 Akim Demaille <akim@epita.fr>
3377 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
3379 2007-01-15 Paolo Bonzini <bonzini@gnu.org>
3380 and Joel E. Denny <jdenny@ces.clemson.edu>
3382 Clean up %define and %code implementation in M4 some. Most
3383 importantly, rename all related macros to be in the b4_percent_define
3384 and b4_percent_code namespaces. Also, complete support for `.' in
3385 %define variable names and %code qualifiers.
3386 * data/bison.m4 (b4_check_user_names): Check for special
3387 "SKELETON-NAMESPACE(name)" macros instead of using two nested
3389 (b4_get_percent_define, b4_get_percent_code): Rename to...
3390 (b4_percent_define_get, b4_percent_code_get): ... these.
3391 Extend documentation with examples.
3392 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
3393 b4_percent_define_skeleton_variables and
3394 b4_percent_code_skeleton_qualifiers.
3395 Expect any value for the %define variable `foo' to be stored in the
3396 macro named `b4_percent_define(foo)'; expect any %code blocks for the
3397 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
3398 expect any unqualified %code blocks to be stored in a macro named
3399 `b4_percent_code_unqualified'.
3400 Use m4_indir so that %define variable names and %code qualifiers can
3401 contain `.', which is allowed by the grammar parser.
3402 (b4_percent_define_default): New macro to set a default value for a
3404 (m4_wrap): Update wrapped code, and fix some underquoting.
3405 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
3406 Expect grammar uses of %define variables and %code qualifiers to be
3407 defined in b4_percent_define_user_variables and
3408 b4_percent_code_user_qualifiers.
3409 * data/c++.m4: Use b4_percent_define_default rather than
3410 m4_define_default. Fix some underquoting. Skeleton usage of %define
3411 variable define_location_comparison now implies skeleton usage of
3412 %define variable filename_type.
3413 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
3414 data/push.c, data/yacc.c: Update macro names.
3415 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
3418 2007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3420 DJGPP specific issues.
3422 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
3423 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
3425 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
3427 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
3428 run parsers in all tests so that Valgrind is invoked during
3429 maintainer-check-valgrind.
3430 (Duplicate representation of merged trees): Free all semantic values.
3431 (Duplicated user destructor for lookahead): Likewise.
3433 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
3435 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
3436 command-line prefix.
3437 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
3438 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
3439 miss Valgrind messages.
3440 (Exploding the Stack Size with Malloc): Likewise.
3442 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
3444 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
3445 locals. Reported by Juan Manuel Guerrero at
3446 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
3447 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
3448 Fix some indentation also.
3449 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
3450 explaining this issue.
3452 2007-01-09 Paolo Bonzini <bonzini@gnu.org>
3453 and Joel E. Denny <jdenny@ces.clemson.edu>
3455 Simplify union and prologue handling, and escape union and lex/parse
3456 params with digraphs.
3457 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
3458 values to the empty string since these are no longer guaranteed
3459 initialized by the front-end.
3460 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
3461 braces around b4_user_stype since this is no longer done by the
3463 * src/files.c, src/files.h (pre_prologue_obstack,
3464 post_prologue_obstack): Remove.
3465 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
3466 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
3467 with digraphs. This fixes lex params and parse params.
3468 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
3469 * src/output.c (prepare): Remove muscle insertion of the prologues.
3470 (output): Remove freeing of pre_prologue_obstack and
3471 post_prologue_obstack.
3472 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
3473 than prologue_augment for prologue parsing so you don't need prologue
3475 (grammar_declaration): For %union RHS, use `braceless' instead of
3476 "{...}" so that braces are already stripped and code is escaped with
3478 * src/reader.c (prologue_augment): Remove.
3479 (reader): Remove initialization of pre_prologue_obstack and
3480 post_prologue_obstack.
3481 * src/reader.h (prologue_augment): Remove.
3483 * data/c.m4: Remove stray parenthesis.
3485 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3487 Remove quotes from variables names in %define directives and from
3488 qualifiers in %code directives, and restrict the characters that are
3489 allowed in them to M4-friendly ones. For %define, continue to support
3490 the quoted form as a deprecated feature. Discussed starting at
3491 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
3492 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
3494 * doc/bison.texinfo (Prologue Alternatives): Update.
3495 (Decl Summary): In %defines entry, update mention of `%code requires'
3496 and `%code provides'.
3497 (C++ Location Values): Update %define uses.
3498 (Calc++ Parser Interface): Likewise.
3499 (Calc++ Parser): Likewise, and update `%code requires' uses.
3500 (Table of Symbols): Update %code documentation.
3501 * src/parse-gram.y (prologue_declaration): For %define variables, use
3502 `variable' instead of `STRING'.
3503 (grammar_declaration): For %code qualifiers, use `ID' instead of
3505 (variable): New nonterminal that takes an `ID' or a `STRING'.
3506 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
3508 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
3509 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
3510 (%define errors): Update %define uses.
3512 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3514 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
3515 instead of muscle_insert for %define values so that M4-special
3516 characters are replaced with digraphs.
3517 * tests/input.at (%define errors): Extend to check weird values.
3519 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3521 Instead of having skeletons declare all valid %define variables and
3522 %code qualifiers, provide macros that retrieve the associated values
3523 and build these lists automatically. Thus Bison will now warn when a
3524 variable or qualifier is not used by the skeleton in the current
3525 invocation regardless of whether it might sometimes be used by that
3526 skeleton in other invocations. Also, move all %define value macros to
3527 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
3528 form, which is replaced by %code.
3529 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
3530 (b4_check_user_names): ... this, and change the series of valid name
3531 arguments to a single list argument for names used in the skeleton
3532 similar to the existing list argument for names used in the grammar.
3533 Warn instead of complaining.
3534 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
3535 values and %code code, to format %code code properly, and to build
3536 lists of all %define variables and %code qualifiers used in the
3537 skeleton: b4_skeleton_percent_define_variables and
3538 b4_skeleton_percent_code_qualifiers.
3539 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
3541 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
3542 the skeleton names lists can finish building first. In place of
3543 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
3544 expect the lists b4_user_percent_define_variables and
3545 b4_user_percent_code_qualifiers.
3546 * data/c++.m4: Where setting default values for b4_parser_class_name,
3547 b4_location_type, b4_filename_type, b4_namespace, and
3548 b4_define_location_comparison, update their names to the
3549 b4_percent_define_ namespace.
3550 * data/glr.c: Don't use b4_check_percent_define_variables and
3551 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
3552 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
3553 (b4_parser_class_name, b4_namespace): Define these using
3554 b4_get_percent_define for parser_class_name and namespace.
3555 * data/location.cc: Use b4_get_percent_define.
3556 * data/push.c: Don't use b4_check_percent_define_variables and
3557 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
3558 * data/yacc.c: Likewise, and don't call m4_exit in
3559 b4_use_push_for_pull_if or m4_wrap code will never execute.
3560 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
3562 (muscle_grow_user_name_list): ... this for consistency with the
3563 terminology used in bison.m4.
3564 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
3565 %define variable names, and rename muscle used_percent_define_variables
3566 to user_percent_define_variables.
3567 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
3568 user_percent_code_qualifiers.
3570 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
3571 {CODE} form is no longer accepted.
3572 * tests/input.at (Reject bad %code qualifiers): Rename to...
3573 (Reject unused %code qualifiers): ... this, and update test output.
3574 (%define error): Update test output.
3576 2007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
3578 Check for unrecognized %define variables similar to checking for
3579 unrecognized %code qualifiers. Check for redefined %define variables.
3580 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
3582 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
3583 (b4_check_percent_define_variables): New, also wraps it.
3584 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
3585 variables using b4_check_percent_define_variables.
3586 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
3587 all those exercised in the test suite and all those listed in the
3588 `Default values' section of c++.m4. Are there others?
3589 * data/push.c, data/yacc.c: Declare no valid %define variables.
3590 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
3591 similar to muscle_find, but it works even when the muscle stores a
3593 (muscle_grow_used_name_list): New function for constructing the used
3594 name list muscles that b4_check_for_unrecognized_names requires.
3595 * src/parse-gram.y (prologue_declaration): Warn if a variable is
3596 %define'd more than once. Define the b4_used_percent_define_variables
3597 muscle with muscle_grow_used_name_list.
3598 (grammar_declaration): Abbreviate %code code with
3599 muscle_grow_used_name_list.
3600 * tests/input.at (%define errors): New.
3602 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3604 Provide warn_at, complain_at, and fatal_at function callbacks to the
3605 skeletons, and use this for %code qualifier complaints.
3606 * data/bison.m4 (b4_error_at): New, invoked by...
3607 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
3608 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
3609 @fatal_at(...@) directives.
3610 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
3611 qualifiers in b4_used_percent_code_qualifiers and to use
3613 * src/location.c, src/location.h (boundary_set_from_string): New global
3615 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
3617 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
3618 to b4_used_percent_code_qualifiers.
3619 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
3621 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
3622 (lineno): Rename to...
3623 (out_lineno): ... this so I don't misunderstand it again.
3624 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
3625 here; these newlines are in the input but not the output file.
3626 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
3627 (at_directive_perform): ... this new static function, and add handling
3628 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
3630 * tests/input.at (Reject bad %code qualifiers): Update test output with
3631 locations and extend.
3633 * tests/output.at (Output file name: [, Output file name: ]): Remove
3634 bogus comment about these tests failing.
3636 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3638 Clean up b4_check_percent_code_qualifiers a little.
3639 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
3640 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
3641 documentation and add examples.
3642 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
3645 2007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
3647 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
3648 unreliable -- especially when they're hidden inside another macro.
3649 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
3650 data/c.m4: Remove m4_divert(-1).
3651 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
3652 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
3653 m4_divert_push(0) and m4_divert_pop(0).
3654 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
3655 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
3656 pushed and popped by m4sugar, should be first on the stack.
3658 Provide warn, complain, and fatal function callbacks to the skeletons.
3659 This provides more flexibility than m4_fatal, improves the error
3660 message format, and captures messages for translation. Discussed
3662 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
3663 * data/bison.m4 (b4_error): New, invoked by...
3664 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
3665 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
3666 directives. Because these M4 macros might be called when the current
3667 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
3668 the previous removal of uses of m4_divert, which caused trouble.
3669 (b4_check_percent_code_qualifiers): Use b4_complain instead of
3670 m4_fatal to report unrecognized %code qualifiers.
3671 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
3672 push parser requests.
3673 * data/glr.c: Use b4_complain instead of m4_fatal to report
3674 non-deterministic push parser requests.
3675 Update @output usage to @output(...@) form.
3676 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
3677 report missing %defines. Update @output usage to @output(...@) form.
3678 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
3680 * src/main.c (main): Invoke skel_scanner_free.
3681 * src/scan-skel.h (skel_scanner_free): Prototype new function.
3682 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
3683 obstack_for_string from flex-scanner.h.
3684 (YY_DECL): Use to declare skel_lex static.
3685 (decode_at_digraphs): Remove; now handled in the new
3686 SC_AT_DIRECTIVE_ARG start condition.
3687 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
3689 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
3690 at_directive_argv): New static globals.
3691 (INITIAL): Use fail_for_invalid_at.
3692 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
3693 recognize the start of a generalized `@directive(...@)' form and
3695 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
3696 directive args (using the new obstack_for_string), to decode the
3697 contained @ diagraphs, and to perform the directive. It recognizes
3698 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
3700 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
3701 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
3703 (scan_skel): Initialize obstack_for_string on the first call.
3704 (skel_scanner_free): New function to free obstack_for_string.
3705 * tests/input.at (Reject bad %code qualifiers): Update test output.
3707 2007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
3709 Consolidate the 4 prologue alternative directives (%code, %requires,
3710 %provides, and %code-top) into a single %code directive with an
3711 optional qualifier field. Discussed at
3712 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
3713 * NEWS (2.3a+): Rewrite the existing entry for the prologue
3715 * doc/bison.texinfo (Prologue Alternatives): Update.
3716 (Decl Summary): Update to %code "requires" and %code "provides".
3717 (Calc++ Parser): Update to %code "requires".
3718 (Table of Symbols): Remove entries for %requires, %provides, and
3719 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
3720 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
3721 are replaced by b4_percent_code_provides and b4_percent_code_requires,
3722 which are skeleton-specific.
3723 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
3724 declare what %code qualifiers it supports and to complain if any other
3725 qualifiers were used in the grammar.
3726 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
3727 and b4_user_code([b4_percent_code_provides]) in place of
3728 b4_user_requires and b4_user_provides.
3729 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
3730 Add b4_user_code([b4_percent_code_top]) and
3731 b4_user_code([b4_percent_code]).
3732 Invoke b4_check_percent_code_qualifiers.
3733 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
3734 PERCENT_REQUIRES): Remove.
3735 (grammar_declaration): Remove RHS's for %code-top, %provides, and
3736 %requires. Rewrite the %code RHS as the unqualified form defining the
3737 muscle b4_percent_code. Add another RHS for the qualified %code form,
3738 which defines muscles of the form b4_percent_code_QUALIFIER and the
3739 b4_used_percent_code_qualifiers muscle.
3740 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
3741 PERCENT_REQUIRES): Remove.
3742 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
3743 %code "requires" and %code "provides".
3744 * tests/input.at (Reject bad %code qualifiers): New.
3746 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
3748 Use the new code_props interface for destructors and printers.
3749 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
3750 printer_location members, and change the type of the destructor and
3751 printer members to code_props.
3752 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
3753 symbol_printer_get, semantic_type_destructor_set,
3754 semantic_type_printer_set, default_tagged_destructor_set,
3755 default_tagless_destructor_set, default_tagged_printer_set,
3756 default_tagless_printer_set): Use code_props in arguments and return
3757 types in place of char const * and location.
3758 (symbol_destructor_location_get, symbol_printer_location_get): Remove
3759 since the locations are now contained in the return of
3760 symbol_destructor_get and symbol_printer_get.
3761 * src/output.c (symbol_destructors_output, symbol_printers_output):
3763 (symbol_code_props_output): ... this to eliminate duplicate code.
3764 (output_skeleton): Update to use symbol_code_props_output.
3765 * src/reader.c (symbol_should_be_used): Update use of
3766 symbol_destructor_get.
3767 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
3768 Update uses of the various _destructor_set and _printer_set functions.
3769 * src/symtab.c: (default_tagged_destructor_location,
3770 default_tagless_destructor_location, default_tagged_printer_location,
3771 default_tagless_printer_location): Remove since we...
3772 (default_tagged_destructor, default_tagless_destructor,
3773 default_tagged_printer, default_tagless_printer): ... change the type
3774 of these to code_props.
3775 (symbol_new, semantic_type_new, symbol_destructor_set,
3776 semantic_type_destructor_set, symbol_destructor_get,
3777 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
3778 symbol_check_alias_consistency, default_tagged_destructor_set,
3779 default_tagless_destructor_set, default_tagged_printer_set,
3780 default_tagless_printer_set): Update.
3781 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
3782 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
3784 (symbol_print): Use SYMBOL_CODE_PRINT.
3786 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
3788 Use the new code_props interface for rule actions.
3789 * src/symlist.h (symbol_list): Replace action, action_location, and
3790 used members with a code_props action_props member.
3791 * src/reader.c (symbol_should_be_used, grammar_rule_check,
3792 grammar_midrule_action, grammar_current_rule_merge_set,
3793 grammar_current_rule_symbol_append, packgram): Update.
3794 * src/scan-code.h (translate_rule_action): Remove, no longer used.
3795 * src/scan-code.l (handle_action_dollar): Update.
3796 (translate_rule_action): Remove, no longer used.
3797 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
3799 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
3801 Use the new code_props interface in parse-gram.y.
3802 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
3803 Update all uses of translate_* functions to use the new code_props
3804 interface and to use gram_scanner_last_string_free and
3805 code_scanner_last_string_free where possible.
3806 (grammar_declaration): symbol_list_destructor_set and
3807 symbol_list_printer_set now perform the translation, so don't do it
3808 here. Use gram_scanner_last_string_free where possible.
3809 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
3810 translate_code): Remove, no longer used.
3811 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
3812 symbol_list_printer_set): Perform code translation here rather than
3813 depending on the caller to do so.
3815 * src/symlist.h (struct symbol_list): Correct some documentation typos.
3816 * src/scan-gram.h (gram_last_string): Remove declaration.
3817 * src/scan-gram.l (last_string): Declare it static.
3819 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
3821 Encapsulate code properties and related functionality for the various
3822 destructors, printers, and actions into a code_props structure and
3823 interface. This patch merely implements code_props in scan-code.h and
3824 scan-code.l. Future patches will rewrite other modules to use it.
3825 Discussed starting at
3826 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
3827 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
3828 consistently initialize const structs that have an empty location
3830 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
3831 to ensure consistency.
3832 * src/scan-code.h (code_props): New structure.
3833 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
3834 function, macro, and const global variable for initializing a
3835 code_props with no code.
3836 (code_props_plain_init, code_props_symbol_action_init,
3837 code_props_rule_action_init, code_props_translate_code): The rest of
3838 the new code_props functional interface. Among other things, the init
3839 functions set the code_props kind field so that
3840 code_props_translate_code will know whether to behave like
3841 translate_symbol_action, translate_rule_action, or translate_code.
3842 These old translate functions must remain until all other modules are
3843 updated to use the new code_props interface.
3844 (code_scanner_last_string_free): New function similar to
3845 gram_scanner_last_string_free.
3846 (code_scanner_free): Add documentation.
3847 * src/scan-code.l: Implement the new interface.
3848 (code_lex): Make it static, add a code_props* argument, and remove the
3850 (last_string): New static global similar to the one in scan-gram.l.
3851 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
3853 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
3854 code_props since Bison may one day use this information for destructors
3856 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
3857 (handle_action_dollar): Use symbol_list_n_get and set used flag
3858 directly since symbol_list_n_used_set is removed.
3859 (translate_action): Add a code_props* argument and remove the rule,
3860 action, and location arguments. Pass the code_props* on to code_lex.
3861 (translate_rule_action, translate_symbol_action, translate_code):
3862 Rewrite as wrappers around the new code_props interface.
3863 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
3864 it would eventually need to break the encapsulation of code_props.
3866 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
3868 * etc/.cvsignore: New.
3870 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
3872 Add maintainer-push-check to run maintainer-check using push parsing in
3873 place of pull parsing where available.
3874 * Makefile.am (maintainer-push-check): New.
3875 * data/bison.m4 (b4_use_push_for_pull_if): New.
3876 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
3877 appropriately based on their existing values.
3878 (yypush_parse): Don't print push-parser-specific diagnostics if push
3879 parsing is being used in place of pull parsing.
3880 * data/yacc.c: If push parsing should replace pull parsing, redirect to
3882 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
3883 variable, and insert b4_use_push_for_pull_flag into muscles.
3884 * tests/Makefile.am (maintainer-push-check): New.
3886 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
3888 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
3889 (whether successful or failed) so that yypush_parse can be invoked
3890 again to start a new parse using the same yypstate.
3891 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
3892 check multiple yypull_parse invocations on the same yypstate. For pull
3893 mode, extend to check multiple yyparse invocations.
3894 (Exploding the Stack Size with Alloca): Extend to try with
3896 (Exploding the Stack Size with Malloc): Likewise.
3898 * tests/calc.at (Simple LALR Calculator): Don't specify
3899 %skeleton "push.c" since %push-pull-parser implies that now.
3900 * tests/headers.at (export YYLTYPE): Don't check for the push
3901 declarations. Otherwise, this test case can't be used to see if push
3902 mode can truly emulate pull mode.
3903 * tests/input.at (Torturing the Scanner): Likewise.
3904 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
3905 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
3906 AT_YACC_IF, which now includes the case of push mode since %skeleton
3907 need not be used for push mode. This will be more intuitive once
3908 push.c is renamed to yacc.c.
3910 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
3912 For push mode, convert yyparse from a macro to a function, invoke yylex
3913 instead of passing a yylexp argument to yypull_parse, and don't
3914 generate yypull_parse or yyparse unless %push-pull-parser is declared.
3915 Discussed starting at
3916 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
3917 * data/bison.m4 (b4_pull_if): New.
3918 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
3919 * data/push.c: Improve M4 quoting a little.
3920 (b4_generate_macro_args, b4_parenthesize): Remove.
3921 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
3922 any time a pull parser is requested.
3923 Don't #define this as a wrapper around yypull_parse. Instead, when
3924 both push and pull are requested, make it a function that does that
3926 (yypull_parse): If there's a b4_prefix, #define this to
3927 b4_prefix[pull_parse] when both push and pull are requested.
3928 Don't define this as a function unless both push and pull are
3930 Remove the yylexp argument and hard-code yylex invocation instead.
3931 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
3933 * src/getargs.c (pull_parser): New global initialized to true.
3934 * getargs.h (pull_parser): extern it.
3935 * src/output.c (prepare): Insert pull_flag muscle.
3936 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
3937 (prologue_declaration): Set both push_parser and pull_parser = true for
3938 %push-pull-parser. Set push_parser = true and pull_parser = false for
3940 * src/scan-gram.l: Don't accept %push_parser as an alternative to
3941 %push-parser since there's no backward-compatibility concern here.
3942 Scan %push-pull-parser.
3943 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
3944 instead of %push-parser.
3945 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
3946 prototype it in the module that calls yyparse.
3947 * tests/input.at (Torturing the Scanner): Likewise.
3948 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
3950 2006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
3952 Update etc/bench.pl. Optimize push mode a little (the yyn change
3953 deserves most of the credit).
3954 * Makefile.am (SUBDIRS): Add etc subdirectory.
3955 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
3956 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
3957 yytoken, yyval, and yyloc declarations to...
3958 (yyparse or yypush_parse): ... here to improve performance. For
3959 yypush_parse invocations after the first, be sure to assign yyn its old
3961 (yypstate_new): Don't bother initializing the yyresult field since the
3962 initial value isn't used.
3963 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
3964 remove the #define that, in push mode, set it to yyps->NAME.
3965 * etc/Makefile.am: New.
3966 * etc/bench.pl: Remove and build it instead from...
3967 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
3968 "tests/bison" from the build directory by default rather than just
3969 invoking "bison" from $PATH.
3970 (calc_grammar): Update push parser code: don't declare yylval globally,
3971 don't define yyparse_wrapper, and don't #define yyparse.
3972 (bench_grammar): Update to check all working combinations of yacc.c,
3973 push.c, impure, pure, pull, and push.
3975 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
3977 For push mode, add pull wrappers around yypush_parse.
3978 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
3979 (yypull_parse): New function wrapping yypush_parse.
3980 (yyparse): New #define wrapping yypull_parse.
3981 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
3983 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
3984 prototype yylex in the module that calls yyparse, and don't prototype
3985 yyparse there. Otherwise, the yyparse expansion won't compile.
3986 * tests/input.at (Torturing the Scanner): Likewise.
3988 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
3990 Enable push parsers to operate in impure mode. Thus, %push-parser no
3991 longer implies %pure-parser. The point of this change is to move
3992 towards being able to test the push parser code by running the entire
3993 test suite as if %push-parser had been declared.
3994 * data/push.c (yypush_parse): For impure mode, remove the
3995 yypushed_char, yypushed_val, and yypushed_loc arguments.
3996 Instead, declare these as local variables initialized to the global
3997 yychar, yylval, and yylloc.
3998 For the first yypush_parse invocation only, restore the initial values
3999 of these global variables when it's time to read a token since they
4000 have been overwritten.
4001 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
4003 * tests/calc.at (Simple LALR(1) Calculator): Always declare
4004 %pure-parser along with %push-parser since this test case was designed
4005 for pure push parsers.
4006 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
4007 (AT_YACC_OR_PUSH_IF): New.
4008 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
4009 add a note that it's still wrong for some cases (as it has been for a
4011 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
4012 %push-parser no longer implies %pure-parser.
4014 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4016 Remove some unnecessary differences between the pull parser code and
4017 the push parser code. This patch enables yynerrs in push mode.
4018 * data/push.c: Reformat M4 a little.
4019 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
4020 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
4021 because push mode is on. Instead, if pure mode is on, move yynerrs
4023 (b4_declare_parser_state_variables): ... here.
4024 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
4025 to yyps->NAME so it can be used in yypush_parse.
4026 (yypush_parse): Don't omit uses of yynerrs in push mode.
4028 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4030 Fix bug such that the first pushed token's value and location are
4031 sometimes overwritten (sometimes by %initial-action) before being used.
4032 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
4033 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
4034 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
4035 more closely mimic the pull parser logic.
4036 Don't copy the pushed token to yychar, yylval, and yylloc until it's
4037 time to read a token, which is after any initialization of yylval and
4039 (gottoken): Rename label to...
4040 (yyread_pushed_token): ... for clarity and to avoid infringing on the
4043 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4045 Rearrange initialization of the parser state variables so that the
4046 skeleton doesn't have to have a copy for pull mode and another for push
4047 mode. This patch also fixes at least a bug such that yylloc was not
4048 initialized (with b4_location_initial_line and
4049 b4_location_initial_column) upon calling yypush_parse. However, that
4050 initialization now overwrites the first token's location;
4051 %initial-action assigning @$ already did the same thing, and both bugs
4052 will be fixed in a later patch.
4053 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
4054 (b4_declare_parser_state_variables): Remove initialization of yytoken,
4055 yyss, yyvs, yyls, and yystacksize.
4056 (yypstate_new): Remove initialization of some yypstate fields: yystate,
4057 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
4059 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
4060 yyps->NAME so it can be used in yypush_parse.
4061 (yyparse or yypush_parse): For yypush_parse, don't print the
4062 "Starting parse" diagnostic for invocations after the first.
4063 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
4064 yypush_parse, only do it for the first invocation.
4065 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
4066 initialization to occur in yypush_parse but only on the first
4069 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
4071 * data/push.c: Add CPP guards around push parser declarations in both
4072 the header and the code file.
4073 In the code file, move the push parser declarations to the same place
4074 they appear in the header file.
4075 Clean up the M4 some, especially the inconsistent underquoting in
4076 some b4_c_function_def and b4_c_function_decl uses.
4078 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
4080 Encapsulate the push parser state variables into an M4 macro so the
4081 push skeleton doesn't have to list them again for pull mode's yyparse.
4082 For push mode, remove yypush_parse's local equivalents of these
4083 variables to eliminate unnecessary copying between the two sets at
4084 run-time. This patch also fixes at least a bug related to multiple
4085 %initial-action invocations in push mode.
4086 * data/push.c (b4_declare_parser_variables): Rename to...
4087 (b4_declare_scanner_communication_variables): ... this for clarity and
4089 (b4_declare_yyparse_variables): Remove and move its contents to the one
4090 spot where it was invoked.
4091 (b4_declare_parser_state_variables): New macro containing the parser
4092 state variables required by push mode.
4093 (struct yypstate): Replace all fields but yynew with
4094 b4_declare_parser_state_variables.
4095 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
4096 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
4097 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
4098 (yyparse or yypush_parse): For yyparse in pull mode, replace local
4099 parser state variable declarations with
4100 b4_declare_parser_state_variables.
4101 Don't initialize parser state variables when calling yypush_parse since
4102 yypstate_new already does that.
4103 Invoke the user's initial action only upon the first yypush_parse
4105 Remove all code that copies between the local parser state variables
4108 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
4110 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
4111 prevent a name collision in a future patch where these names will
4112 sometimes be #define'd.
4113 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
4114 since it no longer has the same name as the existing argument.
4115 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
4117 2006-12-19 Paolo Bonzini <bonzini@gnu.org>
4118 and Joel E. Denny <jdenny@ces.clemson.edu>
4120 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
4121 that the argument is case-insensitive, and there's no `=' here.
4122 For the %skeleton entry, mention that %language is better.
4123 (Bison Options): Likewise for --language and --skeleton. Move the
4124 --skeleton entry so that the `Tuning the parser' section is sorted
4125 alphabetically on long options.
4126 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
4127 %language directive in detail here; cross-reference the %language
4128 documentation instead.
4129 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
4130 `%require "2.3b"' so that the example is always up-to-date.
4131 (Table of Symbols): Add entries for %language and %skeleton.
4132 * examples/extexi (normalize): Instead of replacing every %require
4133 argument with the current Bison version, just substitute for
4134 `@value{VERSION}'. This guarantees that we're testing what actually
4135 appears in the documentation.
4136 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
4137 rather than `@VERSION@'.
4139 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
4141 * NEWS: Reword the %language news a bit, and put it earlier.
4143 * src/getargs.c (skeleton_arg): Last arg is now location const *.
4144 Rewrite to simplify the logic.
4145 (language_argmatch): Likewise.
4146 (program_name): We now own this var.
4147 * src/getargs.h (struct bison_language): Use char[] rather than
4150 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
4152 * src/complain.c (program_name): Remove decl; no longer needed.
4153 * src/main.c (program_name): Remove; now belongs to getargs.
4155 2006-12-18 Paolo Bonzini <bonzini@gnu.org>
4157 * NEWS: Document %language.
4159 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
4161 * data/c-skel.m4, data/c++-skel.m4: New files.
4162 * data/glr.c: Complain on push parsers.
4164 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
4166 (Decl Summary): Document %language and %skeleton.
4167 (Command line): Document -L.
4169 * examples/extexi: Rewrite %require directive.
4170 * examples/calc++/Makefile.am: Pass VERSION to extexi.
4172 * src/files.c (compute_exts_from_gc): Look in language structure
4174 (compute_file_name_parts): Check whether .tab should be added.
4175 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
4176 (language, skeleton_arg, language_argmatch): New.
4177 (long_options): Add --language.
4178 (getargs): Use skeleton_arg, add -L/--language.
4179 * src/getargs.h: Include location.h.
4180 (struct bison_language, language, skeleton_arg, language_argmatch): New.
4181 * src/output.c (prepare): Pick default skeleton from struct language.
4182 Don't dispatch C skeletons here.
4183 * src/parse-gram.y (PERCENT_LANGUAGE): New.
4184 (prologue_declaration): Add "%language" rule, use skeleton_arg.
4185 * src/scan-gram.l ("%language"): New rule.
4187 * tests/calc.at: Test %skeleton and %language.
4188 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
4189 (AT_GLR_IF): Look for %skeleton "glr.cc".
4190 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
4191 (AT_YACC_IF): Reject %language.
4193 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
4195 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
4196 since it wasn't used; only the typedef name 'semantic_type' is needed.
4197 Also, omit trailing white space.
4199 * bootstrap: Sync from coreutils.
4200 (gnulib_extra_files): Add build-aux/announce.gen.
4201 (slurp): Adjust .gitignore files like .cvsignore files.
4202 * build-aux/announce-gen: Remove from CVS, since bootstrap
4205 2006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
4207 Make %push-parser imply %pure-parser. This fixes several bugs; see
4208 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
4209 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
4211 * data/push.c: Don't bother testing b4_push_if when deciding whether
4212 to expand b4_declare_parser_variables globally.
4213 (yypush_parse): Likewise in here.
4215 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
4216 (yy_reduce_print): Reformat M4 for readability.
4218 2006-12-15 Bob Rossi <bob@brasko.net>
4219 and Joel Denny <jdenny@ces.clemson.edu>
4221 * data/push.c (yypstate): Add typedef, and update all uses of
4222 struct yypstate to just yypstate.
4223 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
4225 2006-12-14 Bob Rossi <bob@brasko.net>
4227 * data/push.c (yypush_parse): Declare prototype regardless of
4230 2006-12-14 Bob Rossi <bob@brasko.net>
4232 * data/push.c (yyparse): Remove the prototype and the #define when in
4235 2006-12-13 Bob Rossi <bob@brasko.net>
4237 * data/push.c (yypstate_init): Rename to...
4238 (yypstate_new): ... this and use b4_c_function_def.
4239 (yypstate_delete): New.
4240 (yypush_parse): Change parameters yynval and yynlloc to be const.
4241 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
4242 yypstate_delete functions.
4244 2006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
4246 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
4247 strange test case titles. Reported by Bob Rossi.
4249 2006-12-13 Paul Eggert <eggert@cs.ucla.edu>
4251 * TODO: Add pointer to Sylvain Schmitz's work on static detection
4252 of potential ambiguities in GLR grammers.
4254 2006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
4256 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
4257 `bison ', use m4_index instead of m4_substr since chopping up a string
4258 containing M4-special characters causes problems here.
4260 Fix a couple of bugs related to special characters in user-specified
4261 file names, and make it easier for skeletons to compute output file
4262 names with the same file name prefix as Bison-computed output file
4264 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
4265 b4_parser_file_name and b4_spec_defines_file instead of
4266 @output_parser_name@ and @output_header_name@, which are now redundant.
4267 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
4268 b4_parser_file_name, b4_spec_defines_file, and the new
4269 @basename(FILENAME@) instead of @output_parser_name@ and
4270 @output_header_name@, which inappropriately escaped the file names as
4272 * src/files.c (all_but_ext): Remove static qualifier.
4273 (compute_output_file_names): Move `free (all_but_ext)' to...
4274 (output_file_names_free): ... here since all_but_ext is needed later.
4275 * src/files.h (all_but_ext): Extern.
4276 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
4277 exactly what MUSCLE_INSERT_STRING used to do.
4278 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
4279 characters are escaped properly.
4280 * src/output.c (prepare): Define muscle file_name_all_but_ext as
4282 For pkgdatadir muscle, maintain previous functionality by using
4283 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
4284 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
4285 digraphs would never be expanded. Hopefully no one has M4-special
4286 characters in his Bison installation path.
4287 * src/scan-skel.l: Don't parse @output_header_name@ and
4288 @output_parser_name@ anymore since they're now redundant.
4289 In @output, use decode_at_digraphs.
4290 Parse a new @basename command that invokes last_component.
4291 (decode_at_digraphs): New.
4292 (BASE_QPUTS): Remove unused.
4293 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
4294 (Output file name): New tests.
4296 2006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
4298 Warn about output files that are generated by the skeletons and that
4299 conflict with other output files.
4300 * data/glr.c: Don't generate the header file here when glr.cc does.
4301 * src/files.c (file_names, file_names_count): New static globals.
4302 (compute_output_file_names): Invoke output_file_name_check for files
4303 not generated by the skeletons and remove existing checks.
4304 (output_file_name_check): New function that warns about conflicting
4306 (output_file_names_free): Free file_names.
4307 * src/files.h (output_file_name_check): Declare.
4308 * src/scan-skel.l: Invoke output_file_name_check for files generated by
4310 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
4311 (Conflicting output files): New tests.
4313 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4315 * doc/bison.texinfo: Fix a couple of typos.
4317 2006-12-08 Bob Rossi <bob@brasko.net>
4319 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
4321 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
4323 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
4324 (yypush_parse): Rename yypvars argument to yyps and remove redundant
4326 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
4327 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
4329 2006-12-07 Bob Rossi <bob@brasko.net>
4330 and Joel Denny <jdenny@ces.clemson.edu>
4332 * data/push.c (yypvarsinit): Change return type from void* to struct
4333 yypvars*. No longer cast to void* on return.
4334 (struct yypvars): Remove yylen since it need not be remembered between
4335 yypushparse invocations.
4336 (yypushparse): Don't copy between yylen and pv->yylen.
4338 2006-12-05 Bob Rossi <bob@brasko.net>
4340 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
4341 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
4342 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
4343 (struct yypvars): Remove b4_declare_parser_variables.
4344 (yypvarsinit): Remove init code for removed variables.
4345 (global scope): Do not declare b4_declare_parser_variables if
4347 (yypushparse): Add b4_declare_parser_variables.
4348 Init new local variables, and remove init code for removed
4351 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
4352 and yyparse for other modes.
4353 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
4354 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
4355 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
4356 (AT_PURE_LEX_IF): True if pure or push parser.
4358 2006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
4360 Document Yacc prologue alternatives and default %destructor's and
4361 %printer's as experimental. Don't mention Java yet. Discussed at
4362 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
4363 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
4364 (2.3a): Annotate this entry to say the old forms of these features were
4366 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
4367 Table of Symbols): Say they're experimental. Comment out any mention
4368 of Java (we'll want this back eventually).
4370 2006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
4372 Support a file name argument to %defines. Deprecate `=' in
4373 %file-prefix, %name-prefix, and %output. Discussed at
4374 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
4375 * NEWS (2.3a+): Mention.
4376 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
4377 form of %defines, and remove `=' from entries for %file-prefix,
4378 %name-prefix, and %output.
4379 * src/parse-gram.y (prologue_declaration): Implement.
4380 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
4381 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
4382 all but one occurrence of %name-prefix.
4383 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
4384 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
4385 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
4386 occurrence of each of %file-prefix and %output. Add check for %defines
4388 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
4389 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
4390 Remove the `=' from %output.
4392 2006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
4394 Don't escape $ in test case titles since Autoconf 2.61 now does that
4396 * tests/actions.at (Default %printer and %destructor are not for error
4397 or $undefined): Here.
4398 (Default %printer and %destructor are not for $accept): Here.
4399 * tests/input.at (Invalid $n and @n): Here.
4401 2006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
4403 Rename <!> to <>. Discussed starting at
4404 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
4405 * NEWS (2.3a+): Update.
4406 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
4408 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
4409 * src/scan-gram.l (INITIAL): Implement.
4410 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
4411 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
4413 * tests/actions.at (Default tagless %printer and %destructor,
4414 Default tagged and per-type %printer and %destructor,
4415 Default %printer and %destructor are not for error or $undefined,
4416 Default %printer and %destructor are not for $accept,
4417 Default %printer and %destructor for mid-rule values): Update.
4418 * tests/input.at (Default %printer and %destructor redeclared,
4419 Unused values with default %destructor): Update.
4421 2006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
4423 Don't let %prec take a nonterminal.
4424 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
4426 * tests/input.at (%prec takes a token): New test checking that %prec
4427 won't take a nonterminal.
4429 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
4431 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
4432 it was double-quoted.
4433 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
4434 grammar is maintained with Bison's highest standards.
4435 * src/getargs.c: Fix some typos in Doxygen comments.
4437 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
4439 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
4440 later. Reported by Paul Eggert in
4441 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
4442 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
4443 * src/scan-code.l (translate_action): Don't bother invoking
4444 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
4445 (code_scanner_free): Instead of invoking
4446 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
4448 * src/scan-gram.l (gram_scanner_free): Likewise.
4449 * src/scan-skel.l (scan_skel): Likewise.
4451 2006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
4453 * src/files.c (tr): Change return type to void.
4454 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
4455 has been called previously for the same key.
4456 (muscle_find): Return storage instead of value so that
4457 --enable-gcc-warnings doesn't produce warnings that the return discards
4458 const. aver that the value and storage are the same since storage
4459 could potentially be NULL when value is not.
4460 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
4463 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
4465 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
4466 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
4467 us a slightly cleaner distribution, and also works.
4468 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
4471 2006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
4472 and Paul Eggert <eggert@cs.ucla.edu>
4474 Don't let Bison leak memory except when it complains.
4475 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
4476 (spec_defines_file, dir_prefix): Now char *, not const char *,
4477 since they are freed.
4478 * src/files.c: Likewise.
4479 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
4481 (tr): Now operates in-place. All uses changed.
4482 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
4484 (compute_file_name_parts, compute_output_file_names): Don't store
4485 read-only data in variables that will be freed.
4486 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
4487 src_extension, and header_extension.
4488 (output_file_names_free): New public function to free
4489 spec_verbose_file, spec_graph_file, spec_defines_file,
4490 parser_file_name, and dir_prefix.
4491 * src/getargs.c (getargs): Don't store read-only data in variables that
4493 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
4494 (which previously existed but was unused), and quotearg_free.
4495 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
4496 * src/muscle_tab.c: Likewise.
4497 (muscle_entry): Make the value char const *,
4498 and add a new storage member that is char * and can be freed.
4499 (muscle_entry_free): New private function.
4500 (muscle_init): Use it instead of free.
4501 (muscle_insert, muscle_grow): Update and use new storage member.
4502 (muscle_code_grow): Free the string passed to muscle_grow
4503 since it's not needed anymore.
4504 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
4505 add a new `char *code' member.
4506 ("{...}"): Declare semantic type as code.
4507 * src/scan-code.h (translate_rule_action):
4508 (translate_symbol_action, translate_code, translate_action): Return
4509 `char const *' rather than `char *' since external code should not free
4511 * src/scan-code.l: Likewise.
4512 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
4513 which is "{...}" in the parser.
4514 * tests/Makefile.am (maintainer-check-valgrind): Set
4515 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
4517 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
4519 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
4520 expecting a non-zero exit status sets --leak-check=summary and
4521 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
4522 this case, and we don't want to hear about it.
4524 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
4526 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
4527 instead of from the template, to simplify configuration a bit.
4528 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
4529 and m4/wint_t.m4, as they are needed with the latest gnulib.
4531 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
4533 Disable unset/unused mid-rule value warnings by default, and recognize
4534 --warnings=midrule-values to enable them. Discussed starting at
4535 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
4536 * NEWS (2.3a+): Mention.
4537 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
4538 warnings): Add entry for midrule-values subargument.
4539 * src/reader.c (symbol_should_be_used): Don't return true just because
4540 the value is a set/used mid-rule value unless
4541 --warnings=midrule-values was specified.
4542 * tests/input.at (Unused values, Unused values before symbol
4543 declarations): Run tests with and without --warnings=midrule-values.
4545 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
4546 than LIST_FREE directly.
4548 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
4550 Finish implementing --warnings=error, which should not be implied by
4551 --warnings=all (or by its synonyms -W and --warnings without
4553 * src/complain.c (set_warning_issued): New function to report that
4554 warnings are being treated as errors and to record an error if so.
4556 (warn_at, warn): ... here.
4557 * src/getargs.c (warnings_args, warnings_types): Reorder so that
4558 "error - warnings are errors" does not appear above "all - all of the
4560 (getargs): For -W and --warnings without subarguments, don't let
4561 FLAGS_ARGMATCH set warnings_error in warnings_flag.
4562 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
4564 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
4566 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
4567 empty subargument list. For example: `bison --warnings= parser.y'.
4569 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4571 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
4572 the parser header file so that gcc doesn't warn.
4574 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4576 Split the default %destructor/%printer into two kinds: <*> and <!>.
4577 Discussed starting at
4578 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
4579 * NEWS (2.3a+): Mention.
4580 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
4581 previous change today related to mid-rules.
4582 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
4583 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
4584 (TYPE_TAG_ANY): Add as <*>.
4585 (TYPE_TAG_NONE): Add as <!>.
4586 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
4588 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
4589 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
4590 * src/symlist.c (symbol_list_default_new): Split into tagged and
4592 (symbol_list_destructor_set, symbol_list_printer_set): Split
4593 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
4594 SYMLIST_DEFAULT_TAGLESS.
4595 * src/symlist.h: Update symbol_list_default*_new prototypes.
4596 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
4597 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
4598 * src/symtab.c (default_destructor, default_destructor_location,
4599 default_printer, default_printer_location): Split each into tagged and
4601 (symbol_destructor_get, symbol_destructor_location_get,
4602 symbol_printer_get, symbol_printer_location_get): Implement tagged
4603 default and tagless default cases.
4604 (default_destructor_set, default_printer_set): Split each into tagged
4605 and tagless versions.
4606 * src/symtab.h: Update prototypes.
4607 * tests/actions.at (Default %printer and %destructor): Rename to...
4608 (Default tagless %printer and %destructor): ... this, and extend.
4609 (Per-type %printer and %destructor): Rename to...
4610 (Default tagged and per-type %printer and %destructor): ... this, and
4612 (Default %printer and %destructor for user-defined end token): Extend.
4613 (Default %printer and %destructor are not for error or $undefined):
4615 (Default %printer and %destructor are not for $accept): Update.
4616 (Default %printer and %destructor for mid-rule values): Extend.
4617 * tests/input.at (Default %printer and %destructor redeclared): Extend.
4618 (Unused values with default %destructor): Extend.
4620 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4622 Don't apply the default %destructor/%printer to an unreferenced midrule
4624 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
4625 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
4626 like $@n instead of just @n so that the default %destructor/%printer
4627 logic doesn't see them as user-defined symbols.
4628 (symbol_is_dummy): Check for both forms of the name.
4629 * src/reader.c (packgram): Remove the `$' from each midrule symbol
4630 name for which the midrule value is referenced in any action.
4631 * tests/actions.at (Default %printer and %destructor for mid-rule
4633 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
4634 for change to dummy symbol names.
4636 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
4638 Warn about unset midrule $$ if the corresponding $n is used.
4639 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
4641 (packgram): Before invoking grammar_rule_check on any rule, make sure
4642 all actions have already been scanned in order to set `used' flags.
4643 Otherwise, checking that a midrule's $$ is set will not always work
4644 properly because the midrule check must forward-reference the midrule's
4646 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
4649 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
4651 More improvements to the documentation of the prologue alternatives:
4652 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
4654 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
4655 some text to clarify the relative importance of the new directives and
4656 to show how these directives may be viewed as code labels.
4658 2006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
4660 Similar to the recently removed %before-header, add %code-top as the
4661 alternative to the pre-prologue. Mentioned at
4662 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
4663 Also, let the prologue alternatives appear in the grammar section.
4664 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
4665 (prologue_declaration): Move the existing prologue alternatives to...
4666 (grammar_declaration): ... here and add %code-top.
4667 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
4669 Clean up and extend documentation for the prologue alternatives.
4670 * NEWS (2.3a+): Describe prologue alternatives.
4671 * doc/bison.texinfo (Prologue): Move discussion of prologue
4673 (Prologue Alternatives): ... this new section, and extend it to discuss
4674 all 4 directives in detail.
4675 (Table of Symbols): Clean up discussion of prologue alternatives and
4678 2006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4680 DJGPP specific issues.
4682 * djgpp/config.bat: config.hin has been moved to lib. Adjust
4683 config.bat accordingly.
4684 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
4685 * djgpp/config.site: Likewise.
4687 2006-10-16 Paolo Bonzini <bonzini@gnu.org>
4689 Replace %*-header with %provides, %requires, %code. See discussion at
4690 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
4692 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
4693 (b4_user_start_header): Remove.
4694 * data/glr.c: Use new macros instead of b4_*start_header
4696 * data/glr.cc: Likewise.
4697 * data/lalr1.cc: Likewise.
4698 * data/push.c: Likewise.
4699 * data/yacc.c: Likewise.
4701 * doc/bison.texinfo: Remove %before-header, rename
4702 %{start,end,after}-header to %requires, %provides, %code.
4704 * src/parse-gram.y: Likewise (also rename token names accordingly).
4705 * src/scan-gram.l: Likewise.
4706 * tests/actions.at: Likewise.
4708 2006-10-14 Paul Eggert <eggert@cs.ucla.edu>
4710 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
4711 Problem reported by Joel E. Denny.
4713 2006-10-14 Jim Meyering <jim@meyering.net>
4715 (Sync from coreutils.)
4716 Work also when the working directory (with e.g. coreutils sources)
4717 is version controlled with git, rather than CVS.
4718 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
4720 In messages and comments, say e.g., "checked-out sources",
4721 rather than "CVS sources".
4722 (version_controlled_file): New function. Work for git as well as
4723 for CVS. Don't use grep's -q option.
4724 (slurp): Call it here, in place of CVS-specific code.
4726 2006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
4728 Fix testsuite for ./configure --enable-gcc-warnings:
4729 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
4730 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
4731 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
4732 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
4733 * test/regression.at (Diagnostic that expects two alternatives):
4736 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
4738 * bootstrap.conf (gnulib_modules): Add config-h.
4739 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
4740 worry about HAVE_CONFIG_H.
4741 * lib/abitset.c: Likewise.
4742 * lib/bitset.c: Likewise.
4743 * lib/bitset_stats.c: Likewise.
4744 * lib/bitsetv-print.c: Likewise.
4745 * lib/bitsetv.c: Likewise.
4746 * lib/ebitset.c: Likewise.
4747 * lib/get-errno.c: Likewise.
4748 * lib/lbitset.c: Likewise.
4749 * lib/subpipe.c: Likewise.
4750 * lib/timevar.c: Likewise.
4751 * lib/vbitset.c: Likewise.
4752 * lib/bitset.c: Include "bitset.h" first, to test interface.
4753 * lib/bitset_stats.c: Include "bitset_stats.h" first.
4754 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
4755 * lib/bitsetv.c: Include "bitsetv.h" first.
4756 * lib/get-errno.c: Include "get-errno.h" first.
4757 * m4/.cvsignore: Add config-h.m4.
4758 * tests/actions.at (Default %printer and %destructor for ...):
4759 Adjust expected line numbers in output to reflect removal of #if
4760 HAVE_CONFIG_H lines.
4761 * tests/glr-regression.at (Missed %merge type warnings when ...):
4763 * tests/regression.at (Braced code in declaration in rules section):
4765 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
4766 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
4767 Include <config.h> unconditionally.
4769 * bootstrap: Sync from coreutils, as follows:
4771 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
4773 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
4774 variable was sometimes used without being initialized. This
4775 messed up the installation of the INSTALL file in some cases.
4777 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
4779 * bootstrap (usage, main program, symlink_to_gnulib): Add option
4780 --copy. Inspired by a suggestion from Bruno Haible.
4782 2006-10-03 Jim Meyering <jim@meyering.net>
4784 * bootstrap: Undo last change to this file, since now gnulib-tool
4785 sticks with the automake default in generating dependencies.
4787 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
4789 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
4790 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
4792 * doc/bison.1: Add copyright notice.
4794 * data/glr.c: Don't include <stdarg.h>; not used.
4796 * NEWS: The -g and --graph options now output graphs in Graphviz
4797 DOT format, not VCG format.
4798 * doc/bison.1: Likewise.
4799 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
4800 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
4802 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
4803 * TODO: Remove Graphviz entry.
4804 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
4805 remove vcg.c, vcg.h, vcg_defaults.h.
4806 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
4807 * src/graphviz.c, src/graphviz.h: New files.
4808 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
4809 * src/files.h: Make comment more generic.
4810 * src/main.c (main): Likewise.
4811 * src/print_graph.h: Likewise.
4812 * src/getargs.c (usage): Make usage description more generic.
4813 * src/print_graph.c: Include graphviz.h rather than vcg.h.
4814 (static_graph, fgraph): Remove. All uses changed to pass
4815 arguments instead of sharing a static var.
4816 (print_core, print_actions, print_state, print_graph):
4817 Output graphviz format rather than VCG format.
4818 * tests/.cvsignore: Remove *.vcg; add *.dot.
4819 * tests/output.at: Expect *.dot files, not *.vcg files.
4821 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
4822 accommodates the 2006-10-08 change.
4824 2006-10-11 Bob Rossi <bob@brasko.net>
4826 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
4827 (b4_yyssa, b4_yyerror_range): New macros.
4828 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
4829 (yypvarsinit): Remove init of removed fields.
4830 (yypushparse): Remove use of removed fields; use new macros instead.
4832 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
4834 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
4835 in a push parser. Reindent slightly to match yacc.c better.
4837 2006-10-11 Bob Rossi <bob@brasko.net>
4839 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
4841 (yypvarsinit, yypushparse): Remove init of removed fields.
4842 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
4844 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
4846 * THANKS: Add Paolo Bonzini and Bob Rossi.
4848 2006-10-08 Paolo Bonzini <bonzini@gnu.org>
4850 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
4851 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
4852 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
4853 b4_define_user_cde and uses): Remove.
4854 (b4_comment, b4_prefix, b4_sync_start): New.
4855 * data/bison.m4: New file, with most of the content removed from c.m4.
4856 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
4857 * src/output.c (output_skeleton): Pass bison.m4.
4858 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
4861 2006-10-05 Paul Eggert <eggert@cs.ucla.edu>
4863 Fix test failure reported by Tom Lane in
4864 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
4865 and try to make such failures easier to catch in the future.
4866 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
4867 that's now the caller's responsibility.
4868 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
4869 Set yychar = YYEOF if it's negative.
4870 * tests/actions.at (yylex): Abort if asked to read past EOF.
4871 * tests/conflicts.at (yylex): Likewise.
4872 * tests/cxx-type.at (yylex): Likewise.
4873 * tests/glr-regression.at (yylex): Likewise.
4874 * tests/input.at (yylex): Likewise.
4875 * tests/regression.at (yylex): Likewise.
4876 * tests/torture.at (yylex): Likewise.
4878 2006-10-01 Paul Eggert <eggert@cs.ucla.edu>
4880 Fix problems with translating English-language diagnostics.
4881 * bootstrap: Fix bug introduced in recent bootstrap changes, with
4882 respect to bison-runtime pot generation. The YY_ stuff
4883 wasn't being captured.
4884 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
4885 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
4886 * runtime-po/POTFILES.in: Add data/push.c.
4888 2006-09-29 Paul Eggert <eggert@cs.ucla.edu>
4890 Merge bootstrap changes from coreutils.
4892 2006-09-28 Jim Meyering <jim@meyering.net>
4894 Automatically generated dependencies are important even
4895 when all of the sources in a directory come from gnulib.
4896 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
4897 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
4899 2006-09-23 Jim Meyering <jim@meyering.net>
4901 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
4903 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
4905 * bootstrap: Add support for --force.
4906 (usage): New function. Describe usage less tersely.
4907 (CVS_only_file): New var.
4909 2006-09-21 Paul Eggert <eggert@cs.ucla.edu>
4911 * data/push.c (YYPUSH_MORE): Make it an enum instead.
4912 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
4913 Adjust white space and comments to match GNU style better.
4915 2006-09-20 Bob Rossi <bob@brasko.net>
4917 * data/push.c (yyresult_get): Remove function.
4918 (YYPUSH_MORE): Add #define.
4919 (yypushparse): Modify return value.
4921 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
4923 * stamp-h.in: Remove; no longer needed.
4924 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
4925 Remove config.h, config.hin, intl (no longer created).
4926 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
4929 Sync bootstrap from coreutils, as follows:
4931 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
4933 * bootstrap (symlink_to_gnulib): New function.
4934 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
4935 to copies-of-gnulib.
4936 (cp_mark_as_generated, slurp, gnulib_files):
4937 Avoid making a copy if it's the same as the old version.
4938 (gnulib_files): Add support for this variable (used by Bison).
4940 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
4942 * src/getargs.c (usage): Rework to use conventions similar to
4943 coreutils, to make translation a bit easier and the code a bit
4944 smaller. Problem reported by Tim Van Holder.
4946 2006-09-15 Paul Eggert <eggert@cs.ucla.edu>
4948 Use some of gnulib's new modules, taken from coreutils.
4950 * bootstrap: Sync from coreutils, except add support for gnulib_files.
4951 * bootstrap.conf: New file.
4952 (gnulib_modules): Add configmake, inttypes, unistd.
4953 (XGETTEXT_OPTIONS): Add complain, complain_at,
4954 fatal, fatal_at, warn, warn_at, unexpected_end.
4955 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
4956 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
4958 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
4960 (GNULIB_AUTOCONF_SNIPPET): Remove.
4961 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
4963 * lib/.cvsignore: Add inttypes_.h.
4964 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
4965 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
4966 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
4967 no-longer-necessary initializations.
4968 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
4969 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
4970 use the unistd module.
4971 * src/system.h: Likewise.
4972 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
4973 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
4974 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
4975 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
4976 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
4977 * src/system.h: Include inttypes.h unconditionally, now that we
4978 use the inttypes module. Don't bother to include stdint.h, since
4979 inttypes.h now does that for us.
4980 (LOCALEDIR): Remove, now that we use the configmake module.
4981 * src/getargs.c: Include configmake.h.
4982 * src/main.c: Likewise.
4983 * src/output.c: Likewise.
4984 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
4985 not from $abs_top_builddir, since config.h moved.
4988 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
4989 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
4991 * src/parse-gram.y (symbol_declaration): Don't put statements
4992 before declarations; it's not portable to C89.
4993 * src/scan-code.l (handle_action_at): Likewise.
4995 * src/scan-code.l: Always initialize braces_level; the old code
4996 left it uninitialized and therefore had undefined behavior.
4998 Don't attempt to redefine 'assert', since it runs afoul of
4999 systems where standard headers (mistakenly) include <assert.h>.
5000 Instead, define and use our own alternative, called 'aver'.
5001 * src/reader.c: Don't include assert.h, since we no longer
5003 * src/scan-code.l: Likewise.
5004 * src/system.h (assert): Remove, replacing with....
5005 (aver): New function, taking a bool arg. All uses changed.
5006 * src/tables.c (pack_vector): Ensure that aver arg is bool,
5007 not merely an integer.
5009 2006-09-15 Bob Rossi <bob@brasko.net>
5011 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
5012 * data/c.m4 (YYPUSH): New.
5013 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
5014 * src/getargs.c (push_parser): New var.
5015 * src/getargs.h (push_parser): New declaration.
5016 * src/output.c (prepare): Add macro insertion of `push_flag'.
5017 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
5018 (prologue_declaration): Parse %push-parser.
5019 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
5020 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
5021 list of removed lines from the traces observed.
5022 (AT_CHECK_CALC_LALR): Added push parser tests.
5024 2006-09-13 Paul Eggert <eggert@cs.ucla.edu>
5026 * NEWS: Version 2.3a.
5027 * configure.ac (AC_INIT): Likewise.
5029 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
5030 "#define YYSTYPE int" that caused "make maintainer-check" to fail
5031 due to header ordering dependencies. I don't know why the #define
5034 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
5035 runtime cost when YYDEBUG is not defined, and so that some tests
5036 that used to fail now work. Problem and initial suggestion by
5038 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
5039 * data/glr.cc (b4_parser_class_name):
5040 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
5041 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
5042 (yydebug_) [YYDEBUG]: New member.
5043 (yycdebug_): Now defined only if YYDEBUG.
5044 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
5045 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
5046 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
5048 (debug_stream, set_debug_stream, debug_level, set_debug_level):
5049 Define only if YYDEBUG.
5050 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
5052 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
5053 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
5054 AT_CHECK_CALC_GLR_CC that are working now.
5056 2006-09-12 Paul Eggert <eggert@cs.ucla.edu>
5058 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
5059 We don't need them in glr.cc, and glr.c defines them.
5060 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
5061 assumes that defining it to anything is the same as defining
5062 it to 1. Problem reported by Paolo Bonzini.
5064 2006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
5066 * data/c.m4 (b4_null, b4_case): Define.
5067 * src/output.c (prepare_symbols): Use b4_null.
5068 (user_actions_output): Use b4_case.
5070 2006-09-11 Paul Eggert <eggert@cs.ucla.edu>
5072 * data/glr.c (b4_shared_declarations): Put start-header first,
5073 before any #includes that we generate, so that feature-test
5074 macros work. Problem reported by Michael Deutschmann in
5075 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
5076 * data/lalr1.cc: Likewise.
5077 * doc/bison.texinfo (Prologue): Document that feature-test macros
5078 should be defined before any Bison declarations.
5079 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
5080 that depend on location.hh after, not before, Bison decls, since
5081 we now include location.hh after the first user prologue.
5083 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
5084 Sander Brandenburg in
5085 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
5086 Also, fix minor white space and comment issues.
5087 (Prologue): Mention that it's better to define feature-test macros
5088 before Bison declarations. Problem reported by Michael Deutschmann.
5090 * README-cvs: Fix typo: "&" should be "&&". Problem reported
5092 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
5093 This adjusts to recent gnulib changes.
5095 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
5097 Finish implementation of per-type %destructor/%printer. Discussed
5099 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
5101 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
5102 * NEWS (2.3+): Add a description of this feature to the default
5103 %destructor/%printer description.
5104 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
5105 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
5106 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
5107 list node contains a semantic type.
5108 * src/symtab.c, src/symtab.h: Extend with a table that associates
5109 semantic types with their %destructor's and %printer's.
5110 (semantic_type_from_uniqstr, semantic_type_get,
5111 semantic_type_destructor_set, semantic_type_printer_set): New functions
5112 composing the public interface of that table.
5113 (symbol_destructor_get, symbol_destructor_location_get,
5114 symbol_printer_get, symbol_printer_location_get): If there's no
5115 per-symbol %destructor/%printer, look up the per-type before trying
5117 * tests/actions.at (Per-type %printer and %destructor): New test case.
5118 * tests/input.at (Default %printer and %destructor redeclared):
5119 Extend to check that multiple occurrences of %symbol-default in a
5120 single %destructor/%printer declaration is an error.
5121 (Per-type %printer and %destructor redeclared, Unused values with
5122 per-type %destructor): New test cases.
5124 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
5126 Require default %destructor/%printer to be declared using
5127 %symbol-default instead of an empty symbol list, and start working on
5128 new per-type %destructor/%printer. Discussed at
5129 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
5130 * NEWS (2.3+): Add %symbol-default to example.
5131 * bison.texinfo (Freeing Discarded Symbols): Likewise.
5132 (Table of Symbols): Add entry for %symbol-default.
5133 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
5134 (generic_symlist, generic_symlist_item): New nonterminals for creating
5135 a list in which each item is a symbol, semantic type, or
5137 (grammar_declaration): Use generic_symlist in %destructor and %printer
5138 declarations instead of symbols.1 or an empty list.
5139 (symbol_declaration, precedence_declaration, symbols.1): Update actions
5140 for changes to symbol_list.
5141 * src/reader.c: Update for changes to symbol_list.
5142 * src/scan-code.l: Likewise.
5143 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
5144 * src/symlist.c, src/symlist.h: Extend such that a list node may
5145 represent a semantic type or a %symbol-default in addition to just an
5146 ordinary symbol. Add switched functions for setting %destructor's and
5148 * tests/actions.at, tests/input.at: Add %symbol-default to all default
5149 %destructor/%printer declarations.
5151 2006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
5153 Whether the default %destructor/%printer applies to a particular symbol
5154 isn't a question of whether the user *declares* that symbol (in %token,
5155 for example). It's a question of whether the user by any means
5156 *defines* the symbol at all (by simply using a char token, for
5157 example). $end is defined by Bison whereas any other token with token
5158 number 0 is defined by the user. The error token is always defined by
5159 Bison regardless of whether the user declares it with %token, but we
5160 may one day let the user define error as a nonterminal instead.
5161 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
5162 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
5163 the meaning of "user-defined".
5164 * tests/actions.at (Default %printer and %destructor for user-declared
5165 end token): Rename to...
5166 (Default %printer and %destructor for user-defined end token): ...
5169 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
5170 computation of whether to apply the default, don't maintain a list of
5171 every Bison-defined symbol. Instead, just check for a first character
5172 of '$', which a user symbol cannot have, and check for the error token.
5174 2006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
5176 Don't apply the default %destructor or %printer to the error token,
5177 $undefined, or $accept. This change fits the general rule that the
5178 default %destructor and %printer are only for user-declared symbols,
5179 and it solves several difficulties that are described in the new test
5181 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
5182 * tests/actions.at (Default %printer and %destructor are not for error
5183 or $undefined, Default %printer and %destructor are not for $accept):
5186 2006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
5188 Allow %start after the first rule.
5189 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
5190 when parsing the first rule.
5191 (check_and_convert_grammar): Search for it here after all grammar
5192 declarations have been parsed. Skip midrules, which have dummy LHS
5194 * src/symtab.c (symbol_is_dummy): New function.
5195 * src/symtab.h (symbol_is_dummy): Declare it.
5196 * tests/input.at (%start after first rule): New test.
5198 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
5200 Redo some of the previous commit: add back the ability to use
5201 non-aliased/undeclared string literals since it might be useful to
5202 those declaring %token-table.
5203 * src/reader.c (check_and_convert_grammar): Undo changes in previous
5204 commit: don't worry about complaints from symbols_pack.
5205 * src/symtab.c (symbol_new, symbol_class_set,
5206 symbol_check_alias_consistency): Undo changes in previous commit: count
5207 each string literal as a new symbol and token, assign it a symbol
5208 number, and don't complain about non-aliased string literals.
5209 (symbols_pack): Since symbol_make_alias still does not decrement symbol
5210 and token counts but does still set aliased tokens to the same number,
5211 symbol_pack_processor now leaves empty slots in the symbols array.
5213 * tests/regression.at (Undeclared string literal): Remove test case
5214 added in previous commit since non-aliased string literals are allowed
5216 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
5217 remove unnecessary string literal declarations.
5218 * tests/sets.at (Firsts): Likewise.
5220 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
5222 Don't allow an undeclared string literal, but allow a string literal to
5223 be used before its declaration.
5224 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
5225 symbols_pack complained.
5226 * src/symtab.c (symbol_new): Don't count a string literal as a new
5228 (symbol_class_set): Don't count a string literal as a new token, and
5229 don't assign it a symbol number since symbol_make_alias does that.
5230 (symbol_make_alias): It's not necessary to decrement the symbol and
5231 token counts anymore. Don't assume that an alias declaration occurs
5232 before any uses of the identifier or string, and thus don't assert that
5233 one of them has the highest symbol number so far.
5234 (symbol_check_alias_consistency): Complain if there's a string literal
5235 that wasn't declared as an alias.
5236 (symbols_pack): Bail if symbol_check_alias_consistency failed since
5237 symbol_pack asserts that every token has been assigned a symbol number
5238 although undeclared string literals have not.
5239 * tests/regression.at (String alias declared after use, Undeclared
5240 string literal): New test cases.
5241 (Characters Escapes, Web2c Actions): Declare string literals as
5243 * tests/sets.at (Firsts): Likewise.
5245 2006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
5247 In the grammar scanner, STRING_FINISH unclosed constructs and return
5248 them to the parser in order to improve error messages.
5249 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
5250 SC_BRACED_CODE, SC_PROLOGUE): Implement.
5251 * tests/input.at (Unclosed constructs): New test case.
5252 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
5255 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
5258 2006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
5260 Handle string aliases for character tokens correctly.
5261 * src/symtab.c (symbol_user_token_number_set): If the token has an
5262 alias, check and set its alias's user token number instead of its own,
5263 which is set to indicate the alias. Previously, every occurrence of
5264 the character token in the grammar overwrote that alias indicator with
5266 * tests/input.at (String aliases for character tokens): New test.
5268 2006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
5270 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
5272 2006-08-11 Paul Eggert <eggert@cs.ucla.edu>
5274 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
5275 to prevent failures when building on older platforms.
5276 Check for autopoint failure.
5277 Set XGETTEXT_OPTIONS to values that check for C format strings,
5278 so that translators are warned about them (this also helps
5279 prevent core dumps).
5281 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
5282 function, since it simplifies our code a bit.
5284 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
5285 rather than -W, so we don't get bogus warnings about sign comparisons.
5286 Add -Wpointer-arith, since that warning is useful (it reports code
5287 that does not conform to C89 and that some compilers reject).
5288 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
5289 since it's no longer needed.
5291 2006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
5293 Clean up scanners a bit.
5294 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
5295 definitions so gcc won't warn when obstack_for_string is unused.
5296 * src/scan-code.l: config.h and system.h are already #include'd by
5297 scan-code-c.c, so get rid of them here.
5298 * src/scan-gram.l: Likewise.
5299 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
5300 definitions rather than duplicating the rest of it.
5301 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
5303 2006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
5305 Suppress signed/unsigned comparison warnings for yycheck.
5306 * data/c.m4 (b4_safest_int_type): New macro.
5307 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
5308 a signed int type, cast it to b4_safest_int_type first.
5309 * data/yacc.c: Likewise.
5310 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
5313 2006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
5315 * doc/bison.texinfo: Fix some typos.
5317 2006-08-02 Paul Eggert <eggert@cs.ucla.edu>
5319 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
5320 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
5322 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
5323 the latest gnulib does this a different way.
5324 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
5325 translation was patched, so stop omitting it.
5327 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
5329 Enable declaration of default %printer/%destructor. Make the parser
5330 use these for all user-declared grammar symbols for which the user does
5331 not declare a specific %printer/%destructor. Thus, the parser uses it
5332 for token 0 if the user declares it but not if Bison generates it as
5333 $end. Discussed starting at
5334 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
5335 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
5337 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
5338 * NEWS (2.3+): Mention.
5339 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
5340 declare a %destructor for a mid-rule's semantic value. It's just
5341 impossible to declare one specific to it.
5342 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
5343 code. Describe default %destructor form.
5344 * src/parse-gram.y (grammar_declaration): Parse default
5345 %printer/%destructor declarations.
5346 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
5347 and symbol_destructor_location_get rather than accessing the destructor
5348 and destructor_location members of struct symbol.
5349 (symbol_printers_output): Likewise but for %printer's.
5350 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
5352 * src/symtab.c (default_destructor, default_destructor_location,
5353 default_printer, default_printer_location): New static global
5354 variables to record the default %destructor and %printer.
5355 (symbol_destructor_get, symbol_destructor_location_get,
5356 symbol_printer_get, symbol_printer_location_get): New functions to
5357 compute the appropriate %destructor and %printer for a symbol.
5358 (default_destructor_set, default_printer_set): New functions to set the
5359 default %destructor and %printer.
5360 * src/symtab.h: Prototype all those new functions.
5361 * tests/actions.at (Default %printer and %destructor): New test to
5362 check that the right %printer and %destructor are called, that they're
5363 not called for $end, and that $$ and @$ work correctly.
5364 (Default %printer and %destructor for user-declared end token): New
5365 test to check that the default %printer and %destructor are called for
5366 a user-declared end token.
5367 * tests/input.at (Default %printer and %destructor redeclared, Unused
5368 values with default %destructor): New tests to check related grammar
5369 warnings and errors.
5371 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
5373 Clean up handling of %destructor for the end token (token 0).
5374 Discussed starting at
5375 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
5377 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
5379 Make the skeletons consistent in how they pop the end token and invoke
5381 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
5382 state, which has token number 0, since this would invoke the
5383 %destructor for the end token.
5384 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
5385 until after shifting the end token, or else it won't be popped.
5386 * data/yacc.c (yyparse): Likewise.
5388 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
5389 it's the end token. Upon termination, destroy an unshifted lookahead
5390 even when it's the end token.
5391 * data/lalr1.cc (yy::parser::parse): Likewise.
5392 * data/yacc.c (yyparse): Likewise.
5394 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
5395 value warnings for the end token when the user gives the end token a
5398 * tests/actions.at (Printers and Destructors): Test all the above.
5400 2006-07-24 Paul Eggert <eggert@cs.ucla.edu>
5402 Update to latest gnulib and gettext versions.
5403 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
5405 (gnulib_files): Add m4/warning.m4. Don't worry about files
5406 overwritten by autopoint.
5407 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
5408 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
5410 Don't use autoreconf; instead, invoke autopoint etc. by hand,
5411 so that we can remove the intl files at a better time.
5412 (intl_files_to_remove): Remove aclocal.m4, since it gets
5413 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
5414 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
5415 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
5416 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
5417 Remove datarootdir hack; no longer needed.
5418 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
5419 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
5420 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
5422 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
5423 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
5425 2006-07-20 Paul Eggert <eggert@cs.ucla.edu>
5427 * bootstrap: Adjust to today's change to gnulib-tool by invoking
5428 it with --assume-autoconf='latest-stable'.
5430 2006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
5432 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
5433 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
5435 * src/muscle_tab.h (muscle_grow): Replace the header comments with
5436 those from muscle_tab.c since the old ones are misleading.
5438 2006-07-13 Akim Demaille <akim@epita.fr>
5440 Support %define "KEY" {VALUE}.
5441 * src/scan-code.h, src/scan-code.l (translate_action)
5442 (translate_rule_action, translate_symbol_action, translate_code):
5443 Return char *, not const char *.
5444 * src/parse-gram.y (declaration): Rename as...
5445 (prologue_declaration): this.
5446 (string_content): Remove this nonterminal, use STRING.
5447 (braceless, content, content.opt): New nonterminal.
5449 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
5451 * src/scan-gram.l (getargs.h): Don't include it.
5453 2006-07-12 Paul Eggert <eggert@cs.ucla.edu>
5455 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
5456 rather than a for-loop that declares a local bool variable. This
5457 should work around a compatibility problem with a Cray x1e C++
5458 compiler reported by Hung Nguyen in
5459 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
5460 The for-loop was introduced in the 2004-11-17 change but I don't
5461 know why it was needed.
5463 2006-07-12 Akim Demaille <akim@epita.fr>
5465 * data/c.m4: Comment changes.
5467 2006-07-10 Akim Demaille <akim@lrde.epita.fr>
5469 * src/complain.c (error_message, ERROR_MESSAGE): New.
5471 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
5472 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
5474 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
5476 * NEWS: Instead of %union, you can define and use your own union type
5477 YYSTYPE if your grammar contains at least one <type> tag.
5478 Your YYSTYPE need not be a macro; it can be a typedef.
5479 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
5480 (Union Decl, Decl Summary): Document this.
5481 * data/glr.c (YYSTYPE): Implement this.
5482 * data/glr.cc (YYSTYPE): Likewise.
5483 * data/lalr1.cc (YYSTYPE): Likewise.
5484 * data/yacc.c (YYSTYPE): Likewise.
5485 * src/output.c (prepare): Output tag_seen_flag.
5486 * src/parse-gram.y (declaration, grammar_declaration):
5487 Use 'union_seen' rather than 'typed' to determine whether
5488 %union has been seen, since grammars can now be typed without
5490 (symbol_declaration, type.opt, symbol_def):
5491 Keep track of whether a tag has been seen.
5492 * src/reader.c (union_seen, tag_seen): New vars.
5494 * src/reader.h (union_seen, tag_seen, typed): Likewise.
5495 * src/scan-code.l (untyped_var_seen): New variable.
5496 (handle_action_dollar): Adjust to above changes.
5497 (handle_action_dollar, handle_action_at):
5498 Improve overflow checking for outlandish numbers.
5499 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
5500 avoid new diagnostics generated by above changes.
5501 * tests/regression.at (YYSTYPE typedef): Add test to check
5502 for type tags without %union.
5504 * src/symlist.c (symbol_list_length): Return int, not unsigned
5505 int, since callers expect int. This may need to get revisited
5506 once we have proper integer overflow checking.
5508 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
5509 object is now static.
5511 * src/getargs.c (flags_argmatch): Return void, not int,
5512 to pacify ./configure --enable-gcc-warnings.
5514 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
5515 since last_string is already defined to FLEX_PREFIX (last_string).
5517 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
5519 Implement --warnings/-W.
5520 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
5522 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
5524 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
5525 (warnings_args, warnings_types): New.
5526 (getargs, short_options, long_options): Accept -W/--warnings.
5527 Sort the options by alphabetical order, upper case letter right
5528 before its lower case.
5530 2006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
5532 Change %merge result type clash warnings to errors. Discussed at
5533 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
5534 * src/reader.c (record_merge_function_type): Use complain_at.
5535 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
5536 declared later): Update test case results.
5538 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
5540 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
5541 to be in alphabetical order.
5542 (trace_args): Spelling fixes.
5544 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
5546 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
5547 so they don't collide with user-defined macros.
5548 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
5549 this was never guaranteed, and now that we're using gnulib stdint,
5550 which defines int_fast16_t to long int, the problem is exposed.
5552 2006-07-08 Paul Eggert <eggert@cs.ucla.edu>
5554 * data/c.m4 (b4_basename): Simplify a bit, since we don't
5555 need the full POSIX semantics (and weren't implementing them
5558 Adjust to Autoconf 2.60 and today's gnulib.
5559 * bootstrap (gnulib_modules): Add stdint.
5560 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
5561 no longer copies it.
5562 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
5563 since stdint needs the former and wcwidth (which is now required
5564 by mbswidth) needs the latter.
5565 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
5566 work around a compatibility glitch between gettext 0.14.6 and
5568 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
5569 Do not check for uintptr_t, since new stdint module does the right
5571 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
5572 Add stdint.h, stdint_.h, wcwidth.h.
5573 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
5574 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
5575 stdint.m4, wchar_t.m4, wcwidth.m4.
5576 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
5577 usual order for ../lib/*.h files.
5578 (file_name_split): Use last_component, not base_name, to adjust
5580 * src/parse-gram.h: Include <strverscmp.h> in the usual order
5581 for ../lib/*.h files.
5582 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
5583 Define unconditionally, since we now assume the stdint module.
5584 * src/scan-skel.l: Include <dirname.h>.
5585 (BASE_QPUTS): Use last_component, not base_name.
5586 * src/system.h: Include <unlocked-io.h> in the usual order
5587 for ../lib/*.h files. Include <stdint.h> unconditionally,
5588 since we now use the stdint module.
5589 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
5590 HAVE_UINTPTR_T, since we now use the stdint module.
5591 (base_name): Remove decl, since files now include <dirname.h>
5594 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
5596 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
5598 * data/yacc.c, data/glr.c, data/location.cc: Use them.
5599 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
5601 * tests/calc.at: Adjust.
5603 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
5605 * data/c.m4 (b4_basename): New.
5606 (b4_syncline): Also output the location of its invocation (from
5608 (b4_user_action, b4_define_user_action, b4_user_actions)
5609 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
5610 (b4_user_stype): New.
5611 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
5613 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
5615 In the grammar file, the first column is 1 not 0 on the first line as
5616 on every other line.
5617 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
5618 * tests/input.at (Torturing the Scanner): Update output.
5620 * src/scan-gram.l (scanner_cursor): Declare it static.
5622 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
5624 In warnings, say "previous declaration" rather than "first
5626 * src/symtab.c (redeclaration): Do that here.
5627 * src/reader.c (record_merge_function_type): In the case of a result
5628 type clash, report the previous declaration rather than the very first
5629 one in the grammar file.
5630 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
5631 declared later): Add a third declaration to check this behavior.
5632 * tests/input.at (Incompatible Aliases): Update output.
5634 2006-06-27 Akim Demaille <akim@epita.fr>
5636 * doc/Doxyfile.in: New.
5637 * doc/Makefile.am: Use it.
5638 * src/lalr.h, src/symtab.h: Initial doxygenation.
5640 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
5642 Don't miss %merge result type warnings just because the LHS types are
5643 declared after the %merge. This continues the effort of the previous
5645 * src/reader.c (get_merge_function): Don't set the merger type yet.
5646 (record_merge_function_type): New function for setting the merger type
5647 and checking for clashes.
5648 (grammar_current_rule_merge_set): Set the location of the %merge for
5650 (packgram): Invoke record_merge_function_type for each rule now that
5651 all symbol type declarations have been parsed.
5652 * src/reader.h (merger_list.type_declaration_location): New member
5653 storing the location of the first %merge from which the type for this
5654 merging function was derived.
5655 * src/symlist.h (symbol_list.merger_declaration_location): New member
5656 storing the location of a rule's %merge, if any.
5657 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
5658 declared later): New test to catch the error fixed by the above patch.
5660 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
5662 Get action warnings (grammar_rule_check) right even when symbol
5663 declarations appear after the rules. Discussed at
5664 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
5666 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
5667 Don't mistake the type of $$ in a midrule to be that of its parent
5669 * src/reader.c (grammar_current_rule_end): Don't invoke
5670 grammar_rule_check yet since not all symbol declarations may have been
5672 (grammar_midrule_action): Likewise.
5673 Don't record whether the midrule's $$ has been used yet since actions
5674 haven't been translated yet.
5675 Record the midrule's parent rule and its RHS index within the parent
5677 (grammar_current_rule_action_append): Don't translate the action yet
5678 since not all symbol declarations may have been parsed yet and, thus,
5679 warnings about types for $$, $n, @$, and @n can't be reported yet.
5680 (packgram): Translate the action and invoke grammar_rule_check now that
5681 all symbol declarations have been parsed.
5682 * src/scan-code.l (handle_action_dollar): Now that this is invoked
5683 after parsing the entire grammar file, the symbol list here in the case
5684 of a midrule is actually the midrule's empty RHS, so reference its
5685 parent rule's RHS where necessary.
5686 On the other hand, now that you can already know it's a midrule, you
5687 aren't forced to think $$ has the same type as its parent rule's $$.
5688 (handle_action_at): In the case of a midrule, reference the parent rule
5690 * src/symlist.c (symbol_list_new): Initialize new midrule-related
5692 (symbol_list_length): Now that this is invoked after all rules have
5693 been parsed, a NULL symbol (rather than a NULL symbol list node)
5694 terminates a rule. symbol_list_print already does this correctly.
5695 * src/symlist.h (symbol_list.midrule_parent_rule,
5696 symbol_list.midrule_parent_rhs_index): New members so that midrules can
5697 remember their relationships with their parents.
5698 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
5699 fixed by the above patch.
5700 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
5702 (Unused values): ... this old test case and...
5703 (Unused values before symbol declarations): ... this new test case.
5704 This one is the same as `Unused values' except that all symbol
5705 declarations appear after the rules in order to catch the rest of the
5706 errors fixed by the above patch.
5708 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
5711 * src/reader.c (current_rule): Declare it static since it's no longer
5712 used outside this file.
5713 (grammar_current_rule_action_append): Remove redundant arguments from
5714 translate_rule_action invocation.
5715 * src/reader.h (current_rule): Remove this unused extern.
5716 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
5717 * src/scan-code.l (translate_rule_action): Likewise.
5719 2006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
5721 Clean up yesterday's patch.
5722 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
5724 * src/reader.c (grammar_current_rule_action_append): ... here for
5725 consistency with grammar_current_rule_symbol_append.
5726 * tests/regression.at (Braced code in declaration in rules section):
5727 Make yyerror and yylex static as usual.
5729 2006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
5731 Fix bug that mistakes braced code in a declaration in the rules section
5732 to be a rule action. Mentioned at
5733 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
5734 * src/scan-gram.l: Move midrule action detection from the start of the
5735 scanning of any braced code to...
5736 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
5737 action. For readability, use $2 and @2 rather than the equivalent
5739 * tests/regression.at (Braced code in declaration in rules section):
5740 New test to catch the error fixed by the above patch.
5742 Work on code readability some.
5743 * src/scan-code.l (current_rule): Get rid of this misleading and
5744 redundant declaration: it's actually extern'ed in reader.h.
5745 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
5746 translate_action): Add a rule argument and use it instead of the global
5748 (translate_rule_action): This already receives current_rule through an
5749 argument, so pass it on to translate_action instead of assigning
5750 current_rule to current_rule.
5751 (translate_symbol_action, translate_code): Pass rule = NULL to
5754 2006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
5756 Rename %before-definitions to %start-header and %after-definitions to
5757 %end-header. Don't use these declarations to separate pre-prologue
5758 blocks from post-prologue blocks. Add new order-independent
5759 declarations %before-header and %after-header as alternatives to the
5760 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
5761 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
5762 * NEWS (2.3+): Update for these changes.
5763 * data/glr.c (b4_before_definitions): Update to...
5764 (b4_start_header): ... this.
5765 (b4_after_definitions): Update to...
5766 (b4_end_header): ... this.
5767 * data/glr.cc: Likewise.
5768 * data/lalr1.cc: Likewise.
5769 * data/yacc.c: Likewise.
5770 * doc/bison.texinfo (The prologue): Update names, and replace remaining
5771 prologue blocks with %*-header declarations.
5772 (Calc++ Parser): Likewise.
5773 (Decl Summary): Update names.
5774 (Table of Symbols): Update description.
5775 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
5776 (PERCENT_END_HEADER): ... this.
5777 (PERCENT_BEFORE_DEFINITIONS): Update to...
5778 (PERCENT_START_HEADER): ... this.
5779 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
5780 (declaration): Update token names and m4 macro names.
5781 When parsing %end-header and %start-header, invoke translate_code
5782 before muscle_code_grow, and no longer set global booleans to remember
5783 whether these declarations have been seen.
5784 Parse new %after-header and %before-header.
5785 * src/reader.c (before_definitions, after_definitions): Remove.
5786 (prologue_augment): Accept a new bool argument to specify whether to
5787 augment the pre-prologue or post-prologue.
5788 * src/reader.h (before_definitions, after_definitions): Remove these
5790 (prologue_augment): Add new bool argument.
5791 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
5792 (PERCENT_END_HEADER): ... this.
5793 (PERCENT_BEFORE_DEFINITIONS): Update to...
5794 (PERCENT_START_HEADER): ... this.
5795 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
5796 * tests/actions.at (Printers and Destructors): Update names.
5798 2006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
5800 Add comparison operators for C++ location classes. Discussed at
5801 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
5802 * data/c++.m4 (b4_define_location_comparison): New boolean %define
5803 declaration indicating whether filename_type has an operator==. If
5804 filename_type is `std::string', it defaults to `1', `0' otherwise.
5805 * data/location.cc: Iff b4_define_location_comparison is `1', add
5806 operator== and operator!= for class position and for class location.
5809 * src/scan-action.l: Remove unused file.
5810 * src/symtab.c (symbol_printer_set): Use printer_location not
5811 destructor_location.
5812 * src/symtab.h (struct symbol): Replace incorrect source comment for
5814 * tests/input.at (Incompatible Aliases): Update output with correct
5817 2006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
5819 Don't put the pre-prologue in the header file. For the yacc.c code
5820 file and the glr.c header and code files, move the pre-prologue before
5821 the token definitions. Add new %before-definitions and
5822 %after-definitions to declare code that will go in both the header file
5823 and code file. Discussed at
5824 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
5825 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
5827 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
5828 * NEWS (2.3+): Describe these changes.
5829 * data/glr.c (b4_pre_prologue): Move from within to before...
5830 (b4_shared_declarations): ... this.
5831 Add new b4_before_definitions before b4_token_enums.
5832 Add new b4_after_definitions at the end.
5833 * data/glr.cc (b4_pre_prologue): Replace with...
5834 (b4_before_definitions): ... this in the header file.
5835 (b4_after_definitions): New near the end of the header file.
5836 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
5837 code file right before including the header file.
5838 (b4_before_definitions): New in the previous position of
5839 b4_pre_prologue in the header file.
5840 (b4_after_definitions): New near the end of the header file.
5841 * data/yacc.c: Clean up some m4 quoting especially in the header file.
5842 (b4_token_enums_defines): In the code file, move to right before
5843 YYSTYPE for consistency with the header file.
5844 (b4_before_definitions): New right before b4_token_enums_defines in
5845 both the header and code file.
5846 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
5847 header and code file.
5848 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
5849 of prologues for %union dependencies.
5850 (Decl Summary): In %defines description, mention the effect of
5851 %before-definitions and %after-definitions on the header file.
5852 (Calc++ Parser): Forward declare driver in a %before-definitions rather
5853 than in the pre-prologue so that make check succeeds.
5854 (Table of Symbols): Add entries for %before-definitions and
5856 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
5857 %before-definitions.
5858 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
5859 (declaration): Parse those declarations and append to
5860 b4_before_definitions and b4_after_definitions, respectively.
5861 * src/reader.c (before_definitions, after_definitions): New bools to
5862 track whether those declarations have been seen.
5863 (prologue_augment): Add to the post-prologue if %union,
5864 %before-definitions, or %after-definitions has been seen.
5865 * src/reader.h (before_definitions, after_definitions): New extern's.
5866 * src/scan-gram.l: Scan the new declarations.
5867 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
5868 prologue block in a %before-definitions or a %after-definitions based
5869 on whether the %union is declared.
5870 * tests/regression.at (Early token definitions with --yacc, Early token
5871 definitions without --yacc): Move tests for token definitions into the
5872 post-prologue since token names are no longer defined in the
5875 2006-06-20 Akim Demaille <akim@epita.fr>
5877 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
5878 (symbol_get): Use it.
5879 * src/parse-gram.y: Use it.
5881 2006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
5883 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
5884 build succeeds when configured with --enable-gcc-warnings.
5886 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
5888 * src/parse-gram.y (char_name): New function.
5889 (CHAR, STRING, string_content): For %printer, properly escape.
5890 (ID): Prefer fputs to fprintf.
5891 (id): Reindent to be consistent with other rules.
5892 Properly quote char.
5894 The Translation Project changed its way of publishing translations
5895 to maintainers. I haven't received any responses to my request
5896 for supporting the old way, or for documenting the new way. I
5897 have modified 'bootstrap' to use screen scraping
5898 (in this case, HTML scraping). This is unreliable and inelegant,
5899 but I don't see any better way. Yuck.
5900 * bootstrap (TP_URL, WGET_COMMAND): New vars.
5901 (get_translations): New function, which uses HTML scraping to
5902 deduce locations of latest translations.
5903 Use this function to grab both bison and bison-runtime .po files.
5904 Don't bother priming the pump for the runtime-po domain any more,
5905 as it's now translated better than bison is.
5907 2006-06-19 Akim Demaille <akim@epita.fr>
5909 * src/scan-gram.l: No longer "parse" things after `%union' until
5910 `{'. Rather, return a single "%union" token.
5911 No longer make symbols: return strings, and leave the conversion
5912 to symbols to the parser.
5913 (SC_PRE_CODE, token_type): Remove.
5914 * src/parse-gram.y (%union): New field `character'.
5917 (ID, ID_COLON): Now that the scanner no longer makes them
5918 identifiers, adjust all uses to invoke symbol_get.
5919 (id_colon): New, wraps the conversion from string to symbol.
5920 (%union): Accept a possible union_name.
5921 (symbol): Now can be a char.
5922 * data/c.m4 (b4_union_name): Leave a default value.
5923 * data/glr.c, data/yacc.c: Use it.
5925 2006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
5927 For associating token numbers with token names for "yacc.c", don't use
5928 #define statements unless `--yacc' is specified; always use enum
5929 yytokentype. Most important discussions start at:
5930 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
5931 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
5933 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
5934 * NEWS (2.3+): Mention.
5935 * data/c.m4 (b4_yacc_if): New.
5936 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
5938 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
5939 on token name definitions.
5940 * src/getargs.c (usage): Capitalize `Yacc' in English.
5941 * src/output.c (prepare): Define b4_yacc_flag.
5942 * tests/regression.at (Early token definitions): Test that tokens names
5943 are defined before the pre-prologue not just before the post-prologue.
5944 Remove this test case and copy to...
5945 (Early token definitions with --yacc): ... this to test #define's.
5946 (Early token definitions without --yacc): ... and this to test enums.
5948 2006-06-11 Paul Eggert <eggert@cs.ucla.edu>
5950 * NEWS: Reword the post-2.3 change to not be so optimistic about
5951 removing the old "look-ahead" spelling.
5952 Update previous look-ahead/lookahead change reports.
5953 * REFERENCES: look-ahead -> lookahead (since that's
5954 what he actually wrote).
5955 * doc/refcard.tex: look ahead -> lookahead,
5956 look-ahead -> lookahead
5958 2006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
5960 For consistency, use `lookahead' instead of `look-ahead' or
5961 `look_ahead'. Discussed starting at
5962 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
5964 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
5965 * NEWS: For the next release, note the change to `--report'.
5966 * TODO, doc/bison.1: Update English.
5967 * doc/bison.texinfo: Update English.
5968 (Understanding Your Parser, Bison Options): Document as
5969 `--report=lookahead' rather than `--report=look-ahead'.
5970 * src/conflicts.c: Update English in comments.
5971 (lookahead_set): Rename from look_ahead_set.
5972 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
5973 (resolve_sr_conflict): Rename local look_ahead_tokens to
5974 lookahead_tokens, and update other uses.
5975 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
5976 count_rr_conflicts, conflicts_free): Update uses.
5977 * src/getargs.c (report_args): Move "lookahead" before alternate
5979 (report_types): Update uses.
5980 (usage): For `--report' usage description, state `lookahead' spelling
5981 rather than `look-ahead'.
5982 * src/getargs.h (report.report_lookahead_tokens): Rename from
5983 report_look_ahead_tokens.
5984 * src/lalr.c: Update English in comments.
5985 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
5986 (state_lookahead_tokens_count): Rename from
5987 state_look_ahead_tokens_count.
5988 Rename local n_look_ahead_tokens to n_lookahead_tokens.
5989 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
5990 Rename local n_look_ahead_tokens to n_lookahead_tokens.
5992 Update English in output.
5993 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
5994 * src/print.c: Update English in comments.
5995 (lookahead_set): Rename from look_ahead_set.
5996 (print_reduction): Rename argument lookahead_token from
5998 (print_core, state_default_rule, print_reductions, print_results):
6000 * src/print_graph.c: Update English in comments.
6001 (print_core): Update uses.
6002 * src/state.c: Update English in comments.
6003 (reductions_new): Update uses.
6004 (state_rule_lookahead_tokens_print): Rename from
6005 state_rule_look_ahead_tokens_print, and update other uses.
6006 * src/state.h: Update English in comments.
6007 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
6008 (state_rule_lookahead_tokens_print): Rename from
6009 state_rule_look_ahead_tokens_print.
6010 * src/tables.c: Update English in comments.
6011 (conflict_row, action_row): Update uses.
6012 * tests/glr-regression.at
6013 (Incorrect lookahead during deterministic GLR,
6014 Incorrect lookahead during nondeterministic GLR): Rename
6015 print_look_ahead to print_lookahead.
6016 * tests/torture.at: Update English in comments.
6017 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
6018 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
6019 (Many lookahead tokens): Update uses.
6020 * data/glr.c: Update English in comments.
6021 * lalr1.cc: Likewise.
6023 * src/conflicts.h: Likewise.
6024 * src/lalr.h: Likewise.
6025 * src/main.c: Likewise.
6026 * src/output.c: Likewise.
6027 * src/parse-gram.c: Likewise.
6028 * src/tables.h: Likewise.
6029 * tests/calc.at: Likewise.
6031 2006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
6033 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
6035 2006-06-07 Paul Eggert <eggert@cs.ucla.edu>
6037 * TODO: Add request from Nelson H. F. Beebe to be able to install
6038 Bison without installing the yacc script.
6040 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
6042 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
6043 and yytext if they're already #define'd.
6044 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
6045 * src/scan-code-c.c: ... here.
6046 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
6049 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
6051 Get Bison to build again when configured with --enable-gcc-warnings.
6052 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
6054 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
6055 loc argument as it shadows a global.
6056 * src/scan-gram.l: Remove stray comma that prevents boundary_set
6059 * src/.cvsignore: Add scan-code.c.
6061 2006-06-07 Akim Demaille <akim@epita.fr>
6063 * src/scan-gram.l: Move the "add a trailing ; to actions" code
6065 * src/scan-code.l: here.
6066 * tests/input.at (Torturing the Scanner): Fix another location
6069 2006-06-07 Akim Demaille <akim@epita.fr>
6071 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
6073 2006-06-06 Akim Demaille <akim@epita.fr>
6075 Extract the parsing of user actions from the grammar scanner.
6076 As a consequence, the relation between the grammar scanner and
6077 parser is much simpler. We can also split "composite tokens" back
6079 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
6080 * src/scan-gram.l (add_column_width, adjust_location): Move to and
6082 * src/location.h, src/location.c (add_column_width)
6083 (location_compute): these.
6084 Fix the column count: the initial column is 0.
6085 (location_print): Be robust to ending column being 0.
6086 * src/location.h (boundary_set): New.
6087 * src/main.c: Adjust to scanner_free being renamed as
6089 * src/output.c: Include scan-code.h.
6090 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
6092 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
6093 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
6094 which is now, again, a separate token.
6095 Adjust all dependencies.
6096 Whereever actions with $ and @ are used, use translate_code.
6097 (action): Remove this nonterminal which is now useless.
6098 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
6099 (grammar_current_rule_action_append): Use translate_code.
6100 (packgram): Bound check ruleno, itemno, and rule_length.
6101 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
6102 (last_string, last_braced_code_loc, max_left_semantic_context)
6103 (scanner_initialize, scanner_free, scanner_last_string_free)
6104 (gram_out, gram_lineno, YY_DECL_): Move to...
6105 * src/scan-gram.h: this new file.
6106 (YY_DECL): Rename as...
6108 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
6109 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
6110 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
6111 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
6112 Move these declarations, and...
6113 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
6115 * src/flex-scanner.h: this new file.
6116 * src/scan-gram.l (rule_length, rule_length_overflow)
6117 (increment_rule_length): Remove.
6118 (last_braced_code_loc): Rename as...
6119 (gram_last_braced_code_loc): this.
6120 Adjust to the changes of the parser.
6121 Move all the handling of $ and @ into...
6122 * src/scan-code.l: here.
6123 * src/scan-gram.l (handle_dollar, handle_at): Remove.
6124 (handle_action_dollar, handle_action_at): Move to...
6125 * src/scan-code.l: here.
6126 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
6127 scan-code.h, scan-code-c.c, scan-gram.h.
6128 (EXTRA_bison_SOURCES): Add scan-code.l.
6129 (BUILT_SOURCES): Add scan-code.c.
6130 (yacc): Be robust to white spaces.
6132 * tests/conflicts.at, tests/input.at, tests/reduce.at,
6133 * tests/regression.at: Adjust the column numbers.
6134 * tests/regression.at: Adjust the error message.
6136 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
6138 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
6139 Use Akim's wording from
6140 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
6142 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
6144 Between Bison releases, manually append `+' to the previous Bison
6145 release number, and use that as a signal to automatically print the
6146 ChangeLog's CVS Id keyword from --version. Discussed starting at
6147 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
6148 * ChangeLog: Add Id header.
6149 * configure.ac (AC_INIT): Append `+' to `2.3'.
6150 * src/.cvsignore: Add revision.c.
6151 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
6152 (BUILT_SOURCES): Add revision.c.
6153 (revision.c): New target rule. This file defines a new global variable
6154 named revision. It initializes it with either the Id from ChangeLog
6155 or, if VERSION doesn't contain `+', with the empty string.
6156 * src/getargs.c (version): Print the value of revision.
6157 * src/revision.h: Extern revision.
6159 2006-06-05 Paul Eggert <eggert@cs.ucla.edu>
6161 * NEWS: Version 2.3.
6162 * configure.ac (AC_INIT): Likewise.
6164 2006-05-30 Paul Eggert <eggert@cs.ucla.edu>
6166 * data/glr.c (YYRECOVERING): Define to be a function-like macro
6167 with no arguments, not as an object-like macro. This is for
6168 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
6169 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
6170 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
6173 2006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
6175 * src/getargs.c (usage): Back out yesterday's modification of the
6176 --help output so that we don't have to wait for translation before
6179 2006-05-29 Paul Eggert <eggert@cs.ucla.edu>
6181 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
6182 Problem reported by Akim Demaille.
6184 2006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
6186 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
6188 2006-05-26 Paul Eggert <eggert@cs.ucla.edu>
6190 * data/yacc.c (yy_reduce_print): Omit trailing white space in
6191 generated source code. Problem reported by Frans Englich in
6192 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
6194 2006-05-22 Paul Eggert <eggert@cs.ucla.edu>
6196 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
6197 shell, not within 'make', so that 'make' by an ordinary builder
6198 (using GNU make) does not worry about configuring gzip. This also
6199 works around a bug reported independently by Keith Thompson and by
6200 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
6201 stderr rather than stdout, messing up the build logs.
6203 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
6205 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
6206 to make sure that YYID will never be unused. This fixes a 'make
6207 maintainer-check' failure caused by the recent changes to the 'Trivial
6208 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
6210 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
6212 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
6214 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
6215 state before an empty RHS is always resolved here. Only the location
6216 of that state is guaranteed to be resolved, and that's enough. This
6217 fixes the remaining bug reported by Derek M. Jones in
6218 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
6219 * tests/glr-regression.at (Uninitialized location when reporting
6220 ambiguity): Test the above case.
6221 Also, the embedded comments in this test case claim it checks the case
6222 of an empty RHS that has inherited the initial location. However, the
6223 corresponding LHS was already resolved, so yyresolveLocations didn't
6224 actually have reason to modify it. Fix this by forcing
6225 nondeterministic operation at the beginning of the parse.
6227 2006-05-20 Paul Eggert <eggert@cs.ucla.edu>
6229 * data/c.m4 (b4_yy_symbol_print_generate):
6230 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
6231 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
6232 of the bugs reported today by Derek M Jones in
6233 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
6234 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
6235 defined to be a type name without parens or brackets.
6236 (Location Type): Similarly for YYLTYPE.
6237 * tests/regression.at (Trivial grammars): Put in a test for this
6238 bug that will be caught by 'make maintainer-check' (though not,
6239 alas, by 'make check' unless your compiler is picky).
6241 2006-05-19 Paul Eggert <eggert@cs.ucla.edu>
6243 * NEWS: Version 2.2.
6244 * configure.ac (AC_INIT): Likewise.
6246 2006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
6248 * data/glr.c (yyreportTree): Make room in yystates for the state
6249 preceding the RHS. This fixes the segmentation fault reported by Derek
6251 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
6252 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
6253 to the user. Reported for yyreportTree by Derek M. Jones later in the
6255 * THANKS: Add Derek M. Jones.
6256 Update my email address.
6257 Fix typo in Steve Murphy's name.
6259 2006-05-14 Paul Eggert <eggert@cs.ucla.edu>
6261 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
6262 checking against YYLAST that caused the parser to miss a potential
6263 alternative in its diagnostic.
6264 Problem reported by Maria Jose Moron Fernandez in
6265 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
6266 * data/lalr1.cc (yysyntax_error_): Likewise.
6267 * data/yacc.c (yysyntax_error): Likewise.
6268 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
6269 tokens, in case we run into an older C compiler.
6270 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
6271 Use them to check for the off-by-one error fixed above.
6273 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
6274 YYSIZE_T, not size_t.
6275 * tests/regression.at (Trivial grammars): New test, to catch
6276 the error fixed by the above patch.
6278 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
6280 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
6282 Reported by Steve Murphy.
6284 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
6286 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
6287 * data/glr.cc: b4_location_flag is now b4_locations_flag.
6289 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
6291 Implement --trace=m4.
6292 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
6293 * src/output.c (output_skeleton): When set, pass -dV to m4.
6295 Factor the handling of flags in m4.
6296 * src/output.c (prepare): Rename the muscle names debug, defines,
6297 error_verbose to debug_flag, defines_flag, error_verbose_flag.
6298 * data/c.m4: Adjust.
6299 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
6300 Use b4_define_flag_if to define other b4_FLAG_if macros.
6301 (b4_location_if): As a consequence, rename as...
6302 (b4_locations_if): this, for consistency.
6303 Adjust all the skeletons.
6305 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
6307 * etc/bench.pm: Shorten bench names.
6309 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
6311 * src/output.h, src/output.c (error_verbose): Move to...
6312 * src/getargs.h, src/getargs.c: here.
6314 Adjust dependencies.
6316 2006-05-13 Paul Eggert <eggert@cs.ucla.edu>
6318 * data/c.m4 (b4_copyright): Put the special exception for Bison
6319 skeletons here, so we don't have to put it in each skeleton. All
6320 uses changed. Suggested by Akim Demaille. Also, wrap the
6321 copyright notice, in case it is longer than 80 columns. Replace
6322 comma by newline after title.
6324 2006-05-11 Paul Eggert <eggert@cs.ucla.edu>
6326 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
6327 incompatibility, not a bug. Mention that it wasn't fixed as of
6330 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
6332 * examples/extexi: Enforce the precedence of concatenation over
6334 Reported by Tommy Nordgren.
6336 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
6338 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
6339 with the member "token".
6340 Reported by Martin Nylin.
6342 2006-05-08 Paul Eggert <eggert@cs.ucla.edu>
6344 * data/glr.c: Switch to Bison 2.2 special-exception language in
6345 the copyright notice. Use more-regular format for titles and
6347 * data/glr.cc: Likewise.
6348 * data/location.cc: Likewise.
6349 * data/yacc.cc: Likewise.
6350 * doc/bison.texinfo (Conditions): Document this.
6351 * NEWS: likewise. Upgrade version to 2.2.
6353 2006-04-27 Akim Demaille <akim@lrde.epita.fr>
6355 * data/glr.cc: Remove dead code.
6357 2006-04-25 Paul Eggert <eggert@cs.ucla.edu>
6359 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
6360 that variable and the line breaks the bootstrap. Problem reported
6361 by Juan M. Guerrero.
6363 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
6365 * doc/bison.texinfo (Multiple start-symbols): New.
6367 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
6369 * etc/README, etc/bench.pl: New.
6371 2006-04-03 Akim Demaille <akim@lrde.epita.fr>
6373 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
6375 Reported by Mickael Labau.
6376 * tests/input.at (Torturing the Scanner): Test it.
6378 2006-03-16 Paul Eggert <eggert@cs.ucla.edu>
6380 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
6381 Problem reported by Bob Rossi.
6383 2006-03-13 Paul Eggert <eggert@cs.ucla.edu>
6385 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
6386 and didn't really work.
6387 For the index, use @ifnotinfo, not @iftex.
6388 Minor cleanups of spacing and terminology.
6390 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
6392 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
6393 of AT_NAME_PREFIX when %name-prefix is not used.
6395 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
6397 Apply --prefix to C++ skeletons too: they change the namespace.
6398 The test suite already exercize these cases.
6399 * data/c++.m4 (b4_namespace): New.
6400 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
6401 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
6402 * data/yacc.c, data/glr.c: Remove a useless `[]'.
6403 * doc/bison.texinfo: Document it.
6404 (Option Cross Key): Use @multitable in all formats. It looks
6405 nicer, even in TeX outputs.
6406 (Rules): Use the same code whatever the output type is.
6407 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
6408 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
6409 * tests/calc.at: Use it, instead of hard coding `yy'.
6411 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
6413 * TODO: Remove dead items.
6415 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
6417 * doc/FAQ: Remove, merged into...
6418 * doc/bison.texinfo (FAQ): this.
6419 * doc/Makefile.am (EXTRA_DIST): Adjust.
6421 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
6423 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
6425 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
6426 * doc/bison.texinfo (Calc++ Scanner): Use it.
6428 2006-03-09 Paul Eggert <eggert@cs.ucla.edu>
6430 Fix two nits reported by twlevo, plus one more that I discovered.
6432 * src/assoc.h (assoc_to_string): Give a name to the arg, as
6433 this is the usual Bison style.
6434 * src/location.h (location_print): Likewise.
6436 * src/reader.h (token_name): Likewise.
6438 2006-03-08 Paul Eggert <eggert@cs.ucla.edu>
6440 Fix some nits reported by twlevo.
6441 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
6442 and "POSIX". Use more-modern syntax for URLs. Mention C++
6443 and ask for Java. Don't hardwire OS version numbers. Add
6445 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
6446 * src/conflicts.c (solved_conflicts_obstack): Now static.
6448 2006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
6450 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
6451 page. Say "you can use it" not "you may use it" as on the web page;
6452 we're describing capabilities not granting permission.
6454 2006-03-06 Paul Eggert <eggert@cs.ucla.edu>
6456 * data/glr.c (yyresolveLocations): Rename local variables to avoid
6457 shadowing warnings. Use usual patter for iterating through RHS.
6458 * tests/glr-regression.at
6459 (Uninitialized location when reporting ambiguity):
6460 Modify yylex so that it uses its argument, rather than trying
6461 to rely on ARGSUSED (which doesn't work for gcc with warnings).
6462 const char -> char const.
6464 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
6465 Don't use tabs inside commands; it messes up 'ps'.
6466 Problem reported by twlevo.
6468 2006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
6470 * tests/glr-regression.at (Uninitialized location when reporting
6471 ambiguity): New test case.
6472 * data/glr.c (yyresolveLocations): New function, which uses
6474 (yyresolveValue): Invoke yyresolveLocations before reporting an
6476 * doc/bison.texinfo (Default Action for Locations): Note
6477 YYLLOC_DEFAULT's usage for ambiguity locations.
6478 (GLR Semantic Actions): Cross-reference those notes.
6480 2006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
6482 * tests/glr-regression.at (Leaked semantic values when reporting
6483 ambiguity): Remove unnecessary union and type declarations.
6484 (Leaked lookahead after nondeterministic parse syntax error): New test
6486 * data/glr.c (yyparse): Check for zero stacks remaining before
6487 attempting to shift the lookahead so that you don't lose it.
6489 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
6491 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
6492 * tests/glr-regression.at (Leaked semantic values when reporting
6493 ambiguity): New test case.
6494 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
6495 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
6496 now unnecessary yystackp parameter.
6497 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
6498 destructors can be called.
6500 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
6501 in existing testcases.
6503 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
6505 Don't leak semantic values for parent RHS when a user action cuts the
6506 parser, and clean up related code a bit.
6507 * tests/glr-regression.at (Leaked merged semantic value if user action
6508 cuts parse): Rename to...
6509 (Leaked semantic values if user action cuts parse): ... this. Add check
6510 for leaked parent RHS values.
6511 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
6512 between an unresolved state (non-empty chain of semantic options) and
6513 an incomplete one (signaled by an empty chain).
6514 (yyresolveStates): Document the interface. Move all manipulation of a
6515 successfully or unsuccessfully resolved yyGLRState to...
6516 (yyresolveValue): ... here so that yyresolveValue always leaves a
6517 yyGLRState with consistent data and thus is easier to understand.
6518 Remove the yyvalp and yylocp parameters since they are always just
6519 taken from the yys parameter. When reporting a discarded merged value
6520 in debugging output, note that it is incompletely merged. Document the
6522 (yyresolveAction): If resolving any of the RHS states fails, destroy
6523 them all rather than leaking them. Thus, as long as user actions are
6524 written to clean up the RHS correctly, yyresolveAction always cleans up
6525 the RHS of a semantic option. Document the interface.
6527 2006-02-27 Paul Eggert <eggert@cs.ucla.edu>
6529 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
6530 led to a segmentation fault in GNU Pascal. Problem reported
6533 2006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
6535 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
6536 mid-rule action inside a nonterminal symbol in order to declare a
6537 destructor for its semantic value.
6539 2006-02-16 Paul Eggert <eggert@cs.ucla.edu>
6541 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
6542 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
6543 __cplusplus && ! defined _STDLIB_H && !
6544 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
6545 defined free))]: Include <stdlib.h> rather than rolling our own
6546 declarations of malloc and free, to avoid problems with
6547 incompatible declarations (using 'throw') C++'s stdlib.h. This
6548 should fix Debian bug 340012
6549 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
6550 reported by Guillaume Melquiond.
6552 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
6554 * NEWS: Clarify symbols versus types in unused-value warnings.
6556 * configure.ac (AC_INIT): Bump version number.
6558 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
6560 * NEWS: Version 2.1a.
6561 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
6562 since C99 requires this.
6564 2006-02-11 Paul Eggert <eggert@cs.ucla.edu>
6566 * m4/c-working.m4: New file.
6567 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
6569 2006-02-10 Paul Eggert <eggert@cs.ucla.edu>
6571 * Makefile.maint: Merge from coreutils.
6573 2006-02-09 Paul Eggert <eggert@cs.ucla.edu>
6575 More portability fixes for problems summarized by Nelson H. F. Beebe.
6577 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
6578 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
6579 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
6580 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
6581 messes up because C++ code is compiled in 32-bit mode but linked
6584 2006-02-08 Paul Eggert <eggert@cs.ucla.edu>
6586 More portability fixes for problems summarized by Nelson H. F. Beebe.
6588 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
6589 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
6591 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
6592 nodist_PROGRAMS, since we don't need to actually compile the
6593 example if we're just doing a plain 'make'. This avoids bothering
6594 the installer unnecessarily about problems due to weird C++
6597 2006-02-06 Paul Eggert <eggert@cs.ucla.edu>
6599 More portability fixes for problems summarized by Nelson H. F. Beebe.
6601 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
6602 than #include "...", and compile with -I'.'. The old method was
6603 not portable, according to Posix and the C standard, and it does
6604 not work with Sun C 5.7, where previous #line directives affect
6605 the working directory used in later #include "..." directives.
6607 2006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6609 Various DJGGP specific issues in /djgpp
6611 2006-02-02 Paul Eggert <eggert@cs.ucla.edu>
6613 More portability fixes for problems summarized by Nelson H. F. Beebe.
6615 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
6616 '#include <map>' works and that you can apply ++ to iterators.
6618 2006-02-01 Paul Eggert <eggert@cs.ucla.edu>
6620 Work around portability problems summarized by Nelson H. F. Beebe in
6621 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
6623 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
6624 that '#include <string>' works.
6626 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
6627 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
6628 "warning: sorry: semantics of inline function static data `const
6629 unsigned char translate_table[262]' are wrong (you'll wind up with
6632 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
6633 or, xor to not_, and_, or_, and xor_, respectively. This works
6634 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
6635 random system header somewhere that includes the equivalent of
6638 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
6639 -E" works; it apparently doesn't work with PathScale EKO Compiler
6642 2006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
6644 During deterministic GLR operation, user actions should be able to
6645 influence the parse by changing yychar. To make this easier to fix and
6646 to make glr.c easier to evolve in general, don't maintain yytoken in
6647 parallel with yychar; just compute yytoken when needed.
6648 * tests/glr-regression.at (Incorrect lookahead during deterministic
6649 GLR): Check that setting yychar in a user action has the intended
6651 * data/glr.c (yyGLRStack): Remove yytokenp member.
6652 (yyclearin): Don't set *yytokenp.
6653 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
6654 yychar rather than *yytokenp to determine the current lookahead.
6655 Compute yytoken locally when needed.
6656 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
6659 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
6660 after `--report' documentation.
6662 2006-01-30 Paul Eggert <eggert@cs.ucla.edu>
6664 * src/parse-gram.y (grammar_declaration): Location of printer
6665 symbol is @1, not list->location. Bug reported by twlevo.
6666 * tests/input.at (Incompatible Aliases): Adjust to above change.
6668 2006-01-29 Paul Eggert <eggert@cs.ucla.edu>
6670 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
6671 all the test at once. This makes the output easier to read in the
6674 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
6675 got from <http://bro-ids.org/download.html>. The bug is that
6676 when two actions appeared in succession, the second one was
6677 scanned before the first one was added to the grammar rule
6678 as a midrule action. Bison then output the incorrect warning
6679 "parse.y:905.17-906.36: warning: unused value: $3".
6680 * src/parse-gram.y (BRACED_CODE, action): These are no longer
6681 associated with a value.
6682 (rhs): Don't invoke grammar_current_rule_action_append.
6683 (action): Invoke it here instead.
6684 * src/reader.c (grammar_midrule_action): Now extern.
6685 (grammar_current_rule_action_append): Don't invoke
6686 grammar_midrule_action; that is now the scanner's job.
6687 * src/reader.h (last_string, last_braced_code_loc):
6688 (grammar_midrule_action): New decls.
6689 * src/scan-gram.l (last_string): Now extern, sigh.
6690 (last_braced_code_loc): New extern variable.
6691 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
6692 rule already has an action.
6693 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
6694 * tests/input.at (AT_CHECK_UNUSED_VALUES):
6695 Add some tests to check that the above changes fixed the bug.
6697 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
6699 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
6700 All used changed. Check whether the symbol has a destructor,
6701 not whether it is typed.
6702 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
6703 that the values are still reported as unused. All line numbers
6706 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
6708 Work around a bug in bro 0.8, which underparenthesizes its
6709 definition of YYLLOC_DEFAULT.
6710 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
6712 * data/lalr1.cc: Likewise.
6713 * data/yacc.cc: Likewise.
6715 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
6717 Work around a bug in Pike 7.0, and give the Pike folks a
6718 better way to override the usual int widths.
6719 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
6720 user can override the types.
6721 (short): #undef, to work around a bug in Pike 7.0.
6722 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
6723 (union yyalloc.yyss): Use yytype_int16 rather than short.
6725 (yysigned_char): Remove.
6726 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
6727 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
6728 * tests/regression.at (Web2c Actions): Adjust to above changes.
6730 * src/reader.c (check_and_convert_grammar): New function.
6731 (reader): Close the input file even if something went wrong during
6732 parsing. Minor file descriptor leak reported by twlevo.
6734 * src/assoc.c (assoc_to_string): Use a default: abort (); case
6735 to pacify gcc -Wswitch-default.
6736 * src/scan-gram.l (adjust_location): Use a default: break; case
6737 to pacify gcc -Wswitch-default.
6738 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
6739 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
6740 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
6741 Move these decls to scan-skel.l, since they don't need to be
6743 * src/scan-skel.l: Accept the above decls.
6744 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
6747 2006-01-21 Paul Eggert <eggert@cs.ucla.edu>
6749 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
6750 since we don't want to insist on a version number at the start
6751 of the changelog every time.
6752 * Makefile.maint: Sync from coreutils a bit better.
6753 (sc_trailing_blank): Renamed from sc_trailing_space.
6755 (sc_no_if_have_config_h, sc_require_config_h):
6756 (sc_prohibit_assert_without_use): New rules.
6757 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
6758 (sc_dd_max_sym_length): Fix leading spaces in rule.
6759 (sc_system_h_headers): Prefix with @.
6760 (sc_useless_cpp_parens, m4-check): Output line numbers.
6761 (changelog-check): Allow version only in head.
6762 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
6763 satisfy new Makefile.maint rule.
6764 * data/glr.c: Likewise.
6765 * data/glr.cc: Likewise.
6766 * data/lalr1.cc: Likewise.
6767 * data/yacc.c: Likewise.
6768 * lib/ebitsetv.c: Likewise.
6769 * lib/lbitset.c: Likewise.
6770 * lib/subpipe.c: Likewise.
6771 * lib/timevar.c: Likewise.
6772 * src/system.h: Likewise.
6773 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
6774 * djgpp/Makefile.maint: Add copyright notice.
6775 * djgpp/README.in: Likewise.
6776 * djgpp/config.bat: Likewise.
6777 * djgpp/config.site: Likewise.
6778 * djgpp/config_h.sed: Likewise.
6779 * djgpp/djunpack.bat: Likewise.
6780 * djgpp/config.sed: Fix copyright notice to match standard format.
6781 * djgpp/subpipe.h: Likewise.
6782 * lib/bitsetv-print.c: Likewise.
6783 * lib/bitsetv.c: Likewise.
6784 * lib/subpipe.h: Likewise.
6785 * lib/timevar.c: Likewise.
6786 * lib/timevar.h: Likewise.
6787 * djgpp/subpipe.c: Use standard recipe for config.h.
6788 * lib/abitset.c: Likewise.
6789 * lib/bitset.c: Likewise.
6790 * lib/bitset_stats.c: Likewise.
6791 * lib/bitsetv-print.c: Likewise.
6792 * lib/bitsetv.c: Likewise.
6793 * lib/ebitsetv.c: Likewise.
6794 * lib/get-errno.c: Likewise.
6795 * lib/lbitset.c: Likewise.
6796 * lib/subpipe.c: Likewise.
6797 * lib/timevar.c: Likewise.
6798 * lib/vbitset.c: Likewise.
6799 * tests/local.at: Likewise.
6800 * src/scan-gram.l: Don't include verify.h, since system.h does
6802 * .x-sc_require_config_h: New file.
6803 * .x-sc_unmarked_diagnostics: New file.
6805 2006-01-20 Paul Eggert <eggert@cs.ucla.edu>
6807 Be a bit more systematic about using 'abort'.
6808 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
6809 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
6810 Put 'default: abort ();' before some other case, to satisfy older
6812 * lib/bitset_stats.c (bitset_stats_init): Likewise.
6813 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
6814 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
6815 * src/conflicts.c (resolve_sr_conflict): Likewise.
6816 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
6817 (get_decision_str, get_orientation_str, get_node_alignment_str):
6818 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
6819 (get_linestyle_str, get_arrowstyle_str): Likewise.
6820 * src/conflicts.c (resolve_sr_conflict):
6821 Use a default case rather than one for the one remaining enum
6822 value, to catch invalid enum values as well.
6823 * src/lalr.c (set_goto_map, map_goto):
6824 Prefer "assert (FOO);" to "if (!FOO) abort ();".
6825 * src/nullable.c (nullable_compute, token_definitions_output):
6827 * src/reader.c (packgram, reader): Likewise.
6828 * src/state.c (transitions_to, state_new, state_reduction_find):
6830 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
6831 (symbol_pack): Likewise.
6832 * src/tables.c (conflict_row, pack_vector): Likewise.
6833 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
6834 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
6835 * src/system.h: Don't include <assert.h>.
6836 (assert): New macro.
6838 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
6839 (Destructor Decl, Parser Function, Pure Calling):
6840 Describe rules for braces inside C code more carefully.
6842 2006-01-19 Paul Eggert <eggert@cs.ucla.edu>
6844 Fix some porting glitches found by Nelson H. F. Beebe.
6845 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
6846 compilers that don't understand that abort () does not return.
6847 * src/state.c (transitions_to): Likewise.
6848 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
6849 that '#include <cstdlib>' works.
6850 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
6851 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
6852 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
6853 for the benefit of some pre-C99 compilers.
6855 * bootstrap: Undo changes to gnulib files that autoreconf made.
6857 Minor fixups to get 'make maintainer-check' to work.
6858 * configure.ac: Don't use -Wnested-externs, as it's incompatible
6859 with the new verify.h implementation.
6860 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
6861 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
6862 * data/yacc.c (YYUSE): Likewise.
6863 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
6864 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
6865 * src/parse-gram.y (declaration): Don't pass a string constant
6866 to a function that expects char *, since GCC might complain
6867 about the constant value.
6868 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
6869 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
6870 before #defining them.
6871 * tests/glr-regression.at
6872 (Incorrectly initialized location for empty right-hand side in GLR):
6873 In yyerror, use the msg arg.
6874 (Corrupted semantic options if user action cuts parse):
6875 (Incorrect lookahead during deterministic GLR):
6876 (Incorrect lookahead during nondeterministic GLR):
6877 Don't name a local var 'index'; it shadows string.h's 'index'.
6879 2006-01-19 Akim Demaille <akim@epita.fr>
6881 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
6882 location, not just parts of it.
6884 2006-01-18 Paul Eggert <eggert@cs.ucla.edu>
6886 * NEWS: Document the fact that multiple %unions are now allowed.
6887 * doc/bison.texinfo (Union Decl): Likewise.
6888 * TODO: This feature is now implemented, so remove it from
6891 * Makefile.maint: Merge with coreutils Makefile.maint.
6892 (CVS_LIST): Use build-aux version if available.
6893 (VERSION_REGEXP): New macro.
6894 (syntax-check-rules): Add sc_no_if_have_config_h,
6895 sc_prohibit_assert_without_use, sc_require_config_h,
6896 sc_useless_cpp_parens.
6897 (sc_obsolete_symbols): Check for O_NDELAY.
6898 (sc_dd_max_sym_length): Track coreutils.
6899 (sc_unmarked_diagnostics): Look in all files, not just *.c.
6900 (sc_useless_cpp_parens): New rule.
6901 (news-date-check): Look for version or today's date.
6902 (changelog-check): Don't require version number near head.
6903 (copyright-check): Use current year instead of hardwiring 2005.
6904 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
6905 (announcement): Add --gpg-key-ID.
6907 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
6910 Avoid undefined behavior that addressed just before the start of an
6911 array. Problem reported by twlevo.
6912 * src/reader.c (packgram): Prepend a new sentinel before ritem.
6913 * src/lalr.c (build_relations): Rely on new sentinel.
6914 * src/gram.c (gram_free): Adjust to new sentinel.
6916 2006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
6918 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
6919 yylookaheadNeeds. All uses updated.
6920 (yysplitStack): Rename local yynewLookaheadStatuses to
6921 yynewLookaheadNeeds.
6922 * data/glr-regression.at (Incorrect lookahead during nondeterministic
6923 GLR): In comments, change `lookahead status' to `lookahead need'.
6925 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
6927 * data/glr.c (yysplitStack): A little stylistic rewrite.
6929 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
6931 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
6933 2006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
6935 * doc/bison.texinfo: Fix some typos.
6936 (GLR Semantic Actions): New subsection discussing special
6937 considerations because GLR semantic actions might be deferred.
6938 (Actions): Mention look-ahead usage of yylval.
6939 (Actions and Locations): Mention look-ahead usage of yylloc.
6940 (Special Features for Use in Actions): Add YYEOF entry and mention it
6941 in the yychar entry.
6942 In the yychar entry, remove mention of the local yychar case (pure
6943 parser) since this is irrelevant information when writing semantic
6944 actions and since it's already discussed in `Table of Symbols' where
6945 yychar is otherwise described as an external variable.
6946 In the yychar entry, don't call it the `current' look-ahead since it
6947 isn't when semantic actions are deferred.
6948 In the yychar and yyclearin entries, add note about deferred semantic
6950 Add yylloc and yylval entries discussing look-ahead usage.
6951 (Look-Ahead Tokens): When discussing yychar, don't call it the
6952 `current' look-ahead, and do mention yylval and yylloc.
6953 (Error Recovery): Cross-reference `Action Features' when mentioning
6955 (Table of Symbols): In the yychar entry, don't call it the `current'
6957 In the yylloc and yylval entries, mention look-ahead usage.
6959 2006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
6961 * tests/glr-regression.at: Update copyright year to 2006.
6963 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
6965 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
6966 use during nondeterministic operation to track which stacks have
6967 actually needed the current lookahead.
6968 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
6969 Allocate, deallocate, resize, and otherwise shuffle space for
6970 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
6971 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
6972 appropriately during nondeterministic operation.
6973 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
6974 members to store the current lookahead to be used by the deferred
6976 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
6977 from which the RHS is taken. Set the lookahead members of the new
6978 yySemanticOption according to the lookahead status for stack yyk.
6979 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
6980 yyaddDeferredAction.
6981 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
6982 members of yySemanticOption before invoking yyuserAction, and then set
6983 them back to their current values afterward.
6984 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
6985 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
6986 * tests/glr-regression.at: Remove `.' from the ends of recent test case
6987 titles for consistency.
6988 (Leaked merged semantic value if user action cuts parse): In order to
6989 suppress lint warnings, use arguments in merge function, and assign
6990 char value < 128 in main.
6991 (Incorrect lookahead during deterministic GLR): New test case.
6992 (Incorrect lookahead during nondeterministic GLR): New test case.
6994 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
6996 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
6997 !yyvaluep as signal that no semantic value is available to print.
6998 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
6999 to print a semantic value.
7001 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
7003 * tests/glr-regression.at: For consistency with my newer test cases,
7006 2006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
7008 * data/glr.c (yyresolveValue): When merging semantic options, if at
7009 least one user action succeeds but a later one cuts the parse, then
7010 destroy the semantic value before returning rather than leaking it.
7011 (yyresolveStates): If a user action cuts the parse and thus
7012 yyresolveValue fails, ignore the (unset) semantic value rather than
7013 corrupting the yyGLRState, and empty the semantic options list since
7014 the user actions should have called all necessary destructors.
7015 Simplify code with YYCHK.
7016 * tests/glr-regression.at (Corrupted semantic options if user action
7017 cuts parse): New test case.
7018 (Undesirable destructors if user action cuts parse): New test case.
7019 Before applying any of this patch, this test case never actually failed
7020 for me... but only because the corrupted semantic options usually
7022 (Leaked merged semantic value if user action cuts parse): New test
7025 2006-01-05 Akim Demaille <akim@epita.fr>
7027 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
7029 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
7031 * data/c.m4 (b4_c_modern): New macro, with a new provision for
7032 _MSC_VER. Problem reported by Cenzato Marco.
7033 (b4_c_function_def): Use it.
7034 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
7036 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
7037 than rolling our own.
7039 2006-01-04 Akim Demaille <akim@epita.fr>
7041 Also warn about non-used mid-rule values.
7042 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
7044 (symbol_list_new): Adjust.
7045 * src/reader.c (symbol_typed_p): New.
7046 (grammar_rule_check): Use it.
7047 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
7049 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
7051 * tests/actions.at (Exotic Dollars): Adjust.
7053 2006-01-04 Akim Demaille <akim@epita.fr>
7055 * src/reader.c (grammar_midrule_action): If $$ is set in a
7056 mid-rule, move the `used' bit to its lhs.
7057 * tests/input.at (Unused values): New.
7058 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
7060 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
7062 * doc/bison.texinfo (Bison Options): Say more accurately what
7064 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
7065 about declarations in the grammar when in Yacc mode, as POSIX does
7066 not require a diagnostic when the grammar uses extensions.
7068 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
7070 Warn about dubious constructions like "%token T T".
7072 * src/symtab.h (struct symbol.declared): New member.
7073 * src/symtab.c (symbol_new): Initialize it to false.
7074 (symbol_class_set): New arg DECLARING, specifying whether
7075 this is a declaration that we want to warn about, if there
7076 is more than one of them. All uses changed.
7078 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
7079 Allow multiple %union directives, whose contents concatenate.
7080 * src/parse-gram.y (grammar_declaration): Likewise.
7081 Use muscle_code_grow, so that we don't need stype_line any more.
7084 * src/muscle_tab.c (muscle_grow): Fix comment.
7086 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
7087 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
7088 Update copyright year to 2006.
7090 2006-01-03 Akim Demaille <akim@epita.fr>
7092 Have glr.cc pass (some of) the calc.at tests.
7093 * data/glr.cc (b4_parse_param_orig): New.
7094 (b4_parse_param): Improve its definition, and bound it more
7095 clearly in the skeleton.
7096 (b4_epilogue): Append, instead of prepending, in order to keep
7098 Simplify the generation of auxiliary functions: locations and
7099 purity are mandated.
7100 (b4_global_tokens_and_yystype): Honor it.
7101 * data/location.cc (c++.m4): Don't include it.
7102 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
7104 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
7106 Be sure to initialize the first position's filename.
7107 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
7109 (AT_CHECK_CALC_GLR_CC): New.
7110 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
7112 2006-01-02 Akim Demaille <akim@epita.fr>
7114 * src/output.c (output_skeleton): Don't hard wire the inclusion of
7116 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
7117 * data/glr.cc: Do not include stack.hh.
7119 2006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
7121 * data/glr.c: Reformat whitespace with tabs.
7122 (b4_lpure_formals): Remove this unused m4 macro.
7123 * tests/cxx-type.at: Reformat whitespace with tabs.
7124 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
7125 since it's a member. Rename type to isNterm for clarity.
7127 2005-12-29 Akim <akim@sulaco.local>
7129 Let glr.cc catch up with symbol_value_print.
7130 * data/glr.cc (b4_yysymprint_generate): Replace by...
7131 (b4_yy_symbol_print_generate): this.
7132 (yy_symbol_print, yy_symbol_value_print): Declare them.
7134 2005-12-28 Paul Eggert <eggert@cs.ucla.edu>
7136 * src/location.h (boundary): Note that a line or column equal
7137 to INT_MAX indicates an overflow.
7138 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
7139 (rule_length_overflow, increment_rule_length, add_column_width):
7141 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
7142 (<SC_BRACED_CODE>"}"):
7143 Use increment_rule_length rather than incrementing it by hand.
7144 (adjust_location, handle_syncline): Diagnose overflow.
7145 (handle_action_dollar, handle_action_at):
7146 Fix bug with monstrosities like $-2147483648.
7147 Remove now-unnecessary checks.
7148 (scan_integer): Verify assumptions and remove now-unnecessary checks.
7149 (convert_ucn_to_byte): Verify assumptions.
7150 (handle_syncline): New arg LOC. All callers changed.
7151 Don't store through a value derived from char const * pointer.
7153 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
7156 2005-12-27 Paul Eggert <eggert@cs.ucla.edu>
7158 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
7159 Remove unnecessary forward static decls.
7161 2005-12-27 Akim Demaille <akim@epita.fr>
7163 * src/reader.c (grammar_current_rule_check): Also check that $$
7165 Take the rule to check as argument, hence rename as...
7166 (grammar_rule_check): this.
7167 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
7169 (grammar_rule_begin, grammar_rule_end): these, for consistency.
7170 (grammar_midrule_action, grammar_symbol_append): Now static.
7171 * tests/torture.at (input): Don't rely on the default action
7172 being always performed.
7173 * tests/calc.at: "Set" $$ even when the action is "cut" with
7175 * tests/actions.at (Exotic Dollars): Instead of using unused
7176 values, check that the warning is issued.
7178 2005-12-22 Paul Eggert <eggert@cs.ucla.edu>
7180 * NEWS: Improve wording for unused-value warnings.
7182 2005-12-22 Akim Demaille <akim@epita.fr>
7184 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
7185 (b4_yysymprint_generate): Rename as...
7186 (b4_yy_symbol_print_generate): this.
7187 Generate yy_symbol_print instead of yysymprint.
7188 Generate also yy_symbol_value_print, and use it.
7190 2005-12-22 Akim Demaille <akim@epita.fr>
7192 * NEWS: Warn about unused values.
7193 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
7195 (symbol_list_n_get, symbol_list_n_used_set): New.
7196 (symbol_list_n_type_name_get): Use symbol_list_n_get.
7197 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
7198 * src/reader.c (grammar_current_rule_check): Check that values are
7200 * src/symtab.c (symbol_print): Accept 0.
7201 * tests/existing.at: Remove the type information.
7203 Remove useless actions (beware of mid-rule actions: perl -000
7204 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
7205 * tests/actions.at (Exotic Dollars): Use unused values.
7206 * tests/calc.at: Likewise.
7207 * tests/glr-regression.at (No users destructors if stack 0 deleted):
7210 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
7213 2005-12-21 Paul Eggert <eggert@cs.ucla.edu>
7215 Undo 2005-12-01 tentative license wording change. The wording is
7216 still being reviewed by the lawyers, and we don't want to wait for
7217 them before publishing a test release. For now, revert to the
7219 * NEWS: Undo 2005-12-01 change.
7220 * data/glr.c: Revert to previous license wording.
7221 * data/glr.cc: Likewise.
7222 * data/lalr1.cc: Likewise.
7223 * data/location.cc: Likewise.
7224 * data/yacc.c: Likewise.
7226 * NEWS: Reword %destructor vs YYABORT etc.
7227 * data/glr.c: Use American spacing, for consistency.
7228 * data/glr.cc: Likewise.
7229 * data/lalr1.cc: Likewise.
7230 * data/yacc.c: Likewise.
7231 * data/yacc.c: Reformat comments slightly.
7232 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
7233 for consistency. Fix some spelling errors and reword recently-included
7235 * tests/cxx-type.at: Cast results of malloc, for C++.
7237 2005-12-21 Joel E. Denny <address@hidden>
7239 * tests/cxx-type.at: Construct a tree, count the parents of shared
7240 nodes, and free each node once and only once. Previously, the memory
7241 for semantic values was leaked instead.
7243 2005-12-21 Joel E. Denny <address@hidden>
7245 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
7246 (yylval, yylloc): If pure, #define to yystackp->yyval and
7247 yystackp->yyloc similar to yychar and yynerrs.
7248 (yyparse): If pure, remove local yylval and yylloc. Add local
7249 yystackp to accommodate pure definitions of yylval and yylloc.
7250 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
7251 yylvalp and yyllocp to &yylval and &yylloc.
7252 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
7253 namespace. Previously, nerrs and char were missing, but lval and lloc
7255 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
7256 yylvalp and yyllocp parameters since, if pure, these are now always
7257 accessible through yystackp. If not pure, they are still accessible
7259 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
7260 `if (YYID (N))' to pacify lint.
7262 2005-12-21 Akim Demaille <akim@epita.fr>
7264 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
7265 destroy the RHS symbols of a rule.
7266 * data/yacc.c (yylen): Initialize to 0.
7267 Keep its value to the number of items to possibly shift.
7268 In particular, a regular successful parse that ends on YYFINAL by
7269 a (internal) YYACCEPT must not have yylen != 0.
7270 (yyerrorlab, yyreturn): Pop the RHS.
7271 Reorder a bit to emphasize the `shifting' bits of code.
7272 (YYPOPSTACK): Now accept a number of items to pop.
7273 * data/lalr1.cc: Likewise.
7274 * data/glr.c: Formatting changes.
7275 Use goto instead of fall through.
7276 * doc/bison.texinfo (Destructor Decl): Complete.
7278 2005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7280 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
7281 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
7282 * djgpp/config.bat: Replace every occurence of the file name
7283 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
7284 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
7285 * djgpp/config.sed: Replace every occurence of the file name
7286 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
7287 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
7288 * djgpp/djunpack.bat: DJGPP specific file.
7289 * djgpp/fnchange.lst: DJGPP specific file.
7290 * djgpp/README.in: Add new information about how to unpack the bison
7291 source on MSDOS and other systems which have 8.3 file name restrictions
7292 using djunpack.bat and fnchange.lst.
7294 2005-12-12 Paul Eggert <eggert@cs.ucla.edu>
7296 * bootstrap (build_cvs_prefix): Remove; unused.
7297 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
7298 when getting gnulib.
7300 2005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
7302 * data/glr.c: Reorder typedef declarations for structs to match order
7303 of struct declarations.
7304 Rename yystack everywhere to yystackp except in yyparse where it's not
7306 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
7308 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
7309 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
7310 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
7313 2005-12-09 Paul Eggert <eggert@cs.ucla.edu>
7315 * tests/sets.at (Accept): Fix typos in regular expression used to
7316 sed out the final state number.
7318 Work around portability problem on Solaris 10: flex-generated
7319 files include <stdio.h> before <config.h>, which messes up
7320 because the latter defines __EXTENSIONS__. Address the problem
7321 by creating two new little files that include <config.h> first,
7322 then include the flex-generated files. Rewrite everyone else
7323 to include <config.h> first, as well.
7324 * lib/timevar.c: Always include "config.h".
7325 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
7326 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
7327 (EXTRA_bison_SOURCES): New macro.
7328 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
7329 * src/system.h: Don't include config.h.
7330 * src/LR0.c: Include <config.h> first.
7331 * src/assoc.c: Likewise.
7332 * src/closure.c: Likewise.
7333 * src/complain.c: Likewise.
7334 * src/conflicts.c: Likewise.
7335 * src/derives.c: Likewise.
7336 * src/files.c: Likewise.
7337 * src/getargs.c: Likewise.
7338 * src/gram.c: Likewise.
7339 * src/lalr.c: Likewise.
7340 * src/location.c: Likewise.
7341 * src/main.c: Likewise.
7342 * src/muscle_tab.c: Likewise.
7343 * src/nullable.c: Likewise.
7344 * src/output.c: Likewise.
7345 * src/parse-gram.y: Likewise.
7346 * src/print.c: Likewise.
7347 * src/print_graph.c: Likewise.
7348 * src/reader.c: Likewise.
7349 * src/reduce.c: Likewise.
7350 * src/relation.c: Likewise.
7351 * src/state.c: Likewise.
7352 * src/symlist.c: Likewise.
7353 * src/symtab.c: Likewise.
7354 * src/tables.c: Likewise.
7355 * src/uniqstr.c: Likewise.
7356 * src/vcg.c: Likewise.
7358 * src/parse-gram.y: Fix minor problems uncovered by lint.
7359 (current_lhs, current_lhs_location): Now static.
7360 (current_assoc): Remove unused variable.
7362 Cleanups so that Bison-generated parsers have less lint.
7363 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
7364 Prepend /*ARGSUSED*/, for lint's sake.
7365 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
7366 definition if 'lint' is defined.
7367 (YYID): New macro (or function, if lint).
7368 All uses of /*CONSTCOND*/0 replaced by YYID(0).
7369 * data/yacc.c: Likewise.
7370 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
7371 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
7372 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
7374 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
7375 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
7376 Use YYID(0) rather than 0, for lint.
7377 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
7378 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
7380 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
7382 * tests/glr-regression.at
7383 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
7384 Close memory leak reported by twlevo.
7386 2005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
7388 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
7390 (yyparse): Iterate another stack in order to call user destructors.
7391 * tests/glr-regression.at (No users destructors if stack 0 deleted):
7393 (Duplicated user destructor for lookahead): This test now is expected
7396 2005-12-01 Paul Eggert <eggert@cs.ucla.edu>
7398 * NEWS: Document the following change.
7399 * data/yacc.c: Say "parser skeleton" rather than "file", since
7400 it's no longer just a file.
7401 * data/glr.c: Grant a special exception for C GLR parsers, that
7402 reads like the already-existing exception for C LALR(1) parsers.
7403 * data/glr.cc: Likewise.
7404 * data/lalr1.cc: Likewise.
7405 * data/location.cc: Likewise.
7406 * data/yacc.c: Reword the "written by" statement to clarify that
7407 it was the parser skeleton, not the entire output file.
7408 * data/glr.c: Written by Paul Hilfinger.
7409 * data/glr.cc: Written by Akim Demaille.
7410 * data/lalr1.cc: Likewise.
7412 2005-11-18 Paul Eggert <eggert@cs.ucla.edu>
7414 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
7415 Fix typos in previous change that broke 'make check'.
7416 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
7418 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
7419 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
7420 We can revert this once things settle down.
7422 * src/conflicts.c (conflicts_print): Don't print file name twice
7423 when %expect fails because there were no conflicts.
7424 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
7426 * tests/conflicts.at (%expect not enough, %expect too much):
7427 (%expect with reduce conflicts): Adjust to new behavior.
7429 2005-11-18 Akim Demaille <akim@epita.fr>
7431 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
7433 * NEWS: Document this.
7434 * doc/bison.texinfo (Expect Decl): Likewise.
7436 2005-11-16 Akim Demaille <akim@epita.fr>
7438 Generalize the display of semantic values and locations in traces.
7439 * data/glr.c (yy_reduce_print): Fix indices (again).
7440 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
7442 * data/lalr1.cc (yyreduce_print): Rename as...
7443 (yy_reduce_print): this.
7444 Display values and locations.
7445 * data/yacc.c (yy_reduce_print): Likewise.
7446 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
7447 (yysymprint): Move higher to be visible from yy_reduce_print).
7449 * tests/calc.at: Adjust the expected length of the traces.
7451 2005-11-14 Akim Demaille <akim@epita.fr>
7453 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
7454 from 1 to N, while values and location start at 0.
7455 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
7457 2005-11-14 Akim Demaille <akim@epita.fr>
7459 * data/glr.c (yy_reduce_print): Fix the $ number.
7461 2005-11-14 Akim Demaille <akim@epita.fr>
7463 "Use" parse parameters.
7464 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
7465 * data/glr.c, data/glr.cc: Use them.
7466 * data/glr.c (YYUSE): Have a C++ definition that supports
7469 2005-11-14 Akim Demaille <akim@epita.fr>
7471 * data/glr.c (yyexpandGLRStack): Declare only if defined.
7473 2005-11-14 Akim Demaille <akim@epita.fr>
7476 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
7478 2005-11-12 Akim Demaille <akim@epita.fr>
7480 Let position and location be PODs.
7481 * data/location.cc (position::initialize, location::initialize): New.
7482 (position::position, location::location): Define only if
7483 b4_location_constructors is defined.
7484 * data/lalr1.cc (b4_location_constructors): Define it for backward
7486 * doc/bison.texinfo (Initial Action Decl): Use initialize.
7488 2005-11-12 Akim Demaille <akim@epita.fr>
7490 * data/lalr1.cc: Move the body of the ctor and dtor into the
7491 parser file (instead of the header).
7492 Wrap the implementations in a "namespace yy".
7494 2005-11-12 Akim Demaille <akim@epita.fr>
7496 Have glr.c include its header file when created.
7497 * data/glr.c (b4_shared_declarations): New.
7498 Output them verbatim in the parser if !%defines, otherwise
7499 output then in the header file, and include it instead.
7501 2005-11-11 Akim Demaille <akim@epita.fr>
7503 * data/glr.c: Comment changes.
7505 2005-11-11 Akim Demaille <akim@epita.fr>
7507 When yydebug, report semantic and location values for reductions.
7508 * data/glr.c (yy_reduce_print): Report the semantic values and the
7510 (YY_REDUCE_PRINT): Adjust.
7511 (yyglrReduce): Use them.
7512 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
7513 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
7514 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
7517 2005-11-10 Akim Demaille <akim@epita.fr>
7519 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
7520 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
7521 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
7523 2005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
7525 * m4/cxx.m4, examples/Makefile.am: Don't build
7526 examples/calc++ if no C++ compiler is available. (trivial change)
7528 2005-11-09 Akim Demaille <akim@epita.fr>
7530 * src/scan-skel.l: Use a couple of asserts.
7532 2005-11-03 Akim Demaille <akim@epita.fr>
7534 In some (weird) cases, the final state number is incorrect.
7535 Reported by Alexandre Duret-Lutz.
7536 * src/LR0.c (state_list_append): Remove the computation of
7538 (save_reductions): Do it here.
7539 (get_state): Alpha conversion.
7540 (generate_states): Use a for loop.
7541 * src/gram.h (item_number_is_rule_number)
7542 (item_number_is_symbol_number): New.
7543 * src/state.c: Use assert.
7544 * src/system.h: Include assert.h.
7545 * tests/sets.at (Accept): New.
7547 2005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7549 * data/glr.c (yyfill): Adjust comment.
7550 (yyresolveAction): Initialize default location properly
7551 for empty right-hand sides.
7552 (yydoAction): Ditto.
7553 Add comment explaining apparently dead code.
7554 * tests/glr-regression.at
7555 (Incorrectly initialized location for empty right-hand side in GLR):
7558 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
7560 * bootstrap (cleanup_gnulib): New function. Use it to clean up
7561 gnulib when interrupted. This fixes some race conditions and
7562 works around some portability problems (one noted by Paul
7565 2005-10-22 Akim <akim@epita.fr>
7567 * Makefile.cfg: Adjust to config -> build-aux.
7570 2005-10-21 Akim Demaille <akim@epita.fr>
7572 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
7574 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
7575 * data/yacc.c (b4_Pure_if): Rename as...
7576 (b4_yacc_pure_if): this.
7577 (YY_SYMBOL_PRINT, yyparse): Adjust.
7578 * doc/bison.texinfo: Formatting changes.
7580 2005-10-21 Akim Demaille <akim@epita.fr>
7582 Finish the transition config -> build-aux.
7583 * configure.ac, Makefile.am: Use build-aux.
7584 * config/prev-version, config/announce-gen, config/Makefile.am:
7586 * build-aux/prev-version, build-aux/announce-gen,
7587 * build-aux/Makefile.am: here.
7589 2005-10-14 Akim Demaille <akim@epita.fr>
7591 * examples/calc++/test: Use set -x only when VERBOSE.
7593 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
7595 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
7596 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
7598 2005-10-13 Akim Demaille <akim@epita.fr>
7600 * src/scan-skel.l: Output the base name parts of the parser and
7602 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7604 Use this to exercise C++ outputs in subdirs.
7605 Reported by Oleg Smolsky.
7607 2005-10-12 Paul Eggert <eggert@cs.ucla.edu>
7609 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
7610 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
7611 Problem reported by John P. Hartmann.
7612 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
7615 2005-10-12 Akim Demaille <akim@epita.fr>
7617 * src/parse-gram.y (version_check): Exit 63 to please missing
7618 (stands for "version mismatch).
7619 * tests/input.at, doc/bison.texinfo: Adjust.
7621 2005-10-10 Paul Eggert <eggert@cs.ucla.edu>
7623 Work around portability problems with Visual Age C compiler
7624 (xlc and xlC_r) reported by John P. Hartmann.
7625 * data/location.cc (initial_column, initial_line): Remove.
7626 All uses replaced by 0 and 1.
7627 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
7628 that xlc complains about.
7629 * src/scan-skel.l (skel_wrap): Likewise.
7630 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
7632 * data/yacc.c (YYMODERN_C): New macro, which also looks at
7633 __STDC_VERSION__. Use it everywhere instead of looking at
7634 __STDC__ and __cplusplus.
7636 2005-10-10 Akim Demaille <akim@epita.fr>
7638 * examples/calc++/test: Be quiet unless VERBOSE.
7640 2005-10-05 Paul Eggert <eggert@cs.ucla.edu>
7642 * data/c.m4 (yydestruct, yysymprint):
7643 Use YYUSE instead of casting to void.
7644 * data/glr.c (YYUSE): New macro.
7645 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
7646 Use it instead of rolling our own.
7647 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
7649 Use /*CONSTCOND*/ to suppress lint warnings.
7650 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
7651 (YY_STACK_PRINT): Use 'false' not '0'.
7653 (yysymprint_, yydestruct_): Use it instead of rolling our own.
7654 * data/yacc.c (YYUSE): New macro.
7655 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
7656 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
7657 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
7660 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
7661 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
7663 2005-10-04 Paul Eggert <eggert@cs.ucla.edu>
7665 Undo the parts of the unlocked-I/O change that substituted
7666 putc or puts for printf. This might hurt performance a bit,
7667 but some people prefer the printf style.
7668 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
7669 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
7670 All uses replaced by YYFPRINTF and YYDPRINTF.
7671 * data/yacc.c: Likewise.
7672 * lib/bitset.c (bitset_print): Likewise.
7673 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
7675 * lib/lbitset.c (debug_lbitset): Likewise.
7676 * src/closure.c (print_firsts, print_fderives): Likewise.
7677 * src/gram.c (grammar_dump): Likewise.
7678 * src/lalr.c (look_ahead_tokens_print): Likewise.
7679 * src/output.c (escaped_output): Likewise.
7680 (user_actions_output): Break apart two printfs.
7681 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
7682 * src/reduce.c (reduce_print): Likewise.
7683 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
7684 * src/system.h: Include unlocked-io.h rathe than stdio.h.
7686 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
7687 Use assignments rather than casts-to-void to suppress
7688 unused-variable warnings. This pacifies 'lint'.
7689 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
7690 unused-variable warnings.
7692 2005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7694 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
7696 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
7698 Use unlocked I/O for a minor performance improvement on hosts like
7699 GNU/Linux and Solaris that support unlocked I/O. The basic idea
7700 is to use the gnlib unlocked-io module, and to prefer putc and
7701 puts to printf when either will work (since the latter doesn't
7702 come in an unlocked flavor).
7703 * bootstrap (gnulib_modules): Add unlocked-io.
7704 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
7705 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
7706 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
7707 and similarly for puts and putc and printf.
7708 * data/yacc.c: Likewise.
7709 * lib/bitset.c (bitset_print): Likewise.
7710 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
7711 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
7713 * lib/lbitset.c (debug_lbitset): Likewise.
7714 * src/closure.c (print_firsts, print_fderives): Likewise.
7715 * src/gram.c (grammar_dump): Likewise.
7716 * src/lalr.c (look_ahead_tokens_print): Likewise.
7717 * src/output.c (escaped_output): Likewise.
7718 (user_actions_output): Coalesce two printfs.
7719 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
7720 * src/reduce.c (reduce_print): Likewise.
7721 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
7722 * src/system.h: Include unlocked-io.h rather than stdio.h.
7724 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
7725 this confuses xgettext.
7727 2005-10-02 Akim Demaille <akim@epita.fr>
7729 * bootstrap (gnulib_modules): Add strverscmp.
7730 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
7731 * m4/.cvsignore: Add strverscmp.m4.
7732 * src/parse-gram.y (%require): New token, new rule.
7733 (version_check): New.
7734 * src/scan-gram.l (%require): Adjust.
7735 * tests/input.at (AT_REQUIRE): New.
7737 * doc/bison.texinfo (Require Decl): New.
7738 (Calc++ Parser): Use %require.
7740 2005-10-02 Akim Demaille <akim@epita.fr>
7742 * data/location.cc: New.
7744 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
7745 Akim Demaille <akim@epita.fr>
7747 Make sure -odir/foo.cc creates dir/location.hh etc.
7748 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
7749 (spec_file_prefix, spec_verbose_file, spec_graph_file)
7750 (spec_defines_file): Now const.
7752 (short_base_name): Remove.
7753 * src/files.c: Adjust.
7754 (dirname.h): Include.
7755 (base_name): Don't prototype it.
7756 (finput): Remove, duplicates gram_in.
7757 (full_base_name, short_base_name): Replace by...
7758 (all_but_ext, all_but_tab_ext): these.
7759 (compute_base_names): Rename as...
7760 (compute_file_name_parts): this.
7761 Update to compute the new variables, including dir_prefix.
7762 Adjust dependencies.
7763 * src/output.c (prepare): Output them.
7764 * src/reader.c: Adjust to use gram_in, not finput.
7765 * src/scan-skel.l (@dir_prefix@): New.
7767 2005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7769 * lib/subpipe.c: New function end_of_output_subpipe() added
7770 to allow support for non-posix systems. This is a no-op function
7773 * lib/subpipe.h: New function end_of_output_subpipe() added
7774 to allow support for non-posix systems. This is a no-op function
7777 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
7778 handle the lack of pipe/fork functionality on non-posix systems.
7780 * djgpp/Makefile.maint: DJGPP specific file.
7782 * djgpp/README.in: DJGPP specific file.
7784 * djgpp/config.bat: DJGPP specific configuration file.
7786 * djgpp/config.sed: DJGPP specific configuration file.
7788 * djgpp/config.site: DJGPP specific configuration file.
7790 * djgpp/config_h.sed: DJGPP specific configuration file.
7792 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
7794 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
7796 2005-10-02 Akim Demaille <akim@epita.fr>
7798 * data/location.cc: New, extract from...
7799 * data/lalr1.cc: here.
7800 (location.hh): Include it after the user prologue, in case the
7801 filename type is defined by the user.
7802 Forward declation location and position before the pre-prologue.
7803 (yyresult_): Rename as...
7804 (yyresult): this, it's a local variable, not an attribute.
7805 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
7807 2005-10-01 Akim Demaille <akim@epita.fr>
7809 * examples/extexi: Restore the #line generation.
7811 2005-09-30 Akim Demaille <akim@epita.fr>,
7812 Alexandre Duret-Lutz <adl@gnu.org>
7814 Move the token type and YYSTYPE in the parser class.
7815 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
7816 (parser::token): New, from the moved free definition of tokens.
7817 (parser::semantic_value): Now a full definition instead of an
7818 indirection to YYSTYPE.
7819 (b4_post_prologue): No longer included in the header file, but
7820 in the implementation file.
7821 * doc/bison.texi (C+ Language Interface): Update.
7822 * src/parse-gram.y: Support unary %define.
7823 * tests/actions.at: Define global_tokens_and_yystype for backward
7824 compatibility until we update the tests.
7825 * tests/calc.at: Idem.
7826 (first_line, first_column, last_line, last_column): Define for lalr1.cc
7827 to simplify the code.
7829 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
7831 Port to SunOS 4.1.4, which lacks strtoul and strerror.
7832 Ah, the good old days! Problem reported by Peter Klein.
7833 * bootstrap (gnulib_modules): Add strerror, strtoul.
7834 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
7835 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
7837 2005-09-29 Akim Demaille <akim@epita.fr>
7839 * data/c.m4 (b4_error_verbose_if): New.
7840 * data/lalr1.cc: Use it.
7841 (YYERROR_VERBOSE_IF): Remove.
7842 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
7843 parser members, replaced by...
7844 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
7846 (yysyntax_error_): Takes the state number as argument.
7847 (yyreduce_print_): Use the argument yyrule, not the former
7850 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
7852 * bootstrap (gnulib_modules): Add verify.
7853 * lib/.cvsignore: Add verify.h.
7854 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
7855 * src/system.h (verify): Remove.
7856 Include verify.h instead.
7857 * src/tables.c (tables_generate): Use new API for 'verify'.
7859 2005-09-21 Paul Eggert <eggert@cs.ucla.edu>
7861 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
7862 local variables whose names begin with 'yy'.
7863 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
7864 Trivial changes from Joel E. Denny.
7866 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
7868 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
7869 don't use alloca any more.
7871 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
7872 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
7873 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
7874 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
7875 to match yacc.c, to test more hosts.
7877 2005-09-20 Paul Eggert <eggert@cs.ucla.edu>
7879 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
7880 doesn't affect behavior.
7881 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
7883 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
7884 This works a bit better with glibc, if user code has already included
7886 * doc/bison.texinfo (Bison Parser): Document that users can't
7887 arbitrarily use malloc and free for other purposes. Document
7888 that <alloca.h> and <malloc.h> might be included.
7889 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
7890 user must declare alloca.
7892 * HACKING (release): Forwarn the Translation Project about
7895 2005-09-20 Akim Demaille <akim@epita.fr>
7897 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
7899 2005-09-19 Paul Eggert <eggert@cs.ucla.edu>
7901 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
7902 (YYSTACK_ALLOC_MAXIMUM): Use it.
7903 (yysyntax_error): New function.
7904 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
7905 multiple syntax errors are reported, and alloca is being used.
7906 Instead, reallocate buffers twice as big each time, so that
7907 we waste at most half the allocated memory. Start with a small
7908 (128-byte) buffer that will suffice in most cases anyway.
7909 Use yysyntax_error to do most of the work.
7911 * doc/bison.texinfo (Error Reporting, Table of Symbols):
7912 yynerrs is the number of errors reported, not the number of
7915 * tests/glr-regression.at (Duplicated user destructor for lookahead):
7916 Mark it as expected to fail.
7917 Cast result of malloc; problem reported by twlevo@xs4all.nl.
7918 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
7919 Don't start user-code symbols with "yy", to avoid name space problems.
7921 2005-09-19 Akim Demaille <akim@epita.fr>
7923 Remove the traits, failed experiment.
7924 It never proved useful, and anyway because of the current
7925 definition, it was not possible to have several specialization of
7926 this traits, making it useless.
7927 * data/lalr1.cc (yy:traits): Remove.
7928 Inline its definitions in the parser class.
7930 2005-09-19 Akim Demaille <akim@epita.fr>
7932 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
7933 least Mac OSX with a /usr/local install of gettext.
7935 2005-09-19 Akim Demaille <akim@epita.fr>
7937 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
7938 and yytoken for similarity with the other skeletons.
7940 2005-09-19 Akim Demaille <akim@epita.fr>
7942 * NEWS, configure.ac: update version number to 2.1a.
7944 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
7946 * NEWS: Version 2.1.
7948 * NEWS: Remove notice of yytname change, since it was never in an
7950 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
7952 * src/output.c (prepare): Likewise.
7953 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
7954 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
7955 is not defined. This is an awful hack, but it's enough for now.
7956 All callers changed.
7957 * tests/glr-regression-at (make_value): Args are const pointers now,
7958 to avoid GCC warning.
7959 (Duplicated user destructor for lookahead): New test. Currently
7960 skipped. It fails on my host but I'm not sure it'll always fail.
7962 2005-09-16 Akim Demaille <akim@epita.fr>
7964 * src/symtab.h (struct symbol): Declare the printer and destructor
7965 as const, to avoid accidental calls to free.
7966 (symbol_destructor_set, symbol_printer_set): Adjust.
7967 * src/symtab.c: Adjust.
7969 2005-09-16 Akim Demaille <akim@epita.fr>
7971 * data/c.m4 (b4_token_enums): New.
7972 (b4_token_defines): Rename as...
7973 (b4_token_enums_defines): this.
7974 (b4_token_defines): New, output only the #defines.
7975 * data/yacc.c, data/glr.c: Adjust.
7976 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
7977 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
7980 2005-09-16 Akim Demaille <akim@epita.fr>
7982 * data/lalr1.cc (yylex_): Remove, inline its code.
7983 (yyreport_syntax_error_): Remove, replaced by...
7984 (yysyntax_error_): this which returns a string and leaves to the
7985 caller the call to the users' error function.
7986 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
7987 Move from members of the parser object...
7988 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
7989 to local variables of the parse function.
7991 2005-09-16 Akim Demaille <akim@epita.fr>
7993 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
7994 since it's in Bison's name space.
7996 2005-09-15 Paul Eggert <eggert@cs.ucla.edu>
7998 * data/glr.c (yyresolveValue): Add default case to pacify
7999 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
8001 * NEWS: Document when yyparse started to return 2.
8002 * doc/bison.texinfo (Parser Function): Document when yyparse
8005 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
8006 (b4_filename_type): Renamed back from b4_file_name_type. All uses
8008 (class position): file_name -> filename (reverting). All uses changed.
8010 2005-09-14 Paul Eggert <eggert@cs.ucla.edu>
8012 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
8013 do anything if $@ exists. This reverts part of the 2005-07-07
8016 2005-09-11 Paul Eggert <eggert@cs.ucla.edu>
8018 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
8019 contains obsolete information and isn't worth distributing as a
8020 separate file anyway.
8021 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
8022 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
8023 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
8024 (yyparse): Abort if user code uses longjmp to throw an unexpected
8027 2005-09-09 Paul Eggert <eggert@cs.ucla.edu>
8029 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
8030 Suggested by twlevo@xs4all.nl.
8032 * data/glr.c (YYCHK1): Do not assume YYE is in range.
8033 This avoids a diagnostic from gcc -Wswitch-enum.
8034 Problem reported by twlevo@xs4all.nl.
8036 * doc/bison.texinfo: Don't use "filename", as per GNU coding
8037 standards. Use "file name" or "file" or "name", depending on
8039 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
8040 not to hack/foo.tab.c.
8041 (Calc++ Top Level): 2nd arg of main is not const.
8042 * data/glr.c: b4_filename -> b4_file_name.
8043 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
8045 (class position): filename -> file_name. All uses changed.
8046 * data/yacc.c: b4_filename -> b4_file_name.
8047 * lib/bitset.h: filename -> file_name in local vars.
8048 * lib/bitset_stats.c: Likewise.
8049 * src/files.c: Likewise.
8050 * src/scan-skel.l ("@output ".*\n): Likewise.
8051 * src/files.c (file_name_split): Renamed from filename_split.
8052 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
8054 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
8056 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
8057 to accommodate latest gnulib.
8059 * tests/glr-regression.at (Duplicate representation of merged trees):
8060 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
8062 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
8065 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
8067 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
8068 All uses changed. Invoke user destructor after an error during a
8069 split parse (trivial change from Joel E. Denny).
8071 * tests/glr-regression.at
8072 (User destructor after an error during a split parse): New test case.
8073 Problem reported by Joel E. Denny in:
8074 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
8076 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
8078 * README-cvs: Give URLs for recommended tools.
8079 Mention Gzip version problem, and bootstrapping issues.
8080 Remove troubleshooting section, as it's somewhat obsolete.
8082 * bootstrap (no_cache): New var, to accommodate different wget
8083 variants. Use it instead of '-C off'. Problem reported by
8086 * data/glr.c (yydestroyStackItem): New function.
8087 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
8088 debugging information. Problem reported by Joel E. Denny.
8090 2005-08-25 Akim Demaille <akim@epita.fr>
8092 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
8094 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
8096 * data/glr.c (yyrecoverSyntaxError, yyreturn):
8097 Don't invoke destructor on unresolved entries.
8098 * tests/glr-regression.at
8099 (User destructor for unresolved GLR semantic value): New test case.
8100 Problem reported by Joel E. Denny in:
8101 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
8103 2005-08-21 Paul Eggert <eggert@cs.ucla.edu>
8105 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
8107 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
8108 lib-prefix.m4, po.m4.
8110 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
8111 in yydestruct diagnostic, since it might not be an error.
8112 Problem reported by Joel Denny near end of
8113 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
8114 * data/lalr1.cc (yyerturn): Likewise.
8115 * data/yacc.c (yyreturn): Likewise.
8116 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
8118 * src/files.c: Remove obsolete FIXME comment.
8120 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
8121 with the other templates, and to fix bogus run-on messages such
8122 as the one reported at the end of
8123 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
8124 All callers changed to avoid the newline.
8125 (yyprocessOneStack): Output two lines rather than one, to accommodate
8126 the above change. This changes the debug output format slightly.
8128 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
8129 reported by Joel E. Denny in
8130 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
8132 * tests/glr-regression.at (Duplicate representation of merged trees):
8133 New test, from Joel E. Denny in:
8134 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
8135 * THANKS: Add Joel E. Denny.
8137 * configure.ac (AC_INIT): Bump to 2.0c.
8139 2005-07-24 Paul Eggert <eggert@cs.ucla.edu>
8141 * NEWS: Version 2.0b.
8143 * Makefile.am (SUBDIRS): Put examples before tests, so that
8144 "make check" doesn't finish with "All 1 tests passed".
8146 * tests/regression.at (Token definitions): Don't rely on
8147 AT_PARSER_CHECK for data that contains backslashes. It currently
8148 uses 'echo', and 'echo' isn't portable if its argument contains
8149 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
8150 that the byte '\0xff' is not printable in the C locale; it is,
8151 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
8152 not printable, so use '\0x81' to test.
8154 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
8155 version of GCC, since the macro is used with non-GCC compilers.
8157 Fix core dump reported by Pablo De Napoli in
8158 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
8159 * tests/regression.at (Invalid inputs with {}): New test.
8160 * src/parse-gram.y (token_name): Translate type before using
8163 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
8164 the user's name space. All uses changed to __attribute__
8166 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
8167 Add __attribute__ ((__noreturn__)).
8169 * etc/clcommit: Remove. We weren't using it, and it failed
8170 "make maintainer-distcheck".
8171 * Makefile.maint: Merge from coreutils.
8172 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
8173 (syntax-check-rules): Change list of rules as described below.
8174 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
8175 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
8176 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
8177 (sc_trailing_space): New rules.
8178 (sc_xalloc_h_in_src): Remove.
8179 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
8180 (sc_space_tab, sc_error_exit_success, sc_changelog):
8181 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
8182 (makefile-check, po-check, author_mark_check):
8183 (makefile_path_separator_check, copyright-check):
8184 Use grep -n, to make it easier to find violations.
8185 Use CVS_LIST and CVS_LIST_EXCEPT.
8186 (header_regexp, h_re): Remove.
8188 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
8189 (my-distcheck): Use more-modern GCC flags.
8190 (signatures, %.asc): Remove.
8191 (rel-files, announcement): Remove signatures.
8192 Restore old updating code, even though we don't use it, so
8193 that we're the same as coreutils.
8194 (alpha, beta, major): Depend on news-date-check.
8195 Make the upload commands.
8197 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
8198 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
8199 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
8200 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
8201 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
8202 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
8203 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
8204 * tests/sets.at: Likewise.
8206 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
8207 we comment out the Autoconf version number.
8208 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
8209 it's error-prone and "make maintainer-distcheck" rejects it.
8211 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
8212 Indent calls to "error" to pacify "make maintainer-distcheck",
8213 when the calls are not intended to be translated.
8214 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
8216 * src/Makefile.am (DEFS): Use +=, to pacify
8217 "make maintainer-distcheck".
8218 (bison_SOURCES): Add scan-skel.h.
8219 (sc_tight_scope): New rule, from coreutils.
8221 * src/files.c (src_extension, header_extension):
8222 Now static, not extern.
8223 * src/getargs.c (short_options): Likewise.
8224 * src/muscle_tab.c (muscle_table): Likewise.
8225 * src/parse-gram.y (current_class, current_type, current_prec):
8227 * src/reader.c (grammar_end, previous_rule_end): Likewise.
8228 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
8229 * src/main.c (main): Cast bindtextdomain and textdomain calls to
8230 void, to avoid warning when NLS is disabled.
8231 * src/output.c: Include scan-skel.h.
8232 (scan_skel): Remove decl, since scan-skel.h does this.
8234 Indent calls to "error" to pacify "make maintainer-distcheck".
8235 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
8236 * src/reader.h (gram_end, gram_lineno): New decls to pacify
8237 "make maintainer-distcheck".
8238 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
8239 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
8240 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
8241 (skel_lex_destroy, scan_skel): Move these decls to...
8242 * src/scan-skel.h: New file.
8243 * src/uniqstr.c (uniqstr_assert):
8244 Indent calls to "error" to pacify "make maintainer-distcheck".
8246 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
8249 * tests/torture.at: Revamp to avoid misuse of atoi that
8250 "make maintainer-distcheck" complained about.
8252 * examples/extexi (message): Don't print a message more than once,
8253 and omit line-number decoration that makes Emacs compile think
8254 that informative messages are worth worrying about.
8256 2005-07-22 Paul Eggert <eggert@cs.ucla.edu>
8258 * configure.ac: Update version number.
8260 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
8262 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
8263 autogenerated by the maintainer.
8264 * examples/calc++/.cvsignore: Add *.yy.
8266 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
8267 * lib/bitset_stats.c (bitset_stats_init): Likewise.
8268 * lib/bitsetv.c (bitsetv_alloc): Likewise.
8270 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
8272 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
8273 from maintainer-distcheck about casting the argument of 'free'.
8275 * NEWS: Mention recent yytname changes.
8276 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
8278 * bootstrap: For translations that have not yet been upgraded to
8279 the new runtime-po domain, prime the pump by extracting the
8280 relevant strings from the obsolete translations. This code can be
8281 removed once the bison-runtime domain has been translated by each
8284 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
8285 now that token names are already quoted.
8287 Fix problem reported by Anthony Heading.
8288 * data/glr.c (YYTOKEN_TABLE): New macro.
8289 (yytname): Define if YYTOKEN_TABLE.
8290 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
8291 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
8292 (YYERROR_VERBOSE): Define the same way the other skeletons do.
8293 * src/output.c (prepare_symbols): Output token_table_flag.
8295 2005-07-21 Paul Eggert <eggert@cs.ucla.edu>
8297 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
8298 again if the first call fails.
8300 * data/glr.c (yytnamerr): New function.
8301 (yyreportSyntaxError): Use it to dequote most string literals.
8302 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
8303 with other skeletons. All uses changed.
8304 (yytnameerr_): New function.
8305 (yyreport_syntax_error): Use it to dequote most string literals.
8306 * data/yacc.c (yytnamerr): New function.
8307 (yyerrlab): Use it to decode most string literals.
8308 * doc/bison.texinfo (Decl Summary, Calling Convention):
8309 Clarify quoting convention of yytname.
8310 * src/output.c (prepare_symbols): Quote all names. This undoes
8311 the 2005-04-17 change, which is now accomplished (mostly) via
8312 changes in the parsers as described above.
8313 * tests/regression.at (Token definitions, Web2c Actions):
8314 Undo most 2005-04-17 change here, too.
8316 2005-07-20 Paul Eggert <eggert@cs.ucla.edu>
8318 Fix more problems reported by twlevo@xs4all.nl.
8319 * tests/cxx-type.at: Don't pipe output of ./types through sed to
8320 remove trailing spaces. This loses the exit status of ./types,
8321 and isn't needed since ./types shouldn't be emitting trailing
8323 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
8324 as the stack isn't valid in that case.
8326 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
8327 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
8328 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
8329 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
8331 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
8332 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
8333 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
8336 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
8337 overly-picky compilers that reject 'char *foo = "bar";'.
8339 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
8340 to FILE * parameter, not to stderr. This fixes a typo introduced
8341 in the 2005-07-12 change.
8343 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
8344 warnings from GCC 4.
8346 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
8347 (yyglrShiftDefer, yysplitStack):
8348 Remove unused parameters b4_pure_formals. All uses changed.
8349 (yyglrShift): Remove unused parameters b4_user_formals.
8351 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
8353 2005-07-18 Paul Eggert <eggert@cs.ucla.edu>
8355 Destructor cleanups and regularization among the three skeletons.
8356 * NEWS: Document the behavior changes.
8357 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
8358 stack before failing, as the cleanup code will do it for us now.
8359 * data/lalr1.cc (yyerrlab): Likewise.
8360 * data/glr.c (yyparse): Pop everything off the stack before
8361 freeing it, so that destructors get called properly.
8362 * data/lalr1.cc (yyreturn): Likewise.
8363 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
8364 This is more consistent.
8365 * doc/bison.texinfo (Destructor Decl): Mention more reasons
8366 why destructors might be called. 1.875 -> 2.1.
8367 (Destructor Decl, Decl Summary, Table of Symbols):
8368 Some English-language cleanups for %destructor.
8369 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
8370 Add output line for destructor of start symbol.
8371 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
8372 because of that same extra output line.
8374 * NEWS: Document minor wording changes in diagnostics of
8375 Bison-generated parsers.
8376 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
8377 Remove unused formals. All uses changed.
8378 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
8379 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
8380 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
8381 Rename yyoverflowab to yyexhaustedlab.
8382 When memory exhaustion occurs during syntax-error reporting,
8383 report it separately rather than in a single diagnostic; this
8385 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
8386 (Memory Exhausted): Renamed from Parser Stack Overflow.
8387 Revamp wording slightly to prefer "memory exhaustion".
8388 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
8390 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
8392 Add i18n support to the GLR skeleton. Partially fix the C++
8393 skeleton; a C++ expert needs to finish this. Remove debugging
8394 msgids; there's little point to having them translated, since they
8395 can be understood only by someone who can read the
8396 (English-language) source code.
8398 Generate runtime-po/bison-runtime.pot automatically, so that we
8399 don't have to worry about garbage getting in that file. We'll
8400 make sure after the next official release that old msgids don't
8402 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
8404 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
8406 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
8407 Fix typos in explanations of the runtime file.
8408 * bootstrap: Change gettext keyword from YYI18N to YY_.
8409 Use standard Makefile.in.in in runtime-po, since we'll arrange
8410 for backward-compatible bison-runtime.po files in a different way.
8411 * data/glr.c (YY_): New macro, from yacc.c.
8412 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
8413 Translate messages intended for users.
8414 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
8415 the wording in the other skeletons. We don't know that the memory
8417 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
8418 Use same method that yacc.c uses.
8419 Don't translate debugging messages.
8420 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
8421 it doesn't work (yet), and requires C++ expertise to fix.
8422 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
8423 Move defn to a more logical place, to be consistent with other
8425 Don't translate debugging messages.
8426 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
8427 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
8428 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
8429 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
8431 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
8432 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
8434 * tests/glr-regression.at (Badly Collapsed GLR States):
8436 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
8437 yylex should return 0 at EOF rather than aborting.
8439 Improve tests for stack overflow in GLR parser.
8440 Problem reported by twlevo@xs4all.nl.
8441 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
8443 (yyStackOverflow): Just longjmp, but with value 2 so that caller
8444 can handle the problem.
8445 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
8446 (yyparse): New local variable yyresult to record the result.
8447 Use result of setjmp to set it, rather than storing itinto
8449 (yyDone): Remove label.
8450 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
8451 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
8452 if YYABORT is used).
8453 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
8454 yyparse status; put status > 1 into diagnostic.
8455 Check that status==2 works.
8456 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
8457 Use exit status 3 for failure to open (which shouldn't happen).
8459 2005-07-17 Paul Eggert <eggert@cs.ucla.edu>
8461 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
8462 1 on syntax error; just let yyparse do its thing.
8463 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
8464 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
8465 (Exploding the Stack Size with Alloca):
8466 (Exploding the Stack Size with Malloc):
8467 Expect exit status 2, not 1, since the parser is supposed to blow
8468 its stack. Problem reported by twlevo@xs4all.nl.
8470 * data/glr.c (yyparse): Don't assume that the initial calls
8471 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
8472 Print a stack-overflow message and fail instead.
8473 Initialize the line-number information before creating the stack,
8474 so that the stack-overflow message can report line zero safely.
8476 2005-07-14 Paul Eggert <eggert@cs.ucla.edu>
8478 Fix problems reported by twlevo@xs4all.nl.
8479 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
8480 (yyuserMerge): Provide a default case if b4_mergers is empty.
8481 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
8482 * tests/glr-regression.at
8483 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
8484 Add casts to pacify C++ compilers.
8485 * tests/glr-regression.at (Improper merging of GLR delayed action
8486 sets): Declare yylex before using it.
8487 * tests/Makefile.am (maintainer-check-g++): Fix a stray
8488 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
8489 test for valgrind; valgrind is independent of g++.
8490 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
8491 for compatibility with POSIX 1003.1-2001 (if running coreutils).
8492 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
8493 Use a destructor, so that we can expand the stack. Change
8494 YYSTYPE to char * so that we can free it. Cast result of malloc.
8496 2005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8498 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
8499 a valgrind failure. Problem reported by twlevo@xs4all.nl.
8501 2005-07-13 Paul Eggert <eggert@cs.ucla.edu>
8503 * PACKAGING: New file, suggested by Bruno Haible and taken from
8504 similar wording in gettext's PACKAGING file.
8505 * NEWS: Mention PACKAGING.
8506 * Makefile.am (EXTRA_DIST): Add PACKAGING.
8508 2005-07-12 Paul Eggert <eggert@cs.ucla.edu>
8510 * NEWS: Document recent i18n improvements.
8511 * bootstrap: Get runtime translations into runtime-po.
8512 Create runtime-po files automatically, if possible.
8513 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
8514 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
8515 does not infringe on the user's name space.
8516 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
8517 * doc/bison.texinfo (Internationalization): Revamp the English
8518 and Texinfo syntax a bit, to try to make it clearer.
8519 (Bison Options, Option Cross Key): Mention --print-localedir.
8520 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
8521 YYENABLE_NLS. Quote a bit more.
8522 * runtime-po/.cvsignore: New file.
8523 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
8524 * runtime-po/Rules-quot: Remove; now created by bootstrap.
8525 * runtime-po/quot.sed: Likewise.
8526 * runtime-po/boldquot.sed: Likewise.
8527 * runtime-po/en@quot.header: Likewise.
8528 * runtime-po/en@boldquot.header: Likewise.
8529 * runtime-po/insert-header.sin: Likewise.
8530 * runtime-po/remove-potcdate.sin: Likewise.
8531 * runtime-po/Makevars: Likewise.
8532 * runtime-po/LINGUAS: Likewise.
8533 * runtime-po/de.po: Likewise; we will rely on the translation project
8534 to maintain this, so "bootstrap" should get it.
8535 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
8537 * src/main.c (main): Bind the bison-runtime domain, too.
8539 2005-07-12 Bruno Haible <bruno@clisp.org>
8541 * data/yacc.c: Include <libintl.h> when NLS is enabled.
8542 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
8543 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
8544 * runtime-po: New directory.
8545 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
8546 $(DOMAIN).pot-update rule, so that old messages are never dropped.
8547 * runtime-po/Rules-quot: New file, copied from po/.
8548 * runtime-po/quot.sed: Likewise.
8549 * runtime-po/boldquot.sed: Likewise.
8550 * runtime-po/en@quot.header: Likewise.
8551 * runtime-po/en@boldquot.header: Likewise.
8552 * runtime-po/insert-header.sin: Likewise.
8553 * runtime-po/remove-potcdate.sin: Likewise.
8554 * runtime-po/Makevars: New file.
8555 * runtime-po/POTFILES.in: New file.
8556 * runtime-po/LINGUAS: New file.
8557 * runtime-po/bison-runtime.pot: New file.
8558 * runtime-po/de.po: New file.
8559 * m4/bison.m4: New file.
8560 * Makefile.am (SUBDIRS): Add runtime-po.
8561 (aclocaldir, aclocal_DATA): New variables.
8562 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
8564 * src/getargs.c (usage): Document --print-localedir option.
8565 (PRINT_LOCALEDIR_OPTION): New enum item.
8566 (long_options): Add --print-localedir option.
8567 (getargs): Handle --print-localedir option.
8568 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
8569 (Internationalization): New section.
8571 2005-07-12 Akim Demaille <akim@epita.fr>
8573 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
8574 for consistency with the rest of the code.
8575 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
8578 2005-07-12 Akim Demaille <akim@epita.fr>
8580 * src/parse-gram.y: Use %printer instead of YYPRINT.
8582 2005-07-12 Akim Demaille <akim@epita.fr>
8584 * src/symtab.h, src/symtab.c (symbol_print): New.
8585 * src/symlist.h, src/symlist.c (symbol_list_print): New.
8586 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
8588 2005-07-12 Akim Demaille <akim@epita.fr>
8590 * data/glr.c (b4_syncline): Fix (swap) the definitions of
8591 b4_at_dollar and b4_dollar_dollar.
8593 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
8595 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
8596 and Pennello's paper.
8598 2005-07-09 Paul Eggert <eggert@cs.ucla.edu>
8600 * data/yacc.c (yyparse): Undo previous patch. Instead,
8601 set yylsp[0] and yyvsp[0] only if the initial action
8602 sets yylloc and yylval, respectively.
8604 * data/yacc.c (yyparse): In the initial action, set
8605 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
8606 This avoids the use of undefined variables if the initial
8607 action does not set yylloc and/or yylval.
8609 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
8611 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
8612 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
8613 Remove from CVS. These files are automatically generated.
8614 * examples/extexi: Clarify that this file is now part of Bison,
8615 not GNU M4, and that it works with any POSIX-compatible Awk.
8616 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
8617 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
8618 so that we also get calc++-parser.yy. Geneate it.
8619 Use $(AWK), not gawk, since any conforming Awk will do.
8620 Put comment before action, since older 'make' can't handle comment
8622 $(BUILT_SOURCES): List all built sources, not just some of them.
8623 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
8624 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
8625 $($(calc_sources_generated)): Remove unnecessary test for existence
8626 of target. (This had a shell syntax error anyway; a stray "x".)
8627 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
8629 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
8631 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
8632 implied by the other modules.
8634 2005-07-06 Akim Demaille <akim@epita.fr>
8636 Bind examples/calc++ to the package.
8637 * examples/calc++/Makefile: Remove, replaced by...
8638 * examples/calc++/Makefile.am: ... this new file.
8639 * examples/calc++/test: Remove input.
8640 * examples/calc++/compile: Remove.
8641 * examples/Makefile.am: New.
8642 * configure.ac, Makefile.am: Adjust.
8643 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
8645 2005-07-05 Paul Eggert <eggert@cs.ucla.edu>
8647 * data/glr.c (yyFail): Drastically simplify; since the format argument
8648 never had any % directives, we can simply pass it to yyerror.
8649 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
8650 be modified later, as that is the usual style in glr.c.
8651 Problems reported by Paul Hilfinger.
8653 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
8654 and size overflow errors.
8655 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
8656 in case the user prolog sets feature-test macros like _GNU_SOURCE.
8657 (YYSIZEMAX): New macro.
8658 (yystpcpy): New function, taken from yacc.c.
8659 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
8660 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
8661 so that we don't have to maintain their signatures.
8662 (yyFail): Check for buffer overflow, by using vsnprintf rather
8663 than vsprintf. Allocate a bigger buffer if possible.
8664 Report an error if buffer allocation fails.
8665 (yyStackOverflow): New function.
8666 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
8667 the initialization was successful. It might fail if storage was
8669 (yyexpandGLRStack): Add more checks for storage allocation failure.
8670 Use yyStackOverflow to report failures.
8671 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
8672 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
8673 Don't assume stack number fits in int.
8674 (yysplitStack): Check for storage allocation failure.
8675 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
8676 can print diagnostics on storage allocation failure. All callers
8678 (yyresolveValue): Use yybool for boolean.
8679 (yyreportSyntaxError): Check for size-calculation overflow.
8680 This code is taken from yacc.c.
8681 (yyparse): Check for storage allocation errors when allocating
8684 2005-07-05 Akim Demaille <akim@epita.fr>
8686 Extract calc++ from the documentation.
8687 * doc/bison.texinfo (Calc++): Add the extraction marks.
8688 * examples/extexi: New, from the aborted GNU Programming 2E.
8689 Separate the different paragraph of a file with empty lines.
8690 * examples/Makefile: Use it to extract the whole calc++ example.
8692 2005-06-24 Akim Demaille <akim@epita.fr>
8694 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
8697 2005-06-22 Akim Demaille <akim@epita.fr>
8699 * doc/bison.texinfo (C++ Language Interface): First stab.
8700 (C++ Parsers): Remove.
8702 2005-06-22 Akim Demaille <akim@epita.fr>
8704 * data/lalr1.cc (yylex_): Honor %lex-param.
8706 2005-06-22 Akim Demaille <akim@epita.fr>
8708 Start a set of simple examples.
8709 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
8710 * examples/calc++/calc++-driver.hh,
8711 * examples/calc++/calc++-parser.yy,
8712 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
8713 * examples/calc++/compile, examples/calc++/test: New.
8715 2005-06-09 Paul Eggert <eggert@cs.ucla.edu>
8717 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
8718 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
8719 which stems from the 2005-05-27 patch.
8721 2005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8723 * data/glr.c: Modify treatment of unused parameters to permit use
8724 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
8726 2005-05-30 Paul Eggert <eggert@cs.ucla.edu>
8728 Fix infringement on user name space reported by Janos Zoltan Szabo.
8729 * data/yacc.c (yyparse): strlen -> yystrlen.
8731 2005-05-30 Akim Demaille <akim@epita.fr>
8733 * data/lalr1.cc (_): New.
8734 Translate the various messages.
8736 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
8738 Fix infringement on user name space reported by Bruno Haible.
8739 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
8740 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
8741 the user's name space.
8742 (alloca): Include <stdlib.h> to get it, if it's not built in.
8743 (YYMALLOC, YYFREE): Define only if needed.
8744 (malloc, free): Declare, but only if needed, as this infringes on
8745 the user name space.
8747 2005-05-25 Paul Eggert <eggert@cs.ucla.edu>
8749 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
8750 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
8752 * lib/ebitset.c (min, max): Undef before defining.
8753 * lib/vbitset.c (min, max): Likewise.
8754 * lib/subpipe.c (create_subpipe): Save local variables in case
8755 vfork clobbers them.
8757 2005-05-24 Bruno Haible <bruno@clisp.org>
8759 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
8760 error message syntax used by gcc-4.0.
8762 2005-05-23 Paul Eggert <eggert@cs.ucla.edu>
8764 * README: Mention m4 1.4.3. Remove obsolete advice about
8765 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
8767 * bootstrap: Remove workaround for problem I encountered with
8768 gettext 0.14.1; it seems to be fixed now.
8770 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
8772 * NEWS: Version 2.0a.
8774 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
8775 the previous change.
8777 Various maintainer cleanups.
8778 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
8779 conftest*, for benefit of CVS commands run at the same time as
8780 "configure". Add build-aux, since "bootstrap" now creates it and
8782 * Makefile.cfg (move_if_change): Remove.
8783 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
8784 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
8785 (po_repo, do-po-update, po-update, wget_files, get-targets):
8786 (config.guess-url_prefix, config.sub-url_prefix):
8787 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
8788 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
8789 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
8791 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
8792 this is now the recommended name.
8793 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
8794 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
8795 ylwrap. These files now go into build-aux.
8796 * config/move-if-change: Remove.
8797 * config/prev-version.txt: Bump from 1.75 to 2.0.
8799 * bootstrap: Add stdio-safer, unistd-safer modules.
8800 Remove m4/glibc2.m4 (introduced by latest gnulib, but
8802 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
8803 fopen-safer.c, stdio-safer.h, unistd-safer.h.
8804 * lib/subpipe.c: Include "unistd-safer.h".
8805 (create_subpipe): Make sure all the newly-created
8806 file descriptors are > 2, so that diagnostics don't
8807 get sent down them (which might cause Bison to hang, in theory).
8808 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
8809 * src/files.c (xfopen): Use fopen_safer, not fopen.
8811 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
8812 yesterday's yacc.c fix.
8814 2005-05-21 Paul Eggert <eggert@cs.ucla.edu>
8816 * data/glr.c, data/lalr1.cc: Update copyright date.
8818 Fix a destructor bug reported by Wolfgang Spraul in
8819 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
8820 * data/yacc.c (yyabortlab): Don't call destructor, and
8821 don't set yychar to EMPTY.
8822 (yyoverflowlab): Don't call destructor.
8823 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
8824 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
8825 since we no longer output the message "discarding lookahead token
8828 2005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8830 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
8831 fix a small glitch in debugging output.
8832 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
8833 after YY_SYMBOL_PRINT where needed.
8835 (struct yyGLRState): Add some comments.
8836 (struct yySemanticOption): Add some comments.
8837 (union yyGLRStackItem): Add comment.
8839 (yymergeOptionSets): Correct this to properly perform the union,
8840 avoiding infinite reported by Michael Rosien.
8843 * tests/glr-regression.at: Add test for GLR merging error reported
8846 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
8848 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
8849 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
8850 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
8851 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
8852 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
8853 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
8854 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
8855 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
8856 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
8857 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
8858 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
8859 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
8860 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
8861 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
8862 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
8863 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
8864 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
8865 src/derives.h, src/files.c, src/files.h, src/getargs.c,
8866 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
8867 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
8868 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
8869 src/output.h, src/parse-gram.c, src/parse-gram.h,
8870 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
8871 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
8872 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
8873 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
8874 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
8875 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
8876 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
8877 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
8878 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
8879 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
8880 tests/reduce.at, tests/regression.at, tests/sets.at,
8881 tests/synclines.at, tests/testsuite.at, tests/torture.at:
8882 Update FSF postal mail address.
8884 2005-05-11 Paul Eggert <eggert@cs.ucla.edu>
8886 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
8887 Problem reported by Ralf Menzel.
8889 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
8891 * tests/actions.at: Test that stack overflow invokes destructors.
8892 From Marcus Holland-Moritz.
8893 * data/yacc.c (yyerrlab): Move the code that destroys the stack
8895 (yyreturn): to here. That way, destructors are called properly
8896 even if the stack overflows, or the user calls YYACCEPT or
8897 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
8898 (yyoverflowlab): Destroy the lookahead.
8900 2005-04-24 Paul Eggert <eggert@cs.ucla.edu>
8902 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
8904 2005-04-17 Paul Eggert <eggert@cs.ucla.edu>
8906 * NEWS: Bison-generated C parsers no longer quote literal strings
8907 associated with tokens.
8908 * src/output.c (prepare_symbols): Don't escape strings,
8909 since users don't want to see C escapes.
8910 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
8912 * tests/input.at (Torturing the Scanner): Likewise.
8913 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
8915 2005-04-16 Paul Eggert <eggert@cs.ucla.edu>
8917 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
8918 the data size is known to be too small and we can't increase it.
8919 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
8921 2005-04-15 Paul Eggert <eggert@cs.ucla.edu>
8923 * src/parse-gram.y: Include quotearg.h.
8924 (string_as_id): Quote $1 before using it as a key, since the
8925 lexer no longer quotes it for us.
8926 (string_content): Don't strip quotes, since lexer no longer
8928 * src/scan-gram.l: Include quotearg.h.
8930 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
8931 a key, since the rest of the lexer doesn't quote it.
8932 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
8933 * tests/regression.at (Token definitions): Check for backslashes
8936 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
8937 (YYSIZE_T): Define to unsigned long int when using an older compiler.
8938 (yyparse): Revamp code to generate long syntax error message, to
8939 make it easier to translate, and to avoid problems with arithmetic
8940 overflow. Change "virtual memory" to "memory" in diagnostic, since
8941 we don't know whether the memory is virtual.
8943 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
8945 * NEWS: Bison-generated C parsers now use the _ macro to
8947 * data/yacc.c (_) [!defined _]: New macro.
8948 All English strings wrapped inside this macro.
8949 * doc/bison.texinfo (Bison Parser): Document _.
8950 * po/POTFILES.in: Include src/parse-gram.c, since it now
8951 includes translateable strings that parse-gram.y doesn't.
8953 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
8955 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
8956 reverting the 2004-10-11 change to this function.
8957 (symbol_check_alias_consistency): Don't call symbol_type_set
8958 if the type name is already correct.
8959 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
8961 2005-03-25 Paul Eggert <eggert@cs.ucla.edu>
8963 * tests/regression.at (Token definitions): Don't use a token named
8964 c, as that generates a "#define c ..." that runs afoul of buggy
8965 stdlib.h that uses the identifier c as a member of struct
8966 drand48_data. Problem reported by Horst Wente.
8968 2005-03-21 Paul Eggert <eggert@cs.ucla.edu>
8970 * bootstrap: Change translation URL from
8971 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
8972 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
8973 redirection glitches. Problem reported by twlevo@xs4all.nl.
8975 2005-03-20 Paul Eggert <eggert@cs.ucla.edu>
8977 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
8978 after operands; POSIX says this isn't portable for the c99 command.
8980 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
8982 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
8983 immediately if a data overrun has occurred; this may help us track
8984 down what may be a spurious failure on MacOS.
8986 2005-03-17 Paul Eggert <eggert@cs.ucla.edu>
8988 Respond to problems reported by twlevo@xs4all.nl.
8990 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
8992 * src/vcg.h: Comment fix.
8993 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
8994 (G_CMAX): Change to -1 instead of INT_MAX.
8996 * data/yacc.c (yyparse): Omit spaces before #line.
8998 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
9000 * src/tables.c (state_number_to_vector_number): Put it inside an
9001 "#if 0", since it's not currently used. Problem reported by
9004 2005-03-06 Paul Eggert <eggert@cs.ucla.edu>
9006 * src/output.c (escaped_output): Renamed from
9007 escaped_file_name_output, since we now use it for symbol tags as
9008 well. All uses changed.
9009 (symbol_destructors_output, symbol_printers_output):
9010 Escape symbol tags too.
9011 Problem reported by Matyas Forstner in
9012 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
9014 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
9016 * src/output.c (user_actions_output, token_definitions_output,
9017 symbol_destructors_output, symbol_printers_output): Likewise.
9018 * src/reader.c (prologue_augment): Likewise.
9019 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
9021 * src/vcg.c (output_edge): Don't quote linestyle arg.
9022 Problem reported by twlevo@xs4all.nl.
9024 2005-02-28 Paul Eggert <eggert@cs.ucla.edu>
9026 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
9027 example, reported by Derek M Jones. Also, make the example even
9028 more outrageous, to better illustrate how bad the problem is.
9030 2005-02-24 Paul Eggert <eggert@cs.ucla.edu>
9032 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
9033 putsym. Typo reported by Sebastian Piping.
9035 2005-02-23 Paul Eggert <eggert@cs.ucla.edu>
9037 * doc/bison.texinfo (Language and Grammar): some -> same
9038 (Epilogue): int he -> in the
9039 Typos reported by Sebastian Piping via Justin Pence.
9041 2005-02-07 Paul Eggert <eggert@cs.ucla.edu>
9043 * tests/glr-regression.at (Improper handling of embedded actions
9044 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
9045 embedded actions and $-N in GLR parsers", work around an Autoconf bug
9046 with dollar signs in test names.
9047 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
9048 for a similar reason.
9050 2005-01-28 Paul Eggert <eggert@cs.ucla.edu>
9052 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
9053 wants to redefine G_VIEW.
9055 2005-01-27 Paul Eggert <eggert@cs.ucla.edu>
9057 * src/vcg.c (get_view_str): Remove case for normal_view.
9058 Problem reported by twlevo@xs4all.nl.
9060 2005-01-24 Paul Eggert <eggert@cs.ucla.edu>
9062 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
9063 Problem reported by twlevo@xs4all.nl.
9065 * doc/bison.texinfo: Change @dircategory from "GNU programming
9066 tools" to "Software development". Requested by Richard Stallman
9069 2005-01-23 Paul Eggert <eggert@cs.ucla.edu>
9071 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
9072 Problem reported by twlevo@xs4all.nl.
9074 2005-01-21 Paul Eggert <eggert@cs.ucla.edu>
9076 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
9077 keyword; it's not needed with modern compilers, and it doesn't
9078 affect correctness with older compilers. Suggested by
9081 2005-01-17 Paul Eggert <eggert@cs.ucla.edu>
9083 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
9084 gcc -Wswitch-default.
9085 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
9086 * data/yacc.c (yyparse): Likewise.
9088 2005-01-12 Paul Eggert <eggert@cs.ucla.edu>
9090 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
9091 already. Let config.h define any nonstandard values.
9093 2005-01-10 Paul Eggert <eggert@cs.ucla.edu>
9095 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
9096 for the benefit of slower hosts. Problem reported by
9099 2005-01-07 Paul Eggert <eggert@cs.ucla.edu>
9101 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
9102 being defined and not used.
9103 * data/lalr1.cc (yyparse): Likewise.
9104 Use "if (false)" rather than "if (0)".
9106 2005-01-05 Paul Eggert <eggert@cs.ucla.edu>
9108 * TODO: Mention that we should allow NUL bytes in tokens.
9110 2005-01-02 Paul Eggert <eggert@cs.ucla.edu>
9112 * src/scan-skel.l (<<EOF>>): Don't close standard output.
9113 Problem reported by Hans Aberg.
9115 2005-01-01 Paul Eggert <eggert@cs.ucla.edu>
9117 * src/getargs.c (version): Happy new year; update overall
9118 program copyright date from 2004 to 2005.
9120 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
9121 Problem reported by Hans Aberg.
9122 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
9123 (Output file names.): Add a test for the case when standard output
9126 2004-12-26 Paul Eggert <eggert@cs.ucla.edu>
9128 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
9129 to fix an oversight in the Bison 2.0 manual.
9131 2004-12-25 Paul Eggert <eggert@cs.ucla.edu>
9133 * NEWS: Version 2.0. Reformat the existing news items since
9134 1.875, so that related items are grouped together.
9135 * configure.ac (AC_INIT): Bump version to 2.0.
9136 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
9138 * tests/torture.at (Exploding the Stack Size with Alloca): Set
9139 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
9140 otherwise, we're not testing alloca. Unfortunately there's no
9141 simple way to consult HAVE_ALLOCA here.
9143 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
9146 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
9147 hand. This avoids a warning about comparing int to size_t when
9148 GCC warnings are enabled.
9150 2004-12-22 Paul Eggert <eggert@cs.ucla.edu>
9152 * NEWS: Bison-generated parsers no longer default to using the
9153 alloca function (when available) to extend the parser stack, due
9154 to widespread problems in unchecked stack-overflow detection.
9155 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
9156 responsibility to set it to a positive value. This lets the user
9157 specify a value that is not a preprocessor constant.
9158 * data/yacc.c (YYMAXDEPTH): Likewise.
9159 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
9160 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
9161 to be a compile-time constant. However, explain the constraints on it.
9162 Also, explain the constraints on YYINITDEPTH.
9163 (Table of Symbols): Explain that alloca is no longer the default.
9164 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
9167 * doc/bison.texinfo (Location Default Action): Mention that n must
9168 be zero when k is zero. Suggested by Frank Heckenbach.
9170 2004-12-22 Akim Demaille <akim@epita.fr>
9172 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
9173 (parser::state_type, parser::semantic_type, parser::location_type):
9174 Private, not public.
9175 (parser::parse): Return ints, not bool.
9176 Returning a bool introduces a problem: 0 corresponds to false, and
9177 it seems weird to return false on success. Returning true changes
9178 the conventions for yyparse.
9179 Alternatively we could return void and send an exception.
9180 There is no clear consensus (yet?).
9181 (state_stack, semantic_stack, location_stack): Rename as...
9182 (state_stack_type, semantic_stack_type, location_stack_type): these.
9183 Private, not public.
9184 * tests/c++.at: New.
9185 * tests/testsuite.at, tests/Makefile.am: Adjust.
9187 2004-12-21 Akim Demaille <akim@epita.fr>
9189 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
9191 2004-12-21 Akim Demaille <akim@epita.fr>
9193 Don't impose std::string for filenames.
9195 * data/lalr1.cc (b4_filename_type): New.
9196 (position::filename): Use it.
9197 (parser.hh): Move the inclusion of stack.hh and location.hh below
9198 the user code, so that needed headers for the filename type can be
9200 Forward declare them before the user code.
9201 * tests/Makefile.am (check-local, installcheck-local): Pass
9202 TESTSUITEFLAGS to the TESTSUITE.
9204 2004-12-20 Akim Demaille <akim@epita.fr>
9206 Use more STL like names: my_class instead of MyClass.
9208 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
9209 (SemanticStack, SemanticType, StateStack, StateType)
9210 (TokenNumberType, Stack, Slice, Traits, Parser::location)
9211 (Parser::value): Rename as...
9212 (location_stack, location_type, rhs_number_type, semantic_stack)
9213 (semantic_type, state_stack, state_type, token_number_type, stack)
9214 (slice, traits, parser::yylloc, parser::yylval): these.
9216 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
9218 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
9220 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
9221 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
9223 2004-12-17 Paul Eggert <eggert@cs.ucla.edu>
9225 Remove uses of 'short int' and 'unsigned short int'. This raises
9226 some arbitrary limits. It uses more memory but nowadays that's
9227 not much of an issue.
9229 This change does not affect the generated parsers; that's a different
9230 task, as some users will want to conserve memory there.
9232 Ideally we should use size_t to represent all object counts, and
9233 something like ptrdiff_t to represent signed differences of object
9234 counts; but that will require more code-cleanup than I have the
9235 time to do right now.
9237 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
9238 Use size_t, not int or short int, to count objects.
9239 * src/closure.c (nritemset, closure): Likewise.
9240 * src/closure.h (nritemset, closure): Likewise.
9241 * src/nullable.c (nullable_compute): Likewise.
9242 * src/print.c (print_core): Likewise.
9243 * src/print_graph.c (print_core): Likewise.
9244 * src/state.c (state_compare, state_hash): Likewise.
9245 * src/state.h (struct state): Likewise.
9246 * src/tables.c (default_goto, goto_actions): Likewise.
9248 * src/gram.h (rule_number, rule): Use int, not short int.
9249 * src/output.c (prepare_rules): Likewise.
9250 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
9251 errs, reductions): Likewise.
9252 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
9254 * src/tables.c (vector_number, tally, action_number,
9255 ACTION_NUMBER_MINIMUM): Likewise.
9256 * src/output.c (muscle_insert_short_int_table): Remove.
9258 2004-12-17 Akim Demaille <akim@epita.fr>
9260 * data/lalr1.cc: Extensive Doxygenation.
9261 (error_): Rename as...
9262 (error): this, since it is visible to the user.
9264 (Parser::message): Now an automatic variable from...
9265 (Parser::yyreport_syntax_error_): here.
9266 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
9268 * tests/input.at: Escape $.
9270 2004-12-16 Paul Eggert <eggert@cs.ucla.edu>
9272 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
9273 Parenthesize rhs to avoid obscure problems with mistakes like
9274 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
9275 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
9276 b4_rhs_location): Likewise.
9277 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
9278 b4_rhs_location): Likewise.
9280 2004-12-16 Akim Demaille <akim@epita.fr>
9282 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
9283 yacc.c: be sure to stay within yycheck_.
9284 * tests/actions.at: Re-enable C++ tests.
9286 2004-12-16 Akim Demaille <akim@epita.fr>
9288 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
9291 2004-12-16 Akim Demaille <akim@epita.fr>
9293 Use #define to handle the %name-prefix.
9295 * data/glr.c, data/yacc.c: Comment changes.
9296 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
9297 so that one can refer to yylex in the parser file, and have it
9298 renamed, as is the case with other skeletons.
9300 2004-12-16 Akim Demaille <akim@epita.fr>
9302 Move lalr1.cc internals into yy*.
9304 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
9305 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
9306 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
9307 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
9308 (empty_, final_, terror_, errcode_, ntokens_)
9309 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
9310 (looka_, ilooka_, error_range_, nerrs_):
9312 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
9313 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
9314 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
9315 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
9316 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
9317 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
9318 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
9319 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
9322 2004-12-15 Paul Eggert <eggert@cs.ucla.edu>
9324 Fix some problems reported by twlevo at xs4all.
9325 * src/symtab.c (symbol_new): Report an error if the input grammar
9326 contains too many symbols. This is better than calling abort() later.
9327 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
9328 (struct node, struct graph):
9329 Rename member expand to stretch. All uses changed.
9330 (struct graph): Remove member layoutalgorithm. All uses removed.
9331 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
9332 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
9334 (N_STRETCH): Rename from N_EXPAND. All uses changed.
9336 2004-12-15 Akim Demaille <akim@epita.fr>
9338 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
9339 Add more Doxygen comments.
9340 (symprint_, stack_print_, reduce_print_, destruct_, pop)
9341 (report_syntax_error_, translate_): Rename as...
9342 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
9343 (yypop_, yyreport_syntax_error_, yytranslate_): this.
9345 2004-12-15 Akim Demaille <akim@epita.fr>
9347 * data/lalr1.cc (lex_): Rename as...
9349 Move the trace here.
9350 Take the %name-prefix into account.
9351 Reported by Alexandre Duret-Lutz.
9353 2004-12-15 Akim Demaille <akim@epita.fr>
9355 Simplify the C++ parser constructor.
9357 * data/lalr1.cc (debug_): Rename as...
9358 (yydebug_): so that the parser's internals are always in the yy*
9361 (b4_parse_param_decl): Remove the leading comma as it is now only
9362 called as unique argument list.
9363 (Parser::Parser): Remove the constructor accepting a location and
9364 an initial debugging level.
9365 Remove from the other ctor the argument for the debugging level.
9366 (debug_level_type, debug_level, set_debug_level): New.
9368 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
9371 2004-12-15 Akim Demaille <akim@epita.fr>
9373 Remove b4_root related material: failure experiment
9374 (which goal was to allow to derive from a class).
9376 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
9377 definitions and uses.
9379 2004-12-14 Paul Eggert <eggert@cs.ucla.edu>
9381 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
9382 not 2, since it's not portable to subtract 1 from the start of an
9383 array. The new item 0 is never set or used. All uses changed.
9385 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
9386 the default definition of YYLLOC_DEFAULT. Problem reported
9387 by Frank Heckenbach.
9389 2004-12-12 Paul Eggert <eggert@cs.ucla.edu>
9391 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
9392 the normal case and one for the error case. Just use the
9393 first one uniformly. Problem reported by Frank Heckenbach.
9394 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
9395 use exactly the same macro in both places.
9396 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
9397 so that the normal-case YYRHSLOC works for the error case too.
9399 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
9400 (YYLLOC_DEFAULT): Use the same macro as glr.c.
9401 * doc/bison.texinfo (Location Default Action): Don't claim that
9402 we have an array of locations. Use the same macro for both glr
9403 and lalr parsers. Mention YYRHSLOC. Mention what happens when
9406 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
9408 * HACKING: Update email addresses to send announcements to.
9410 * configure.ac (AC_INIT): Bump version to 1.875f.
9412 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
9414 * NEWS: Version 1.875e.
9415 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
9417 * src/scan-skel.l: Include "complain.h", for "fatal".
9419 * src/relation.h (relation_print, relation_digraph):
9420 Relation sizes are of type relation_node, not size_t (this is
9421 merely a doc fix, since the two types are equivalent).
9422 (relation_transpose): Relation sizes are of type relation_node,
9424 * src/relation.c: Likewise.
9425 (top, infinity): Now of type relation_node, not int.
9426 (traverse, relation_transpose): Use relation_node, not int.
9428 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
9429 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
9430 (yyparse): Remove unused local introduced in 2004-10-25 patch.
9432 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
9433 specifying whether the test should be skipped. Use it tp
9434 specify that the [%defines %skeleton "lalr1.cc"] tests currently
9435 fail on some hosts, and should be skipped.
9437 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
9439 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
9440 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
9441 unless otherwise specified below.
9443 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
9444 to allocate kernel_base, kernel_items, kernel_size, since
9445 they needn't be initialized to 0.
9446 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
9447 * src/closure.c (new_closure): Likewise, for itemset.
9448 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
9449 * src/lalr.c (set_goto_map): Likewise, for temp_map.
9450 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
9451 (build_relations): Likewise for edge, states1, includes.
9452 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
9453 * src/reader.c (packgram): Likewise, for ritem, rules.
9454 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
9455 * src/relation.c (relation_digraph): Likewise for VERTICES.
9456 (relation_transpose): Likewise for new_R, end_R.
9457 * src/symtab.c (symbols_token_translations_init): Likewise for
9459 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
9460 (token_actions): Likewise for yydefact, actrow, conflrow,
9462 (save_column): Likewise for froms[symno], tos[symno].
9463 (goto_actions): Likewise for state_count.
9464 (pack_table): Likewise for base, pos, check.
9465 (tables_generate): Likewise for width.
9467 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
9468 for initial core. Just have a separate core, so we needn't worry
9469 about whether kernel_size and kernel_base are initialized.
9471 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
9472 kernel_size, kernel_items): Remove unnecessary initialization.
9473 * src/conflicts.c (conflicts): Likewise.
9474 * src/derives.c (derives): Likewise.
9475 * src/muscle_tablc (muscle_insert): Likewise.
9476 * src/relation.c (relation_digraph): Likewise.
9477 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
9478 conflrow, conflict_table, conflict_list, table, check):
9481 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
9482 This is because all callers pass unsigned int.
9483 * src/closure.h (new_closure): Likewise.
9485 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
9486 (build_relations): Initialize includes[i] in all cases.
9487 * src/reader.c (packgram): Always initialize rules[ruleno].prec
9488 and rules[ruleno].precsym. Initialize members in order.
9489 * src/relation.c (relation_transpose): Always initialize new_R[i]
9491 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
9493 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
9494 conflict_list[0] was always 0, but now it isn't initialized.
9496 * src/table.c (table_grow): When conflict_table grew, the grown
9497 area wasn't cleared. Fix this.
9499 * lib/.cvsignore: Add strdup.c, strdup.h.
9500 * m4/.cvsignore: Add strdup.m4.
9502 2004-12-07 Paul Eggert <eggert@cs.ucla.edu>
9504 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
9505 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
9506 GOTO_NUMBER_MAXIMUM, since we occasionally compute
9507 ngotos + 1 without checking for overflow.
9508 (build_relations): Use END_NODE, not -1, to denote end of edges.
9509 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
9510 build_relations): Use goto_number, not int, for goto numbers.
9511 * src/tables.c (save_column, default_goto): Likewise.
9513 2004-11-23 Akim Demaille <akim@epita.fr>
9515 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
9516 of #defining from yystype.
9517 Don't typedef yystype, C++ does not need it.
9518 This lets it possible to forward declare it as union.
9520 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
9522 * bootstrap (gnulib_modules): Add extensions.
9523 Problem reported by Jim Meyering.
9525 2004-11-22 Paul Eggert <eggert@cs.ucla.edu>
9527 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
9528 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
9529 src/system.h, src/tables.c: XFREE -> free, to accommodate
9530 recent change to gnulib xalloc.h.
9531 Problem reported by Jim Meyering.
9533 2004-11-17 Akim Demaille <akim@epita.fr>
9535 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
9537 2004-11-17 Akim Demaille <akim@epita.fr>,
9538 Alexandre Duret-Lutz <adl@gnu.org>
9540 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
9543 Use it instead of cdebug_.
9544 (Parser::debug_stream, Parser::set_debug_stream): New.
9545 (Parser::symprint_): Define cdebug_ for temporary backward
9547 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
9550 2004-11-17 Akim Demaille <akim@epita.fr>
9552 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
9553 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
9554 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
9555 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
9557 2004-10-27 Paul Eggert <eggert@cs.ucla.edu>
9559 * data/glr.c (yyloc_default): Remove; not used.
9560 Problem reported by Frank Heckenbach.
9562 2004-10-25 Akim Demaille <akim@epita.fr>
9564 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
9565 Introduce another definition to address simple location arrays.
9566 (yyGLRStack): New member: yyerror_range.
9567 (yyrecoverSyntaxError, yyparse): Update it.
9568 (yyrecoverSyntaxError): Use it when shifting the error token to
9569 have an accurate range, equivalent to the one computed by both
9570 yacc.c and lalr1.cc.
9571 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
9572 that column numbers start at column 0, as per GNU Coding
9573 Standards, the others tests, and the doc.
9574 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
9575 Adjust to the above change (first column is 0).
9576 And adjust the location of the "<error>", now covering the whole
9579 2004-10-22 Akim Demaille <akim@epita.fr>
9580 and Paul Eggert <eggert@cs.ucla.edu>
9582 Remove some arbitrary limits on goto numbers and relations.
9583 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
9584 initial values, since they're never used.
9585 (set_goto_map): ngotos is now unsigned, so test for overflow
9586 by seeing whether it wraps around to zero.
9587 * src/lalr.h (goto_number): Now size_t, not short int.
9588 (GOTO_NUMBER_MAXIMUM): Remove.
9589 * src/relation.c (relation_print, traverse, relation_transpose):
9590 Check for END_NODE rather than looking at sign.
9591 * src/relation.h (END_NODE): New macro.
9592 (relation_node): Now size_t, not short int.
9594 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
9596 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
9597 keyword, not an identifier. Problem reported by Baron Schwartz in
9598 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
9600 2004-10-11 Akim Demaille <akim@epita.fr>
9602 * src/symtab.c (symbol_check_alias_consistency): Also check
9603 type names, destructors, and printers.
9604 Reported by Alexandre Duret-Lutz.
9605 Recode the handling of associativity and precedence in terms
9606 of symbol_precedence_set.
9607 Accept no redeclaration at all, not even equal to the previous
9609 (redeclaration): New.
9610 Use it to factor redeclaration complaints.
9611 (symbol_make_alias): Don't set the type of the alias, let
9612 symbol_check_alias_consistency do it as for other features.
9613 * src/symtab.h (symbol): Add new member prec_location, and
9615 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
9616 * tests/input.at (Incompatible Aliases): New.
9618 2004-10-09 Paul Eggert <eggert@cs.ucla.edu>
9620 .cvsignore fixes to accommodate gnulib changes,
9621 and the practice of naming build directories "_build".
9622 * .cvsignore: Add "_*". Sort.
9623 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
9624 * m4/.cvsignore: Add "*_gl.m4".
9626 2004-10-06 Akim Demaille <akim@epita.fr>
9628 * src/parse-gram.y (add_param): Fix the truncation of trailing
9631 2004-10-05 Akim Demaille <akim@epita.fr>
9633 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
9634 whether the reducion was empty or not. This leaves room to
9635 improve the use of YYLLOC_DEFAULT in such a case.
9636 lalr1.cc is still experimental, so changing this is acceptable.
9637 And finally, there are probably not many users who changed the
9638 handling of locations in GLR, so changing is admissible too.
9640 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
9641 empty reduction, set @$ to an empty location ending the previously
9643 Adjust uses to make sure the code is triggered on empty
9645 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
9646 expected output: empty reductions have empty locations.
9648 2004-09-29 Akim Demaille <akim@epita.fr>
9650 * data/lalr1.cc: Move towards a more standard C++ coding style
9651 for templates: Class < T > -> Class<T>.
9653 2004-09-29 Akim Demaille <akim@epita.fr>
9655 * data/lalr1.cc: Reinstall the former ctor, for sake of
9656 compatibility, but warn it will be removed.
9657 Move towards a more standard C++ coding style (i.e., type *var ->
9660 2004-09-27 Paul Eggert <eggert@cs.ucla.edu>
9662 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
9663 since it's less likely to work if NULs are involved in the future.
9665 2004-09-27 Akim Demaille <akim@epita.fr>
9667 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
9669 2004-09-27 Akim Demaille <akim@epita.fr>
9671 * data/lalr1.cc (b4_parse_param_decl_1): New.
9672 (b4_parse_param_decl): Use it to have different names between attribute
9674 (b4_cc_constructor_call): Likewise.
9676 2004-09-24 Akim Demaille <akim@epita.fr>
9678 * src/parse-gram.y (add_param): Strip the leading and trailing
9679 blanks from a formal argument declaration.
9680 (YY_LOCATION_PRINT): New.
9682 2004-09-24 Akim Demaille <akim@epita.fr>
9684 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
9687 2004-09-24 Akim Demaille <akim@epita.fr>
9689 * doc/bison.texinfo (Table of Symbols): Sort.
9691 2004-09-21 Akim Demaille <akim@epita.fr>
9693 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
9694 the useless parentheses.
9695 Suggested by Paul Eggert.
9697 2004-09-20 Akim Demaille <akim@epita.fr>
9699 Let the initial-action act on the look-ahead, and use it for the
9700 "initial push" (corresponding to an hypothetical beginning-of-file).
9701 And let lalr1.cc honor %initial-action.
9703 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
9705 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
9706 (Parser::Parser): Remove the ctor that used to initialize it.
9707 (Parser::parse): Like in the other skeletons, issue the "starting
9708 parse" message before any action.
9709 Honor %initial-action.
9710 Initialize the stacks with the lookahead.
9711 * data/yacc.c: Let $$ and @$ in %initial-action designate the
9713 Push them in the stacks.
9714 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
9716 2004-09-20 Akim Demaille <akim@epita.fr>
9718 * doc/bison.texinfo (Initial Action Decl): New.
9720 2004-09-20 Akim Demaille <akim@epita.fr>
9722 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
9723 clearer criterion to define it.
9724 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
9725 When reducing on an empty RHS, use the latest stacked location as
9727 yylloc is not always available.
9728 * data/glr.c: Likewise.
9729 Also, honor initial-actions.
9731 2004-09-20 Akim Demaille <akim@epita.fr>
9733 * data/yacc.c (YY_LOCATION_PRINT): New.
9734 Define when we know YYLTYPE's structure, i.e., when the default
9735 YYLLOC_DEFAULT is used.
9736 * data/c.m4 (b4_yysymprint_generate): Use it.
9737 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
9738 value of the result.
9739 (error_start_): Replace with...
9740 (error_range_): this location array.
9741 This allows to replace code relying on the implementation of
9742 locations by portable code.
9743 * data/yacc.c (yylerrsp): Replace with...
9744 (yyerror_range): this.
9745 Every time a token is popped, update yyerror_range[0], to have an
9746 accurate location for the error token.
9747 * data/glr.c (YY_LOCATION_PRINT): New.
9748 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
9749 deference a pointer.
9750 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
9751 report the location in %printers.
9753 * src/scan-skel.l: Instead of abort, report error messages to ease
9754 understanding skeleton scanning failures.
9756 2004-09-16 Akim Demaille <akim@epita.fr>
9758 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
9759 (iterator, const_iterator): these, to be more in the C++ spirit.
9760 Also, return reverse iterators so that when displaying the stack
9761 we display its bottom first.
9762 (Parser::stack_print_, Parser::reduce_print_): Match the messages
9764 We should probably use vector here though.
9766 2004-09-16 Akim Demaille <akim@epita.fr>
9768 Have more complete shift traces.
9770 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
9771 to report Shifts instead of ad hoc YYDPRINTF invocations,
9772 including for the error token.
9773 * data/lalr1.cc (symprint_): Output the location.
9774 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
9775 output the location within the %printer.
9776 Activate GLR tests, at least to make sure they compile properly.
9777 They still don't pass though.
9778 * tests/calc.at: Adjust expect verbose output, since now "Entering
9779 state..." is on a different line than the "Shifting" message.
9781 2004-09-08 Akim Demaille <akim@epita.fr>
9783 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
9784 Bison directive from the Bison file to the invocation of this
9785 macro, so that these directives are passed to
9786 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
9787 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
9788 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
9789 the extra Bison directives instead of the whole series.
9790 Change the grammar so that there are recoverable errors, and
9791 unrecoverable errors. Now we can have the parser give up before
9792 consuming the whole input. As a result we now can observe that
9793 the lookahead is freed when needed.
9794 Change the parser source to parse argv[1] instead of a hard coded
9796 Simplify yylex, and give a value and location to EOF.
9797 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
9798 passed directives already coded in the file.
9799 Add some tests to check the location of "error".
9800 For some tests, the C++ parser is correct, and not yacc.c.
9801 For other tests, they provide different, but unsatisfying, values,
9802 so keep the C++ value so that at least one parser is "correct"
9803 according to the test suite.
9804 (Actions after errors): Remove, this is subsumed by the
9805 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
9807 2004-09-06 Akim Demaille <akim@epita.fr>
9809 * data/lalr1.cc: Adjust the indentation of the labels.
9813 2004-09-06 Akim Demaille <akim@epita.fr>
9815 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
9816 argument, an informative message.
9817 Call YY_SYMBOL_PRINT.
9818 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
9819 * data/lalr1.cc (destruct_): Likewise.
9820 In addition, no longer depend on b4_yysymprint_generate and
9821 b4_yydestruct_generate to generate these functions, do it "by
9824 2004-09-03 Akim Demaille <akim@epita.fr>
9826 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
9827 invoked, yydestruct the lookahead.
9828 * tests/calc.at (Calculator $1): Update the expected lengths of
9829 traces: there is an added line for the discarded lookahead.
9830 * doc/bison.texinfo (Destructor Decl): Some rewording.
9831 Define "discarded" symbols.
9833 2004-09-02 Akim Demaille <akim@epita.fr>
9835 * data/lalr1.cc (translate_, destruct_): No reason to be static.
9837 2004-09-02 Akim Demaille <akim@epita.fr>
9839 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
9840 (YYDSYMPRINTF): Rename as...
9841 (YY_SYMBOL_PRINT): this.
9842 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
9844 Use it instead of direct symprint_ calls.
9845 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
9848 2004-09-02 Akim Demaille <akim@epita.fr>
9850 * data/lalr1.cc (b4_yysymprint_generate): New.
9851 (symprint_): New member function, defined when YYDEBUG.
9852 Use it consistently instead of token/nterm debugging output by
9854 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
9855 %printer calls to use cdebug_ when using lalr1.cc.
9857 2004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
9859 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
9860 with #ifdef YYDEBUG.
9862 2004-08-26 Akim Demaille <akim@epita.fr>
9864 * doc/bison.texinfo (Implementing Loops): Rename as...
9865 (Implementing Gotos/Loops): this.
9867 2004-08-13 Paul Eggert <eggert@cs.ucla.edu>
9869 Adjust to latest gnulib.
9870 * bootstrap (gnulib_modules): Add xalloc-die.
9871 Set LC_ALL=C so that file names sort consistently.
9872 Prefer the gnulib copies of gettext.m4, glibc21.m4,
9873 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
9874 uintmax_t.m4, ulonglong.m4.
9875 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
9876 po.m4 since we are now using _gl.m4 instead.
9878 2004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
9880 * src/scan-action.l: Remove. Scanning of semantic actions is
9881 handled in scan-gram.l.
9883 2004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
9885 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
9887 * src/location.h (struct): The file member is a uniqstr.
9888 (equal_boundaries): Use UNIQSTR_EQ for comparison.
9890 2004-07-22 Paul Eggert <eggert@cs.ucla.edu>
9892 Fix bug with non-%union parsers that have printers or destructors,
9893 which led to a Bison core dump. Reported by Peter Fales in
9894 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
9896 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
9897 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
9898 not to our own type.
9899 * src/output.c (symbol_destructors_output, symbol_printers_output):
9900 Don't assume %union.
9901 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
9902 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
9903 UNION-FLAG. All callers changed.
9904 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
9905 Use type char, not unsigned int, when declaring an array of char;
9906 this lets us remove a cast.
9907 (Printers and Destructors): Add non-%union test cases.
9909 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
9911 * doc/bison.texinfo: Minor editorial changes, mostly to the new
9912 GLR writeups. E.g., avoid frenchspacing and the future tense,
9913 change "lookahead" to "look-ahead", and change "wrt" to "with
9916 2004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
9918 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
9919 New sections, split off from the GLR Parsers section. Put the new
9920 Simple GLR Parser near the start of the GLR section, for clarity.
9921 Rewrite connective text.
9923 2004-06-21 Frank Heckenbach <frank@g-n-u.de>
9925 * doc/bison.texinfo (Simple GLR Parsers): New section.
9927 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
9929 * NEWS, TODO, doc/bison.texinfo:
9930 Use "look-ahead" instead of "lookahead", to be consistent.
9931 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
9932 while we're fixing "look-ahead".
9933 * src/conflicts.c (shift_set): Renamed from shiftset.
9934 (look_ahead_set): Renamed from lookaheadset.
9935 * src/print.c: Likewise.
9936 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
9937 name for "lookahead".
9938 (report_types, usage): Likewise.
9939 * src/getargs.h (report_look_ahead_tokens): Renamed from
9941 * src/lalr.c (compute_look_ahead_tokens): Renamed from
9943 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
9944 (look_ahead_tokens_print): Renamed from lookaheads_print.
9945 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
9946 state_rule_lookaheads_print.
9947 * src/state.h: Likewise.
9948 (reductions.look_ahead_tokens): Renamed from lookaheads.
9949 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
9950 AT_DATA_LOOKAHEADS_GRAMMAR.
9952 2004-06-03 Paul Eggert <eggert@cs.ucla.edu>
9954 * README: Update location of patched M4 distribution.
9956 2004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
9958 Don't assume the C++ compiler takes the same arguments as the C compiler
9960 * configure.ac (O0CXXFLAGS): New var.
9961 * tests/atlocal.in (CXXFLAGS): Use it.
9963 2004-05-29 Paul Eggert <eggert@cs.ucla.edu>
9965 Fix some "make check" problems with C++ reported by
9966 Albert Chin-A-Young for Tru64 C++ in this thread:
9967 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
9969 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
9970 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
9971 Output to a .cc file for C++, not to a .c file.
9972 * tests/calc.at (AT_CHECK_CALC): Likewise.
9973 * tests/regression.at (AT_CHECK_DANCER): Likewise.
9974 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
9976 2004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
9978 * tests/calc.at, tests/actions.at: Workaround for SGI
9979 C++ compiler. (trivial change)
9981 2004-05-27 Paul Eggert <eggert@cs.ucla.edu>
9983 Spent a few hours checking out which prerequisite versions the
9984 current sources actually require. I went all the way back to
9985 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
9986 a seemingly endless set of combinations of versions more recent
9987 than that. The bottom line is that the current sources require
9988 fairly recent versions of the build tools, and it'll be some work
9990 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
9991 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
9992 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
9993 Add comments explaining why those particular versions are
9996 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
9997 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
9998 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
10000 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
10001 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
10003 2004-05-26 Paul Eggert <eggert@cs.ucla.edu>
10005 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
10006 0.11.5. Suggested by Bruno Haible.
10007 * bootstrap: Remove gettext version checking.
10009 * doc/bison.texinfo (Decl Summary): Also mention that %union
10010 can depend on prerequisite types. Problem reported by Tim
10013 2004-05-25 Paul Eggert <eggert@cs.ucla.edu>
10015 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
10016 * README-alpha: Don't tell people not to package this.
10018 * bootstrap: Don't assume $(...) works; use `...` instead.
10019 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
10022 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
10023 put into the -d output file, and mention what to do if YYSTYPE is
10024 defined as a macro.
10026 2004-05-24 Paul Eggert <eggert@cs.ucla.edu>
10028 Undo change made earlier today: it caused autopoint to not bring
10029 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
10032 * bootstrap: Check that gettext version matches what's in
10033 configure.ac. Warn users to ignore robots.txt ERROR 404.
10034 * bootstrap: Undo today's earlier change (logged below).
10035 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
10037 The gettext version checking is causing more trouble than it's
10038 curing; remove it. Problem reported by Paul Hilfinger.
10040 * bootstrap: Issue a warning that one can expect a message
10041 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
10042 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
10044 2004-05-23 Paul Eggert <eggert@cs.ucla.edu>
10046 Ensure that the C++ compiler used for testing actually works on a
10047 simple test program; if not, skip the C++-related tests. Problem
10048 reported by Vin Shelton in:
10049 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
10051 * m4/cxx.m4: New file.
10052 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
10053 * tests/atlocal.in (BISON_CXX_WORKS): Add.
10054 * tests/local.at (AT_COMPILE_CXX): Use it.
10056 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
10058 * data/glr.c (yylloc): Output this macro even if locations are not
10059 being generated, as the GLR parser needs it even in that case.
10060 Problem reported by Troy A. Johnson
10061 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
10063 * configure.ac (AC_INIT): Update to 1.875e.
10065 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
10067 * NEWS: Version 1.875d.
10068 * configure.ac (AC_INIT): Likewise.
10069 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
10071 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
10072 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
10073 lalr1.cc runs afoul of the first, and the last two are no longer
10074 supported by GCC 3.4.0.
10075 * README: Mention GNU m4 1.4 or later; mention m4 patches.
10076 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
10078 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
10080 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
10081 unsigned int, for compatibility with latest gnulib hash module.
10082 * src/state.c (state_hash, state_hasher): Likewise.
10083 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
10084 * src/uniqstr.c (hash_uniqstr): Likewise.
10086 2004-05-03 Paul Eggert <eggert@cs.ucla.edu>
10088 * NEWS: Unescaped newlines are no longer allowed in char & strings.
10090 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
10091 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
10092 character and string literals.
10093 (unexpected_end): New function.
10094 (unexpected_eof): Use it.
10095 (unexpected_newline): New function.
10096 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
10099 * NEWS: Document %expect-rr.
10101 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
10102 Fix typo by replacing $1 with $option.
10103 Remove more 'intl'-related files.
10104 Don't DEFUN AM_INTL_SUBDIR twice.
10106 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
10107 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
10109 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
10110 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
10111 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
10112 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
10113 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
10114 * src/.cvsignore: Add *.output.
10116 * src/parse-gram.y: Put copyright notice inside %{ %} so it
10117 gets copied to the output file.
10119 2004-04-28 Paul Eggert <eggert@twinsun.com>
10121 Get files from the gnulib and po repositories, instead of relying
10122 on them being in our CVS. Upgrade to latest versions of gnulib
10125 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
10126 * bootstrap: Bootstrap from gnulib and po repositories.
10127 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
10128 * README-cvs: Document these changes. Remove version numbers from
10129 mentions of build tools, since they change so often. Mention Flex.
10131 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
10132 (gl_USE_SYSTEM_EXTENSIONS): Add.
10133 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
10134 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
10136 (AC_ISC_POSIX): Remove; we no longer support this
10137 ancient OS, as it gets in the way of latest Autoconf & gnulib.
10138 (AC_HEADER_STDC): Remove: we now assume C89 or better.
10139 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
10140 Do not check for C89 headers, except for locale.h which is used
10141 by the Yacc library and must port to K&R hosts.
10142 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
10143 Do not check for C89 functions, except for setlocale which is
10144 used by the Yacc library.
10145 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
10146 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
10147 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
10148 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
10149 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
10150 AM_GNU_GETTEXT): Remove; now done by:
10151 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
10152 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
10155 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
10156 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
10157 Define to empty, as gnulib.mk will do the rest for us.
10158 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
10160 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
10161 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
10163 * src/files.c: Include gnulib's xstrndup.h.
10165 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
10166 (REALLOC): Use xnrealloc, for likewise.
10167 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
10168 (strnlen, memrchr): Remove decls; functions no longer used.
10169 Include <stpcpy.h>.
10171 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
10172 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
10173 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
10174 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
10175 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
10176 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
10177 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
10178 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
10179 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
10180 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
10181 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
10182 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
10183 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
10184 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
10185 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
10186 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
10187 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
10188 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
10189 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
10190 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
10191 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
10192 Remove, as these files are now generated automatically
10193 by bootstrap or automake.
10195 * po/ChangeLog: Remove: all but one entry was a duplicate
10196 of this file, and I moved that 2000-11-02 entry here.
10198 * config/.cvsignore: Add Makefile, depcomp, install-sh.
10199 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
10200 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
10201 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
10202 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
10203 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
10204 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
10205 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
10206 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
10207 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
10208 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
10210 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
10211 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
10212 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
10213 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
10214 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
10215 * src/.cvsignore: Remove *_.c.
10218 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
10219 support it. (The latest stable gzip doesn't.)
10221 2004-04-27 Paul Eggert <eggert@twinsun.com>
10223 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
10224 case, as stos_ is now used by destructors due to the 2004-02-09
10227 Remove more K&R C support.
10228 * lib/libiberty.y (PARAMS): Remove. All uses removed.
10229 * lib/subpipe.c (errno): Remove decl.
10230 Include <stdlib.h> unconditionally.
10231 (EXIT_FAILURE): Remove macro.
10232 * src/complain.c (vfprintf, strerror): Remove.
10233 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
10235 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
10236 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
10237 (strchr, strspn, memchr): Remove decls.
10238 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
10239 unconditionally. Do not declare perror.
10240 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
10243 * src/complain.c (_): Remove useless defn, as system.h defines this.
10245 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
10246 with latest obstack.h.
10247 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
10248 to procedure types, as obstack.h now does that for us.
10249 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
10251 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
10252 so that this include file can stand alone.
10253 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
10254 does this now. Include subpipe.h first after config.h, to
10255 test whether it can stand alone.
10257 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
10258 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
10259 unused declaration.
10261 * tests/synclines.at (%union synch line): Put a dummy member in
10262 the union, because empty unions aren't allowed in C. Caught
10265 2004-04-13 Jim Meyering <jim@meyering.net>
10267 * src/conflicts.c (conflicts_print): Correct format string typo:
10268 use `%%' to produce literal `%'. (trivial change)
10270 2004-03-30 Paul Eggert <eggert@twinsun.com>
10272 * src/getargs.c (version): Update copyright year to 2004.
10274 * data/c.m4 (b4_int_type): Use 'short int' rather than
10275 'short', and similarly for 'long', 'unsigned', etc.
10276 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
10277 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
10278 yy_yypstack, yydumpstack): Likewise.
10279 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
10280 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
10282 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
10283 yy_stack_print, yyparse): Likewise.
10284 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
10285 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
10286 * lib/bitset.c (bitset_print): Likewise.
10287 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
10288 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
10289 * lib/bitsetv.c (bitsetv_dump): Likewise.
10290 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
10291 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
10293 * src/LR0.c (allocate_itemsets): Likewise.
10294 * src/gram.h (rule_number, rule): Likewise.
10295 * src/lalr.h (goto_number): Likewise.
10296 * src/nullable.c (nullable_compute): Likewise.
10297 * src/output.c (prepare_rules): Likewise.
10298 * src/relation.c (relation_print, relation_digraph): Likewise.
10299 * src/relation.h (relation_node): Likewise.
10300 * src/state.h (state_number, transitions, errs, reductions,
10301 struct state): Likewise.
10302 * src/symtab.h (symbol_number, struct symbol): Likewise.
10303 * src/tables.c (vector_number, tally, action_number,
10304 default_goto, goto_actions): Likewise.
10305 * tests/existing.at (GNU Cim Grammar): Likewise.
10306 * tests/regression.at (Web2c Actions): Likewise.
10308 * src/output.c (muscle_insert_short_int_table): Renamed from
10309 muscle_insert_short_table. All uses changed.
10311 2004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10313 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
10314 (declaration): Replace expected_conflicts with expected_sr_conflicts.
10315 Add %expect-rr rule.
10317 * src/scan-gram.l: Recognize %expect-rr.
10319 * src/conflicts.h (expected_sr_conflicts): Rename from
10320 expected_conflicts.
10321 (expected_rr_conflicts): Declare.
10323 * src/conflicts.c (expected_sr_conflicts): Rename from
10324 expected_conflicts.
10325 (expected_rr_conflicts): Define.
10326 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
10328 Use expected_sr_conflicts in place of expected_conflicts.
10329 Warn if expected_rr_conflicts used in non-GLR parser.
10331 * doc/bison.texinfo: Add documentation for %expect-rr.
10333 2004-03-08 Paul Eggert <eggert@gnu.org>
10335 Add support for hex token numbers. Suggested by Odd Arild Olsen in
10336 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
10338 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
10340 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
10341 * src/scan-gram.l (scan_integer): New function.
10343 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
10344 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
10345 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
10346 Say "long int", not "long", for uniformity with GNU style.
10348 2004-02-25 Paul Eggert <eggert@twinsun.com>
10350 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
10351 compilers. This fixes a problem with Intel's C++ compiler being
10352 chatty, reported by Guido Trentalancia in
10353 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
10355 2004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
10357 Support %destructor and merge error locations in lalr1.cc.
10359 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
10360 (Parser::stos_): Define unconditionally.
10361 (Parser::destruct_): New method. Generate its body with
10362 b4_yydestruct_generate.
10363 (Parser::error_start_): New attribute.
10364 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
10365 token which are discarded.
10366 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
10367 error_start_ when erroneous token are discarded.
10368 (Parser::parse) <yyerrlab1>: Compute the location of the error
10369 token so that it covers all the discarded tokens.
10370 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
10371 it can be called with `%skeleton "lalr1.cc"', and do that.
10373 2004-02-02 Paul Eggert <eggert@twinsun.com>
10375 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
10376 $(top_srcdir)/lib and ../lib. This fixes a bug reported
10377 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
10378 There's no need to mention top_builddir since Automake does that
10380 (INCLUDES): Remove, as Automake says it's obsolescent.
10381 Contents migrated into AM_CPPFLAGS as described above.
10382 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
10384 2004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10386 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
10387 (yyreportSyntaxError): Handle case where lookahead token is
10390 2004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10392 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
10393 resulting parsers are compilable with C++.
10395 2003-12-23 Paul Eggert <eggert@twinsun.com>
10397 * config/depcomp, config/install-sh: Sync with Automake 1.8.
10398 * src/output.c (output_skeleton): Rename local var.
10399 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
10400 Bison tokens, as this runs afoul of the 2003-10-07 change that
10401 disallowed NUL bytes in character constants or string literals.
10403 * tests/local.at: Require Autoconf 2.59's Autotest.
10404 * tests/testsuite.at: Don't include local.at, since we now assume
10405 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
10407 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
10408 multiple inclusion warnings.
10410 2003-12-02 Akim Demaille <akim@epita.fr>
10412 * doc/bison.texinfo (How Can I Reset the Parser): More about start
10416 2003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
10418 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
10420 2003-10-07 Paul Eggert <eggert@twinsun.com>
10422 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
10423 if testsuite doesn't exist.
10425 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
10426 literals, unfortunately.
10427 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
10428 Complain about NUL bytes in character constants or string literals.
10430 2003-10-05 Paul Eggert <eggert@twinsun.com>
10432 * NEWS: Don't document %no-default-prec, as it's still
10434 * doc/bison.texinfo: Document %no-default-prec only if
10435 the defaultprec flag is set. Normally it's not.
10437 2003-10-04 Paul Eggert <eggert@twinsun.com>
10439 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
10440 non-modifiable lvalue, instead of a modifiable one.
10441 * doc/bison.texinfo (Actions): Document that $$ can
10442 be assigned to. Do not claim that $$ and $N are
10443 array element references: user code should not rely on this.
10445 2003-10-01 Paul Eggert <eggert@twinsun.com>
10447 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
10448 (grammar_declaration): Use it.
10449 * src/scan-gram.l: New token %no-default-prec.
10450 * tests/conflicts.at: Revamp tests to use %no-default-prec.
10451 * NEWS, doc/bison.texinfo: Document the above.
10453 2003-10-01 Akim Demaille <akim@epita.fr>
10455 VCG no longer supports long_straight_phase.
10457 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
10458 * src/print_graph.c (print_graph): Adjust.
10460 2003-09-30 Frank Heckenbach <frank@g-n-u.de>
10461 and Paul Eggert <eggert@twinsun.com>
10463 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
10464 Table of Symbols): Document %default-prec.
10465 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
10466 (grammar_declaration): Set default_prec on %default-prec.
10467 * src/scan-gram.l (%default-prec): New token.
10468 * src/reader.h (default_prec): New flag.
10469 * src/reader.c: Likewise.
10470 (packgram): Handle it.
10471 * tests/conflicts.at (%default-prec without %prec,
10472 %default-prec with %prec, %default-prec 1): New tests.
10474 2003-09-30 Paul Eggert <eggert@twinsun.com>
10476 * tests/testsuite.at: Include local.at, not input.at, fixing
10477 a typo in the 2003-08-25 patch.
10479 2003-08-27 Akim Demaille <akim@epita.fr>
10481 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
10484 2003-08-26 Akim Demaille <akim@epita.fr>
10486 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
10487 "<\#" to avoid magic from Gnus when posting parts of this script.
10489 2003-08-26 Akim Demaille <akim@epita.fr>
10491 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
10492 (Parser::parse): here.
10493 Adjust: nerrs and errstatus is now replaced by...
10494 (Parser::nerrs_, Parser::errstatus_): New.
10496 2003-08-25 Akim Demaille <akim@epita.fr>
10498 * config/announce-gen, Makefile.cfg: New.
10499 * Makefile.am: Adjust.
10500 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
10501 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
10503 2003-08-25 Akim Demaille <akim@epita.fr>
10505 When reducing initial empty rules, Bison parser read an initial
10506 location that is not defined. This results in garbage, and that
10507 affects Bison's own parser. Therefore we need (i) to extend Bison
10508 to support a means to initialize this location, and (ii) to use
10509 this CVS Bison to fix CVS Bison's parser.
10511 * src/reader.h, reader.c (epilogue_augment): Remove, replace
10513 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
10514 * src/parse-gram.y: Adjust.
10515 (%initial-action): New.
10516 (%error-verbose): Since we require CVS Bison, there is no reason
10518 * src/scan-gram.l: Adjust.
10519 * src/Makefile.am (YACC): New, to make sure we use our own parser.
10520 * data/yacc.c (yyparse): Use b4_initial_action.
10522 2003-08-25 Akim Demaille <akim@epita.fr>
10524 * doc/bison.texinfo: Don't promote stdout for error messages.
10526 2003-08-25 Akim Demaille <akim@epita.fr>
10528 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
10529 From Alexandre Duret-Lutz.
10531 2003-08-25 Akim Demaille <akim@epita.fr>
10535 2003-08-25 Akim Demaille <akim@epita.fr>
10537 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
10540 2003-08-25 Akim Demaille <akim@epita.fr>
10542 * data/lalr1.cc (Parser::reduce_print_): New.
10545 2003-08-25 Akim Demaille <akim@epita.fr>
10547 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
10548 error recovery loops. This patch is based on
10549 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
10550 Also, augment the similarity between lalr1.cc and yacc.c.
10551 Note: the locations of error recovery rules are not correct yet.
10553 * data/lalr1.cc: Comment changes to augment the similarity between
10554 lalr1.cc and yacc.c.
10555 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
10556 (yyerrlab1): Remove, but where it used to be (now the bottom part of
10557 yyerrlab), when hitting EOF, pop the whole stack here instead of
10558 merely falling thru the default error handling mechanism.
10559 (yyerrorlab): New label, with the old contents of YYERROR,
10560 plus the following change: pop the stack of rhs corresponding
10561 to the production that invoked YYERROR. That is how Yacc
10562 behaves (required by POSIX).
10563 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
10566 2003-08-25 Akim Demaille <akim@epita.fr>
10568 Tune local.at so that people can "autom4te -l autotest calc.at -o
10569 calc" for instance, to extract a sub test suite.
10571 * tests/testsuite.at: Move the initialization, Autotest version
10572 requirement, and AT_TESTED invocation into...
10573 * tests/local.at: here.
10574 * tests/testsuite.at: Include it for compatibility with Autoconf
10576 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
10579 2003-08-04 Paul Eggert <eggert@twinsun.com>
10581 Rework code slightly to avoid gcc -Wtraditional warnings.
10582 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
10583 The returned value is now stored in *YY0. All callers changed.
10584 * src/output.c (merge_output): Adjust to the above change.
10586 2003-07-26 Paul Eggert <eggert@twinsun.com>
10588 * data/glr.c (YYASSERT): New macro.
10589 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
10590 yyresolveStates, yyprocessOneStack):
10591 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
10592 Derived from a suggestion by Frank Heckenbach.
10594 2003-07-25 Paul Eggert <eggert@twinsun.com>
10596 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
10597 for portability to K&R C (after ansi2knr, presumably). See
10598 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
10599 by Frank Heckenbach, though I have omitted the structure-initialization
10600 part of his glr-knr.diff patch since I recall that the Portable
10601 C Compiler didn't require that change.
10603 Let the user specify how to allocate and free memory.
10604 Derived from a suggestion by Frank Heckenbach in
10605 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
10606 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
10607 All uses of free, malloc, realloc changed to use these macros,
10608 and unnecessary casts removed.
10609 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
10611 2003-07-06 Matthias Mann <MatthiasMann@gmx.de>
10613 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
10614 use s.empty() rather than s == "" to test for empty string; see
10615 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
10618 2003-06-25 Akim Demaille <akim@epita.fr>
10620 * config/depcomp, config/install-sh: Update from masters.
10622 2003-06-20 Paul Eggert <eggert@twinsun.com>
10624 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
10625 and return properly parenthesized result.
10626 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
10627 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
10628 Remove unnecessary parentheses from uses.
10629 * doc/bison.texinfo (Location Default Action): Describe the
10630 conventions for parentheses.
10632 2003-06-19 Paul Eggert <eggert@twinsun.com>
10634 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
10635 yyreportTree): Do not assume that size_t is the same width as int,
10636 when printing sizes. Print sizes using an unsigned format.
10637 Problem reported by Frank Heckenbach in
10638 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
10640 Port to Forte Developer 7 C compiler.
10641 * data/glr.c (struct YYLTYPE): If locations are not being used,
10642 declare a single dummy member, as empty structs do not conform
10644 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
10645 the Forte Developer 7 C compiler complains that end-of-loop
10646 code is not reached.
10648 2003-06-17 Paul Eggert <eggert@twinsun.com>
10650 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
10651 avoid warnings from picky compilers about redefinition of PARAMS.
10653 2003-06-17 Paul Eggert <eggert@twinsun.com>
10657 * NEWS: Document 1.875b.
10659 * lib/bbitset.h: Do not include config.h; that's the includer's job.
10660 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
10661 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
10662 Don't use 'index' in comments, as it's a builtin fn on some hosts.
10663 * lib/bitset_stats.c: Include gettext.h unconditionally, as
10664 per recent gettext manual's suggestion.
10665 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
10666 Use prototypes, not old-style definitions.
10667 * lib/lbitset.c (lbitset_unused_clear): Likewise.
10668 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
10669 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
10670 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
10671 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
10672 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
10673 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
10674 vbitset_or_and_cmp, vbitset_copy): Likewise.
10676 * lib/libiberty.h: Do not include config.h; that's the includer's job.
10677 Do not include <stdlib.h>.
10678 (PARAMS): Define unconditionally for C89.
10679 (ATTRIBUTE_NORETURN): Remove.
10680 (ATTRIBUTE_UNUSED): Define unconditionally.
10682 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
10683 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
10684 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
10685 * lib/vbitset.c, lib/vbitset.h: New files.
10686 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
10687 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
10690 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
10691 `How Can I Reset @code{yyparse}', since texinfo does not allow
10692 arbitrary @ in node names.
10694 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
10695 shouldn't be needed according to the gettext 0.12.1 documentation
10696 but which seem to be needed anyway: codeset.m4 glibc21.m4
10697 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
10698 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
10699 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
10701 * lib/.cvsignore: Add stdbool.h.
10702 * m4/.cvsignore: Add nls.m4, po.m4.
10704 Upgrade to CVS gnulib.
10705 * stdbool_.h: File renamed from stdbool.h.in.
10706 * configure.ac (AM_STDBOOL_H): Invoke this instead of
10708 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
10709 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
10710 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
10711 (MOSTLYCLEANFILES): New var.
10712 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
10713 (stdbool.h): New rule.
10714 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
10715 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
10716 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
10717 m4/quote.m4: Upgrade to today's gnulib.
10719 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
10720 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
10721 the tests right now.
10722 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
10723 yyerror are declared before use; C99 requires this.
10725 2003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10727 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
10729 (yyrecoverSyntaxError): Correct the logic for setting and testing
10731 Correct comment on handling EOF.
10732 Allow states with only a default reduction, rather than failing
10733 (I can't quite reconstruct why these were not allowed before).
10735 Fixes to avoid problem that $-N rules in GLR parsers can cause
10736 buffer overruns, corrupting state.
10738 * src/output.c (prepare_rules): Output max_left_semantic_context
10740 * src/reader.h (max_left_semantic_context): New variable declaration.
10741 * src/scan-gram.l (max_left_semantic_context): Define.
10742 (handle_action_dollar): Update max_left_semantic_context.
10743 * data/glr.c (YYMAXLEFT): New definition.
10744 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
10745 (yyresolveAction): Ditto.
10747 Fixes to problems with location handling in GLR parsers reported by
10748 Frank Heckenbach (2003/06/05).
10750 * data/glr.c (YYLTYPE): Make trivial if locations not used.
10751 (YYRHSLOC): Add parentheses, and define only if locations used.
10752 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
10753 locations not used.
10754 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
10755 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
10757 * tests/cxx-type.at: Exercise location information; update tests
10758 to differentiate output with and without locations.
10759 Remove forward declarations of yylex and yyerror---caused errors
10760 because default YYLTYPE not yet defined.
10761 Change semantic actions to compute strings, rather than printing
10762 them directly (to test proper passing of semantics values). Change
10763 output to prefix notation and update test data and expected results.
10764 (yylex): Track locations.
10765 (stmtMerge): Return value rather than printing, and include arguments
10768 2003-06-03 Paul Eggert <eggert@twinsun.com>
10770 Avoid warnings generated by GCC 2.95.4 when Bison is
10771 configured with --enable-gcc-warnings.
10772 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
10773 yy::]b4_parser_class_name[::translate_,
10774 yy::Stack::operator[] (unsigned),
10775 yy::Stack::operator[] (unsigned) const,
10776 yy::Slice::operator[] (unsigned),
10777 yy::Slice::operator[] (unsigned) const):
10778 Rename local vars to avoid warnings.
10779 * tests/glr-regression.at (Improper handling of embedded actions
10780 and $-N in GLR parsers): Remove unused local variable from yylex.
10781 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
10782 (void) as arg when not pure, since we now assume C89 when building
10783 Bison. Pacify GCC by using parameter.
10785 2003-06-02 Paul Eggert <eggert@twinsun.com>
10787 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
10788 yy::Location::lines, yy::Location::columns): Rename arguments
10789 to avoid shadowing; this removes a warning generated by GCC 3.3.
10791 2003-06-01 Paul Eggert <eggert@twinsun.com>
10793 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
10794 to g++, as GCC 3.3 complains if you do it.
10795 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
10796 everything that WARNING_CFLAGS has, except omit warnings
10797 not suitable for C++.
10798 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
10799 * tests/atlocal.in (CXXFLAGS): New var.
10800 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
10802 Fix a GLR parser bug I reported in February; see
10803 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
10804 The problem was that GLR parsers did not conform to the C standard,
10805 because actions like { $1 = $2 + $3; } expanded to expressions
10806 that invoked YYFILL in separate subexpressions, and YYFILL assigned
10807 to a local variable. The C standard says that expressions
10808 like (var = f ()) + (var = f ()) have undefined behavior.
10809 Another problem was that GCC sometimes issues warnings that
10810 yyfill and its parameters are unused.
10812 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
10813 as possibly unused.
10814 (yyfill): New function.
10816 (yyuserAction): Change type of yynormal to bool, so that it matches
10817 the new yyfill signature. Mark it as possibly unused.
10820 Follow up on a bug I reported in February, where a Bison-generated
10821 parser can loop. Provide a test case and a fix for yacc.c. I
10822 don't have a fix for lalr1.cc or for glr.c, unfortunately.
10823 The original bug report is in:
10824 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
10826 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
10827 macro's size was becoming unwieldy.
10828 (yyerrlab): Do not discard an empty lookahead symbol, as this
10829 might destroy garbage.
10830 (yyerrorlab): New label, with the old contents of YYERROR,
10831 plus the following change: pop the stack of rhs corresponding
10832 to the production that invoked YYERROR. That is how Yacc
10833 behaves, and POSIX requires this behavior.
10834 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
10835 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
10836 Define 'alarm' to do nothing if unistd.h is not available.
10837 Add a new rule "exp: '-' error;" to test the above change to
10838 data/yacc.c. Use 'alarm' to abort any test taking longer than
10839 10 seconds, as it's probably looping.
10840 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
10841 Also, the new yacc.c generates two fewer diagnostics for an
10844 2003-05-24 Paul Eggert <eggert@twinsun.com>
10846 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
10847 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
10848 This fixes a problem reported by John Bowman when the Compaq/HP
10849 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
10850 -ansi -Wall -gall).
10851 * data/yacc.c (union yyalloc): Likewise.
10852 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
10854 Switch from 'int' to 'bool' where that makes sense.
10856 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
10857 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
10858 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
10859 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
10860 Return or accept bool, not int. All callers changed.
10861 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
10862 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
10863 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
10864 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
10865 bitset_or_and_cmp_): Likewise.
10866 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
10867 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
10868 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
10869 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
10870 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
10871 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
10872 bitset_stats_or_and_cmp): Likewise.
10873 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
10874 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
10875 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
10876 ebitset_xor_cmp): Likewise.
10877 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
10878 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
10879 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
10880 lbitset_xor_cmp): Likewise.
10881 * lib/bbitset.h: Include <stdbool.h>.
10882 (struct bitset_vtable): The following members now return bool, not
10883 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
10884 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
10886 * src/conflicts.c (count_rr_conflicts): Likewise.
10887 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
10889 * lib/ebitset.c (ebitset_obstack_init): Likewise.
10890 * lib/lbitset.c (lbitset_obstack_init): Likewise.
10891 * src/getargs.c (debug_flag, defines_flag, locations_flag,
10892 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
10893 graph_flag): Likewise.
10894 * src/getargs.h (debug_flag, defines_flag, locations_flag,
10895 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
10896 graph_flag): Likewise.
10897 * src/output.c (error_verbose): Likewise.
10898 * src/output.h (error_verbose): Likewise.
10899 * src/reader.c (start_flag, typed): Likewise.
10900 * src/reader.h (typed): Likewise.
10901 * src/getargs.c (LOCATIONS_OPTION): New constant.
10902 (long_options, getargs): Use it.
10903 * src/lalr.c (build_relations): Use bool, not int.
10904 * src/nullable.c (nullable_compute): Likewise.
10905 * src/print.c (print_reductions): Likewise.
10906 * src/tables.c (action_row, pack_vector): Likewise.
10907 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
10908 * src/output.c (prepare): Use it.
10909 * src/output.c (token_definitions_output,
10910 symbol_destructors_output, symbol_destructors_output): Use string,
10911 not boolean integer, to keep track of whether to output separator.
10912 * src/print_graph.c (print_core): Likewise.
10913 * src/state.c (state_rule_lookaheads_print): Likewise.
10915 * config/install-sh: Sync from automake 1.7.5.
10917 2003-05-14 Paul Eggert <eggert@twinsun.com>
10919 * src/parse-gram.y (rules_or_grammar_declaration): Require a
10920 semicolon after a grammar declaration, in the interest of possible
10921 future changes to the Bison input language.
10922 Do not allow a stray semicolon at the start of the grammar.
10923 (rhses.1): Allow one or more semicolons after any rule, including
10924 just before "|" as required by POSIX.
10925 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
10928 2003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
10930 %parse-param support for lalr1.cc.
10932 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
10933 b4_cc_constructor_calls, b4_cc_constructor_call,
10934 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
10936 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
10937 parse-param arguments.
10938 (yy::b4_parser_class_name): Declare instance variables to
10939 hold parse-param arguments.
10940 * tests/calc.at: s/value/semantic_value/ because value clashes
10941 with a member of yy::b4_parser_class_name. Adjust C++ code
10942 to handle %parse-param. Enable %parse-param test in C++.
10944 2003-05-12 Paul Eggert <eggert@twinsun.com>
10946 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
10947 English a bit. Fix fclose typo. Change "const char" to "char
10948 const", and use ANSI C rather than K&R for "main". Suggest
10949 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
10950 and suggest yy_switch_to_buffer.
10952 2003-05-05 Paul Eggert <eggert@twinsun.com>
10954 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
10955 C89. This avoids a diagnostic on compilers that define __STDC__
10956 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
10957 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
10959 2003-05-03 Paul Eggert <eggert@twinsun.com>
10961 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
10962 Do not overrun array bounds.
10963 This should fix a bug reported today by Olatunji Oluwabukunmi in
10964 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
10966 2003-04-29 Akim Demaille <akim@epita.fr>
10968 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
10969 * src/getargs.c, src/getargs.h: here, as bool, not int.
10970 (nondeterministic_parser): New.
10971 * src/parse-gram.y, src/scan-gram.l: Support
10972 %nondeterministic-parser.
10973 * src/output.c (prepare): Use nondeterministic_parser instead
10974 of glr_parser where appropriate.
10975 * src/tables.c (conflict_row, action_row, save_row)
10976 (token_actions, token_actions, pack_vector): Ditto.
10978 2003-04-29 Akim Demaille <akim@epita.fr>
10980 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
10982 2003-04-29 Akim Demaille <akim@epita.fr>
10984 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
10985 with %pure-parser and %locations to exercise the patch from Yakov
10988 2003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
10990 * data/yacc.c: (b4_lex_param): Corrected for the case where
10991 %lex-param is provided and %pure-parser isn't.
10993 2003-04-27 Paul Eggert <eggert@twinsun.com>
10995 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
10996 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
10997 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
10998 if it is not defined.
10999 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
11001 2003-04-26 Paul Eggert <eggert@twinsun.com>
11003 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
11004 Declare to be of type suitable for the ninf value itself, not of
11005 type suitable for the corresponding table, since the latter might
11006 be unsigned but the ninf value might be negative. This fixes a
11007 bug reported by Alexandre Duret-Lutz in
11008 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
11010 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
11011 invokes it. We shouldn't invoke it twice because it will attempt
11012 to put error.o in the archive twice. This fixes a glitch reported
11013 by Martin Mokrejs in
11014 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
11016 2003-04-21 Paul Eggert <eggert@twinsun.com>
11018 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
11021 2003-04-21 Yakov Markovitch <Markovitch@iso.ru>
11023 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
11024 Fix obvious typo that results in uncompilable GLR parsers
11025 when both %pure-parser and %locations are used. (trivial change)
11027 2003-04-17 Paul Eggert <eggert@twinsun.com>
11029 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
11030 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
11031 Do not insert the expected token via unput, as this runs afoul
11032 of a POSIX-compatibility bug in flex 2.5.31.
11033 All uses changed to BEGIN the parent state,
11034 since we no longer insert the expected token via unput.
11035 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
11036 that is no longer emitted after the above change.
11038 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
11039 the first one. This change is from Paul Hilfinger, and it fixes
11040 regression reported by Werner Lemberg in
11041 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
11043 (resolve_sr_conflict): Don't invoke state_errs_set
11044 unless one or more tokens have been explicitly made errors.
11045 Otherwise, the above change causes Bison to abort.
11047 * tests/existing.at (GNU pic Grammar): New test case, taken from
11050 2003-03-31 Akim Demaille <akim@epita.fr>
11052 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
11054 2003-03-31 Akim Demaille <akim@epita.fr>
11056 * src/output.c (prepare_symbols): Avoid trailing spaces in the
11059 2003-03-31 Akim Demaille <akim@epita.fr>
11061 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
11062 From Paul Hilfinger.
11064 2003-03-29 Akim Demaille <akim@epita.fr>
11066 * m4/error.m4: Do not put under dynamic conditions some code which
11067 expansion is under static control.
11069 2003-03-29 Akim Demaille <akim@epita.fr>
11071 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
11073 2003-03-29 Akim Demaille <akim@epita.fr>
11075 * doc/bison.texinfo (Strings are Destroyed): New.
11077 2003-03-13 Paul Eggert <eggert@twinsun.com>
11079 * .cvsignore: Add configure.lineno.
11080 * src/.cvsignore: Add yacc.
11081 * tests/.cvsignore: Add testsuite.log.
11082 * doc/fdl.texi: Sync with latest FSF version.
11084 2003-03-12 Paul Eggert <eggert@twinsun.com>
11086 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
11087 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
11088 cursor, instead of leaving it undefined. This fixes a bug
11089 reported by Tim Van Holder in
11090 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
11091 * tests/input.at (Torturing the Scanner): Test the scanner on
11092 an empty input file, which was Tim Van Holder's test case.
11094 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
11095 <sys/resource.h> can be included, include sys/time.h and
11096 sys/times.h first, if available. This works around the SunOS
11097 4.1.4 porting bug reported by Bruce Becker in
11098 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
11100 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
11101 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
11102 AC_HEADER_SYS_WAIT.
11104 Merge changes from gnulib. This was prompted because the CVS
11105 snapshot didn't build on Solaris 7 due to strnlen problems.
11107 These changes need to be merged back into gnulib:
11108 * lib/hash.c: Include <stdbool.h> unconditionally.
11109 * m4/onceonly.m4 (m4_quote): New macro.
11110 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
11111 Quote AC_FOREACH variable-expansions properly.
11112 The 2003-01-03 obstack.h change also needs merging.
11113 {end of changes requiring merging}
11115 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
11116 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
11117 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
11118 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
11119 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
11120 New files, imported from gnulib.
11121 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
11124 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
11125 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
11128 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
11130 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
11131 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
11132 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
11133 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
11134 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
11135 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
11136 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
11137 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
11138 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
11139 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
11140 (jm_PREREQ_ARGMATCH): Remove.
11141 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
11142 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
11144 * src/system.h: Include <stdbool.h> unconditionally.
11146 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
11147 assuming at least C89 in the bitset code for some time now.
11149 2003-03-03 Akim Demaille <akim@epita.fr>
11153 2003-03-02 Akim Demaille <akim@epita.fr>
11155 * doc/bison.texinfo (Table of Symbols): Reactivate the
11156 documentation for %lex-param, and %parse-param.
11158 2003-03-02 Akim Demaille <akim@epita.fr>
11160 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
11161 generate verbose error messages.
11162 Use the number of tokens as an upper bound in yytname, as it
11163 cannot be a non terminal.
11165 2003-03-02 Akim Demaille <akim@epita.fr>
11167 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
11170 2003-03-02 Akim Demaille <akim@epita.fr>
11172 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
11173 Use them to exercise yycheck overrun.
11174 Based on Andrew Suffield's grammar.
11176 2003-03-02 Akim Demaille <akim@epita.fr>
11178 Create tests/local.at for Bison generic testing macros.
11180 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
11181 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
11183 * tests/calc.at (AT_CHECK_CALC): Adjust.
11184 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
11185 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
11186 * tests/local.at: here.
11187 (AT_COMPILE_CXX): Tags the tests using it as c++.
11188 Ignore the test if CXX is not functional.
11190 2003-03-01 Paul Eggert <eggert@twinsun.com>
11192 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
11193 not loc->end, since loc->end might contain garbage and this leads
11194 to undefined behavior on some platforms.
11195 (id_loc, token_start): Use (IF_LINTed) initial values that do not
11196 depend on *loc, so that the reader doesn't give the the false
11197 impression that *loc is initialized.
11198 (<INITIAL>"%%"): Do not bother setting code_start, since its value
11199 does not survive the return.
11201 2003-03-01 Akim Demaille <akim@epita.fr>
11203 * src/scan-gram.l (code_start): Always initialize it when entering
11204 into yylex, as SC_EPILOGUE is activated *before* the corresponding
11205 yylex invocation. An alternative would be making it static, but
11206 then it starts with the second %%'s beginning, instead of its end.
11208 2003-02-28 Paul Eggert <eggert@twinsun.com>
11210 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
11211 around a UnixWare 7.1.1 porting bug reported by John Hughes in
11212 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
11214 2003-02-26 Paul Eggert <eggert@twinsun.com>
11216 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
11217 Remove Sequent/Pyramid discussion (nobody uses them any more).
11218 Merge VMS and MS-DOS discussion; these ports may well be dead
11219 but let's keep mentioning them for now. Put <> around email
11220 addresses. Add copyright notice.
11222 2003-02-24 Paul Eggert <eggert@twinsun.com>
11224 * data/glr.c (yy_reduce_print): yylineno -> yylno,
11225 to avoid collision with flex use of yylineno.
11226 Problem reported by Bruce Lilly in
11227 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
11228 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
11229 * data/yacc.c (yy_reduce_print): Likewise.
11231 * config/depcomp: Sync with Automake 1.7.3.
11233 2003-02-21 Akim Demaille <akim@epita.fr>
11235 * data/lalr1.cc: Use temporary variables instead of casts to
11236 change integer types.
11237 Suggested by Paul Eggert.
11239 2003-02-21 Akim Demaille <akim@epita.fr>
11241 * doc/bison.texinfo: Use "location" consistently to refer to @n,
11242 to avoid confusions with lalr1.cc's notion of Position.
11243 Suggested by Paul Eggert.
11245 2003-02-20 Akim Demaille <akim@epita.fr>
11247 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
11248 before initial_columns.
11249 (location.hh): Use consistent variable names when defining the
11251 Use "last" so that we subtract from Positions, not from unsigned.
11253 2003-02-20 Akim Demaille <akim@epita.fr>
11255 * data/lalr1.cc (position.hh): New subfile, including the extended
11256 and Doxygen'ed documentation of class Position.
11257 (location.hh): Use it.
11258 Document a` la Doxygen.
11259 With the help of Benoit Perrot.
11261 2003-02-20 Akim Demaille <akim@epita.fr>
11263 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
11265 Redefine AT_YYERROR_SEES_LOC_IF using it.
11266 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
11268 Don't use the location in yy::Parser::error_ and
11269 yy::Parser::print_ when not %locations.
11270 Activate more lalr1.cc tests.
11272 2003-02-19 Akim Demaille <akim@epita.fr>
11274 * data/lalr1.cc: When displaying a line number, be sure to make it
11277 2003-02-19 Akim Demaille <akim@epita.fr>
11279 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
11281 (YYABORT, YYACCEPT, YYERROR): New.
11282 * tests/calc.at: Renable the lalr1.cc test.
11284 2003-02-19 Akim Demaille <akim@epita.fr>
11286 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
11287 error recovery, mixing with/without pops and discarding of the
11290 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
11292 2003-02-17 Paul Eggert <eggert@twinsun.com>
11294 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
11295 * tests/testsuite.at (AT_COMPILE): Use them.
11296 This fixes the testsuite problem reported by Robert Lentz in
11297 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
11299 2003-02-12 Paul Eggert <eggert@twinsun.com>
11301 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
11302 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
11303 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
11304 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
11305 Check for malloc failure, for consistency with yacc.c.
11306 (yytname_size): Remove, for consistency with yacc.c.
11308 The bug still remains in data/lalr1.cc, as I didn't have time
11311 2003-02-06 Akim Demaille <akim@epita.fr>
11313 * configure.ac (GXX): Rename as...
11314 (CXX): this, to keep the original Autoconf semantics.
11316 * data/lalr1.cc: Fix b4_copyright invocations.
11317 If YYDEBUG is not defined, don't depend upon name_ being defined.
11318 (location.hh): Include string and iostream.
11319 (Position::filename): New member.
11320 (Position::Position ()): New.
11321 (operator<< (Position)): New.
11322 (operator- (Position, int)): New.
11323 (Location::first, Location::last): Rename as...
11324 (Location::begin, Location::end): these, to mock the conventional
11326 (operator<< (Location)): New.
11327 * tests/atlocal.in (CXX): New.
11328 * tests/testsuite.at (AT_COMPILE_CXX): New.
11329 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
11330 locations in a more synthetic way.
11331 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
11333 Adjust the C locations to match those from Emacs: first column is
11335 Change all the expected results.
11336 Conform to the GCS: simplify the locations when applicable.
11337 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
11338 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
11339 these CPP macros with the m4 macros new defined by...
11340 (AT_CHECK_PUSHDEFS): this, i.e.:
11341 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
11342 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
11344 (AT_CHECK_POPDEFS): Undefine them.
11345 (AT_CHECK_CALC_LALR1_CC): New.
11346 Use it for the first lalr1.cc test.
11348 2003-02-04 Akim Demaille <akim@epita.fr>
11350 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
11351 Location as is defined.
11353 2003-02-04 Akim Demaille <akim@epita.fr>
11355 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
11356 name_ being defined.
11358 2003-02-03 Paul Eggert <eggert@twinsun.com>
11360 * src/gram.h (start_symbol): Remove unused decl.
11362 Use more-consistent naming conventions for local vars.
11364 * src/derives.c (derives_compute): Change type of local var from
11365 int to rule_number.
11366 * src/gram.c (grammar_rules_partial_print): Likewise.
11367 * src/print.c (print_core): Likewise.
11368 * src/reduce.c (reduce_grammar_tables): Likewise.
11370 * src/gram.c (grammar_dump): Change name of item_number *
11371 local var from r to rp.
11372 * src/nullable.c (nullable_compute): Likewise.
11374 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
11376 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
11377 for symbol or symbol_number var.
11378 * src/reader.c (grammar_start_symbol_set): Likewise.
11379 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
11381 * src/state.c (transitions_to): Likewise.
11382 * src/state.h: Likewise.
11383 * src/tables.c (symbol_number_to_vector_number): Likewise.
11385 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
11388 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
11391 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
11394 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
11395 Use str, not s, for char * var. Use ch, not c, for character var.
11396 Use size for size var.
11398 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
11400 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
11402 * src/uniqstr.h: Likewise.
11404 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
11405 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
11406 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
11407 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
11408 param to have same name as that of enum, so that we don't use
11409 "s" to stand for a non-state.
11411 2003-02-02 Akim Demaille <akim@epita.fr>
11413 * src/scan-skel.l: Scan more than one inert character per yylex
11416 2003-02-01 Paul Eggert <eggert@twinsun.com>
11420 * po/LINGUAS: Add ms.
11422 2003-01-30 Akim Demaille <akim@epita.fr>
11424 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
11426 2003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11428 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
11431 Changes in response to error report by S. Eken: GLR mode does not
11432 handle negative $ indices or $ indices in embedded rules correctly.
11433 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
11435 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
11436 (b4_rhs_location): Ditto.
11437 (yyfill): New function to copy from stack tree into array
11439 (yyuserAction): Modify to allow incremental move of semantic values
11440 to rhs array when in GLR mode.
11441 Define YYFILL to use in user-defined actions to fill semantic array
11443 Remove dummy use of yystack, as there is now a guaranteed use.
11444 (yydoAction): Modify to allow incremental move of semantic values
11445 to rhs array when in GLR mode.
11446 (yyresolveAction): Ditto.
11447 (yyglrShiftDefer): Update comment.
11448 (yyresolveStates): Use X == NULL for pointers, not !X.
11449 (yyglrReduce): Ditto.
11450 (yydoAction): Ditto
11452 * tests/glr-regr1.at: Rename to ...
11453 * tests/glr-regression.at: Add new regression test for the problems
11454 described above (adapted from S. Eken).
11455 Update copyright notice.
11456 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
11457 * tests/Makefile.am: Ditto.
11459 2003-01-28 Paul Eggert <eggert@twinsun.com>
11461 * data/lalr1.cc: Do not use @output_header_name@ unless
11462 b4_defines_flag is set. This fixes two bugs reported by
11464 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
11465 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
11467 2003-01-21 Paul Eggert <eggert@twinsun.com>
11469 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
11470 we don't need to worry about yyerrlab1 being reported as an
11471 "unused label" by non-GCC C compilers. The downside is that if
11472 locations are used then a couple of statements are duplicated each
11473 time YYERROR is invoked, but the upside is that the warnings
11475 (yyerrlab1): Move code to YERROR.
11476 (yyerrlab2): Remove. Change uses back to yyerrlab1.
11477 This reverts some of the 2002-12-27 change.
11479 2003-01-17 Paul Eggert <eggert@twinsun.com>
11481 * src/output.c (symbol_printers_output): Fix typo that led
11482 to core dump. Problem reported by Antonio Rus in
11483 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
11485 2003-01-13 Akim Demaille <akim@epita.fr>,
11486 Quoc Peyrot <chojin@lrde.epita.fr>,
11487 Robert Anisko <anisko_r@lrde.epita.fr>
11489 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
11490 when the stacks contain one element, as the loop would otherwise
11491 free the last state, and then use the top state (the one we just
11492 popped). This means that the initial elements will not be freed
11493 explicitly, as is the case in yacc.c; it is not a problem, as
11494 these elements have fake values.
11496 2003-01-11 Paul Eggert <eggert@twinsun.com>
11498 * NEWS: %expect-violations are now just warnings, reverting
11499 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
11500 bootstrapping problem reported by Matthias Klose; see
11501 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
11502 * src/conflicts.c (conflicts_print): Likewise.
11503 * tests/conflicts.at (%expect not enough, %expect too much,
11504 %expect with reduce conflicts): Likewise.
11505 * doc/bison.texinfo (Expect Decl): Document this. Also mention
11506 that the warning is enabled if the number of conflicts changes
11507 (not necessarily increases).
11509 * src/getargs.c (version): Update copyright year.
11511 2003-01-09 Akim Demaille <akim@epita.fr>
11513 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
11515 2003-01-08 Paul Eggert <eggert@twinsun.com>
11517 * Makefile.maint (WGETFLAGS):
11518 New macro, containing "-C off" to disable proxy caches.
11519 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
11520 (rel-check): Use $(WGET) instead of wget.
11522 2003-01-06 Paul Eggert <eggert@twinsun.com>
11524 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
11525 the GLR paper of Scott, Johnstone and Hussain.
11527 2003-01-04 Paul Eggert <eggert@twinsun.com>
11529 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
11530 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
11531 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
11532 (EXTRA_LIBRARIES): New var, for liby.a.
11533 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
11534 (EXTRA_SCRIPTS): New var, for yacc.
11536 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
11537 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
11538 Problem reported by Nelson H. F. Beebe.
11540 2003-01-03 Paul Eggert <eggert@twinsun.com>
11542 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
11543 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
11544 when compiling Bison 1.875's `bitset bset = obstack_alloc
11545 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
11547 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
11548 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
11549 grow to a huge size with typical invocation.
11551 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
11552 Use the pattern recommended by Autoconf 2.57, except also protect
11553 against double-definition.
11554 * src/system.h: Likewise.
11555 Portability issues reported by Nelson H. F. Beebe.
11557 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
11558 All uses changed. Provide a definition in both C and C++.
11559 (yytrue, yyfalse): Define even if defined (__cplusplus).
11561 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
11562 Reported by Nelson H. F. Beebe.
11564 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
11566 2003-01-02 Paul Eggert <eggert@twinsun.com>
11568 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
11569 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
11570 Bug reported by Nelson H. F. Beebe.
11572 2003-01-01 Paul Eggert <eggert@twinsun.com>
11576 2002-12-30 Paul Eggert <eggert@twinsun.com>
11578 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
11580 (<INITIAL>","): Here. This causes stray "," to be treated
11583 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
11584 last brace in braced code when not in Yacc mode, for compatibility
11585 with Bison 1.35. This resurrects the 2001-12-15 patch to
11588 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
11589 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
11591 2002-12-28 Paul Eggert <eggert@twinsun.com>
11593 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
11594 that of SYM's type. This fixes Debian bug 168069, reported by
11597 2002-12-28 Paul Eggert <eggert@twinsun.com>
11601 Switch back to the Yacc style of conflict reports, undoing some
11602 of the 2002-07-30 change.
11603 * doc/bison.texinfo (Understanding): Use Yacc style for
11604 conflict reports. Also, use new way of locating rules.
11605 * src/conflicts.c (conflict_report):
11606 Renamed from conflict_report_yacc, removing the old
11607 'conflict_report'. Translate the entire conflict report at once,
11608 so that we don't assume that "," has the same interpretation in
11610 (conflicts_output): Use Yacc-style conflict report for each state,
11611 instead of our more-complicated style.
11612 (conflicts_print): Use Yacc-style conflict report, except print
11613 the input file name when not emulating Yacc.
11614 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
11615 Conflicted Reduction, %expect not enough, %expect too much,
11616 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
11617 * tests/existing.at (GNU Cim Grammar): Likewise.
11618 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
11620 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
11621 fatal): Don't invoke fflush; it's not needed and it might even be
11622 harmful for stdout, as stdout might not be open.
11623 * src/reduce.c (reduce_print): Likewise.
11625 2002-12-27 Paul Eggert <eggert@twinsun.com>
11627 Fix a bug where error locations were not being recorded correctly.
11628 This problem was originally reported by Paul Hilfinger in
11629 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
11631 * data/yacc.c (yyparse): New local var yylerrsp, to record the
11632 top of the location stack's error locations.
11633 (yyerrlab): Set it. When discarding a token, push its location
11634 onto yylerrsp so that we don't lose track of the error's end.
11635 (yyerrlab1): Now is only the target of YYERROR, so that we can
11636 properly record the location of the action that failed. For GCC
11637 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
11638 GCC warning about yyerrlab1 being unused if YYERROR is unused.
11639 (yyerrlab2): New label, which yyerrlab now falls through to.
11640 Compute the error's location by applying YYLLOC_DEFAULT to
11641 the locations of all the symbols that went into the error.
11642 * doc/bison.texinfo (Location Default Action): Mention that
11643 YYLLOC_DEFAULT is also invoked for syntax errors.
11644 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
11645 Error locations include the locations of all the tokens that were
11646 discarded, not just the last token.
11648 2002-12-26 Paul Eggert <eggert@twinsun.com>
11650 * src/files.c: Include quote.h.
11651 (compute_output_file_names): Warn if we detect conflicting
11652 outputs to the same file. This should catch the misunderstanding
11653 exemplified by Debian Bug 165349, reported by Bruce Stephens..
11655 * src/conflicts.c (conflicts_print): If the user specifies
11656 "%expect N", report an error if there are any reduce/reduce
11657 conflicts. This is what the manual says should happen.
11658 This fixes Debian bug 130890, reported by Anthony DeRobertis.
11659 * tests/conflicts.at (%expect with reduce conflicts): New test.
11661 Don't use m4_include on relative file names, as it doesn't work as
11662 desired if there happens to be a file with that name under ".".
11664 * m4sugar/version.m4: Remove; it was included but it wasn't used.
11665 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
11666 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
11667 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
11668 * src/output.c (output_skeleton): Use full path names when
11669 specifying a file to include; don't rely on include path, as
11670 it's unreliable when the working file contains a file with
11673 2002-12-25 Paul Eggert <eggert@twinsun.com>
11675 Remove obsolete references to bison.simple and bison.hairy.
11676 Problem mentioned by Aubin Mahe in
11677 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
11678 * data/glr.c: Comment fix.
11679 * doc/bison.1: Remove references. Also, mention "yacc".
11681 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
11684 * src/parse-gram.y (declaration): Use enum "report_states" rather
11685 than its numeric value 1.
11687 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
11688 opening a new one. This fixes Debian bug 165349, reported by
11691 2002-12-24 Paul Eggert <eggert@twinsun.com>
11695 * Makefile.maint (cvs-update): Don't assume that the shell
11696 supports $(...), as Solaris sh doesn't.
11698 * src/parse-gram.y (lloc_default): Remove test for empty
11699 nonterminals at the end, since it didn't change the result.
11701 2002-12-24 Paul Eggert <eggert@twinsun.com>
11703 If the user does not define YYSTYPE as a macro, Bison now declares it
11704 using typedef instead of defining it as a macro. POSIX requires this.
11705 For consistency, YYLTYPE is also declared instead of defined.
11707 %union directives can now have a tag before the `{', e.g., the
11708 directive `%union foo {...}' now generates the C code
11709 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
11710 The default union tag is `YYSTYPE', for compatibility with Solaris 9
11711 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
11712 instead of `yyltype'.
11714 `yystype' and `yyltype' are now obsolescent macros instead of being
11715 typedefs or tags; they are no longer documented and will be
11716 withdrawn in a future release.
11718 * data/glr.c (b4_location_type): Remove.
11719 (YYSTYPE): Renamed from yystype.
11720 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
11721 (struct YYLTYPE): Renamed from struct yyltype.
11722 (YYLTYPE): Renamed from yyltype.
11723 (yyltype, yystype): New (and obsolescent) macros,
11724 for backward compatibility.
11725 * data/yacc.c: Likewise.
11727 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
11728 does not specify a union tag. This is for compatibility with
11731 * src/parse-gram.y (add_param): 2nd arg is now char * not char
11732 const *, since it is now modified by stripping surrounding { }.
11733 (current_braced_code): Remove.
11734 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
11735 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
11736 trailing " {...}". Now of type <chars>.
11737 (grammar_declaration): Adjust to bundled tokens.
11738 (code_content): Remove; stripping is now done by add_param.
11739 (print_token_value): Print contents of bundled tokens.
11740 (token_name): New function.
11742 * src/reader.h (braced_code, current_braced_code): Remove.
11743 (token_name): New decl.
11745 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
11746 token_type, not braced_code code_kind. All uses changed.
11747 (SC_PRE_CODE): New state, for scanning after a keyword that
11748 has (or usually has) an immediately-following braced code.
11749 (token_type): New local var, to keep track of which token type
11750 to return when scanning braced code.
11751 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
11752 <INITIAL>"%parse-param", <INITIAL>"%printer",
11753 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
11754 instead of returning a token type immediately.
11755 (<INITIAL>"{"): Set token type.
11756 (<SC_BRACED_CODE>"}"): Use it.
11757 (handle_action_dollar, handle_action_at): Now returns bool
11758 indicating success. Fail if ! current_rule; this prevents a core dump.
11759 (handle_symbol_code_dollar, handle_symbol_code_at):
11760 Remove; merge body into caller.
11761 (handle_dollar, handle_at): Complain in invalid contexts.
11763 * NEWS, doc/bison.texinfo: Document the above.
11764 * NEWS: Fix years and program names in copyright notice.
11766 2002-12-17 Paul Eggert <eggert@twinsun.com>
11768 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
11769 Reporting, Table of Symbols): Omit mentions of %lex-param and
11770 %parse-param from the documentation for now.
11772 2002-12-15 Paul Eggert <eggert@twinsun.com>
11774 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
11775 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
11776 lookahead symbol, and which sets yychar in parser actions) and it
11777 disagreed with the Bison documentation. Bug
11778 reported by Andrew Walrond.
11780 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
11781 as the caller now does that.
11782 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
11783 (YYEMPTY): Parenthesize right hand side, since others use it.
11784 (yyparse): Don't assume that our generated code is the only code
11787 2002-12-13 Paul Eggert <eggert@twinsun.com>
11791 POSIX requires a "yacc" command.
11792 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
11793 (MOSTLYCLEANFILES): Add yacc.
11795 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
11796 as an alias for bison y.
11798 * po/LINGUAS: Add da.
11800 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
11801 problem with latest <getopt.h>.
11802 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
11804 * doc/fdl.texi: Upgrade to 1.2.
11805 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
11806 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
11807 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
11809 * config/install-sh: Sync with autotools.
11811 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
11812 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
11813 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
11814 locations are requested.
11815 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
11816 locations are requested.
11818 2002-12-12 Paul Eggert <eggert@twinsun.com>
11820 Remove unportable casts and storage allocation tricks.
11821 While we're at it, remove almost all casts, since they
11822 usually aren't needed and are a sign of trouble.
11824 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
11826 * src/derives.c (derives_compute): Do not subtract NTOKENS from
11827 the pointer DSET returned by malloc; this isn't portable.
11828 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
11829 Similarly for DERIVES.
11830 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
11831 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
11832 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
11834 * src/derives.c (derives_compute): Do not bother invoking
11835 int_of_rule_number, since rule numbers are integers.
11837 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
11838 rather than XMALLOC (char, N).
11840 * src/files.c (filename_split): Rewrite to avoid cast.
11842 * src/gram.h (symbol_number_as_item_number,
11843 item_number_as_symbol_number, rule_number_as_item_number,
11844 item_number_as_rule_number):
11845 Now inline functions rather than macros, to avoid casts.
11846 * src/state.h (state_number_as_int): Likewise.
11847 * src/tables.c (state_number_to_vector_number,
11848 symbol_number_to_vector_number): Likewise.
11850 * src/gram.h (int_of_rule_number): Remove; no longer used.
11852 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
11853 since the resulting storage is always stored into.
11855 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
11858 * src/muscle_tab.c (muscle_m4_output):
11859 Now inline. Return bool, not int.
11860 * src/state.c (state_compare): Likewise.
11861 * src/symtab.c (symbol_check_defined,
11862 symbol_check_alias_consistency, symbol_pack, symbol_translation,
11863 hash_compare_symbol, hash_symbol):
11865 * src/uniqstr.c (uniqstr_print): Likewise.
11866 * src/muscle_tab.c (muscle_m4_output_processor):
11867 New function, to avoid casts.
11868 * src/state.c (state_comparator, stage_hasher): Likewise.
11869 * src/symtab.c (symbol_check_defined_processor,
11870 symbol_check_alias_consistency_processor, symbol_pack_processor,
11871 symbol_translation_processor, hash_symbol_comparator,
11872 hash_symbol_hasher): Likewise.
11873 * src/uniqstr.c (uniqstr_print_processor): Likewise.
11874 * src/muscle_tab.c (muscles_m4_output):
11875 Use new functions instead of casting old functions unportably.
11876 * src/state.c (state_hash_new): Likewise.
11877 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
11878 symbols_token_translations_init):
11880 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
11882 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
11883 var instead of casting to long, to avoid casts.
11884 (prepare_states): Use MALLOC rather than alloca, so that we don't
11885 have to worry about alloca.
11886 * src/state.c (state_hash_lookup): Likewise.
11888 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
11889 local var instead of casting to unsigned char, to avoid casts.
11891 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
11892 STATE_ALLOC): Remove.
11893 (transitions_new, errs_new, reductions_new, state_new): Use malloc
11894 rather than calloc, and use offsetof to avoid allocating slightly
11896 (state_new): Initialize all members.
11898 * src/state.c (state_hash): Use unsigned accumulator, not signed.
11900 * src/symtab.c (symbol_free): Remove; unused.
11901 (symbol_get): Remove cast in lhs of assignment.
11902 (symbols_do): Now static. Accept generic arguments, not
11903 hashing-related ones.
11905 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
11906 (symbol_processor): Remove.
11907 (symbols_do): Remove decl; now static.
11909 * src/system.h (alloca): Remove; decl no longer needed.
11910 (<stddef.h>): Include, for offsetof.
11911 (<inttypes.>, <stdint.h>): Include if available.
11912 (uintptr_t): New type, if system lacks it.
11913 (CALLOC, MALLOC, REALLOC): New macros.
11914 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
11917 * src/tables.c (table_size): Now int, to pacify GCC.
11918 (table_grow, table_ninf_remap): Use signed table size.
11919 (save_row): Don't bother initializing locals when not needed.
11920 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
11921 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
11923 * src/vcg.h: Correct misspellings.
11925 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
11928 * src/getargs.c (getargs): Don't assume EOF == -1.
11930 2002-12-09 Paul Eggert <eggert@twinsun.com>
11932 Change identifier spellings to avoid collisions with names
11933 that are reserved by POSIX.
11935 Don't use names ending in _t, since POSIX reserves them.
11936 For consistency, remove _e and _s endings -- they're weren't
11937 needed to remove ambiguity. All uses changed.
11938 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
11939 turn was just renamed from struniq_t.
11940 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
11941 which in turn was just renamed from struniq_processor_t.
11942 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
11943 in turn was renamed from hash_compare_struniq_t.
11944 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
11945 (state_list): Renamed from state_list_t.
11946 * src/assoc.h (assoc): Renamed from assoc_t.
11947 * src/conflicts.c (enum conflict_resolution): Renamed from
11948 enum conflict_resolution_e.
11949 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
11950 (rule_list): Renamed from rule_list_t.
11951 * src/getargs.h (enum trace): Renamed from enum trace_e.
11952 (enum report): Renamed from enum report_e.
11953 * src/gram.h (item_number): Renamed from item_number_t.
11954 (rule_number): Renamed from rule_number_t.
11955 (struct rule_s): Remove the "rule_s" part; not used.
11956 (rule): Renamed from rule_t.
11957 (rule_filter): Renamed from rule_filter_t.
11958 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
11959 (goto_list): Renamed from goto_list_t.
11960 * src/lalr.h (goto_number): Renamed from goto_number_t.
11961 * src/location.h (location): Renamed from location_t.
11962 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
11963 and moved here from:
11964 * src/muscle_tab.h (muscle_entry_t): here.
11965 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
11966 (rule_list): Renamed from rule_list_t.
11967 * src/print_graph.c (static_graph): Renamed from graph.
11968 * src/reader.h (braced_code): Renamed from braced_code_t.
11969 Remove brace_code_e tag.
11970 * src/relation.h (relation_node): Renamed from relation_node_t.
11971 (relation_nodes): Renamed from relation_nodes_t.
11972 (relation): Renamed from relation_t.
11973 * src/state.h (state_number): Renamed from state_number_t.
11974 (struct state): Renamed from struct state_s.
11975 (state): Renamed from state_t.
11976 (transitions): Renamed from transitions_t. Unused (and
11977 misspelled) transtion_s tag removed.
11978 (errs): Renamed from errs_t. Unused errs_s tag removed.
11979 (reductions): Renamed from reductions_t. Unused tag
11980 reductions_s removed.
11981 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
11982 (struct symbol_list): Renamed from struct symbol_list_s.
11983 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
11984 (struct symbol): Renamed from struct symbol_s.
11985 (symbol): Renamed from symbol_t.
11986 * src/tables.c (vector_number): Renamed from vector_number_t.
11987 (action_number): Renamed from action_t.
11988 * src/tables.h (base_number): Renamed from base_t.
11989 * src/vcg.h (enum color): Renamed from enum color_e.
11990 (enum textmode): Renamed from enum textmode_e.
11991 (enum shape): Renamed from enum shape_e.
11992 (struct colorentry): Renamed from struct colorentry_s.
11993 (struct classname): Renamed from struct classname_s.
11994 (struct infoname): Renamed from struct infoname_s.
11995 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
11996 (enum decision): Renamed from enum decision_e.
11997 (enum orientation): Renamed from enum orientation_e.
11998 (enum alignment): Renamed from enum alignment_e.
11999 (enum arrow_mode): Renamed from enum arrow_mode_e.
12000 (enum crossing_type): Renamed from enum crossing_type_e.
12001 (enum view): Renamed from enum view_e.
12002 (struct node): Renamed from struct node_s.
12003 (node): Renamed from node_t.
12004 (enum linestyle): Renamed from enum linestyle_e.
12005 (enum arrowstyle): Renamed from enum arrowstyle_e.
12006 (struct edge): Renamed from struct edge.
12007 (edge): Renamed from edge_t.
12008 (struct graph): Renamed from struct graph_s.
12009 (graph): Renamed from graph_t.
12010 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
12011 Rename value_t -> value.
12012 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
12013 value_t_as_yystype -> value_as_yystype.
12015 Don't include <errno.h> in the mainstream code, since it
12016 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
12017 * lib/get-errno.c, lib/get-errno.h: New files.
12018 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
12020 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
12021 * src/output.c (output_skeleton): Likewise.
12022 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
12024 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
12026 (handle_action_dollar, handle_action_at): Likewise.
12027 * src/system.h: Do not include <errno.h>.
12028 (TAB_EXT): Renamed from EXT_TAB.
12029 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
12031 Avoid str[a-z]*, since <string.h> reserves that name space.
12032 Change all instances of "struniq" in names to "uniqstr", and
12033 likewise for "STRUNIQ" and "UNIQSTR".
12034 * src/uniqstr.c: Renamed from src/struniq.c.
12035 * src/uniqstr.h: Renamed from src/struniq.h.
12036 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
12037 * src/files.c (strsuffix): Remove; unused.
12038 (concat2): Renamed from stringappend. Now static.
12039 * src/files.h (strsuffix, stringappend): Remove; unused.
12040 * src/parse-gram.y (<chars>): Renamed from <string>.
12041 (<uniqstr>): Renamed from <struniq>.
12042 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
12043 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
12044 (struct graph_s.expand): Renamed from struct graph_s.stretch.
12045 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
12046 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
12047 (N_EXPAND): Renamed from N_STRETCH.
12049 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
12050 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
12051 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
12053 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
12054 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
12055 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
12056 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
12057 (BASE_MAXIMUM): Renamed from BASE_MAX.
12058 (BASE_MINIMUM): Renamed from BASE_MIN.
12059 (ACTION_MAX): Remove; unused.
12060 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
12061 Unnecessary casts removed from above defines.
12064 Fix misspelling in names.
12065 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
12066 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
12070 * lib/timevar.c (timevar_report): Renamed from time_report,
12071 for consistency with other names.
12072 * lib/timevar.h (timevar_report): New decl.
12073 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
12076 Sort include-file uses.
12078 Reorder all include files under src to be in the order "system.h".
12079 then the ../lib include files in angle brackets (alphabetized),
12080 then the . include files in double-quotes (alphabetized). Fix
12081 dependency breakages encountered in this process, as follows:
12082 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
12083 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
12084 * src/state.h: Include "symtab.h".
12086 2002-12-08 Paul Eggert <eggert@twinsun.com>
12088 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
12089 since this causes problems when __file__ contains character
12090 sequences like "@" that are treated specially by src/scan-skel.l.
12091 Instead, just use the file's basename. This fixes the bug
12092 reported by Martin Mokrejs in
12093 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
12095 2002-12-06 Paul Eggert <eggert@twinsun.com>
12097 Add support for rules that do not have trailing semicolons, as
12098 POSIX requires. Improve the quality of locations in Bison
12101 * src/location.c: Include <quotearg.h>.
12102 (empty_location): Now const.
12103 (location_print): New function. Follow the recommendation of the
12104 GNU Coding Standards for locations that span file boundaries.
12105 * src/location.h: Do not include <quotearg.h>; no longer needed.
12106 (boundary): New type.
12107 (location_t): Use it. This allows locations to span file boundaries.
12108 All member uses changed: file -> start.file or end.file (as needed),
12109 first_line -> start.line, first_column -> start.column,
12110 last_line -> end.line, last_column -> end.column.
12111 (equal_boundaries): New function.
12112 (LOCATION_RESET, LOCATION_STEP): Remove.
12113 (LOCATION_PRINT): Remove. All callers changed to use location_print.
12114 (empty_location): Now const.
12115 (location_print): New decl.
12116 * src/parse-gram.y (lloc_default): New function, which handles
12117 empty locations more accurately.
12118 (YYLLOC_DEFAULT): Use it.
12119 (%token COLON): Remove.
12120 (%token ID_COLON): New token.
12122 (declarations, rules): Remove trailing semicolon.
12123 (declaration, rules_or_grammar_declaration):
12124 Allow empty (";") declaration.
12125 (symbol_def): Remove empty actions; no longer needed.
12126 (rules_or_grammar_declaration): Remove trailing semicolon.
12127 (semi_colon.opt): Remove.
12128 * src/reader.h: Include location.h.
12129 (scanner_cursor): New decl.
12130 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
12132 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
12134 (STEP): Remove. No longer needed, now that adjust_location does
12135 the work. All uses removed.
12136 (scanner_cursor): New var.
12137 (adjust_location): Renamed from extend_location. It now sets
12138 *loc and adjusts the scanner cursor. All uses changed.
12139 Don't bother testing for CR.
12140 (handle_syncline): Remove location arg; now updates scanner cursor.
12141 All callers changed.
12142 (unexpected_end_of_file): Now accepts start boundary of token or
12143 comment, not location. All callers changed. Update scanner cursor,
12145 (SC_AFTER_IDENTIFIER): New state.
12146 (context_state): Renamed from c_context. All uses changed.
12147 (id_loc, code_start, token_start): New local vars.
12148 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
12149 processing of Yacc white space and equivalents here.
12150 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
12151 instead of returning ID immediately, since we need to search for
12152 a subsequent colon.
12153 (<INITIAL>"'", "\""): Save token_start.
12154 (<INITIAL>"%{", "{", "%%"): Save code_start.
12155 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
12156 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
12157 BEGIN context_state at end, not INITIAL.
12158 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
12159 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
12160 Return correct token start.
12161 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
12162 the start of a character, string or multiline comment is found.
12163 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
12164 Reduction): Adjust reported locations to match the more-precise
12165 results now expected.
12166 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
12167 * tests/reduce.at (Useless Rules, Reduced Automaton,
12168 Underivable Rules): Likewise.
12169 * tests/regression.at (Invalid inputs): No longer `expecting ";"
12170 or "|"' now that so many other tokens are allowed by the new grammar.
12172 * src/complain.h (current_file): Remove duplicate decl;
12173 current_file is now owned by files.h.
12174 * src/complain.c, src/scan-gram.l: Include files.h.
12176 2002-12-06 Paul Eggert <eggert@twinsun.com>
12178 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
12179 promotes to int; it might be unsigned int.
12180 * data/yacc.c (yy_reduce_print): Likewise.
12182 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
12183 be #defined in the prologue, not in the Bison declarations.
12184 This fixes Debian Bug 102878, reported by Shaul Karl.
12186 2002-12-02 Paul Eggert <eggert@twinsun.com>
12188 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
12189 * lib/strtoul.c: New file, from gnulib.
12190 This fixes a porting bug reported by Peter Klein in
12191 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
12193 2002-11-30 Paul Eggert <eggert@twinsun.com>
12195 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
12196 and put only a forward declaration in the prologue. This is for
12197 consistency with the other scanner helper functions.
12199 Type clashes now generate warnings, not errors, since it
12200 appears that POSIX may allow some grammars with type clashes.
12201 * src/reader.c (grammar_current_rule_check): Warn about
12202 type clashes instead of complaining.
12203 * tests/input.at (Type Clashes): Expect warnings, not complaints.
12205 Add Yacc library, since POSIX requires it.
12206 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
12207 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
12208 * lib/main.c, lib/yyerror.c: New files.
12210 gram_error can be static; it need not be extern.
12211 * src/reader.h (gram_error): Remove decl.
12212 * src/parse-gram.y (gram_error): Now static. Add static decl.
12213 (print_token_value): Omit parameter names from forward decl,
12216 2002-11-29 Paul Eggert <eggert@twinsun.com>
12218 * doc/bison.texinfo: Emphasize that yylex and yyerror must
12219 be declared before being used. E.g., one should typically
12220 declare them in the prologue. Use GNU coding style in examples.
12221 Put "const" consistently after the type it modifies. Mention
12222 that C99 supports "inline". Mention that yyerror traditionally
12225 %parse-param and %lex-param now take just one argument, the
12226 declaration; the argument name is deduced from the declaration.
12228 * doc/bison.texinfo (Parser Function, Pure Calling, Error
12229 Reporting, Table of Symbols): Document this.
12230 * src/parse-gram.y (add_param): New function.
12232 (declaration): Implement new rule for %parse-param and %lex-param.
12233 * src/scan-gram.l: "," now elicits a warning, rather than being
12234 a token; this is more compatible with byacc.
12235 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
12237 2002-11-27 Paul Eggert <eggert@twinsun.com>
12239 Rename identifiers to avoid real and potential collisions.
12241 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
12242 to avoid collision with lex macro described by Bruce Lilly in
12243 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
12244 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
12245 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
12246 * src/parse-gram.y (print_token_value): Renamed from yyprint.
12248 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
12249 The name "yycontrol" violates the name space rules, and this stuff
12250 wasn't being used anyway.
12251 (input): Remove action; this stuff wasn't being used.
12252 (gram_error): Rename local variable yylloc -> loc.
12253 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
12254 (YY_DECL): Don't use "yy" at start of local variables.
12255 All uses changed, e.g., yylloc -> loc.
12256 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
12257 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
12258 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
12259 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
12261 * src/parse-gram.y (gram_error): loc is now const *.
12262 * src/reader.h (gram_error): Likewise.
12264 2002-11-24 Paul Eggert <eggert@twinsun.com>
12268 * tests/actions.at (Actions after errors): Use an output format
12269 more similar to that of the Printers and Destructors test.
12270 Test the position of the ';' token too.
12271 (Printers and Destructors): Likewise.
12272 (Printers and Destructors: %glr-parser): Remove for now, to avoid
12273 unnecessarily alarming people when the test fails.
12275 * data/yacc.c (yyerrlab1): Move this label down, so that the
12276 parser does not discard the lookahead token if the user code
12277 invokes YYERROR. This change is required for POSIX conformance.
12279 * lib/error.c: Sync with gnulib.
12281 2002-11-22 Paul Eggert <eggert@twinsun.com>
12283 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
12284 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
12285 * lib/xmalloc.c: Likewise.
12287 2002-11-20 Paul Eggert <eggert@twinsun.com>
12289 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
12291 2002-11-20 Paul Eggert <eggert@twinsun.com>
12293 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
12294 should use `if (! x) abort ();' rather than `assert (x);', and
12295 anyway it's one less thing to worry about configuring.
12297 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
12298 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
12299 and replace all instances of assert with abort.
12300 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
12301 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
12303 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
12304 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
12305 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
12306 hash_find_entry, hash_rehash, hash_insert): Likewise.
12307 * src/conflicts.c (resolve_sr_conflict): Likewise.
12308 * src/lalr.c (set_goto_map, map_goto): Likewise.
12309 * src/nullable.c (nullable_compute): Likewise.
12310 * src/output.c (prepare_rules, token_definitions_output): Likewise.
12311 * src/reader.c (packgram, reader): Likewise.
12312 * src/state.c (state_new, state_free, state_transitions_set,
12313 state_reduction_find): Likewise.
12314 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
12315 symbol_pack): Likewise.
12316 * src/tables.c (conflict_row, pack_vector): Likewise.
12317 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
12318 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
12319 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
12320 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
12322 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
12323 (ARGMATCH_CONSTRAINT): New macro.
12324 (ARGMATCH_ASSERT): Use it.
12326 * src/system.h (verify): New macro.
12327 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
12328 rather than assert.
12329 * src/tables.c (tables_generate): Likewise.
12331 * src/struniq.c (struniq_assert): Now returns void, and aborts
12332 if the assertion is false.
12333 (struniq_assert_p): Remove.
12334 * src/struniq.h: Likewise.
12336 2002-11-18 Paul Eggert <eggert@twinsun.com>
12338 * data/glr.c (yygetLRActions): Replace `yyindex' with
12339 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
12340 This fixes the regression with Sun ONE Studio 7 cc that I reported in
12341 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
12343 2002-11-18 Akim Demaille <akim@epita.fr>
12345 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
12347 From Tim Van Holder.
12349 2002-11-17 Paul Eggert <eggert@twinsun.com>
12351 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
12352 to "SyntaxError" for consistency with my 2002-11-15 change.
12354 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
12355 not define to {}, since this breaks the common use of `YYDPRINTF
12356 ((...));' if a single statement is desired (e.g. before `else').
12357 Work around GCC warnings by surrounding corresponding calls with
12359 (yyhasResolvedValue): Remove unused function.
12360 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
12362 (yyreportSyntaxError): Renamed from yyreportParseError.
12363 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
12365 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
12366 extern when possible. Remove unused initializations.
12368 2002-11-16 Akim Demaille <akim@epita.fr>
12370 Augment the similarity between GLR and LALR traces.
12372 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
12373 (YY_REDUCE_PRINT): New.
12374 (yyparse): Use them.
12375 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
12377 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
12378 state reached after the reduction/recovery, since...
12379 (yyparse, yyprocessOneStack): Report the state we are entering in.
12381 2002-11-16 Akim Demaille <akim@epita.fr>
12383 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
12384 Add support for --trace=skeleton.
12385 * src/scan-skel.l: %option debug.
12386 Scan strings of non-@ or \n instead of character by character.
12387 (scan_skel): Handle trace_skeleton.
12389 (@output_parser_name@, @output_header_name@): ``Restore'' their
12390 support (used to be M4 macros).
12391 * data/yacc.c: Quote larger chunks, a la glr.c.
12392 * data/lalr1.cc: Likewise.
12393 The header guards are no longer available, so use some other
12394 string than `YYLSP_NEEDED'.
12396 2002-11-16 Akim Demaille <akim@epita.fr>
12398 Make the ``Printers and Destructors'' test more verbose, taking
12399 `yacc.c''s behavior as (possibly wrong) reference.
12401 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
12402 instead of fprint on stdout.
12403 Set and report the last_line of the symbols.
12404 Consistently display values and locations.
12406 2002-11-16 Paul Eggert <eggert@twinsun.com>
12408 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
12410 2002-11-15 Paul Eggert <eggert@twinsun.com>
12412 * tests/actions.at (Actions after errors): New test case.
12414 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
12415 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
12416 tests/action.at, tests/calc.at, tests/conflicts.at,
12417 tests/cxx-type.at, tests/regression.at:
12418 "parse error" -> "syntax error" for POSIX compatibility.
12419 "parsing stack overflow..." -> "parser stack overflow" so
12420 that code matches Bison documentation.
12422 2002-11-15 Akim Demaille <akim@epita.fr>
12424 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
12425 take two BRACED_CODE, not two string_content.
12426 Free the scanner's obstack when we are done.
12427 (code_content): New.
12428 * tests/calc.at: Adjust.
12429 * doc/bison.texinfo: Adjust.
12430 Also, make sure to include the `,' for these declarations.
12432 2002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
12434 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
12435 definition; avoids potential autoreconf problems.
12437 2002-11-15 Akim Demaille <akim@epita.fr>
12439 Always check the value returned by yyparse.
12441 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
12442 returned by yyparse.
12443 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
12445 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
12446 returned by yyparse.
12448 2002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12450 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
12453 2002-11-14 Paul Eggert <eggert@twinsun.com>
12455 * src/output.c (output_skeleton): Call xfopen instead of
12456 duplicating xfopen's body.
12458 Fix bugs reported by Nelson H. F. Beebe in
12459 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
12461 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
12462 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
12463 Group compiler. Instead, use "$CC -E bar.c". Include the .h
12464 file twice in the grammar, as an extra check.
12466 * tests/input.at (Torturing the Scanner): Surround the
12467 backslash-newline tests with "#if 0", to make it less likely that
12468 we'll run into compiler bugs. Bring back solitary \ inside
12469 comment, but add a closing comment to work around HP C bug. Don't
12470 test backslash-newline in C character constant.
12472 2002-11-14 Akim Demaille <akim@epita.fr>
12474 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
12475 status of the compiler.
12476 Calling `exit 1' is no longer needed.
12477 Reported by Nelson H. F. Beebe.
12479 2002-11-14 Akim Demaille <akim@epita.fr>
12481 * tests/atlocal.in (CPPFLAGS): We have config.h.
12482 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
12484 * tests/actions.at, tests/calc.at, tests/conflicts.at,
12485 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
12486 * tests/regression.at, tests/torture.at: Use them for all the
12487 grammars that are to be compiled.
12488 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
12489 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
12490 * doc/bison.texinfo (GLR Parsers): Document `inline'.
12492 2002-11-14 Akim Demaille <akim@epita.fr>
12494 * doc/bison.texinfo: Various formatting changes (alignments in
12495 samples, additional @group/@end group, GCS in samples.
12496 Use @deffn instead of simple @table to define the directives,
12497 macros, variables etc.
12499 2002-11-13 Paul Eggert <eggert@twinsun.com>
12501 Fix some bugs reported by Albert Chin-A-Young in
12502 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
12504 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
12505 -o c"; the HP C compiler chatters during compilation.
12506 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
12507 * tests/headers.at (export YYLTYPE): Likewise.
12509 * tests/input.at (Torturing the Scanner): Remove lines containing
12510 solitary backslashes, as they tickle a bug in the HP C compiler.
12512 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
12513 comments, since they're not portable. Use GNU coding style.
12515 2002-11-13 Akim Demaille <akim@epita.fr>
12517 * data/yacc.c: Leave bigger chunks of quoted text.
12518 (YYDSYMPRINTF): New.
12519 Use it to report symbol activities.
12520 * data/glr.c (YYDSYMPRINTF): New.
12523 2002-11-12 Paul Eggert <eggert@twinsun.com>
12527 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
12528 (yyglrReduce): Return yyok, not 0.
12529 This should avoid the enumerated-type warnings reported
12530 by Nelson H. F. Beebe in
12531 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
12533 * lib/bbitset.h (BITSET_INLINE): Remove.
12534 * lib/bitset.h [! BITSET_INLINE]: Remove.
12535 (bitset_set, bitset_reset, bitset_test): Rename local vars
12536 to avoid shadowing warnings by GCC.
12538 * data/glr.c (inline): Remove #define. It's the user's
12539 responsibility to #define it away, just like 'const'.
12540 This fixes one of the bugs reported by Nelson H. F. Beebe in
12541 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
12543 * Makefile.maint (po-check): Scan .l and .y files instead of the
12544 .c and the .h files that they generate. This fixes the bug
12545 reported by Tim Van Holder in:
12546 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
12547 Look for N_ as well as for _. Try to avoid matching #define for
12549 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
12550 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
12551 * src/scan-gram.l: Revamp regular expressions so that " and '
12552 do not confuse xgettext.
12554 * src/struniq.h (struniq_new): Do not declare the return type
12555 to be 'const'; this violates the C standard.
12556 * src/struniq.c (struniq_new): Likewise.
12558 2002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
12560 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
12561 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
12564 2002-11-12 Akim Demaille <akim@epita.fr>
12566 * Makefile.maint: Sync with Autoconf:
12567 (local_updates): New.
12569 2002-11-12 Akim Demaille <akim@epita.fr>
12571 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
12573 2002-11-12 Akim Demaille <akim@epita.fr>
12575 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
12578 2002-11-12 Akim Demaille <akim@epita.fr>
12580 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
12583 2002-11-12 Akim Demaille <akim@epita.fr>
12585 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
12586 Use it to test the GLR parser.
12588 2002-11-12 Akim Demaille <akim@epita.fr>
12590 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
12592 * data/glr.c (yystos): New.
12593 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
12594 (YYDSYMPRINT): New.
12595 (yyval): Don't define it, it is handled via M4.
12596 (yyrecoverParseError): Free verbosely the discarded symbols.
12597 * data/yacc.c (yysymprint): Remove, rather...
12598 (b4_yysymprint_generate): invoke.
12599 * data/c.m4 (b4_yysymprint_generate): New.
12600 Accept pointers as arguments, as opposed to the version from
12602 (b4_yydestruct_generate): Likewise.
12603 * tests/cations.at (Printers and Destructors): Use Bison directives
12604 instead of CPP macros.
12605 Don't rely on internal details.
12607 2002-11-12 Akim Demaille <akim@epita.fr>
12609 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
12610 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
12611 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
12612 it against YYEMPTY and so forth), work on yytoken (i.e., set
12613 it to YYEMPTY etc.).
12614 (yydestruct): Replace with a b4_yydestruct_generate invocation.
12615 (b4_symbol_actions): Remove.
12616 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
12617 for 0, end-of-input.
12619 2002-11-12 Akim Demaille <akim@epita.fr>
12621 * doc/bison.texinfo (Destructor Decl): New.
12623 2002-11-12 Akim Demaille <akim@epita.fr>
12625 * src/tables.c (tables_generate): Use free for pointers that
12626 cannot be NULL, not XFREE.
12627 (pack_vector): Use assert, not fatal, for bound violations.
12628 * src/state.c (state_new): Likewise.
12629 * src/reader.c (reader): Likewise.
12630 * src/lalr.c (set_goto_map): Likewise.
12631 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
12634 2002-11-12 Akim Demaille <akim@epita.fr>
12636 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
12638 * src/scan-gram.l (last_string): Is global to the file, not to
12640 * src/parse-gram.y (input): Don't append the epilogue here,
12641 (epilogue.opt): do it here, and free the scanner's obstack.
12642 * src/reader.c (epilogue_set): Rename as...
12643 (epilogue_augment): this.
12644 * data/c.m4 (b4_epilogue): Defaults to empty.
12646 2002-11-12 Akim Demaille <akim@epita.fr>
12648 * src/getargs.c (long_options): Remove duplicates.
12649 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
12651 * doc/bison.rnh: Remove.
12652 * doc/bison.texinfo (VMS Invocation): Remove.
12654 2002-11-12 Akim Demaille <akim@epita.fr>
12656 * src/struniq.h, src/struniq.c (struniq_t): Is const.
12657 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
12659 Use struniq for symbols.
12661 * src/symtab.h (symbol_t): The tag member is a struniq.
12662 (symbol_type_set): Adjust.
12663 * src/symtab.c (symbol_new): Takes a struniq.
12664 (symbol_free): Don't free the tag member.
12665 (hash_compare_symbol_t, hash_symbol_t): Rename as...
12666 (hash_compare_symbol, hash_symbol): these.
12667 Use the fact that tags as struniqs.
12668 (symbol_get): Use struniq_new.
12669 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
12671 * src/reader.h (merger_list, grammar_currentmerge_set): The name
12672 and type members are struniqs.
12673 * src/reader.c (get_merge_function)
12674 (grammar_current_rule_merge_set): Adjust.
12675 (TYPE, current_type): Are struniq.
12677 Use struniq for file names.
12679 * src/files.h, src/files.c (infile): Split into...
12680 (grammar_file, current_file): these.
12681 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
12682 * src/reduce.c (reduce_print): Likewise.
12683 * src/getargs.c (getargs): Likewise.
12684 * src/complain.h, src/complain.c: Likewise.
12685 * src/main.c (main): Call struniqs_new early enough to use it for
12687 Don't free the input file name.
12689 2002-11-12 Akim Demaille <akim@epita.fr>
12691 * src/symtab.c (symbol_free): Remove dead deactivated code:
12692 type_name are properly removed.
12693 Don't use XFREE to free items that cannot be NULL.
12694 * src/struniq.h, src/struniq.c: New.
12695 * src/main.c (main): Initialize/free struniqs.
12696 * src/parse-gram.y (%union): Add astruniq member.
12698 * src/scan-gram.l (<{tag}>): Return a struniq.
12699 Free the obstack bit that used to store it.
12700 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
12702 2002-11-11 Paul Eggert <eggert@twinsun.com>
12704 Revamp to fix many (but not all) of the C- and M4-related quoting
12705 problems. Among other things, this fixes the Bison bug reported
12706 by Jan Hubicka when processing the Bash grammar; see:
12707 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
12709 Use new @ escapes consistently. Represent brackets with @{ and @}
12710 rather than @<:@ and @:>@, since this works a bit better with dumb
12711 editors like vi. Represent @ with @@, since @ is now consistently
12712 an escape. Use @oline@ and @ofile@ rather than __oline__ and
12713 __ofile__, to avoid unexpected expansions. Similarly, use @output
12714 rather than #output.
12716 * data/c.m4 (b4_copyright): Omit file name from comment, since
12717 the file name could contain "*/".
12718 (b4_synclines_flag): Don't quote the 2nd argument; it should already
12719 be quoted. All uses changed.
12721 * data/glr.c: Use new @ escapes consistently.
12722 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
12723 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
12724 Remove, since they couldn't handle arbitrary characters in file
12726 * data/lalr1.cc: Likewise.
12727 * data/yacc.c: Likewise.
12729 * src/files.c (output_infix): Remove; all uses removed.
12730 * src/files.h: Likewise.
12732 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
12733 mishandled funny characters in file names, and anyway it isn't
12735 * data/yacc.c: Likewise.
12736 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
12738 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
12739 * data/yacc.c: Likewise.
12741 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
12743 (muscle_init): Quote filename as a C string.
12744 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
12745 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
12746 * src/output.c (escaped_file_name_output): New function.
12747 (prepare_symbols): Quote tokens for M4.
12748 (prepare): Don't insert output_infix, output_prefix,
12749 output_parser_name, output_header_name; this is now down by scan-skel.
12750 Insert skeleton as a C string.
12752 * src/output.c (user_actions_output, symbol_destructors_output,
12753 symbol_printers_output): Quote filenames for C and M4.
12754 * src/reader.c (prologue_augment, epilogue_set): Likewise.
12756 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
12757 escapes other than \\ and \'; this simplifies the code.
12758 (<SC_STRING>): Likewise, for \\ and \".
12759 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
12760 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
12761 Use new escapes @{ and @} for [ and ].
12763 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
12764 them with auto vars.
12765 Switch to new escape scheme, where @ is the escape character uniformly.
12766 Abort if a stray escape character is found. Avoid unbounded input
12767 buffer when parsing non-escaped text.
12769 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
12770 __oline__, #output, $@, and @{ do not have unintended meanings.
12772 2002-11-09 Paul Eggert <eggert@twinsun.com>
12774 Fix the test failure due to GCC warnings described in
12775 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
12776 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
12777 evaluate to 0 if it's impossible for NINF to be in the respective
12779 (yygetLRActions, yyrecoverParseError): Use them.
12781 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
12782 counted in the token inserted at end of file. Now takes
12783 location_t *, not location_t, so that the location can be
12784 adjusted. All uses changed.
12786 * tests/regression.at (Invalid inputs): Adjust wording in
12787 diagnostic to match the new behavior.
12789 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
12790 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
12791 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
12792 abort ();'. This reduces the runtime of the "Many lookaheads"
12793 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
12796 2002-11-07 Paul Eggert <eggert@twinsun.com>
12798 * src/parse-gram.y (CHARACTER): Remove unused token.
12801 * src/scan-gram.l: Remove stack option. We no longer use the
12802 stack, since the stack was never deeper than 1; instead, use the
12803 new auto var c_context to record the stacked value.
12805 Remove nounput option. At an unexpected end of file, we now unput
12806 the minimal input necessary to end cleanly; this simplifies the
12809 Avoid unbounded token sizes where this is easy.
12811 (unexpected_end_of_file): New function.
12812 Use it to systematize the error message on unexpected EOF.
12813 (last-string): Now auto, not static.
12814 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
12815 (scanner_last_string_free): Remove; not used.
12816 (percent_percent_count): Move decl to just before use.
12817 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
12818 not the (never otherwised-used) CHARACTER.
12820 2002-11-07 Akim Demaille <akim@epita.fr>
12822 Let yyerror always receive the msg as last argument, so that
12823 yyerror can be variadic.
12825 * data/yacc.c (b4_yyerror_args): New.
12826 Use it when calling yyerror.
12827 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
12828 Use it when calling yyerror.
12829 * doc/bison.texinfo (Error Reporting): Adjust.
12830 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
12831 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
12833 2002-11-06 Akim Demaille <akim@epita.fr>
12835 #line should have quoted strings.
12836 Ideally, this should be done by m4_quotearg.
12838 * src/scan-skel.l: Include quotearg.h.
12840 * src/output.c (symbol_printers_output)
12841 (symbol_destructors_output): Quote the file name.
12843 2002-11-06 Akim Demaille <akim@epita.fr>
12845 * tests/regression.at (Invalid inputs): Adjust to the recent
12848 2002-11-06 Akim Demaille <akim@epita.fr>
12850 Restore --no-lines.
12851 Reported by Jim Kent.
12853 * data/c.m4 (b4_syncline): New.
12854 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
12855 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
12856 * src/output.c (user_actions_output): Likewise.
12857 (prepare): Define 'b4_synclines_flag'.
12858 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
12860 2002-11-06 Akim Demaille <akim@epita.fr>
12862 * src/main.c (main): Free `infile'.
12863 * src/scan-gram.l (handle_syncline): New.
12865 * src/output.c (user_actions_output, symbol_destructors_output)
12866 (symbol_printers_output): Use the location's file name, not
12868 * src/reader.c (prologue_augment, epilogue_set): Likewise.
12870 2002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12872 * src/tables.c (matching_state): Don't allow states to match if
12873 either has GLR conflict entries.
12875 2002-11-05 Paul Eggert <eggert@twinsun.com>
12877 * src/scan-gram.l: Use more accurate diagnostics, e.g.
12878 "integer out of range" rather than "invalid value".
12879 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
12882 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
12883 Also, remove one static variable in the scanner.
12885 * src/scan-gram.l (braces_level): Now auto, not static.
12886 Initialize to zero if the compiler is being picky.
12887 (INITIAL): Clear braces_level instead of incrementing it.
12888 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
12889 as POSIX 1003.1-2001 requires.
12890 * src/system.h (IF_LINT): New macro, taken from coreutils.
12891 * configure.ac: Define "lint" if --enable-gcc-warnings.
12893 2002-11-05 Akim Demaille <akim@epita.fr>
12895 * src/scan-gram.l: When it starts with `%', complain about the
12896 whole directive, not just that `invalid character: %'.
12898 2002-11-04 Akim Demaille <akim@epita.fr>
12900 * Makefile.maint: Update from Autoconf.
12901 (update, cvs-update, po-update, do-po-update): New.
12903 2002-11-04 Akim Demaille <akim@epita.fr>
12905 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
12907 Have yyerror `use' its arguments.
12908 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
12909 returns true when location & yacc & pure & parse-param.
12910 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
12912 2002-11-04 Akim Demaille <akim@epita.fr>
12914 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
12916 * src/scan-gram.l: Use [\'] instead of ['] to pacify
12919 Use quote, not quote_n since LOCATION_PRINT no longer uses the
12922 2002-11-03 Paul Eggert <eggert@twinsun.com>
12924 * src/reader.c (get_merge_function, grammar_current_rule_check):
12925 Use consistent diagnostics for reporting type name clashes.
12926 Quote the types with <>, for consistency with Yacc.
12927 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
12929 2002-11-03 Akim Demaille <akim@epita.fr>
12931 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
12933 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
12934 (b4_parse_param): Remove.
12935 Use b4_identification.
12936 Propagate b4_pure_args where needed to pass them to yyerror.
12937 * data/glr.m4 (b4_parse_param): Remove.
12938 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
12939 (b4_lpure_formals): New.
12940 Use b4_identification.
12941 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
12942 b4_user_formals and b4_user_args.
12943 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
12944 (yyreportAmbiguity): When using a pure parser, also need
12945 the location, and the parse-params.
12947 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
12948 When using a pure parser, also need the parse-params.
12950 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
12951 (%pure-parser + %parse-param) LALR and GLR parsers.
12952 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
12953 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
12954 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
12955 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
12956 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
12957 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
12958 * doc/bison.texinfo: Untabify the whole file.
12959 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
12960 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
12961 (Error Reporting): Adjust to these new directives.
12962 Document %error-verbose, deprecate YYERROR_VERBOSE.
12964 2002-11-03 Akim Demaille <akim@epita.fr>
12966 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
12967 AT_CHECK_CALC_GLR invocations to use % directives, instead of
12968 command line options.
12969 * tests/cxx-type.at: Formatting changes.
12971 2002-11-03 Paul Eggert <eggert@twinsun.com>
12973 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
12974 to count columns correctly, and to check for invalid inputs.
12976 Use mbsnwidth to count columns correctly. Account for tabs, too.
12977 Include mbswidth.h.
12978 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
12979 (extend_location): New function.
12980 (YY_LINES): Remove.
12982 Handle CRLF in C code rather than in Lex code.
12983 (YY_INPUT): New macro.
12984 (no_cr_read): New function.
12986 Scan UCNs, even though we don't fully handle them yet.
12987 (convert_ucn_to_byte): New function.
12989 Handle backslash-newline correctly in C code.
12990 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
12991 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
12993 (tag, splice): New EREs. Do not allow NUL or newline in tags.
12994 Use {splice} wherever C allows backslash-newline.
12995 YY_STEP after space, newline, vertical-tab.
12996 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
12998 (letter, id): Don't assume ASCII; e.g., spell out a-z.
13000 ({int}, handle_action_dollar, handle_action_at): Check for integer
13003 (YY_STEP): Omit trailing semicolon, so that it's more like C.
13005 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
13006 as well as \000. Check for UCHAR_MAX, not 255.
13007 Allow \x with an arbitrary positive number of digits, as in C.
13008 Check for overflow here.
13009 Allow \? and UCNs, for compatibility with C.
13011 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
13012 with quote slot used by complain_at.
13014 * tests/input.at: Add tests for backslash-newline, m4 quotes
13015 in symbols, long literals, and funny escapes in strings.
13017 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
13018 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
13019 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
13020 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
13021 * m4/mbswidth.m4: New file, from GNU coreutils.
13023 * doc/bison.texinfo (Grammar Outline): Document // comments.
13024 (Symbols): Document that trigraphs have no special meaning in Bison,
13025 nor is backslash-newline allowed.
13026 (Actions): Document that trigraphs have no special meaning.
13028 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
13031 2002-11-02 Paul Eggert <eggert@twinsun.com>
13033 * src/reader.c: Don't include quote.h; not needed.
13034 (get_merge_function): Reword warning to be consistent with
13035 type clash diagnostic in grammar_current_rule_check.
13037 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
13038 bug in trigraph handling.
13040 * src/output.c (prepare_symbols): When printing token names,
13041 escape "[" as "@<:@" and likewise for "]".
13043 * src/system.h (errno): Remove declaration, as we are now
13044 assuming C89 or better, and C89 guarantees errno.
13046 2002-10-30 Paul Eggert <eggert@twinsun.com>
13048 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
13049 Check for close failures.
13050 * src/files.h (xfclose): Return void, not int, since it always
13052 * src/files.c (xfclose): Likewise. Report I/O error if ferror
13054 * src/output.c (output_skeleton): Use xfclose rather than fclose
13055 and ferror. xfclose now checks ferror.
13057 * data/glr.c (YYLEFTMOST_STATE): Remove.
13058 (yyreportTree): Use a stack-based leftmost state. This avoids
13059 our continuing battles with bogus warnings about initializers.
13061 2002-10-30 Akim Demaille <akim@epita.fr>
13063 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
13066 2002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13068 * tests/glr-regr1.at: New test for reported regressions.
13069 * tests/testsuite.at: Add glr-regr1.at test.
13070 * tests/Makefile.am: Add glr-regr1.at test.
13072 2002-10-24 Paul Eggert <eggert@twinsun.com>
13076 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
13077 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
13078 we use malloc. Don't assume 'A' through 'Z' are contiguous.
13079 Don't assume strdup exists; POSIX says its an XSI extension.
13080 Check for buffer overflow on input.
13082 2002-10-24 Akim Demaille <akim@epita.fr>
13084 * src/output.c (output_skeleton): Don't disable M4sugar comments
13085 too soon: it results in comments being expanded.
13086 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
13089 2002-10-24 Akim Demaille <akim@epita.fr>
13091 * data/yacc.c (m4_int_type): New.
13092 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
13093 char' as only yacc.c wants K&R portability.
13094 * data/glr.c (yysigned_char): Remove.
13095 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
13096 Reported by Quoc Peyrot.
13098 2002-10-23 Paul Eggert <eggert@twinsun.com>
13100 * src/main.c (main): With --trace=time, report times even if a
13101 non-fatal error occurs. Formerly, the times were reported in some
13102 such cases but not in others.
13103 * src/reader.c (reader): Just return if a complaint has been issued,
13104 instead of exiting, so that 'main' can report times.
13106 2002-10-22 Akim Demaille <akim@epita.fr>
13108 * src/system.h: Include sys/types.
13109 Reported by Bert Deknuydt.
13111 2002-10-23 Paul Eggert <eggert@twinsun.com>
13113 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
13114 Suggested by Art Haas.
13116 2002-10-22 Paul Eggert <eggert@twinsun.com>
13118 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
13119 decl; not needed any more.
13120 * src/main.c (main): Use return to exit, undoing yesterday's change.
13121 The last OS that we could find where this wouldn't work is
13122 SunOS 3.5, and that's too old to worry about now.
13124 * data/glr.c (struct yyltype): Define members even when not
13125 doing locations. This is more consistent with yacc.c, and it
13126 works around the following bug reports:
13127 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
13128 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
13130 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
13131 @acronym consistently. Standardize on "Yacc" instead of "YACC",
13132 "Algol" instead of "ALGOL". Give a bit more history about BNF.
13134 2002-10-22 Akim Demaille <akim@epita.fr>
13136 * data/README: New.
13138 2002-10-21 Paul Eggert <eggert@twinsun.com>
13140 Be consistent about 'bool'; the old code used an enum in one
13141 module and an int in another, and this violates the C standard.
13142 * m4/stdbool.m4: New file, from coreutils 4.5.3.
13143 * configure.ac (AC_HEADER_STDBOOL): Add.
13144 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
13145 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
13146 * src/symtab.c (hash_compare_symbol_t): Likewise.
13147 * src/system.h (bool, false, true): Use a definition consistent
13148 with ../lib/hash.c. All uses changed.
13150 * src/complain.c (warning_issued): Renamed from warn_message_count,
13151 so that we needn't worry about integer overflow (!).
13152 Now of type bool. All uses changed.
13153 (complaint_issued): Renamed from complain_message_count; likewise.
13155 * src/main.c (main): Use exit to exit with failure.
13157 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
13158 rather than 1 and 0.
13159 * src/main.c (main): Likewise.
13160 * src/getargs.c (getargs): Likewise.
13161 * src/reader.c (reader): Likewise.
13163 * src/getarg.c (getargs): Remove duplicate code for
13164 "Try `bison --help'".
13166 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
13167 What was that "2" for?
13169 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
13170 * src/getargs.c (usage): Likewise.
13172 * src/getargs.c (getargs): When there are too few operands, report
13173 the last one. When there are too many, report the first extra
13174 one. This is how diffutils does it.
13176 2002-10-20 Paul Eggert <eggert@twinsun.com>
13178 Remove K&R vestiges.
13179 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
13180 * src/complain.c (VA_START): Remove. Assume prototypes.
13181 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
13182 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
13183 fatal): Assume prototypes.
13184 * src/complain.h: Assume prototypes.
13185 * src/system.h (PARAMS): Remove.
13186 Include <limits.h> unconditionally, since it's guaranteeed even
13187 for a freestanding C89 compiler.
13188 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
13189 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
13191 2002-10-20 Akim Demaille <akim@epita.fr>
13193 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
13194 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
13195 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
13196 (yyresolveStates, yyresolveAction, yyresolveStack)
13197 (yyprocessOneStack): Use them.
13198 (yy_reduce_print): New.
13199 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
13201 2002-10-20 Akim Demaille <akim@epita.fr>
13203 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
13204 arguments and output `void'.
13205 (b4_c_function): Rename as...
13206 (b4_c_function_def): this.
13207 (b4_c_function_decl, b4_c_ansi_function_def)
13208 (b4_c_ansi_function_decl): New.
13209 Change the interpretation of the arguments: before `int, foo', now
13211 * data/yacc.c (yyparse): Prototype and define thanks to these.
13212 Adjust b4_c_function_def uses.
13213 * data/glr.c (yyparse): Likewise, but ANSI only.
13215 2002-10-20 Akim Demaille <akim@epita.fr>
13217 * src/output.c (prepare): Move the definition of `tokens_number',
13218 `nterms_number', `undef_token_number', `user_token_number_max'
13220 (prepare_tokens): Here.
13221 (prepare_tokens): Rename as...
13222 (prepare_symbols): this.
13223 (prepare): Move the definition of `rules_number' to...
13224 (prepare_rules): here.
13225 (prepare): Move the definition of `last', `final_state_number',
13226 `states_number' to...
13227 (prepare_states): here.
13228 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
13230 2002-10-20 Akim Demaille <akim@epita.fr>
13232 * src/tables.h, src/tables.c, src/output.c: Comment changes.
13234 2002-10-20 Akim Demaille <akim@epita.fr>
13236 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
13239 2002-10-20 Akim Demaille <akim@epita.fr>
13241 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
13242 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
13244 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
13246 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
13247 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
13250 2002-10-19 Paul Eggert <eggert@twinsun.com>
13252 Do not create a temporary file, as that involves security and
13253 cleanup headaches. Instead, use a pair of pipes.
13254 Derived from a suggestion by Florian Krohm.
13255 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
13256 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
13257 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
13258 (BISON_PREREQ_SUBPIPE): Add.
13259 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
13260 Add subpipe.h, subpipe.c.
13261 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
13262 * po/POTFILES.in: Add lib/subpipe.c.
13263 * src/output.c: Include "subpipe.h".
13264 (m4_invoke): Remove decl.
13265 (scan_skel): New decl.
13266 (output_skeleton): Use pipe rather than temporary file for m4 input.
13267 Check that m4sugar.m4 is readable, to avoid deadlock.
13268 Check for pipe I/O error.
13269 * src/scan-skel.l (readpipe): Remove decl.
13270 (scan_skel): New function, to be used in place of m4_invoke.
13271 Read from stream rather than file.
13273 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
13274 float, as this generates a warning on Solaris 8 + GCC 3.2 with
13275 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
13276 this generates a more-accurate value anyway.
13278 * lib/timevar.c (timervar_accumulate): Rename locals to
13279 avoid confusion with similarly-named more-global.
13280 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
13282 * src/output.c (prepare): Use xstrdup to convert char const *
13283 to char *, to avoid GCC warning.
13285 2002-10-19 Akim Demaille <akim@epita.fr>
13287 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
13288 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
13289 Use them to have `calc.y' ready for %pure-parser.
13290 * data/yacc.c (YYLEX): Pass a yylex return type to
13291 b4_c_function_call.
13293 2002-10-19 Akim Demaille <akim@epita.fr>
13295 Prototype support of %lex-param and %parse-param.
13297 * src/parse-gram.y: Add the definition of the %lex-param and
13298 %parse-param tokens, plus their rules.
13299 Drop the `_' version of %glr-parser.
13301 * src/scan-gram.l (INITIAL): Scan them.
13302 * src/muscle_tab.c: Comment changes.
13303 (muscle_insert, muscle_find): Rename `pair' as `probe'.
13304 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
13305 (muscle_entry_s): The `value' member is no longer const.
13306 Adjust all dependencies.
13307 * src/muscle_tab.c (muscle_init): Adjust: use
13308 MUSCLE_INSERT_STRING.
13309 Initialize the obstack earlier.
13310 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
13311 (muscle_pair_list_grow): New.
13312 * data/c.m4 (b4_c_function_call, b4_c_args): New.
13313 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
13314 * tests/calc.at: Use %locations, not --locations.
13315 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
13317 2002-10-19 Akim Demaille <akim@epita.fr>
13319 * src/getargs.c (usage): Take status as argument and exit
13321 Report the traditional `Try ... --help' message when status != 0.
13322 (usage, version): Don't take a FILE * as arg, it is pointless.
13323 (getargs): When there is an incorrect number of arguments, make it
13324 an error, and report it GNUlically thanks to `usage ()'.
13326 2002-10-18 Paul Eggert <eggert@twinsun.com>
13328 * data/glr.c (yyreportParseError): Don't assume that sprintf
13329 yields the length of the printed string, as this is not true
13330 on SunOS 4.1.4. Reported by Peter Klein.
13332 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
13333 * tests/conflicts.at (%nonassoc and eof): Likewise.
13334 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
13336 2002-10-17 Akim Demaille <akim@epita.fr>
13338 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
13339 * src/getargs.c (trace_types, trace_args): Adjust.
13340 * src/reader.c (grammar_current_rule_prec_set)
13341 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
13342 Standardize error messages.
13343 And s/@prec/%prec/!
13344 (reader): Use trace_flag to enable scanner/parser debugging,
13345 instead of an adhoc scheme.
13346 * src/scan-gram.l: Remove trailing debugging code.
13348 2002-10-16 Paul Eggert <eggert@twinsun.com>
13350 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
13353 * NEWS: Officially drop support for building Bison with K&R C,
13354 since it didn't work anyway and it's not worth worrying about.
13355 * Makefile.maint (wget_files): Remove ansi2knr.c.
13356 (ansi2knr.c-url_prefix): Remove.
13357 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
13358 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
13359 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
13361 2002-10-15 Paul Eggert <eggert@twinsun.com>
13363 Stop using the "enum_" trick for K&R-style function definitions;
13364 it confused me, and I was the author! Instead, assume that people
13365 who want to use K&R C compilers (when using these modules in GCC,
13366 perhaps?) will run ansi2knr.
13368 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
13369 All uses of "enum_" changed to "enum ".
13370 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
13371 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
13373 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
13374 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
13375 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
13376 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
13377 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
13378 abitset_not, abitset_ones, abitset_or, abitset_or_and,
13379 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
13380 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
13381 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
13382 Use function prototypes; this removes the need for declaring
13383 static functions simply to provide their prototypes.
13384 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
13385 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
13386 bitset_count_, bitset_create, bitset_dump, bitset_first,
13387 bitset_free, bitset_init, bitset_last, bitset_next,
13388 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
13389 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
13390 bitset_print, bitset_release_memory, bitset_toggle_,
13391 bitset_type_choose, bitset_type_get, bitset_type_name_get,
13392 debug_bitset): Likewise.
13393 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
13394 * lib/bitset_stats.c (bitset_log_histogram_print,
13395 bitset_percent_histogram_print, bitset_stats_and,
13396 bitset_stats_and_cmp, bitset_stats_and_or,
13397 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
13398 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
13399 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
13400 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
13401 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
13402 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
13403 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
13404 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
13405 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
13406 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
13407 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
13408 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
13409 bitset_stats_zero): Likewise.
13410 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
13411 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
13412 bitsetv_dump, debug_bitsetv): Likewise.
13413 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
13414 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
13415 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
13416 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
13417 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
13418 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
13419 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
13420 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
13421 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
13422 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
13423 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
13425 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
13426 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
13427 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
13428 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
13429 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
13430 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
13431 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
13432 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
13433 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
13434 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
13435 lbitset_xor_cmp, lbitset_zero): Likewise.
13437 2002-10-14 Akim Demaille <akim@epita.fr>
13441 2002-10-14 Akim Demaille <akim@epita.fr>
13443 * tests/Makefile.am (maintainer-check-posix): New.
13445 2002-10-14 Akim Demaille <akim@epita.fr>
13447 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
13450 2002-10-14 Akim Demaille <akim@epita.fr>
13452 * src/tables.c (table_ninf_remap): base -> tab.
13453 Reported by Matt Rosing.
13455 2002-10-14 Paul Eggert <eggert@twinsun.com>
13457 * tests/action.at, tests/calc.at, tests/conflicts.at,
13458 tests/cxx-type.at, tests/headers.at, tests/input.at,
13459 tests/regression.at, tests/synclines.at, tests/torture.at:
13460 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
13461 so that the tests still work even if POSIXLY_CORRECT is set.
13462 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
13464 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
13465 for portability to K&R hosts. Fix typo: signed char is guaranteed
13466 only to 127, not to 128.
13467 * data/glr.c (yysigned_char): New type.
13468 * data/yacc.c (yysigned_char): Likewise.
13469 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
13471 2002-10-13 Paul Eggert <eggert@twinsun.com>
13473 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
13474 true due to limited range of data type" warning from GCC.
13476 * data/c.m4 (b4_token_defines): Protect against double-inclusion
13477 by wrapping enum yytokentype's definition inside #ifndef
13478 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
13480 2002-10-13 Akim Demaille <akim@epita.fr>
13482 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
13483 Un yy- yyrhs to avoid the name clash with the global YYRHS.
13485 2002-10-13 Akim Demaille <akim@epita.fr>
13487 * Makefile.maint: Update from Autoconf 2.54.
13488 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
13490 2002-10-13 Akim Demaille <akim@epita.fr>
13492 * src/print.c (print_state): Separate the list of solved conflicts
13493 from the other items.
13494 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
13496 2002-10-13 Akim Demaille <akim@epita.fr>
13498 Let nondeterministic skeletons be usable with deterministic
13501 With the patch, GAWK compiled by GCC without -O2 passes its test
13502 suite using a GLR parser driven by LALR tables. It fails with -O2
13503 because `struct stat' gives two different answers on my machine:
13504 88 (definition of an auto var) and later 96 (memset on this var).
13505 Hence the stack is badly corrumpted. The headers inclusion is to
13506 blame: if I move the awk.h inclusion before GLR's system header
13507 inclusion, the two struct stat have the same size.
13509 * src/tables.c (pack_table): Always create conflict_table.
13510 (token_actions): Always create conflict_list.
13511 * data/glr.c (YYFLAG): Remove, unused.
13513 2002-10-13 Akim Demaille <akim@epita.fr>
13515 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
13517 (VALGRIND, GXX): New.
13518 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
13519 * tests/bison.in: Run $PREBISON a pre-command.
13520 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
13521 (maintainer-check-g++): New.
13522 * Makefile.am (maintainer-check): New.
13524 2002-10-13 Akim Demaille <akim@epita.fr>
13526 * data/glr.c: Formatting changes.
13527 Tweak some trace messages to match yacc.c's.
13529 2002-10-13 Akim Demaille <akim@epita.fr>
13531 GLR parsers sometimes raise parse errors instead of performing the
13533 Reported by Charles-Henry de Boysson.
13535 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
13536 check the length of the traces when %glr.
13537 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
13539 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
13541 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
13542 (yyltype): Remove the yy prefix from the member names.
13543 (yytable): Complete its comment.
13544 (yygetLRActions): Map error action number from YYTABLE from
13546 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
13547 (which was a bug: it should have been YYTABEL_NINF, and yet it was
13548 not satisfying as we could compare an YYACTION computed from
13549 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
13550 only value for error actions.
13551 (yyreportParseError): In verbose parse error messages, don't issue
13552 `error' in the list of expected tokens.
13553 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
13554 next action to perform to match glr.c's decoding.
13555 (yytable): Complete its comment.
13557 2002-10-13 Paul Eggert <eggert@twinsun.com>
13559 Fix problem reported by Henrik Grubbstroem in
13560 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
13561 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
13562 because the Bison parser reads the second action before reducing
13564 * src/scan-gram.l (rule_length): New static var.
13565 Use it to keep track of the rule length in the scanner, since
13566 we can't expect the parser to be in lock-step sync with the scanner.
13567 (handle_action_dollar, handle_action_at): Use this var.
13568 * tests/actions.at (Exotic Dollars): Test for the problem.
13570 2002-10-12 Paul Eggert <eggert@twinsun.com>
13572 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
13573 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
13574 Include <sys/time.h> when checking for clock_t and struct tms.
13575 Use same include order as source.
13576 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
13577 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
13579 * lib/timevar.c: Update copyright date and clarify comments.
13580 (get_time) [IN_GCC]: Keep the GCC version for reference.
13582 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
13583 GCC version as of today, then merge Bison's changes.
13584 Change "GCC" to "Bison" in copyright notice. timevar.def's
13585 author is Akim, so change that too.
13587 * src/reader.c (grammar_current_rule_check):
13588 Don't worry about the default action if $$ is untyped.
13589 Prevents bogus warnings reported by Jim Gifford in
13590 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
13592 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
13593 * data/glr.c, data/lalr1.cc, data/yacc.c:
13594 Output token definitions before the first part of user declarations.
13595 Fixes compatibility problem reported by Jim Gifford for kbd in
13596 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
13598 2002-10-11 Paul Eggert <eggert@twinsun.com>
13600 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
13601 (yyparse): here. This undoes some of the 2002-07-25 change.
13602 Compatibility problem reported by Ralf S. Engelschall with
13603 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
13605 2002-10-11 Akim Demaille <akim@epita.fr>
13607 * tests/regression.at Characters Escapes): New.
13608 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
13610 Reported by Jan Nieuwenhuizen.
13612 2002-10-11 Akim Demaille <akim@epita.fr>
13616 2002-10-10 Paul Eggert <eggert@twinsun.com>
13618 Portability fixes for bitsets; this also avoids several GCC
13621 * lib/abitset.c: Include <stddef.h>, for offsetof.
13622 * lib/lbitset.c: Likewise.
13624 * lib/abitset.c (abitset_bytes): Return a size that is aligned
13625 properly for vectors of objects. Do not assume that adding a
13626 header size to a multiple of a word size yields a value that is
13627 properly aligned for the whole union.
13628 * lib/bitsetv.c (bitsetv_alloc): Likewise.
13630 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
13631 unique names for structures.
13632 * lib/ebitset.c (ebitset_bytes): Likewise.
13633 * lib/lbitset.c (lbitset_bytes): Likewise.
13635 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
13636 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
13637 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
13638 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
13639 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
13640 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
13641 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
13642 to improve the type-checking that GCC can do.
13643 * lib/bitset.c (bitset_op4_cmp): Likewise.
13644 * lib/bitset_stats.c (bitset_stats_count,
13645 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
13646 bitset_stats_copy, bitset_stats_disjoint_p,
13647 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
13648 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
13649 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
13650 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
13651 bitset_stats_and_or_cmp, bitset_stats_andn_or,
13652 bitset_stats_andn_or_cmp, bitset_stats_or_and,
13653 bitset_stats_or_and_cmp): Likewise.
13654 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
13655 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
13656 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
13657 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
13659 * lib/abitset.h: Include bitset.h, not bbitset.h.
13660 * lib/ebitset.h: Likewise.
13661 * lib/lbitset.h: Likewise.
13663 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
13664 All instances of parameters of type enum bitset_opts are now of
13665 type enum_bitset_opts, to conform to the C Standard, and similarly
13666 for enum_bitset_type.
13667 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
13668 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
13670 Do not use "struct bitset_struct" to mean different things in
13671 different modules. Not only is this confusing, it violates
13672 the C Standard, which requires that structure types in different
13673 modules must be compatible if one is to be passed to the other.
13674 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
13675 All instances of "struct bitset_struct *" replaced with "bitset".
13676 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
13677 (union bitset_union, struct abitset_struct, struct ebitset_struct,
13678 struct lbitset_struct, struct bitset_stats_struct): New types.
13679 All uses of struct bitset_struct changed to union bitset_union,
13681 * lib/abitset.c (struct abitset_struct, abitset,
13682 struct bitset_struct): Remove.
13683 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
13684 struct bitset_struct): Remove.
13685 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
13686 bitset_struct): Remove.
13687 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
13690 Do not call a function of type T using a call that assumes the
13691 function is of a different type U. Standard C requires that a
13692 function must be called with a type that is compatible with its
13694 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
13696 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
13698 * lib/ebitset.c (PFV): Remove.
13699 * lib/lbitset.c (PFV): Likewise.
13700 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
13701 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
13703 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
13704 (ebitset_vtable): Use them.
13705 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
13706 lbitset_xor): New functions.
13707 (lbitset_vtable): Use them.
13709 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
13712 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
13714 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
13715 Use offsetof, for simplicity.
13717 2002-10-06 Paul Eggert <eggert@twinsun.com>
13719 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
13720 the same width as int. This reapplies a hunk of the 2002-08-12 patch
13721 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
13722 which was inadvertently undone by the 2002-09-30 patch.
13723 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
13724 the same width as int.
13726 2002-10-04 Paul Eggert <eggert@twinsun.com>
13730 * configure.ac (AC_INIT), NEWS: Increment version number.
13732 * doc/bison.texinfo: Minor spelling, grammar, and white space
13734 (Symbols): Mention that any negative value returned from yylex
13735 signifies end-of-input. Warn about negative chars. Mention
13736 the portable Standard C character set.
13738 The GNU coding standard says CFLAGS and YFLAGS are reserved
13739 for the installer to set.
13740 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
13741 * src/Makefile.am (AM_CFLAGS): Likewise.
13742 (AM_YFLAGS): Renamed from YFLAGS.
13744 Fix some MAX and MIN problems.
13745 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
13746 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
13747 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
13748 * src/reader.c (reader): Use it.
13750 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
13751 POSIX 1003.1-2001 has removed fgrep.
13753 2002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
13755 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
13756 interpreted as signed.
13757 * lib/ebitset.c (ebitset_list): Fix bug.
13759 2002-10-01 Paul Eggert <eggert@twinsun.com>
13761 More fixes for 64-bit hosts and large bitsets.
13763 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
13764 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
13765 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
13766 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
13767 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
13768 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
13769 bitset_count_): Likewise.
13770 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
13771 bitset_first, bitset_last): Likewise.
13772 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
13773 bitset_stats_list_reverse, bitset_stats_size,
13774 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
13776 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
13777 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
13778 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
13779 bitsetv_reflexive_transitive_closure): Likewise.
13780 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
13781 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
13783 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
13786 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
13787 Use size_t, not unsigned int, to count bytes.
13788 * lib/abitset.h (abitset_bytes): Likewise.
13789 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
13791 * lib/bitset.h (bitset_bytes): Likewise.
13792 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
13793 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
13794 * lib/bitsetv.c (bitsetv_alloc): Likewise.
13795 * lib/ebitset.c (ebitset_bytes): Likewise.
13796 * lib/ebitset.h (ebitset_bytes): Likewise.
13797 * lib/lbitset.c (lbitset_bytes): Likewise.
13798 * lib/lbitset.h (lbitset_bytes): Likewise.
13800 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
13801 abitset_subset_p, abitset_disjoint_p, abitset_and,
13802 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
13803 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
13804 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
13805 abitset_or_and, abitset_or_and_cmp):
13806 Use bitset_windex instead of unsigned int.
13807 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
13808 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
13809 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
13810 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
13812 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
13814 * lib/bitset.c (bitset_print):
13815 Use proper printf formats for widths of integer types.
13816 * lib/bitset_stats.c (bitset_percent_histogram_print,
13817 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
13818 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
13819 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
13820 * lib/lbitset.c (lbitset_bytes): Likewise.
13822 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
13823 BITSET_SIZE_MAX): New macros.
13824 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
13825 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
13826 to BITSET_WINDEX_MAX.
13828 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
13829 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
13830 since we now return the bitset_bindex type (not int).
13832 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
13833 when computing sizes.
13834 * lib/ebitset.c (ebitset_elts_grow): Likewise.
13836 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
13837 and avoid cast to unsigned.
13839 2002-09-30 Akim Demaille <akim@epita.fr>
13841 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
13842 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
13843 Updates from Michael Hayes.
13845 2002-09-30 Art Haas <ahaas@neosoft.com>
13847 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
13849 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
13852 2002-09-27 Akim Demaille <akim@epita.fr>
13856 2002-09-27 Akim Demaille <akim@epita.fr>
13858 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
13859 (Because of AC_LIBSOURCE).
13861 2002-09-27 Akim Demaille <akim@epita.fr>
13863 Playing with Autoscan.
13865 * configure.ac: Remove the old LIBOBJ tweaks.
13866 (AC_REPLACE_FUNCS): Add strrchr and strtol.
13867 * lib/strrchr.c: New.
13868 * lib/strtol.c: New, from the Coreutils 4.5.1.
13870 2002-09-27 Akim Demaille <akim@epita.fr>
13872 Playing with Autoscan.
13874 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
13875 * lib/Makefile.am (libbison_a_SOURCES): No longer include
13876 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
13877 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
13880 2002-09-24 Akim Demaille <akim@epita.fr>
13882 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
13883 (Frequently Asked Questions, Parser Stack Overflow): New.
13885 2002-09-13 Akim Demaille <akim@epita.fr>
13887 Playing with autoscan.
13889 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
13890 * src/files.c (skeleton_find): Remove, unused.
13891 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
13892 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
13894 2002-09-13 Akim Demaille <akim@epita.fr>
13896 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
13897 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
13899 2002-09-13 Akim Demaille <akim@epita.fr>
13901 * configure.ac: Require 2.54.
13902 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
13903 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
13904 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
13905 Remove, provided by Autoconf macros.
13907 2002-09-12 Akim Demaille <akim@epita.fr>
13909 * m4/prereq.m4: Update, from Coreutils 4.5.1.
13911 2002-09-12 Akim Demaille <akim@epita.fr>
13913 * m4/prereq.m4: Update, from Fileutils 4.1.5.
13914 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
13915 Reported by Martin Mokrejs.
13917 2002-09-10 Akim Demaille <akim@epita.fr>
13919 * src/parse-gram.y: Associate a human readable string to each
13921 * tests/regression.at (Invalid inputs): Adjust.
13923 2002-09-10 Gary V. Vaughan <gary@gnu.org>
13925 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
13926 with an Autoconf-2.5x style configure.ac.
13928 2002-09-06 Paul Eggert <eggert@twinsun.com>
13930 * doc/bison.texinfo (Conditions): Make explicit that the GPL
13931 exception applies only to yacc.c. This is a modification of a
13932 patch originally suggested by Akim Demaille.
13934 2002-09-06 Akim Demaille <akim@epita.fr>
13936 * data/c.m4 (b4_copyright): Move the GPL exception comment from
13938 * data/yacc.c: here.
13940 * data/lalr1.cc (struct yyltype): Don't define it, since we use
13942 (b4_ltype): Default to yy::Location from location.hh.
13944 2002-09-04 Jim Meyering <jim@meyering.net>
13946 * data/yacc.c: Guard the declaration of yytoknum also with
13947 `#ifdef YYPRINT', so it is declared only when used.
13949 2002-09-04 Akim Demaille <akim@epita.fr>
13951 * configure.in: Rename as...
13952 * configure.ac: this.
13955 2002-09-04 Akim Demaille <akim@epita.fr>
13957 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
13958 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
13959 translate maintainer only messages.
13961 2002-08-12 Paul Eggert <eggert@twinsun.com>
13965 * Makefile.am (SUBDIRS): Remove intl.
13966 (DISTCLEANFILES): Remove.
13967 * NEWS: Mention that GNU M4 is now required. Clarify what is
13968 meant by "larger grammars". Mention the pt_BR translation.
13969 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
13970 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
13971 Bump version from 0.11.2 to 0.11.5.
13972 (BISON_PREREQ_STAGE): Remove.
13973 (AM_GNU_GETTEXT): Use external gettext.
13974 (AC_OUTPUT): Remove intl/Makefile.
13976 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
13978 * data/glr.c: Include string.h, for strlen.
13979 (yyreportParseError): Use size_t for yysize.
13980 (yy_yypstack): No longer nested inside yypstates, as nested
13981 functions are not portable. Do not assume size_t is the
13983 (yypstates): Do not assume that ptrdiff_t is the same width
13984 as int, and similarly for yyposn and YYINDEX.
13986 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
13988 * lib/Makefile.am (INCLUDES): Do not include from the intl
13989 directory, which has been removed.
13990 * src/Makefile.am (INCLUDES): Likewise.
13992 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
13993 (bitsets_sources, additional_bitsets_sources, timevars_sources):
13996 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
13997 * tests/Makefile.am (EXTRA_DIST): Likewise.
13999 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
14000 Do not assume that bitset_windex is the same width as unsigned.
14002 * lib/abitset.c (abitset_unused_clear): Do not assume that
14003 bitset_word is the same width as int.
14004 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
14005 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
14006 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
14007 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
14008 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
14010 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
14011 portability to one's complement hosts!).
14012 * lib/ebitset.c (ebitset_op1): Likewise.
14013 * lib/lbitset.c (lbitset_op1): Likewise.
14015 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
14016 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
14017 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
14018 Sync with fileutils.
14019 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
14020 lib/gettext.h: Sync with diffutils.
14022 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
14023 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
14025 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
14026 PROTOTYPES to check for prototypes, and "defined __STDC__" to
14029 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
14030 size_t; the old version tried to do this but casted improperly.
14031 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
14032 (bitset_test): Now returns int, not unsigned long.
14034 * lib/bitset_stats.c: Include "gettext.h".
14036 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
14037 name locals "index", as it generates unnecessary warnings on some
14038 hosts that have an "index" function.
14040 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
14041 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
14042 they need translation.
14043 * src/LR0.c (state_list_append, new_itemsets, get_state,
14044 append_states, generate_states): Likewise.
14045 * src/assoc.c (assoc_to_string): Likewise.
14046 * src/closure.c (print_closure, set_firsts, closure): Likewise.
14047 * src/gram.c (grammar_dump): Likewise.
14048 * src/injections.c (injections_compute): Likewise.
14049 * src/lalr.c (lookaheads_print): Likewise.
14050 * src/relation.c (relation_transpose): Likewise.
14051 * src/scan-gram.l: Likewise.
14052 * src/tables.c (table_grow, pack_vector): Likewise.
14054 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
14055 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
14056 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
14057 * m4/mbstate_t.m4: Sync with fileutils.
14058 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
14060 * po/LINGUAS: Add pt_BR.
14061 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
14062 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
14064 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
14066 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
14068 * src/complain.c (strerror_r): Remove decl; not needed.
14069 (strerror): Use same pattern as ../lib/error.c.
14071 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
14073 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
14075 * src/main.c (main): Cast result of bindtextdomain and textdomain
14076 to void, to avoid a GCC warning when --disable-nls is in effect.
14078 * src/scan-gram.l: Use strings rather than escapes when possible,
14079 to minimize the number of warnings from xgettext.
14080 (handle_action_dollar, handle_action_at): Don't use isdigit,
14081 as it mishandles negative chars and it may not work as expected
14082 outside the C locale.
14084 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
14085 this is a GCC extension and is not portable to other compilers.
14087 * src/system.h (alloca): Use same pattern as ../lib/error.c.
14088 Do not include <ctype.h>; no longer needed.
14089 Do not include <malloc.h>; no longer needed (and generates
14090 warnings on OpenBSD 3.0).
14092 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
14095 * tests/regression.at: Do not use 'cc -c input.c -o input';
14096 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
14098 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
14099 exit status as failure, not just exit status 1. Sun C exits
14100 with status 2 sometimes.
14102 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
14103 Use it for the two large tests.
14105 2002-08-02 Akim Demaille <akim@epita.fr>
14107 * src/conflicts.c (conflicts_output): Don't output rules never
14108 reduced here, since anyway that computation doesn't work.
14109 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
14110 (rule_useless_p, rule_never_reduced_p): New.
14111 (grammar_rules_partial_print): Use a filter instead of a range.
14112 Display the title only if needed.
14113 (grammar_rules_print): Adjust.
14114 (grammar_rules_never_reduced_report): New.
14115 * src/tables.c (action_row): Move the computation of rules never
14117 (token_actions): here.
14118 * src/main.c (main): Make the parser before making the report, so
14119 that rules never reduced are computed.
14120 Call grammar_rules_never_reduced_report.
14121 * src/print.c (print_results): Report rules never reduced.
14122 * tests/conflicts.at, tests/reduce.at: Adjust.
14124 2002-08-01 Akim Demaille <akim@epita.fr>
14126 Instead of attaching lookaheads and duplicating the rules being
14127 reduced by a state, attach the lookaheads to the reductions.
14129 * src/state.h (state_t): Remove the `lookaheads',
14130 `lookaheads_rule' member.
14131 (reductions_t): Add a `lookaheads' member.
14132 Use a regular array for the `rules'.
14133 * src/state.c (reductions_new): Initialize the lookaheads member
14135 (state_rule_lookaheads_print): Adjust.
14136 * src/state.h, src/state.c (state_reductions_find): New.
14137 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
14138 (count_rr_conflicts): Adjust.
14139 * src/lalr.c (LArule): Remove.
14140 (add_lookback_edge): Adjust.
14141 (state_lookaheads_count): New.
14142 (states_lookaheads_initialize): Merge into...
14143 (initialize_LA): this.
14144 (lalr_free): Adjust.
14145 * src/main.c (main): Don't free nullable and derives too early: it
14146 is used by --verbose.
14147 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
14149 2002-08-01 Akim Demaille <akim@epita.fr>
14151 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
14153 (set_derives, free_derives): Rename as...
14154 (derives_compute, derives_free): this.
14155 Adjust all dependencies.
14156 * src/nullable.c (set_nullable, free_nullable): Rename as...
14157 (nullable_compute, nullable_free): these.
14158 (rule_list_t): Store rule_t *, not rule_number_t.
14159 * src/state.c (state_rule_lookaheads_print): Directly compare rule
14160 pointers, instead of their numbers.
14161 * src/main.c (main): Call nullable_free, and derives_free earlier,
14162 as they were lo longer used.
14164 2002-08-01 Akim Demaille <akim@epita.fr>
14166 * lib/timevar.c (get_time): Include children time.
14167 * src/lalr.h (LA, LArule): Don't export them: used with the
14169 * src/lalr.c (LA, LArule): Static.
14170 * src/lalr.h, src/lalr.c (lalr_free): New.
14171 * src/main.c (main): Call it.
14172 * src/tables.c (pack_vector): Check whether loc is >= to the
14174 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
14175 (tables_generate): do it, since that's also it which allocates
14177 Don't free LA and LArule, main does.
14179 2002-07-31 Akim Demaille <akim@epita.fr>
14181 Separate parser tables computation and output.
14183 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
14184 (conflict_list, conflict_list_cnt, table, check, table_ninf)
14185 (yydefgoto, yydefact, high): Move to...
14186 * src/tables.h, src/tables.c: here.
14187 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
14188 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
14189 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
14190 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
14191 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
14192 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
14193 (action_row, save_row, token_actions, save_column, default_goto)
14194 (goto_actions, sort_actions, matching_state, pack_vector)
14195 (table_ninf_remap, pack_table, prepare_actions): Move to...
14196 * src/tables.c: here.
14197 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
14198 * src/output.c (token_actions, output_base, output_conflicts)
14199 (output_check): Merge into...
14200 (prepare_actions): this.
14201 (actions_output): Rename as...
14202 (user_actions_output): this.
14203 * src/main.c (main): Call tables_generate and tables_free.
14205 2002-07-31 Akim Demaille <akim@epita.fr>
14207 Steal GCC's --time-report support.
14209 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
14210 stolen/adjusted from GCC.
14211 * m4/stage.m4: Remove time related checks.
14212 * m4/timevar.m4: New.
14213 * configure.in: Adjust.
14214 * src/system.h: Adjust to using timevar.h.
14215 * src/getargs.h, src/getargs.c: Support trace_time for
14217 * src/main.c (stage): Remove.
14218 (main): Replace `stage' invocations with timevar calls.
14219 * src/output.c: Insert pertinent timevar calls.
14221 2002-07-31 Akim Demaille <akim@epita.fr>
14223 Let --trace have arguments.
14225 * src/getargs.h (enum trace_e): New.
14226 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
14227 (long_options, short_options): --trace/-T takes an optional
14229 Change all the uses of trace_flag to reflect the new flags.
14230 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
14232 Strengthen `stage' portability.
14234 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
14235 * configure.in: Use it.
14236 Don't check for malloc.h and sys/times.h.
14237 * src/system.h: Include them when appropriate.
14238 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
14239 times and struct tms are available.
14241 2002-07-30 Akim Demaille <akim@epita.fr>
14243 In verbose parse error message, don't report `error' as an
14245 * tests/actions.at (Printers and Destructors): Adjust.
14246 * tests/calc.at (Calculator $1): Adjust.
14247 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
14248 error message, do not report the parser accepts the error token in
14251 2002-07-30 Akim Demaille <akim@epita.fr>
14253 Normalize conflict related messages.
14255 * src/complain.h, src/complain.c (warn, complain): New.
14256 * src/conflicts.c (conflicts_print): Use them.
14257 (conflict_report_yacc): New, extracted from...
14258 (conflicts_print): here.
14259 * tests/conflicts.at, tests/existing.at: Adjust.
14261 2002-07-30 Akim Demaille <akim@epita.fr>
14263 Report rules which are never reduced by the parser: those hidden
14266 * src/LR0.c (save_reductions): Don't make the final state too
14267 different: save its reduction (accept) instead of having a state
14268 without any action (no shift or goto, no reduce).
14269 Note: the final state is now a ``regular'' state, i.e., the
14270 parsers now contain `reduce 0' as default reduction.
14271 Nevertheless, since they decide to `accept' when yystate =
14272 final_state, they still will not reduce rule 0.
14273 * src/print.c (print_actions, print_reduction): Adjust.
14274 * src/output.c (action_row): Track reduced rules.
14275 (token_actions): Report rules never reduced.
14276 * tests/conflicts.at, tests/regression.at: Adjust.
14278 2002-07-30 Akim Demaille <akim@epita.fr>
14280 `stage' was accidently included in a previous patch.
14281 Initiate its autoconfiscation.
14283 * configure.in: Look for malloc.h and sys/times.h.
14284 * src/main.c (stage): Adjust.
14285 Report only when trace_flag.
14287 2002-07-29 Akim Demaille <akim@epita.fr>
14289 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
14291 (errs_t): symbol_t*, not symbol_number_t.
14292 (reductions_t): rule_t*, not rule_number_t.
14293 (FOR_EACH_SHIFT): New.
14294 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
14295 * src/print.c, src/print_graph.c: Adjust.
14297 2002-07-29 Akim Demaille <akim@epita.fr>
14299 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
14301 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
14302 (endtoken, accept): these.
14303 * src/reader.c (reader): Set endtoken's default tag to "$end".
14304 Set undeftoken's tag to "$undefined" instead of "$undefined.".
14305 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
14308 2002-07-29 Akim Demaille <akim@epita.fr>
14310 * src/reduce.c (reduce_grammar): When the language is empty,
14311 complain about the start symbol, not the axiom.
14313 * tests/reduce.at (Empty Language): New.
14315 2002-07-26 Akim Demaille <akim@epita.fr>
14317 * src/reader.h, src/reader.c (gram_error): ... can't get
14318 yycontrol without making too strong assumptions on the parser
14320 * src/output.c (prepare_tokens): Use the real 0th value of
14321 token_translations instead of `0'.
14322 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
14324 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
14325 for the time being: %locations ought to provide it to yyerror.
14327 2002-07-25 Akim Demaille <akim@epita.fr>
14329 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
14330 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
14331 * tests/regression.at (Web2c Actions): Adjust.
14333 2002-07-25 Akim Demaille <akim@epita.fr>
14335 Stop storing rules from 1 to nrules + 1.
14337 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
14338 * src/nullable.c, src/output.c, src/print.c, src/reader.c
14339 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
14340 Iterate from 0 to nrules.
14341 Use rule_number_as_item_number and item_number_as_rule_number.
14342 Adjust to `derive' now containing possibly 0.
14343 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
14344 Handle the `- 1' part in rule numbers from/to item numbers.
14345 * src/conflicts.c (log_resolution): Fix the message which reversed
14347 * src/output.c (action_row): Initialize default_rule to -1.
14348 (token_actions): Adjust.
14349 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
14351 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
14353 2002-07-25 Akim Demaille <akim@epita.fr>
14355 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
14356 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
14357 (b4_c_knr_arg_decl): New.
14358 * data/yacc.c: Use it to define yysymprint, yydestruct, and
14359 yyreport_parse_error.
14361 2002-07-25 Akim Demaille <akim@epita.fr>
14363 * data/yacc.c (yyreport_parse_error): New, extracted from...
14365 (yydestruct, yysymprint): Move above yyparse.
14368 2002-07-25 Akim Demaille <akim@epita.fr>
14370 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
14372 (b4_sint_type, b4_uint_type): these.
14373 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
14374 * tests/regression.at (Web2c Actions): Adjust.
14376 2002-07-25 Akim Demaille <akim@epita.fr>
14378 * src/gram.h (TIEM_NUMBER_MAX): New.
14379 (item_number_of_rule_number, rule_number_of_item_number): Rename
14381 (rule_number_as_item_number, item_number_as_rule_number): these.
14382 Adjust dependencies.
14383 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
14384 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
14385 (symbol_number_to_vector_number): New.
14386 (order): Of vector_number_t* type.
14387 (base_t, BASE_MAX, BASE_MIN): New.
14388 (froms, tos, width, pos, check): Of base_t type.
14389 (action_number_t, ACTION_MIN, ACTION_MAX): New.
14390 (actrow): Of action_number_t type.
14391 (conflrow): Of unsigned int type.
14392 (table_ninf, base_ninf): New.
14393 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
14394 (muscle_insert_int_table, muscle_insert_base_table)
14395 (muscle_insert_rule_number_table): New.
14396 (prepare_tokens): Output `toknum' as int_table.
14397 (action_row): Returns a rule_number_t.
14398 Use ACTION_MIN, not SHRT_MIN.
14399 (token_actions): yydefact is rule_number_t*.
14400 (table_ninf_remap): New.
14401 (pack_table): Use it for `base' and `table'.
14402 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
14404 (YYPACT_NINF, YYTABLE_NINF): these.
14405 (yypact, yytable): Compute their types instead of hard-coded
14407 * tests/regression.at (Web2c Actions): Adjust.
14409 2002-07-19 Akim Demaille <akim@epita.fr>
14411 * src/scan-gram.l (id): Can start with an underscore.
14413 2002-07-16 Akim Demaille <akim@epita.fr>
14415 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
14416 Adjust all former `associativity' dependencies.
14417 * src/symtab.c (symbol_new): Default associativity is `undef', not
14419 (symbol_check_alias_consistence): Adjust.
14421 2002-07-09 Akim Demaille <akim@epita.fr>
14423 * doc/bison.texinfo: Properly set the ``header'' part.
14424 Use @dircategory ``GNU programming tools'' as per Texinfo's
14428 2002-07-09 Akim Demaille <akim@epita.fr>
14430 * lib/quotearg.h: Protect against multiple inclusions.
14431 * src/location.h (location_t): Add a `file' member.
14432 (LOCATION_RESET, LOCATION_PRINT): Adjust.
14433 * src/complain.c (warn_at, complain_at, fatal_at): Drop
14434 `error_one_per_line' support.
14436 2002-07-09 Akim Demaille <akim@epita.fr>
14438 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
14439 * src/reader.c (lineno): Remove.
14440 Adjust all dependencies.
14441 (get_merge_function): Take a location and use complain_at.
14442 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
14443 * tests/regression.at (Invalid inputs, Mixing %token styles):
14446 2002-07-09 Akim Demaille <akim@epita.fr>
14448 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
14449 recovery rule, and forbid extensions when --yacc.
14450 (gram_error): Use complain_at.
14451 * src/reader.c (reader): Exit if there were parse errors.
14453 2002-07-09 Akim Demaille <akim@epita.fr>
14455 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
14456 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
14457 Reported by R Blake <blakers@mac.com>.
14459 2002-07-09 Akim Demaille <akim@epita.fr>
14461 * data/yacc.c: Output the copyright notive in the header.
14463 2002-07-03 Akim Demaille <akim@epita.fr>
14465 * src/output.c (froms, tos): Are state_number_t.
14466 (save_column): sp, sp1, and sp2 are state_number_t.
14467 (prepare): Rename `final' as `final_state_number', `nnts' as
14468 `nterms_number', `nrules' as `rules_number', `nstates' as
14469 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
14471 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
14472 * data/lalr1.cc (nsym_): Remove, unused.
14474 2002-07-03 Akim Demaille <akim@epita.fr>
14476 * src/lalr.h, src/lalr.c (goto_number_t): New.
14477 * src/lalr.c (goto_list_t): New.
14479 * src/nullable.c (rule_list_t): New.
14481 * src/types.h: Remove.
14483 2002-07-03 Akim Demaille <akim@epita.fr>
14485 * src/closure.c (print_fderives): Use rule_rhs_print.
14486 * src/derives.c (print_derives): Use rule_rhs_print.
14487 (rule_list_t): New, replaces `shorts'.
14488 (set_derives): Add comments.
14489 * tests/sets.at (Nullable, Firsts): Adjust.
14491 2002-07-03 Akim Demaille <akim@epita.fr>
14493 * src/output.c (prepare_actions): Free `tally' and `width'.
14494 (prepare_actions): Allocate and free `order'.
14495 * src/symtab.c (symbols_free): Free `symbols'.
14496 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
14497 * src/output.c (m4_invoke): Move to...
14498 * src/scan-skel.l: here.
14499 (<<EOF>>): Close yyout, and free its name.
14501 2002-07-03 Akim Demaille <akim@epita.fr>
14503 Fix some memory leaks, and fix a bug: state 0 was examined twice.
14505 * src/LR0.c (new_state): Merge into...
14506 (state_list_append): this.
14507 (new_states): Merge into...
14508 (generate_states): here.
14509 (set_states): Don't ensure a proper `errs' state member here, do it...
14510 * src/conflicts.c (conflicts_solve): here.
14511 * src/state.h, src/state.c: Comment changes.
14512 (state_t): Rename member `shifts' as `transitions'.
14513 Adjust all dependencies.
14514 (errs_new): For consistency, also take the values as argument.
14515 (errs_dup): Remove.
14516 (state_errs_set): New.
14517 (state_reductions_set, state_transitions_set): Assert that no
14518 previous value was assigned.
14520 (states_free): Use it.
14521 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
14522 temporary storage: use `errs' and `nerrs' as elsewhere.
14523 (set_conflicts): Allocate and free this `errs'.
14525 2002-07-02 Akim Demaille <akim@epita.fr>
14527 * lib/libiberty.h: New.
14528 * lib: Update the bitset implementation from upstream.
14529 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
14530 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
14531 * src/main.c: Adjust bitset stats calls.
14533 2002-07-01 Paul Eggert <eggert@twinsun.com>
14535 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
14536 char, so that negative chars don't collide with $.
14538 2002-06-30 Akim Demaille <akim@epita.fr>
14540 Have the GLR tests be `warning' checked, and fix the warnings.
14542 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
14543 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
14544 (yyremoveDeletes): `yyi' and `yyj' are size_t.
14545 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
14546 (yyaddDeferredAction): static.
14547 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
14548 (yyreportParseError): yyprefix is const.
14549 yytokenp is used only when verbose.
14550 (yy__GNUC__): Replace with __GNUC__.
14551 (yypdumpstack): yyi is size_t.
14552 (yypreference): Un-yy local variables and arguments, to avoid
14553 clashes with `yyr1'. Anyway, we are not in the user name space.
14554 (yytname_size): be an int, as is compared with ints.
14555 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
14557 * tests/cxx-gram.at: Use quotation to protect $1.
14558 Use AT_COMPILE to enable warnings hunts.
14559 Prototype yylex and yyerror.
14561 Include `string.h', not `strings.h'.
14562 Produce and prototype stmtMerge only when used.
14563 yylex takes a location.
14565 2002-06-30 Akim Demaille <akim@epita.fr>
14567 We spend a lot of time in quotearg, in particular when --verbose.
14569 * src/symtab.c (symbol_get): Store a quoted version of the key.
14570 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
14571 Adjust all callers.
14573 2002-06-30 Akim Demaille <akim@epita.fr>
14575 * src/state.h (reductions_t): Rename member `nreds' as num.
14576 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
14577 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
14579 2002-06-30 Akim Demaille <akim@epita.fr>
14581 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
14582 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
14583 (shifts_to): Rename as...
14584 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
14585 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
14586 (TRANSITION_IS_DISABLED, transitions_to): these.
14588 2002-06-30 Akim Demaille <akim@epita.fr>
14590 * src/print.c (print_shifts, print_gotos): Merge into...
14591 (print_transitions): this.
14592 (print_transitions, print_errs, print_reductions): Align the
14593 lookaheads columns.
14594 (print_core, print_transitions, print_errs, print_state,
14595 print_grammar): Output empty lines separator before, not after.
14596 (state_default_rule_compute): Rename as...
14597 (state_default_rule): this.
14598 * tests/conflicts.at (Defaulted Conflicted Reduction),
14599 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
14600 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
14602 2002-06-30 Akim Demaille <akim@epita.fr>
14604 Display items as we display rules.
14606 * src/gram.h, src/gram.c (rule_lhs_print): New.
14607 * src/gram.c (grammar_rules_partial_print): Use it.
14608 * src/print.c (print_core): Likewise.
14609 * tests/conflicts.at (Defaulted Conflicted Reduction),
14610 (Unresolved SR Conflicts): Adjust.
14611 (Unresolved SR Conflicts): Adjust and rename as...
14612 (Resolved SR Conflicts): this, as was meant.
14613 * tests/regression.at (Web2c Report): Adjust.
14615 2002-06-30 Akim Demaille <akim@epita.fr>
14617 * src/print.c (state_default_rule_compute): New, extracted from...
14618 (print_reductions): here.
14619 Pessimize, but clarify the code.
14620 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
14622 2002-06-30 Akim Demaille <akim@epita.fr>
14624 * src/output.c (action_row): Let default_rule be always a rule
14627 2002-06-30 Akim Demaille <akim@epita.fr>
14629 * src/closure.c (print_firsts, print_fderives, closure):
14630 Use BITSET_EXECUTE.
14631 * src/lalr.c (lookaheads_print): Likewise.
14632 * src/state.c (state_rule_lookaheads_print): Likewise.
14633 * src/print_graph.c (print_core): Likewise.
14634 * src/print.c (print_reductions): Likewise.
14635 * src/output.c (action_row): Likewise.
14636 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
14638 2002-06-30 Akim Demaille <akim@epita.fr>
14640 * src/print_graph.c: Use report_flag.
14642 2002-06-30 Akim Demaille <akim@epita.fr>
14644 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
14646 * src/relation.h, src/relation.c (traverse, relation_digraph)
14647 (relation_print, relation_transpose): New.
14649 2002-06-30 Akim Demaille <akim@epita.fr>
14651 * src/state.h, src/state.c (shifts_to): New.
14652 * src/lalr.c (build_relations): Use it.
14654 2002-06-30 Akim Demaille <akim@epita.fr>
14656 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
14657 (item_number_of_rule_number, rule_number_of_item_number): New.
14658 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
14659 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
14660 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
14661 Propagate their use.
14662 Much remains to be done, in particular wrt `shorts' from types.h.
14664 2002-06-30 Akim Demaille <akim@epita.fr>
14666 * src/symtab.c (symbol_new): Initialize the `printer' member.
14668 2002-06-30 Akim Demaille <akim@epita.fr>
14670 * src/LR0.c (save_reductions): Remove, replaced by...
14671 * src/state.h, src/state.c (state_reductions_set): New.
14672 (reductions, errs): Rename as...
14673 (reductions_t, errs_t): these.
14674 Adjust all dependencies.
14676 2002-06-30 Akim Demaille <akim@epita.fr>
14678 * src/LR0.c (state_list_t, state_list_append): New.
14679 (first_state, last_state): Now symbol_list_t.
14680 (this_state): Remove.
14681 (new_itemsets, append_states, save_reductions): Take a state_t as
14683 (set_states, generate_states): Adjust.
14684 (save_shifts): Remove, replaced by...
14685 * src/state.h, src/state.c (state_shifts_set): New.
14686 (shifts): Rename as...
14688 Adjust all dependencies.
14689 * src/state.h (state_t): Remove the `next' member.
14691 2002-06-30 Akim Demaille <akim@epita.fr>
14693 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
14696 2002-06-30 Akim Demaille <akim@epita.fr>
14698 Use hash.h for the state hash table.
14700 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
14701 (allocate_storage): Use state_hash_new.
14702 (free_storage): Use state_hash_free.
14703 (new_state, get_state): Adjust.
14704 * src/lalr.h, src/lalr.c (states): Move to...
14705 * src/states.h (state_t): Remove the `link' member, no longer
14707 * src/states.h, src/states.c: here.
14708 (state_hash_new, state_hash_free, state_hash_lookup)
14709 (state_hash_insert, states_free): New.
14710 * src/states.c (state_table, state_compare, state_hash): New.
14711 * src/output.c (output_actions): Do not free states now, since we
14712 still need to know the final_state number in `prepare', called
14713 afterwards. Do it...
14714 * src/main.c (main): here: call states_free after `output'.
14716 2002-06-30 Akim Demaille <akim@epita.fr>
14718 * src/state.h, src/state.c (state_new): New, extracted from...
14719 * src/LR0.c (new_state): here.
14720 * src/state.h (STATE_ALLOC): Move to...
14721 * src/state.c: here.
14722 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
14723 * src/state.h, src/state.c: here.
14725 2002-06-30 Akim Demaille <akim@epita.fr>
14727 * src/reader.c (gensym): Rename as...
14728 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
14729 (getsym): Rename as...
14730 (symbol_get): this.
14732 2002-06-30 Akim Demaille <akim@epita.fr>
14734 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
14735 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
14736 * src/output.c, src/print.c, src/print_graph.c: Propagate.
14737 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
14739 2002-06-30 Akim Demaille <akim@epita.fr>
14741 Make the test suite pass with warnings checked.
14743 * tests/actions.at (Printers and Destructors): Improve.
14744 Avoid unsigned vs. signed issues.
14745 * tests/calc.at: Don't exercise the scanner here, do it...
14746 * tests/input.at (Torturing the Scanner): here.
14748 2002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14750 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
14751 reorganize first lines parallel to yacc.c.
14753 2002-06-28 Akim Demaille <akim@epita.fr>
14755 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
14756 (b4_token_enum, b4_token_defines): New, factored from...
14757 * data/lalr1.cc, data/yacc.c, glr.c: here.
14759 2002-06-28 Akim Demaille <akim@epita.fr>
14761 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
14763 * src/output.c (merger_output): static.
14765 2002-06-28 Akim Demaille <akim@epita.fr>
14767 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
14768 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
14770 * src/output.c (save_row): Initialize all the variables to pacify GCC.
14772 2002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14774 Accumulated changelog for new GLR parsing features.
14776 * src/conflicts.c (count_total_conflicts): Change name to
14777 conflicts_total_count.
14778 * src/conflicts.h: Ditto.
14779 * src/output.c (token_actions): Use the new name.
14780 (output_conflicts): Change conflp => conflict_list_heads, and
14781 confl => conflict_list for better readability.
14782 * data/glr.c: Use the new names.
14783 * NEWS: Add self to GLR announcement.
14785 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
14787 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
14790 * data/bison.glr: Change name to glr.c
14791 * data/glr.c: Renamed from bison.glr.
14792 * data/Makefile.am: Add glr.c
14796 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
14797 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
14799 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14801 * data/bison.glr: Be sure to restore the
14802 current #line when returning to the skeleton contents after having
14803 exposed the input file's #line.
14805 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14807 * data/bison.glr: Bring up to date with changes to bison.simple.
14809 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14811 * data/bison.glr: Correct definitions that use b4_prefix.
14812 Various reformatting.
14813 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
14814 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
14815 yytokenp argument; now part of stack.
14816 (yychar): Define to behave as documented.
14817 (yyclearin): Ditto.
14819 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14821 * src/reader.h: Add declaration for free_merger_functions.
14823 * src/reader.c (merge_functions): New variable.
14824 (get_merge_function): New function.
14825 (free_merger_functions): New function.
14826 (readgram): Check for %prec that is not followed by a symbol.
14827 Handle %dprec and %merge declarations.
14828 (packgram): Initialize dprec and merger fields in rules array.
14830 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
14831 conflict_list_cnt, conflict_list_free): New variables.
14832 (table_grow): Also grow conflict_table.
14833 (prepare_rules): Output dprec and merger tables.
14834 (conflict_row): New function.
14835 (action_row): Output conflict lists for GLR parser. Don't use
14836 default reduction in conflicted states for GLR parser so that there
14837 are spaces for the conflict lists.
14838 (save_row): Also save conflict information.
14839 (token_actions): Allocate conflict list.
14840 (merger_output): New function.
14841 (pack_vector): Pack conflict table, too.
14842 (output_conflicts): New function to output yyconflp and yyconfl.
14843 (output_check): Allocate conflict_tos.
14844 (output_actions): Output conflict tables, also.
14845 (output_skeleton): Output b4_mergers definition.
14846 (prepare): Output b4_max_rhs_length definition.
14847 Use 'bison.glr' as default skeleton for GLR parsers.
14849 * src/gram.c (glr_parser): New flag.
14850 (grammar_free): Call free_merger_functions.
14852 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
14853 all pairs of conflicting reductions, rather than just all tokens
14854 causing conflicts. Needed to size conflict tables.
14855 (conflicts_output): Modify call to count_rr_conflicts for new
14857 (conflicts_print): Ditto.
14858 (count_total_conflicts): New function.
14860 * src/reader.h (merger_list): New type.
14861 (merge_functions): New variable.
14863 * src/lex.h (tok_dprec, tok_merge): New token types.
14865 * src/gram.h (rule_s): Add dprec and merger fields.
14866 (glr_parser): New flag.
14868 * src/conflicts.h (count_total_conflicts): New function.
14870 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
14872 * doc/bison.texinfo (Generalized LR Parsing): New section.
14873 (GLR Parsers): New section.
14874 (Language and Grammar): Mention GLR parsing.
14875 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
14876 Correct typo ("tge" -> "the").
14878 * data/bison.glr: New skeleton for GLR parsing.
14880 * tests/cxx-gram.at: New tests for GLR parsing.
14882 * tests/testsuite.at: Include cxx-gram.at.
14884 * tests/Makefile.am: Add cxx-gram.at.
14886 * src/parse-gram.y:
14888 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
14890 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
14892 2002-06-27 Akim Demaille <akim@epita.fr>
14894 * src/options.h, src/options.c: Remove.
14895 * src/getargs.c (short_options, long_options): New.
14897 2002-06-27 Akim Demaille <akim@epita.fr>
14899 * data/bison.simple, data/bison.c++: Rename as...
14900 * data/yacc.c, data/lalr1.cc: these.
14901 * doc/bison.texinfo (Environment Variables): Remove.
14903 2002-06-25 Raja R Harinath <harinath@cs.umn.edu>
14905 * src/getargs.c (report_argmatch): Initialize strtok().
14907 2002-06-20 Akim Demaille <akim@epita.fr>
14909 * data/bison.simple (b4_symbol_actions): New, replaces...
14910 (b4_symbol_destructor, b4_symbol_printer): these.
14911 (yysymprint): Be sure to call YYPRINT only for tokens, and using
14912 user token numbers.
14914 2002-06-20 Akim Demaille <akim@epita.fr>
14916 * data/bison.simple (yydestructor): Rename as...
14917 (yydestruct): this.
14919 2002-06-20 Akim Demaille <akim@epita.fr>
14921 * src/symtab.h, src/symtab.c (symbol_type_set)
14922 (symbol_destructor_set, symbol_precedence_set): The location is
14924 Adjust all callers.
14926 2002-06-20 Akim Demaille <akim@epita.fr>
14928 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
14930 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
14932 * src/symtab.h, src/symtab.c (symbol_class_set)
14933 (symbol_user_token_number_set): Likewise.
14934 Adjust all callers.
14935 Promote complain_at.
14936 * tests/input.at (Type Clashes): Adjust.
14938 2002-06-20 Akim Demaille <akim@epita.fr>
14940 * data/bison.simple (YYLEX): Fix the declaration when
14943 2002-06-20 Akim Demaille <akim@epita.fr>
14945 * data/bison.simple (yysymprint): Don't print the token number,
14947 * tests/actions.at (Destructors): Rename as...
14948 (Printers and Destructors): this.
14949 Also exercise %printer.
14951 2002-06-20 Akim Demaille <akim@epita.fr>
14953 * data/bison.simple (YYDSYMPRINT): New.
14954 Use it to remove many of the #if YYDEBUG/if (yydebug).
14956 2002-06-20 Akim Demaille <akim@epita.fr>
14958 * src/symtab.h, src/symtab.c (symbol_t): printer and
14959 printer_location are new members.
14960 (symbol_printer_set): New.
14961 * src/parse-gram.y (PERCENT_PRINTER): New token.
14962 Handle its associated rule.
14963 * src/scan-gram.l: Adjust.
14964 (handle_destructor_at, handle_destructor_dollar): Rename as...
14965 (handle_symbol_code_at, handle_symbol_code_dollar): these.
14966 * src/output.c (symbol_printers_output): New.
14967 (output_skeleton): Call it.
14968 * data/bison.simple (yysymprint): New. Cannot be named yyprint
14969 since there are already many grammar files with a user `yyprint'.
14970 Replace the calls to YYPRINT to calls to yysymprint.
14971 * tests/calc.at: Adjust.
14972 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
14973 taking advantage of parser very internal details (stack size!).
14975 2002-06-20 Akim Demaille <akim@epita.fr>
14977 * src/scan-gram.l: Complete the scanner with the missing patterns
14979 Use `quote' and `symbol_tag_get' where appropriate.
14981 2002-06-19 Akim Demaille <akim@epita.fr>
14983 * tests/actions.at (Destructors): Augment to test locations.
14984 * data/bison.simple (yydestructor): Pass it the current location
14985 if locations are enabled.
14986 Prototype only when __STDC__ or C++.
14987 Change the argument names to move into the yy name space: there is
14990 2002-06-19 Akim Demaille <akim@epita.fr>
14992 * data/bison.simple (b4_pure_if): New.
14993 Use it instead of #ifdef YYPURE.
14995 2002-06-19 Akim Demaille <akim@epita.fr>
14997 * data/bison.simple (b4_location_if): New.
14998 Use it instead of #ifdef YYLSP_NEEDED.
15000 2002-06-19 Akim Demaille <akim@epita.fr>
15002 Prepare @$ in %destructor, but currently don't bind it in the
15003 skeleton, as %location use is not cleaned up yet.
15005 * src/scan-gram.l (handle_dollar, handle_destructor_at)
15006 (handle_action_at): New.
15007 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
15008 a braced_code_t and a location as additional arguments.
15009 (handle_destructor_dollar): Instead of requiring `b4_eval', just
15010 unquote one when outputting `b4_dollar_dollar'.
15012 * data/bison.simple (b4_eval): Remove.
15013 (b4_symbol_destructor): Adjust.
15014 * tests/input.at (Invalid @n): Adjust.
15016 2002-06-19 Zack Weinberg <zack@codesourcery.com>
15018 * doc/bison.texinfo: Document ability to have multiple
15021 2002-06-18 Akim Demaille <akim@epita.fr>
15023 * src/files.c (compute_base_names): When computing the output file
15024 names from the input file name, strip the directory part.
15026 2002-06-18 Akim Demaille <akim@epita.fr>
15028 * data/bison.simple.new: Comment changes.
15029 Reported by Andreas Schwab.
15031 2002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
15033 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
15034 there are no `label `yyoverflowlab' defined but not used' warnings
15035 when yyoverflow is defined.
15037 2002-06-18 Akim Demaille <akim@epita.fr>
15039 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
15041 (symbol_destructor_set): Adjust.
15042 * src/output.c (symbol_destructors_output): Output the destructor
15044 Output the symbol name.
15045 * data/bison.simple (b4_symbol_destructor): Adjust.
15047 2002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
15048 and Akim Demaille <akim@epita.fr>
15050 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
15051 what's left on the stack when the error recovery hits EOF.
15052 * tests/actions.at (Destructors): Complete to exercise this case.
15054 2002-06-17 Akim Demaille <akim@epita.fr>
15056 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
15057 arguments is really empty, not only equal to `[]'.
15058 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
15060 (symbol_destructor_set): New.
15061 * src/output.c (symbol_destructors_output): New.
15062 * src/reader.h (brace_code_t, current_braced_code): New.
15063 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
15064 (handle_dollar): Rename as...
15065 (handle_action_dollar): this.
15066 (handle_destructor_dollar): New.
15067 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
15068 (grammar_declaration): Use it.
15069 * data/bison.simple (yystos): Is always defined.
15070 (yydestructor): New.
15071 * tests/actions.at (Destructors): New.
15072 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
15074 2002-06-17 Akim Demaille <akim@epita.fr>
15076 * src/symlist.h, src/symlist.c (symbol_list_length): New.
15077 * src/scan-gram.l (handle_dollar, handle_at): Compute the
15078 rule_length only when needed.
15079 * src/output.c (actions_output, token_definitions_output): Output
15081 * src/symtab.c: Don't access directly to the symbol tag, use
15083 * src/parse-gram.y: Use symbol_list_free.
15085 2002-06-17 Akim Demaille <akim@epita.fr>
15087 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
15088 (symbol_list_prepend, get_type_name): Move to...
15089 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
15090 (symbol_list_prepend, symbol_list_n_type_name_get): here.
15091 Adjust all callers.
15092 (symbol_list_free): New.
15093 * src/scan-gram.l (handle_dollar): Takes a location.
15094 * tests/input.at (Invalid $n): Adjust.
15096 2002-06-17 Akim Demaille <akim@epita.fr>
15098 * src/reader.h, src/reader.c (symbol_list_new): Export it.
15099 (symbol_list_prepend): New.
15100 * src/parse-gram.y (%union): `list' is a new member.
15101 (symbols.1): New, replaces...
15102 (terms_to_prec.1, nterms_to_type.1): these.
15103 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
15104 Take a location as additional argument.
15105 Adjust all callers.
15107 2002-06-15 Akim Demaille <akim@epita.fr>
15109 * src/parse-gram.y: Move %token in the declaration section so that
15110 we don't depend upon CVS Bison.
15112 2002-06-15 Akim Demaille <akim@epita.fr>
15114 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
15115 * src/print.c (print_core): Use it.
15117 2002-06-15 Akim Demaille <akim@epita.fr>
15119 * src/conflicts.c (log_resolution): Accept the rule involved in
15120 the sr conflicts instead of the lookahead number that points to
15122 (flush_reduce): Accept the current lookahead vector as argument,
15123 instead of the index in LA.
15124 (resolve_sr_conflict): Accept the current number of lookahead
15125 bitset to consider for the STATE, instead of the index in LA.
15126 (set_conflicts): Adjust.
15127 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
15129 2002-06-15 Akim Demaille <akim@epita.fr>
15131 * src/state.h (state_t): Replace the `lookaheadsp' member, a
15132 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
15133 Adjust all dependencies.
15134 * src/lalr.c (initialize_lookaheads): Split into...
15135 (states_lookaheads_count, states_lookaheads_initialize): these.
15138 2002-06-15 Akim Demaille <akim@epita.fr>
15140 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
15142 (grammar_rules_print): here.
15143 * src/reduce.c (reduce_output): Use it.
15144 * tests/reduce.at (Useless Rules, Reduced Automaton)
15145 (Underivable Rules): Adjust.
15147 2002-06-15 Akim Demaille <akim@epita.fr>
15149 Copy BYacc's nice way to report the grammar.
15151 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
15153 Don't print the rules' location, it is confusing and useless.
15154 (rule_print): Use grammar_rhs_print.
15155 * src/print.c (print_grammar): Use grammar_rules_print.
15157 2002-06-15 Akim Demaille <akim@epita.fr>
15159 Complete and rationalize `useless thing' warnings.
15161 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
15162 (symbol_tag_print): New.
15163 Use them everywhere in place of accessing directly the tag member.
15164 * src/gram.h, src/gram.c (rule_print): New.
15165 Use it where a rule used to be printed `by hand'.
15166 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
15167 (reduce_grammar_tables): Report the useless rules.
15168 (reduce_print): Useless things are a warning, not an error.
15170 * tests/reduce.at (Useless Nonterminals, Useless Rules):
15171 (Reduced Automaton, Underivable Rules): Adjust.
15172 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
15173 * tests/conflicts.at (Unresolved SR Conflicts)
15174 (Solved SR Conflicts): Adjust.
15176 2002-06-15 Akim Demaille <akim@epita.fr>
15178 Let symbols have a location.
15180 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
15182 Adjust all callers.
15183 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
15184 Use location_t, not int.
15185 * src/symtab.c (symbol_check_defined): Take advantage of the
15187 * tests/regression.at (Invalid inputs): Adjust.
15189 2002-06-15 Akim Demaille <akim@epita.fr>
15191 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
15192 (input): Don't try to initialize yylloc here, do it in the
15194 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
15195 * src/gram.h (rule_t): Change line and action_line into location
15196 and action_location, of location_t type.
15197 Adjust all dependencies.
15198 * src/location.h, src/location.c (empty_location): New.
15199 * src/reader.h, src/reader.c (grammar_start_symbol_set)
15200 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
15201 (grammar_current_rule_symbol_append)
15202 (grammar_current_rule_action_append): Expect a location as argument.
15203 * src/reader.c (grammar_midrule_action): Adjust to attach an
15204 action's location as dummy symbol location.
15205 * src/symtab.h, src/symtab.c (startsymbol_location): New.
15206 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
15209 2002-06-14 Akim Demaille <akim@epita.fr>
15211 Grammar declarations may be found in the grammar section.
15213 * src/parse-gram.y (rules_or_grammar_declaration): New.
15214 (declarations): Each declaration may end with a semicolon, not
15216 (grammar_declaration): `"%union"'.
15217 (grammar): Branch to rules_or_grammar_declaration.
15219 2002-06-14 Akim Demaille <akim@epita.fr>
15221 * src/main.c (main): Invoke scanner_free.
15223 2002-06-14 Akim Demaille <akim@epita.fr>
15225 * src/output.c (m4_invoke): Extracted from...
15226 (output_skeleton): here.
15229 2002-06-14 Akim Demaille <akim@epita.fr>
15231 * src/parse-gram.y (directives, directive, gram)
15232 (grammar_directives, precedence_directives, precedence_directive):
15234 (declarations, declaration, grammar, grammar_declaration)
15235 (precedence_declaration, precedence_declarator): these.
15236 (symbol_declaration): New.
15238 2002-06-14 Akim Demaille <akim@epita.fr>
15240 * src/files.c (action_obstack): Remove, unused.
15241 (output_obstack): Remove it, and all its dependencies, as it is no
15243 * src/reader.c (epilogue_set): Build the epilogue in the
15245 * src/output.h, src/output.c (muscle_obstack): Move to...
15246 * src/muscle_tab.h, src/muscle_tab.h: here.
15247 (muscle_init): Initialize muscle_obstack.
15248 (muscle_free): New.
15249 * src/main.c (main): Call it.
15251 2002-06-14 Akim Demaille <akim@epita.fr>
15253 * src/location.h: New, extracted from...
15254 * src/reader.h: here.
15255 * src/Makefile.am (noinst_HEADERS): Merge into
15256 (bison_SOURCES): this.
15258 * src/parse-gram.y: Use location_t instead of Bison's.
15259 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
15260 Use location_t instead of ints.
15262 2002-06-14 Akim Demaille <akim@epita.fr>
15264 * data/bison.simple, data/bison.c++: Be sure to restore the
15265 current #line when returning to the skeleton contents after having
15266 exposed the input file's #line.
15268 2002-06-12 Akim Demaille <akim@epita.fr>
15270 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
15272 * tests/actions.at (Exotic Dollars): New.
15274 2002-06-12 Akim Demaille <akim@epita.fr>
15276 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
15278 * tests/input.at (Torturing the Scanner): New.
15280 2002-06-11 Akim Demaille <akim@epita.fr>
15282 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
15283 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
15284 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
15285 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
15286 * src/reader.c (reader): Use it.
15288 2002-06-11 Akim Demaille <akim@epita.fr>
15290 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
15291 Adjust all callers.
15292 (scanner_last_string_free): New.
15294 2002-06-11 Akim Demaille <akim@epita.fr>
15296 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
15297 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
15298 (last_string, YY_OBS_FREE): New.
15299 Use them when returning an ID.
15301 2002-06-11 Akim Demaille <akim@epita.fr>
15303 Have Bison grammars parsed by a Bison grammar.
15305 * src/reader.c, src/reader.h (prologue_augment): New.
15306 * src/reader.c (copy_definition): Remove.
15308 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
15309 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
15310 (grammar_current_rule_prec_set, grammar_current_rule_check)
15311 (grammar_current_rule_symbol_append)
15312 (grammar_current_rule_action_append): Export.
15313 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
15314 (symbol_list_action_append): Remove.
15315 Hook the routines from reader.
15316 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
15317 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
15319 * src/reader.c (read_declarations): Remove, unused.
15321 * src/parse-gram.y: Handle the epilogue.
15322 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
15323 (grammar_start_symbol_set): this.
15324 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
15325 * src/reader.c (readgram): Remove, unused.
15326 (reader): Adjust to insert eoftoken and axiom where appropriate.
15328 * src/reader.c (copy_dollar): Replace with...
15329 * src/scan-gram.h (handle_dollar): this.
15330 * src/parse-gram.y: Remove `%thong'.
15332 * src/reader.c (copy_at): Replace with...
15333 * src/scan-gram.h (handle_at): this.
15335 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
15338 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
15341 * src/reader.h, src/reader.c (grammar_rule_end): New.
15343 * src/parse.y (current_type, current_class): New.
15344 Implement `%nterm', `%token' support.
15345 Merge `%term' into `%token'.
15346 (string_as_id): New.
15347 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
15350 * src/parse-gram.y: Be sure to handle properly the beginning of
15353 * src/parse-gram.y: Handle %type.
15354 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
15356 * src/parse-gram.y: More directives support.
15357 * src/options.c: No longer handle source directives.
15359 * src/parse-gram.y: Fix %output.
15361 * src/parse-gram.y: Handle %union.
15362 Use the prologue locations.
15363 * src/reader.c (parse_union_decl): Remove.
15365 * src/reader.h, src/reader.c (epilogue_set): New.
15366 * src/parse-gram.y: Use it.
15368 * data/bison.simple, data/bison.c++: b4_stype is now either not
15369 defined, then default to int, or to the contents of %union,
15370 without `union' itself.
15372 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
15374 * src/output.c (actions_output): Don't output braces, as they are
15375 already handled by the scanner.
15377 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
15378 characters to themselves.
15380 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
15381 that the epilogue has a proper #line.
15383 * src/parse-gram.y: Handle precedence/associativity.
15385 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
15387 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
15388 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
15389 at all to define terminals that cannot be emitted.
15391 * src/scan-gram.l: Escape M4 characters.
15393 * src/scan-gram.l: Working properly with escapes in user
15394 strings/characters.
15396 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
15397 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
15399 Use more modest sizes, as for the time being the parser does not
15400 release memory, and therefore the process swallows a huge amount
15403 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
15404 stricter %token grammar.
15406 * src/symtab.h (associativity): Add `undef_assoc'.
15407 (symbol_precedence_set): Do nothing when passed an undef_assoc.
15408 * src/symtab.c (symbol_check_alias_consistence): Adjust.
15410 * tests/regression.at (Invalid %directive): Remove, as it is now
15412 (Invalid inputs): Adjust to the new error messages.
15413 (Token definitions): The new grammar doesn't allow too many
15416 * src/lex.h, src/lex.c: Remove.
15417 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
15418 (copy_character, copy_string2, copy_string, copy_identifier)
15419 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
15420 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
15421 (parse_action): Remove.
15422 * po/POTFILES.in: Adjust.
15424 2002-06-11 Akim Demaille <akim@epita.fr>
15426 * src/reader.c (parse_action): Don't store directly into the
15427 rule's action member: return the action as a string.
15428 Don't require `rule_length' as an argument: compute it.
15429 (grammar_current_rule_symbol_append)
15430 (grammar_current_rule_action_append): New, eved out from
15432 Remove `action_flag', `rulelength', unused now.
15434 2002-06-11 Akim Demaille <akim@epita.fr>
15436 * src/reader.c (grammar_current_rule_prec_set).
15437 (grammar_current_rule_check): New, eved out from...
15439 Remove `xaction', `first_rhs': useless.
15440 * tests/input.at (Type clashes): New.
15441 * tests/existing.at (GNU Cim Grammar): Adjust.
15443 2002-06-11 Akim Demaille <akim@epita.fr>
15445 * src/reader.c (grammar_midrule_action): New, Eved out from
15448 2002-06-11 Akim Demaille <akim@epita.fr>
15450 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
15452 (readgram): Use them as replacement of inlined code, crule and
15455 2002-06-11 Akim Demaille <akim@epita.fr>
15457 * src/reader.c (grammar_end, grammar_symbol_append): New.
15458 (readgram): Use them.
15459 Make the use of `p' as local as possible.
15461 2002-06-10 Akim Demaille <akim@epita.fr>
15463 GCJ's parser requires the tokens to be defined before the prologue.
15465 * data/bison.simple: Output the token definition before the user's
15467 * tests/regression.at (Braces parsing, Duplicate string)
15468 (Mixing %token styles): Check the output from bison.
15469 (Early token definitions): New.
15471 2002-06-10 Akim Demaille <akim@epita.fr>
15473 * src/symtab.c (symbol_user_token_number_set): Don't complain when
15474 assigning twice the same user number to a token, so that we can
15476 * src/lex.c (lex): here.
15477 Also use `symbol_class_set' instead of hand written code.
15478 * src/reader.c (parse_assoc_decl): Likewise.
15480 2002-06-10 Akim Demaille <akim@epita.fr>
15482 * src/symtab.c, src/symtab.c (symbol_class_set)
15483 (symbol_user_token_number_set): New.
15484 * src/reader.c (parse_token_decl): Use them.
15485 Use a switch instead of ifs.
15486 Use a single argument.
15488 2002-06-10 Akim Demaille <akim@epita.fr>
15490 Remove `%thong' support as it is undocumented, unused, duplicates
15491 `%token's job, and creates useless e-mail traffic with people who
15492 want to know what it is, why it is undocumented, unused, and
15493 duplicates `%token's job.
15495 * src/reader.c (parse_thong_decl): Remove.
15496 * src/options.c (option_table): Remove "thong".
15497 * src/lex.h (tok_thong): Remove.
15499 2002-06-10 Akim Demaille <akim@epita.fr>
15501 * src/symtab.c, src/symtab.c (symbol_type_set)
15502 (symbol_precedence_set): New.
15503 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
15504 (value_components_used): Remove, unused.
15506 2002-06-09 Akim Demaille <akim@epita.fr>
15508 Move symbols handling code out of the reader.
15510 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
15511 (axiom): Move to...
15512 * src/symtab.h, src/symtab.c: here.
15514 * src/gram.c (start_symbol): Remove: use startsymbol->number.
15515 * src/reader.c (startval): Rename as...
15516 * src/symtab.h, src/symtab.c (startsymbol): this.
15517 * src/reader.c: Adjust.
15519 * src/reader.c (symbol_check_defined, symbol_make_alias)
15520 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
15521 (token_translations_init)
15523 * src/symtab.c: here.
15524 * src/reader.c (packsymbols): Move to...
15525 * src/symtab.h, src/symtab.c (symbols_pack): here.
15526 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
15529 2002-06-03 Akim Demaille <akim@epita.fr>
15531 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
15534 2002-06-03 Akim Demaille <akim@epita.fr>
15536 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
15537 structs with non literals.
15538 * src/scan-skel.l: never-interactive.
15539 * src/conflicts.c (enum conflict_resolution_e): No trailing
15541 * src/getargs.c (usage): Split long literal strings.
15542 Reported by Hans Aberg.
15544 2002-05-28 Akim Demaille <akim@epita.fr>
15546 * data/bison.c++: Use C++ ostreams.
15547 (cdebug_): New member.
15549 2002-05-28 Akim Demaille <akim@epita.fr>
15551 * src/output.c (output_skeleton): Be sure to allocate enough room
15552 for `/' _and_ for `\0' in full_skeleton.
15554 2002-05-28 Akim Demaille <akim@epita.fr>
15556 * data/bison.c++: Catch up with bison.simple:
15557 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15558 and Paul Eggert <eggert@twinsun.com>: `error' handing.
15559 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
15560 and popping traces.
15562 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15564 * src/output.c (output_skeleton): Put an explicit path in front of
15565 the skeleton file name, rather than relying on the -I directory,
15566 to partially alleviate effects of having a skeleton file lying around
15567 in the current directory.
15569 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15571 * src/conflicts.c (log_resolution): Correct typo:
15572 obstack_printf should be obstack_fgrow1.
15574 2002-05-26 Akim Demaille <akim@epita.fr>
15576 * src/state.h (state_t): `solved_conflicts' is a new member.
15577 * src/LR0.c (new_state): Set it to 0.
15578 * src/conflicts.h, src/conflicts.c (print_conflicts)
15579 (free_conflicts, solve_conflicts): Rename as...
15580 (conflicts_print, conflicts_free, conflicts_solve): these.
15582 * src/conflicts.c (enum conflict_resolution_e)
15583 (solved_conflicts_obstack): New, used by...
15584 (log_resolution): this.
15585 Adjust to attach the conflict resolution to each state.
15586 Complete the description with the precedence/associativity
15588 (resolve_sr_conflict): Adjust.
15589 * src/print.c (print_state): Output its solved_conflicts.
15590 * tests/conflicts.at (Unresolved SR Conflicts)
15591 (Solved SR Conflicts): Exercise --report=all.
15593 2002-05-26 Akim Demaille <akim@epita.fr>
15595 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
15596 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
15597 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
15598 (token_number_t, item_number_as_token_number)
15599 (token_number_as_item_number, muscle_insert_token_number_table):
15601 (symbol_number_t, item_number_as_symbol_number)
15602 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
15603 these, since it is more appropriate.
15605 2002-05-26 Akim Demaille <akim@epita.fr>
15607 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
15609 * data/bison.simple (yystos) [YYDEBUG]: New.
15610 (yyparse) [YYDEBUG]: Display the symbols which are popped during
15612 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
15614 2002-05-25 Akim Demaille <akim@epita.fr>
15616 * doc/bison.texinfo (Debugging): Split into...
15617 (Tracing): this new section, its former contents, and...
15618 (Understanding): this new section.
15619 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
15621 (report_flag): this.
15622 Adjust all dependencies.
15623 (report_args, report_types, report_argmatch): New.
15624 (usage, getargs): Report/support -r, --report.
15626 (struct option_table_struct): Rename as..,
15627 (struct option_table_s): this.
15628 Rename the `set_flag' member to `flag' to match with getopt_long's
15630 * src/options.c (option_table): Split verbose into an entry for
15631 %verbose, and another for --verbose.
15632 Support --report/-r, so remove -r from the obsolete --raw.
15633 * src/print.c: Attach full item sets and lookaheads reports to
15634 report_flag instead of trace_flag.
15635 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
15637 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15638 and Paul Eggert <eggert@twinsun.com>
15640 * data/bison.simple (yyparse): Correct error handling to conform to
15641 POSIX and yacc. Specifically, after syntax error is discovered,
15642 do not reduce further before shifting the error token.
15643 Clean up the code a bit by removing the labels yyerrdefault,
15644 yyerrhandle, yyerrpop.
15645 * NEWS: Document the above.
15647 2002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15649 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
15650 type; it isn't always big enough, since it doesn't necessarily
15651 include non-terminals.
15652 (yytranslate): Expand definition of yy_token_number_type, so that
15653 the latter can be removed.
15654 (yy_token_number_type): Remove, only one use.
15655 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
15656 don't use TokenNumberType as element type.
15658 * tests/regression.at: Modify expected output to agree with change
15659 to yyr1 and yytranslate.
15661 2002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
15663 * src/reader.c (parse_action): Use copy_character instead of
15666 2002-05-13 Akim Demaille <akim@epita.fr>
15668 * tests/regression.at (Token definitions): Prototype yylex and
15671 2002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15673 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
15674 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
15676 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
15678 2002-05-07 Akim Demaille <akim@epita.fr>
15680 * tests/synclines.at: Be sure to prototype yylex and yyerror to
15681 avoid GCC warnings.
15683 2002-05-07 Akim Demaille <akim@epita.fr>
15687 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
15688 over the RHS of each rule.
15689 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
15690 * src/state.h (state_t): Member `nitems' is unsigned short.
15691 * src/LR0.c (get_state): Adjust.
15692 * src/reader.c (packgram): Likewise.
15693 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
15695 (muscle_insert_int_table): Remove, unused.
15696 (prepare_rules): Remove `max'.
15698 2002-05-06 Akim Demaille <akim@epita.fr>
15700 * src/closure.c (print_firsts): Display of the symbol tags.
15701 (bitmatrix_print): Move to...
15702 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
15704 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
15706 2002-05-06 Akim Demaille <akim@epita.fr>
15708 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
15711 2002-05-06 Akim Demaille <akim@epita.fr>
15713 * src/LR0.c (new_state, get_state): Instead of using the global
15714 `kernel_size' and `kernel_base', have two new arguments:
15715 `core_size' and `core'.
15718 2002-05-06 Akim Demaille <akim@epita.fr>
15720 * src/reader.c (packgram): No longer end `ritem' with a 0
15721 sentinel: it is not used.
15723 2002-05-05 Akim Demaille <akim@epita.fr>
15725 New experimental feature: display the lookaheads in the report and
15728 * src/print (print_core): When --trace-flag, display the rules
15730 * src/print_graph.c (print_core): Likewise.
15731 Swap the arguments.
15734 2002-05-05 Akim Demaille <akim@epita.fr>
15736 * tests/torture.at (Many lookaheads): New test.
15738 2002-05-05 Akim Demaille <akim@epita.fr>
15740 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
15741 (GENERATE_MUSCLE_INSERT_TABLE): this.
15742 (output_int_table, output_unsigned_int_table, output_short_table)
15743 (output_token_number_table, output_item_number_table): Replace with...
15744 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
15745 (muscle_insert_short_table, muscle_insert_token_number_table)
15746 (muscle_insert_item_number_table): these.
15747 Adjust all callers.
15748 (prepare_tokens): Don't free `translations', since...
15749 * src/reader.h, src/reader.c (grammar_free): do it.
15751 * src/gram.h, src/gram.c (grammar_free): here.
15752 * data/bison.simple, data/bison.c++: b4_token_number_max is now
15755 2002-05-05 Akim Demaille <akim@epita.fr>
15757 * src/output.c (output_unsigned_int_table): New.
15758 (prepare_rules): `i' is unsigned.
15759 `prhs', `rline', `r2' are unsigned int.
15760 Rename muscle `rhs_number_max' as `rhs_max'.
15761 Output muscles `prhs_max', `rline_max', and `r2_max'.
15763 * data/bison.simple, data/bison.c++: Adjust to use these muscles
15764 to compute types instead of constant types.
15765 * tests/regression.at (Web2c Actions): Adjust.
15767 2002-05-04 Akim Demaille <akim@epita.fr>
15769 * src/symtab.h (SALIAS, SUNDEF): Rename as...
15770 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
15771 Adjust dependencies.
15772 * src/output.c (token_definitions_output): Be sure not to output a
15773 `#define 'a'' when fed with `%token 'a' "a"'.
15774 * tests/regression.at (Token definitions): New.
15776 2002-05-03 Paul Eggert <eggert@twinsun.com>
15778 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
15781 2002-05-03 gettextize <bug-gnu-gettext@gnu.org>
15783 * Makefile.am (SUBDIRS): Remove intl.
15784 (EXTRA_DIST): Add config/config.rpath.
15786 2002-05-03 Akim Demaille <akim@epita.fr>
15788 * data/bison.simple (m4_if): Don't output empty enums.
15789 And actually, output valid enum definitions :(.
15791 2002-05-03 Akim Demaille <akim@epita.fr>
15793 * configure.bat: Remove, completely obsolete.
15794 * Makefile.am (EXTRA_DIST): Adjust.
15795 Don't distribute config.rpath...
15796 * config/Makefile.am (EXTRA_DIST): Do it.
15798 2002-05-03 Akim Demaille <akim@epita.fr>
15800 * configure.in (GETTEXT_VERSION): New.
15801 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
15803 2002-05-03 Akim Demaille <akim@epita.fr>
15805 * data/bison.simple (b4_token_enum): New.
15806 (b4_token_defines): Use it to output tokens both as #define and
15808 Suggested by Paul Eggert.
15809 * src/output.c (token_definitions_output): Don't output spurious
15812 2002-05-03 Akim Demaille <akim@epita.fr>
15814 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
15816 2002-05-02 Robert Anisko <robert@lrde.epita.fr>
15818 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
15819 Update the stack class, give a try to deque as the default container.
15821 2002-05-02 Akim Demaille <akim@epita.fr>
15823 * data/bison.simple (yyparse): Do not implement @$ = @1.
15824 (YYLLOC_DEFAULT): Adjust to do it.
15825 * doc/bison.texinfo (Location Default Action): Fix.
15827 2002-05-02 Akim Demaille <akim@epita.fr>
15829 * src/reader.c (parse_braces): Merge into...
15830 (parse_action): this.
15832 2002-05-02 Akim Demaille <akim@epita.fr>
15834 * configure.in (ALL_LINGUAS): Remove.
15835 * po/LINGUAS, hr.po: New.
15837 2002-05-02 Akim Demaille <akim@epita.fr>
15839 Remove the so called hairy (semantic) parsers.
15841 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
15842 * src/gram.h, src/gram.c (semantic_parser): Remove.
15843 (rule_t): Remove the guard and guard_line members.
15844 * src/lex.h (token_t): remove tok_guard.
15845 * src/options.c (option_table): Remove %guard and %semantic_parser
15847 * src/output.c, src/output.h (guards_output): Remove.
15849 (token_definitions_output): Don't output the `T'
15851 (output_skeleton): Don't output the guards.
15852 * src/files.c, src/files.c (attrsfile): Remove.
15853 * src/reader.c (symbol_list): Remove the guard and guard_line
15855 Adjust dependencies.
15856 (parse_guard): Remove.
15857 * data/bison.hairy: Remove.
15858 * doc/bison.texinfo (Environment Variables): Remove occurrences of
15861 2002-05-02 Akim Demaille <akim@epita.fr>
15863 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
15864 (parse_guard): Rename the formal argument `stack_offset' as
15865 `rule_length', which is more readable.
15867 (copy_at, copy_dollar): Instead of outputting the hard coded
15868 values of $$, $n and so forth, output invocation to b4_lhs_value,
15869 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
15870 Note: this patch partially drops `semantic-parser' support: it
15871 always does `rule_length - n', where semantic parsers ought to
15873 * data/bison.simple, data/bison.c++ (b4_lhs_value)
15874 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
15876 2002-05-02 Akim Demaille <akim@epita.fr>
15878 * configure.in (AC_INIT): Bump to 1.49b.
15879 (AM_INIT_AUTOMAKE): Short invocation.
15881 2002-05-02 Akim Demaille <akim@epita.fr>
15885 2002-05-01 Akim Demaille <akim@epita.fr>
15887 * src/skeleton.h: Remove.
15889 2002-05-01 Akim Demaille <akim@epita.fr>
15891 * src/skeleton.h: Fix the #endif.
15892 Reported by Magnus Fromreide.
15894 2002-04-26 Paul Eggert <eggert@twinsun.com>
15896 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
15897 Define if we define YYSTYPE and YYLTYPE, respectively.
15898 (YYCOPY): Fix [] quoting problem in the non-GCC case.
15900 2002-04-25 Robert Anisko <robert@lrde.epita.fr>
15902 * src/scan-skel.l: Postprocess quadrigraphs.
15904 * src/reader.c (copy_character): New function, used to output
15905 single characters while replacing `[' and `]' with quadrigraphs, to
15906 avoid troubles with M4 quotes.
15907 (copy_comment): Output characters with copy_character.
15908 (read_additionnal_code): Likewise.
15909 (copy_string2): Likewise.
15910 (copy_definition): Likewise.
15912 * tests/calc.at: Exercise M4 quoting.
15914 2002-04-25 Akim Demaille <akim@epita.fr>
15916 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
15917 between `!' and the command.
15918 Reported by Paul Eggert.
15920 2002-04-24 Robert Anisko <robert@lrde.epita.fr>
15922 * tests/calc.at: Exercise prologue splitting.
15924 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
15925 `b4_post_prologue' instead of `b4_prologue'.
15927 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
15929 (output): Free pre_prologue_obstack and post_prologue_obstack.
15930 * src/files.h, src/files.c (attrs_obstack): Remove.
15931 (pre_prologue_obstack, post_prologue_obstack): New.
15932 * src/reader.c (copy_definition): Add a parameter to specify the
15933 obstack to fill, instead of using attrs_obstack unconditionally.
15934 (read_declarations): Pass pre_prologue_obstack to copy_definition if
15935 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
15937 2002-04-23 Paul Eggert <eggert@twinsun.com>
15939 * data/bison.simple: Remove unnecessary commentary and white
15940 space differences from 1_29-branch.
15941 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
15943 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
15944 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
15945 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
15946 constructors or destructors.
15948 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
15950 2002-04-23 Akim Demaille <akim@epita.fr>
15952 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
15953 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
15954 location with columns.
15955 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
15956 All reported by Paul Eggert.
15958 2002-04-22 Akim Demaille <akim@epita.fr>
15960 * src/reduce.c (dump_grammar): Move to...
15961 * src/gram.h, src/gram.c (grammar_dump): here.
15962 Be sure to separate long item numbers.
15963 Don't read the members of a rule's prec if its nil.
15965 2002-04-22 Akim Demaille <akim@epita.fr>
15967 * src/output.c (table_size, table_grow): New.
15968 (MAXTABLE): Remove, replace uses with table_size.
15969 (pack_vector): Instead of dying when the table is too big, grow it.
15971 2002-04-22 Akim Demaille <akim@epita.fr>
15973 * data/bison.simple (yyr1): Its type is that of a token number.
15974 * data/bison.c++ (r1_): Likewise.
15975 * tests/regression.at (Web2c Actions): Adjust.
15977 2002-04-22 Akim Demaille <akim@epita.fr>
15979 * src/reader.c (token_translations_init): 256 is now the default
15980 value for the error token, i.e., it will be assigned another
15981 number if the user assigned 256 to one of her tokens.
15982 (reader): Don't force 256 to error.
15983 * doc/bison.texinfo (Symbols): Adjust.
15984 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
15985 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
15986 etc. instead of 10, 20, 30 (which was used to `jump' over error
15987 (256) and undefined (2)).
15989 2002-04-22 Akim Demaille <akim@epita.fr>
15991 Propagate more token_number_t.
15993 * src/gram.h (token_number_as_item_number)
15994 (item_number_as_token_number): New.
15995 * src/output.c (GENERATE_OUTPUT_TABLE): New.
15996 Use it to create output_item_number_table and
15997 output_token_number_table.
15998 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
15999 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
16000 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
16001 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
16003 2002-04-22 Akim Demaille <akim@epita.fr>
16005 * src/output.h, src/output.c (get_lines_number): Remove.
16007 2002-04-19 Akim Demaille <akim@epita.fr>
16009 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
16011 (Debugging): More details about enabling the debugging features.
16012 (Table of Symbols): Describe $$, $n, @$, and @n.
16013 Suggested by Tim Josling.
16015 2002-04-19 Akim Demaille <akim@epita.fr>
16017 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
16019 2002-04-10 Akim Demaille <akim@epita.fr>
16021 * src/system.h: Rely on HAVE_LIMITS_H.
16022 Suggested by Paul Eggert.
16024 2002-04-09 Akim Demaille <akim@epita.fr>
16026 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
16027 full stderr, and strip it according to the bison options, instead
16028 of composing the error message from different bits.
16029 This makes it easier to check for several error messages.
16030 Adjust all the invocations.
16031 Add an invocation exercising the error token.
16032 Add an invocation demonstrating a stupid error message.
16033 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
16035 Error message are for stderr, not stdout.
16037 2002-04-09 Akim Demaille <akim@epita.fr>
16039 * src/gram.h, src/gram.c (error_token_number): Remove, use
16041 * src/reader.c (reader): Don't specify the user token number (2)
16042 for $undefined, as it uselessly prevents using it.
16043 * src/gram.h (token_number_t): Move to...
16044 * src/symtab.h: here.
16045 (state_t.number): Is a token_number_t.
16046 * src/print.c, src/reader.c: Use undeftoken->number instead of
16048 (Even though this 2 is not the same as above: the number of the
16049 undeftoken remains being 2, it is its user token number which
16051 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
16052 `user_token_number_max'.
16053 Output `undef_token_number'.
16054 * data/bison.simple, data/bison.c++: Use them.
16055 Be sure to map invalid yylex return values to
16056 `undef_token_number'. This saves us from gratuitous SEGV.
16058 * tests/conflicts.at (Solved SR Conflicts)
16059 (Unresolved SR Conflicts): Adjust.
16060 * tests/regression.at (Web2c Actions): Adjust.
16062 2002-04-08 Akim Demaille <akim@epita.fr>
16064 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
16066 Remove the duplicate `typedefs'.
16067 (RhsNumberType): Fix the declaration and various other typos.
16069 * data/bison.simple: Use __ofile__.
16070 * src/scan-skel.l: Handle __ofile__.
16072 2002-04-08 Akim Demaille <akim@epita.fr>
16074 * src/gram.h (item_number_t): New, the type of item numbers in
16075 RITEM. Note that it must be able to code symbol numbers as
16076 positive number, and the negation of rule numbers as negative
16078 Adjust all dependencies (pretty many).
16079 * src/reduce.c (rule): Remove this `short *' pointer: use
16081 * src/system.h (MINSHORT, MAXSHORT): Remove.
16082 Include `limits.h'.
16083 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
16084 (shortcpy): Remove.
16085 (MAXTABLE): Move to...
16086 * src/output.c (MAXTABLE): here.
16087 (prepare_rules): Use output_int_table to output rhs.
16088 * data/bison.simple, data/bison.c++: Adjust.
16089 * tests/torture.at (Big triangle): Move the limit from 254 to
16091 * tests/regression.at (Web2c Actions): Ajust.
16093 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
16094 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
16095 passes, but produces negative #line number, once fixed, GCC is
16096 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
16098 * src/state.h (state_h): Code input lines on ints, not shorts.
16100 2002-04-08 Akim Demaille <akim@epita.fr>
16102 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
16103 and then the grammar.
16105 2002-04-08 Akim Demaille <akim@epita.fr>
16107 * src/system.h: No longer using strndup.
16109 2002-04-07 Akim Demaille <akim@epita.fr>
16111 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
16112 * src/output.c (output_table_data): Return the longest number.
16113 (prepare_tokens): Output `token_number_max').
16114 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
16116 Use them to define yy_token_number_type/TokenNumberType.
16117 Use this type for yytranslate.
16118 * tests/torture.at (Big triangle): Push the limit from 124 to
16120 * tests/regression.at (Web2c Actions): Adjust.
16122 2002-04-07 Akim Demaille <akim@epita.fr>
16124 * tests/torture.at (Big triangle): New.
16125 (GNU AWK Grammar, GNU Cim Grammar): Move to...
16126 * tests/existing.at: here.
16128 2002-04-07 Akim Demaille <akim@epita.fr>
16130 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
16132 Adjust dependencies.
16134 2002-04-07 Akim Demaille <akim@epita.fr>
16136 * src/reader.c: Normalize increments to prefix form.
16138 2002-04-07 Akim Demaille <akim@epita.fr>
16140 * src/reader.c, symtab.c: Remove debugging code.
16142 2002-04-07 Akim Demaille <akim@epita.fr>
16144 Rename all the `bucket's as `symbol_t'.
16146 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
16147 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
16148 * src/symtab.c, src/symtab.h (bucket): Rename as...
16150 (symbol_list_new, bucket_check_defined, bucket_make_alias)
16151 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
16152 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
16153 (buckets_new, buckets_free, buckets_do): Rename as...
16154 (symbol_list_new, symbol_check_defined, symbol_make_alias)
16155 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
16156 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
16157 (symbols_new, symbols_free, symbols_do): these.
16159 2002-04-07 Akim Demaille <akim@epita.fr>
16161 Use lib/hash for the symbol table.
16163 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
16165 * src/lex.c (lex): Set the `number' member of new terminals.
16166 * src/reader.c (bucket_check_defined, bucket_make_alias)
16167 (bucket_check_alias_consistence, bucket_translation): New.
16168 (reader, grammar_free, readgram, token_translations_init)
16169 (packsymbols): Adjust.
16170 (reader): Number the predefined tokens.
16171 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
16172 for predefined tokens.
16173 * src/symtab.h (bucket): Remove all the hash table related
16175 * src/symtab.c (symtab): Replace by...
16176 (bucket_table): this.
16177 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
16178 (buckets_new, buckets_do): New.
16180 2002-04-07 Akim Demaille <akim@epita.fr>
16182 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
16183 (start_symbol, max_user_token_number, semantic_parser)
16184 (error_token_number): Initialize.
16185 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
16188 (errtoken, eoftoken, undeftoken, axiom): Extern.
16190 2002-04-07 Akim Demaille <akim@epita.fr>
16192 * src/gram.h (rule_s): prec and precsym are now pointers
16193 to the bucket giving the priority/associativity.
16194 Member `associativity' removed: useless.
16195 * src/reduce.c, src/conflicts.c: Adjust.
16197 2002-04-07 Akim Demaille <akim@epita.fr>
16199 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
16200 Properly escape the symbols' TAG when outputting them.
16202 2002-04-07 Akim Demaille <akim@epita.fr>
16204 * src/lalr.h (LA): Is a bitsetv, not bitset*.
16206 2002-04-07 Akim Demaille <akim@epita.fr>
16208 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
16209 (LArule): this, which is an array to rule_t*.
16210 * src/print.c, src/conflicts.c: Adjust.
16212 2002-04-07 Akim Demaille <akim@epita.fr>
16214 * src/gram.h (rule_t): Rename `number' as `user_number'.
16215 `number' is a new member.
16216 Adjust dependencies.
16217 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
16219 2002-04-07 Akim Demaille <akim@epita.fr>
16221 As a result of the previous patch, it is no longer needed
16222 to reorder ritem itself.
16224 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
16226 2002-04-07 Akim Demaille <akim@epita.fr>
16228 Be sure never to walk through RITEMS, but use only data related to
16229 the rules themselves. RITEMS should be banished.
16231 * src/output.c (output_token_translations): Rename as...
16232 (prepare_tokens): this.
16233 In addition to `translate', prepare the muscles `tname' and
16234 `toknum', which were handled by...
16235 (output_rule_data): this.
16236 Remove, and move the remainder of its outputs into...
16237 (prepare_rules): this new routines, which also merges content from
16238 (output_gram): this.
16239 (prepare_rules): Be sure never to walk through RITEMS.
16240 (output_stos): Rename as...
16241 (prepare_stos): this.
16242 (output): Always invoke prepare_states, after all, just don't use it
16243 in the output if you don't need it.
16245 2002-04-07 Akim Demaille <akim@epita.fr>
16247 * src/LR0.c (new_state): Display `nstates' as the name of the
16248 newly created state.
16249 Adjust to initialize first_state and last_state if needed.
16250 Be sure to distinguish the initial from the final state.
16251 (new_states): Create the itemset of the initial state, and use
16253 * src/closure.c (closure): Now that the initial state has its
16254 items properly set, there is no need for a special case when
16255 creating `ruleset'.
16257 As a result, now the rule 0, reducing to $axiom, is visible in the
16258 outputs. Adjust the test suite.
16260 * tests/conflicts.at (Solved SR Conflicts)
16261 (Unresolved SR Conflicts): Adjust.
16262 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
16263 * tests/conflicts.at (S/R in initial): New.
16265 2002-04-07 Akim Demaille <akim@epita.fr>
16267 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
16268 the RHS of the rules.
16269 * src/output.c (output_gram): Likewise.
16271 2002-04-07 Akim Demaille <akim@epita.fr>
16273 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
16275 Adjust all dependencies.
16276 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
16277 `number' of the buckets too.
16278 * src/gram.h: Include `symtab.h'.
16279 (associativity): Move to...
16280 * src/symtab.h: here.
16281 No longer include `gram.h'.
16283 2002-04-07 Akim Demaille <akim@epita.fr>
16285 * src/gram.h, src/gram.c (rules_rhs_length): New.
16286 (ritem_longest_rhs): Use it.
16287 * src/gram.h (rule_t): `number' is a new member.
16288 * src/reader.c (packgram): Set it.
16289 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
16290 the end of `rules', and count them out of `nrules'.
16291 (reduce_output, dump_grammar): Adjust.
16292 * src/print.c (print_grammar): It is no longer needed to check for
16293 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
16294 * tests/reduce.at (Reduced Automaton): New test.
16296 2002-04-07 Akim Demaille <akim@epita.fr>
16298 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
16299 lacking `+ 1' to nrules, Bison reported as useless a token if it
16300 was used solely to set the precedence of the last rule...
16302 2002-04-07 Akim Demaille <akim@epita.fr>
16304 * data/bison.c++, data/bison.simple: Don't output the current file
16305 name in #line, to avoid useless diffs between two identical
16306 outputs under different names.
16308 2002-04-07 Akim Demaille <akim@epita.fr>
16310 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
16311 Normalize loops to using `< nrules + 1', not `<= nrules'.
16313 2002-04-07 Akim Demaille <akim@epita.fr>
16317 2002-04-07 Akim Demaille <akim@epita.fr>
16319 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
16320 bucket.value as bucket.number.
16322 2002-04-07 Akim Demaille <akim@epita.fr>
16324 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
16325 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
16326 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
16327 RHS, instead of being an index in RITEMS.
16329 2002-04-04 Paul Eggert <eggert@twinsun.com>
16331 * doc/bison.texinfo: Update copyright date.
16332 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
16333 (Symbols): Warn about running Bison in one character set,
16334 but compiling and/or running in an incompatible one.
16335 Warn about character code 256, too.
16337 2002-04-03 Paul Eggert <eggert@twinsun.com>
16339 * src/bison.data (YYSTACK_ALLOC): Depend on whether
16340 YYERROR_VERBOSE is nonzero, not whether it is defined.
16342 Merge changes from bison-1_29-branch.
16344 2002-03-20 Paul Eggert <eggert@twinsun.com>
16346 Merge fixes from Debian bison_1.34-1.diff.
16348 * configure.in (AC_PREREQ): 2.53.
16350 2002-03-20 Akim Demaille <akim@epita.fr>
16352 * src/conflicts.c (log_resolution): Argument `resolution' is const.
16354 2002-03-19 Paul Eggert <eggert@twinsun.com>
16356 * src/bison.simple (YYCOPY): New macro.
16357 (YYSTACK_RELOCATE): Use it.
16358 Remove Type arg; no longer needed. All callers changed.
16359 (yymemcpy): Remove; no longer needed.
16361 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
16362 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
16364 2002-03-19 Akim Demaille <akim@epita.fr>
16366 Test and fix the #line outputs.
16368 * tests/atlocal.at (GCC): New.
16369 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
16370 (Prologue synch line, %union synch line, Postprologue synch line)
16371 (Action synch line, Epilogue synch line): New tests.
16372 * src/reader.c (parse_union_decl): Define the muscle stype_line.
16373 * data/bison.simple, data/bison.c++: Use it.
16375 2002-03-19 Akim Demaille <akim@epita.fr>
16377 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
16378 (Solved SR Conflicts, %expect not enough, %expect right)
16379 (%expect too much): Move to...
16380 * tests/conflicts.at: this new file.
16382 2002-03-19 Akim Demaille <akim@epita.fr>
16384 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
16385 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
16386 that we can move to enums for instance.
16387 * src/output.c (token_definitions_output): Output a list of
16388 `token-name, token-number' instead of the #define.
16389 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
16391 2002-03-14 Akim Demaille <akim@epita.fr>
16393 Use Gettext 0.11.1.
16395 2002-03-09 Robert Anisko <robert@lrde.epita.fr>
16397 * data/bison.c++: Make the user able to add members to the generated
16398 parser by subclassing.
16400 2002-03-05 Robert Anisko <robert@lrde.epita.fr>
16402 * src/reader.c (read_additionnal_code): `c' should be an integer, not
16404 Reported by Nicolas Tisserand and Nicolas Burrus.
16406 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
16408 * src/reader.c: Warn about lacking semi-colons, do not complain.
16410 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
16412 * data/bison.c++: Remove a debug line.
16414 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
16416 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
16417 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
16418 provide a default implementation.
16420 2002-03-04 Akim Demaille <akim@epita.fr>
16422 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
16423 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
16424 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
16425 * tests/semantic.at (Parsing Guards): Similarly.
16426 * src/reader.at (readgram): Complain if the last rule is not ended
16429 2002-03-04 Akim Demaille <akim@epita.fr>
16431 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
16432 * src/closure.c: here.
16433 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
16435 * src/warshall.h, src/warshall.c: Remove.
16436 * tests/sets.at (Broken Closure): Adjust.
16438 2002-03-04 Akim Demaille <akim@epita.fr>
16440 * src/output.c (output_skeleton): tempdir is const.
16441 bytes_read is unused.
16443 2002-03-04 Akim Demaille <akim@epita.fr>
16445 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
16446 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
16448 From Michael Hayes.
16450 2002-03-04 Akim Demaille <akim@epita.fr>
16452 * src/closure.c (closure): `r' is unused.
16454 2002-03-04 Akim Demaille <akim@epita.fr>
16456 * tests/sets.at (Broken Closure): Add the ending `;'.
16457 * src/reader.at (readgram): Complain if a rule is not ended with a
16460 2002-03-04 Akim Demaille <akim@epita.fr>
16462 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
16463 (count_sr_conflicts): Use bitset_count.
16464 * src/reduce.c (inaccessable_symbols): Ditto.
16465 (bits_size): Remove.
16466 * src/warshall.h, src/warshall.c: Convert to bitsetv.
16468 2002-03-04 Akim Demaille <akim@epita.fr>
16470 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
16471 * src/reduce.c: Remove the `bitset_zero's following the
16472 `bitset_create's, as now it is performed by the latter.
16474 2002-03-04 Akim Demaille <akim@epita.fr>
16476 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
16477 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
16478 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
16479 latest sources from Michael.
16481 2002-03-04 Akim Demaille <akim@epita.fr>
16483 * src/output.c (output): Don't free the grammar.
16484 * src/reader.c (grammar_free): New.
16485 * src/main.c (main): Call it and don't free symtab here.
16487 2002-03-04 Akim Demaille <akim@epita.fr>
16489 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
16491 Reported by Benoit Perrot.
16493 2002-03-04 Akim Demaille <akim@epita.fr>
16495 Use bitset operations when possible, not loops over bits.
16497 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
16499 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
16500 * src/reduce.c (useless_nonterminals): Formatting changes.
16501 * src/warshall.c (TC): Use bitset_or.
16503 2002-03-04 Akim Demaille <akim@epita.fr>
16505 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
16506 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
16509 2002-03-04 Akim Demaille <akim@epita.fr>
16511 * src/lalr.c (F): Now a bitset*.
16512 Adjust all dependencies.
16514 2002-03-04 Akim Demaille <akim@epita.fr>
16516 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
16517 Adjust all dependencies.
16519 2002-03-04 Akim Demaille <akim@epita.fr>
16521 * src/L0.c, src/LR0.h (nstates): Be size_t.
16522 Adjust comparisons (signed vs unsigned).
16523 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
16525 Adjust all dependencies.
16527 2002-03-04 Akim Demaille <akim@epita.fr>
16529 * src/closure.c (firsts): Now, also a bitset.
16530 Adjust all dependencies.
16531 (varsetsize): Remove, now unused.
16532 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
16534 2002-03-04 Akim Demaille <akim@epita.fr>
16536 * src/print.c: Convert to use bitset.h, not hand coded iterations
16539 2002-03-04 Akim Demaille <akim@epita.fr>
16541 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
16543 2002-03-04 Akim Demaille <akim@epita.fr>
16545 * src/closure.c (ruleset): Be a bitset.
16546 (rulesetsize): Remove.
16548 2002-03-04 Akim Demaille <akim@epita.fr>
16550 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
16551 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
16552 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
16553 * src/closure.c (fderives): Be an array of bitsets.
16555 2002-02-28 Robert Anisko <robert@lrde.epita.fr>
16557 * data/bison.c++: Merge the two generated headers. Insert a copyright
16558 notice in each output file.
16560 2002-02-28 Akim Demaille <akim@epita.fr>
16562 * data/bison.c++: Copy the prologue of bison.simple to fetch
16563 useful M4 definitions, such as b4_header_guard.
16565 2002-02-25 Akim Demaille <akim@epita.fr>
16567 * src/getargs.c (version): Give the name of the authors, and use a
16568 translator friendly scheme for the bgr
16571 2002-02-25 Akim Demaille <akim@epita.fr>
16573 * src/output.c (header_output): Remove, now handled completely via
16576 2002-02-25 Akim Demaille <akim@epita.fr>
16578 * m4/m4.m4: New, from CVS Autoconf.
16579 * configure.in: Invoke it.
16580 * src/output.c (output_skeleton): Use its result instead of the
16583 2002-02-25 Akim Demaille <akim@epita.fr>
16585 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
16587 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
16588 * src/output.c (output_skeleton): Use mkstemp to create a real
16590 Move the filling of `skeleton' and its muscle to...
16592 (output): Move the definition of the prologue muscle to...
16594 * src/system.h (DEFAULT_TMPDIR): New.
16596 2002-02-14 Paul Eggert <eggert@twinsun.com>
16598 Remove the support for C++ namespace cleanliness; it was
16599 causing more problems than it was curing, since it didn't work
16600 properly on some nonstandard C++ compilers. This can wait
16601 for a proper C++ parser.
16603 * NEWS: Document this.
16604 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
16605 of C++, as it's treated like C now.
16606 * src/bison.simple (YYSTD): Remove.
16607 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
16608 Treat C++ just like Standard C instead of trying to support
16609 namespace cleanliness.
16611 2002-02-14 Akim Demaille <akim@epita.fr>
16613 * tests/regression.at (else): Adjust to Andreas' change.
16615 2002-02-14 Akim Demaille <akim@epita.fr>
16617 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
16619 2002-02-13 Andreas Schwab <schwab@suse.de>
16621 * src/output.c (output_rule_data): Don't output NULL, it might
16622 not be defined yet.
16624 2002-02-11 Robert Anisko <robert@lrde.epita.fr>
16626 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
16627 (Copyright notice): Update.
16629 2002-02-11 Akim Demaille <akim@epita.fr>
16631 * tests/regression.at (%nonassoc and eof): Don't include
16632 nonportable headers.
16634 2002-02-08 Robert Anisko <robert@lrde.epita.fr>
16636 * data/bison.c++: Correct error recovery. Make the user able to
16637 initialize the starting location.
16639 2002-02-07 Akim Demaille <akim@epita.fr>
16641 * tests/input.at: New.
16643 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
16645 * data/bison.c++: Replace some direct m4 expansions by constants. Be
16646 more consistent when naming methods and variables. Put preprocessor
16647 directives around tables only needed for debugging.
16649 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
16651 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
16653 (yy::b4_name::parse): Use print_.
16655 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
16657 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
16659 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
16661 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
16663 (yy::b4_name::parse): Build verbose error messages, and use error_.
16665 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
16667 * data/bison.c++: Fix m4 quoting in comments.
16669 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
16671 * data/bison.c++: Adjust the parser code. Fix some muscles that were
16672 not expanded by m4.
16674 2002-02-05 Akim Demaille <akim@epita.fr>
16676 * data/bison.c++: Adjust to the M4 back end.
16677 More is certainly needed.
16679 2002-02-05 Akim Demaille <akim@epita.fr>
16681 Give a try to M4 as a back end.
16683 * lib/readpipe.c: New, from wdiff.
16684 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
16686 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
16687 specific values. Now it is m4 that performs the lookup.
16688 * src/parse-skel.y: Remove.
16689 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
16690 * src/output.c (actions_output, guards_output)
16691 (token_definitions_output): No longer keeps track of the output
16692 line number, hence remove the second argument.
16693 (guards_output): Check against the guard member of a rule, not the
16696 (output_skeleton): Don't look for the skeleton location, let m4 do
16698 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
16700 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
16701 (prepare): Given that for the time being changesyntax is not
16702 usable in M4, rename the muscles using `-' to `_'.
16703 Define `defines_flag', `output_parser_name' and `output_header_name'.
16704 * src/output.h (actions_output, guards_output)
16705 (token_definitions_output): Adjust prototypes.
16706 * src/scan-skel.l: Instead of scanning the skeletons, it now
16707 processes the output of m4: `__oline__' and `#output'.
16708 * data/bison.simple: Adjust to be used by M4(sugar).
16709 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
16711 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
16712 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
16713 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
16714 shamelessly stolen from CVS Autoconf.
16716 2002-02-05 Akim Demaille <akim@epita.fr>
16718 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
16719 * configure.in: Check for the declarations of free and malloc.
16720 * src/muscle_tab.c: Adjust.
16722 2002-02-05 Akim Demaille <akim@epita.fr>
16724 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
16725 which have no values.
16727 2002-02-05 Akim Demaille <akim@epita.fr>
16729 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
16732 2002-01-29 Paul Eggert <eggert@twinsun.com>
16734 * src/bison.simple (YYSIZE_T): Do not define merely because
16735 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
16736 On some platforms, <alloca.h> does not declare YYSTD (size_t).
16738 2002-01-27 Akim Demaille <akim@epita.fr>
16740 Fix `%nonassoc and eof'.
16742 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
16743 which were not properly copied! Replace
16744 memcpy (res->errs, src->errs, src->nerrs);
16746 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
16748 * tests/regression.at (%nonassoc and eof): Adjust to newest
16749 Autotest: `.' is not in the PATH.
16751 2002-01-27 Akim Demaille <akim@epita.fr>
16753 * tests/sets.at (AT_EXTRACT_SETS): New.
16754 (Nullable): Use it.
16757 2002-01-26 Akim Demaille <akim@epita.fr>
16759 * tests/actions.at, tests/calc.at, tests/headers.at,
16760 * tests/torture.at: Adjust to the newest Autotest which no longer
16761 forces `.' in the PATH.
16763 2002-01-25 Akim Demaille <akim@epita.fr>
16765 * tests/regression.at (%nonassoc and eof): New.
16766 Suggested by Robert Anisko.
16768 2002-01-24 Akim Demaille <akim@epita.fr>
16770 Bison dumps core when trying to complain about broken input files.
16771 Reported by Cris van Pelt.
16773 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
16774 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
16776 (Invalid inputs): Strengthen: exercise parse_percent_token.
16778 2002-01-24 Robert Anisko <robert.anisko@epita.fr>
16780 * src/Makefile.am: Add bison.c++.
16781 * src/bison.c++: New skeleton.
16783 2002-01-21 Paolo Bonzini <bonzini@gnu.org>
16787 2002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
16789 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
16791 2002-01-20 Marc Autret <marc@gnu.org>
16793 * src/files.c (compute_output_file_names): Fix
16795 2002-01-20 Marc Autret <marc@gnu.org>
16797 * tests/output.at: New test.
16798 * src/files.c (compute_base_names): Don't map extensions when
16799 the YACC flag is set, use defaults.
16800 Reported by Evgeny Stambulchik.
16802 2002-01-20 Marc Autret <marc@gnu.org>
16804 * src/system.h: Need to define __attribute__ away for non-GCC
16805 compilers as well (i.e., the vendor C compiler).
16806 Suggested by Albert Chin-A-Young.
16808 2002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
16810 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
16811 canonical definition.
16812 * src/system.h: Use the canonical definition for PARAMS (avoids
16813 a conflict with the macro from lib/hash.h).
16815 2002-01-11 Akim Demaille <akim@epita.fr>
16817 * configure.in: Use AC_FUNC_STRNLEN.
16818 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
16820 2002-01-09 Akim Demaille <akim@epita.fr>
16822 * src/files.c, src/files.h (output_infix): New.
16823 (tab_extension): Remove.
16824 (compute_base_names): Compute the former, drop the latter.
16825 * src/output.c (prepare): Insert the muscles `output-infix', and
16827 * src/parse-skel.y (string, string.1): New.
16828 (section.header): Use it.
16829 (section.yacc): Remove.
16830 (prefix): Remove too.
16831 * src/scan-skel.l: Adjust.
16832 * src/bison.simple, src/bison.hairy: Adjust.
16834 2002-01-09 Akim Demaille <akim@epita.fr>
16836 * configure.in (WERROR_CFLAGS): Compute it.
16837 * src/Makefile.am (CFLAGS): Pass it.
16838 * tests/atlocal.in (CFLAGS): Idem.
16839 * src/files.c: Fix a few warnings.
16840 (get_extension_index): Remove, unused.
16842 2002-01-08 Akim Demaille <akim@epita.fr>
16844 * src/getargs.c (AS_FILE_NAME): New.
16845 (getargs): Use it to convert DOSish file names.
16846 * src/files.c (base_name): Rename as full_base_name to avoid
16847 clashes with `base_name ()'.
16848 (filename_split): New.
16849 (compute_base_names): N-th rewrite, using filename_split.
16851 2002-01-08 Akim Demaille <akim@epita.fr>
16853 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
16854 New, stolen from the Fileutils 4.1.
16855 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
16856 * configure.in: Check for the presence of memrchr, and of its
16859 2002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
16861 * lib/hash.h (__P): Added definition for this macro.
16862 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
16863 BUILT_SOURCES, to ensure they are generated first.
16864 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
16865 %error-verbose to allow bootstrapping with bison 1.30x.
16867 2002-01-06 Akim Demaille <akim@epita.fr>
16869 * src/reader.c (parse_braces): Don't fetch the next char, the
16870 convention is to fetch on entry.
16871 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
16872 'switch' without a following semicolon.
16873 * tests/regression.at (braces parsing): New.
16875 2002-01-06 Akim Demaille <akim@epita.fr>
16877 Bison is dead wrong in its RR conflict reports.
16879 * tests/torture.at (GNU Cim Grammar): New.
16880 * src/conflicts.c (count_rr_conflicts): Fix.
16882 2002-01-06 Akim Demaille <akim@epita.fr>
16884 Creating package.m4 from configure.ac causes too many problems.
16886 * tests/Makefile.am (package.m4): Create it by hand,
16887 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
16889 2002-01-06 Akim Demaille <akim@epita.fr>
16891 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
16894 2002-01-04 Paul Eggert <eggert@twinsun.com>
16896 * doc/bison.texinfo (Debugging):
16897 Remove YYSTDERR; it's no longer defined or used.
16898 Also, s/cstdio.h/cstdio/.
16900 2002-01-03 Akim Demaille <akim@epita.fr>
16902 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
16904 2002-01-03 Akim Demaille <akim@epita.fr>
16906 * src/parse-skel.y (process_skeleton): Don't bind the parser's
16907 tracing code to --trace, wait for a better --trace option, with
16910 2002-01-03 Akim Demaille <akim@epita.fr>
16912 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
16913 The ISO C++ standard is extremely clear about it: stderr is
16914 considered a macro, not a regular symbol (see table 94 `Header
16915 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
16916 Therefore std:: does not apply to it. It still does with fprintf.
16917 Also, s/cstdio.h/cstdio/.
16919 2002-01-03 Akim Demaille <akim@epita.fr>
16921 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
16922 for non system headers.
16924 2002-01-02 Akim Demaille <akim@epita.fr>
16926 Equip the skeleton chain with location tracking, runtime trace,
16927 pure parser and scanner.
16929 * src/parse-skel.y: Request a pure parser, locations, and prefix
16931 (%union): Having several members with the same type does not help
16932 type mismatches, simplify.
16933 (YYPRINT, yyprint): New.
16934 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
16935 (skel_error): this.
16937 * src/scan-skel.l: Adjust to these changes.
16938 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
16939 (LOCATION_PRINT, skel_control_t): New.
16941 2001-12-30 Akim Demaille <akim@epita.fr>
16943 * src/parse-skel.y: Get rid of the shift/reduce conflict:
16944 replace `gb' with BLANKS.
16945 * src/scan-skel.l: Adjust.
16947 2001-12-30 Akim Demaille <akim@epita.fr>
16949 * src/system.h: We don't need nor want bcopy.
16950 Throw away MS-DOS crap: we don't need getpid.
16951 * configure.in: We don't need strndup. It was even causing
16952 problems: because Flex includes the headers *before* us,
16953 _GNU_SOURCE is not defined by config.h, and therefore strndup was
16955 * lib/xstrndup.c: New.
16956 * src/scan-skel.l: Use it.
16957 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
16958 * src/parse-skel.y: Use %directives instead of #defines.
16960 2001-12-30 Akim Demaille <akim@epita.fr>
16962 * src/skeleton.h: New.
16963 * src/output.c (output_parser, output_master_parser): Remove, dead
16965 * src/output.h (get_lines_number, actions_output, guards_output)
16966 (token_definitions_output): Prototype them.
16967 * src/parse-skel.y: Add the license notice.
16968 Include output.h and skeleton.h.
16969 (process_skeleton): Returns void, and takes a single parameter.
16970 * src/scan-skel.l: Add the license notice.
16971 Include skeleton.h.
16972 Don't use %option yylineno: it seems that then Flex imagines
16973 REJECT has been used, and therefore it won't reallocate its
16974 buffers (which makes no other sense to me than a bug). It results
16975 in warnings for `unused: yy_flex_realloc'.
16977 2001-12-30 Robert Anisko <robert.anisko@epita.fr>
16979 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
16980 (MUSCLE_INSERT_PREFIX): ...to there.
16981 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
16982 (MUSCLE_INSERT_PREFIX): Move from here...
16984 * src/bison.hairy: Add a section directive. Put braces around muscle
16985 names. This parser skeleton is still broken, but Bison should not
16986 choke on a bad muscle 'syntax'.
16987 * src/bison.simple: Add a section directive. Put braces around muscle
16990 * src/files.h (strsuffix, stringappend): Add declarations.
16991 (tab_extension): Add declaration.
16992 (short_base_name): Add declaration.
16994 * src/files.c (strsuffix, stringappend): No longer static. These
16995 functions are used in the skeleton parser.
16996 (tab_extension): New.
16997 (compute_base_names): Use the computations done in this function
16998 to guess if the generated parsers should have '.tab' in their
17000 (short_base_name): No longer static.
17002 * src/output.c (output_skeleton): New.
17003 (output): Disable call to output_master_parser, and give a try to
17004 a new skeleton handling system.
17005 (guards_output, actions_output): No longer static.
17006 (token_definitions_output, get_lines_number): No longer static.
17008 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
17010 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
17013 * src/parse-skel.y: New file.
17014 * src/scan-skel.l: New file.
17016 2001-12-29 Akim Demaille <akim@epita.fr>
17018 %name-prefix is broken.
17020 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
17021 Adjust all dependencies.
17022 * tests/headers.at (export YYLTYPE): Strengthen this test: use
17025 Renaming yylval but not yylloc is not consistent. Now we do.
17027 * src/bison.simple: Prefix yylloc if used.
17028 * doc/bison.texinfo (Decl Summary): Document that.
17030 2001-12-29 Akim Demaille <akim@epita.fr>
17032 * doc/bison.texinfo: Promote `%long-directive' over
17034 Remove all references to fixed-output-files, yacc is enough.
17036 2001-12-29 Akim Demaille <akim@epita.fr>
17038 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
17039 user prologue. These are defaults.
17040 * tests/actions.at (Mid-rule actions): Make sure the user can
17041 define YYDEBUG and YYERROR_VERBOSE.
17043 2001-12-29 Akim Demaille <akim@epita.fr>
17045 * src/output.c (header_output): Don't forget to export YYLTYPE and
17047 * tests/headers.at (export YYLTYPE): New, make sure it does.
17048 * tests/regression.at (%union and --defines, Invalid CPP headers):
17050 * tests/headers.at: here.
17052 2001-12-29 Akim Demaille <akim@epita.fr>
17054 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
17056 2001-12-29 Akim Demaille <akim@epita.fr>
17058 * tests/actions.at (Mid-rule actions): Output on a single line
17059 instead of several.
17061 2001-12-29 Akim Demaille <akim@epita.fr>
17063 * doc/bison.texinfo: Formatting changes.
17065 2001-12-29 Akim Demaille <akim@epita.fr>
17067 Don't store the token defs in a muscle, just be ready to output it
17068 on command. Now possible via `symbols'. Fixes a memory leak.
17070 * src/output.c (token_definitions_output): New.
17071 (output_parser, header_output): Use it.
17072 * src/reader.c (symbols_save): Remove.
17074 2001-12-29 Akim Demaille <akim@epita.fr>
17076 * src/bison.simple: Do not provide a default for YYSTYPE and
17077 YYLTYPE before the user's prologue. Otherwise it's hardly... a
17080 2001-12-29 Akim Demaille <akim@epita.fr>
17082 Mid-rule actions are simply... ignored!
17084 * src/reader.c (readgram): Be sure to attach mid-rule actions to
17085 the empty-rule associated to the dummy symbol, not to the host
17087 * tests/actions.at (Mid-rule actions): New.
17089 2001-12-29 Akim Demaille <akim@epita.fr>
17093 * src/reader.c (reader): Free grammar.
17095 2001-12-29 Akim Demaille <akim@epita.fr>
17099 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
17100 since it allocates it for each state, although only one is needed.
17101 (allocate_storage): Do it here.
17103 2001-12-29 Akim Demaille <akim@epita.fr>
17105 * src/options.h, src/options.c (create_long_option_table): Rename
17107 (long_option_table_new): this, with a clearer prototype.
17108 (percent_table): Remove, unused,
17109 * src/getargs.c (getargs): Adjust.
17111 2001-12-29 Akim Demaille <akim@epita.fr>
17113 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
17114 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
17117 2001-12-29 Akim Demaille <akim@epita.fr>
17119 * src/lalr.c (build_relations): Rename `states' as `states1'.
17120 Sorry, I don't understand exactly what it is, no better name...
17122 2001-12-29 Akim Demaille <akim@epita.fr>
17124 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
17125 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
17126 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
17129 2001-12-29 Akim Demaille <akim@epita.fr>
17131 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
17134 2001-12-29 Akim Demaille <akim@epita.fr>
17136 * src/reader.c, src/reader.h (user_toknums): Remove.
17137 Adjust all users to use symbols[i]->user_token_number.
17139 2001-12-29 Akim Demaille <akim@epita.fr>
17141 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
17142 Adjust all users to use symbols[i]->prec or ->assoc.
17144 2001-12-29 Akim Demaille <akim@epita.fr>
17146 * src/reader.c, src/reader.h (tags): Remove.
17147 Adjust all users to use symbols[i]->tag.
17149 2001-12-29 Akim Demaille <akim@epita.fr>
17151 * src/gram.h, src/gram.c (symbols): New, similar to state_table
17153 * src/reader.c (packsymbols): Fill this table.
17155 * src/conflicts.c (resolve_sr_conflict): Adjust.
17156 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
17158 Use symbols[i]->tag instead of tags[i].
17160 2001-12-29 Akim Demaille <akim@epita.fr>
17162 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
17163 In addition, put a comment in there, to replace...
17164 * tests/regression.at (%union and C comments): Remove.
17166 2001-12-29 Akim Demaille <akim@epita.fr>
17168 * tests/regression.at (Web2c Actions): Blindly move the actual
17169 output as expected output. The contents *seem* right to me, but I
17170 can't pretend reading perfectly parser tables... Nonetheless, all
17171 the other tests pass correctly, the table look OK, even though the
17172 presence of `$axiom' is to be noted: AFAICS it is useless (but
17175 2001-12-29 Akim Demaille <akim@epita.fr>
17177 * src/reader.c (readgram): Don't add the rule 0 if there were no
17178 rules read. In other words, add it _after_ having performed
17179 grammar sanity checks.
17180 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
17182 2001-12-29 Akim Demaille <akim@epita.fr>
17184 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
17185 visible, and some states have now a different number.
17187 2001-12-29 Akim Demaille <akim@epita.fr>
17189 * src/reader.c (readgram): Bind the initial rule's lineno to that
17191 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
17192 (Solved SR Conflicts): Adjust rule 0's line number.
17194 2001-12-29 Akim Demaille <akim@epita.fr>
17196 Fix the `GAWK Grammar' failure.
17198 * src/LR0.c (final_state): Initialize to -1 so that we do compute
17199 the reductions of the first state which was mistakenly confused
17200 with the final state because precisely final_state was initialized
17202 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
17203 now noticed by Bison.
17204 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
17205 have a reduction on $default.
17207 2001-12-29 Akim Demaille <akim@epita.fr>
17209 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
17211 * src/closure.c (print_closure): Likewise.
17212 * src/derives.c (print_derives): Likewise.
17213 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
17216 2001-12-29 Akim Demaille <akim@epita.fr>
17218 * src/lalr.c (lookaheads_print): New.
17219 (lalr): Call it when --trace-flag.
17220 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
17223 2001-12-29 Akim Demaille <akim@epita.fr>
17225 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
17226 when walking through ritem, even via rule->rhs.
17227 * src/reduce.c (dump_grammar, useful_production, reduce_output)
17228 (useful_production, useless_nonterminals): Likewise.
17229 (reduce_grammar_tables): Likewise, plus update nritems.
17230 * src/nullable.c (set_nullable): Likewise.
17231 * src/lalr.c (build_relations): Likewise.
17232 * tests/sets.at (Nullable): Adjust.
17233 Fortunately, now, the $axiom is no longer nullable.
17235 2001-12-29 Akim Demaille <akim@epita.fr>
17237 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
17239 * src/gram.c (ritem_longest_rhs): Likewise.
17240 * src/reduce.c (nonterminals_reduce): Likewise.
17241 * src/print_graph.c (print_graph): Likewise.
17242 * src/output.c (output_rule_data): Likewise.
17243 * src/nullable.c (set_nullable): Likewise.
17245 2001-12-29 Akim Demaille <akim@epita.fr>
17247 * src/output.c: Comment changes.
17249 2001-12-27 Paul Eggert <eggert@twinsun.com>
17251 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
17252 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
17253 Sparc, as they were causing more porting problems than the
17254 (minor) performance improvement was worth.
17256 Also, catch up with 1.31's YYSTD.
17258 2001-12-27 Akim Demaille <akim@epita.fr>
17260 * src/output.c (output_gram): Rely on nritems, not the
17261 0-sentinel. See below.
17262 Use -1 as separator, not 0.
17263 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
17264 Rely on -1 as separator in yyrhs, instead of 0.
17265 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
17266 twice `Now at end of input', therefore there are two lines less to
17269 2001-12-27 Akim Demaille <akim@epita.fr>
17271 * tests/regression.at (Unresolved SR Conflicts):
17272 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
17275 2001-12-27 Akim Demaille <akim@epita.fr>
17277 * src/LR0.c (new_state): Recognize the final state by the fact it
17278 is reached by eoftoken.
17279 (insert_start_shifting_state, insert_eof_shifting_state)
17280 (insert_accepting_state, augment_automaton): Remove, since now
17281 these states are automatically computed from the initial state.
17282 (generate_states): Adjust.
17283 * src/print.c: When reporting a rule number to the user, substract
17284 1, so that the axiom rule is rule 0, and the first user rule is 1.
17285 * src/reduce.c: Likewise.
17286 * src/print_graph.c (print_core): For the time being, just as for
17287 the report, depend upon --trace-flags to dump the full set of
17289 * src/reader.c (readgram): Once the grammar read, insert the rule
17290 0: `$axiom: START-SYMBOL $'.
17291 * tests/set.at: Adjust: rule 0 is now displayed, and since the
17292 number of the states has changed (the final state is no longer
17293 necessarily the last), catch up.
17295 2001-12-27 Akim Demaille <akim@epita.fr>
17297 Try to make the use of the eoftoken valid. Given that its value
17298 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
17299 is used instead of > 0 where appropriate, (ii), depend upon nritems
17300 instead of the 0-sentinel.
17302 * src/gram.h, src/gram.c (nritems): New.
17303 Expected to be duplication of nitems, but for the time being...
17304 * src/reader.c (packgram): Assert nritems and nitems are equal.
17305 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
17306 * src/closure.c (print_closure, print_fderives): Likewise.
17307 * src/gram.c (ritem_print): Likewise.
17308 * src/print.c (print_core, print_grammar): Likewise.
17309 * src/print_graph.c: Likewise.
17311 2001-12-27 Akim Demaille <akim@epita.fr>
17313 * src/main.c (main): If there are complains after grammar
17314 reductions, then output the report anyway if requested, then die.
17315 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
17316 * src/reader.c (eoftoken): New.
17317 (parse_token_decl): If the token being defined has value `0', it
17319 (packsymbols): No longer hack `tags' to insert `$' by hand.
17320 Be sure to preserve the value of the eoftoken.
17321 (reader): Make sure eoftoken is defined.
17322 Initialize nsyms to 0: now eoftoken is created just like the others.
17323 * src/print.c (print_grammar): Don't special case the eof token.
17324 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
17325 lie anyway, albeit pleasant.
17326 * tests/calc.at: Exercise error messages with eoftoken.
17327 Change the grammar so that empty input is invalid.
17328 Adjust expectations.
17329 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
17331 2001-12-27 Akim Demaille <akim@epita.fr>
17333 * configure.in: Check the protos of strchr ans strspn.
17334 Replace strchr if needed.
17335 * src/system.h: Provide the protos of strchr, strspn and memchr if
17337 * lib/strchr.c: New.
17338 * src/reader.c (symbols_save): Use strchr.
17340 2001-12-27 Akim Demaille <akim@epita.fr>
17342 * src/print.c, src/print_graph.c (escape): New.
17343 Use it to quote the TAGS outputs.
17344 * src/print_graph.c (print_state): Now errors are in red, and
17345 reductions in green.
17346 Prefer high to wide: output the state number on a line of its own.
17348 2001-12-27 Akim Demaille <akim@epita.fr>
17350 * src/state.h, src/state.c (reductions_new): New.
17351 * src/LR0.c (set_state_table): Let all the states have a
17352 `reductions', even if reduced to 0.
17353 (save_reductions): Adjust.
17354 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
17355 * src/print.c (print_reductions, print_actions): Adjust.
17356 * src/output.c (action_row): Adjust.
17358 2001-12-27 Akim Demaille <akim@epita.fr>
17360 * src/state.h, src/state.c (errs_new, errs_dup): New.
17361 * src/LR0.c (set_state_table): Let all the states have an errs,
17362 even if reduced to 0.
17363 * src/print.c (print_errs, print_reductions): Adjust.
17364 * src/output.c (output_actions, action_row): Adjust.
17365 * src/conflicts.c (resolve_sr_conflict): Adjust.
17367 2001-12-27 Akim Demaille <akim@epita.fr>
17369 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
17371 2001-12-27 Akim Demaille <akim@epita.fr>
17373 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
17374 * src/print.c: here.
17375 (lookaheadset, shiftset): New, used as additional storage by
17377 (print_results): Adjust.
17378 (print_shifts, print_gotos, print_errs): New, extracted from...
17379 (print_actions): here.
17380 * src/print_graph.c (print_actions): Remove dead code.
17382 2001-12-27 Akim Demaille <akim@epita.fr>
17384 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
17387 2001-12-27 Akim Demaille <akim@epita.fr>
17389 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
17390 (build_relations): Adjust.
17392 2001-12-27 Akim Demaille <akim@epita.fr>
17394 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
17397 2001-12-27 Akim Demaille <akim@epita.fr>
17399 * src/reader.c (packgram): Catch nitems overflows.
17401 2001-12-27 Akim Demaille <akim@epita.fr>
17403 * src/files.c, src/files.h (guard_obstack): Remove.
17404 * src/output.c (output): Adjust.
17405 * src/reader.c (parse_braces): New, factoring...
17406 (copy_action, copy_guard): these two which are renamed as...
17407 (parse_action, parse_guard): these.
17408 As a voluntary consequence, using braces around guards is now
17411 2001-12-27 Akim Demaille <akim@epita.fr>
17413 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
17414 * src/reader.c (symbol_list): `guard' and `guard_line' are new
17416 (symbol_list_new): Adjust.
17417 (copy_action): action_line is the first line, not the last.
17418 (copy_guard): Just as for actions, store the `action' only, not
17419 the switch/case/break flesh.
17420 Don't parse the user action that might follow the guard, let...
17421 (readgram): do it, i.e., now, there can be an action after a
17423 In other words the guard is just explicitly optional.
17424 (packgram): Adjust.
17425 * src/output.c (guards_output): New.
17426 (output_parser): Call it when needed.
17427 (output): Also free the guard and attrs obstacks.
17428 * src/files.c, src/files.h (obstack_save): Remove.
17429 (output_files): Remove.
17430 As a result, if one needs the former `.act' file, using an
17431 appropriate skeleton which requires actions and guards is now
17433 * src/main.c (main): Adjust.
17434 * tests/semantic.at: New.
17435 * tests/regression.at: Use `input.y' as input file name.
17436 Avoid 8+3 problems by requiring input.c when the test needs the
17439 2001-12-27 Akim Demaille <akim@epita.fr>
17441 * src/reader.c (symbol_list_new): Be sure to initialize all the
17444 2001-12-27 Akim Demaille <akim@epita.fr>
17446 All the hacks using a final pseudo state are now useless.
17448 * src/LR0.c (set_state_table): state_table holds exactly nstates.
17449 * src/lalr.c (nLA): New.
17450 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
17451 instead of lookaheadsp from the pseudo state (nstate + 1).
17453 2001-12-27 Akim Demaille <akim@epita.fr>
17455 * src/output.c (action_row, token_actions): Use a state_t instead
17456 of a integer, and nlookaheads instead of the following state's
17459 2001-12-27 Akim Demaille <akim@epita.fr>
17461 * src/conflicts.c (log_resolution, flush_shift)
17462 (resolve_sr_conflict, set_conflicts, solve_conflicts)
17463 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
17464 (conflicts_print, print_reductions): Use a state_t instead of an
17465 integer when referring to a state.
17466 As much as possible, depend upon nlookaheads, instead of the
17467 `lookaheadsp' member of the following state (since lookaheads of
17468 successive states are successive, the difference between state n + 1
17469 and n served as the number of lookaheads for state n).
17470 * src/lalr.c (add_lookback_edge): Likewise.
17471 * src/print.c (print_core, print_actions, print_state)
17472 (print_results): Likewise.
17473 * src/print_graph.c (print_core, print_actions, print_state)
17474 (print_graph): Likewise.
17475 * src/conflicts.h: Adjust.
17477 2001-12-27 Akim Demaille <akim@epita.fr>
17479 * src/bison.hairy: Formatting/comment changes.
17481 Remove `register' indications.
17482 Add plenty of `static'.
17484 2001-12-27 Akim Demaille <akim@epita.fr>
17486 * src/output.c (prepare): Drop the muscle `ntbase' which
17487 duplicates ntokens.
17488 * src/bison.simple: Formatting/comment changes.
17489 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
17490 is an undocumented synonym.
17492 2001-12-22 Akim Demaille <akim@epita.fr>
17494 * src/output.c (output_table_data): Change the prototype to use
17495 `int' for array ranges: some invocations do pass an int, not a
17497 Reported by Wayne Green.
17499 2001-12-22 Akim Demaille <akim@epita.fr>
17501 Some actions of web2c.y are improperly triggered.
17502 Reported by Mike Castle.
17504 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
17505 * tests/regression.at (Web2c): Rename as...
17506 (Web2c Report): this.
17507 (Web2c Actions): New.
17509 2001-12-22 Akim Demaille <akim@epita.fr>
17511 Reductions in web2c.y are improperly reported.
17512 Reported by Mike Castle.
17514 * src/conflicts.c (print_reductions): Fix.
17515 * tests/regression.at (Web2c): New.
17517 2001-12-18 Akim Demaille <akim@epita.fr>
17519 Some host fail on `assert (!"foo")', which expands to
17520 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
17521 Reported by Nelson Beebee.
17523 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
17524 `#define it_succeeded 0' and `assert (it_succeeded)'.
17526 2001-12-17 Marc Autret <autret_m@epita.fr>
17528 * src/bison.simple: Don't hard code the skeleton line and filename.
17529 * src/output.c (output_parser): Rename 'line' as 'output_line'.
17530 New line counter 'skeleton_line' (skeleton-line muscle).
17532 2001-12-17 Paul Eggert <eggert@twinsun.com>
17534 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
17535 YYDEBUG must be defined to a nonzero value.
17537 * src/bison.simple (yytname): Do not assume that the user defines
17538 YYDEBUG to a properly parenthesized expression.
17540 2001-12-17 Akim Demaille <akim@epita.fr>
17542 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
17543 nlookaheads is a new member.
17545 * src/lalr.h (nlookaheads): Remove this orphan declaration.
17546 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
17549 2001-12-17 Akim Demaille <akim@epita.fr>
17551 * src/files.h, src/files.c (open_files, close_files): Remove.
17552 * src/main.c (main): Don't open/close files, nor invoke lex_free,
17554 * src/reader.c (reader): Do it.
17556 2001-12-17 Akim Demaille <akim@epita.fr>
17558 * src/conflicts.c (print_reductions): Formatting changes.
17560 2001-12-17 Akim Demaille <akim@epita.fr>
17562 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
17563 (flush_reduce): New.
17564 (resolve_sr_conflict): Adjust.
17566 2001-12-17 Akim Demaille <akim@epita.fr>
17568 * src/output.c (output_obstack): Be static and rename as...
17569 (format_obstack): this, to avoid any confusion with files.c's
17571 * src/reader.h (muscle_obstack): Move to...
17572 * src/output.h: here, since it's defined in output.c.
17574 2001-12-17 Akim Demaille <akim@epita.fr>
17576 * src/output.c (action_row, save_column, default_goto)
17577 (sort_actions, matching_state, pack_vector): Better variable
17580 2001-12-17 Akim Demaille <akim@epita.fr>
17582 * src/output.c: Various formatting changes.
17584 2001-12-17 Akim Demaille <akim@epita.fr>
17586 * src/files.c (output_files): Free the output_obstack.
17587 * src/main.c (main): Call print and print_graph conditionally.
17588 * src/print.c (print): Work unconditionally.
17589 * src/print_graph.c (print_graph): Work unconditionally.
17590 * src/conflicts.c (log_resolution): Output only if verbose_flag.
17592 2001-12-16 Marc Autret <autret_m@epita.fr>
17594 * src/output.c (actions_output): Fix. When we use %no-lines,
17595 there is one less line per action.
17597 2001-12-16 Marc Autret <autret_m@epita.fr>
17599 * src/bison.simple: Remove a useless #line directive.
17600 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
17601 * src/output.c (get_lines_number): New.
17602 (output_parser): Adjust, now takes care about the lines of a
17604 Fix line numbering.
17605 (actions_output): Computes the number of lines taken by actions.
17606 (output_master_parser): Insert new skeleton which is the name of
17607 the output parser file name.
17609 2001-12-15 Marc Autret <autret_m@epita.fr>
17611 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
17613 2001-12-15 Marc Autret <autret_m@epita.fr>
17615 * src/output.c (output_gram): Keep track of the hairy one.
17617 2001-12-15 Akim Demaille <akim@epita.fr>
17619 Make `make distcheck' work.
17621 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
17622 system.h which uses libgettext.h.
17624 2001-12-15 Akim Demaille <akim@epita.fr>
17626 * src/nullable.c (set_nullable): Useless rules must be skipped,
17627 otherwise, since we range over their symbols, we might look at a
17628 nonterminal which no longer ``exists'', i.e., it is not counted in
17629 `nvars', hence we overflow our arrays.
17631 2001-12-15 Akim Demaille <akim@epita.fr>
17633 The header can also be produced directly, without any obstack!
17636 * src/files.c, src/files.h (defines_obstack): Remove.
17637 (compute_header_macro): Global.
17638 (defines_obstack_save): Remove.
17639 * src/reader.c (parse_union_decl): No longer output to
17640 defines_obstack: its content can be found in the `stype' muscle
17642 (output_token_translations): Merge into...
17643 (symbols_output): this.
17645 (symbols_save): this.
17647 * src/output.c (header_output): New.
17650 2001-12-15 Akim Demaille <akim@epita.fr>
17652 * src/reader.c (parse_union_decl): Instead of handling two obstack
17653 simultaneously, use one to define the `stype' muscle, and use the
17654 value of the latter to fill defines_obstack.
17655 (copy_comment): Remove.
17656 (copy_comment2): Work for a single obstack.
17658 (copy_comment): this.
17660 2001-12-15 Akim Demaille <akim@epita.fr>
17662 * src/lex.c, src/lex.h (xgetc): No longer static.
17663 * src/reader.c (parse_union_decl): Revamp.
17665 2001-12-15 Akim Demaille <akim@epita.fr>
17667 Still making progress in separating Bison into (i) input, (ii)
17668 process, (iii) output: now we can directly output the parser file
17669 without using table_obstack at all.
17671 * src/files.c, src/files.h (table_obstack): Bye bye.
17672 (parser_file_name): New.
17673 * src/files.c (compute_output_file_names): Compute it.
17674 * src/output.c (actions_output, output_parser)
17675 (output_master_parser): To a file instead of an obstack.
17677 2001-12-15 Akim Demaille <akim@epita.fr>
17679 Attach actions to rules, instead of pre-outputting them to
17682 * src/gram.h (rule_t): action and action_line are new members.
17683 * src/reader.c (symbol_list): Likewise.
17684 (copy_action): Save the actions within the rule.
17685 (packgram): Save them in rule_table.
17686 * src/output.c (actions_output): New.
17687 (output_parser): Use it on `%%actions'.
17688 (output_rule_data): Don't free rule_table.
17690 (prepare): Don't save the `action' muscle.
17691 * src/bison.simple: s/%%action/%%actions/.
17693 2001-12-15 Akim Demaille <akim@epita.fr>
17695 * src/reader.c (copy_action): When --yacc, don't append a `;'
17696 to the user action: let it fail if lacking.
17697 Suggested by Arnold Robbins and Tom Tromey.
17699 2001-12-14 Akim Demaille <akim@epita.fr>
17701 * src/lex.c (literalchar): Simply return the char you decoded, non
17702 longer mess around with obstacks and int pointers.
17703 Adjust all callers.
17705 2001-12-14 Akim Demaille <akim@epita.fr>
17707 * src/lex.c (literalchar): Don't escape the special characters,
17708 just decode them, and keep them as char (before, eol was output as
17709 the 2 char string `\n' etc.).
17710 * src/output.c (output_rule_data): Use quotearg to output the
17713 2001-12-13 Paul Eggert <eggert@twinsun.com>
17715 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
17716 Do not infringe on the global user namespace when using C++.
17717 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
17718 All uses of `fprintf' and `stderr' changed.
17720 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
17722 2001-12-13 Akim Demaille <akim@epita.fr>
17724 The computation of nullable is broken: it doesn't handle empty
17727 * tests/torture.at (GNU AWK Grammar): New.
17728 * tests/sets.at (Nullable): New.
17729 * src/nullable.c (set_nullable): Instead of blindly looping over
17730 `ritems', loop over the rules, and then over their rhs's.
17732 Work around Autotest bugs.
17734 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
17735 frame, because Autotest understand lines starting with a `+' as
17736 traces from the shell. Then, they are not processed properly.
17737 Admittedly an Autotest bug, but we don't have time to wait for
17738 Autotest to catch up.
17739 * tests/regression.at (Broken Closure): Adjust to the new table
17742 * tests/sets.at: here.
17744 2001-12-13 Akim Demaille <akim@epita.fr>
17746 * src/closure.c (closure): Use nrules instead of playing tricks
17747 with BITS_PER_WORD.
17749 2001-12-13 Akim Demaille <akim@epita.fr>
17751 * src/print.c (print_actions): Output the handling of `$' as the
17752 traces do: shifting the token EOF. Before EOF was treated as a
17754 * tests/regression.at: Adjust some tests.
17755 * src/print_graph.c (print_core): Complete the set of items via
17756 closure. The next-to-final and final states are still unsatisfying,
17757 but that's to be addressed elsewhere.
17758 No longer output the rule numbers, but do output the state number.
17759 A single loop for the shifts + gotos is enough, but picked a
17760 distinct color for each.
17761 (print_graph): Initialize and finalize closure.
17763 2001-12-13 Akim Demaille <akim@epita.fr>
17765 * src/reader.c (readgram): Remove dead code, an strip useless
17767 (get_type): Remove, unused.
17769 2001-12-12 Akim Demaille <akim@epita.fr>
17771 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
17772 on that of lib/error.c.
17774 2001-12-12 Akim Demaille <akim@epita.fr>
17776 Some hosts don't like `/' in includes.
17778 * src/system.h: Include libgettext.h without qualifying the path.
17779 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
17782 2001-12-11 Marc Autret <autret_m@epita.fr>
17784 * src/output.c (output_parser): Remove useless muscle.
17786 2001-12-11 Marc Autret <autret_m@epita.fr>
17788 * src/bison.simple: Remove #line just before %%epilogue. It
17789 is now handled in ...
17790 * src/reader.c (read_additionnal_code): Add the output of a
17791 #line for the epilogue.
17793 2001-12-10 Marc Autret <autret_m@epita.fr>
17795 * src/reader.c (copy_definition): Re-use CPP-outed code which
17796 replace precedent remove.
17797 * src/bison.simple: Remove #line before %%prologue because
17798 %%input-line is wrong at this time.
17800 2001-12-10 Marc Autret <autret_m@epita.fr>
17802 * src/reader.c (symbols_output): Clean up.
17803 * src/output.c (output_gram, output): Clean up.
17805 2001-12-10 Akim Demaille <akim@epita.fr>
17807 * src/lalr.c (initialize_lookaheads): New. Extracted from...
17808 * src/LR0.c (set_state_table): here.
17809 * src/lalr.c (lalr): Call it.
17811 2001-12-10 Akim Demaille <akim@epita.fr>
17813 * src/state.h (shifts): Remove the `number' member: shifts are
17814 attached to state, hence no longer need to be labelled with a
17817 2001-12-10 Akim Demaille <akim@epita.fr>
17819 Now that states have a complete set of members, the linked list of
17820 shifts is useless: just fill directly the state's shifts member.
17822 * src/state.h (shifts): Remove the `next' member.
17823 * src/LR0.c (first_state, last_state): Remove.
17824 Adjust the callers.
17825 (augment_automaton): Don't look for the shifts that must be added
17826 a shift on EOF: it is those of the state we looked for! But now,
17827 since shifts are attached, it is no longer needed to looking
17828 merely by its id: its number.
17830 2001-12-10 Akim Demaille <akim@epita.fr>
17832 * src/LR0.c (augment_automaton): Better variable locality.
17833 Remove an impossible branch: if there is a state corresponding to
17834 the start symbol being shifted, then there is shift for the start
17835 symbol from the initial state.
17837 2001-12-10 Akim Demaille <akim@epita.fr>
17839 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
17840 only when appropriate: when insert_start_shifting_state' is not
17842 * tests/regression.at (Rule Line Numbers): Adjust.
17844 2001-12-10 Akim Demaille <akim@epita.fr>
17846 * src/LR0.c (augment_automaton): Now that all states have shifts,
17847 merge the two cases addition shifts to the initial state.
17849 2001-12-10 Akim Demaille <akim@epita.fr>
17851 * src/lalr.c (set_state_table): Move to...
17853 * src/lalr.c (lalr): Don't call it...
17854 * src/LR0.c (generate_states): do it.
17855 * src/LR0.h (first_state): Remove, only the table is used.
17857 2001-12-10 Akim Demaille <akim@epita.fr>
17859 * src/LR0.h (first_shift, first_reduction): Remove.
17860 * src/lalr.c: Don't use first_shift: find shifts through the
17863 2001-12-10 Akim Demaille <akim@epita.fr>
17865 * src/LR0.c: Attach shifts to states as soon as they are
17867 * src/lalr.c (set_state_table): Instead of assigning shifts to
17868 state, just assert that the mapping was properly done.
17870 2001-12-10 Akim Demaille <akim@epita.fr>
17872 * src/LR0.c (insert_start_shift): Rename as...
17873 (insert_start_shifting_state): this.
17874 (insert_eof_shifting_state, insert_accepting_state): New.
17875 (augment_automaton): Adjust.
17876 Better locality of the variables.
17877 When looking if the start_symbol is shifted from the initial
17878 state, using `while (... symbol != start_symbol ...)' sounds
17879 better than `while (... symbol < start_symbol ...)': If fail
17880 to see how the order between symbols could be relevant!
17882 2001-12-10 Akim Demaille <akim@epita.fr>
17884 * src/getargs.h: Don't declare `spec_name_prefix' and
17885 `spec_file_prefix', declared by src/files.h.
17886 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
17887 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
17888 * src/output.c (prepare): Adjust.
17889 * src/reader.c (symbols_output): Likewise.
17890 * src/vmsgetargs.c: Vaguely adjust, but who cares?
17892 2001-12-10 Akim Demaille <akim@epita.fr>
17894 * src/muscle_tab.c (muscle_init): NULL is a better default than
17897 2001-12-10 Akim Demaille <akim@epita.fr>
17899 * src/reader.c (reader): Calling symbols_output once is enough.
17901 2001-12-10 Akim Demaille <akim@epita.fr>
17903 Now that states have a complete set of members, the linked list of
17904 reductions is useless: just fill directly the state's reductions
17907 * src/state.h (struct reductions): Remove member `number' and
17909 * src/LR0.c (first_reduction, last_reduction): Remove.
17910 (save_reductions): Don't link the new reductions, store them in
17912 * src/lalr.c (set_state_table): No need to attach reductions to
17913 states, it's already done.
17914 * src/output.c (output_actions): No longer free the shifts, then
17915 the reductions, then the states: free all the states and their
17918 2001-12-10 Akim Demaille <akim@epita.fr>
17920 * src/options.c (OPTN, DRTV, BOTH): New.
17921 (option_table): Use them.
17923 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
17924 the job of system.h.
17925 * src/options.c: Don't include stdio.h and xalloc.h for the same
17928 2001-12-10 Akim Demaille <akim@epita.fr>
17930 * src/output.c (output, prepare): Make sure the values of the
17931 muscles `action' and `prologue' are 0-terminated.
17933 2001-12-10 Akim Demaille <akim@epita.fr>
17935 Clean up GCC warnings.
17937 * src/reader.c (copy_action): `buf' is not used.
17938 (parse_skel_decl): Be static.
17939 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
17940 * src/options.h (create_long_option_table): Have a real prototype.
17941 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
17942 (hash_delete_at): Return const void *.
17943 Adjust casts to preserve the const.
17945 2001-12-10 Akim Demaille <akim@epita.fr>
17947 * configure.in: Require 2.52g.
17948 M4 is not needed, but AUTOM4TE is.
17949 * m4/m4.m4: Remove.
17950 * tests/Makefile.am: Adjust.
17952 2001-12-10 Akim Demaille <akim@epita.fr>
17954 One structure for states is enough, even though theoretically
17955 there are LR(0) states and LALR(1) states.
17957 * src/lalr.h (state_t): Remove.
17958 (state_table): Be state_t **, not state_t *.
17959 * src/state.h (core, CORE_ALLOC): Rename as...
17960 (state_t, STATE_ALLOC): this.
17961 Add the LALR(1) members: shifts, reductions, errs.
17962 * src/LR0.c (state_table): Rename as...
17963 (state_hash): this, to avoid name clashes with the global
17965 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
17966 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
17968 2001-12-10 Akim Demaille <akim@epita.fr>
17970 Bison dumps core on bash.y.
17971 Reported by Pascal Bart.
17973 * src/warshall.c (bitmatrix_print): New.
17975 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
17976 j must be the outer loop.
17977 * tests/regression.at (Broken Closure): New.
17979 2001-12-05 Akim Demaille <akim@epita.fr>
17981 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
17983 Reported by Peter Hamorsky.
17985 2001-12-05 Akim Demaille <akim@epita.fr>
17987 * src/conflicts.c (err_table): Remove.
17988 (resolve_sr_conflict): Adjust.
17989 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
17991 (state_t.reductions, state_t.shifts): this.
17993 2001-12-05 Akim Demaille <akim@epita.fr>
17995 * src/reduce.c (reduce_grammar_tables): No longer disable the
17996 removal of useless rules via CPP but via `if (0)', so that the
17997 compiler still check the code is valid.
17998 For instance, it should have noticed `rline' no longer exists: use
17999 the `line' member of rule_t.
18000 * src/gram.c (dummy, rline): Remove, unused.
18002 2001-12-05 Akim Demaille <akim@epita.fr>
18004 * src/output.c (pack_vector): Use assert, not berror.
18005 * src/main.c (berror): Remove, unused.
18007 2001-12-05 Akim Demaille <akim@epita.fr>
18009 New experimental feature: if --verbose --trace output all the
18010 items of a state, not only its kernel.
18012 * src/print.c (print_core): If `trace_flag', then invoke closure
18013 before outputting the items of the state (print_core is no longer
18014 a correct name them).
18015 (print_results): Invoke new_closure/free_closure if needed.
18017 2001-12-05 Akim Demaille <akim@epita.fr>
18019 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
18020 * src/closure.c, src/closure.h (itemsetsize): Rename as...
18021 (nitemset): for consistency with the rest of the project.
18023 2001-12-05 Akim Demaille <akim@epita.fr>
18025 * src/closure.c (print_closure): Improve.
18026 (closure): Use it for printing input and output.
18028 2001-12-05 Akim Demaille <akim@epita.fr>
18030 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
18031 indexed by nonterminals.
18033 2001-12-05 Akim Demaille <akim@epita.fr>
18035 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
18037 * src/warshall.h: Remove accidental duplication of the content.
18039 2001-12-05 Akim Demaille <akim@epita.fr>
18041 * src/closure.c (set_fderives): De-obfuscate.
18043 2001-12-05 Akim Demaille <akim@epita.fr>
18045 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
18047 2001-12-05 Akim Demaille <akim@epita.fr>
18049 * src/closure.c (set_firsts): De-obfuscate.
18051 2001-12-05 Akim Demaille <akim@epita.fr>
18053 * src/output.c (action_row): De-obfuscate
18054 using the good o' techniques: arrays not pointers, variable
18055 locality, BITISSET, RESETBIT etc.
18057 2001-12-05 Akim Demaille <akim@epita.fr>
18059 Pessimize the code to simplify it: from now on, all the states
18060 have a valid SHIFTS, which NSHIFTS is possibly 0.
18062 * src/LR0.c (shifts_new): Be global and move to..
18063 * src/state.c, src/state.h: here.
18064 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
18065 * src/print_graph: Adjust.
18067 2001-12-05 Akim Demaille <akim@epita.fr>
18069 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
18070 * src/conflicts.c: Use it.
18071 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
18072 incorrectly ``simplified''.
18074 2001-12-05 Akim Demaille <akim@epita.fr>
18076 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
18077 using the good o' techniques: arrays not pointers, variable
18078 locality, BITISSET, RESETBIT etc.
18080 2001-12-05 Akim Demaille <akim@epita.fr>
18082 * src/state.h (SHIFT_SYMBOL): New.
18083 * src/conflicts.c: Use it to deobfuscate.
18085 2001-12-05 Akim Demaille <akim@epita.fr>
18087 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
18088 (print_reductions): De-obfuscate using the good o' techniques:
18089 arrays not pointers, variable locality, BITISSET.
18091 2001-12-05 Akim Demaille <akim@epita.fr>
18093 * src/conflicts.c (print_reductions): Arrays, not pointers.
18096 2001-12-05 Akim Demaille <akim@epita.fr>
18098 * src/conflicts.c (print_reductions): Pessimize, but clarify.
18100 2001-12-05 Akim Demaille <akim@epita.fr>
18102 * src/conflicts.c (print_reductions): Improve variable locality.
18104 2001-12-05 Akim Demaille <akim@epita.fr>
18106 * src/conflicts.c (print_reductions): Pessimize, but clarify.
18108 2001-12-05 Akim Demaille <akim@epita.fr>
18110 * src/conflicts.c (print_reductions): Improve variable locality.
18112 2001-12-05 Akim Demaille <akim@epita.fr>
18114 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
18115 * src/lalr.c: Use them.
18117 2001-12-05 Akim Demaille <akim@epita.fr>
18119 * src/LR0.c (augment_automaton): Formatting changes.
18120 Better variable locality.
18122 2001-12-05 Akim Demaille <akim@epita.fr>
18124 * src/lalr.c (matrix_print): New.
18125 (transpose): Use it.
18126 Use arrays instead of pointers.
18128 2001-12-05 Akim Demaille <akim@epita.fr>
18130 * src/lalr.c (maxrhs): Move to...
18131 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
18132 * src/lalr.c (build_relations): Adjust.
18134 2001-12-05 Akim Demaille <akim@epita.fr>
18136 * src/lalr.c (transpose): Free the memory allocated to the
18137 argument, as it is replaced by the results by the unique caller.
18138 (build_relations): Merely invoke transpose: it handles the memory
18140 Improve variable locality.
18141 Avoid variables used as mere abbreviations.
18142 (compute_lookaheads): Use arrays instead of pointers.
18144 2001-12-05 Akim Demaille <akim@epita.fr>
18146 * src/lalr.c (initialize_F): Improve variable locality.
18147 Avoid variables used as mere abbreviations.
18149 2001-12-05 Akim Demaille <akim@epita.fr>
18151 * src/derives.c (print_derives): Display the ruleno.
18152 * src/lalr.c (initialize_F, transpose): Better variable locality
18153 to improve readability.
18154 Avoid variables used as mere abbreviations.
18156 2001-12-05 Akim Demaille <akim@epita.fr>
18158 * src/lalr.c (traverse): Use arrays instead of pointers.
18160 2001-12-05 Akim Demaille <akim@epita.fr>
18162 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
18163 the handling of squeue.
18164 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
18166 2001-12-05 Akim Demaille <akim@epita.fr>
18168 Because useless nonterminals are now kept alive (instead of being
18169 `destroyed'), we now sometimes examine them, and store information
18170 related to them. Hence we need to know their number, and adjust
18171 memory allocations.
18173 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
18175 * src/LR0.c (allocate_itemsets): The memory allocated to
18176 `symbol_count' was used for two different purpose: once to count
18177 the number of occurrences of each symbol, and later reassigned to
18178 `shift_symbol', containing the symbol that can be shifted from a
18180 Deobfuscate, i.e., allocate, use and free `symbol_count' here
18182 (new_itemsets): Allocate `shift_symbol' here.
18183 (allocate_itemsets): symbol_count includes useless nonterminals.
18184 Make room for them.
18185 (free_storage): Use `free', not `XFREE', for pointers that cannot
18188 2001-12-05 Akim Demaille <akim@epita.fr>
18190 * src/nullable.c (set_nullable): Deobfuscate the handling of
18192 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
18194 2001-12-05 Akim Demaille <akim@epita.fr>
18196 * src/gram.c, src/gram.h (ritem_print): New.
18197 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
18198 (This useless function was defined only to work around VMS linkers
18199 that can't handle compilation units with variables only).
18200 * src/reduce.c (dump_grammar): Use it to trace the construction of
18203 2001-12-04 Paul Eggert <eggert@twinsun.com>
18205 * src/bison.simple (union yyalloc): Change member names
18206 to be the same as the stack names.
18207 (yyparse): yyptr is now union yyalloc *, not char *.
18208 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
18209 and may generate better code on some machines.
18210 (yystpcpy): Use prototype if __STDC__ is defined, not just
18211 if __cplusplus is defined.
18213 2001-11-30 Akim Demaille <akim@epita.fr>
18215 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
18216 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
18217 Gettext doesn't compile cleanly, and dies with -Werror.
18218 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
18219 Include WARNING_CFLAGS here.
18220 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
18221 before being defined.
18223 2001-11-27 Paul Eggert <eggert@twinsun.com>
18225 * lib/quotearg.h (quotearg_n, quotearg_n_style):
18226 First arg is int, not unsigned.
18227 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
18228 (SIZE_MAX, UINT_MAX): New macros.
18229 (quotearg_n_options): Abort if N is negative.
18230 Avoid overflow check on hosts where size_t is 64 bits and int
18231 is 32 bits, as overflow is impossible there.
18232 Fix off-by-one typo that caused unnecessary reallocation.
18234 2001-11-29 Paul Eggert <eggert@twinsun.com>
18236 Name space cleanup in generated parser.
18238 * doc/bison.texinfo (Bison Parser): Discuss system headers
18239 and their effect on the user name space.
18241 * src/bison.simple:
18242 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
18243 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
18244 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
18246 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
18247 on user names when possible.
18249 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
18250 Simplify test for whather <alloca.h> exists.
18252 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
18254 (<stdio.h>): Include if YYDEBUG.
18256 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
18257 ! defined (yyoverflow) && ! defined (yymemcpy).
18259 (yymemcpy, yyparse): Rename local variables as needed so that
18260 they all begin with 'yy'.
18262 (yystrlen, yystpcpy): New functions.
18264 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
18267 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
18268 instead of relying on string.h functions. Use YYSTACK_ALLOC
18269 and YYSTACK_FREE instead of malloc and free.
18271 2001-11-30 Akim Demaille <akim@epita.fr>
18273 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
18274 before their first uses.
18275 (YYBISON, YYPURE): Move to the top of the output.
18277 2001-11-30 Akim Demaille <akim@epita.fr>
18279 * tests/reduce.at (Useless Nonterminals): Fix.
18281 2001-11-30 Akim Demaille <akim@epita.fr>
18283 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
18284 if body instead of `;' to pacify GCC's warnings.
18286 2001-11-30 Akim Demaille <akim@epita.fr>
18288 Instead of mapping the LHS of unused rules to -1, keep the LHS
18289 valid, but flag the rules as invalid.
18291 * src/gram.h (rule_t): `useful' is a new member.
18292 * src/print.c (print_grammar): Adjust.
18293 * src/derives.c (set_derives): Likewise.
18294 * src/reader.c (packgram, reduce_output): Likewise.
18295 * src/reduce.c (reduce_grammar_tables): Likewise.
18296 * tests/reduce.at (Underivable Rules, Useless Rules): New.
18298 2001-11-30 Akim Demaille <akim@epita.fr>
18300 * src/reduce.c (reduce_output): Formatting changes.
18301 * src/print.c (print_results, print_grammar): Likewise.
18302 * tests/regression.at (Rule Line Numbers)
18303 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
18305 2001-11-30 Akim Demaille <akim@epita.fr>
18307 * src/reduce.c (nonterminals_reduce): Instead of throwing away
18308 useless nonterminals, move them at the end of the symbol arrays.
18309 (reduce_output): Adjust.
18310 * tests/reduce.at (Useless Nonterminals): Adjust.
18312 2001-11-30 Akim Demaille <akim@epita.fr>
18314 * src/reduce.c: Various comment/formatting changes.
18315 (nonterminals_reduce): New, extracted from...
18316 (reduce_grammar_tables): here.
18317 (reduce_grammar): Call nonterminals_reduce.
18319 2001-11-29 Paul Eggert <eggert@twinsun.com>
18321 * src/bison.simple (YYSTACK_REALLOC): Remove.
18322 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
18323 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
18325 (union yyalloc): New type.
18326 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
18327 an arbitrary restriction on hosts where size_t is wider than int.
18329 (yyparse): Don't dump core if alloca or malloc fails; instead, report
18330 a parser stack overflow. Allocate just one block of memory for all
18331 three stacks, instead of allocating three blocks; this typically is
18332 faster and reduces fragmentation.
18334 Do not limit the number of items in the stack to a value that fits
18335 in 'int', as this is an arbitrary limit on hosts with 64-bit
18336 size_t and 32-bit int.
18338 2001-11-29 Marc Autret <autret_m@epita.fr>
18340 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
18341 of defining YYERROR_VERBOSE.
18342 [AT_DATA]: $4 is now out of C declarations in the prologue.
18344 2001-11-28 Marc Autret <autret_m@epita.fr>
18346 * src/reader.c (parse_dquoted_param): New.
18347 (parse_skel_decl): Use it.
18348 * src/lex.h: Add its prototype.
18349 * src/lex.c (literalchar): Become not static.
18351 2001-11-28 Marc Autret <autret_m@epita.fr>
18353 * src/output.h: And put its extern declaration here.
18354 * src/output.c (error_verbose): Define here.
18355 (prepare): Echo name modification.
18356 * src/getargs.h: Clean its extern declaration.
18357 * src/getargs.c (error_verbose_flag): Remove.
18358 (getargs): Remove case 'e'.
18359 * src/options.c (option_table): 'error-verbose' is now seen as simple
18363 * src/reader.c (read_declarations): Remove case tok_include.
18364 (parse_include_decl): Remove.
18365 * src/lex.h (token_t): Remove tok_include.
18366 * src/options.c (option_table): 'include' is now a simple command line
18369 2001-11-28 Marc Autret <autret_m@epita.fr>
18371 * src/bison.simple: Adjust muscle names.
18372 * src/muscle_tab.c (muscle_init): Also rename the muscles.
18373 * src/output.c (prepare): s/_/-/ for the muscles names.
18374 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
18376 2001-11-28 Marc Autret <autret_m@epita.fr>
18378 * src/bison.simple: Fix debug.
18379 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
18381 2001-11-28 Akim Demaille <akim@epita.fr>
18383 * src/LR0.c (shifts_new): New.
18384 (save_shifts, insert_start_shift, augment_automaton): Use it.
18386 2001-11-28 Akim Demaille <akim@epita.fr>
18388 * src/closure.c (closure): `b' and `ruleno' denote the same value:
18391 2001-11-28 Akim Demaille <akim@epita.fr>
18393 * src/closure.c (closure): Instead of looping over word in array
18394 then bits in words, loop over bits in array.
18396 2001-11-28 Akim Demaille <akim@epita.fr>
18398 * src/closure.c (closure): No longer optimize the special case
18399 where all the bits of `ruleset[r]' are set to 0, to make the code
18402 2001-11-28 Akim Demaille <akim@epita.fr>
18404 * src/closure.c (closure): `r' and `c' are new variables, used to
18405 de-obfuscate accesses to RULESET and CORE.
18407 2001-11-28 Akim Demaille <akim@epita.fr>
18409 * src/reduce.c (reduce_print): Use ngettext.
18410 (dump_grammar): Improve the trace accuracy.
18412 2001-11-28 Akim Demaille <akim@epita.fr>
18414 * src/reduce.c (dump_grammar): Don't translate trace messages.
18416 2001-11-28 Akim Demaille <akim@epita.fr>
18418 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
18419 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
18420 as all tags are free'ed afterwards.
18421 From Enrico Scholz.
18423 2001-11-27 Paul Eggert <eggert@twinsun.com>
18425 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
18426 use alloca when we didn't want to, and vice versa.
18428 2001-11-27 Marc Autret <autret_m@epita.fr>
18430 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
18432 * src/output.c (prepare): Remove its update.
18434 2001-11-27 Marc Autret <autret_m@epita.fr>
18436 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
18437 Use %error-verbose.
18439 2001-11-27 Marc Autret <autret_m@epita.fr>
18441 * src/bison.simple: Remove YYERROR_VERBOSE using.
18442 Use %%error_verbose.
18443 (yyparse): Likewise.
18444 * src/output.c (prepare): Give its final value.
18445 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
18446 * src/getargs.h: Add its extern declaration.
18447 * src/getargs.c (error_verbose_flag): New int.
18448 (getargs): Update to catch new case.
18449 * src/options.c (option_table): 'error-verbose' is a new option.
18450 (shortopts): Update.
18452 2001-11-27 Akim Demaille <akim@epita.fr>
18454 * src/system.h: Use intl/libgettext.h.
18455 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
18457 2001-11-27 Akim Demaille <akim@epita.fr>
18459 * tests/torture.at (Exploding the Stack Size with Malloc):
18460 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
18462 2001-11-27 Akim Demaille <akim@epita.fr>
18464 * src/files.c: Include error.h.
18465 Reported by Hans Aberg.
18467 2001-11-26 Marc Autret <autret_m@epita.fr>
18469 * src/reader.c (parse_include_decl): New, not yet implemented.
18470 (read_declarations): Add case tok_include.
18471 * src/getargs.h (include): Add its extern definition.
18472 * src/getargs.c (include): New const char *.
18473 (getargs): Add case '-I'.
18474 * src/options.c (option_table): Add include as command line and
18476 * src/lex.h (token_t): Add tok_include.
18478 2001-11-26 Akim Demaille <akim@epita.fr>
18480 * src/reader.c (readgram): Make sure rules for mid-rule actions
18481 have a lineno equal to that of their host rule.
18482 Reported by Hans Aberg.
18483 * tests/regression.at (Rule Line Numbers): New.
18485 2001-11-26 Akim Demaille <akim@epita.fr>
18487 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
18490 2001-11-26 Akim Demaille <akim@epita.fr>
18492 * src/complain.c, src/complain.h (error): Remove, provided by
18495 2001-11-26 Akim Demaille <akim@epita.fr>
18497 * src/reader.c (read_declarations): Don't abort on tok_illegal,
18498 issue an error message.
18499 * tests/regression.at (Invalid %directive): New.
18500 Reported by Hans Aberg.
18502 2001-11-26 Akim Demaille <akim@epita.fr>
18504 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
18505 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
18507 2001-11-26 Akim Demaille <akim@epita.fr>
18509 * src/conflicts.c (conflicts_print): Don't complain at all when
18510 there are no reduce/reduce conflicts, and as many shift/reduce
18511 conflicts as expected.
18512 * tests/regression.at (%expect right): Adjust.
18514 2001-11-23 Akim Demaille <akim@epita.fr>
18516 * lib/alloca.c: Update, from fileutils.
18518 2001-11-23 Akim Demaille <akim@epita.fr>
18520 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
18522 2001-11-23 Akim Demaille <akim@epita.fr>
18524 * src/system.h: Include alloca.h.
18525 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
18527 2001-11-23 Akim Demaille <akim@epita.fr>
18529 * src/print_graph.c (print_actions): Remove `rule', unused.
18530 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
18531 pacify GCC's signed < unsigned warnings.
18532 * src/closure.c (itemsetsize): Likewise.
18533 * src/reader.c (symbol_list_new): Static.
18535 2001-11-23 Akim Demaille <akim@epita.fr>
18537 Attaching lineno to buckets is stupid, since only one copy of each
18538 symbol is kept, only the line of the first occurrence is kept too.
18540 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
18541 * src/reader.c (rline_allocated): Remove, unused.
18542 (symbol_list): Have a `line' member.
18543 (symbol_list_new): New.
18544 (readgram): Use it.
18545 * src/print.c (print_grammar): Output the rule line numbers.
18546 * tests/regression.at (Solved SR Conflicts)
18547 (Unresolved SR Conflicts): Adjust.
18548 Reported by Hans Aberg.
18550 2001-11-22 Marc Autret <autret_m@epita.fr>
18552 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
18554 2001-11-22 Marc Autret <autret_m@epita.fr>
18556 * src/muscle_tab.c (muscle_init): Remove initialization of
18558 * src/output.c (output_master_parser): Do it here.
18560 2001-11-20 Akim Demaille <akim@epita.fr>
18563 * configure.in (ALL_LINGUAS): Adjust.
18564 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
18565 longer contains strings to translate.
18567 2001-11-19 Akim Demaille <akim@epita.fr>
18569 * src/conflicts.c (conflicts_print): Add a missing \n.
18571 2001-11-19 Akim Demaille <akim@epita.fr>
18573 * src/nullable.c (nullable_print): New.
18574 (set_nullable): Call it when tracing.
18575 Better locality of variables.
18577 2001-11-19 Akim Demaille <akim@epita.fr>
18579 * src/print.c (print_actions): Better locality of variables.
18581 2001-11-19 Akim Demaille <akim@epita.fr>
18583 * src/derives.c (print_derives): Fix and enrich.
18584 * src/closure.c (print_fderives): Likewise.
18586 2001-11-19 Akim Demaille <akim@epita.fr>
18588 * src/closure.c (itemsetend): Remove, replaced with...
18589 (itemsetsize): new.
18591 2001-11-19 Akim Demaille <akim@epita.fr>
18593 * src/LR0.c (kernel_end): Remove, replaced with...
18594 (kernel_size): new.
18596 2001-11-19 Akim Demaille <akim@epita.fr>
18598 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
18601 2001-11-19 Akim Demaille <akim@epita.fr>
18603 * src/closure.c (closure): Use arrays instead of pointers to clarify.
18605 2001-11-19 Akim Demaille <akim@epita.fr>
18607 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
18609 * src/LR0.c: Likewise.
18610 (allocate_itemsets): Use arrays instead of pointers to clarify.
18612 2001-11-19 Akim Demaille <akim@epita.fr>
18614 * src/getargs.c (statistics_flag): Replace with...
18616 (longopts): Accept --trace instead of --statistics.
18617 * src/getargs.h, src/options.c: Adjust.
18618 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
18619 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
18621 2001-11-19 Akim Demaille <akim@epita.fr>
18623 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
18624 pointers to clarify the code.
18625 (save_reductions, save_shifts): Factor common parts of alternatives.
18627 2001-11-19 Akim Demaille <akim@epita.fr>
18629 * src/LR0.c (new_state, get_state): Complete TRACE code.
18630 * src/closure.c: Include `reader.h' to get `tags', needed by the
18632 Rename the conditional DEBUG as TRACE.
18633 Output consistently TRACEs to stderr, not stdout.
18634 * src/derives.c: Likewise.
18635 * src/reduce.c: (inaccessable_symbols): Using if is better style
18637 Use `#if TRACE' instead of `#if 0' for tracing code.
18639 2001-11-19 Akim Demaille <akim@epita.fr>
18641 * src/system.h (LIST_FREE, shortcpy): New.
18642 * src/LR0.c: Use them.
18643 * src/output.c (free_itemsets, free_reductions, free_shifts):
18644 Remove, replaced by LIST_FREE.
18646 2001-11-19 Akim Demaille <akim@epita.fr>
18648 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
18649 (REDUCTIONS_ALLOC): New.
18650 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
18653 2001-11-19 Akim Demaille <akim@epita.fr>
18655 * src/LR0.c (new_state): Complete trace code.
18656 * src/nullable.c (set_nullable): Don't translate traces.
18658 2001-11-19 Akim Demaille <akim@epita.fr>
18660 * src/print_graph.c (print_core): Better locality of variables.
18661 * src/print.c (print_core): Likewise.
18663 2001-11-19 Akim Demaille <akim@epita.fr>
18665 * src/vcg.c: You do the output, so you are responsible of the
18666 handling of VCG syntax, in particular: use quotearg.
18667 * src/print_graph.c: Don't.
18668 (print_actions): Don't output the actions as part of the nodes,
18669 since that's the job of the edges.
18670 (print_state): Don't output by hand: fill the node description,
18671 and ask for its output.
18673 2001-11-19 Akim Demaille <akim@epita.fr>
18675 * src/bison.simple (yyparse): When verbosely reporting an error,
18676 no longer put additional quotes around token names.
18677 * tests/calc.at: Adjust.
18679 2001-11-19 Akim Demaille <akim@epita.fr>
18681 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
18682 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
18683 * src/output.c: Adjust.
18685 2001-11-19 Akim Demaille <akim@epita.fr>
18687 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
18689 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
18691 2001-11-19 Akim Demaille <akim@epita.fr>
18693 * src/gram.h (rule_t): New.
18695 (rrhs, rlhs): Remove, part of state_t.
18696 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
18697 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
18698 * src/reader.c, src/reduce.c: Adjust.
18700 2001-11-19 Akim Demaille <akim@epita.fr>
18702 * src/reader.c (symbols_output): New, extracted from...
18703 (packsymbols): Here.
18706 2001-11-19 Akim Demaille <akim@epita.fr>
18708 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
18709 (maxrhs): this new function.
18711 2001-11-19 Akim Demaille <akim@epita.fr>
18713 * src/lalr.c (F): New macro to access the variable F.
18716 2001-11-19 Akim Demaille <akim@epita.fr>
18718 * src/lalr.h (LA): New macro to access the variable LA.
18719 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18720 * src/lalr.c: Adjust.
18722 2001-11-19 Akim Demaille <akim@epita.fr>
18724 * src/lalr.c (initialize_LA): Only initialize LA. Let...
18725 (set_state_table): handle the `lookaheads' members.
18727 2001-11-19 Akim Demaille <akim@epita.fr>
18729 * src/lalr.h (lookaheads): Removed array, whose contents is now
18731 (state_t): this structure.
18732 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18735 2001-11-19 Akim Demaille <akim@epita.fr>
18737 * src/lalr.h (consistent): Removed array, whose contents is now
18739 (state_t): this structure.
18740 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18743 2001-11-19 Akim Demaille <akim@epita.fr>
18745 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
18746 contents are now members of...
18747 (state_t): this structure.
18748 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18751 2001-11-19 Akim Demaille <akim@epita.fr>
18753 * src/lalr.h (state_t): New.
18754 (state_table): Be a state_t * instead of a core **.
18755 (accessing_symbol): Remove, part of state_t.
18756 * src/lalr.c: Adjust.
18757 (set_accessing_symbol): Merge into...
18758 (set_state_table): this.
18759 * src/print_graph.c, src/conflicts.c: Adjust.
18761 2001-11-14 Akim Demaille <akim@epita.fr>
18763 * tests/calc.at, tests/output.at, tests/regression.at,
18764 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
18765 now the tests are run in private dirs, therefore AC_CLEANUP and
18766 family can be simplified to 0-ary.
18767 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
18768 use abs. path to find config.h.
18769 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
18770 stderr, there can be way too much random noise.
18771 Instead pass -Werror to GCC and rely on the exit status.
18772 Reported by Wolfram Wagner.
18774 2001-11-14 Akim Demaille <akim@epita.fr>
18776 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
18777 defined only if yyoverflow is defined, to avoid `warning: unused
18779 Reported by The Test Suite.
18781 2001-11-14 Akim Demaille <akim@epita.fr>
18783 * src/print.c: Include reduce.h.
18784 Reported by Hans Aberg.
18786 2001-11-14 Akim Demaille <akim@epita.fr>
18788 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
18789 Revert a previous patch: these are really const.
18790 * src/conflicts.c (conflict_report): Additional useless pair of
18791 braces to pacify GCC's warnings for `if () if () {} else {}'.
18792 * src/lex.c (parse_percent_token): Replace equal_offset with
18795 Be sure to strdup `arg' when used, since there is no reason for
18796 token_buffer not to change.
18798 2001-11-14 Akim Demaille <akim@epita.fr>
18800 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
18802 * src/main.c (main): Use them.
18803 Suggested by Hans Aberg.
18805 2001-11-12 Akim Demaille <akim@epita.fr>
18807 * src/system.h (ngettext): Now that we use ngettext, be sure to
18808 provide a default definition when NLS are not used.
18810 2001-11-12 Akim Demaille <akim@epita.fr>
18812 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
18813 Use @kbd to denote user input.
18814 (Language and Grammar): ANSIfy the example.
18815 Adjust its layout for info/notinfo.
18816 (Location Tracking Calc): Output error messages to stderr.
18817 Output locations in a more GNUtically correct way.
18818 Fix a couple of Englishos.
18819 Adjust @group/@end group pairs.
18821 2001-11-12 Akim Demaille <akim@epita.fr>
18823 %expect was not functioning at all.
18825 * src/conflicts.c (expected_conflicts): Set to -1.
18826 (conflict_report): Use ngettext.
18827 (conflicts_print): Check %expect and make its violation an error.
18828 * doc/bison.texinfo (Expect Decl): Adjust.
18829 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
18830 * tests/regression.at (%expect not enough, %expect right)
18831 (%expect too much): New.
18833 2001-11-12 Akim Demaille <akim@epita.fr>
18835 * tests/regression.at (Conflicts): Rename as...
18836 (Unresolved SR Conflicts): this.
18837 (Solved SR Conflicts): New.
18839 2001-11-12 Akim Demaille <akim@epita.fr>
18841 * src/reduce.c (print_results): Rename as...
18842 (reduce_output): This.
18843 Output to OUT, passed as argument, instead of output_obstack.
18844 (dump_grammar): Likewise.
18845 (reduce_free): New.
18847 (reduce_grammar): No longer call reduce_output, since...
18848 * src/print.c (print_results): do it.
18849 * src/main.c (main): Call reduce_free;
18851 2001-11-12 Akim Demaille <akim@epita.fr>
18853 * src/conflicts.c (print_reductions): Accept OUT as argument.
18854 Output to it, not to output_obstack.
18855 * src/print.c (print_actions): Adjust.
18857 2001-11-12 Akim Demaille <akim@epita.fr>
18859 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
18860 the result instead of using...
18861 (src_total, rrc_total, src_count, rrc_count): Remove.
18862 (any_conflicts): Remove.
18863 (print_conflicts): Split into...
18864 (conflicts_print, conflicts_output): New.
18865 * src/conflicts.h: Adjust.
18866 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
18867 * src/print.c (print_grammar): Issue `\n' between two rules.
18868 * tests/regression.at (Conflicts): New.
18869 Reported by Tom Lane.
18871 2001-11-12 Akim Demaille <akim@epita.fr>
18873 * tests/regression.at (Invalid input): Remove, duplicate with
18874 ``Invalid input: 1''.
18876 2001-11-12 Akim Demaille <akim@epita.fr>
18878 * tests/torture.at (AT_DATA_STACK_TORTURE)
18879 (Exploding the Stack Size with Alloca)
18880 (Exploding the Stack Size with Malloc): New.
18882 2001-11-12 Akim Demaille <akim@epita.fr>
18884 * src/bison.simple (YYSTACK_REALLOC): New.
18885 (yyparse) [!yyoverflow]: Use it and free the old stack.
18886 Reported by Per Allansson.
18888 2001-11-12 Pascal Bart <pascal.bart@epita.fr>
18890 * src/bison.simple: Define type yystype instead of YYSTYPE, and
18891 define CPP macro, which substitute YYSTYPE by yystype.
18892 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
18893 with yyltype/YYLTYPE. This allows inclusion of the generated
18894 header within the parser if the compiler, such as GGC, accepts
18895 multiple equivalent #defines.
18898 2001-11-05 Akim Demaille <akim@epita.fr>
18900 * src/reader.c (symbols_output): New, extracted from...
18901 (packsymbols): here.
18904 2001-11-05 Akim Demaille <akim@epita.fr>
18906 * src/lex.c (parse_percent_token): s/quotearg/quote/.
18908 2001-11-05 Akim Demaille <akim@epita.fr>
18910 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
18913 2001-11-05 Akim Demaille <akim@epita.fr>
18915 * src/options.h (struct option_table_struct): set_flags is void*.
18916 * src/options.c (longopts): Support `--output' and `%output'.
18918 * src/lex.h (tok_setopt): Remove, replaced with...
18919 (tok_intopt, tok_stropt): these new guys.
18920 * src/lex.c (getopt.h): Not needed.
18921 (token_buffer, unlexed_token_buffer): Not const.
18922 (percent_table): Promote `-' over `_' in directive names.
18923 Active `%name-prefix', `file-prefix', and `output'.
18924 (parse_percent_token): Accept possible arguments to directives.
18925 Promote `-' over `_' in directive names.
18927 2001-11-04 Akim Demaille <akim@epita.fr>
18929 * doc/bison.texinfo (Decl Summary): Split the list into
18930 `directives for grammars' and `directives for bison'.
18932 Add description of `%name-prefix', `file-prefix', and `output'.
18933 Promote `-' over `_' in directive names.
18934 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
18935 Simplify the description of `--name-prefix'.
18936 Promote `-' over `_' in directive names.
18937 Promote `--output' over `--output-file'.
18938 Fix the description of `--defines'.
18939 * tests/output.at: Exercise %file-prefix and %output.
18941 2001-11-02 Akim Demaille <akim@epita.fr>
18943 * doc/refcard.tex: Update.
18945 2001-11-02 Akim Demaille <akim@epita.fr>
18947 * src/symtab.h (SUNDEF): New.
18948 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
18949 stand for `uninitialized', instead of 0.
18950 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
18951 * src/lex.c (lex): Adjust.
18953 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
18955 Let yylex return it instead of a plain 0.
18956 Reported by Dick Streefland.
18958 2001-11-02 Akim Demaille <akim@epita.fr>
18960 * tests/regression.at (Mixing %token styles): New test.
18962 2001-11-02 Akim Demaille <akim@epita.fr>
18964 * src/reader.c (parse_thong_decl): Formatting changes.
18965 (token_translations_init): New, extracted from...
18966 (packsymbols): Here.
18969 2001-11-01 Akim Demaille <akim@epita.fr>
18971 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
18972 Check that `9foo.y' produces correct cpp guards.
18973 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
18977 2001-11-01 Akim Demaille <akim@epita.fr>
18979 * tests/regression.at (Invalid input: 2): New.
18980 * src/lex.c (unlexed_token_buffer): New.
18981 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
18985 2001-11-01 Akim Demaille <akim@epita.fr>
18987 * tests/calc.at: Catch up with 1.30.
18988 * configure.in: Bump to 1.49a.
18989 Adjust to newer Autotest.
18991 2001-10-19 Pascal Bart <pascal.bart@epita.fr>
18993 * src/conflicts.c: Move global variables rrc_total and src_total ...
18994 (print_conflicts): here.
18995 * src/output.c (output): Free global variable user_toknums.
18996 * src/lex.c (token_obstack): Become static.
18998 2001-10-18 Akim Demaille <akim@epita.fr>
19000 * tests/atlocal.in (GCC): Add.
19001 * tests/calc.at: s/m4_match/m4_bmatch/.
19002 s/m4_patsubst/m4_bpatsubst/.
19003 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
19004 * configure.in: AC_SUBST(GCC).
19006 2001-10-14 Marc Autret <autret_m@epita.fr>
19008 * src/options.c (create_long_option_table): Fix.
19010 2001-10-10 Akim Demaille <akim@epita.fr>
19012 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
19014 2001-10-04 Akim Demaille <akim@epita.fr>
19016 * src/reader.c (parse_union_decl): Push the caracters in
19017 union_obstack, not attrs_obstack.
19019 2001-10-04 Akim Demaille <akim@epita.fr>
19021 Merge in the branch 1.29.
19023 * src/reader.c (packsymbols): Use a temporary obstack for
19024 `%%tokendef', since output_stack is already used elsewhere.
19026 2001-10-02 Akim Demaille <akim@epita.fr>
19030 2001-10-02 Akim Demaille <akim@epita.fr>
19034 2001-10-02 Akim Demaille <akim@epita.fr>
19036 * tests/regression.at (Invalid CPP headers): New.
19037 From Alexander Belopolsky.
19038 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
19040 2001-10-02 Akim Demaille <akim@epita.fr>
19042 * tests/regression.at (Invalid input): New.
19043 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
19046 2001-10-02 Akim Demaille <akim@epita.fr>
19048 * tests/calc.at: Now that --debug works, the tests must be adjusted.
19050 2001-10-02 Akim Demaille <akim@epita.fr>
19052 * src/output.c (output_parser): Assert `skeleton'.
19053 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
19057 2001-10-01 Marc Autret <autret_m@epita.fr>
19059 * src/lex.h: Echo modifications.
19060 * src/lex.c (unlex): Parameter is now token_t.
19063 2001-10-01 Marc Autret <autret_m@epita.fr>
19065 * src/main.c: Include lex.h.
19068 2001-09-29 Akim Demaille <akim@epita.fr>
19070 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
19072 2001-09-28 Akim Demaille <akim@epita.fr>
19074 * tests/testsuite.at: Update to newer Autotest.
19075 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
19077 2001-09-27 Akim Demaille <akim@epita.fr>
19079 Position independent wrapper.
19081 * tests/bison: Remove.
19082 * tests/bison.in: New.
19083 * configure.in: Adjust.
19085 2001-09-27 Paul Eggert <eggert@twinsun.com>
19087 Port quotearg fixes from tar 1.13.24.
19089 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
19091 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
19092 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
19094 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
19095 * m4/mbrtowc.m4: New file.
19096 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
19097 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
19099 2001-09-27 Akim Demaille <akim@epita.fr>
19103 2001-09-27 Akim Demaille <akim@epita.fr>
19107 2001-09-25 Akim Demaille <akim@epita.fr>
19109 * src/system.h: Include `xalloc.h'.
19110 Remove it from the C files.
19111 * src/files.c (output_files): Free the obstacks.
19112 * src/lex.c (init_lex): Rename as...
19115 * src/main.c (main): Use it.
19117 2001-09-24 Marc Autret <autret_m@epita.fr>
19119 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
19120 to output informations in fout (FILE*).
19121 (open_graph, close_graph): Likewise.
19122 (output_graph, output_edge, output_node): Likewise.
19123 * src/vcg.h: Update function prototypes.
19124 * src/print_graph.c (print_graph): Open output graph file.
19125 (print_actions): Adjust.
19126 * src/files.h: Remove extern declaration.
19127 * src/files.c: Remove graph_obstack declaration.
19128 (open_files): Remove graph_obstack initialization.
19129 (output_files): Remove graph_obstack saving.
19131 2001-09-24 Marc Autret <autret_m@epita.fr>
19133 * src/files.c (compute_output_file_names): Fix.
19135 2001-09-24 Marc Autret <autret_m@epita.fr>,
19136 Akim Demaille <akim@epita.fr>
19138 * src/reader.c (reader): Remove call to free_symtab ().
19139 * src/main.c (main): Call it here.
19141 * src/conflicts.c (initialize_conflicts): Rename as...
19142 (solve_conflicts): this.
19143 * src/print.c (print_core, print_actions, print_state)
19144 (print_grammar): Dump to a file instead a `output_obstack'.
19145 (print_results): Dump `output_obstack', and then proceed with the
19147 * src/files.c (compute_output_file_names, close_files): New.
19148 (output_files): Adjust.
19149 * src/main.c (main): Adjust.
19151 2001-09-23 Marc Autret <autret_m@epita.fr>
19153 * src/files.c (compute_header_macro): Computes header macro name
19154 from spec_defines_file when given.
19156 2001-09-23 Marc Autret <autret_m@epita.fr>
19158 * src/files.c (output_files): Add default extensions.
19160 2001-09-22 Akim Demaille <akim@epita.fr>
19162 * src/conflicts.c (finalize_conflicts): Rename as...
19163 (free_conflicts): this.
19165 2001-09-22 Akim Demaille <akim@epita.fr>
19167 * src/gram.c (gram_free): Rename back as...
19169 (output_token_translations): Free `token_translations'.
19170 * src/symtab.c (free_symtab): Free the tag field.
19172 2001-09-22 Akim Demaille <akim@epita.fr>
19174 Remove `translations' as it is always set to true.
19176 * src/gram.h: Adjust.
19177 * src/reader.c (packsymbols, parse_token_decl): Adjust
19178 * src/print.c (print_grammar): Adjust.
19179 * src/output.c (output_token_translations): Adjust.
19180 * src/lex.c (lex): Adjust.
19181 * src/gram.c: Be sure the set pointers to NULL.
19182 (dummy): Rename as...
19185 2001-09-22 Akim Demaille <akim@epita.fr>
19187 * configure.in: Invoke AM_LIB_DMALLOC.
19188 * src/system.h: Use dmalloc.
19189 * src/LR0.c: Be sure to have pointers initialized to NULL.
19190 (allocate_itemsets): Allocate kernel_items only if needed.
19192 2001-09-22 Akim Demaille <akim@epita.fr>
19194 * configure.in: Bump to 1.29b.
19195 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
19196 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
19197 need xmalloc.c in calc.y.
19200 2001-09-21 Akim Demaille <akim@epita.fr>
19203 * Makefile.maint, config/config.guess, config/config.sub,
19204 * config/missing: Update from masters.
19205 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
19207 * configure.in (ALL_LINGUAS): Add `tr'.
19209 2001-09-21 Akim Demaille <akim@epita.fr>
19211 * tests/Makefile.am (package.m4): Move to...
19212 ($(srcdir)/$(TESTSUITE)): here.
19214 2001-09-20 Akim Demaille <akim@epita.fr>
19216 * src/complain.c: No longer try to be standalone: use system.h.
19217 Don't assume __STDC__ is defined to 1. Just test if it is defined.
19218 * src/complain.h: Likewise.
19219 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
19220 Remove the unused variable `n'.
19221 From Albert Chin-A-Young.
19223 2001-09-18 Marc Autret <autret_m@epita.fr>
19225 * doc/bison.1: Update.
19226 * doc/bison.texinfo (Bison Options): Update --defines and --graph
19228 (Option Cross Key): Update.
19231 2001-09-18 Marc Autret <autret_m@epita.fr>
19233 * tests/regression.at: New test (comment in %union).
19235 2001-09-18 Marc Autret <autret_m@epita.fr>
19237 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
19239 Reported by Keith Browne.
19241 2001-09-18 Marc Autret <autret_m@epita.fr>
19243 * tests/output.at: Add tests for --defines and --graph.
19245 2001-09-18 Marc Autret <autret_m@epita.fr>
19247 * tests/output.at: Removes tests of %{header,src}_extension features.
19249 2001-09-18 Akim Demaille <akim@epita.fr>
19251 * tests/Makefile.am (package.m4): New.
19252 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
19253 (_AT_CHECK_CALC_ERROR): Likewise.
19254 Factor the `, ' part of verbose error messages.
19256 2001-09-18 Marc Autret <autret_m@epita.fr>
19258 * src/getargs.c (longopts): Declare --defines and --graph as options
19259 with optional arguments.
19260 * src/files.h: Add extern declarations.
19261 * src/files.c (spec_graph_file, spec_defines_file): New.
19262 (output_files): Update.
19263 Remove CPP-outed code.
19265 2001-09-18 Marc Autret <autret_m@epita.fr>
19267 Turn off %{source,header}_extension feature.
19269 * src/files.c (compute_exts_from_gf): Update.
19270 (compute_exts_from_src): Update.
19271 (output_files): CPP-out useless code.
19272 * src/files.h: Remove {header,source}_extension extern declarations.
19273 * src/reader.c (parse_dquoted_param): CPP-out.
19274 (parse_header_extension_decl): Remove.
19275 (parse_source_extension_decl): Remove.
19276 (read_declarations): Remove cases tok_{hdrext,srcext}.
19277 * src/lex.c (percent_table): Remove {header,source}_extension entries.
19278 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
19280 2001-09-10 Akim Demaille <akim@epita.fr>
19282 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
19283 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
19284 (AT_CHECK_OUTPUT): this.
19285 Merely check ls' exit status, its output is useless.
19287 2001-09-10 Akim Demaille <akim@epita.fr>
19289 * tests/calc.at: Use m4_match.
19290 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
19292 2001-09-10 Marc Autret <autret_m@epita.fr>,
19293 Akim Demaille <akim@epita.fr>
19295 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
19297 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
19299 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
19300 * src/lex.h: Adjust prototype.
19301 (token_t): Add `tok_undef'.
19302 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
19303 (parse_percent_token): Now returns token_t.
19304 Add default statement in switch.
19305 (lex): Separate `c' as an input variable, from the token_t result
19307 (unlexed): Is a token_t.
19309 2001-09-10 Akim Demaille <akim@epita.fr>
19311 * configure.in: Bump to 1.29a.
19313 2001-09-07 Akim Demaille <akim@epita.fr>
19317 2001-08-30 Akim Demaille <akim@epita.fr>
19319 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
19320 * m4/atconfig.m4: Remove.
19321 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
19322 * tests/bison: New.
19323 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
19324 m4_if, m4_patsubst, and m4_regexp.
19325 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
19326 `input' file instead of echo.
19328 2001-08-29 Akim Demaille <akim@epita.fr>
19332 2001-08-29 Akim Demaille <akim@epita.fr>
19336 2001-08-29 Paul Eggert <eggert@twinsun.com>
19338 * src/bison.simple (yyparse): Don't take the address of an
19339 item before the start of an array, as that doesn't conform to
19342 2001-08-29 Robert Anisko <anisko_r@epita.fr>
19344 * doc/bison.texinfo (Location Tracking Calc): New node.
19346 2001-08-29 Paul Eggert <eggert@twinsun.com>
19348 * src/output.c (output): Do not define const, as this now
19349 causes more problems than it cures.
19351 2001-08-29 Akim Demaille <akim@epita.fr>
19353 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
19355 Be sure to tag the `detailmenu'.
19357 2001-08-29 Akim Demaille <akim@epita.fr>
19359 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
19360 download in a tmp dir.
19362 2001-08-28 Marc Autret <autret_m@epita.fr>
19364 * config/depcomp: New file.
19366 2001-08-28 Marc Autret <autret_m@epita.fr>
19368 * doc/bison.1 (mandoc): Adjust.
19369 From Juan Manuel Guerrero.
19371 2001-08-28 Marc Autret <autret_m@epita.fr>
19373 * src/print_graph.c (print_state): Fix.
19375 2001-08-27 Marc Autret <autret_m@epita.fr>
19377 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
19379 Echo modifications to the functions prototypes.
19380 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
19382 2001-08-27 Marc Autret <autret_m@epita.fr>
19384 * src/vcg.c: Include `xalloc.h'.
19385 (add_colorentry): New.
19386 (add_classname): New.
19387 (add_infoname): New.
19388 * src/vcg.h: Add new prototypes.
19390 2001-08-27 Akim Demaille <akim@epita.fr>
19392 * Makefile.maint: Sync. again with CVS Autoconf.
19394 2001-08-27 Akim Demaille <akim@epita.fr>
19396 * Makefile.maint: Formatting changes.
19397 (po-update, cvs-update, update): New targets.
19400 2001-08-27 Akim Demaille <akim@epita.fr>
19402 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
19403 * Makefile.maint: Sync. with CVS Autoconf.
19405 2001-08-27 Marc Autret <autret_m@epita.fr>
19407 * src/vcg.h (struct infoname_s): New.
19408 (struct colorentry_s): New.
19409 (graph_s): New fields {vertical,horizontal}_order in structure.
19410 Add `infoname' field.
19411 Add `colorentry' field;
19412 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
19413 (G_HORIZONTAL_ORDER): New.
19415 (G_COLORENTRY): New.
19416 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
19417 Add output of `infoname'.
19418 Add output of `colorentry'.
19420 2001-08-27 Marc Autret <autret_m@epita.fr>
19422 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
19423 This one shadowed a global parameter.
19425 2001-08-24 Marc Autret <autret_m@epita.fr>
19427 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
19428 instead of `unsigned'.
19429 (print_state): Do not call obstack_object_size () in obstack_grow ()
19430 to avoid macro variables shadowing.
19432 2001-08-23 Marc Autret <autret_m@epita.fr>
19434 * src/lex.c (percent_table): Typo: s/naem/name/.
19436 Normalize new options declarations.
19438 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
19440 * tests/suite.at: Exercise %header_extension and %source_extension.
19442 2001-08-16 Marc Autret <autret_m@epita.fr>
19444 * src/reader.c (parse_dquoted_param): New.
19445 (parse_header_extension_decl): Use it.
19446 (parse_source_extension_decl): Likewise.
19448 2001-08-16 Marc Autret <autret_m@epita.fr>
19450 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
19451 (get_xxxx_str): Use assert () instead of complain ().
19452 Remove return invokations in default cases.
19453 (get_decision_str): Modify default behaviour. Remove second argument.
19454 Echo modifications on calls.
19455 (output_graph): Fix.
19457 2001-08-16 Marc Autret <autret_m@epita.fr>
19459 * src/getargs.c (usage): Update with ``-g, --graph''.
19461 2001-08-16 Marc Autret <autret_m@epita.fr>
19463 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
19464 (Option Cross Key): Likewise.
19465 * doc/bison.1: Update.
19467 2001-09-25 Pascal Bart <pascal.bart@epita.fr>
19469 * src/output.c (output_master_parser): Don't finish action_obstack.
19470 (output_parser): Don't care about the muscle action, here.
19471 (prepare): Copy the action_obstack in the action muscle.
19472 (output): Free action_obstack.
19474 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
19476 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
19477 will contain `%union' declaration.
19478 (parse_union_decl): Delete #line directive output.
19479 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
19480 informations about %union.
19481 (parse_union_decl): Copy the union_obstack in the muscle stype.
19482 * src/bison.simple: Add new #line directive.
19483 Add typdef %%stype YYSTYPE.
19485 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
19487 * src/bison.simple: Add new `#line' directive.
19489 2001-09-22 Pascal Bart <pascal.bart@epita.fr>
19491 * src/bison.simple: New `#line' directive.
19492 * src/output.c (output_parser): Support new dynamic muscle input_line.
19494 2001-09-22 Marc Autret <autret_m@epita.fr>
19496 * src/output.c (output_master_parser): New.
19497 (output_parser): Be more re-entrant.
19499 2001-09-21 Marc Autret <autret_m@epita.fr>
19501 * src/reader.c (copy_definition, parse_union_decl): Update and use
19503 (copy_action): Likewise.
19504 Use obstack_1grow ().
19505 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
19507 2001-09-21 Marc Autret <autret_m@epita.fr>
19509 * src/options.c (option_table): Adjust.
19510 * src/lex.c (parse_percent_token): Fix.
19512 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
19514 * src/options.c (symtab.h): Include it, need by lex.h.
19516 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
19518 * src/lex.c (parse_percent_token): Change type of variable `tx', which
19519 is now an option_table_struct*.
19520 (option_strcmp): New function option_strcmp.
19521 (parse_percent_token): Call option_strcmp.
19522 * src/getargs.c (xalloc.h, options.h): Include it.
19523 (getargs): Call create_long_option_table.
19524 (getargs): Free longopts at the end of the function.
19525 (shortopts): Move in options.c.
19526 * src/options.c (create_long_option_table): New function. Convert
19527 information from option_table to option structure.
19528 * src/reader.c (options.h): Include it.
19530 * src/Makefile.am: Adjust.
19531 * src/options.c (option_table): Create from longopts and percent_table.
19532 * src/getargs.c (longopts): Delete.
19533 * src/lex.c (struct percent_table_struct): Delete.
19534 (percent_table): Delete.
19535 (options.h): Include it.
19536 * src/options.c: Create.
19537 * src/options.h: Create.
19538 Declare enum opt_access_e.
19539 Define struct option_table_struct.
19541 2001-09-20 Marc Autret <autret_m@epita.fr>
19543 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
19546 2001-09-19 Pascal Bart <pascal.bart@epita.fr>
19548 * src/bison.simple: s/%%filename/%%skeleton.
19549 * src/muscle_tab.c (getargs.h): Include it.
19550 (muscle_init): Insert new muscle skeleton.
19552 2001-09-18 Pascal Bart <pascal.bart@epita.fr>
19554 * src/output.c (output_parser): Delete unused variable actions_dumped.
19556 2001-09-07 Pascal Bart <pascal.bart@epita.fr>
19558 * src/output.c (output): Delete call to reader_output_yylsp.
19559 * src/reader.c (reader): Likewise.
19560 * src/reader.h: Delete declaration of reader_output_yylsp.
19562 2001-09-02 Marc Autret <autret_m@epita.fr>
19564 * src/reader.c: Include muscle_tab.h.
19565 (parse_union_decl): Update.
19566 (parse_macro_decl): Rename parse_muscle_decl.
19567 Update to use renamed functions and variable.
19568 (read_declarations, copy_action, read_additionnal_code, : Updated
19569 with correct variables and functions names.
19570 (packsymbols, reader): Likewise.
19572 * src/reader.h (muscle_obstack): Extern declaration update.
19574 * src/output.c: Include muscle_tab.h
19575 In all functions using macro_insert, change by using muscle_insert ().
19576 (macro_obstack): Rename muscle_obstack.
19577 Echo modifications in the whole file.
19578 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
19579 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
19580 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
19582 * src/muscle_tab.h: Update double inclusion macros.
19583 (macro_entry_s): Rename muscle_entry_s.
19586 * src/muscle_tab.c: Include muscle_tab.h.
19587 Rename macro_tabble to muscle_table.
19588 (mhash1, mhash2, mcmp): Use muscle_entry.
19589 (macro_init): Rename muscle_init. Update.
19590 (macro_insert): Rename muscle_insert. Update.
19591 (macro_find): Rename muscle_find. Update.
19593 * src/main.c: Include muscle_tab.h.
19594 (main): Call muscle_init ().
19595 * src/Makefile.am (bison_SOURCES): Echo modifications.
19597 2001-09-02 Marc Autret <autret_m@epita.fr>
19599 Now the files macro_tab.[ch] are named muscle_tab.[ch].
19601 * src/muscle_tab.c, src/muscle_tab.h: Add files.
19603 2001-09-02 Marc Autret <autret_m@epita.fr>
19605 * src/macrotab.c, src/macrotab.h: Remove.
19607 2001-09-01 Pascal Bart <pascal.bart@epita.fr>
19609 * src/reader.c (copy_guard): Use muscle to specify the `#line'
19612 2001-09-01 Marc Autret <autret_m@epita.fr>
19614 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
19615 to an explicit value to activate the feature. We do it here.
19617 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
19619 * src/output.c (prepare): Delete the `filename' muscule insertion.
19620 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
19621 (parse_union_decl): Likewise.
19622 * src/macrotab.c (macro_init): Initialize filename by infile.
19624 2001-08-31 Marc Autret <autret_m@epita.fr>
19626 * src/bison.simple (YYLSP_NEEDED): New definition.
19627 * src/output.c (prepare): Add macro insertion of `locations_flag'
19629 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
19631 * src/output.c (prepare): Delete insertion of previous muscles,
19632 and insert the `prefix' muscles.
19633 * src/macrotab.c (macro_init): Likewise.
19634 (macro_init): Initialization prefix directive by `yy'.
19635 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
19636 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
19637 yylval, yydebug, yyerror, yynerrs and yyparse.
19638 New directive `#define' to substitute yydebug, ... with option
19641 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
19643 * src/main.c (main): Standardize.
19644 * src/output.c (output_table_data, output_parser): Likewise.
19645 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
19647 2001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
19649 * src/reader.c (read_additionnal_code): Rename %%user_code to
19651 * src/output.c (output): Rename %%declarations to %%prologue.
19652 * src/bison.simple: Echo modifications.
19654 2001-08-31 Marc Autret <autret_m@epita.fr>
19656 * src/reader.c (readgram): CleanUp.
19657 (output_token_defines): Likewise.
19658 (packsymbols): Likewise.
19659 (reader): Likewise.
19660 * src/output.c (output): CPP-out useless code.
19662 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
19664 * src/reader.c (reader): Delete obsolete call to function
19665 output_trailers and output_headers.
19666 * src/output.h: Remove obsolete functions prototypes of output_headers
19667 and output_trailers.
19669 2001-08-30 Pascal Bart <pascal.bart@epita.fr>
19671 * src/main.c: Include macrotab.h.
19672 * src/macrotab.h (macro_entry_s): Constify fields.
19673 Adjust functions prototypes.
19674 * src/macrotab.c (macro_insert): Constify key and value.
19675 (macro_find): Constify key.
19676 (macro_insert): Include 'xalloc.h'
19677 (macro_insert): Use XMALLOC.
19678 (macro_find): Constify return value.
19679 * src/output.c (output_table_data): Rename table to table_data.
19680 (output_parser): Constify macro_key, macro_value.
19682 2001-08-30 Marc Autret <autret_m@epita.fr>
19684 * src/reader.c (parse_skel_decl): New.
19685 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
19686 * src/lex.h (token_t): New token `tok_skel'.
19687 * src/lex.c (percent_table): Add skeleton option entry.
19690 2001-08-29 Marc Autret <autret_m@epita.fr>
19692 * src/bison.simple: Add %%user_code directive at the end.
19693 * src/reader.c (read_additionnal_code): New.
19695 * src/output.c (output_program): Remove.
19698 2001-08-28 Marc Autret <autret_m@epita.fr>
19700 * src/output.c (output_actions): Clean up.
19701 (output_gram): CPP-out useless code.
19702 * src/reader.c (reader): Clean up, CPP-out useless code.
19704 2001-08-28 Pascal Bart <pascal.bart@epita.fr>
19706 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
19708 * src/bison.simple: Add `%%definitions'.
19710 2001-08-28 Marc Autret <autret_m@epita.fr>
19712 * config/depcomp: New file.
19714 2001-08-27 Paul Eggert <eggert@twinsun.com>
19716 * src/bison.simple (yyparse): Don't take the address of an
19717 item before the start of an array, as that doesn't conform to
19720 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
19722 * src/output.c (output): Remove the initialization of the macro
19723 obstack. It was done too late here.
19725 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
19727 (reader): Initialize the macro obstack here, since we need it to grow
19728 '%define' directives.
19730 * src/reader.h: Declare the macro obstack as extern.
19732 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
19734 * src/output.c (output_parser): Fix. Store single '%' characters in
19735 the output obstack instead of throwing them away.
19737 2001-08-27 Akim Demaille <akim@epita.fr>
19739 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
19741 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
19743 * lib/Makefile.am: Adjust.
19745 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
19747 * src/bison.simple: Update and add '%%' directives.
19749 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
19751 * src/reader.c (reader): Remove calls to 'output_headers' and
19752 'output_trailers'. Remove some C output.
19753 (readgram): Disable a piece of code that was writing a default
19754 definition for 'YYSTYPE'.
19755 (reader_output_yylsp): Remove.
19756 (packsymbols): Output token defintions to a macro.
19757 (copy_definition): Disable C output.
19759 * src/reader.c (parse_macro_decl): New function used to parse macro
19761 (copy_string2): Put the body of copy_string into this new function.
19762 Add a parameter to let the caller choose whether he wants to copy the
19763 string delimiters or not.
19764 (copy_string): Be a simple call to copy_string2 with the last argument
19766 (read_declarations): Add case for macro definition.
19767 (copy_identifier): New.
19768 (parse_macro_decl): Read macro identifiers using copy_identifier
19771 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
19773 * src/output.c (prepare): Add prefixed names.
19774 (output_parser): Output semantic actions.
19775 (output_parser): Fix bug on '%%line' directives.
19777 * src/output.c (output_headers): Remove. The C code printed by this
19778 function should now be in the skeletons.
19779 (output_trailers): Remove.
19780 (output): Disable call to 'reader_output_yylsp'.
19781 (output_rule_data): Do not output tables to the table obstack.
19783 * src/output.c: Remove some C dedicated output.
19784 Improve the use of macro and output obstacks.
19785 (output_defines): Remove.
19787 * src/output.c (output_token_translations): Associate 'translate'
19788 table with a macro. No output to the table obstack.
19789 (output_gram): Same for 'rhs' and 'prhs'.
19790 (output_stos): Same for 'stos'.
19791 (output_rule_data): Same for 'r1' and 'r2'.
19792 (token_actions): Same for 'defact'.
19793 (goto_actions): Same for 'defgoto'.
19794 (output_base): Same for 'pact' and 'pgoto'.
19795 (output_table): Same for 'table'.
19796 (output_check): Same for 'check'.
19798 * src/output.c (output_table_data): New function.
19799 (output_short_table): Remove.
19800 (output_short_or_char_table): Remove.
19802 * src/output.c (output_parser): Replace most of the skeleton copy code
19803 with something new. Skeletons are now processed character by character
19804 rather than line by line, and Bison looks for '%%' macros. This is the
19805 first step in making Bison's output process (a lot) more flexible.
19806 (output_parser): Use the macro table.
19808 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
19810 * src/main.c (main): Initialize the macro table.
19812 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
19814 * src/lex.c (percent_table): Add tok_define.
19815 * src/lex.h: Add tok_define.
19817 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
19819 * src/macrotab.c: New file.
19820 * src/macrotab.h: New file.
19821 * src/Makefile.am: Update.
19823 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
19825 * lib/hash.c: New file.
19826 * lib/hash.h: New file.
19827 * lib/Makefile.am: Update.
19829 2001-08-15 Akim Demaille <akim@epita.fr>
19833 2001-08-15 Marc Autret <autret_m@epita.fr>
19835 * src/reader.c (readgram): Indent output macro YYSTYPE.
19836 (packsymbols): Likewise.
19837 (output_token_defines): Likewise.
19838 * src/files.c: Standardize.
19839 (compute_header_macro): New.
19840 (defines_obstack_save): New. Use compute_header_macro.
19841 (output_files): Update. Use defines_obstack_save.
19843 2001-08-15 Akim Demaille <akim@epita.fr>
19845 * doc/bison.texinfo (Table of Symbols): Document
19846 YYSTACK_USE_ALLOCA.
19848 2001-08-15 Akim Demaille <akim@epita.fr>
19850 * missing: Update from CVS Automake.
19851 * config/config.guess, config/config.sub, config/texinfo.tex:
19852 Update from gnu.org.
19854 2001-08-15 Akim Demaille <akim@epita.fr>
19856 * Makefile.maint: Sync with CVS Autoconf.
19858 2001-08-14 Pascal Bart <pascal.bart@epita.fr>
19860 * doc/bison.texinfo: Include GNU Free Documentation License from
19862 * doc/fdl.texi: Add to package.
19864 2001-08-14 Marc Autret <autret_m@epita.fr>
19866 Turn on %{source,header}_extension features.
19868 * src/lex.c (percent_table): Un-CPP out header_extension and
19870 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
19871 (compute_exts_from_src): Remove conditions. It restores priorities
19874 2001-08-14 Marc Autret <autret_m@epita.fr>
19876 * src/files.c (compute_base_names): Add extensions computing when
19877 `--file-prefix' used.
19878 Standardize function calls.
19880 2001-08-13 Marc Autret <autret_m@epita.fr>
19882 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
19883 defining it (defined but null disables alloca).
19885 2001-08-13 Marc Autret <autret_m@epita.fr>
19887 * src/bison.simple (_yy_memcpy): CPP reformat.
19889 2001-08-13 Pascal Bart <pascal.bart@epita.fr>
19891 * tests/atconfig.in (CPPFLAGS): Fix.
19893 2001-08-10 Pascal Bart <pascal.bart@epita.fr>
19895 * doc/bison.texinfo: Include GNU General Public License from
19897 * doc/gpl.texi: Add to package.
19899 2001-08-10 Marc Autret <autret_m@epita.fr>
19901 * src/print_graph.h: Fix.
19902 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
19904 2001-08-10 Akim Demaille <akim@epita.fr>
19906 * src/system.h: Provide default declarations for stpcpy, strndup,
19909 2001-08-10 Robert Anisko <anisko_r@epita.fr>
19911 * doc/bison.texinfo (Locations): Update @$ stuff.
19913 2001-08-09 Robert Anisko <anisko_r@epita.fr>
19915 * src/bison.simple (YYLLOC_DEFAULT): Update.
19918 2001-08-08 Marc Autret <autret_m@epita.fr>
19920 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
19921 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
19922 Reported by Fabrice Bauzac.
19924 2001-08-08 Marc Autret <autret_m@epita.fr>
19926 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
19927 * src/vcg.c (output_node): Fix.
19928 * src/vcg.h: Cleanup.
19929 * src/print_graph.c: Add comments.
19930 (node_output_size): New global variable. Simplify the formatting of
19931 the VCG graph output.
19932 (print_actions): Unused code is now used. It notifies the final state
19933 and no action states in the VCG graph. It also give the reduce actions.
19934 The `shift and goto' edges are red and the `go to state' edges are
19936 Get the current node name and node_obstack by argument.
19937 (node_obstack): New variable.
19938 (print_state): Manage node_obstack.
19939 (print_core): Use node_obstack given by argument.
19940 A node is not only computed here but in print_actions also.
19941 (print_graph): CPP out useless code instead of commenting it.
19943 2001-08-07 Pascal Bart <pascal.bart@epita.fr>
19945 * tests/atconfig.in (CPPFLAGS): Fix.
19947 2001-08-07 Akim Demaille <akim@epita.fr>
19949 * src/print_graph.c (quote): New.
19950 (print_core): Use it.
19952 2001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
19954 * src/vcg.c (complain.h): Include it.
19955 Unepitaize `return' invocations.
19956 [NDEBUG] (main): Remove.
19957 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
19958 * src/files.c (open_files): Initialize graph_obstack.
19959 * src/print_graph.c (print_actions): CPP out useless code.
19960 (print_core): Don't output the last `\n' in labels.
19962 * src/files.c (output_files): Output the VCG file.
19963 * src/main.c (main): Invoke print_graph ();
19965 2001-08-06 Marc Autret <autret_m@epita.fr>
19967 Automaton VCG graph output.
19968 Using option ``-g'' or long option ``--graph'', you can generate
19969 a gram_filename.vcg file containing a VCG description of the LALR (1)
19970 automaton of your grammar.
19972 * src/main.c: Call to print_graph() function.
19973 * src/getargs.h: Update.
19974 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
19975 (graph_flag): New flag.
19976 (longopts): Update.
19977 (getargs): Add case `g'.
19978 * src/files.c (graph_obstack): New obstack struct.
19979 (open_files): Initialize new obstack.
19980 (output_files): Saves graph_obstack if required.
19981 * src/files.h (graph_obstack): New extern declaration.
19982 * src/Makefile.am: Add new source files.
19984 2001-08-06 Marc Autret <autret_m@epita.fr>
19986 * src/print_graph.c, src/print_graph.h (graph): New.
19987 * src/vcg.h: New file.
19988 * src/vcg.c: New file, VCG graph handling.
19990 2001-08-06 Marc Autret <autret_m@epita.fr>
19992 Add of %source_extension and %header_extension which specify
19993 the source or/and the header output file extension.
19995 * src/files.c (compute_base_names): Remove initialisation of
19996 src_extension and header_extension.
19997 (compute_exts_from_gf): Update.
19998 (compute_exts_from_src): Update.
19999 (output_files): Update.
20000 * src/reader.c (parse_header_extension_decl): New.
20001 (parse_source_extension_decl): New.
20002 (read_declarations): New case statements for the new tokens.
20003 * src/lex.c (percent_table): Add entries for %source_extension
20004 and %header_extension.
20005 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
20007 2001-08-06 Marc Autret <autret_m@epita.fr>
20009 * configure.in: Bump to 1.28c.
20010 * doc/bison.texinfo: Texinfo thingies.
20012 2001-08-04 Pascal Bart <pascal.bart@epita.fr>
20014 * tests/atconfig.in (CPPFLAGS): Add.
20015 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
20017 2001-08-03 Akim Demaille <akim@epita.fr>
20021 2001-08-03 Akim Demaille <akim@epita.fr>
20023 * tests/Makefile.am (check-local): Ship testsuite.
20024 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
20025 Include `string.h'.
20027 2001-08-03 Akim Demaille <akim@epita.fr>
20029 * configure.in: Try using -Wformat when compiling.
20031 2001-08-03 Akim Demaille <akim@epita.fr>
20033 * configure.in: Bump to 1.28b.
20035 2001-08-03 Akim Demaille <akim@epita.fr>
20037 * src/complain.c: Adjust strerror_r portability issues.
20039 2001-08-03 Akim Demaille <akim@epita.fr>
20043 2001-08-03 Akim Demaille <akim@epita.fr>
20045 * src/getargs.c, src/getarg.h (skeleton)): Constify.
20046 * src/lex.c (literalchar): Avoid name clashes on `buf'.
20047 * src/getargs.c: Include complain.h.
20048 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
20049 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
20051 2001-08-03 Akim Demaille <akim@epita.fr>
20053 * src/reader.c (readgram): Display hidden chars in error messages.
20055 2001-08-03 Akim Demaille <akim@epita.fr>
20057 Update to gettext 0.10.39.
20059 2001-08-03 Akim Demaille <akim@epita.fr>
20061 * lib/strspn.c: New.
20063 2001-08-01 Marc Autret <autret_m@epita.fr>
20065 * doc/bison.texinfo: Update.
20066 * doc/bison.1 (mandoc): Update.
20067 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
20068 * src/files.c: Support output files extensions computing.
20069 (src_extension): New static variable.
20070 (header_extension): New static variable.
20071 (tr): New function.
20072 (get_extension_index): New function, gets the index of an extension
20073 filename in a string.
20074 (compute_exts_from_gf): New function, computes extensions from the
20075 grammar file extension.
20076 (compute_exts_from_src): New functions, computes extensions from the
20077 C source file extension, file given by ``-o'' option.
20078 (compute_base_names): Update.
20079 (output_files): Update.
20081 2001-08-01 Robert Anisko <anisko_r@epita.fr>
20083 * doc/bison.texi: Document @$.
20084 (Locations): New section.
20086 2001-07-18 Akim Demaille <akim@epita.fr>
20088 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
20089 * config/prev-version.txt, config/move-if-change: New.
20090 * Makefile.am: Adjust.
20092 2001-07-08 Pascal Bart <pascal.bart@epita.fr>
20094 * src/bison.simple (yyparse): Suppress warning `comparaison
20095 between signed and unsigned'.
20097 2001-07-05 Pascal Bart <pascal.bart@epita.fr>
20099 * src/getargs.h (raw_flag): Remove.
20100 * src/getargs.c: Die on `-r'/`--raw'.
20101 * src/lex.c (parse_percent_token): Die on `%raw'.
20102 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
20103 * tests/calc.at: Suppress test with option `--raw'.
20105 2001-07-14 Akim Demaille <akim@epita.fr>
20108 * configure.in: Require Autoconf 2.50.
20109 Update to gettext 0.10.38.
20111 2001-03-16 Akim Demaille <akim@epita.fr>
20113 * doc/bison.texinfo: ANSIfy the examples.
20115 2001-03-16 Akim Demaille <akim@epita.fr>
20117 * getargs.c (skeleton): New variable.
20118 (longopts): --skeleton is a new option.
20119 (shortopts, getargs): -S is a new option.
20120 * getargs.h: Declare skeleton.
20121 * output.c (output_parser): Use it.
20123 2001-03-16 Akim Demaille <akim@epita.fr>
20125 * m4/strerror_r.m4: New.
20126 * m4/error.m4: Run AC_FUNC_STRERROR_R.
20127 * lib/error.h, lib/error.c: Update.
20129 2001-03-16 Akim Demaille <akim@epita.fr>
20131 * src/getargs.c (longopts): Clean up.
20133 2001-02-21 Akim Demaille <akim@epita.fr>
20135 * src/reader.c (gensym): `gensym_count' is your own.
20136 Use a static buf to create the symbol name, as token_buffer is no
20139 2001-02-08 Akim Demaille <akim@epita.fr>
20141 * src/conflicts.c (conflict_report): Be sure not to append to res
20142 between two calls, which could happen if both first sprintf were
20143 skipped, but not the first cp += strlen.
20145 2001-02-08 Akim Demaille <akim@epita.fr>
20147 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
20148 New, from fileutils 4.0.37.
20149 * configure.in: Require Autoconf 2.49c. I took some time before
20150 making this decision. This is the only way out for portability
20151 issues in Bison, it would mean way too much duplicate effort to
20152 import in Bison features implemented in 2.49c since 2.13.
20153 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
20155 2001-02-02 Akim Demaille <akim@epita.fr>
20157 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
20158 * lib/xalloc.h, lib/xmalloc.c: Update.
20160 2001-01-19 Akim Demaille <akim@epita.fr>
20162 Get rid of the ad hoc handling of token_buffer in the scanner: use
20165 * src/lex.c (token_obstack): New.
20166 (init_lex): Initialize it. No longer call...
20167 (grow_token_buffer): this. Remove it.
20168 Adjust all the places which used it to use the obstack.
20170 2001-01-19 Akim Demaille <akim@epita.fr>
20172 * src/lex.h: Rename all the tokens:
20173 s/\bENDFILE\b/tok_eof/g;
20174 s/\bIDENTIFIER\b/tok_identifier/g;
20176 Let them be enums, not #define, to ease debugging.
20177 Adjust all the code.
20179 2001-01-18 Akim Demaille <akim@epita.fr>
20181 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
20182 * src/lex.c (maxtoken, grow_token_buffer): Static.
20184 2001-01-18 Akim Demaille <akim@epita.fr>
20186 Since we now use obstacks, more % directives can be enabled.
20188 * src/lex.c (percent_table): Also accept `%yacc',
20189 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
20191 Handle the actions for `%semantic_parser' and `%pure_parser' here,
20192 instead of returning a token.
20193 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
20194 * src/reader.c (read_declarations): Adjust.
20195 * src/files.c (open_files): Don't call `compute_base_names', don't
20196 compute `attrsfile' since they depend upon data which might be
20197 *in* the input file now.
20198 (output_files): Do it here.
20199 * src/output.c (output_headers): Document the fact that this patch
20200 introduces a guaranteed SEGV for semantic parsers.
20201 * doc/bison.texinfo: Document them.
20202 * tests/suite.at: Exercise these %options.
20204 2000-12-20 Akim Demaille <akim@epita.fr>
20206 Also handle the output file (--verbose) with obstacks.
20208 * files.c (foutput): Remove.
20209 (output_obstack): New.
20210 Adjust all dependencies.
20211 * src/conflicts.c: Return a string.
20212 * src/system.h (obstack_grow_string): Rename as...
20213 (obstack_sgrow): this. Be ready to work with non literals.
20214 (obstack_fgrow4): New.
20216 2000-12-20 Akim Demaille <akim@epita.fr>
20218 * src/files.c (open_files): Fix the computation of short_base_name
20219 in the case of `-o foo.tab.c'.
20221 2000-12-20 Akim Demaille <akim@epita.fr>
20223 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
20224 (copy_dollar): Now that everything uses obstacks, get rid of the
20227 2000-12-20 Akim Demaille <akim@epita.fr>
20229 * src/files.c (open_files): Actually the `.output' file is based
20230 on the short_base_name, not base_name.
20231 * tests/suite.at (Checking output file names): Adjust.
20233 2000-12-20 Akim Demaille <akim@epita.fr>
20235 * src/bison.s1: Remove, we now use directly...
20236 * src/bison.simple: this.
20237 * src/Makefile.am: Use pkgdata instead of data.
20239 2000-12-20 Akim Demaille <akim@epita.fr>
20241 * src/files.c (guard_obstack): New.
20242 (open_files): Initialize it.
20243 (output_files): Dump it...
20244 * src/files.h: Export it.
20245 * src/reader.c (copy_guard): Use it.
20247 2000-12-19 Akim Demaille <akim@epita.fr>
20249 * src/files.c (outfile, defsfile, actfile): Removed as global
20251 (open_files): Don't compute them.
20252 (output_files): Adjust.
20253 (base_name, short_base_name): Be global.
20254 Adjust dependencies.
20256 2000-12-19 Akim Demaille <akim@epita.fr>
20258 * src/files.c (strsuffix): New.
20259 (stringappend): Be just like strcat but allocate.
20260 (base_names): Eve out from open_files.
20261 Try to simplify the rather hairy computation of base_name and
20263 (open_files): Use it.
20264 * tests/suite.at (Checking output file names): New test.
20266 2000-12-19 Akim Demaille <akim@epita.fr>
20268 * src/system.h (obstack_grow_literal_string): Rename as...
20269 (obstack_grow_string): this.
20270 * src/output.c (output_parser): Recognize `%% actions' instead of
20272 * src/bison.s1: s/$/%% actions/.
20273 * src/bison.hairy: Likewise.
20275 2000-12-19 Akim Demaille <akim@epita.fr>
20277 * src/output.c (output_parser): Compute the `#line' lines when
20279 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
20280 Suggested by Hans Aberg.
20282 2000-12-19 Akim Demaille <akim@epita.fr>
20284 Let the handling of the skeleton files be local to the procedures
20287 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
20289 (fparser, open_extra_files): Remove.
20290 (open_files, output_files): Don't take care of fparser.
20291 * src/files.h: Adjust.
20292 * src/output.c (output_parser): Open and close the file to the
20294 * src/reader.c (read_declarations): When %semantic_parser, open
20297 2000-12-19 Akim Demaille <akim@epita.fr>
20299 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
20300 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
20302 2000-12-19 Akim Demaille <akim@epita.fr>
20304 * src/files.c (open_files): Yipee! We no longer need all the code
20305 looking for `/tmp' since we have no tmp file.
20307 2000-12-19 Akim Demaille <akim@epita.fr>
20309 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
20311 * src/files.c (open_files): Less dependency on MSDOS etc.
20313 2000-12-14 Akim Demaille <akim@epita.fr>
20315 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
20316 Provide a default definition.
20317 Use it when executing the default @ action.
20318 * src/reader.c (reader_output_yylsp): No longer include
20319 `timestamp' and `text' in the default YYLTYPE.
20321 2000-12-12 Akim Demaille <akim@epita.fr>
20323 * src/reader.c (copy_definition, parse_union_decl, copy_action)
20324 (copy_guard): Quote the file names.
20325 Reported by Laurent Mascherpa.
20327 2000-12-12 Akim Demaille <akim@epita.fr>
20329 * src/output.c (output_headers, output_program, output): Be sure
20330 to escape special characters when outputting filenames.
20331 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
20332 (output_headers): Don't depend on them, Use ACTSTR.
20334 2000-11-17 Akim Demaille <akim@epita.fr>
20336 * lib/obstack.h: Formatting changes.
20337 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
20338 prevents type checking.
20339 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
20340 cast the value to (void *): assigning a `foo *' to a `void *'
20342 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
20343 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
20346 2000-11-17 Akim Demaille <akim@epita.fr>
20348 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
20350 (suite.m4, regression.m4, calc.m4): these.
20351 * tests/atgeneral.m4: Update from CVS Autoconf.
20353 2000-11-17 Akim Demaille <akim@epita.fr>
20355 * tests/regression.m4 (%union and --defines): New test,
20356 demonstrating a current bug in the obstack implementation.
20358 2000-11-17 Akim Demaille <akim@epita.fr>
20360 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
20362 Use them to declare the variables which are global or local to
20365 2000-11-17 Akim Demaille <akim@epita.fr>
20367 * acconfig.h: Remove, no longer used.
20369 2000-11-07 Akim Demaille <akim@epita.fr>
20371 * src: s/Copyright (C)/Copyright/g.
20373 2000-11-07 Akim Demaille <akim@epita.fr>
20375 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
20377 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
20379 2000-11-07 Akim Demaille <akim@epita.fr>
20381 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
20382 Merge in a single CPP if/else.
20384 2000-11-07 Akim Demaille <akim@epita.fr>
20386 * src/output.c (output): Remove useless variables.
20387 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
20388 argument `data' for consistency with the prototypes.
20389 Qualify it `const'.
20390 (obstack_copy, obstack_copy0): Rename the second argument as
20391 `address' for consistency. Qualify it `const'.
20392 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
20393 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
20394 `const' their input argument (`data' or `address').
20395 Adjust the corresponding macros to include `const' in casts.
20397 2000-11-03 Akim Demaille <akim@epita.fr>
20399 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
20400 s/PFILE1/BISON_HAIRY/.
20401 Adjust dependencies.
20403 2000-11-03 Akim Demaille <akim@epita.fr>
20405 For some reason, this was not applied.
20407 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
20408 `unlink': it's no longer used.
20410 2000-11-03 Akim Demaille <akim@epita.fr>
20412 * src/files.c (skeleton_find): New function, eved out of...
20413 (open_files, open_extra_files): here.
20415 2000-11-03 Akim Demaille <akim@epita.fr>
20417 Don't use `atexit'.
20419 * src/files.c (obstack_save): New function.
20420 (done): Rename as...
20421 (output_files): this.
20422 Use `obstack_save'.
20423 * src/main.c (main): Don't use `atexit' to register `done', since
20424 it no longer has to remove tmp files, just call `output_files'
20425 when there are no errors.
20427 2000-11-02 Akim Demaille <akim@epita.fr>
20429 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
20430 `unlink': it's no longer used.
20431 * src/files.h: Formatting changes.
20433 2000-11-02 Akim Demaille <akim@epita.fr>
20435 Remove the last uses of mktemp and unlink/delete.
20437 * src/files.c (fdefines, ftable): Removed.
20438 (defines_ostack, table_obstack): New.
20439 Adjust dependencies of the former into uses of the latter.
20440 * src/output.c (output_short_or_char_table, output_short_table):
20441 Convert to using obstacks.
20442 * src/reader.c (copy_comment2): Accept one FILE * and two
20444 (output_token_defines, reader_output_yylsp): Use obstacks.
20445 * src/system.h (obstack_fgrow3): New.
20446 * po/POTFILES.in: Adjust.
20448 2000-11-01 Akim Demaille <akim@epita.fr>
20450 Change each use of `fattrs' into a use of `attrs_obstack'.
20452 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
20453 * src/files.c (fattrs): Remove.
20454 (attrs_obstack): New.
20455 Adjust all dependencies.
20456 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
20458 2000-11-01 Akim Demaille <akim@epita.fr>
20460 Introduce obstacks.
20461 Change each use of `faction' into a use of `action_obstack'.
20463 * lib/obstack.h, lib/obstack.c: New files.
20464 * src/files.c (faction): Remove.
20465 (action_obstack): New.
20466 Adjust all dependencies.
20468 2000-10-20 Akim Demaille <akim@epita.fr>
20470 * lib/quote.h (PARAMS): New macro. Use it.
20472 2000-10-16 Akim Demaille <akim@epita.fr>
20474 * src/output.c (output_short_or_char_table): New function.
20475 (output_short_table, output_token_translations): Use it.
20476 (goto_actions): Use output_short_table.
20478 2000-10-16 Akim Demaille <akim@epita.fr>
20480 * src/symtab.c (bucket_new): New function.
20483 * src/output.c (output_short_table): New argument to display the
20484 comment associated with the table.
20485 Adjust dependencies.
20486 (output_gram): Use it.
20487 (output_rule_data): Nicer output layout for YYTNAME.
20489 2000-10-16 Akim Demaille <akim@epita.fr>
20491 * src/lex.c (read_typename): New function.
20493 * src/reader.c (copy_dollar): Likewise.
20495 2000-10-16 Akim Demaille <akim@epita.fr>
20497 * src/reader.c (copy_comment2): Expect the input stream to be on
20498 the `/' which is suspected to open a comment, instead of being
20499 called after `//' or `/*' was read.
20500 (copy_comment, copy_definition, parse_union_decl, copy_action)
20501 (copy_guard): Adjust.
20503 2000-10-16 Akim Demaille <akim@epita.fr>
20505 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
20506 `read_signed_integer'.
20508 2000-10-16 Akim Demaille <akim@epita.fr>
20510 * src/reader.c (copy_dollar): New function.
20511 (copy_guard, copy_action): Use it.
20513 2000-10-16 Akim Demaille <akim@epita.fr>
20515 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
20516 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
20517 New files, from Fileutils 4.0.27.
20518 * src/main.c (printable_version): Remove.
20519 * src/lex.c, src/reader.c: Use `quote'.
20521 2000-10-04 Akim Demaille <akim@epita.fr>
20523 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
20525 2000-10-04 Akim Demaille <akim@epita.fr>
20527 * doc/bison.texinfo: Various typos spotted by Neil Booth.
20529 2000-10-04 Akim Demaille <akim@epita.fr>
20531 When a literal string is used to define two different tokens,
20532 `bison -v' segfaults.
20533 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
20535 * tests/regression.m4: New file.
20536 Include the core of the sample provided by Piotr Gackiewicz.
20537 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
20540 2000-10-04 Akim Demaille <akim@epita.fr>
20542 * src/reader.c (parse_expect_decl): Keep `count' within the size
20546 2000-10-02 Paul Eggert <eggert@twinsun.com>
20548 * bison.s1 (yyparse): Assign the default value
20549 unconditionally, to avoid a GCC warning and make the parser a
20552 2000-10-02 Akim Demaille <akim@epita.fr>
20554 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
20557 2000-10-02 Akim Demaille <akim@epita.fr>
20559 * src/derives.c, src/print.c, src/reduce.c: To ease the
20560 translation, move some `\n' out of the translated strings.
20562 2000-10-02 Akim Demaille <akim@epita.fr>
20564 The location tracking mechanism is precious for parse error
20565 messages. Nevertheless, it is enabled only when `@n' is used in
20566 the grammar, which is a different issue (you can use it in error
20567 message, but not in the grammar per se). Therefore, there should
20568 be another means to enable it.
20570 * src/getargs.c (getargs): Support `--locations'.
20571 (usage): Report it.
20572 * src/getargs.h (locationsflag): Export it.
20573 * src/lex.c (percent_table): Support `%locations'.
20574 * src/reader.c (yylsp_needed): Remove this variable, now replaced
20575 with `locationsflag'.
20576 * doc/bison.texinfo: Document `--locations' and `%locations'.
20578 * tests/calc.m4: Test it.
20580 For regularity of the names, replace each
20581 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
20582 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
20583 In addition replace each `flag' with `_flag'.
20585 2000-10-02 Akim Demaille <akim@epita.fr>
20587 Also test parse error messages, including with YYERROR_VERBOSE.
20589 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
20591 Use it to check the computations.
20592 Use it to check `nonassoc' is honored.
20593 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
20594 `--yyerror-verbose'.
20595 (_AT_CHECK_CALC): Adjust to this option.
20596 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
20598 2000-10-02 Akim Demaille <akim@epita.fr>
20600 Test also `--verbose', `--defines' and `--name-prefix'. Testing
20601 the latter demonstrates a flaw in the handling of non debugging
20602 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
20603 was used in order to simplify:
20619 unfortunately this leads to a CPP conflict when
20620 `--name-prefix=foo' is used since it produces `#define yydebug
20623 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
20624 (YYDPRINTF): New macro.
20626 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
20628 Also test `--verbose', `--defines' and `--name-prefix'.
20630 2000-10-02 Akim Demaille <akim@epita.fr>
20632 Improve the readability of the produced parsers.
20634 * src/bison.s1: Formatting changes.
20635 Improve the comment related to the `$' mark.
20636 (yydefault): Don't fall through to `yyresume': `goto' there.
20637 * src/output.c (output_parser): When the `$' is met, skip the end
20639 New variable, `number_of_dollar_signs', to check there's exactly
20640 one `$' in the parser skeleton.
20642 2000-10-02 Akim Demaille <akim@epita.fr>
20644 * lib/xstrdup.c: New file, from the fileutils.
20645 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
20646 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
20647 instead of strlen + xmalloc + strcpy.
20648 * src/symtab.c (copys): Remove, use xstrdup instead.
20650 2000-10-02 Akim Demaille <akim@epita.fr>
20652 * src/gram.h (associativity): New enum type which replaces the
20653 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
20654 `right_assoc', `left_assoc' and `non_assoc'.
20655 Adjust all dependencies.
20656 * src/reader.c: Formatting changes.
20657 (LTYPESTR): Don't define it, use it as a literal in
20658 `reader_output_yylsp'.
20659 * src/symtab.h (symbol_class): New enum type which replaces the
20660 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
20661 `sunknown', `stoken and `snterm'.
20663 2000-10-02 Akim Demaille <akim@epita.fr>
20665 * src/getargs.c (fixed_outfiles): Rename as...
20666 (yaccflag): for consistency and accuracy.
20667 Adjust dependencies.
20669 2000-10-02 Akim Demaille <akim@epita.fr>
20671 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
20672 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
20673 difficult and introduced a lot of core dump. It turns out that
20674 Bison used an implementation of `xmalloc' based on `calloc', and
20675 at various places it does depend upon the initialization to 0. I
20676 have not tried to isolate the pertinent places, and all the former
20677 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
20678 someone should address this issue.
20680 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
20681 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
20683 Adjust dependencies.
20684 * src/warshall.h: New file.
20687 2000-10-02 Akim Demaille <akim@epita.fr>
20689 Various anti-`extern in *.c' changes.
20691 * src/system.h: Include `assert.h'.
20693 2000-10-02 Akim Demaille <akim@epita.fr>
20695 * src/state.h (nstates, final_state, first_state, first_shift)
20696 (first_reduction): Move their exportation from here...
20697 * src/LR0.h: to here.
20698 Adjust dependencies.
20699 * src/getargs.c (statisticsflag): New variable.
20700 Add support for `--statistics'.
20701 Adjust dependencies.
20703 Remove a lot of now useless `extern' statements in most files.
20705 2000-10-02 Akim Demaille <akim@epita.fr>
20707 * src/LR0.h: New file.
20710 2000-10-02 Akim Demaille <akim@epita.fr>
20712 * src/print.h: New file.
20714 * src/print.c: Formatting and ordering changes.
20715 (verbose, terse): Replace with...
20716 (print_results): this new function.
20717 Adjust dependencies.
20719 2000-10-02 Akim Demaille <akim@epita.fr>
20721 * src/conflicts.c (conflict_report): New function.
20722 (conflict_log, verbose_conflict_log): Replace with...
20723 (print_conflicts): this function.
20724 Adjust dependencies.
20725 * src/conflicts.h: New file.
20726 Propagate its inclusion.
20728 2000-10-02 Akim Demaille <akim@epita.fr>
20730 * src/nullable.h: New file.
20731 Propagate its inclusion.
20732 * src/nullable.c: Formatting changes.
20734 2000-10-02 Akim Demaille <akim@epita.fr>
20736 * src/reduce.h: New file.
20737 Propagate its inclusion.
20738 * src/reduce.c: Topological sort and other formatting changes.
20739 (bool, TRUE, FALSE): Move their definition to...
20740 * src/system.h: here.
20742 2000-10-02 Akim Demaille <akim@epita.fr>
20744 * src/files.c: Formatting changes.
20745 (tryopen, tryclose, openfiles): Rename as...
20746 (xfopen, xfclose, open_files): this.
20747 (stringappend): static.
20748 * src/files.h: Complete the list of exported symbols.
20751 2000-10-02 Akim Demaille <akim@epita.fr>
20753 * src/reader.h: New file.
20754 Propagate its use instead of tedious list of `extern' and
20756 * src/reader.c: Formatting changes, topological sort,
20759 2000-10-02 Akim Demaille <akim@epita.fr>
20761 * src/lex.h: Prototype `lex.c' exported functions.
20762 * src/reader.c: Adjust.
20763 * src/lex.c: Formatting changes.
20764 (safegetc): Rename as...
20767 2000-10-02 Akim Demaille <akim@epita.fr>
20769 * src/lalr.h: New file.
20770 Propagate its inclusion instead of prototypes and `extern'.
20771 * src/lalr.c: Formatting changes, topological sorting etc.
20773 2000-10-02 Akim Demaille <akim@epita.fr>
20775 * src/output.c (token_actions): Introduce a temporary array,
20776 YYDEFACT, that makes it possible for this function to use
20777 output_short_table.
20779 2000-10-02 Akim Demaille <akim@epita.fr>
20781 `user_toknums' is output as a `short[]' in `output.c', while it is
20782 defined as a `int[]' in `reader.c'. For consistency with the
20783 other output tables, `user_toknums' is now defined as a table of
20786 * src/reader.c (user_toknums): Be a short table instead of an int
20788 Adjust dependencies.
20790 Factor the short table outputs.
20792 * src/output.c (output_short_table): New function.
20793 * src/output.c (output_gram, output_stos, output_rule_data)
20794 (output_base, output_table, output_check): Use it.
20796 2000-10-02 Akim Demaille <akim@epita.fr>
20798 * src/output.c (output): Topological sort of the functions, in
20799 order to get rid of the `static' prototypes.
20800 No longer use `register'.
20801 * src/output.h: New file.
20802 Propagate its inclusion in files explicitly prototyping functions
20805 2000-09-21 Akim Demaille <akim@epita.fr>
20807 * src/atgeneral.m4: Update from Autoconf.
20809 2000-09-21 Akim Demaille <akim@epita.fr>
20811 * src/closure.h: New file.
20812 * src/closure.c: Formatting changes, topological sort over the
20813 functions, use of closure.h.
20814 (initialize_closure, finalize_closure): Rename as...
20815 (new_closure, free_closure): these. Adjust dependencies.
20816 * src/LR0.c: Formatting changes, topological sort, use of
20818 (initialize_states): Rename as...
20819 (new_states): this.
20820 * src/Makefile.am (noinst_HEADERS): Adjust.
20822 2000-09-20 Akim Demaille <akim@epita.fr>
20824 * src/acconfig.h: Don't protect config.h against multiple
20826 Don't define PARAMS.
20827 * src/system.h: Define PARAMS.
20828 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
20829 purpose of config.h. system.h must not try to fix wrong
20830 definitions in config.h.
20832 2000-09-20 Akim Demaille <akim@epita.fr>
20834 * src/derives.h: New file.
20835 * src/main.c, src/derives.h: Use it.
20836 Formatting changes.
20837 * src/Makefile.am (noinst_HEADERS): Adjust.
20839 2000-09-20 Akim Demaille <akim@epita.fr>
20841 * tests/atgeneral.m4: Update from Autoconf.
20842 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
20843 (AT_CHECK_CALC): New macros.
20844 Use these macros to test bison with options `', `--raw',
20845 `--debug', `--yacc', `--yacc --debug'.
20847 2000-09-19 Akim Demaille <akim@epita.fr>
20849 * src/output.c: Formatting changes.
20850 * src/machine.h: Remove, leaving its contents in...
20851 * src/system.h: here.
20853 Adjust all dependencies on stdio.h and machine.h.
20854 * src/getargs.h: New file.
20855 Let all `extern' declarations about getargs.c be replaced with
20856 inclusion of `getargs.h'.
20857 * src/Makefile.am (noinst_HEADERS): Adjust.
20859 * tests/calc.m4 (yyin): Be initialized in main, not on the global
20861 (yyerror): Returns void, not int.
20862 * doc/bison.texinfo: Formatting changes.
20864 2000-09-19 Akim Demaille <akim@epita.fr>
20866 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
20869 2000-09-18 Akim Demaille <akim@epita.fr>
20871 * configure.in: Append WARNING_CFLAGS to CFLAGS.
20872 * src/Makefile.am (INCLUDES): Don't.
20873 Be ready to fetch headers in lib/.
20875 2000-09-18 Akim Demaille <akim@epita.fr>
20877 * doc/bison.texinfo: Update the copyright.
20878 ANSIfy and GNUify the examples.
20879 Remove the old menu.
20881 2000-09-18 Akim Demaille <akim@epita.fr>
20883 First set of tests: use the `calc' example from the documentation.
20885 * src/bison.s1 (yyparse): Condition the code using `yytname' which
20886 is defined only when YYDEBUG is.
20887 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
20888 * src/files.c (tryopen, tryclose): Formatting changes.
20889 Move to the top and be static.
20890 * src/reader.c (read_signed_integer): Likewise.
20891 * tests/calc.m4: New file.
20892 * Makefile.am, suite.m4: Adjust.
20893 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
20895 2000-09-18 Akim Demaille <akim@epita.fr>
20897 Add support for an Autotest test suite for Bison.
20899 * m4/m4.m4, m4/atconfig.m4: New files.
20900 * m4/Makefile.am (EXTRA_DIST): Adjust.
20901 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
20903 * src/getargs.c: Display a more standard --version message.
20904 * src/reader.c (reader): Formatting changes.
20905 No longer depend upon VERSION_STRING.
20906 * configure.in: No longer use `dnl'.
20907 Set up the test suite and the new directory `tests/.
20908 (VERSION_STRING): Remove.
20910 2000-04-14 Akim Demaille <akim@epita.fr>
20912 * src/reader.c (copy_comment2): New function, same as former
20913 `copy_comment', but outputs into two FILE *.
20914 (copy_comment): Use it.
20915 (parse_union_decl): Use it.
20916 (get_type, parse_start_decl): Use the same `invalid' message.
20917 (parse_start_decl, parse_union_decl): Use the same `multiple'
20919 (parse_union_decl, copy_guard, copy_action): Use the same
20920 `unmatched' message.
20921 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
20923 2000-03-31 Akim Demaille <akim@epita.fr>
20925 * src/files.c (tryopen, tryclose): Move to the top.
20928 2000-03-31 Akim Demaille <akim@epita.fr>
20930 * src/main.c (main): Don't call `done', exit does it.
20932 2000-03-31 Akim Demaille <akim@epita.fr>
20934 * allocate.c: s/return (foo)/return foo/.
20935 * lalr.c: Likewise.
20937 * output.c: Likewise.
20938 * reader.c: Likewise.
20939 * symtab.c: Likewise.
20940 * vmsgetargs.c: Likewise.
20942 2000-03-31 Akim Demaille <akim@epita.fr>
20944 Clean up the error reporting functions.
20946 * src/report.c: New file.
20947 * src/report.h: Likewise.
20948 * src/Makefile.am: Adjust.
20949 * m4/error.m4: New file.
20950 * m4/Makefile.am: Adjust.
20951 * configure.in (jm_PREREQ_ERROR): Call it.
20952 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
20954 (fatal, fatals): Remove. All callers use complain.c::fatal.
20955 (warn, warni, warns, warnss, warnss): Remove. All callers use
20956 complain.c::complain.
20957 (toomany): Remove, use fatal instead.
20958 * src/files.c (done): No argument, use complain_message_count.
20959 * src/main.c (main): Register `done' to `atexit'.
20961 * src/getargs.c (usage): More `fputs', less `fprintf'.
20963 2000-03-28 Akim Demaille <akim@epita.fr>
20965 * lib/: New directory.
20966 * Makefile.am (SUBDIRS): Adjust.
20967 * configure.in: Adjust.
20968 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
20970 * src/alloca.c: Moved to lib/.
20971 * src/getopt.c: Likewise.
20972 * src/getopt1.c: Likewise.
20973 * src/getopt.h: Likewise.
20974 * src/ansi2knr.c: Likewise.
20975 * src/ansi2knr.1: Likewise.
20976 * src/Makefile.am: Adjust.
20977 * lib/Makefile.am: New file.
20979 2000-03-28 Akim Demaille <akim@epita.fr>
20981 * src/getargs.c (usage): Refresh the help message.
20983 2000-03-17 Akim Demaille <akim@epita.fr>
20985 * src/getopt1.c: Updated from textutils 2.0e
20986 * src/getopt.c: Likewise.
20987 * src/getopt.h: Likewise.
20989 2000-03-17 Akim Demaille <akim@epita.fr>
20991 * src/Makefile.am (bison.simple): Fix the awk program: quote only
20992 the file name, not the whole `#line LINE FILE'.
20994 2000-03-17 Akim Demaille <akim@epita.fr>
20996 On syntax errors, report the token on which we choked.
20998 * src/bison.s1 (yyparse): In the label yyerrlab, when
20999 YYERROR_VERBOSE, add yychar in msg.
21001 2000-03-17 Akim Demaille <akim@epita.fr>
21003 * src/reader.c (copy_at): New function.
21004 (copy_guard): Use it.
21005 (copy_action): Use it.
21007 2000-03-17 Akim Demaille <akim@epita.fr>
21009 Be kind to translators, save some useless translations.
21011 * src/main.c (banner): New function.
21012 (fatal_banner): Use it.
21013 (warn_banner): Use it.
21015 2000-03-17 Akim Demaille <akim@epita.fr>
21017 * src/reader.c (copy_definition): Use copy_string and
21018 copy_comment. Removed now unused `match', `ended',
21020 (copy_comment, copy_string): Moved, to be visible from
21023 2000-03-17 Akim Demaille <akim@epita.fr>
21025 * src/reader.c (copy_string): Declare `static inline'. No
21026 problems with inline, since it is checked by configure.
21027 (copy_comment): Likewise.
21029 2000-03-17 Akim Demaille <akim@epita.fr>
21031 * src/reader.c (packsymbols): Formatting changes.
21033 2000-03-17 Akim Demaille <akim@epita.fr>
21035 * src/reader.c (copy_comment): New function, factored out from:
21036 (copy_action): Use it. Removed now unused `match', `ended',
21038 (copy_guard): Likewise.
21040 2000-03-17 Akim Demaille <akim@epita.fr>
21042 * src/reader.c (copy_string): New function, factored out from:
21043 (copy_action): Use it.
21044 (copy_guard): Likewise.
21046 2000-03-17 Akim Demaille <akim@epita.fr>
21048 Change the handling of @s so that they behave exactly like $s.
21049 There is now a pseudo variable @$ (readble and writable), location
21050 of the lhs of the rule (by default ranging from the location of
21051 the first symbol of the rhs, to the location of the last symbol,
21052 or, if the rhs is empty, YYLLOC).
21054 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
21056 (yyparse): When providing a default semantic action, provide a
21057 default location action.
21058 (after the $): No longer change `*YYLSP', just stack YYLOC the
21059 same way you stack YYVAL.
21060 * src/reader.c (read_declarations): Use warns.
21061 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
21062 (copy_action, case '@'): Likewise.
21063 Use a standard error message, to save useless work from
21066 2000-03-17 Akim Demaille <akim@epita.fr>
21068 * src/bison.s1: Formatting and cosmetics changes.
21069 * src/reader.c: Likewise.
21070 Update the Copyright notice.
21072 2000-03-17 Akim Demaille <akim@epita.fr>
21074 * src/bison.s1 (#line): All set to `#line' only, since the
21075 Makefile now handles them.
21077 2000-03-16 Akim Demaille <akim@epita.fr>
21079 * src/output.c (output_rule_data): Output the documentation of
21080 some of the tables.
21081 (Copyright notice): Update.
21082 Formatting changes.
21084 2000-03-16 Akim Demaille <akim@epita.fr>
21086 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
21087 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
21088 One `#if YYDEBUG' remains, since it uses variables which are
21089 defined only if `YYDEBUG != 0'.
21091 2000-03-16 Akim Demaille <akim@epita.fr>
21093 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
21094 and related variables so that the similarities are highlighted.
21096 2000-03-16 Akim Demaille <akim@epita.fr>
21098 * src/bison.s1: Properly indent CPP directives.
21100 2000-03-16 Akim Demaille <akim@epita.fr>
21102 * src/bison.s1: Properly indent the `alloca' CPP section.
21104 2000-03-16 Akim Demaille <akim@epita.fr>
21106 Do not hard code values of directories in `configure.in'.
21107 Update the `configure' tool chain.
21109 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
21111 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
21112 (AC_OUTPUT): Add m4/Makefile.
21113 Bump to bison 1.28a, 1.29 has never been released.
21114 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
21115 handled via src/Makefile.am.
21116 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
21117 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
21119 * Makefile.am (SUBDIRS): Add m4.
21120 (ACLOCAL_AM_FLAGS): New variable.
21121 (AUTOMAKE_OPTIONS): Add check-news.
21122 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
21123 the proper line number and file name.
21124 (DEFS): Propagate the location of bison library files and of the
21126 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
21128 * acinclude.m4: Remove, replaced by the directory m4.
21129 * m4/Makefile.am (EXTRA_DIST): New variable.
21130 * m4/gettext.m4: New file, from the fileutils.
21131 * m4/lcmessage.m4: Likewise
21132 * m4/progtest.m4: Likewise.
21133 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
21135 2000-03-10 Akim Demaille <akim@epita.fr>
21138 Formatting changes of various comments.
21139 Respect the GNU coding standards at various places.
21140 Don't use `_()' when no translation is needed.
21142 1999-12-13 Jesse Thilo <jthilo@gnu.org>
21145 OS/2 honors TMPDIR environment variable.
21147 1999-12-13 Jesse Thilo <jthilo@gnu.org>
21149 * doc/bison.texinfo: Tweaked spelling and grammar.
21151 Removed reference to price of printed copy.
21152 Mention BISON_SIMPLE and BISON_HAIRY.
21154 1999-12-13 Jesse Thilo <jthilo@gnu.org>
21156 * configure.in, NEWS:
21157 Bison 1.29 released.
21159 1999-10-27 Jesse Thilo <jthilo@gnu.org>
21161 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
21162 Added reference card.
21164 1999-07-26 Jesse Thilo <jthilo@gnu.org>
21166 * po/ru.po: Added Russian translation.
21168 1999-07-26 Jesse Thilo <jthilo@gnu.org>
21170 * configure.in: Added Russian translation.
21172 1999-07-06 Jesse Thilo <jthilo@gnu.org>
21174 * configure.in, NEWS, README:
21175 Released version 1.28.
21177 1999-06-14 Jesse Thilo <jthilo@gnu.org>
21180 Squashed redefinition warning on some systems.
21182 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
21183 Have configure build version string instead of relying on ANSI string
21186 1999-06-14 Jesse Thilo <jthilo@gnu.org>
21188 * po/POTFILES.in: Got rid of version.c.
21190 1999-06-14 Jesse Thilo <jthilo@gnu.org>
21192 * acconfig.h, configure.in:
21193 Have configure build version string instead of relying on ANSI string
21196 1999-06-08 Jesse Thilo <jthilo@gnu.org>
21199 Dropped mention of `+' for long-named options.
21201 1999-05-30 Jesse Thilo <jthilo@gnu.org>
21203 * src/files.c: Added <unistd.h> for unlink().
21205 * src/Makefile.am, src/system.h:
21208 1999-05-30 Jesse Thilo <jthilo@gnu.org>
21210 * README: Added a FAQ list.
21212 * configure.in, acconfig.h:
21215 1999-05-30 Jesse Thilo <jthilo@gnu.org>
21217 * doc/FAQ, doc/Makefile.am:
21220 1999-05-19 Jesse Thilo <jthilo@gnu.org>
21222 * src/alloc.h, src/symtab.h, src/version.c:
21223 Protected inclusion of "config.h" with HAVE_CONFIG_H.
21225 1999-04-18 Jesse Thilo <jthilo@gnu.org>
21227 * src/.cvsignore, src/Makefile.am:
21228 Reorganized: sources in `src', documentation in `doc'.
21230 * src/lex.c (literalchar):
21231 fixed the code for escaping double quotes (thanks
21234 1999-04-18 Jesse Thilo <jthilo@gnu.org>
21236 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
21237 Adjusted paths to reflect directory reorganization.
21239 1999-04-18 Jesse Thilo <jthilo@gnu.org>
21241 * doc/.cvsignore, doc/Makefile.am:
21242 Reorganized: sources in `src', documentation in `doc'.
21244 1999-04-18 Jesse Thilo <jthilo@gnu.org>
21247 Updated AC_INIT file to reflect directory reorganization.
21249 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
21250 Reorganized: sources in `src', documentation in `doc'.
21252 1999-04-13 Jesse Thilo <jthilo@gnu.org>
21255 Don't declare calloc() and realloc() if not necessary.
21257 1999-04-13 Jesse Thilo <jthilo@gnu.org>
21259 * configure.in, acconfig.h, acinclude.m4:
21260 Don't declare calloc() and realloc() if not necessary.
21262 1999-03-23 Jesse Thilo <jthilo@gnu.org>
21264 * po/.cvsignore: Added i18n support.
21266 1999-03-23 Jesse Thilo <jthilo@gnu.org>
21268 * acconfig.h, configure.in, Makefile.am:
21269 Added i18n support.
21271 1999-03-22 Jesse Thilo <jthilo@gnu.org>
21273 * src/bison.s1: Fixed #line numbers.
21275 1999-03-15 Jesse Thilo <jthilo@gnu.org>
21277 * po/es.po, po/fr.po, po/nl.po, po/de.po:
21278 Added PO files from Translation Project.
21280 1999-03-03 Jesse Thilo <jthilo@gnu.org>
21283 Added support for non-ANSI compilers (ansi2knr).
21285 1999-02-16 Jesse Thilo <jthilo@gnu.org>
21287 * configure.in: Bumped version number to 1.27.
21290 Added `bison.simple' to list of files removed by `make distclean'.
21292 1999-02-12 Jesse Thilo <jthilo@gnu.org>
21294 * src/files.c, src/files.h:
21295 Defined locations of parser files in config.h instead of Makefile.
21297 1999-02-12 Jesse Thilo <jthilo@gnu.org>
21299 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
21300 Defined locations of parser files in config.h instead of Makefile.
21302 1999-02-09 Jesse Thilo <jthilo@gnu.org>
21305 Removed inappropriate use of $< macro.
21307 1999-02-05 Jesse Thilo <jthilo@gnu.org>
21309 * po/Makefile.in.in, po/POTFILES.in:
21310 Add `po' directory skeleton.
21312 1999-01-27 Jesse Thilo <jthilo@gnu.org>
21314 * README: Document help-bison list.
21316 * configure.in: Add check for mkstemp().
21318 1999-01-20 Jesse Thilo <jthilo@gnu.org>
21320 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
21321 Hush a few compiler warnings.
21324 Add tryclose(), which verifies that fclose was successful.
21325 Hush a couple of compiler warnings.
21327 1999-01-20 Jesse Thilo <jthilo@gnu.org>
21329 * Makefile.am, OChangeLog:
21330 ChangeLog is now automatically generated. Include the old version as
21333 1999-01-14 Jesse Thilo <jthilo@gnu.org>
21335 * 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:
21336 Update FSF address.
21338 1999-01-14 Jesse Thilo <jthilo@gnu.org>
21340 * doc/bison.texinfo: Fix formatting glitch.
21342 * doc/bison.texinfo: Update FSF address.
21344 1999-01-14 Jesse Thilo <jthilo@gnu.org>
21346 * acconfig.h: Update FSF address.
21348 1999-01-08 Jesse Thilo <jthilo@gnu.org>
21351 Don't define PACKAGE here, since config.h defines it.
21353 1998-12-30 Jesse Thilo <jthilo@gnu.org>
21355 * src/reader.c: Update copyright date.
21358 Ditch sprintf to statically-sized buffers in fatal/warn functions in
21359 favor of output directly to stderr (avoids buffer overruns).
21361 * src/reader.c: Some checks for premature EOF.
21363 * 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:
21364 Use prototypes if the compiler understands them.
21366 * src/files.c: Honor TMPDIR on Unix hosts.
21367 Use prototypes if the compiler understands them.
21370 Fix a couple of buffer overrun bugs.
21371 Use prototypes if the compiler understands them.
21373 * src/system.h: Include unistd.h and ctype.h.
21374 Use #ifdef instead of #if for NLS symbols.
21376 1998-12-30 Jesse Thilo <jthilo@gnu.org>
21378 * doc/bison.texinfo:
21379 Delete comment "consider using @set for edition number, etc..." since
21380 we now are doing so.
21382 1998-12-30 Jesse Thilo <jthilo@gnu.org>
21385 Use prototypes if the compiler understands them.
21387 * NEWS: Document 1.26 highlights.
21389 * Makefile.am: Require Automake 1.3 or later.
21392 Use prototypes if the compiler understands them.
21394 1998-12-29 Jesse Thilo <jthilo@gnu.org>
21397 Use VERSION symbol from automake for version number.
21399 1998-12-29 Jesse Thilo <jthilo@gnu.org>
21401 * acconfig.h, configure.in, version.cin:
21402 Use VERSION symbol from automake for version number.
21404 1998-11-28 Jesse Thilo <jthilo@gnu.org>
21407 Distribute original version of simple parser (bison.s1), not built
21408 version (bison.simple).
21410 1998-11-28 Jesse Thilo <jthilo@gnu.org>
21412 * doc/bison.texinfo: Add info dir entry.
21414 * doc/bison.texinfo:
21415 Let automake put version number into documentation.
21417 1998-11-26 Jesse Thilo <jthilo@gnu.org>
21419 * src/bison.cld, src/build.com, src/vmshlp.mar:
21420 Add non-RCS files from /gd/gnu/bison.
21422 1998-11-26 Jesse Thilo <jthilo@gnu.org>
21425 Document the BISON_HAIRY and BISON_SIMPLE variables.
21427 1998-11-25 Jesse Thilo <jthilo@gnu.org>
21429 * src/version.c: Build version.c automatically.
21432 Fix token numbering (used to start at 258, not 257).
21434 * src/system.h: Include config.h.
21436 * src/getargs.c: Update bug report address.
21438 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
21439 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
21441 1998-11-25 Jesse Thilo <jthilo@gnu.org>
21444 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
21446 * configure.in, version.cin:
21447 Build version.c automatically.
21449 * AUTHORS: Add AUTHORS file.
21451 * README: Update bug report address.
21454 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
21456 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
21457 Add automake stuff.
21459 1998-11-25 Jesse Thilo <jthilo@gnu.org>
21461 * doc/bison.texinfo: Clean up some formatting.
21463 1998-05-05 Richard Stallman <rms@gnu.org>
21465 * doc/bison.texinfo:
21466 Explain better why to make a pure parser.
21468 1998-01-05 Richard Stallman <rms@gnu.org>
21470 * src/files.c (openfiles):
21471 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
21472 find a temporary directory, if possible. Do not unlink files while
21475 1997-08-25 Richard Stallman <rms@gnu.org>
21477 * src/reader.c (stack_offset;):
21478 Change some warni to warns.
21480 * src/lex.c (literalchar): Use warns, not warni.
21482 1997-06-28 Richard Stallman <rms@gnu.org>
21484 * src/bison.s1: Add a Bison version comment.
21486 * src/main.c (fatal, warn, berror):
21489 1997-06-28 Richard Stallman <rms@gnu.org>
21491 * Makefile.in (bison_version): New variable.
21492 (dist): Use that variable.
21493 (bison.s1): Substitute the Bison version into bison.simple.
21495 * bison.simple: Add a Bison version comment.
21497 1997-06-18 Richard Stallman <rms@gnu.org>
21499 * src/main.c (fatal, warn, berror):
21500 Make error messages standard.
21501 (toomany): Improve error message text.
21503 * 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:
21504 new.h renamed to alloc.h.
21506 1997-06-18 Richard Stallman <rms@gnu.org>
21508 * Makefile.in: new.h renamed to alloc.h.
21510 1997-05-24 Richard Stallman <rms@gnu.org>
21512 * src/lex.c (literalchar):
21513 Fix the code for escaping \, " and '.
21515 (lex): Avoid trouble when there are many chars
21516 to discard in a char literal with just several chars in it.
21518 1997-05-17 Richard Stallman <rms@gnu.org>
21521 Use malloc, if using alloca is troublesome.
21522 (YYSTACK_USE_ALLOCA): New flag macro.
21523 Define it for some systems and compilers.
21524 (YYSTACK_ALLOC): New macro.
21525 (yyparse): Use YYSTACK_ALLOC to allocate stack.
21526 If it was malloc'd, free it.
21528 1997-05-17 Richard Stallman <rms@gnu.org>
21531 Use malloc, if using alloca is troublesome.
21532 (YYSTACK_USE_ALLOCA): New flag macro.
21533 Define it for some systems and compilers.
21534 (YYSTACK_ALLOC): New macro.
21535 (yyparse): Use YYSTACK_ALLOC to allocate stack.
21536 If it was malloc'd, free it.
21538 1997-04-23 Richard Stallman <rms@gnu.org>
21541 (alloca) [__hpux]: Always define as __builtin_alloca.
21543 1997-04-23 Richard Stallman <rms@gnu.org>
21546 (alloca) [__hpux]: Always define as __builtin_alloca.
21548 1997-04-22 Richard Stallman <rms@gnu.org>
21551 [__hpux]: Include alloca.h (right for HPUX 10)
21552 instead of declaring alloca (right for HPUX 9).
21554 * src/bison.s1 (__yy_memcpy):
21555 Declare arg `count' as unsigned int.
21556 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
21558 1997-04-22 Richard Stallman <rms@gnu.org>
21561 [__hpux]: Include alloca.h (right for HPUX 10)
21562 instead of declaring alloca (right for HPUX 9).
21564 * bison.simple (__yy_memcpy):
21565 Declare arg `count' as unsigned int.
21566 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
21568 1997-01-03 Richard Stallman <rms@gnu.org>
21570 * src/allocate.c: [__STDC__ or _MSC_VER]:
21571 Declare calloc and realloc to return void *.
21573 1997-01-02 Richard Stallman <rms@gnu.org>
21576 [_MSC_VER]: Include stdlib.h and process.h.
21577 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
21579 * src/main.c (main): Return FAILURE as a value.
21580 (printable_version): Declare arg as int, not char.
21582 1997-01-02 Richard Stallman <rms@gnu.org>
21584 * Makefile.in (dist):
21585 Explicitly check for symlinks, and copy them.
21587 1996-12-19 Richard Stallman <rms@gnu.org>
21590 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
21592 1996-12-18 Paul Eggert <eggert@gnu.org>
21594 * src/bison.s1 (yyparse):
21595 If __GNUC__ and YYPARSE_PARAM are both defined,
21596 declare yyparse to have a void * argument.
21598 1996-12-18 Paul Eggert <eggert@gnu.org>
21600 * bison.simple (yyparse):
21601 If __GNUC__ and YYPARSE_PARAM are both defined,
21602 declare yyparse to have a void * argument.
21604 1996-12-17 Richard Stallman <rms@gnu.org>
21606 * src/reduce.c (nbits): Add some casts.
21608 1996-08-12 Richard Stallman <rms@gnu.org>
21610 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
21612 1996-08-12 Richard Stallman <rms@gnu.org>
21614 * bison.simple: Test _MSDOS as well as _MSDOS_.
21616 1996-07-31 Richard Stallman <rms@gnu.org>
21619 [__sun && __i386]: Include alloca.h.
21621 1996-07-31 Richard Stallman <rms@gnu.org>
21624 [__sun && __i386]: Include alloca.h.
21626 1996-07-30 Richard Stallman <rms@gnu.org>
21628 * src/bison.s1: Comment change.
21630 * src/bison.s1: Test _MSDOS_, not MSDOS.
21632 1996-07-30 Richard Stallman <rms@gnu.org>
21634 * bison.simple: Comment change.
21636 * bison.simple: Test _MSDOS_, not MSDOS.
21638 1996-06-01 Richard Stallman <rms@gnu.org>
21640 * 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:
21641 Insert `_' macro around many string constants.
21644 Insert `_' macro around many string constants.
21646 (main): Call setlocale, bindtextdomain and textdomain.
21648 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
21649 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
21650 [ENABLE_NLS]: Include libintl.h.
21651 [ENABLE_NLS] (gettext): Define.
21652 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
21653 (N_, PACKAGE, LOCALEDIR): New macros.
21655 1996-06-01 Richard Stallman <rms@gnu.org>
21657 * POTFILES.in: New file.
21659 * Makefile.in (allocate.o):
21660 Define target explicitly.
21662 * Makefile.in (CFLAGS): Set to @CFLAGS@.
21663 (LDFLAGS): Set to @LDFLAGS@.
21664 (configure): Run autoconf only if preceding `cd' succeeds.
21665 (bison.s1): Redirect output to temporary file then move the
21666 temporary to the target, rather than redirecting directly to bison.s1.
21667 (clean): Remove config.status and config.log.
21668 (distclean): Don't remove config.status here.
21670 1996-05-12 Richard Stallman <rms@gnu.org>
21673 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
21675 1996-05-12 Richard Stallman <rms@gnu.org>
21678 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
21680 1996-05-11 Richard Stallman <rms@gnu.org>
21682 * src/bison.s1 (__yy_memcpy):
21683 Really reorder the args, as was supposedly done on Feb 14 1995.
21684 (yyparse): Calls changed accordingly.
21686 1996-05-11 Richard Stallman <rms@gnu.org>
21688 * Makefile.in (dist): Don't use $(srcdir).
21690 * bison.simple (__yy_memcpy):
21691 Really reorder the args, as was supposedly done on Feb 14 1995.
21692 (yyparse): Calls changed accordingly.
21694 1996-01-27 Richard Stallman <rms@gnu.org>
21696 * src/output.c (output_rule_data):
21697 Test YYERROR_VERBOSE in the conditional
21698 around the definition of ttyname.
21700 1995-12-29 Richard Stallman <rms@gnu.org>
21703 Fix line numbers in #line commands.
21705 1995-12-29 Richard Stallman <rms@gnu.org>
21708 Fix line numbers in #line commands.
21710 1995-12-27 Richard Stallman <rms@gnu.org>
21712 * src/bison.s1 (YYPARSE_PARAM_DECL):
21713 In C++, make it always null.
21714 (YYPARSE_PARAM_ARG): New macro.
21715 (yyparse): Use YYPARSE_PARAM_ARG.
21717 1995-12-27 Richard Stallman <rms@gnu.org>
21719 * bison.simple (YYPARSE_PARAM_DECL):
21720 In C++, make it always null.
21721 (YYPARSE_PARAM_ARG): New macro.
21722 (yyparse): Use YYPARSE_PARAM_ARG.
21724 1995-11-29 Richard Stallman <rms@gnu.org>
21726 * doc/bison.texinfo:
21727 Describe literal string tokens, %raw, %no_lines, %token_table.
21729 1995-11-29 Daniel Hagerty <hag@gnu.org>
21731 * doc/bison.texinfo: Fixed update date
21733 1995-10-16 Richard Stallman <rms@gnu.org>
21735 * src/version.c: Version 1.25.
21737 1995-10-16 Richard Stallman <rms@gnu.org>
21739 * NEWS: *** empty log message ***
21741 1995-10-16 Richard Stallman <rms@gnu.org>
21743 * doc/bison.1, doc/bison.rnh:
21746 1995-10-15 Richard Stallman <rms@gnu.org>
21748 * src/vmsgetargs.c, src/getargs.c:
21749 Added -n, -k, and -raw switches.
21750 (noparserflag, toknumflag, rawtoknumflag): New variables.
21752 * src/symtab.h (SALIAS):
21753 New #define for adding aliases to %token.
21754 (struct bucket): Added `alias' field.
21756 * src/reduce.c (reduce_grammar):
21757 Revise error message.
21758 (print_notices): Remove final `.' from error message.
21760 * src/reader.c (reader_output_yylsp):
21762 (readgram): Use `#if 0' around code that accepted %command
21763 inside grammar rules: The documentation doesn't allow it,
21764 and it will fail since the %command processors scan for the next %.
21765 (parse_token_decl): Extended the %token
21766 declaration to allow a multi-character symbol as an alias.
21767 (parse_thong_decl): New function.
21768 (read_declarations): Added %thong declarations.
21769 (read_declarations): Handle NOOP to deal with allowing
21770 % declarations as another means to specify the flags.
21771 (readgram): Allow %prec prior to semantics embedded in a rule.
21772 (skip_to_char, read_declarations, copy_definition)
21773 (parse_token_decl, parse_start_decl, parse_type_decl)
21774 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
21775 (get_type_name, copy_guard, copy_action, readgram)
21776 (get_type, packsymbols): Revised most error messages.
21777 Changed `fatal' to `warnxxx' to avoid aborting for error.
21778 Revised and use multiple warnxxx functions to avoid using VARARGS1.
21779 (read_declarations): Improve the error message for
21780 an invalid character. Do not abort.
21781 (read_declarations, copy_guard, copy_action): Use
21782 printable_version to avoid unprintable characters in printed output.
21783 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
21784 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
21785 Allow the type of a non-terminal can be given
21786 more than once, as long as all specifications give the same type.
21789 (output_headers, output_trailers, output, output_gram)
21790 (output_rule_data): Implement noparserflag variable.
21791 Implement toknumflag variable.
21792 (output): Call reader_output_yylsp to output LTYPESTR.
21794 * src/main.c (main):
21795 If reader sees an error, don't process the grammar.
21796 (fatals): Updated to not use VARARGS1.
21797 (printable_version, int_to_string, warn, warni, warns, warnss)
21798 (warnsss): New error reporting functions. Avoid abort for error.
21801 Added THONG and NOOP for alias processing.
21802 Added SETOPT for the new code that allows setting options with %flags.
21805 Include getopt.h. Add some extern decls.
21806 (safegetc): New function to deal with EOF gracefully.
21807 (literalchar); new function to deal with reading \ escapes.
21808 (lex): Use literalchar.
21809 (lex): Implemented "..." tokens.
21810 (literalchar, lex, parse_percent_token): Made tokenbuffer
21811 always contain the token. This includes growing the token
21812 buffer while reading an integer.
21813 (parse_percent_token): Replaced if-else statement with percent_table.
21814 (parse_percent_token): Added % declarations as another
21815 way to specify the flags -n, -l, and -r. Also added hooks for
21816 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
21817 major changes to files.c.
21818 (lex) Retain in the incoming stream a character following
21820 (skip_white_space, lex): Revised most error messages
21821 and changed fatal to warn to avoid aborting.
21822 (percent_table): Added %thong declarations.
21824 * src/gram.h: Comment changes.
21826 * src/files.c (openfiles, open_extra_files, done):
21828 and actfile file. Handle noparserflag. Both for -n switch.
21830 * src/conflicts.c (resolve_sr_conflict):
21831 Remove use of alloca.
21833 1995-06-01 Jim Meyering <meyering@gnu.org>
21835 * doc/bison.texinfo: *** empty log message ***
21837 1995-05-06 Richard Stallman <rms@gnu.org>
21839 * src/bison.s1: Comment change.
21841 1995-05-06 Richard Stallman <rms@gnu.org>
21843 * bison.simple: Comment change.
21845 1995-05-03 Richard Stallman <rms@gnu.org>
21847 * src/version.c: Version now 1.24.
21849 * src/bison.s1: Change distribution terms.
21851 * src/version.c: Version now 1.23.
21853 1995-05-03 Richard Stallman <rms@gnu.org>
21855 * doc/bison.texinfo:
21856 Rewrite "Conditions for Using Bison".
21857 Update version to 1.24.
21859 1995-05-03 Richard Stallman <rms@gnu.org>
21861 * bison.simple: Change distribution terms.
21863 1995-02-23 Richard Stallman <rms@gnu.org>
21865 * src/files.c: Test __VMS_POSIX as well as VMS.
21867 1995-02-14 Jim Meyering <meyering@gnu.org>
21869 * src/bison.s1 (__yy_memcpy):
21870 Renamed from __yy_bcopy to avoid
21871 confusion. Reverse FROM and TO arguments to be consistent with
21874 1995-02-14 Jim Meyering <meyering@gnu.org>
21876 * bison.simple (__yy_memcpy):
21877 Renamed from __yy_bcopy to avoid
21878 confusion. Reverse FROM and TO arguments to be consistent with
21881 1994-11-10 David J. MacKenzie <djm@gnu.org>
21887 * Makefile.in (DISTFILES): Include NEWS.
21889 * Makefile.in (DISTFILES):
21890 Include install-sh, not install.sh.
21892 * configure.in: Update to Autoconf v2 macro names.
21894 1994-10-05 David J. MacKenzie <djm@gnu.org>
21896 * Makefile.in: fix typo
21898 * Makefile.in (prefix, exec_prefix):
21899 Let configure set them.
21901 1994-09-28 David J. MacKenzie <djm@gnu.org>
21903 * Makefile.in: Set datadir to $(prefix)/share.
21905 1994-09-15 Richard Stallman <rms@gnu.org>
21908 Update copyright notice and GPL version.
21910 1994-09-15 Richard Stallman <rms@gnu.org>
21913 Update copyright notice and GPL version.
21915 1994-07-12 Richard Stallman <rms@gnu.org>
21917 * src/reduce.c, src/reader.c:
21920 1994-05-05 David J. MacKenzie <djm@gnu.org>
21922 * Makefile.in: entered into RCS
21924 1994-03-26 Richard Stallman <rms@gnu.org>
21926 * src/bison.s1: entered into RCS
21928 1994-03-26 Richard Stallman <rms@gnu.org>
21930 * bison.simple: entered into RCS
21932 1994-03-25 Richard Stallman <rms@gnu.org>
21934 * src/main.c: entered into RCS
21936 1994-03-24 Richard Stallman <rms@gnu.org>
21938 * src/conflicts.c: entered into RCS
21940 1994-01-02 Richard Stallman <rms@gnu.org>
21942 * Makefile.in: *** empty log message ***
21944 1993-11-21 Richard Stallman <rms@gnu.org>
21946 * src/bison.s1: *** empty log message ***
21948 1993-11-21 Richard Stallman <rms@gnu.org>
21950 * doc/bison.texinfo: entered into RCS
21952 * doc/bison.texinfo: *** empty log message ***
21954 1993-11-21 Richard Stallman <rms@gnu.org>
21956 * bison.simple: *** empty log message ***
21958 1993-10-25 David J. MacKenzie <djm@gnu.org>
21960 * doc/bison.texinfo: *** empty log message ***
21962 1993-10-19 Richard Stallman <rms@gnu.org>
21964 * src/bison.s1: *** empty log message ***
21966 1993-10-19 Richard Stallman <rms@gnu.org>
21968 * bison.simple: *** empty log message ***
21970 1993-10-14 Richard Stallman <rms@gnu.org>
21972 * src/bison.s1: *** empty log message ***
21974 1993-10-14 Richard Stallman <rms@gnu.org>
21976 * bison.simple: *** empty log message ***
21978 1993-09-14 David J. MacKenzie <djm@gnu.org>
21980 * doc/bison.texinfo: *** empty log message ***
21982 1993-09-13 Noah Friedman <friedman@gnu.org>
21984 * Makefile.in: *** empty log message ***
21986 1993-09-10 Richard Stallman <rms@gnu.org>
21988 * src/conflicts.c: *** empty log message ***
21990 * src/system.h: entered into RCS
21992 1993-09-10 Richard Stallman <rms@gnu.org>
21994 * doc/bison.1: entered into RCS
21996 1993-09-06 Noah Friedman <friedman@gnu.org>
21998 * src/version.c: entered into RCS
22000 1993-09-06 Noah Friedman <friedman@gnu.org>
22002 * Makefile.in: *** empty log message ***
22004 1993-07-30 David J. MacKenzie <djm@gnu.org>
22006 * Makefile.in: *** empty log message ***
22008 1993-07-24 Richard Stallman <rms@gnu.org>
22010 * src/bison.s1: *** empty log message ***
22012 1993-07-24 Richard Stallman <rms@gnu.org>
22014 * bison.simple: *** empty log message ***
22016 1993-07-08 David J. MacKenzie <djm@gnu.org>
22018 * Makefile.in: *** empty log message ***
22020 1993-07-04 Richard Stallman <rms@gnu.org>
22022 * src/bison.s1: *** empty log message ***
22024 1993-07-04 Richard Stallman <rms@gnu.org>
22026 * bison.simple: *** empty log message ***
22028 1993-06-26 David J. MacKenzie <djm@gnu.org>
22030 * src/getargs.c: entered into RCS
22032 1993-06-26 David J. MacKenzie <djm@gnu.org>
22034 * doc/bison.texinfo: *** empty log message ***
22036 * doc/bison.1: New file.
22038 1993-06-25 Richard Stallman <rms@gnu.org>
22040 * src/getargs.c: New file.
22042 1993-06-16 Richard Stallman <rms@gnu.org>
22044 * src/bison.s1: *** empty log message ***
22046 1993-06-16 Richard Stallman <rms@gnu.org>
22048 * bison.simple: *** empty log message ***
22050 1993-06-03 Richard Stallman <rms@gnu.org>
22052 * src/bison.s1: New file.
22054 1993-06-03 Richard Stallman <rms@gnu.org>
22056 * doc/bison.texinfo: *** empty log message ***
22058 1993-06-03 Richard Stallman <rms@gnu.org>
22060 * bison.simple: New file.
22062 1993-05-19 Richard Stallman <rms@gnu.org>
22064 * doc/bison.texinfo: New file.
22066 1993-05-07 Noah Friedman <friedman@gnu.org>
22068 * Makefile.in: *** empty log message ***
22070 1993-04-28 Noah Friedman <friedman@gnu.org>
22072 * src/reader.c: *** empty log message ***
22074 1993-04-23 Noah Friedman <friedman@gnu.org>
22076 * src/alloc.h: entered into RCS
22078 1993-04-20 David J. MacKenzie <djm@gnu.org>
22080 * src/version.c: *** empty log message ***
22082 * src/files.c, src/allocate.c:
22085 * src/reader.c: *** empty log message ***
22087 * src/lex.c: entered into RCS
22089 * src/conflicts.c: New file.
22091 * src/symtab.c: entered into RCS
22093 * src/alloc.h: New file.
22095 * src/LR0.c: entered into RCS
22097 1993-04-18 Noah Friedman <friedman@gnu.org>
22099 * src/reader.c: New file.
22101 * src/version.c: *** empty log message ***
22103 1993-04-18 Noah Friedman <friedman@gnu.org>
22105 * Makefile.in: *** empty log message ***
22107 1993-04-17 Noah Friedman <friedman@gnu.org>
22109 * Makefile.in: *** empty log message ***
22111 1993-04-15 Richard Stallman <rms@gnu.org>
22113 * src/main.c, src/files.c:
22116 1993-04-15 Noah Friedman <friedman@gnu.org>
22118 * configure.in: entered into RCS
22120 * configure.in: *** empty log message ***
22122 * configure.in: New file.
22124 1993-04-14 Richard Stallman <rms@gnu.org>
22126 * Makefile.in: New file.
22128 1993-04-13 Richard Stallman <rms@gnu.org>
22130 * src/version.c: New file.
22132 1993-03-25 Richard Stallman <rms@gnu.org>
22134 * src/output.c: entered into RCS
22136 1992-09-25 Richard Stallman <rms@gnu.org>
22138 * configure.bat: entered into RCS
22140 1992-06-22 Richard Stallman <rms@gnu.org>
22142 * src/vmsgetargs.c: entered into RCS
22144 1992-06-22 Richard Stallman <rms@gnu.org>
22146 * doc/bison.rnh: entered into RCS
22148 1992-04-20 David J. MacKenzie <djm@gnu.org>
22150 * README: entered into RCS
22152 1992-01-22 Richard Stallman <rms@gnu.org>
22154 * src/machine.h: entered into RCS
22156 1991-12-21 Richard Stallman <rms@gnu.org>
22158 * src/lalr.c, src/closure.c:
22161 1991-12-20 Richard Stallman <rms@gnu.org>
22163 * src/state.h: entered into RCS
22165 1991-12-18 Richard Stallman <rms@gnu.org>
22167 * src/print.c, src/nullable.c, src/derives.c:
22170 1991-11-03 David J. MacKenzie <djm@gnu.org>
22172 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
22175 1988-09-09 Richard Stallman <rms@gnu.org>
22177 * src/bison.hairy: entered into RCS
22179 1987-12-16 Richard Stallman <rms@gnu.org>
22181 * REFERENCES: entered into RCS
22186 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
22187 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
22188 Free Software Foundation, Inc.
22190 Copying and distribution of this file, with or without
22191 modification, are permitted provided the copyright notice and this
22192 notice are preserved.