Commit Graph

2333 Commits

Author SHA1 Message Date
Paul Eggert 5fa908329c Log today's changes. 2003-12-24 08:33:39 +00:00
Akim Demaille b165c324a3 * doc/bison.texinfo (How Can I Reset the Parser): More about start
conditions.
From Bruno Haible.
2003-12-02 17:08:31 +00:00
Alexandre Duret-Lutz 26e06a2157 * doc/bison.texinfo (Bison Options): Escape @' in $@'. 2003-11-18 19:14:05 +00:00
Paul Eggert 6a5ecb38fc Don't run 'testsuite --clean' if testsuite doesn't exist. 2003-10-07 23:34:20 +00:00
Paul Eggert 92ac370570 Do not allow NUL bytes in string literals or character constants. 2003-10-07 07:32:57 +00:00
Paul Eggert 91d2c560a8 Don't document %no-default-prec for now. 2003-10-05 07:34:36 +00:00
Paul Eggert 0cc3da3a4e In GLR grammars, $N and @N now yield non-modifiable lvalues. 2003-10-05 06:46:53 +00:00
Paul Eggert 22fccf958f Use "%no-default-prec" instead of "%default-prec 0". 2003-10-01 21:33:24 +00:00
Akim Demaille fc8f296538 VCG no longer supports long_straight_phase.
* src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
* src/print_graph.c (print_graph): Adjust.
2003-10-01 07:46:41 +00:00
Paul Eggert 39a06c251a Add %default-prec. 2003-09-30 20:11:29 +00:00
Akim Demaille 62b6aef925 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
GCC warnings.
2003-08-27 07:00:10 +00:00
Akim Demaille 89e1cc61b7 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
"<#" to avoid magic from Gnus when posting parts of this script.
2003-08-26 07:13:52 +00:00
Akim Demaille a08460b08c * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
(Parser::parse): here.
Adjust: nerrs and errstatus is now replaced by...
(Parser::nerrs_, Parser::errstatus_): New.
2003-08-26 05:21:41 +00:00
Akim Demaille 603f1cfdc5 * config/announce-gen, Makefile.cfg: New.
* Makefile.am: Adjust.
* GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
keeping local WGET and WGETFLAGS modifications from Paul Eggert.
2003-08-25 18:47:36 +00:00
Akim Demaille cd3684cfa8 When reducing initial empty rules, Bison parser read an initial
location that is not defined.  This results in garbage, and that
affects Bison's own parser.  Therefore we need (i) to extend Bison
to support a means to initialize this location, and (ii) to use
this CVS Bison to fix CVS Bison's parser.
* src/reader.h, reader.c (epilogue_augment): Remove, replace
with...
* src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
* src/parse-gram.y: Adjust.
(%initial-action): New.
(%error-verbose): Since we require CVS Bison, there is no reason
not to use it.
* src/scan-gram.l: Adjust.
* src/Makefile.am (YACC): New, to make sure we use our own parser.
* data/yacc.c (yyparse): Use b4_initial_action.
2003-08-25 15:16:25 +00:00
Akim Demaille 4e03e2015c * doc/bison.texinfo: Don't promote stdout for error messages. 2003-08-25 10:35:38 +00:00
Akim Demaille 8c182d0592 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
From Alexandre Duret-Lutz.
2003-08-25 09:54:57 +00:00
Akim Demaille 25f66e1a6a * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
Use them.
2003-08-25 08:39:34 +00:00
Akim Demaille 5348bfbe29 * data/lalr1.cc (Parser::reduce_print_): New.
Use it.
2003-08-25 08:29:27 +00:00
Akim Demaille 473013144d Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
error recovery loops.  This patch is based on
<http://mail.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
Also, augment the similarity between lalr1.cc and yacc.c.
Note: the locations of error recovery rules are not correct yet.
* data/lalr1.cc: Comment changes to augment the similarity between
lalr1.cc and yacc.c.
(YYERROR): Goto to yyerrorlab, not yyerrlab1.
(yyerrlab1): Remove, but where it used to be (now the bottom part of
yyerrlab), when hitting EOF, pop the whole stack here instead of
merely falling thru the default error handling mechanism.
(yyerrorlab): New label, with the old contents of YYERROR,
plus the following change: pop the stack of rhs corresponding
to the production that invoked YYERROR.  That is how Yacc
behaves (required by POSIX).
* tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
fail.
2003-08-25 08:06:17 +00:00
Akim Demaille 1f7a61ff99 Tune local.at so that people can "autom4te -l autotest calc.at -o
calc" for instance, to extract a sub test suite.
* tests/testsuite.at: Move the initialization, Autotest version
requirement, and AT_TESTED invocation into...
* tests/local.at: here.
* tests/testsuite.at: Include it for compatibility with Autoconf
2.57.
* tests/Makefile.am ($(TESTSUITE)): Report that the warning should
be ignore.
2003-08-25 07:15:49 +00:00
Paul Eggert 327b5b5675 Rework glr.c slightly to avoid gcc -Wtraditional warnings. 2003-08-04 19:09:58 +00:00
Paul Eggert 0051e3edb0 * data/glr.c (YYASSERT): New macro. 2003-07-26 14:14:15 +00:00
Paul Eggert 5b620e069d * data/glr.c (yyglrReduce): Don't use C89 string concatenation. 2003-07-25 07:42:57 +00:00
Paul Eggert 137437c6db Let the user specify how to allocate and free memory. 2003-07-25 07:12:11 +00:00
Paul Eggert ddb85ca59e use s.empty() rather than s == "" to test for empty string 2003-07-07 03:45:07 +00:00
Paul Eggert 4dcf140b13 Log 06-17 minor change to lib/libiberty.h that I forgot to log earlier; sorry! 2003-06-30 17:41:35 +00:00
Akim Demaille 39910e0949 * config/depcomp, config/install-sh: Update from masters. 2003-06-25 13:45:57 +00:00
Paul Eggert 0ae99356d5 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
and return properly parenthesized result.
* data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
* data/yacc.c (YYLLOC_DEFAULT): Likewise.
Remove unnecessary parentheses from uses.
* doc/bison.texinfo (Location Default Action): Describe the
conventions for parentheses.
2003-06-20 22:52:12 +00:00
Paul Eggert 81fd08cad0 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
yyreportTree): Do not assume that size_t is the same width as int,
when printing sizes.  Print sizes using an unsigned format.
2003-06-19 08:45:55 +00:00
Paul Eggert cd05d13c9e Port to Forte Developer 7 C compiler. 2003-06-19 07:40:16 +00:00
Paul Eggert f8e8262e70 Minor textual fixes. 2003-06-17 08:33:36 +00:00
Paul Eggert 8dd76bee16 1.875b changes 2003-06-17 07:54:28 +00:00
Paul Hilfinger 25005f6ab0 * data/glr.c (YYERROR): Update definition.
(yyrecoverSyntaxError): Correct yyerrState logic. Correct comment.
Allow states with only a default reduction.

Fixes to avoid problem that $-N rules in GLR parsers can cause
buffer overruns, corrupting state.

* src/output.c (prepare_rules): Output max_left_semantic_context.
* src/reader.h (max_left_semantic_context): New
* src/scan-gram.l (max_left_semantic_context): Define.
(handle_action_dollar): Update max_left_semantic_context.
* data/glr.c (YYMAXLEFT): New.
(yydoAction): Increase yyrhsVals size.
(yyresolveAction): Ditto.

Fixes to problems with location handling in GLR parsers reported by
Frank Heckenbach (2003/06/05).

* data/glr.c (YYLTYPE): Make trivial if locations not used.
(YYRHSLOC): Add parentheses, make depend on whether locations used.
(YYLLOC_DEFAULT): Ditto.
(yyuserAction): Use YYLLOC_DEFAULT.
(yydoAction): Remove redundant code.

* tests/cxx-type.at: Exercise location information.
(yylex): Track locations.
(stmtMerge): Return value rather than printing.
2003-06-10 02:44:58 +00:00
Paul Eggert 711f40b715 Avoid warnings generated by GCC 2.95.4 when Bison is
configured with --enable-gcc-warnings.
2003-06-04 05:58:52 +00:00
Paul Eggert ac695f7df5 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
yy::Location::lines, yy::Location::columns): Rename arguments
to avoid shadowing; this removes a warning generated by GCC 3.3.
2003-06-02 08:19:29 +00:00
Paul Eggert 26ec81e097 Don't pass C-only options to g++.
Fix YYFILL in GLR parsers to conform to the C standard.
Fix infinite loops in yacc.c, and add a test case.
2003-06-02 07:29:18 +00:00
Paul Eggert c6ae27df0b * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
This fixes a problem reported by John Bowman when the Compaq/HP
Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
-ansi -Wall -gall).
* data/yacc.c (union yyalloc): Likewise.
(YYCOPY): Do not evaluate __GNUC__ unless it is defined.
2003-05-25 06:44:31 +00:00
Paul Eggert d08290769c Switch from 'int' to 'bool' where that makes sense. 2003-05-24 19:16:02 +00:00
Paul Eggert 6b2584b7a2 Require a semicolon after a grammar declaration, in the interest of
possible future changes to the Bison input language.
Do not allow a stray semicolon at the start of the grammar.
Allow one or more semicolons after any rule, including
just before "|" as required by POSIX.
2003-05-14 19:30:22 +00:00
Alexandre Duret-Lutz caf37a3666 %parse-param support for lalr1.cc.
* data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
b4_cc_constructor_calls, b4_cc_constructor_call,
b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
definitions.
(yy::b4_parser_class_name::b4_parser_class_name): Take extra
parse-param arguments.
(yy::b4_parser_class_name): Declare instance variables to
hold parse-param arguments.
* tests/calc.at: s/value/semantic_value/ because value clashes
with a member of yy::b4_parser_class_name.  Adjust C++ code
to handle %parse-param.  Enable %parse-param test in C++.
2003-05-14 18:41:48 +00:00
Paul Eggert 3ab370773d * doc/bison.texinfo (How Can I Reset @code{yyparse}):
Minor English and technical fixups.
2003-05-12 19:35:13 +00:00
Paul Eggert 163ab32161 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes C89. 2003-05-05 20:39:42 +00:00
Paul Eggert e743727fcd * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
Do not overrun array bounds.
2003-05-04 06:30:14 +00:00
Akim Demaille 916708d59e * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
* src/getargs.c, src/getargs.h: here, as bool, not int.
(nondeterministic_parser): New.
* src/parse-gram.y, src/scan-gram.l: Support
%nondeterministic-parser.
* src/output.c (prepare): Use nondeterministic_parser instead
of glr_parser where appropriate.
* src/tables.c (conflict_row, action_row, save_row)
(token_actions, token_actions, pack_vector): Ditto.
2003-04-29 12:57:36 +00:00
Akim Demaille a06ea4aa98 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New. 2003-04-29 09:57:34 +00:00
Akim Demaille 211074caca * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
with %pure-parser and %locations to exercise the patch from Yakov
Markovitch below.
2003-04-29 08:41:13 +00:00
Paul Eggert 6175ffe321 * data/yacc.c: (b4_lex_param): Corrected for the case where
%lex-param is provided and %pure-parser isn't.
2003-04-29 06:04:56 +00:00
Paul Eggert b1e9585744 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
<http://mail.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
2003-04-28 06:04:39 +00:00
Paul Eggert 3470c57bea * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
Declare to be of type suitable for the ninf value itself.
2003-04-27 05:57:13 +00:00