Commit Graph

1066 Commits

Author SHA1 Message Date
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
Paul Eggert
acda9df6f9 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR invokes it. 2003-04-27 05:28:21 +00:00
Paul Eggert
b5250f2635 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch to gnulib. 2003-04-22 03:33:29 +00:00
Paul Eggert
089ac0f11c * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
Fix obvious typo that results in uncompilable GLR parsers
when both %pure-parser and %locations are used.  (trivial change)
2003-04-21 19:37:40 +00:00
Paul Eggert
1b8f2fff2a Don't invoke unput from scan-gram.l; it ran into a POSIX-compatibility
bug in flex 2.5.31.
2003-04-18 07:27:15 +00:00
Paul Eggert
5ededac618 Fix regression reported by Werner Lemberg in
<http://mail.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
2003-04-18 05:11:25 +00:00
Akim Demaille
b8be913233 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file. 2003-03-31 09:46:21 +00:00
Akim Demaille
d423d46080 * src/output.c (prepare_symbols): Avoid trailing spaces in the
output.
2003-03-31 09:17:40 +00:00
Akim Demaille
c7e441b49c * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
From Paul Hilfinger.
2003-03-31 07:10:44 +00:00
Akim Demaille
231897ad21 * m4/error.m4: Do not put under dynamic conditions some code which
expansion is under static control.
2003-03-29 13:50:44 +00:00
Akim Demaille
22a74fece3 Restore a missing ChangeLog entry. 2003-03-29 13:30:15 +00:00
Akim Demaille
5b06606339 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New. 2003-03-29 13:29:41 +00:00
Paul Eggert
0eee27e7b7 Update .cvsignore files. 2003-03-14 01:35:43 +00:00
Paul Eggert
537636c7e5 Fix "Bison blows chunks on empty file" bug.
Work around SunOS 4.1.4 porting problem with <sys/resource.h>.
Don't check for sys/wait.h twice, with two different algorithms.
2003-03-13 07:13:05 +00:00
Paul Eggert
f61aad9399 Merge changes from gnulib. This was prompted because the CVS
snapshot of Bison didn't build on Solaris 7 due to strnlen problems.
2003-03-12 23:08:11 +00:00
Akim Demaille
d2ffe11637 * ro.po: New. 2003-03-03 08:59:34 +00:00
Akim Demaille
052826fdd1 * doc/bison.texinfo (Table of Symbols): Reactivate the
documentation for %lex-param, and %parse-param.
2003-03-02 15:11:43 +00:00
Akim Demaille
c47495657b * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
generate verbose error messages.
Use the number of tokens as an upper bound in yytname, as it
cannot be a non terminal.
2003-03-02 13:39:44 +00:00