cex: don't issue an empty line between counterexamples

Now that we use complain, the "sections" are clearer.

* src/counterexample.c (print_counterexample): Use the empty line only
in reports.
* tests/counterexample.at, tests/diagnostics.at, tests/report.at: Adjust.
This commit is contained in:
Akim Demaille
2020-07-19 19:46:41 +02:00
parent ea138cd1f1
commit 815a76f558
4 changed files with 3 additions and 67 deletions

View File

@@ -136,7 +136,8 @@ print_counterexample (const counterexample *cex, FILE *out, const char *prefix)
prefix, cex->shift_reduce ? _("Reduce derivation") : _("Second derivation")); prefix, cex->shift_reduce ? _("Reduce derivation") : _("Second derivation"));
derivation_print (cex->d2, out, prefix); derivation_print (cex->d2, out, prefix);
fputc ('\n', out); if (out != stderr)
putc ('\n', out);
} }
/* /*
@@ -1258,7 +1259,7 @@ counterexample_report_shift_reduce (state_item_number itm1, state_item_number it
fprintf (out, "%s\n", _(":")); fprintf (out, "%s\n", _(":"));
} }
// In the report, print the items. // In the report, print the items.
if (*prefix || trace_flag & trace_cex) if (out != stderr || trace_flag & trace_cex)
{ {
print_state_item (&state_items[itm1], out, prefix); print_state_item (&state_items[itm1], out, prefix);
print_state_item (&state_items[itm2], out, prefix); print_state_item (&state_items[itm2], out, prefix);

View File

@@ -64,7 +64,6 @@ input.y: warning: shift/reduce conflict on token B [-Wcounterexamples]
s s
`-> a x `-> a x
`-> A . `-> B C `-> A . `-> B C
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]
@@ -72,7 +71,6 @@ 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 ] ]
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]
]]) ]])
@@ -108,7 +106,6 @@ input.y: warning: shift/reduce conflict on token B [-Wcounterexamples]
s s
`-> a bc `-> a bc
`-> A . `-> B C `-> A . `-> B C
input.y: warning: shift/reduce conflict on token B [-Wcounterexamples] 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
@@ -124,7 +121,6 @@ input.y: warning: shift/reduce conflict on token B [-Wcounterexamples]
`-> a bc `-> a bc
`-> A a `-> B bc C `-> A a `-> B bc C
`-> A . `-> B C `-> A . `-> B 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]
@@ -132,12 +128,10 @@ 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 ] ]
input.y: warning: shift/reduce conflict on token B [-Wcounterexamples] 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 ] ]
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]
]]) ]])
@@ -173,7 +167,6 @@ input.y: warning: shift/reduce conflict on token B [-Wcounterexamples]
`-> ax by `-> ax by
`-> A x `-> B y `-> A x `-> B y
`-> . `-> %empty `-> . `-> %empty
input.y: warning: shift/reduce conflict on token B [-Wcounterexamples] 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
@@ -190,7 +183,6 @@ input.y: warning: shift/reduce conflict on token B [-Wcounterexamples]
`-> A x `-> B y `-> A x `-> B y
`-> X x `-> X x
`-> . `-> .
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]
@@ -198,13 +190,11 @@ 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 -> [ ] ] ]
input.y: warning: shift/reduce conflict on token B [-Wcounterexamples] 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
Reduce derivation $accept -> [ s -> [ ax -> [ A x -> [ X x -> [ . ] ] ] by -> [ B y ] ] $end ] Reduce derivation $accept -> [ s -> [ ax -> [ A x -> [ X x -> [ . ] ] ] by -> [ B y ] ] $end ]
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]
]]) ]])
@@ -244,7 +234,6 @@ input.y: warning: shift/reduce conflict on token C [-Wcounterexamples]
`-> x `-> x
`-> b cd `-> b cd
`-> B . `-> C D `-> B . `-> C D
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]
@@ -253,7 +242,6 @@ input.y: warning: shift/reduce conflict on token C [-Wcounterexamples]
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
Reduce derivation $accept -> [ g -> [ x -> [ b -> [ B . ] cd -> [ C D ] ] ] $end ] Reduce derivation $accept -> [ g -> [ x -> [ b -> [ B . ] cd -> [ C D ] ] ] $end ]
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]
]]) ]])
@@ -292,7 +280,6 @@ input.y: warning: shift/reduce conflict on token A [-Wcounterexamples]
`-> t `-> x `-> t `-> x
`-> x `-> A `-> x `-> A
`-> A . `-> A .
]], ]],
[[input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr] [[input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
input.y: warning: shift/reduce conflict on token A [-Wcounterexamples] input.y: warning: shift/reduce conflict on token A [-Wcounterexamples]
@@ -300,7 +287,6 @@ input.y: warning: shift/reduce conflict on token A [-Wcounterexamples]
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
Reduce derivation $accept -> [ s -> [ s -> [ t -> [ x -> [ A . ] ] ] t -> [ x -> [ A ] ] ] $end ] Reduce derivation $accept -> [ s -> [ s -> [ t -> [ x -> [ A . ] ] ] t -> [ x -> [ A ] ] ] $end ]
]]) ]])
AT_CLEANUP AT_CLEANUP
@@ -339,7 +325,6 @@ input.y: warning: shift/reduce conflict on token A [-Wcounterexamples]
`-> r t `-> r t
`-> b . `-> A x xy `-> b . `-> A x xy
`-> X `-> X Y `-> X `-> X Y
input.y: warning: shift/reduce conflict on token X [-Wcounterexamples] input.y: warning: shift/reduce conflict on token X [-Wcounterexamples]
First example A X . X First example A X . X
Shift derivation Shift derivation
@@ -352,7 +337,6 @@ input.y: warning: shift/reduce conflict on token X [-Wcounterexamples]
a a
`-> x t `-> x t
`-> X . `-> X xy `-> X . `-> X xy
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:8.4: warning: rule useless in parser due to conflicts [-Wother] input.y:8.4: warning: rule useless in parser due to conflicts [-Wother]
]], ]],
@@ -361,13 +345,11 @@ 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 ] ] ]
input.y: warning: shift/reduce conflict on token X [-Wcounterexamples] 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
Reduce derivation a -> [ x -> [ X . ] t -> [ X xy ] ] Reduce derivation a -> [ x -> [ X . ] t -> [ X xy ] ]
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:8.4: warning: rule useless in parser due to conflicts [-Wother] input.y:8.4: warning: rule useless in parser due to conflicts [-Wother]
]]) ]])
@@ -398,7 +380,6 @@ input.y: warning: reduce/reduce conflict on token $end [-Wcounterexamples]
a a
`-> A b `-> A b
`-> b . `-> b .
input.y:4.9: warning: rule useless in parser due to conflicts [-Wother] input.y:4.9: warning: rule useless in parser due to conflicts [-Wother]
]], ]],
[[input.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] [[input.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
@@ -406,7 +387,6 @@ input.y: warning: reduce/reduce conflict on token $end [-Wcounterexamples]
Example A b . Example A b .
First derivation a -> [ A b . ] First derivation a -> [ A b . ]
Second derivation a -> [ A b -> [ b . ] ] Second derivation a -> [ A b -> [ b . ] ]
input.y:4.9: warning: rule useless in parser due to conflicts [-Wother] input.y:4.9: warning: rule useless in parser due to conflicts [-Wother]
]]) ]])
@@ -441,7 +421,6 @@ input.y: warning: reduce/reduce conflict on tokens A, C [-Wcounterexamples]
`-> s $end `-> s $end
`-> B b A `-> B b A
`-> D . `-> D .
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: 2 reduce/reduce conflicts [-Wconflicts-rr] [[input.y: warning: 2 reduce/reduce conflicts [-Wconflicts-rr]
@@ -450,7 +429,6 @@ input.y: warning: reduce/reduce conflict on tokens A, C [-Wcounterexamples]
First derivation $accept -> [ s -> [ a -> [ D . ] A ] $end ] First derivation $accept -> [ s -> [ a -> [ D . ] A ] $end ]
Second example B D . A $end Second example B D . A $end
Second derivation $accept -> [ s -> [ B b -> [ D . ] A ] $end ] Second derivation $accept -> [ s -> [ B b -> [ D . ] A ] $end ]
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]
]]) ]])
@@ -486,7 +464,6 @@ time limit exceeded: XXX
`-> s $end `-> s $end
`-> a J `-> a J
`-> H i . `-> H i .
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]
@@ -496,7 +473,6 @@ time limit exceeded: XXX
Shift derivation $accept -> [ a -> [ H i -> [ i . J K ] ] $end ] Shift derivation $accept -> [ a -> [ H i -> [ i . J K ] ] $end ]
Second example H i . J $end Second example H i . J $end
Reduce derivation $accept -> [ s -> [ a -> [ H i . ] J ] $end ] Reduce derivation $accept -> [ s -> [ a -> [ H i . ] J ] $end ]
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]
]]) ]])
@@ -534,7 +510,6 @@ input.y: warning: shift/reduce conflict on token B [-Wcounterexamples]
`-> n C `-> n C
`-> N a B `-> N a B
`-> A . `-> A .
input.y: warning: shift/reduce conflict on token B [-Wcounterexamples] 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
@@ -549,7 +524,6 @@ input.y: warning: shift/reduce conflict on token B [-Wcounterexamples]
`-> N n D `-> N n D
`-> N a B `-> N a B
`-> A . `-> A .
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]
@@ -557,12 +531,10 @@ 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 ]
input.y: warning: shift/reduce conflict on token B [-Wcounterexamples] 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 ]
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]
]]) ]])
@@ -603,7 +575,6 @@ input.y: warning: reduce/reduce conflict on tokens b, c [-Wcounterexamples]
`-> B `-> %empty `-> B `-> %empty
`-> A b A `-> A b A
`-> . `-> %empty `-> . `-> %empty
input.y: warning: reduce/reduce conflict on tokens b, c [-Wcounterexamples] input.y: warning: reduce/reduce conflict on tokens b, c [-Wcounterexamples]
Example C . c b Example C . c b
First derivation First derivation
@@ -618,19 +589,16 @@ input.y: warning: reduce/reduce conflict on tokens b, c [-Wcounterexamples]
`-> C `-> %empty `-> C `-> %empty
`-> A c A `-> A c A
`-> . `-> %empty `-> . `-> %empty
]], ]],
[[input.y: warning: 4 reduce/reduce conflicts [-Wconflicts-rr] [[input.y: warning: 4 reduce/reduce conflicts [-Wconflicts-rr]
input.y: warning: reduce/reduce conflict on tokens b, c [-Wcounterexamples] input.y: warning: reduce/reduce conflict on tokens b, c [-Wcounterexamples]
Example B . b c Example B . b c
First derivation S -> [ B -> [ A -> [ B . ] b A -> [ ] ] C -> [ A -> [ ] c A -> [ ] ] ] First derivation S -> [ B -> [ A -> [ B . ] b A -> [ ] ] C -> [ A -> [ ] c A -> [ ] ] ]
Second derivation S -> [ B C -> [ A -> [ B -> [ A -> [ . ] b A -> [ ] ] ] c A -> [ ] ] ] Second derivation S -> [ B C -> [ A -> [ B -> [ A -> [ . ] b A -> [ ] ] ] c A -> [ ] ] ]
input.y: warning: reduce/reduce conflict on tokens b, c [-Wcounterexamples] input.y: warning: reduce/reduce conflict on tokens b, c [-Wcounterexamples]
Example C . c b Example C . c b
First derivation S -> [ C -> [ A -> [ C . ] c A -> [ ] ] B -> [ A -> [ ] b A -> [ ] ] ] First derivation S -> [ C -> [ A -> [ C . ] c A -> [ ] ] B -> [ A -> [ ] b A -> [ ] ] ]
Second derivation S -> [ C B -> [ A -> [ C -> [ A -> [ . ] c A -> [ ] ] ] b A -> [ ] ] ] Second derivation S -> [ C B -> [ A -> [ C -> [ A -> [ . ] c A -> [ ] ] ] b A -> [ ] ] ]
]]) ]])
AT_CLEANUP AT_CLEANUP
@@ -666,7 +634,6 @@ input.y: warning: reduce/reduce conflict on token A [-Wcounterexamples]
`-> a $end `-> a $end
`-> c d `-> c d
`-> . `-> c A A `-> . `-> c A A
input.y: warning: reduce/reduce conflict on token A [-Wcounterexamples] input.y: warning: reduce/reduce conflict on token A [-Wcounterexamples]
time limit exceeded: XXX time limit exceeded: XXX
First example b . c A A $end First example b . c A A $end
@@ -684,7 +651,6 @@ time limit exceeded: XXX
`-> b d `-> b d
`-> c A `-> c A
`-> . `-> .
input.y: warning: reduce/reduce conflict on token A [-Wcounterexamples] input.y: warning: reduce/reduce conflict on token A [-Wcounterexamples]
time limit exceeded: XXX time limit exceeded: XXX
First example c . c A A $end First example c . c A A $end
@@ -702,7 +668,6 @@ time limit exceeded: XXX
`-> c d `-> c d
`-> c A `-> c A
`-> . `-> .
input.y: warning: shift/reduce conflict on token A [-Wcounterexamples] 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
@@ -720,7 +685,6 @@ time limit exceeded: XXX
`-> a `-> a
`-> b d `-> b d
`-> . `-> c A A `-> . `-> c A A
input.y: warning: reduce/reduce conflict on token A [-Wcounterexamples] input.y: warning: reduce/reduce conflict on token A [-Wcounterexamples]
First example b c . c A A $end First example b c . c A A $end
First derivation First derivation
@@ -741,7 +705,6 @@ input.y: warning: reduce/reduce conflict on token A [-Wcounterexamples]
`-> c d `-> c d
`-> c A `-> c A
`-> . `-> .
input.y: warning: shift/reduce conflict on token A [-Wcounterexamples] input.y: warning: shift/reduce conflict on token A [-Wcounterexamples]
First example b c . A First example b c . A
Shift derivation Shift derivation
@@ -757,7 +720,6 @@ input.y: warning: shift/reduce conflict on token A [-Wcounterexamples]
`-> c d `-> c d
`-> c A `-> c A
`-> . `-> .
input.y: warning: reduce/reduce conflict on token $end [-Wcounterexamples] input.y: warning: reduce/reduce conflict on token $end [-Wcounterexamples]
Example b d . Example b d .
First derivation First derivation
@@ -767,7 +729,6 @@ input.y: warning: reduce/reduce conflict on token $end [-Wcounterexamples]
a a
`-> b d `-> b d
`-> d . `-> d .
input.y: warning: reduce/reduce conflict on token $end [-Wcounterexamples] input.y: warning: reduce/reduce conflict on token $end [-Wcounterexamples]
Example c d . Example c d .
First derivation First derivation
@@ -777,7 +738,6 @@ input.y: warning: reduce/reduce conflict on token $end [-Wcounterexamples]
a a
`-> c d `-> c d
`-> d . `-> d .
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:6.15: warning: rule useless in parser due to conflicts [-Wother] input.y:6.15: warning: rule useless in parser due to conflicts [-Wother]
]], ]],
@@ -788,50 +748,42 @@ input.y: warning: reduce/reduce conflict on token A [-Wcounterexamples]
First derivation $accept -> [ a -> [ b -> [ . ] d -> [ c A A ] ] $end ] First derivation $accept -> [ a -> [ b -> [ . ] d -> [ c A A ] ] $end ]
Second example . c A A $end Second example . c A A $end
Second derivation $accept -> [ a -> [ c -> [ . ] d -> [ c A A ] ] $end ] Second derivation $accept -> [ a -> [ c -> [ . ] d -> [ c A A ] ] $end ]
input.y: warning: reduce/reduce conflict on token A [-Wcounterexamples] input.y: warning: reduce/reduce conflict on token A [-Wcounterexamples]
time limit exceeded: XXX time limit exceeded: XXX
First example b . c A A $end First example b . c A A $end
First derivation $accept -> [ a -> [ b d -> [ a -> [ b -> [ . ] d -> [ c A A ] ] ] ] $end ] First derivation $accept -> [ a -> [ b d -> [ a -> [ b -> [ . ] d -> [ c A A ] ] ] ] $end ]
Second example b . A $end Second example b . A $end
Second derivation $accept -> [ a -> [ b d -> [ c -> [ . ] A ] ] $end ] Second derivation $accept -> [ a -> [ b d -> [ c -> [ . ] A ] ] $end ]
input.y: warning: reduce/reduce conflict on token A [-Wcounterexamples] input.y: warning: reduce/reduce conflict on token A [-Wcounterexamples]
time limit exceeded: XXX time limit exceeded: XXX
First example c . c A A $end First example c . c A A $end
First derivation $accept -> [ a -> [ c d -> [ a -> [ b -> [ . ] d -> [ c A A ] ] ] ] $end ] First derivation $accept -> [ a -> [ c d -> [ a -> [ b -> [ . ] d -> [ c A A ] ] ] ] $end ]
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 ]
input.y: warning: shift/reduce conflict on token A [-Wcounterexamples] 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 ] ]
Second example b c . c A A $end Second example b c . c A A $end
Reduce derivation $accept -> [ a -> [ b d -> [ a -> [ c d -> [ a -> [ b -> [ . ] d -> [ c A A ] ] ] ] ] ] $end ] Reduce derivation $accept -> [ a -> [ b d -> [ a -> [ c d -> [ a -> [ b -> [ . ] d -> [ c A A ] ] ] ] ] ] $end ]
input.y: warning: reduce/reduce conflict on token A [-Wcounterexamples] input.y: warning: reduce/reduce conflict on token A [-Wcounterexamples]
First example b c . c A A $end First example b c . c A A $end
First derivation $accept -> [ a -> [ b d -> [ a -> [ c d -> [ a -> [ b -> [ . ] d -> [ c A A ] ] ] ] ] ] $end ] First derivation $accept -> [ a -> [ b d -> [ a -> [ c d -> [ a -> [ b -> [ . ] d -> [ c A A ] ] ] ] ] ] $end ]
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 ]
input.y: warning: shift/reduce conflict on token A [-Wcounterexamples] 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
Reduce derivation $accept -> [ a -> [ b d -> [ a -> [ c d -> [ c -> [ . ] A ] ] ] ] $end ] Reduce derivation $accept -> [ a -> [ b d -> [ a -> [ c d -> [ c -> [ . ] A ] ] ] ] $end ]
input.y: warning: reduce/reduce conflict on token $end [-Wcounterexamples] input.y: warning: reduce/reduce conflict on token $end [-Wcounterexamples]
Example b d . Example b d .
First derivation a -> [ b d . ] First derivation a -> [ b d . ]
Second derivation a -> [ b d -> [ d . ] ] Second derivation a -> [ b d -> [ d . ] ]
input.y: warning: reduce/reduce conflict on token $end [-Wcounterexamples] input.y: warning: reduce/reduce conflict on token $end [-Wcounterexamples]
Example c d . Example c d .
First derivation a -> [ c d . ] First derivation a -> [ c d . ]
Second derivation a -> [ c d -> [ d . ] ] Second derivation a -> [ c d -> [ d . ] ]
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:6.15: warning: rule useless in parser due to conflicts [-Wother] input.y:6.15: warning: rule useless in parser due to conflicts [-Wother]
]]) ]])
@@ -868,7 +820,6 @@ input.y: warning: shift/reduce conflict on token J [-Wcounterexamples]
`-> a `-> a
`-> H i J J `-> H i J J
`-> i J . `-> i 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]
@@ -876,7 +827,6 @@ 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 ] ]
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]
]]) ]])
@@ -915,14 +865,12 @@ input.y: warning: shift/reduce conflict on token D [-Wcounterexamples]
`-> b `-> D `-> b `-> D
`-> c `-> c
`-> . `-> .
]], ]],
[[input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr] [[input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
input.y: warning: shift/reduce conflict on token D [-Wcounterexamples] 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 ] ]
]]) ]])
AT_CLEANUP AT_CLEANUP
@@ -962,7 +910,6 @@ input.y: warning: shift/reduce conflict on token D [-Wcounterexamples]
`-> b `-> D `-> b `-> D
`-> c `-> c
`-> . `-> .
]], ]],
[[input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr] [[input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
input.y: warning: shift/reduce conflict on token D [-Wcounterexamples] input.y: warning: shift/reduce conflict on token D [-Wcounterexamples]
@@ -970,7 +917,6 @@ input.y: warning: shift/reduce conflict on token D [-Wcounterexamples]
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
Reduce derivation $accept -> [ s -> [ A a a -> [ b -> [ c -> [ . ] ] ] d -> [ D ] E ] $end ] Reduce derivation $accept -> [ s -> [ A a a -> [ b -> [ c -> [ . ] ] ] d -> [ D ] E ] $end ]
]]) ]])
AT_CLEANUP AT_CLEANUP

View File

@@ -546,7 +546,6 @@ input.y: <warning>warning:</warning> shift/reduce conflict on token "+" [<warnin
Example <cex-0><cex-1><cex-leaf>exp</cex-leaf> <cex-leaf>"+"</cex-leaf> <cex-leaf>exp</cex-leaf> <cex-dot>•</cex-dot></cex-1> <cex-leaf>"+"</cex-leaf> <cex-leaf>exp</cex-leaf></cex-0> Example <cex-0><cex-1><cex-leaf>exp</cex-leaf> <cex-leaf>"+"</cex-leaf> <cex-leaf>exp</cex-leaf> <cex-dot>•</cex-dot></cex-1> <cex-leaf>"+"</cex-leaf> <cex-leaf>exp</cex-leaf></cex-0>
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-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>]
@@ -558,7 +557,6 @@ input.y: <warning>warning:</warning> shift/reduce conflict on token "else" [<war
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-1> <cex-leaf>"else"</cex-leaf> <cex-leaf>exp</cex-leaf></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-1> <cex-leaf>"else"</cex-leaf> <cex-leaf>exp</cex-leaf></cex-0>
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-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>]
@@ -570,7 +568,6 @@ input.y: <warning>warning:</warning> shift/reduce conflict on token "+" [<warnin
Example <cex-0><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-1> <cex-leaf>"+"</cex-leaf> <cex-leaf>exp</cex-leaf></cex-0> Example <cex-0><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-1> <cex-leaf>"+"</cex-leaf> <cex-leaf>exp</cex-leaf></cex-0>
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-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>]
@@ -582,7 +579,6 @@ input.y: <warning>warning:</warning> shift/reduce conflict on token "+" [<warnin
Example <cex-0><cex-1><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-leaf>exp</cex-leaf> <cex-dot>•</cex-dot></cex-1> <cex-leaf>"+"</cex-leaf> <cex-leaf>exp</cex-leaf></cex-0> Example <cex-0><cex-1><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-leaf>exp</cex-leaf> <cex-dot>•</cex-dot></cex-1> <cex-leaf>"+"</cex-leaf> <cex-leaf>exp</cex-leaf></cex-0>
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-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-leaf> "else"</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-leaf> "else"</cex-leaf><cex-leaf> exp</cex-leaf><cex-dot> •</cex-dot></cex-step></cex-1>
]]) ]])
@@ -642,7 +638,6 @@ input.y: <warning>warning:</warning> reduce/reduce conflict on token "X" [<warni
<cex-2><cex-step> ↳ <cex-3><cex-step>y3</cex-step></cex-3></cex-step></cex-2><cex-6><cex-step> ↳ <cex-7><cex-step>bar3</cex-step></cex-7></cex-step></cex-6><cex-13><cex-step> ↳ <cex-14><cex-step>y3</cex-step></cex-14></cex-step></cex-13> <cex-2><cex-step> ↳ <cex-3><cex-step>y3</cex-step></cex-3></cex-step></cex-2><cex-6><cex-step> ↳ <cex-7><cex-step>bar3</cex-step></cex-7></cex-step></cex-6><cex-13><cex-step> ↳ <cex-14><cex-step>y3</cex-step></cex-14></cex-step></cex-13>
<cex-3><cex-step> ↳ <cex-leaf>"X"</cex-leaf><cex-dot> •</cex-dot></cex-step></cex-3><cex-7><cex-step> ↳ <cex-8><cex-step>y1</cex-step></cex-8><cex-11><cex-step> bar4</cex-step></cex-11></cex-step></cex-7><cex-14><cex-step> ↳ <cex-leaf>"X"</cex-leaf></cex-step></cex-14> <cex-3><cex-step> ↳ <cex-leaf>"X"</cex-leaf><cex-dot> •</cex-dot></cex-step></cex-3><cex-7><cex-step> ↳ <cex-8><cex-step>y1</cex-step></cex-8><cex-11><cex-step> bar4</cex-step></cex-11></cex-step></cex-7><cex-14><cex-step> ↳ <cex-leaf>"X"</cex-leaf></cex-step></cex-14>
<cex-8><cex-step> ↳ <cex-9><cex-step>y2</cex-step></cex-9></cex-step></cex-8><cex-11><cex-step> ↳ <cex-leaf>"quuux"</cex-leaf></cex-step></cex-11> <cex-8><cex-step> ↳ <cex-9><cex-step>y2</cex-step></cex-9></cex-step></cex-8><cex-11><cex-step> ↳ <cex-leaf>"quuux"</cex-leaf></cex-step></cex-11>
<cex-9><cex-step> ↳ <cex-10><cex-step>y3</cex-step></cex-10></cex-step></cex-9>
<cex-9><cex-step> ↳ <cex-10><cex-step>y3</cex-step></cex-10></cex-step></cex-9> <cex-9><cex-step> ↳ <cex-10><cex-step>y3</cex-step></cex-10></cex-step></cex-9>
<cex-10><cex-step> ↳ <cex-leaf>"X"</cex-leaf></cex-step></cex-10> <cex-10><cex-step> ↳ <cex-leaf>"X"</cex-leaf></cex-step></cex-10>
input.y: <warning>warning:</warning> fix-its can be applied. Rerun with option '--update'. [<warning>-Wother</warning>] input.y: <warning>warning:</warning> fix-its can be applied. Rerun with option '--update'. [<warning>-Wother</warning>]

View File

@@ -1547,7 +1547,6 @@ input.y: warning: shift/reduce conflict on token "⊕" [-Wcounterexamples]
exp exp
↳ exp "⊕" exp ↳ exp "⊕" exp
↳ exp "+" exp • ↳ exp "+" exp •
input.y: warning: reduce/reduce conflict on tokens $end, "+", "⊕" [-Wcounterexamples] input.y: warning: reduce/reduce conflict on tokens $end, "+", "⊕" [-Wcounterexamples]
Example exp "+" exp • Example exp "+" exp •
First derivation First derivation
@@ -1556,7 +1555,6 @@ input.y: warning: reduce/reduce conflict on tokens $end, "+", "⊕" [-Wcounterex
Second derivation Second derivation
exp exp
↳ exp "+" exp • ↳ exp "+" exp •
input.y: warning: shift/reduce conflict on token "⊕" [-Wcounterexamples] input.y: warning: shift/reduce conflict on token "⊕" [-Wcounterexamples]
Example exp "+" exp • "⊕" exp Example exp "+" exp • "⊕" exp
Shift derivation Shift derivation
@@ -1567,7 +1565,6 @@ input.y: warning: shift/reduce conflict on token "⊕" [-Wcounterexamples]
exp exp
↳ exp "⊕" exp ↳ exp "⊕" exp
↳ exp "+" exp • ↳ exp "+" exp •
input.y: warning: shift/reduce conflict on token "⊕" [-Wcounterexamples] input.y: warning: shift/reduce conflict on token "⊕" [-Wcounterexamples]
Example exp "⊕" exp • "⊕" exp Example exp "⊕" exp • "⊕" exp
Shift derivation Shift derivation
@@ -1578,7 +1575,6 @@ input.y: warning: shift/reduce conflict on token "⊕" [-Wcounterexamples]
exp exp
↳ exp "⊕" exp ↳ exp "⊕" exp
↳ exp "⊕" exp • ↳ exp "⊕" exp •
input.y: warning: shift/reduce conflict on token "+" [-Wcounterexamples] input.y: warning: shift/reduce conflict on token "+" [-Wcounterexamples]
Example exp "⊕" exp • "+" exp Example exp "⊕" exp • "+" exp
Shift derivation Shift derivation
@@ -1589,7 +1585,6 @@ input.y: warning: shift/reduce conflict on token "+" [-Wcounterexamples]
exp exp
↳ exp "+" exp ↳ exp "+" exp
↳ exp "⊕" exp • ↳ exp "⊕" exp •
input.y: warning: shift/reduce conflict on token "+" [-Wcounterexamples] input.y: warning: shift/reduce conflict on token "+" [-Wcounterexamples]
Example exp "⊕" exp • "+" exp Example exp "⊕" exp • "+" exp
Shift derivation Shift derivation
@@ -1600,7 +1595,6 @@ input.y: warning: shift/reduce conflict on token "+" [-Wcounterexamples]
exp exp
↳ exp "+" exp ↳ exp "+" exp
↳ exp "⊕" exp • ↳ exp "⊕" exp •
input.y:6.3-13: warning: rule useless in parser due to conflicts [-Wother] input.y:6.3-13: warning: rule useless in parser due to conflicts [-Wother]
]]) ]])