- new_edge (&e);
-
- if (s->number > s1->number)
- e.type = back_edge;
- open_edge (&e, fgraph);
- /* The edge source is the current node. */
- e.sourcename = node_name;
- sprintf (buff, "%d", s1->number);
- e.targetname = buff;
- /* Shifts are blue, gotos are green, and error is red. */
- if (TRANSITION_IS_ERROR (trans, i))
- e.color = red;
- else
- e.color = TRANSITION_IS_SHIFT (trans, i) ? blue : green;
- e.label = symbols[sym]->tag;
- output_edge (&e, fgraph);
- close_edge (fgraph);
+ /* Shifts are solid, gotos are dashed, and error is dotted. */
+ char const *style =
+ (TRANSITION_IS_ERROR (trans, i) ? "dotted"
+ : TRANSITION_IS_SHIFT (trans, i) ? "solid"
+ : "dashed");
+
+ if (TRANSITION_IS_ERROR (trans, i)
+ && strcmp (symbols[sym]->tag, "error") != 0)
+ abort ();
+ output_edge (s->number, s1->number,
+ TRANSITION_IS_ERROR (trans, i) ? NULL : symbols[sym]->tag,
+ style, fgraph);