mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-14 06:43:03 +00:00
Stop storing rules from 1 to nrules + 1.
* src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c * src/nullable.c, src/output.c, src/print.c, src/reader.c * src/reduce.c: Allocate and free from &rules[0], not &rules[1]. Iterate from 0 to nrules. Use rule_number_as_item_number and item_number_as_rule_number. Adjust to `derive' now containing possibly 0. * src/gram.h (rule_number_as_item_number, item_number_as_rule_number): Handle the `- 1' part in rule numbers from/to item numbers. * src/conflicts.c (log_resolution): Fix the message which reversed shift and reduce. * src/output.c (action_row): Initialize default_rule to -1. (token_actions): Adjust. * tests/sets.at (Nullable, Firsts): Fix the previously bogus expected output. * tests/conflicts.at (Resolved SR Conflicts): Likewise.
This commit is contained in:
@@ -326,7 +326,7 @@ state 5
|
||||
1 | exp OP exp . [$, OP]
|
||||
|
||||
$default reduce using rule 1 (exp)
|
||||
Conflict between rule 2 and token OP resolved as shift (%left OP).
|
||||
Conflict between rule 1 and token OP resolved as reduce (%left OP).
|
||||
]])
|
||||
|
||||
AT_CLEANUP
|
||||
|
||||
@@ -98,12 +98,12 @@ FIRSTS
|
||||
e
|
||||
FDERIVES
|
||||
$axiom derives
|
||||
1 e $
|
||||
2 'e'
|
||||
3 /* empty */
|
||||
0 e $
|
||||
1 'e'
|
||||
2 /* empty */
|
||||
e derives
|
||||
2 'e'
|
||||
3 /* empty */
|
||||
1 'e'
|
||||
2 /* empty */
|
||||
]])
|
||||
|
||||
AT_CLEANUP
|
||||
@@ -233,22 +233,22 @@ FIRSTS
|
||||
exp
|
||||
FDERIVES
|
||||
$axiom derives
|
||||
1 exp $
|
||||
2 exp '<' exp
|
||||
3 exp '>' exp
|
||||
4 exp '+' exp
|
||||
5 exp '-' exp
|
||||
6 exp '^' exp
|
||||
7 exp '=' exp
|
||||
8 "exp"
|
||||
0 exp $
|
||||
1 exp '<' exp
|
||||
2 exp '>' exp
|
||||
3 exp '+' exp
|
||||
4 exp '-' exp
|
||||
5 exp '^' exp
|
||||
6 exp '=' exp
|
||||
7 "exp"
|
||||
exp derives
|
||||
2 exp '<' exp
|
||||
3 exp '>' exp
|
||||
4 exp '+' exp
|
||||
5 exp '-' exp
|
||||
6 exp '^' exp
|
||||
7 exp '=' exp
|
||||
8 "exp"
|
||||
1 exp '<' exp
|
||||
2 exp '>' exp
|
||||
3 exp '+' exp
|
||||
4 exp '-' exp
|
||||
5 exp '^' exp
|
||||
6 exp '=' exp
|
||||
7 "exp"
|
||||
]])
|
||||
|
||||
AT_CLEANUP
|
||||
|
||||
Reference in New Issue
Block a user