mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-21 02:03:03 +00:00
cex: use usual routines for diagnostics about S/R conflicts
See previous commit. We go from
input.y: warning: 3 reduce/reduce conflicts [-Wconflicts-rr]
Shift/reduce conflict on token "⊕":
Example exp "+" exp • "⊕" exp
Shift derivation
exp
↳ exp "+" exp
↳ exp • "⊕" exp
to
input.y: warning: 3 reduce/reduce conflicts [-Wconflicts-rr]
input.y: warning: shift/reduce conflict on token "⊕" [-Wcounterexamples]
Example exp "+" exp • "⊕" exp
Shift derivation
exp
↳ exp "+" exp
↳ exp • "⊕" exp
with an hyperlink on -Wcounterexamples.
* src/counterexample.c (counterexample_report_shift_reduce):
Use complain.
* tests/counterexample.at, tests/diagnostics.at, tests/report.at:
Adjust.
This commit is contained in:
@@ -1248,8 +1248,15 @@ counterexample_report_shift_reduce (state_item_number itm1, state_item_number it
|
|||||||
symbol_number next_sym,
|
symbol_number next_sym,
|
||||||
FILE *out, const char *prefix)
|
FILE *out, const char *prefix)
|
||||||
{
|
{
|
||||||
fputs (prefix, out);
|
if (out == stderr)
|
||||||
fprintf (out, _("Shift/reduce conflict on token %s:\n"), symbols[next_sym]->tag);
|
complain (NULL, Wcounterexamples,
|
||||||
|
_("shift/reduce conflict on token %s"), symbols[next_sym]->tag);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fputs (prefix, out);
|
||||||
|
fprintf (out, _("shift/reduce conflict on token %s"), symbols[next_sym]->tag);
|
||||||
|
fprintf (out, "%s\n", _(":"));
|
||||||
|
}
|
||||||
// In the report, print the items.
|
// In the report, print the items.
|
||||||
if (*prefix || trace_flag & trace_cex)
|
if (*prefix || trace_flag & trace_cex)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -861,7 +861,7 @@ State 5
|
|||||||
OP [reduce using rule 1 (exp)]
|
OP [reduce using rule 1 (exp)]
|
||||||
$default reduce using rule 1 (exp)
|
$default reduce using rule 1 (exp)
|
||||||
|
|
||||||
Shift/reduce conflict on token OP:
|
shift/reduce conflict on token OP:
|
||||||
1 exp: exp OP exp .
|
1 exp: exp OP exp .
|
||||||
1 exp: exp . OP exp
|
1 exp: exp . OP exp
|
||||||
Example exp OP exp . OP exp
|
Example exp OP exp . OP exp
|
||||||
@@ -1764,7 +1764,7 @@ State 4
|
|||||||
|
|
||||||
reported_conflicts go to state 6
|
reported_conflicts go to state 6
|
||||||
|
|
||||||
Shift/reduce conflict on token 'a':
|
shift/reduce conflict on token 'a':
|
||||||
10 reported_conflicts: . %empty
|
10 reported_conflicts: . %empty
|
||||||
8 reported_conflicts: . 'a'
|
8 reported_conflicts: . 'a'
|
||||||
First example resolved_conflict . 'a' 'a'
|
First example resolved_conflict . 'a' 'a'
|
||||||
@@ -1778,7 +1778,7 @@ State 4
|
|||||||
`-> resolved_conflict reported_conflicts 'a'
|
`-> resolved_conflict reported_conflicts 'a'
|
||||||
`-> .
|
`-> .
|
||||||
|
|
||||||
Shift/reduce conflict on token 'a':
|
shift/reduce conflict on token 'a':
|
||||||
10 reported_conflicts: . %empty
|
10 reported_conflicts: . %empty
|
||||||
9 reported_conflicts: . 'a'
|
9 reported_conflicts: . 'a'
|
||||||
First example resolved_conflict . 'a' 'a'
|
First example resolved_conflict . 'a' 'a'
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ y: A | A B;
|
|||||||
|
|
||||||
AT_BISON_CHECK_CEX(
|
AT_BISON_CHECK_CEX(
|
||||||
[[input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
|
[[input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
|
||||||
Shift/reduce conflict on token B:
|
input.y: warning: shift/reduce conflict on token B [-Wcounterexamples]
|
||||||
Example A . B C
|
Example A . B C
|
||||||
Shift derivation
|
Shift derivation
|
||||||
s
|
s
|
||||||
@@ -68,7 +68,7 @@ Shift/reduce conflict on token B:
|
|||||||
input.y:4.4: warning: rule useless in parser due to conflicts [-Wother]
|
input.y:4.4: warning: rule useless in parser due to conflicts [-Wother]
|
||||||
]],
|
]],
|
||||||
[[input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
|
[[input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
|
||||||
Shift/reduce conflict on token B:
|
input.y: warning: shift/reduce conflict on token B [-Wcounterexamples]
|
||||||
Example A . B C
|
Example A . B C
|
||||||
Shift derivation s -> [ y -> [ A . B ] c -> [ C ] ]
|
Shift derivation s -> [ y -> [ A . B ] c -> [ C ] ]
|
||||||
Reduce derivation s -> [ a -> [ A . ] x -> [ B C ] ]
|
Reduce derivation s -> [ a -> [ A . ] x -> [ B C ] ]
|
||||||
@@ -96,7 +96,7 @@ bc: B bc C | B C;
|
|||||||
|
|
||||||
AT_BISON_CHECK_CEX(
|
AT_BISON_CHECK_CEX(
|
||||||
[[input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
|
[[input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
|
||||||
Shift/reduce conflict on token B:
|
input.y: warning: shift/reduce conflict on token B [-Wcounterexamples]
|
||||||
Example A . B C
|
Example A . B C
|
||||||
Shift derivation
|
Shift derivation
|
||||||
s
|
s
|
||||||
@@ -109,7 +109,7 @@ Shift/reduce conflict on token B:
|
|||||||
`-> a bc
|
`-> a bc
|
||||||
`-> A . `-> B C
|
`-> A . `-> B C
|
||||||
|
|
||||||
Shift/reduce conflict on token B:
|
input.y: warning: shift/reduce conflict on token B [-Wcounterexamples]
|
||||||
Example A A . B B C C
|
Example A A . B B C C
|
||||||
Shift derivation
|
Shift derivation
|
||||||
s
|
s
|
||||||
@@ -128,12 +128,12 @@ Shift/reduce conflict on token B:
|
|||||||
input.y:6.4: warning: rule useless in parser due to conflicts [-Wother]
|
input.y:6.4: warning: rule useless in parser due to conflicts [-Wother]
|
||||||
]],
|
]],
|
||||||
[[input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
|
[[input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
|
||||||
Shift/reduce conflict on token B:
|
input.y: warning: shift/reduce conflict on token B [-Wcounterexamples]
|
||||||
Example A . B C
|
Example A . B C
|
||||||
Shift derivation s -> [ ac -> [ A ac -> [ b -> [ . B ] ] C ] ]
|
Shift derivation s -> [ ac -> [ A ac -> [ b -> [ . B ] ] C ] ]
|
||||||
Reduce derivation s -> [ a -> [ A . ] bc -> [ B C ] ]
|
Reduce derivation s -> [ a -> [ A . ] bc -> [ B C ] ]
|
||||||
|
|
||||||
Shift/reduce conflict on token B:
|
input.y: warning: shift/reduce conflict on token B [-Wcounterexamples]
|
||||||
Example A A . B B C C
|
Example A A . B B C C
|
||||||
Shift derivation s -> [ ac -> [ A ac -> [ A ac -> [ b -> [ . b -> [ B B ] ] ] C ] C ] ]
|
Shift derivation s -> [ ac -> [ A ac -> [ A ac -> [ b -> [ . b -> [ B B ] ] ] C ] C ] ]
|
||||||
Reduce derivation s -> [ a -> [ A a -> [ A . ] ] bc -> [ B bc -> [ B C ] C ] ]
|
Reduce derivation s -> [ a -> [ A a -> [ A . ] ] bc -> [ B bc -> [ B C ] C ] ]
|
||||||
@@ -162,7 +162,7 @@ xby: B | X xby Y;
|
|||||||
|
|
||||||
AT_BISON_CHECK_CEX(
|
AT_BISON_CHECK_CEX(
|
||||||
[[input.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr]
|
[[input.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr]
|
||||||
Shift/reduce conflict on token B:
|
input.y: warning: shift/reduce conflict on token B [-Wcounterexamples]
|
||||||
Example A . B
|
Example A . B
|
||||||
Shift derivation
|
Shift derivation
|
||||||
s
|
s
|
||||||
@@ -174,7 +174,7 @@ Shift/reduce conflict on token B:
|
|||||||
`-> A x `-> B y
|
`-> A x `-> B y
|
||||||
`-> . `-> %empty
|
`-> . `-> %empty
|
||||||
|
|
||||||
Shift/reduce conflict on token B:
|
input.y: warning: shift/reduce conflict on token B [-Wcounterexamples]
|
||||||
First example A X . B Y $end
|
First example A X . B Y $end
|
||||||
Shift derivation
|
Shift derivation
|
||||||
$accept
|
$accept
|
||||||
@@ -194,12 +194,12 @@ Shift/reduce conflict on token B:
|
|||||||
input.y:5.4-9: warning: rule useless in parser due to conflicts [-Wother]
|
input.y:5.4-9: warning: rule useless in parser due to conflicts [-Wother]
|
||||||
]],
|
]],
|
||||||
[[input.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr]
|
[[input.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr]
|
||||||
Shift/reduce conflict on token B:
|
input.y: warning: shift/reduce conflict on token B [-Wcounterexamples]
|
||||||
Example A . B
|
Example A . B
|
||||||
Shift derivation s -> [ A xby -> [ . B ] ]
|
Shift derivation s -> [ A xby -> [ . B ] ]
|
||||||
Reduce derivation s -> [ ax -> [ A x -> [ . ] ] by -> [ B y -> [ ] ] ]
|
Reduce derivation s -> [ ax -> [ A x -> [ . ] ] by -> [ B y -> [ ] ] ]
|
||||||
|
|
||||||
Shift/reduce conflict on token B:
|
input.y: warning: shift/reduce conflict on token B [-Wcounterexamples]
|
||||||
First example A X . B Y $end
|
First example A X . B Y $end
|
||||||
Shift derivation $accept -> [ s -> [ A xby -> [ X xby -> [ . B ] Y ] ] $end ]
|
Shift derivation $accept -> [ s -> [ A xby -> [ X xby -> [ . B ] Y ] ] $end ]
|
||||||
Second example A X . B y $end
|
Second example A X . B y $end
|
||||||
@@ -229,7 +229,7 @@ bc: B C;
|
|||||||
|
|
||||||
AT_BISON_CHECK_CEX(
|
AT_BISON_CHECK_CEX(
|
||||||
[[input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
|
[[input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
|
||||||
Shift/reduce conflict on token C:
|
input.y: warning: shift/reduce conflict on token C [-Wcounterexamples]
|
||||||
First example B . C $end
|
First example B . C $end
|
||||||
Shift derivation
|
Shift derivation
|
||||||
$accept
|
$accept
|
||||||
@@ -248,7 +248,7 @@ Shift/reduce conflict on token C:
|
|||||||
input.y:6.4: warning: rule useless in parser due to conflicts [-Wother]
|
input.y:6.4: warning: rule useless in parser due to conflicts [-Wother]
|
||||||
]],
|
]],
|
||||||
[[input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
|
[[input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
|
||||||
Shift/reduce conflict on token C:
|
input.y: warning: shift/reduce conflict on token C [-Wcounterexamples]
|
||||||
First example B . C $end
|
First example B . C $end
|
||||||
Shift derivation $accept -> [ g -> [ x -> [ bc -> [ B . C ] ] ] $end ]
|
Shift derivation $accept -> [ g -> [ x -> [ bc -> [ B . C ] ] ] $end ]
|
||||||
Second example B . C D $end
|
Second example B . C D $end
|
||||||
@@ -276,7 +276,7 @@ y: A A B;
|
|||||||
|
|
||||||
AT_BISON_CHECK_CEX(
|
AT_BISON_CHECK_CEX(
|
||||||
[[input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
|
[[input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
|
||||||
Shift/reduce conflict on token A:
|
input.y: warning: shift/reduce conflict on token A [-Wcounterexamples]
|
||||||
First example A . A B $end
|
First example A . A B $end
|
||||||
Shift derivation
|
Shift derivation
|
||||||
$accept
|
$accept
|
||||||
@@ -295,7 +295,7 @@ Shift/reduce conflict on token A:
|
|||||||
|
|
||||||
]],
|
]],
|
||||||
[[input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
|
[[input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
|
||||||
Shift/reduce conflict on token A:
|
input.y: warning: shift/reduce conflict on token A [-Wcounterexamples]
|
||||||
First example A . A B $end
|
First example A . A B $end
|
||||||
Shift derivation $accept -> [ s -> [ t -> [ y -> [ A . A B ] ] ] $end ]
|
Shift derivation $accept -> [ s -> [ t -> [ y -> [ A . A B ] ] ] $end ]
|
||||||
Second example A . A $end
|
Second example A . A $end
|
||||||
@@ -327,7 +327,7 @@ y: Y;
|
|||||||
|
|
||||||
AT_BISON_CHECK_CEX(
|
AT_BISON_CHECK_CEX(
|
||||||
[[input.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr]
|
[[input.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr]
|
||||||
Shift/reduce conflict on token A:
|
input.y: warning: shift/reduce conflict on token A [-Wcounterexamples]
|
||||||
Example b . A X X Y
|
Example b . A X X Y
|
||||||
Shift derivation
|
Shift derivation
|
||||||
a
|
a
|
||||||
@@ -340,7 +340,7 @@ Shift/reduce conflict on token A:
|
|||||||
`-> b . `-> A x xy
|
`-> b . `-> A x xy
|
||||||
`-> X `-> X Y
|
`-> X `-> X Y
|
||||||
|
|
||||||
Shift/reduce conflict on token X:
|
input.y: warning: shift/reduce conflict on token X [-Wcounterexamples]
|
||||||
First example A X . X
|
First example A X . X
|
||||||
Shift derivation
|
Shift derivation
|
||||||
a
|
a
|
||||||
@@ -357,12 +357,12 @@ input.y:4.4: warning: rule useless in parser due to conflicts [-Wother]
|
|||||||
input.y:8.4: warning: rule useless in parser due to conflicts [-Wother]
|
input.y:8.4: warning: rule useless in parser due to conflicts [-Wother]
|
||||||
]],
|
]],
|
||||||
[[input.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr]
|
[[input.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr]
|
||||||
Shift/reduce conflict on token A:
|
input.y: warning: shift/reduce conflict on token A [-Wcounterexamples]
|
||||||
Example b . A X X Y
|
Example b . A X X Y
|
||||||
Shift derivation a -> [ s -> [ b . xx -> [ A X X ] y -> [ Y ] ] ]
|
Shift derivation a -> [ s -> [ b . xx -> [ A X X ] y -> [ Y ] ] ]
|
||||||
Reduce derivation a -> [ r -> [ b . ] t -> [ A x -> [ X ] xy -> [ X Y ] ] ]
|
Reduce derivation a -> [ r -> [ b . ] t -> [ A x -> [ X ] xy -> [ X Y ] ] ]
|
||||||
|
|
||||||
Shift/reduce conflict on token X:
|
input.y: warning: shift/reduce conflict on token X [-Wcounterexamples]
|
||||||
First example A X . X
|
First example A X . X
|
||||||
Shift derivation a -> [ t -> [ A xx -> [ X . X ] ] ]
|
Shift derivation a -> [ t -> [ A xx -> [ X . X ] ] ]
|
||||||
Second example X . X xy
|
Second example X . X xy
|
||||||
@@ -472,7 +472,7 @@ i: X | i J K;
|
|||||||
|
|
||||||
AT_BISON_CHECK_CEX(
|
AT_BISON_CHECK_CEX(
|
||||||
[[input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
|
[[input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
|
||||||
Shift/reduce conflict on token J:
|
input.y: warning: shift/reduce conflict on token J [-Wcounterexamples]
|
||||||
time limit exceeded: XXX
|
time limit exceeded: XXX
|
||||||
First example H i . J K $end
|
First example H i . J K $end
|
||||||
Shift derivation
|
Shift derivation
|
||||||
@@ -490,7 +490,7 @@ time limit exceeded: XXX
|
|||||||
input.y:4.4-6: warning: rule useless in parser due to conflicts [-Wother]
|
input.y:4.4-6: warning: rule useless in parser due to conflicts [-Wother]
|
||||||
]],
|
]],
|
||||||
[[input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
|
[[input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
|
||||||
Shift/reduce conflict on token J:
|
input.y: warning: shift/reduce conflict on token J [-Wcounterexamples]
|
||||||
time limit exceeded: XXX
|
time limit exceeded: XXX
|
||||||
First example H i . J K $end
|
First example H i . J K $end
|
||||||
Shift derivation $accept -> [ a -> [ H i -> [ i . J K ] ] $end ]
|
Shift derivation $accept -> [ a -> [ H i -> [ i . J K ] ] $end ]
|
||||||
@@ -522,7 +522,7 @@ b: A B C | A B D;
|
|||||||
|
|
||||||
AT_BISON_CHECK_CEX(
|
AT_BISON_CHECK_CEX(
|
||||||
[[input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
|
[[input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
|
||||||
Shift/reduce conflict on token B:
|
input.y: warning: shift/reduce conflict on token B [-Wcounterexamples]
|
||||||
Example N A . B C
|
Example N A . B C
|
||||||
Shift derivation
|
Shift derivation
|
||||||
s
|
s
|
||||||
@@ -535,7 +535,7 @@ Shift/reduce conflict on token B:
|
|||||||
`-> N a B
|
`-> N a B
|
||||||
`-> A .
|
`-> A .
|
||||||
|
|
||||||
Shift/reduce conflict on token B:
|
input.y: warning: shift/reduce conflict on token B [-Wcounterexamples]
|
||||||
Example N N A . B D C
|
Example N N A . B D C
|
||||||
Shift derivation
|
Shift derivation
|
||||||
s
|
s
|
||||||
@@ -553,12 +553,12 @@ Shift/reduce conflict on token B:
|
|||||||
input.y:5.4: warning: rule useless in parser due to conflicts [-Wother]
|
input.y:5.4: warning: rule useless in parser due to conflicts [-Wother]
|
||||||
]],
|
]],
|
||||||
[[input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
|
[[input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
|
||||||
Shift/reduce conflict on token B:
|
input.y: warning: shift/reduce conflict on token B [-Wcounterexamples]
|
||||||
Example N A . B C
|
Example N A . B C
|
||||||
Shift derivation s -> [ n -> [ N b -> [ A . B C ] ] ]
|
Shift derivation s -> [ n -> [ N b -> [ A . B C ] ] ]
|
||||||
Reduce derivation s -> [ n -> [ N a -> [ A . ] B ] C ]
|
Reduce derivation s -> [ n -> [ N a -> [ A . ] B ] C ]
|
||||||
|
|
||||||
Shift/reduce conflict on token B:
|
input.y: warning: shift/reduce conflict on token B [-Wcounterexamples]
|
||||||
Example N N A . B D C
|
Example N N A . B D C
|
||||||
Shift derivation s -> [ n -> [ N n -> [ N b -> [ A . B D ] ] C ] ]
|
Shift derivation s -> [ n -> [ N n -> [ N b -> [ A . B D ] ] C ] ]
|
||||||
Reduce derivation s -> [ n -> [ N n -> [ N a -> [ A . ] B ] D ] C ]
|
Reduce derivation s -> [ n -> [ N n -> [ N a -> [ A . ] B ] D ] C ]
|
||||||
@@ -703,7 +703,7 @@ time limit exceeded: XXX
|
|||||||
`-> c A
|
`-> c A
|
||||||
`-> .
|
`-> .
|
||||||
|
|
||||||
Shift/reduce conflict on token A:
|
input.y: warning: shift/reduce conflict on token A [-Wcounterexamples]
|
||||||
time limit exceeded: XXX
|
time limit exceeded: XXX
|
||||||
First example b c . A
|
First example b c . A
|
||||||
Shift derivation
|
Shift derivation
|
||||||
@@ -742,7 +742,7 @@ input.y: warning: reduce/reduce conflict on token A [-Wcounterexamples]
|
|||||||
`-> c A
|
`-> c A
|
||||||
`-> .
|
`-> .
|
||||||
|
|
||||||
Shift/reduce conflict on token A:
|
input.y: warning: shift/reduce conflict on token A [-Wcounterexamples]
|
||||||
First example b c . A
|
First example b c . A
|
||||||
Shift derivation
|
Shift derivation
|
||||||
a
|
a
|
||||||
@@ -803,7 +803,7 @@ time limit exceeded: XXX
|
|||||||
Second example c . A $end
|
Second example c . A $end
|
||||||
Second derivation $accept -> [ a -> [ c d -> [ c -> [ . ] A ] ] $end ]
|
Second derivation $accept -> [ a -> [ c d -> [ c -> [ . ] A ] ] $end ]
|
||||||
|
|
||||||
Shift/reduce conflict on token A:
|
input.y: warning: shift/reduce conflict on token A [-Wcounterexamples]
|
||||||
time limit exceeded: XXX
|
time limit exceeded: XXX
|
||||||
First example b c . A
|
First example b c . A
|
||||||
Shift derivation a -> [ b d -> [ c . A ] ]
|
Shift derivation a -> [ b d -> [ c . A ] ]
|
||||||
@@ -816,7 +816,7 @@ input.y: warning: reduce/reduce conflict on token A [-Wcounterexamples]
|
|||||||
Second example b c . A $end
|
Second example b c . A $end
|
||||||
Second derivation $accept -> [ a -> [ b d -> [ a -> [ c d -> [ c -> [ . ] A ] ] ] ] $end ]
|
Second derivation $accept -> [ a -> [ b d -> [ a -> [ c d -> [ c -> [ . ] A ] ] ] ] $end ]
|
||||||
|
|
||||||
Shift/reduce conflict on token A:
|
input.y: warning: shift/reduce conflict on token A [-Wcounterexamples]
|
||||||
First example b c . A
|
First example b c . A
|
||||||
Shift derivation a -> [ b d -> [ c . A ] ]
|
Shift derivation a -> [ b d -> [ c . A ] ]
|
||||||
Second example b c . A $end
|
Second example b c . A $end
|
||||||
@@ -857,7 +857,7 @@ i: %empty | i J;
|
|||||||
|
|
||||||
AT_BISON_CHECK_CEX(
|
AT_BISON_CHECK_CEX(
|
||||||
[[input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
|
[[input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
|
||||||
Shift/reduce conflict on token J:
|
input.y: warning: shift/reduce conflict on token J [-Wcounterexamples]
|
||||||
Example H i J . J J
|
Example H i J . J J
|
||||||
Shift derivation
|
Shift derivation
|
||||||
s
|
s
|
||||||
@@ -872,7 +872,7 @@ Shift/reduce conflict on token J:
|
|||||||
input.y:5.13-15: warning: rule useless in parser due to conflicts [-Wother]
|
input.y:5.13-15: warning: rule useless in parser due to conflicts [-Wother]
|
||||||
]],
|
]],
|
||||||
[[input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
|
[[input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
|
||||||
Shift/reduce conflict on token J:
|
input.y: warning: shift/reduce conflict on token J [-Wcounterexamples]
|
||||||
Example H i J . J J
|
Example H i J . J J
|
||||||
Shift derivation s -> [ a -> [ H i J . J ] J ]
|
Shift derivation s -> [ a -> [ H i J . J ] J ]
|
||||||
Reduce derivation s -> [ a -> [ H i -> [ i J . ] J J ] ]
|
Reduce derivation s -> [ a -> [ H i -> [ i J . ] J J ] ]
|
||||||
@@ -903,7 +903,7 @@ d: D;
|
|||||||
|
|
||||||
AT_BISON_CHECK_CEX(
|
AT_BISON_CHECK_CEX(
|
||||||
[[input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
|
[[input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
|
||||||
Shift/reduce conflict on token D:
|
input.y: warning: shift/reduce conflict on token D [-Wcounterexamples]
|
||||||
Example A a . D
|
Example A a . D
|
||||||
Shift derivation
|
Shift derivation
|
||||||
s
|
s
|
||||||
@@ -918,7 +918,7 @@ Shift/reduce conflict on token D:
|
|||||||
|
|
||||||
]],
|
]],
|
||||||
[[input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
|
[[input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
|
||||||
Shift/reduce conflict on token D:
|
input.y: warning: shift/reduce conflict on token D [-Wcounterexamples]
|
||||||
Example A a . D
|
Example A a . D
|
||||||
Shift derivation s -> [ A a d -> [ . D ] ]
|
Shift derivation s -> [ A a d -> [ . D ] ]
|
||||||
Reduce derivation s -> [ A a a -> [ b -> [ c -> [ . ] ] ] d -> [ D ] ]
|
Reduce derivation s -> [ A a a -> [ b -> [ c -> [ . ] ] ] d -> [ D ] ]
|
||||||
@@ -947,7 +947,7 @@ d: D;
|
|||||||
|
|
||||||
AT_BISON_CHECK_CEX(
|
AT_BISON_CHECK_CEX(
|
||||||
[[input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
|
[[input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
|
||||||
Shift/reduce conflict on token D:
|
input.y: warning: shift/reduce conflict on token D [-Wcounterexamples]
|
||||||
First example A a . D $end
|
First example A a . D $end
|
||||||
Shift derivation
|
Shift derivation
|
||||||
$accept
|
$accept
|
||||||
@@ -965,7 +965,7 @@ Shift/reduce conflict on token D:
|
|||||||
|
|
||||||
]],
|
]],
|
||||||
[[input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
|
[[input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
|
||||||
Shift/reduce conflict on token D:
|
input.y: warning: shift/reduce conflict on token D [-Wcounterexamples]
|
||||||
First example A a . D $end
|
First example A a . D $end
|
||||||
Shift derivation $accept -> [ s -> [ A a d -> [ . D ] ] $end ]
|
Shift derivation $accept -> [ s -> [ A a d -> [ . D ] ] $end ]
|
||||||
Second example A a . D E $end
|
Second example A a . D E $end
|
||||||
|
|||||||
@@ -535,7 +535,7 @@ exp
|
|||||||
| exp "+" exp
|
| exp "+" exp
|
||||||
| "num"
|
| "num"
|
||||||
]],
|
]],
|
||||||
[1],
|
[1],
|
||||||
[[input.y: <error>error:</error> shift/reduce conflicts: 4 found, 0 expected
|
[[input.y: <error>error:</error> shift/reduce conflicts: 4 found, 0 expected
|
||||||
input.y: <warning>warning:</warning> shift/reduce conflict on token "+" [<warning>-Wcounterexamples</warning>]
|
input.y: <warning>warning:</warning> shift/reduce conflict on token "+" [<warning>-Wcounterexamples</warning>]
|
||||||
Example <cex-0><cex-leaf>exp</cex-leaf> <cex-leaf>"+"</cex-leaf><cex-1> <cex-leaf>exp</cex-leaf> <cex-dot>•</cex-dot> <cex-leaf>"+"</cex-leaf> <cex-leaf>exp</cex-leaf></cex-1></cex-0>
|
Example <cex-0><cex-leaf>exp</cex-leaf> <cex-leaf>"+"</cex-leaf><cex-1> <cex-leaf>exp</cex-leaf> <cex-dot>•</cex-dot> <cex-leaf>"+"</cex-leaf> <cex-leaf>exp</cex-leaf></cex-1></cex-0>
|
||||||
@@ -547,7 +547,7 @@ Shift/reduce conflict on token "+":
|
|||||||
Reduce derivation
|
Reduce derivation
|
||||||
<cex-0><cex-step>exp</cex-step></cex-0>
|
<cex-0><cex-step>exp</cex-step></cex-0>
|
||||||
<cex-0><cex-step>↳ <cex-1><cex-step>exp</cex-step></cex-1><cex-leaf> "+"</cex-leaf><cex-leaf> exp</cex-leaf></cex-step></cex-0>
|
<cex-0><cex-step>↳ <cex-1><cex-step>exp</cex-step></cex-1><cex-leaf> "+"</cex-leaf><cex-leaf> exp</cex-leaf></cex-step></cex-0>
|
||||||
<cex-1><cex-step> ↳ <cex-leaf>exp</cex-leaf><cex-leaf> "+"</cex-leaf><cex-leaf> exp</cex-leaf><cex-dot> •</cex-dot></cex-step></cex-1>
|
<cex-1><cex-step> ↳ <cex-leaf>exp</cex-leaf><cex-leaf> "+"</cex-leaf><cex-leaf> exp</cex-leaf><cex-dot> •</cex-dot></cex-step></cex-1>
|
||||||
|
|
||||||
input.y: <warning>warning:</warning> shift/reduce conflict on token "else" [<warning>-Wcounterexamples</warning>]
|
input.y: <warning>warning:</warning> shift/reduce conflict on token "else" [<warning>-Wcounterexamples</warning>]
|
||||||
Example <cex-0><cex-leaf>"if"</cex-leaf> <cex-leaf>exp</cex-leaf> <cex-leaf>"then"</cex-leaf><cex-1> <cex-leaf>"if"</cex-leaf> <cex-leaf>exp</cex-leaf> <cex-leaf>"then"</cex-leaf> <cex-leaf>exp</cex-leaf> <cex-dot>•</cex-dot> <cex-leaf>"else"</cex-leaf> <cex-leaf>exp</cex-leaf></cex-1></cex-0>
|
Example <cex-0><cex-leaf>"if"</cex-leaf> <cex-leaf>exp</cex-leaf> <cex-leaf>"then"</cex-leaf><cex-1> <cex-leaf>"if"</cex-leaf> <cex-leaf>exp</cex-leaf> <cex-leaf>"then"</cex-leaf> <cex-leaf>exp</cex-leaf> <cex-dot>•</cex-dot> <cex-leaf>"else"</cex-leaf> <cex-leaf>exp</cex-leaf></cex-1></cex-0>
|
||||||
@@ -559,7 +559,7 @@ Shift/reduce conflict on token "else":
|
|||||||
Reduce derivation
|
Reduce derivation
|
||||||
<cex-0><cex-step>exp</cex-step></cex-0>
|
<cex-0><cex-step>exp</cex-step></cex-0>
|
||||||
<cex-0><cex-step>↳ <cex-leaf>"if"</cex-leaf><cex-leaf> exp</cex-leaf><cex-leaf> "then"</cex-leaf><cex-1><cex-step> exp</cex-step></cex-1><cex-leaf> "else"</cex-leaf><cex-leaf> exp</cex-leaf></cex-step></cex-0>
|
<cex-0><cex-step>↳ <cex-leaf>"if"</cex-leaf><cex-leaf> exp</cex-leaf><cex-leaf> "then"</cex-leaf><cex-1><cex-step> exp</cex-step></cex-1><cex-leaf> "else"</cex-leaf><cex-leaf> exp</cex-leaf></cex-step></cex-0>
|
||||||
<cex-1><cex-step> ↳ <cex-leaf>"if"</cex-leaf><cex-leaf> exp</cex-leaf><cex-leaf> "then"</cex-leaf><cex-leaf> exp</cex-leaf><cex-dot> •</cex-dot></cex-step></cex-1>
|
<cex-1><cex-step> ↳ <cex-leaf>"if"</cex-leaf><cex-leaf> exp</cex-leaf><cex-leaf> "then"</cex-leaf><cex-leaf> exp</cex-leaf><cex-dot> •</cex-dot></cex-step></cex-1>
|
||||||
|
|
||||||
input.y: <warning>warning:</warning> shift/reduce conflict on token "+" [<warning>-Wcounterexamples</warning>]
|
input.y: <warning>warning:</warning> shift/reduce conflict on token "+" [<warning>-Wcounterexamples</warning>]
|
||||||
Example <cex-0><cex-leaf>"if"</cex-leaf> <cex-leaf>exp</cex-leaf> <cex-leaf>"then"</cex-leaf><cex-1> <cex-leaf>exp</cex-leaf> <cex-dot>•</cex-dot> <cex-leaf>"+"</cex-leaf> <cex-leaf>exp</cex-leaf></cex-1></cex-0>
|
Example <cex-0><cex-leaf>"if"</cex-leaf> <cex-leaf>exp</cex-leaf> <cex-leaf>"then"</cex-leaf><cex-1> <cex-leaf>exp</cex-leaf> <cex-dot>•</cex-dot> <cex-leaf>"+"</cex-leaf> <cex-leaf>exp</cex-leaf></cex-1></cex-0>
|
||||||
@@ -571,7 +571,7 @@ Shift/reduce conflict on token "+":
|
|||||||
Reduce derivation
|
Reduce derivation
|
||||||
<cex-0><cex-step>exp</cex-step></cex-0>
|
<cex-0><cex-step>exp</cex-step></cex-0>
|
||||||
<cex-0><cex-step>↳ <cex-1><cex-step>exp</cex-step></cex-1><cex-leaf> "+"</cex-leaf><cex-leaf> exp</cex-leaf></cex-step></cex-0>
|
<cex-0><cex-step>↳ <cex-1><cex-step>exp</cex-step></cex-1><cex-leaf> "+"</cex-leaf><cex-leaf> exp</cex-leaf></cex-step></cex-0>
|
||||||
<cex-1><cex-step> ↳ <cex-leaf>"if"</cex-leaf><cex-leaf> exp</cex-leaf><cex-leaf> "then"</cex-leaf><cex-leaf> exp</cex-leaf><cex-dot> •</cex-dot></cex-step></cex-1>
|
<cex-1><cex-step> ↳ <cex-leaf>"if"</cex-leaf><cex-leaf> exp</cex-leaf><cex-leaf> "then"</cex-leaf><cex-leaf> exp</cex-leaf><cex-dot> •</cex-dot></cex-step></cex-1>
|
||||||
|
|
||||||
input.y: <warning>warning:</warning> shift/reduce conflict on token "+" [<warning>-Wcounterexamples</warning>]
|
input.y: <warning>warning:</warning> shift/reduce conflict on token "+" [<warning>-Wcounterexamples</warning>]
|
||||||
Example <cex-0><cex-leaf>"if"</cex-leaf> <cex-leaf>exp</cex-leaf> <cex-leaf>"then"</cex-leaf> <cex-leaf>exp</cex-leaf> <cex-leaf>"else"</cex-leaf><cex-1> <cex-leaf>exp</cex-leaf> <cex-dot>•</cex-dot> <cex-leaf>"+"</cex-leaf> <cex-leaf>exp</cex-leaf></cex-1></cex-0>
|
Example <cex-0><cex-leaf>"if"</cex-leaf> <cex-leaf>exp</cex-leaf> <cex-leaf>"then"</cex-leaf> <cex-leaf>exp</cex-leaf> <cex-leaf>"else"</cex-leaf><cex-1> <cex-leaf>exp</cex-leaf> <cex-dot>•</cex-dot> <cex-leaf>"+"</cex-leaf> <cex-leaf>exp</cex-leaf></cex-1></cex-0>
|
||||||
|
|||||||
@@ -1537,7 +1537,7 @@ exp
|
|||||||
AT_CHECK([LC_ALL="$locale" bison -fno-caret -o input.cc -rall -Wcex --graph=input.gv --xml input.y], [], [],
|
AT_CHECK([LC_ALL="$locale" bison -fno-caret -o input.cc -rall -Wcex --graph=input.gv --xml input.y], [], [],
|
||||||
[[input.y: warning: 3 shift/reduce conflicts [-Wconflicts-sr]
|
[[input.y: warning: 3 shift/reduce conflicts [-Wconflicts-sr]
|
||||||
input.y: warning: 3 reduce/reduce conflicts [-Wconflicts-rr]
|
input.y: warning: 3 reduce/reduce conflicts [-Wconflicts-rr]
|
||||||
Shift/reduce conflict on token "⊕":
|
input.y: warning: shift/reduce conflict on token "⊕" [-Wcounterexamples]
|
||||||
Example exp "+" exp • "⊕" exp
|
Example exp "+" exp • "⊕" exp
|
||||||
Shift derivation
|
Shift derivation
|
||||||
exp
|
exp
|
||||||
@@ -1557,7 +1557,7 @@ input.y: warning: reduce/reduce conflict on tokens $end, "+", "⊕" [-Wcounterex
|
|||||||
exp
|
exp
|
||||||
↳ exp "+" exp •
|
↳ exp "+" exp •
|
||||||
|
|
||||||
Shift/reduce conflict on token "⊕":
|
input.y: warning: shift/reduce conflict on token "⊕" [-Wcounterexamples]
|
||||||
Example exp "+" exp • "⊕" exp
|
Example exp "+" exp • "⊕" exp
|
||||||
Shift derivation
|
Shift derivation
|
||||||
exp
|
exp
|
||||||
@@ -1568,7 +1568,7 @@ Shift/reduce conflict on token "⊕":
|
|||||||
↳ exp "⊕" exp
|
↳ exp "⊕" exp
|
||||||
↳ exp "+" exp •
|
↳ exp "+" exp •
|
||||||
|
|
||||||
Shift/reduce conflict on token "⊕":
|
input.y: warning: shift/reduce conflict on token "⊕" [-Wcounterexamples]
|
||||||
Example exp "⊕" exp • "⊕" exp
|
Example exp "⊕" exp • "⊕" exp
|
||||||
Shift derivation
|
Shift derivation
|
||||||
exp
|
exp
|
||||||
@@ -1579,7 +1579,7 @@ Shift/reduce conflict on token "⊕":
|
|||||||
↳ exp "⊕" exp
|
↳ exp "⊕" exp
|
||||||
↳ exp "⊕" exp •
|
↳ exp "⊕" exp •
|
||||||
|
|
||||||
Shift/reduce conflict on token "+":
|
input.y: warning: shift/reduce conflict on token "+" [-Wcounterexamples]
|
||||||
Example exp "⊕" exp • "+" exp
|
Example exp "⊕" exp • "+" exp
|
||||||
Shift derivation
|
Shift derivation
|
||||||
exp
|
exp
|
||||||
@@ -1590,7 +1590,7 @@ Shift/reduce conflict on token "+":
|
|||||||
↳ exp "+" exp
|
↳ exp "+" exp
|
||||||
↳ exp "⊕" exp •
|
↳ exp "⊕" exp •
|
||||||
|
|
||||||
Shift/reduce conflict on token "+":
|
input.y: warning: shift/reduce conflict on token "+" [-Wcounterexamples]
|
||||||
Example exp "⊕" exp • "+" exp
|
Example exp "⊕" exp • "+" exp
|
||||||
Shift derivation
|
Shift derivation
|
||||||
exp
|
exp
|
||||||
@@ -1745,7 +1745,7 @@ State 7
|
|||||||
|
|
||||||
Conflict between rule 2 and token "+" resolved as reduce (%left "+").
|
Conflict between rule 2 and token "+" resolved as reduce (%left "+").
|
||||||
|
|
||||||
Shift/reduce conflict on token "⊕":
|
shift/reduce conflict on token "⊕":
|
||||||
2 exp: exp "+" exp •
|
2 exp: exp "+" exp •
|
||||||
1 exp: exp • "⊕" exp
|
1 exp: exp • "⊕" exp
|
||||||
Example exp "+" exp • "⊕" exp
|
Example exp "+" exp • "⊕" exp
|
||||||
@@ -1769,7 +1769,7 @@ State 7
|
|||||||
exp
|
exp
|
||||||
↳ exp "+" exp •
|
↳ exp "+" exp •
|
||||||
|
|
||||||
Shift/reduce conflict on token "⊕":
|
shift/reduce conflict on token "⊕":
|
||||||
3 exp: exp "+" exp •
|
3 exp: exp "+" exp •
|
||||||
1 exp: exp • "⊕" exp
|
1 exp: exp • "⊕" exp
|
||||||
Example exp "+" exp • "⊕" exp
|
Example exp "+" exp • "⊕" exp
|
||||||
@@ -1798,7 +1798,7 @@ State 8
|
|||||||
"⊕" [reduce using rule 1 (exp)]
|
"⊕" [reduce using rule 1 (exp)]
|
||||||
$default reduce using rule 1 (exp)
|
$default reduce using rule 1 (exp)
|
||||||
|
|
||||||
Shift/reduce conflict on token "⊕":
|
shift/reduce conflict on token "⊕":
|
||||||
1 exp: exp "⊕" exp •
|
1 exp: exp "⊕" exp •
|
||||||
1 exp: exp • "⊕" exp
|
1 exp: exp • "⊕" exp
|
||||||
Example exp "⊕" exp • "⊕" exp
|
Example exp "⊕" exp • "⊕" exp
|
||||||
@@ -1811,7 +1811,7 @@ State 8
|
|||||||
↳ exp "⊕" exp
|
↳ exp "⊕" exp
|
||||||
↳ exp "⊕" exp •
|
↳ exp "⊕" exp •
|
||||||
|
|
||||||
Shift/reduce conflict on token "+":
|
shift/reduce conflict on token "+":
|
||||||
1 exp: exp "⊕" exp •
|
1 exp: exp "⊕" exp •
|
||||||
2 exp: exp • "+" exp
|
2 exp: exp • "+" exp
|
||||||
Example exp "⊕" exp • "+" exp
|
Example exp "⊕" exp • "+" exp
|
||||||
@@ -1824,7 +1824,7 @@ State 8
|
|||||||
↳ exp "+" exp
|
↳ exp "+" exp
|
||||||
↳ exp "⊕" exp •
|
↳ exp "⊕" exp •
|
||||||
|
|
||||||
Shift/reduce conflict on token "+":
|
shift/reduce conflict on token "+":
|
||||||
1 exp: exp "⊕" exp •
|
1 exp: exp "⊕" exp •
|
||||||
3 exp: exp • "+" exp
|
3 exp: exp • "+" exp
|
||||||
Example exp "⊕" exp • "+" exp
|
Example exp "⊕" exp • "+" exp
|
||||||
|
|||||||
Reference in New Issue
Block a user