- int state1 = shiftp->shifts[i];
- token_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 (SHIFT_IS_ERROR (shiftp, i))
- edge.color = red;
- else
- edge.color = SHIFT_IS_SHIFT(shiftp, i) ? blue : green;
- edge.label = escape (symbols[symbol]->tag);
- 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);