Commit Graph

1607 Commits

Author SHA1 Message Date
Paul Eggert
3813e141f8 (escaped_file_name_output): New function.
(prepare_symbols): Quote tokens for M4.
(prepare): Don't insert output_infix, output_prefix,
output_parser_name, output_header_name; this is now down by scan-skel.
Insert skeleton as a C string.
(user_actions_output, symbol_destructors_output,
symbol_printers_output): Quote filenames for C and M4.
2002-11-12 07:25:36 +00:00
Paul Eggert
a027c30d42 (MUSCLE_GROW_STRING_PAIR): Remove; unused.
(MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
2002-11-12 07:24:33 +00:00
Paul Eggert
4e956a7d9e Include quotearg.h, since we need to quote C strings now.
(muscle_init): Quote filename as a C string.
2002-11-12 07:23:52 +00:00
Paul Eggert
42481a1fd1 (output_infix): Remove; all uses removed. 2002-11-12 07:23:13 +00:00
Paul Eggert
947427ae83 Use new @ escapes consistently.
(b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
b4_output_header_suffix, b4_output_header_name, b4_header_guard):
Remove, since they couldn't handle arbitrary characters in file
names.

Remove use of "#ifdef b4_header_guard", since it
mishandled funny characters in file names, and anyway it isn't
needed any more.

(YYSTYPE_IS_TRIVIAL): Define when the .h file would.
2002-11-12 07:22:01 +00:00
Paul Eggert
6ad762a8c0 Use new @ escapes consistently.
(b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
b4_output_header_suffix, b4_output_header_name, b4_header_guard):
Remove, since they couldn't handle arbitrary characters in file
names.
Use YYSLP_NEEDED instead of b4_header_guard.
2002-11-12 07:21:01 +00:00
Paul Eggert
fa3f2a885a (b4_copyright): Omit file name from comment, since
the file name could contain "*/".
(b4_synclines_flag): Don't quote the 2nd argument; it should already
be quoted.  All uses changed.
2002-11-12 07:15:59 +00:00
Paul Eggert
acea4f3bb6 Fix the test failure due to GCC warnings described in
<http://mail.gnu.org/pipermail/bug-bison/2002-November/001815.html>.
* data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
evaluate to 0 if it's impossible for NINF to be in the respective
table.
(yygetLRActions, yyrecoverParseError): Use them.

* src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
counted in the token inserted at end of file.  Now takes
location_t *, not location_t, so that the location can be
adjusted.  All uses changed.

* tests/regression.at (Invalid inputs): Adjust wording in
diagnostic to match the new behavior.

* tests/torture.at (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 running
GCC 3.2.
2002-11-10 07:10:08 +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
Paul Eggert
345532d70b (unexpected_end_of_file): Fix bug: columns were counted in the token
inserted at end of file.  Now takes location_t *, not location_t, so
that the location can be adjusted.  All uses changed.
2002-11-10 05:17:56 +00:00
Paul Eggert
944ed9f4e9 Fix the test failure due to GCC warnings described in
<http://mail.gnu.org/pipermail/bug-bison/2002-November/001815.html>.

* data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
evalutate to 0 if it's impossible for NINF to be in the respective
table.
(yygetLRActions, yyrecoverParseError): Use them.
2002-11-10 04:31:38 +00:00
Paul Eggert
09d353a08f (scanner_last_string_free): Remove decl. 2002-11-08 06:14:29 +00:00
Paul Eggert
20ef1ad524 * src/parse-gram.y (CHARACTER): Remove unused token.
All uses removed.

* src/scan-gram.l: Remove stack option.  We no longer use the
stack, since the stack was never deeper than 1; instead, use the
new auto var c_context to record the stacked value.

Remove nounput option.  At an unexpected end of file, we now unput
the minimal input necessary to end cleanly; this simplifies the
code.

Avoid unbounded token sizes where this is easy.

(unexpected_end_of_file): New function.
Use it to systematize the error message on unexpected EOF.
(last-string): Now auto, not static.
(YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
(scanner_last_string_free): Remove; not used.
(percent_percent_count): Move decl to just before use.
(SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
not the (never otherwised-used) CHARACTER.
2002-11-08 05:22:51 +00:00
Paul Eggert
a706a1cc03 Remove stack option. We no longer use the stack, since the stack was
never deeper than 1; instead, use the new auto var c_context to record
the stacked value.

Remove nounput option.  At an unexpected end of file, we now unput
the minimal input necessary to end cleanly; this simplifies the
code.

Avoid unbounded token sizes where this is easy.

(unexpected_end_of_file): New function.
Use it to systematize the error message on unexpected EOF.
(last-string): Now auto, not static.
(YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
(scanner_last_string_free): Remove; not used.
(percent_percent_count): Move decl to just before use.
(SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
not the (never otherwised-used) CHARACTER.
2002-11-08 05:20:20 +00:00
Paul Eggert
87fbb0bffc (CHARACTER): Remove unused token. All uses removed. 2002-11-08 05:19:30 +00:00
Akim Demaille
959e5f515a Update. 2002-11-07 14:28:40 +00:00
Akim Demaille
1c0c3e955d Typo. 2002-11-07 12:54:51 +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
0e25cad542 Regen. 2002-11-07 12:50:34 +00:00
Paul Eggert
58918640ad * src/scan-gram.l (unexpected_end_of_file): New function.
Use it to systematize the error message on unexpected EOF.
2002-11-07 08:15:28 +00:00
Paul Eggert
8e6ef48342 (unexpected_end_of_file): New function.
Use it to systematize the error message on unexpected EOF.
2002-11-07 08:15:11 +00:00
Paul Eggert
fdac0091ce Minor spelling and punctuation fix. 2002-11-07 07:07:25 +00:00
Paul Eggert
4e0813a6cf Fix minor troff and spelling glitches. 2002-11-07 07:06:29 +00:00
Akim Demaille
6e40b4ebd4 #line should have quoted strings.
Ideally, this should be done by m4_quotearg.
* src/scan-skel.l: Include quotearg.h.
Quote __ofile__.
* src/output.c (symbol_printers_output)
(symbol_destructors_output): Quote the file name.
2002-11-06 16:22:04 +00:00
Akim Demaille
3d9a71d28a Typo. 2002-11-06 15:35:03 +00:00
Akim Demaille
2dfbfc122c * tests/regression.at (Invalid inputs): Adjust to the recent
messages.
2002-11-06 14:14:48 +00:00
Akim Demaille
437c2d8000 Restore --no-lines.
Reported by Jim Kent.
* data/c.m4 (b4_syncline): New.
* data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
* src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
* src/output.c (user_actions_output): Likewise.
(prepare): Define 'b4_synclines_flag'.
2002-11-06 14:11:47 +00:00
Akim Demaille
900c5db537 * src/main.c (main): Free `infile'.
* src/scan-gram.l (handle_syncline): New.
Recognize `#line'.
* src/output.c (user_actions_output, symbol_destructors_output)
(symbol_printers_output): Use the location's file name, not
infile.
* src/reader.c (prologue_augment, epilogue_set): Likewise.
2002-11-06 08:08:46 +00:00
Paul Eggert
e183b12388 * src/scan-gram.l: Use more accurate diagnostics, e.g.
"integer out of range" rather than "invalid value".
* tests/input.at (Invalid $n, Invalid @n): Change expected wording
accordingly.
2002-11-06 07:04:24 +00:00
Paul Eggert
9906579faa (Invalid $n, Invalid @n): Change expected wording accordingly. 2002-11-06 07:01:55 +00:00
Paul Eggert
98f2caaa5f Use more accurate diagnostics, e.g.
"integer out of range" rather than "invalid value".
2002-11-06 07:01:06 +00:00
Paul Eggert
886a425c6f Bison now parses C99 lexical constructs like digraphs, UCNs, and
backslash-newline within C escape sequences, as POSIX now requires.
2002-11-06 06:56:35 +00:00
Paul Hilfinger
51b4a04cd0 src/tables.c (matching_state): Don't allow states to match if
either has GLR conflict entries.
ChangeLog: update for this and Hilfinger's preceding test-suite	addition.
2002-11-06 02:46:08 +00:00
Paul Eggert
d04946c717 Regenerate. 2002-11-06 00:06:50 +00:00
Paul Eggert
193eb6b7ef Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
Also, remove one static variable in the scanner.
2002-11-05 23:52:28 +00:00
Paul Eggert
1a9e39f116 (braces_level): Now auto, not static.
Initialize to zero if the compiler is being picky.
(INITIAL): Clear braces_level instead of incrementing it.
(SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
as POSIX 1003.1-2001 requires.
2002-11-05 23:50:11 +00:00
Paul Eggert
48e28efa9e (IF_LINT): New macro, taken from coreutils. 2002-11-05 23:42:51 +00:00
Paul Eggert
bcb3effb3c Define "lint" if --enable-gcc-warnings. 2002-11-05 23:42:10 +00:00
Akim Demaille
29c017256a * src/scan-gram.l: When it starts with `%', complain about the
whole directive, not just that `invalid character: %'.
2002-11-05 21:20:14 +00:00
Akim Demaille
8aeac3ca0c * Makefile.maint: Update from Autoconf.
(update, cvs-update, po-update, do-po-update): New.
2002-11-04 08:45:16 +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
Akim Demaille
386642761d Update. 2002-11-04 07:30:28 +00:00
Paul Eggert
613a0dc5b5 * src/reader.c (get_merge_function, grammar_current_rule_check):
Use consistent diagnostics for reporting type name clashes.
Quote the types with <>, for consistency with Yacc.
* tests/input.at (Type Clashes): Adjust to diagnostic changes.
2002-11-04 07:29:57 +00:00
Paul Eggert
baa00b7f43 (Type Clashes): Adjust to diagnostic changes. 2002-11-04 06:07:09 +00:00
Paul Eggert
45a8a65dee (get_merge_function, grammar_current_rule_check):
Use consistent diagnostics for reporting type name clashes.
Quote the types with <>, for consistency with Yacc.
2002-11-04 06:06:44 +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
Akim Demaille
1a43c452ea Regen. 2002-11-03 12:14:47 +00:00