Commit Graph

257 Commits

Author SHA1 Message Date
Paul Eggert
00c378a21f (Badly Collapsed GLR States): Switch to Yacc-style conflict reports. 2002-12-29 02:00:20 +00:00
Paul Eggert
a4b746ea04 (GNU Cim Grammar): Switch to Yacc-style reports. 2002-12-29 01:59:40 +00:00
Paul Eggert
2c8ba4cd59 (Unresolved SR Conflicts, Defaulted
Conflicted Reduction, %expect not enough, %expect too much,
%expect with reduce conflicts): Switch to Yacc-style reports.
2002-12-29 01:59:13 +00:00
Paul Eggert
120f129d67 (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
Error locations include the locations of all the tokens that were
discarded, not just the last token.
2002-12-28 08:38:14 +00:00
Paul Eggert
6876ecd36e (%expect with reduce conflicts): New test. 2002-12-26 22:21:23 +00:00
Paul Eggert
051ade8391 (Torturing the Scanner): Rename value_t -> value,
value_t_as_yystype -> value_as_yystype.
2002-12-11 07:00:15 +00:00
Paul Eggert
e3aa2baac6 (_AT_DATA_CALC_Y, Simple LALR Calculator):
Rename value_t -> value.
2002-12-11 06:59:39 +00:00
Paul Eggert
050931e3f9 (Invalid inputs): No longer `expecting ";"
or "|"' now that so many other tokens are allowed by the new grammar.
2002-12-07 06:16:58 +00:00
Paul Eggert
e551232efa (Useless Rules, Reduced Automaton, Underivable Rules): Adjust reported
locations to match the more-precise results now expected.
2002-12-07 06:16:30 +00:00
Paul Eggert
b06af56f55 (Invalid $n, Invalid @n, Type Clashes):
Adjust reported locations to match the more-precise
results now expected.
2002-12-07 06:15:55 +00:00
Paul Eggert
2bf21a8322 (S/R in initial, Defaulted Conflicted Reduction):
Adjust reported locations to match the more-precise
results now expected.
2002-12-07 06:15:18 +00:00
Paul Eggert
38e71ff8c8 (Type Clashes): Expect warnings, not complaints. 2002-11-30 09:51:50 +00:00
Paul Eggert
da90e18c6e (Simple LALR Calculator): Adopt new convention for %parse-param
and %lex-param.
2002-11-29 08:45:14 +00:00
Paul Eggert
136d65300d (_AT_CHECK_PRINTER_AND_DESTRUCTOR): yyout -> yyoutput,
to avoid collision with lex macro described by Bruce Lilly in
<http://mail.gnu.org/pipermail/bug-bison/2002-November/001929.html>.
2002-11-27 18:31:27 +00:00
Paul Eggert
16f37b35a5 (Actions after errors): Use an output format
more similar to that of the Printers and Destructors test.
Test the position of the ';' token too.
(Printers and Destructors): Likewise.
(Printers and Destructors: %glr-parser): Remove for now, to avoid
unnecessarily alarming people when the test fails.
2002-11-25 07:36:54 +00:00
Paul Eggert
500bbfcd81 (_AT_TEST_GLR_CXXTYPES): Do not include <assert.h>.
Replace all instances of assert with abort.
2002-11-21 05:28:44 +00:00
Paul Eggert
63d0fb9ce4 (_AT_DATA_CALC_Y): Do not include <assert.h>.
Replace all instances of assert with abort.
2002-11-21 05:28:09 +00:00
Paul Eggert
7a86d7eba9 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Do not include <assert.h>. 2002-11-21 05:27:28 +00:00
Paul Eggert
4e8c79eb7f (_AT_DATA_CALC_Y): Make vars static instead of
extern when possible.  Remove unused initializations.
2002-11-18 07:52:13 +00:00
Akim Demaille
4c6cc1db75 Make the ``Printers and Destructors'' test more verbose, taking
`yacc.c''s behavior as (possibly wrong) reference.
* tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
instead of fprint on stdout.
Set and report the last_line of the symbols.
Consistently display values and locations.
2002-11-16 12:30:23 +00:00
Paul Eggert
5dac0025f6 (Actions after errors): New test case. 2002-11-16 07:31:35 +00:00
Paul Eggert
6e649e659e * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
tests/action.at, tests/calc.at, tests/conflicts.at,
tests/cxx-type.at, tests/regression.at:
"parse error" -> "syntax error" for POSIX compatibility.
"parsing stack overflow..." -> "parser stack overflow" so
that code matches Bison documentation.
2002-11-15 20:32:21 +00:00
Akim Demaille
0f39aab92a * src/parse-gram.y (declaration): Have %parse-param and %lex-param
take two BRACED_CODE, not two string_content.
Free the scanner's obstack when we are done.
(code_content): New.
* tests/calc.at: Adjust.
* doc/bison.texinfo: Adjust.
Also, make sure to include the `,' for these declarations.
2002-11-15 16:42:16 +00:00
Akim Demaille
0258d1661c 2002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
* src/.cvsignore: Add src-gram.c.
* tests/.cvsignore: Add atlocal.
* config/.cvsignore, m4/.cvsignore, po/.cvsignore:
Add several files that autoreconf may bring in during
bootstrap.
2002-11-15 09:04:37 +00:00
Akim Demaille
b0f98b1016 Always check the value returned by yyparse.
* tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
returned by yyparse.
(_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
Adjust calls.
* tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
returned by yyparse.
2002-11-15 08:56:40 +00:00
Paul Eggert
edbc04c709 (AT_TEST_CPP_GUARD_H): Compile with -I., as Forte 7 C requires it,
and it shouldn't hurt on other compilers.
2002-11-15 01:57:23 +00:00
Paul Eggert
1d39f854cf (AT_TEST_CPP_GUARD_H): Don't assume that "$CC -E foo.h" is allowed, as
this doesn't work with the Portland Group compiler.  Instead, use "$CC
-E bar.c".  Include the .h file twice in the grammar, as an extra
check.
2002-11-14 23:08:01 +00:00
Paul Eggert
dda7a53e4d (Torturing the Scanner): Surround the backslash-newline tests with
"#if 0", to make it less likely that we'll run into compiler bugs.
Bring back solitary \ inside comment, but add a closing comment to
work around HP C bug.  Don't test backslash-newline in C character
constant.  This should fix the input.at bug reported by Nelson
H. F. Beebe in
<http://mail.gnu.org/pipermail/bug-bison/2002-November/001893.html>.
2002-11-14 22:53:47 +00:00
Akim Demaille
f32b346d84 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
status of the compiler.
Calling `exit 1' is no longer needed.
Reported by Nelson H. F. Beebe.
2002-11-14 11:09:51 +00:00
Akim Demaille
4e8d992c7d * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
status of the compiler.
Reported by Nelson H. F. Beebe.
2002-11-14 11:07:00 +00:00
Akim Demaille
9501dc6e69 * tests/atlocal.in (CPPFLAGS): We have config.h.
* tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
New.
* tests/actions.at, tests/calc.at, tests/conflicts.at,
* tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
* tests/regression.at, tests/torture.at: Use them for all the
grammars that are to be compiled.
* tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
* tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
* doc/bison.texinfo (GLR Parsers): Document `inline'.
2002-11-14 09:58:01 +00:00
Paul Eggert
2b42986e75 (export YYLTYPE): Don't invoke "cc a.c b.c -o c"; the HP-UX 11i C
compiler chatters during compilation.  Instead, invoke "cc -c a.c -o
a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
2002-11-14 00:36:03 +00:00
Paul Eggert
efc6bf1b94 (Torturing the Scanner): Don't invoke "cc a.c b.c
-o c"; the HP-UX 11i C compiler chatters during compilation.
Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
2002-11-14 00:35:27 +00:00
Paul Eggert
149365be01 (Torturing the Scanner): Remove lines containing
solitary backslashes, as they tickle a bug in the HP-UX 11i C
compiler.
2002-11-14 00:26:45 +00:00
Paul Eggert
c240826c06 (Badly Collapsed GLR States): Avoid //
comments, since they're not portable.  Use GNU coding style.
2002-11-13 23:20:52 +00:00
Akim Demaille
283f1e6482 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
locations.
2002-11-12 10:18:05 +00:00
Akim Demaille
3df374151b * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
Use it to test the GLR parser.
2002-11-12 09:07:38 +00:00
Akim Demaille
7bd6c77e5e * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
defines it.
* data/glr.c (yystos): New.
(b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
(YYDSYMPRINT): New.
(yyval): Don't define it, it is handled via M4.
(yyrecoverParseError): Free verbosely the discarded symbols.
* data/yacc.c (yysymprint): Remove, rather...
(b4_yysymprint_generate): invoke.
* data/c.m4 (b4_yysymprint_generate): New.
Accept pointers as arguments, as opposed to the version from
yacc.c.
(b4_yydestruct_generate): Likewise.
* tests/cations.at (Printers and Destructors): Use Bison directives
instead of CPP macros.
Don't rely on internal details.
2002-11-12 09:03:13 +00:00
Paul Eggert
5b7f88c7f2 (Torturing the Scanner): Add tests that @oline@,
__oline__, #output, $@, and @{ do not have unintended meanings.
2002-11-12 07:28:25 +00:00
Paul Eggert
66871a8103 (AT_DATA_TRIANGULAR_GRAMMAR, AT_DATA_HORIZONTAL_GRAMMAR,
AT_DATA_LOOKAHEADS_GRAMMAR, AT_DATA_STACK_TORTURE): Replace `assert
(x);' with `if (! (x)) abort ();'.  This reduces the runtime of the
"Many lookaheads" test from 27.6 to 2.7 minutes on a 440 MHz
Ultrasparc III.
2002-11-10 07:04:07 +00:00
Paul Eggert
2115939b03 (Invalid inputs): Adjust wording in diagnostic to match the new behavior. 2002-11-10 05:27:18 +00:00
Akim Demaille
93724f139a Let yyerror always receive the msg as last argument, so that
yyerror can be variadic.
* data/yacc.c (b4_yyerror_args): New.
Use it when calling yyerror.
* data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
Use it when calling yyerror.
* doc/bison.texinfo (Error Reporting): Adjust.
* tests/calc.at (_AT_DATA_CALC_Y): Adjust.
* tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
2002-11-07 12:52:19 +00:00
Akim Demaille
2dfbfc122c * tests/regression.at (Invalid inputs): Adjust to the recent
messages.
2002-11-06 14:14:48 +00:00
Paul Eggert
9906579faa (Invalid $n, Invalid @n): Change expected wording accordingly. 2002-11-06 07:01:55 +00:00
Akim Demaille
793a58bb66 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
and yyerror.
Have yyerror `use' its arguments.
* tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
returns true when location & yacc & pure & parse-param.
(_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
2002-11-04 08:30:18 +00:00
Akim Demaille
c4d720cdbb * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
clashes.
* src/scan-gram.l: Use ['] instead of ['] to pacify
font-lock-mode.
Use complain_at.
Use quote, not quote_n since LOCATION_PRINT no longer uses the
slot 0.
2002-11-04 08:28:01 +00:00
Paul Eggert
baa00b7f43 (Type Clashes): Adjust to diagnostic changes. 2002-11-04 06:07:09 +00:00
Akim Demaille
2a8d363aab * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
New.
* data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
(b4_parse_param): Remove.
Use b4_identification.
Propagate b4_pure_args where needed to pass them to yyerror.
* data/glr.m4 (b4_parse_param): Remove.
(b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
(b4_lpure_formals): New.
Use b4_identification.
(YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
b4_user_formals and b4_user_args.
(yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
(yyreportAmbiguity): When using a pure parser, also need
the location, and the parse-params.
Adjust callers.
(yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
When using a pure parser, also need the parse-params.
Adjust callers.
* tests/calc.at: Test pure (%pure-parser) and absolutely pure
(%pure-parser + %parse-param) LALR and GLR parsers.
(AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
(_AT_DATA_CALC_Y): Equip for purity of yyerror.
(_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
* tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
* doc/bison.texinfo: Untabify the whole file.
(Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
(Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
(Error Reporting): Adjust to these new directives.
Document %error-verbose, deprecate YYERROR_VERBOSE.
2002-11-03 16:41:57 +00:00
Akim Demaille
9e32add8e6 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
AT_CHECK_CALC_GLR invocations to use % directives, instead of
command line options.
* tests/cxx-type.at: Formatting changes.
2002-11-03 12:16:25 +00:00
Paul Eggert
206fe6a5ec Add tests for backslash-newline, m4 quotes
in symbols, long literals, and funny escapes in strings.
2002-11-03 08:42:56 +00:00