cex: prefer → to ::=

It does not make a lot of sense to use ::= in our counterexamples,
that's not something that belongs to the Bison "vocabulary".  Using
the colon makes sense, but it's too discreet.  Let's use the arrow,
which we already use in some reports (HTML and Dot).

* src/gram.h (print_dot_fallback): Generalize into...
(print_fallback): this.
(print_arrow): New.
* src/derivation.c: Use it.

* NEWS, tests/conflicts.at, tests/counterexample.at,
* tests/diagnostics.at, tests/report.at: Adjust.
* doc/bison.texi: Ditto.
Unfortunately the literal `→` is output as `↦`.  So we need to use
@arrow.
This commit is contained in:
Akim Demaille
2020-07-11 18:25:49 +02:00
parent a2ad33dca6
commit ee86ea8839
8 changed files with 147 additions and 125 deletions

View File

@@ -1539,33 +1539,33 @@ AT_CHECK([LC_ALL="$locale" bison -fno-caret -o input.cc -rall -Wcex --graph=inpu
input.y: warning: 3 reduce/reduce conflicts [-Wconflicts-rr]
Shift/reduce conflict on token "⊕":
Example exp "+" exp • "⊕" exp
First derivation exp ::=[ exp ::=[ exp "+" exp • ] "⊕" exp ]
Second derivation exp ::=[ exp "+" exp ::=[ exp • "⊕" exp ] ]
First derivation exp [ exp [ exp "+" exp • ] "⊕" exp ]
Second derivation exp [ exp "+" exp [ exp • "⊕" exp ] ]
Reduce/reduce conflict on tokens $end, "+", "⊕":
Example exp "+" exp •
First derivation exp ::=[ exp "+" exp • ]
Second derivation exp ::=[ exp "+" exp • ]
First derivation exp [ exp "+" exp • ]
Second derivation 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 ] ]
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 ] ]
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 ] ]
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 ] ]
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]
]])
@@ -1714,22 +1714,22 @@ State 7
2 exp: exp "+" exp •
1 exp: exp • "⊕" exp
Example exp "+" exp • "⊕" exp
First derivation exp ::=[ exp ::=[ exp "+" exp • ] "⊕" exp ]
Second derivation exp ::=[ exp "+" exp ::=[ exp • "⊕" exp ] ]
First derivation exp [ exp [ exp "+" exp • ] "⊕" exp ]
Second derivation exp [ exp "+" exp [ exp • "⊕" exp ] ]
Reduce/reduce conflict on tokens $end, "+", "⊕":
2 exp: exp "+" exp •
3 exp: exp "+" exp •
Example exp "+" exp •
First derivation exp ::=[ exp "+" exp • ]
Second derivation exp ::=[ exp "+" exp • ]
First derivation exp [ exp "+" exp • ]
Second derivation exp [ exp "+" exp • ]
Shift/reduce conflict on token "⊕":
3 exp: exp "+" exp •
1 exp: exp • "⊕" exp
Example exp "+" exp • "⊕" exp
First derivation exp ::=[ exp ::=[ exp "+" exp • ] "⊕" exp ]
Second derivation exp ::=[ exp "+" exp ::=[ exp • "⊕" exp ] ]
First derivation exp [ exp [ exp "+" exp • ] "⊕" exp ]
Second derivation exp [ exp "+" exp [ exp • "⊕" exp ] ]
@@ -1751,22 +1751,22 @@ State 8
1 exp: exp "⊕" exp •
1 exp: exp • "⊕" exp
Example exp "⊕" exp • "⊕" exp
First derivation exp ::=[ exp ::=[ exp "⊕" exp • ] "⊕" exp ]
Second derivation exp ::=[ exp "⊕" 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 •
2 exp: exp • "+" exp
Example exp "⊕" exp • "+" exp
First derivation exp ::=[ exp ::=[ exp "⊕" exp • ] "+" exp ]
Second derivation exp ::=[ exp "⊕" 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 ] ]
First derivation exp [ exp [ exp "⊕" exp • ] "+" exp ]
Second derivation exp [ exp "⊕" exp [ exp • "+" exp ] ]
]])