mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
cex: display all the S/R conflicts, not just one per (state, rule)
Before this commit, on
%%
exp
: "if" exp "then" exp
| "if" exp "then" exp "else" exp
| exp "+" exp
| "num"
we used to not display the third counterexample below:
Shift/reduce conflict on token "+":
Example exp "+" exp . "+" exp
First derivation exp ::=[ exp ::=[ exp "+" exp . ] "+" exp ]
Second derivation exp ::=[ exp "+" exp ::=[ exp . "+" exp ] ]
Shift/reduce conflict on token "else":
Example "if" exp "then" "if" exp "then" exp . "else" exp
First derivation exp ::=[ "if" exp "then" exp ::=[ "if" exp "then" exp . ] "else" exp ]
Second derivation exp ::=[ "if" exp "then" exp ::=[ "if" exp "then" exp . "else" exp ] ]
Shift/reduce conflict on token "+":
Example "if" exp "then" exp . "+" exp
First derivation exp ::=[ exp ::=[ "if" exp "then" exp . ] "+" exp ]
Second derivation exp ::=[ "if" exp "then" exp ::=[ exp . "+" exp ] ]
Shift/reduce conflict on token "+":
Example "if" exp "then" exp "else" exp . "+" exp
First derivation exp ::=[ exp ::=[ "if" exp "then" exp "else" exp . ] "+" exp ]
Second derivation exp ::=[ "if" exp "then" exp "else" exp ::=[ exp . "+" exp ] ]
* src/counterexample.c (counterexample_report_state): Don't stop of
the first conflicts.
* tests/conflicts.at, tests/counterexample.at, tests/diagnostics.at,
* tests/report.at: Adjust.
This commit is contained in:
@@ -1190,6 +1190,16 @@ Shift/reduce conflict on token "⊕":
|
||||
First derivation exp ::=[ exp ::=[ exp "⊕" exp • ] "⊕" exp ]
|
||||
Second derivation exp ::=[ exp "⊕" exp ::=[ exp • "⊕" exp ] ]
|
||||
|
||||
Shift/reduce conflict on token "+":
|
||||
Example exp "⊕" exp • "+" exp
|
||||
First derivation exp ::=[ exp ::=[ exp "⊕" exp • ] "+" exp ]
|
||||
Second derivation exp ::=[ exp "⊕" exp ::=[ exp • "+" exp ] ]
|
||||
|
||||
Shift/reduce conflict on token "+":
|
||||
Example exp "⊕" exp • "+" exp
|
||||
First derivation exp ::=[ exp ::=[ exp "⊕" exp • ] "+" exp ]
|
||||
Second derivation exp ::=[ exp "⊕" exp ::=[ exp • "+" exp ] ]
|
||||
|
||||
input.y:6.3-13: warning: rule useless in parser due to conflicts [-Wother]
|
||||
]])
|
||||
|
||||
@@ -1377,6 +1387,20 @@ State 8
|
||||
First derivation exp ::=[ exp ::=[ exp "⊕" exp • ] "⊕" exp ]
|
||||
Second derivation exp ::=[ exp "⊕" exp ::=[ exp • "⊕" exp ] ]
|
||||
|
||||
Shift/reduce conflict on token "+":
|
||||
1 exp: exp "⊕" exp •
|
||||
2 exp: exp • "+" exp
|
||||
Example exp "⊕" exp • "+" exp
|
||||
First derivation exp ::=[ exp ::=[ exp "⊕" exp • ] "+" exp ]
|
||||
Second derivation exp ::=[ exp "⊕" exp ::=[ exp • "+" exp ] ]
|
||||
|
||||
Shift/reduce conflict on token "+":
|
||||
1 exp: exp "⊕" exp •
|
||||
3 exp: exp • "+" exp
|
||||
Example exp "⊕" exp • "+" exp
|
||||
First derivation exp ::=[ exp ::=[ exp "⊕" exp • ] "+" exp ]
|
||||
Second derivation exp ::=[ exp "⊕" exp ::=[ exp • "+" exp ] ]
|
||||
|
||||
]])
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user