Commit Graph

1777 Commits

Author SHA1 Message Date
Paul Eggert
fbfa091d05 Include "gram.h". 2002-12-11 06:26:42 +00:00
Paul Eggert
f041e30b91 (enum conflict_resolution): Renamed from enum conflict_resolution_e. 2002-12-11 06:25:26 +00:00
Paul Eggert
41f83caf1c Don't include stdlib.h, string.h _LIBC stuff. 2002-12-11 06:23:40 +00:00
Paul Eggert
c7bd07f75a Adjust to type name changes. 2002-12-11 05:32:51 +00:00
Paul Eggert
3de372bb1b (assoc): Renamed from assoc_t. 2002-12-11 05:31:40 +00:00
Paul Eggert
c134bfbeee Adjust to type renamings. 2002-12-11 05:31:12 +00:00
Paul Eggert
5bf3d7c115 (bison_SOURCES): Rename struniq.c and struniq.h to uniqstr.c and uniqstr.h. 2002-12-11 05:30:26 +00:00
Paul Eggert
add6614e2b (struct state_list): Renamed from struct state_list_s.
(state_list): Renamed from state_list_t.
2002-12-11 05:29:17 +00:00
Paul Eggert
7c612afb7e (timevar_report): New decl. 2002-12-11 05:28:00 +00:00
Paul Eggert
e22ad7fa22 (timevar_report): Renamed from time_report, for consistency with other
names.
2002-12-11 05:27:29 +00:00
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