mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-15 07:13:02 +00:00
cex: also include in the report on --report=counterexamples
And let --report=all include the counterexamples. * src/getargs.h, src/getargs.c (report_cex): New. * src/main.c: Compute counterexamples when -rcex is specified. * src/print.c: Include the counterexamples when -rcex is specified. * tests/conflicts.at, tests/existing.at, tests/local.at: Adjust.
This commit is contained in:
@@ -860,6 +860,15 @@ State 5
|
||||
|
||||
OP [reduce using rule 1 (exp)]
|
||||
$default reduce using rule 1 (exp)
|
||||
|
||||
Shift/reduce conflict on token OP:
|
||||
1 exp: exp OP exp .
|
||||
1 exp: exp . OP exp
|
||||
Example exp OP exp • OP exp
|
||||
First derivation exp ::=[ exp ::=[ exp OP exp • ] OP exp ]
|
||||
Example exp OP exp • OP exp
|
||||
Second derivation exp ::=[ exp OP exp ::=[ exp • OP exp ] ]
|
||||
|
||||
]])
|
||||
|
||||
AT_CLEANUP
|
||||
@@ -1195,6 +1204,15 @@ State 1
|
||||
$end [reduce using rule 4 (id)]
|
||||
$default reduce using rule 3 (num)
|
||||
|
||||
Reduce/reduce conflict on token $end:
|
||||
3 num: '0' .
|
||||
4 id: '0' .
|
||||
Example '0' •
|
||||
First derivation exp ::=[ num ::=[ '0' • ] ]
|
||||
Example '0' •
|
||||
Second derivation exp ::=[ id ::=[ '0' • ] ]
|
||||
|
||||
|
||||
|
||||
State 2
|
||||
|
||||
@@ -1734,6 +1752,15 @@ State 4
|
||||
|
||||
reported_conflicts go to state 6
|
||||
|
||||
Shift/reduce conflict on token 'a':
|
||||
10 reported_conflicts: . %empty
|
||||
8 reported_conflicts: . 'a'
|
||||
First example resolved_conflict • 'a'
|
||||
First derivation start ::=[ resolved_conflict reported_conflicts ::=[ • ] 'a' ]
|
||||
Second example resolved_conflict • 'a' 'a'
|
||||
Second derivation start ::=[ resolved_conflict reported_conflicts ::=[ • 'a' ] 'a' ]
|
||||
|
||||
|
||||
|
||||
State 5
|
||||
|
||||
@@ -1744,6 +1771,15 @@ State 5
|
||||
'a' [reduce using rule 9 (reported_conflicts)]
|
||||
$default reduce using rule 8 (reported_conflicts)
|
||||
|
||||
Reduce/reduce conflict on token 'a':
|
||||
8 reported_conflicts: 'a' .
|
||||
9 reported_conflicts: 'a' .
|
||||
Example 'a' •
|
||||
First derivation reported_conflicts ::=[ 'a' • ]
|
||||
Example 'a' •
|
||||
Second derivation reported_conflicts ::=[ 'a' • ]
|
||||
|
||||
|
||||
|
||||
State 6
|
||||
|
||||
@@ -1920,6 +1956,15 @@ AT_CHECK([[cat input.output | sed -n '/^State 0$/,/^State 1$/p']], 0,
|
||||
Conflict between rule 10 and token 'b' resolved as an error (%nonassoc 'b').
|
||||
Conflict between rule 11 and token 'c' resolved as an error (%nonassoc 'c').
|
||||
|
||||
Reduce/reduce conflict on token 'c':
|
||||
12 empty_c2: . %empty
|
||||
13 empty_c3: . %empty
|
||||
Example • 'c'
|
||||
First derivation start ::=[ empty_c2 ::=[ • ] 'c' ]
|
||||
Example • 'c'
|
||||
Second derivation start ::=[ empty_c3 ::=[ • ] 'c' ]
|
||||
|
||||
|
||||
|
||||
State 1
|
||||
]])
|
||||
|
||||
@@ -36,7 +36,7 @@ dnl support is rapidly evolving, let's keep that information to be careful.
|
||||
dnl However, we don't do diffs for canonical LR(1) because the diff is huge.
|
||||
m4_pushdef([AT_LALR1_DIFF_CHECK],
|
||||
[AT_CHECK([[sed 's/^%define lr.type .*$//' input.y > input-lalr.y]])
|
||||
AT_BISON_CHECK([[--report=all input-lalr.y]], [[0]], [ignore], [ignore])
|
||||
AT_BISON_CHECK([[--report=all,no-cex input-lalr.y]], [[0]], [ignore], [ignore])
|
||||
AT_DIFF_U_CHECK([[input-lalr.output input.output]], [$1])])
|
||||
|
||||
AT_TEST_TABLES_AND_PARSE([$2[: LALR(1)]], [[LALR]], [[last-state]],
|
||||
|
||||
@@ -1594,7 +1594,7 @@ yylex (void)
|
||||
|
||||
m4_if(m4_index(m4_quote($3), [no-xml]), -1,
|
||||
[AT_BISON_CHECK],
|
||||
[AT_BISON_CHECK_NO_XML])([[-Wall --report=all --defines -o input.c input.y]],
|
||||
[AT_BISON_CHECK_NO_XML])([[-Wall --report=all,no-cex --defines -o input.c input.y]],
|
||||
[0], [], m4_dquote($7))
|
||||
|
||||
m4_if(m4_index(m4_quote($3), [last-state]), -1,
|
||||
|
||||
Reference in New Issue
Block a user