Commit Graph

1767 Commits

Author SHA1 Message Date
Paul Eggert
f6a8ccf40a (libbison_a_SOURCES): Add get-errno.h, get-errno.c. 2002-12-11 05:26:00 +00:00
Paul Eggert
178365909f (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX. 2002-12-11 05:25:27 +00:00
Paul Eggert
9939fdb139 Rename struniq -> uniqstr to avoid collision with <string.h>. 2002-12-11 05:23:54 +00:00
Paul Eggert
4bebc88ee1 Initial revision 2002-12-11 05:22:48 +00:00
Paul Eggert
557962dcff Initial revision. 2002-12-11 05:22:23 +00:00
Paul Eggert
5bab03fcf8 Rename struniq to uniqstr, to avoid collision with <string.h>. 2002-12-11 05:20:31 +00:00
Paul Eggert
996b1c7e8c * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
since this causes problems when __file__ contains character
sequences like "@" that are treated specially by src/scan-skel.l.
Instead, just use the file's basename.  This fixes the bug
reported by Martin Mokrejs in
<http://mail.gnu.org/pipermail/bug-bison/2002-December/001949.html>.
2002-12-09 04:48:38 +00:00
Paul Eggert
e19c4e5d1c Add support for rules that do not have trailing semicolons, as
POSIX requires.  Improve the quality of locations in Bison
diagnostics.

Remove duplicate decl of current_file.
Fix minor promotion problem in templates.
Fix Debian Bug 102878.
2002-12-07 08:09:17 +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
3f2d73f157 Include "files.h".
(YY_USER_INIT): Initialize scanner_cursor instead
of *loc.
(STEP): Remove.  No longer needed, now that adjust_location does
the work.  All uses removed.
(scanner_cursor): New var.
(adjust_location): Renamed from extend_location.  It now sets
*loc and adjusts the scanner cursor.  All uses changed.
Don't bother testing for CR.
(handle_syncline): Remove location arg; now updates scanner cursor.
All callers changed.
(unexpected_end_of_file): Now accepts start boundary of token or
comment, not location.  All callers changed.  Update scanner cursor,
not the location.
(SC_AFTER_IDENTIFIER): New state.
(context_state): Renamed from c_context.  All uses changed.
(id_loc, code_start, token_start): New local vars.
(<INITIAL,SC_AFTER_IDENTIFIER>): New initial context.  Move all
processing of Yacc white space and equivalents here.
(<INITIAL>{id}): Save id_loc.  Begin state SC_AFTER_IDENTIFIER
instead of returning ID immediately, since we need to search for
a subsequent colon.
(<INITIAL>"'", "\""): Save token_start.
(<INITIAL>"%{", "{", "%%"): Save code_start.
(<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
(<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
BEGIN context_state at end, not INITIAL.
(<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
<SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
Return correct token start.
(<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
the start of a character, string or multiline comment is found.
2002-12-07 06:14:27 +00:00
Paul Eggert
d6ea8200af (nonterminals_reduce): Use warn_at rather than rolling our own. 2002-12-07 06:12:48 +00:00
Paul Eggert
0aa32d51bb Include location.h.
(scanner_cursor): New decl.
2002-12-07 06:11:11 +00:00
Paul Eggert
2073702c37 Adjust to new location_t layout. 2002-12-07 06:02:10 +00:00
Paul Eggert
b729552289 (lloc_default): New function, which handles
empty locations more accurately.
(YYLLOC_DEFAULT): Use it.
(%token COLON): Remove.
(%token ID_COLON): New token.
(rules): Use it.
(declarations, rules): Remove trailing semicolon.
(declaration, rules_or_grammar_declaration):
Allow empty (";") declaration.
(symbol_def): Remove empty actions; no longer needed.
(rules_or_grammar_declaration): Remove trailing semicolon.
(semi_colon.opt): Remove.
2002-12-07 06:01:20 +00:00
Paul Eggert
8f759107f1 Do not include <quotearg.h>; no longer needed.
(boundary): New type.
(location_t): Use it.  This allows locations to span file boundaries.
All member uses changed: file -> start.file or end.file (as needed),
first_line -> start.line, first_column -> start.column,
last_line -> end.line, last_column -> end.column.
(equal_boundaries): New function.
(LOCATION_RESET, LOCATION_STEP): Remove.
(LOCATION_PRINT): Remove.  All callers changed to use location_print.
(empty_location): Now const.
(location_print): New decl.
2002-12-07 05:58:38 +00:00
Paul Eggert
b17a1fc541 * src/location.c: Include <quotearg.h>.
(empty_location): Now const.
(location_print): New function.  Follow the recommendation of the
GNU Coding Standards for locations that span file boundaries.
2002-12-07 05:57:32 +00:00
Paul Eggert
5fcdb07b70 LOCATION_PRINT -> location_print 2002-12-07 05:55:28 +00:00
Paul Eggert
7f8ba6c7f3 (current_file): Remove duplicate decl;
current_file is now owned by files.h.
2002-12-07 05:54:29 +00:00
Paul Eggert
4b68955b1d Include files.h. LOCATION_PRINT -> location_print. 2002-12-07 05:53:51 +00:00
Paul Eggert
b69d743e78 (Table of Symbols): YYERROR_VERBOSE should
be #defined in the prologue, not in the Bison declarations.
This fixes Debian Bug 102878, reported by Shaul Karl.
2002-12-07 05:50:45 +00:00
Paul Eggert
4f21fffe7e (yy_reduce_print): Don't assume that yyrline[yyrule] promotes to int;
it might be unsigned int.
2002-12-07 05:46:30 +00:00
Paul Eggert
c5d128ec1a (yy_reduce_print): Don't assume that yyrline[yyrule]
promotes to int; it might be unsigned int.
2002-12-07 05:45:46 +00:00
Paul Eggert
b64755e391 Add strtoul.c
In src/scan-gram.l, move helper function definitions to epilogue.
2002-12-02 18:20:30 +00:00
Paul Eggert
022fb98e85 (AC_REPLACE_FUNCS): Add strtoul. 2002-12-02 18:19:51 +00:00
Paul Eggert
570fe42828 New file, from gnulib. 2002-12-02 18:19:30 +00:00
Paul Eggert
6c30d6413e (no_cr_read, extend_location): Move to epilogue,
and put only a forward declaration in the prologue.  This is for
consistency with the other scanner helper functions.
2002-12-01 02:37:56 +00:00
Paul Eggert
6ba5559289 Type clashes now generate warnings, not errors, since it
appears that POSIX may allow some grammars with type clashes.
2002-11-30 09:52:42 +00:00
Paul Eggert
e927351156 (grammar_current_rule_check): Warn about
type clashes instead of complaining.
2002-11-30 09:52:11 +00:00
Paul Eggert
38e71ff8c8 (Type Clashes): Expect warnings, not complaints. 2002-11-30 09:51:50 +00:00
Paul Eggert
3b0ee3aa8b fund -> found 2002-11-30 09:25:06 +00:00
Paul Eggert
6e746484fc Add Yacc Library.
gram_error is static.
yylex and yyerror must be declared.
2002-11-30 09:20:52 +00:00
Paul Eggert
74724a70a5 Describe Yacc library, lex-param and parse-param changes. 2002-11-30 09:18:34 +00:00
Paul Eggert
1fec91df90 (gram_error): Now static. Add static decl.
(print_token_value): Omit parameter names from forward decl,
for consistency.
2002-11-30 09:16:54 +00:00
Paul Eggert
d18f45311a (gram_error): Remove decl. 2002-11-30 09:16:32 +00:00
Paul Eggert
93dd49ab29 (Yacc Library): New node. Regenerate top menu. 2002-11-30 09:11:30 +00:00
Paul Eggert
1f14d97ae5 (lib_LIBRARIES, liby_a_SOURCES): New macros. 2002-11-30 09:10:55 +00:00
Paul Eggert
0af19cd0c1 lib/main.c, lib/yyerror.c: New files. 2002-11-30 09:10:20 +00:00
Paul Eggert
38a92d500a Emphasize that yylex and yyerror must be declared before being used.
E.g., one should typically declare them in the prologue.  Use GNU
coding style in examples.  Put "const" consistently after the type it
modifies.  Mention that C99 supports "inline".  Mention that yyerror
traditionally returns "int".
2002-11-30 07:42:37 +00:00
Paul Eggert
6b0d38ab2c [a-f] -> [abcdef], so that we don't assume the C locale. 2002-11-29 09:03:16 +00:00
Paul Eggert
88510f9c07 %parse-param and %lex-param now take just one argument, the
declaration; the argument name is deduced from the declaration.
2002-11-29 08:45:33 +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
763ed7a687 "," now elicits a warning, rather than being
a token; this is more compatible with byacc.
2002-11-29 08:44:40 +00:00
Paul Eggert
1773ceee65 (add_param): New function.
(COMMA): Remove.
(declaration): Implement new rule for %parse-param and %lex-param.
2002-11-29 08:44:04 +00:00
Paul Eggert
feeb0edaf1 (Parser Function, Pure Calling, Error Reporting, Table of Symbols):
%parse-param and %lex-param now take just one argument, the
declaration; the argument name is deduced from the declaration.
2002-11-29 08:43:12 +00:00
Paul Eggert
78c3da9e09 (reader): Remove gram_control; it wasn't being used. 2002-11-29 05:59:59 +00:00
Paul Eggert
4f39538148 Sync with gnulib. 2002-11-28 00:42:28 +00:00
Paul Eggert
bb92250c78 Rename identifiers to avoid real and potential collisions. 2002-11-27 18:36:41 +00:00