xml: match DOT output and xml2dot.xsl processing

Make the DOT produced by XSLT processing equivalent to the one made with the
--graph option.

* data/xslt/xml2dot.xsl: Stylistic changes, and add support for reductions.
* doc/bison.texi (Xml): Update.
* src/graphviz.c (conclude_red): Minor stylistic changes to DOT internals.
(output_red): Swap enabled and disabled reductions output, for coherence
with XSLT output.
* src/print_graph.c (print_core): Minor stylistic change to States' output.
(print_actions): Swap order of output for reductions and transitions.
* tests/local.at (AT_BISON_CHECK_XML): Ignore differences in order.
* tests/output.at: Adjust to changes in DOT internals.
This commit is contained in:
Theophile Ranquet
2012-10-23 15:43:54 +00:00
committed by Akim Demaille
parent 489b320d4a
commit be3517b007
7 changed files with 367 additions and 194 deletions

View File

@@ -76,7 +76,7 @@ print_core (struct obstack *oout, state *s)
}
obstack_printf (oout, _("State %d"), s->number);
obstack_sgrow (oout, "\\n");
obstack_sgrow (oout, "\\n\\l");
for (i = 0; i < snritems; i++)
{
item_number *sp;
@@ -142,9 +142,6 @@ print_actions (state const *s, FILE *fgraph)
transitions const *trans = s->transitions;
int i;
/* Display reductions. */
output_red (s, s->reductions, fgraph);
if (!trans->num && !s->reductions)
return;
@@ -167,6 +164,8 @@ print_actions (state const *s, FILE *fgraph)
TRANSITION_IS_ERROR (trans, i) ? NULL : symbols[sym]->tag,
style, fgraph);
}
/* Display reductions. */
output_red (s, s->reductions, fgraph);
}