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

8
NEWS
View File

@@ -45,8 +45,8 @@ GNU Bison NEWS
conflict. For example:
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 ] ]
When Bison is installed with text styling enabled, the example is actually
shown twice, with colors highlighting the ambiguity.
@@ -57,9 +57,9 @@ GNU Bison NEWS
generates two examples that are the same up until the dot:
First example expr • ID $end
First derivation $accept ::=[ s ::=[ a ::=[ expr • ] ID ] $end ]
First derivation $accept [ s [ a [ expr • ] ID ] $end ]
Second example expr • ID ',' ID $end
Second derivation $accept ::=[ s ::=[ a ::=[ expr ::=[ expr • ID ',' ] ] ID ] $end ]
Second derivation $accept [ s [ a [ expr [ expr • ID ',' ] ] ID ] $end ]
In these cases, the parser usually doesn't have enough lookahead to
differentiate the two given examples.