1 |
|
2002-12-06 Paul Eggert <eggert@twinsun.com> |
2 |
|
|
3 |
|
Add support for rules that do not have trailing semicolons, as |
4 |
|
POSIX requires. Improve the quality of locations in Bison |
5 |
|
diagnostics. |
6 |
|
|
7 |
|
* src/location.c: Include <quotearg.h>. |
8 |
|
(empty_location): Now const. |
9 |
|
(location_print): New function. Follow the recommendation of the |
10 |
|
GNU Coding Standards for locations that span file boundaries. |
11 |
|
* src/location.h: Do not include <quotearg.h>; no longer needed. |
12 |
|
(boundary): New type. |
13 |
|
(location_t): Use it. This allows locations to span file boundaries. |
14 |
|
All member uses changed: file -> start.file or end.file (as needed), |
15 |
|
first_line -> start.line, first_column -> start.column, |
16 |
|
last_line -> end.line, last_column -> end.column. |
17 |
|
(equal_boundaries): New function. |
18 |
|
(LOCATION_RESET, LOCATION_STEP): Remove. |
19 |
|
(LOCATION_PRINT): Remove. All callers changed to use location_print. |
20 |
|
(empty_location): Now const. |
21 |
|
(location_print): New decl. |
22 |
|
* src/parse-gram.y (lloc_default): New function, which handles |
23 |
|
empty locations more accurately. |
24 |
|
(YYLLOC_DEFAULT): Use it. |
25 |
|
(%token COLON): Remove. |
26 |
|
(%token ID_COLON): New token. |
27 |
|
(rules): Use it. |
28 |
|
(declarations, rules): Remove trailing semicolon. |
29 |
|
(declaration, rules_or_grammar_declaration): |
30 |
|
Allow empty (";") declaration. |
31 |
|
(symbol_def): Remove empty actions; no longer needed. |
32 |
|
(rules_or_grammar_declaration): Remove trailing semicolon. |
33 |
|
(semi_colon.opt): Remove. |
34 |
|
* src/reader.h: Include location.h. |
35 |
|
(scanner_cursor): New decl. |
36 |
|
* src/reduce.c (nonterminals_reduce): Use warn_at rather than |
37 |
|
rolling our own. |
38 |
|
* src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead |
39 |
|
of *loc. |
40 |
|
(STEP): Remove. No longer needed, now that adjust_location does |
41 |
|
the work. All uses removed. |
42 |
|
(scanner_cursor): New var. |
43 |
|
(adjust_location): Renamed from extend_location. It now sets |
44 |
|
*loc and adjusts the scanner cursor. All uses changed. |
45 |
|
Don't bother testing for CR. |
46 |
|
(handle_syncline): Remove location arg; now updates scanner cursor. |
47 |
|
All callers changed. |
48 |
|
(unexpected_end_of_file): Now accepts start boundary of token or |
49 |
|
comment, not location. All callers changed. Update scanner cursor, |
50 |
|
not the location. |
51 |
|
(SC_AFTER_IDENTIFIER): New state. |
52 |
|
(context_state): Renamed from c_context. All uses changed. |
53 |
|
(id_loc, code_start, token_start): New local vars. |
54 |
|
(<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all |
55 |
|
processing of Yacc white space and equivalents here. |
56 |
|
(<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER |
57 |
|
instead of returning ID immediately, since we need to search for |
58 |
|
a subsequent colon. |
59 |
|
(<INITIAL>"'", "\""): Save token_start. |
60 |
|
(<INITIAL>"%{", "{", "%%"): Save code_start. |
61 |
|
(<SC_AFTER_IDENTIFIER>): New state, looking for a colon. |
62 |
|
(<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>): |
63 |
|
BEGIN context_state at end, not INITIAL. |
64 |
|
(<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'", |
65 |
|
<SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>): |
66 |
|
Return correct token start. |
67 |
|
(<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when |
68 |
|
the start of a character, string or multiline comment is found. |
69 |
|
* tests/conflicts.at (S/R in initial, Defaulted Conflicted |
70 |
|
Reduction): Adjust reported locations to match the more-precise |
71 |
|
results now expected. |
72 |
|
* tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise. |
73 |
|
* tests/reduce.at (Useless Rules, Reduced Automaton, |
74 |
|
Underivable Rules): Likewise. |
75 |
|
* tests/regression.at (Invalid inputs): No longer `expecting ";" |
76 |
|
or "|"' now that so many other tokens are allowed by the new grammar. |
77 |
|
|
78 |
|
* src/complain.h (current_file): Remove duplicate decl; |
79 |
|
current_file is now owned by files.h. |
80 |
|
* src/complain.c, src/scan-gram.l: Include files.h. |
81 |
|
|
82 |
|
2002-12-06 Paul Eggert <eggert@twinsun.com> |
83 |
|
|
84 |
|
* data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule] |
85 |
|
promotes to int; it might be unsigned int. |
86 |
|
* data/yacc.c (yy_reduce_print): Likewise. |
87 |
|
|
88 |
|
* doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should |
89 |
|
be #defined in the prologue, not in the Bison declarations. |
90 |
|
This fixes Debian Bug 102878, reported by Shaul Karl. |
91 |
|
|
92 |
2002-12-02 Paul Eggert <eggert@twinsun.com> |
2002-12-02 Paul Eggert <eggert@twinsun.com> |
93 |
|
|
94 |
* configure.ac (AC_REPLACE_FUNCS): Add strtoul. |
* configure.ac (AC_REPLACE_FUNCS): Add strtoul. |