- state_number_t state1 = transitions->states[i];
- symbol_number_t symbol = states[state1]->accessing_symbol;
-
- new_edge (&edge);
-
- if (state->number > state1)
- edge.type = back_edge;
- open_edge (&edge, fgraph);
- /* The edge source is the current node. */
- edge.sourcename = node_name;
- sprintf (buff, "%d", state1);
- edge.targetname = buff;
- /* Shifts are blue, gotos are green, and error is red. */
- if (TRANSITION_IS_ERROR (transitions, i))
- edge.color = red;
- else
- edge.color = TRANSITION_IS_SHIFT(transitions, i) ? blue : green;
- edge.label = symbol_tag_get (symbols[symbol]);
- output_edge (&edge, fgraph);
- close_edge (fgraph);
+ state *s1 = trans->states[i];
+ symbol_number sym = s1->accessing_symbol;
+
+ /* 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);