Akim Demaille [Tue, 26 Aug 2003 05:21:41 +0000 (05:21 +0000)]
* 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.
Akim Demaille [Mon, 25 Aug 2003 18:47:36 +0000 (18:47 +0000)]
* 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.
Akim Demaille [Mon, 25 Aug 2003 15:16:25 +0000 (15:16 +0000)]
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.
Akim Demaille [Mon, 25 Aug 2003 08:06:17 +0000 (08:06 +0000)]
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.
Akim Demaille [Mon, 25 Aug 2003 07:15:49 +0000 (07:15 +0000)]
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.
Paul Eggert [Sat, 26 Jul 2003 14:12:28 +0000 (14:12 +0000)]
(YYASSERT): New macro.
(yyfillin, yydoAction, yyglrReduce, yysplitStack,
yyresolveStates, yyprocessOneStack):
Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
Paul Eggert [Mon, 7 Jul 2003 03:46:28 +0000 (03:46 +0000)]
(operator<<(std::ostream&, const Position&)):
use s.empty() rather than s == "" to test for empty string; see
<http://mail.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
(trivial change)
Paul Eggert [Thu, 19 Jun 2003 08:45:55 +0000 (08:45 +0000)]
* 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.
Paul Eggert [Thu, 19 Jun 2003 08:45:16 +0000 (08:45 +0000)]
(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. Problem reported by Frank
Heckenbach in
<http://mail.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
Paul Eggert [Thu, 19 Jun 2003 07:38:39 +0000 (07:38 +0000)]
Port to Forte Developer 7 C compiler.
(struct YYLTYPE): If locations are not being used, declare a single
dummy member, as empty structs do not conform to the C standard.
(YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
the Forte Developer 7 C compiler complains that end-of-loop
code is not reached.
Paul Eggert [Tue, 17 Jun 2003 07:46:05 +0000 (07:46 +0000)]
(EXTRA_DIST): Add the following files, which
shouldn't be needed according to the gettext 0.12.1 documentation
but which seem to be needed anyway: codeset.m4 glibc21.m4
intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4
lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
Paul Eggert [Tue, 17 Jun 2003 07:25:48 +0000 (07:25 +0000)]
Do not include config.h; that's the includer's job.
Do not include <stdlib.h>.
(PARAMS): Define unconditionally for C89.
(ATTRIBUTE_NORETURN): Remove.
(ATTRIBUTE_UNUSED): Define unconditionally.
Paul Eggert [Tue, 17 Jun 2003 07:21:59 +0000 (07:21 +0000)]
Upgrade to 2003-06-08 libbitset; then:
(bitset_compatible_p): Indent as per GNU standard.
Don't use 'index' in comments, as it's a builtin fn on some hosts.
Paul Eggert [Tue, 17 Jun 2003 07:19:50 +0000 (07:19 +0000)]
Upgrade to 2003-06-08 libbitset; then:
Do not include config.h; that's the includer's job.
Do not include <sys/types.h>; shouldn't be needed on a C89 host.
Paul Eggert [Mon, 16 Jun 2003 19:45:45 +0000 (19:45 +0000)]
* configure.ac (AM_STDBOOL_H): Invoke this instead of AC_HEADER_STDBOOL.
(AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
(AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
Paul Hilfinger [Tue, 10 Jun 2003 02:44:58 +0000 (02:44 +0000)]
* 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.
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.
Paul Eggert [Mon, 2 Jun 2003 08:19:29 +0000 (08:19 +0000)]
* 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.
Paul Eggert [Mon, 2 Jun 2003 08:19:08 +0000 (08:19 +0000)]
(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.
Paul Eggert [Mon, 2 Jun 2003 07:25:30 +0000 (07:25 +0000)]
(WARNING_CXXFLAGS): New subst. Set it to
everything that WARNING_CFLAGS has, except omit warnings
not suitable for C++.
(AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
Paul Eggert [Mon, 2 Jun 2003 06:18:31 +0000 (06:18 +0000)]
(yyfillin): Renamed from the old yyfill. Mark
as possibly unused.
(yyfill): New function.
(YYFILL): Use it.
(yyuserAction): Change type of yynormal to bool, so that it matches
the new yyfill signature. Mark it as possibly unused.
Paul Eggert [Mon, 2 Jun 2003 03:58:34 +0000 (03:58 +0000)]
(_AT_DATA_CALC_Y): Include unistd.h if available.
Define 'alarm' to do nothing if unistd.h is not available.
Add a new rule "exp: '-' error;" to test the above change to
data/yacc.c. Use 'alarm' to abort any test taking longer than
10 seconds, as it's probably looping.
(AT_CHECK_CALC): Test recovery from error in new grammar rule.
Also, the new yacc.c generates two fewer diagnostics for an
existing test.
Paul Eggert [Mon, 2 Jun 2003 03:57:39 +0000 (03:57 +0000)]
(YYERROR): Now just 'goto yyerrorlab', since the
macro's size was becoming unwieldy.
(yyerrlab): Do not discard an empty lookahead symbol, as this
might destroy garbage.
(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, and POSIX requires this behavior.
(yyerrlab1): Use YYPOPSTACK instead of its definiens.