- new_node (&node); /* Set node attributs default value. */
- sprintf (name, "%d", state);
- node.title = name; /* Give a name to the node. */
- open_node (&node_obstack);
- /* Output a VCG formatted attributs list. */
- output_node (&node, &node_obstack);
-
- {
- /* Here we begin to compute the node label. */
- obstack_sgrow (&node_obstack, "\t\tlabel:\t\""); /* Open Label */
-
- /* Keep the size of NODE_OBSTACK before computing the label. It is
- useful to format the label. */
- node_output_size = obstack_object_size (&node_obstack);
-
- /* Compute the labels of nodes on the fly. */
- print_core (state, &node_obstack);
- /* Compute edges and additionnal parts of node label. */
- print_actions (state, node.title, &node_obstack);
-
- obstack_sgrow (&node_obstack, "\"\n"); /* Close Label. */
-
- close_node (&node_obstack);
- }
-
- /* `obstack_cat' NODE_OBSTACK to GRAPH_OBSTACK. */
- obstack_grow (&graph_obstack,
- obstack_base (&node_obstack),
- obstack_object_size (&node_obstack));
- obstack_finish (&node_obstack);
+ new_node (&node);
+ sprintf (name, "%d", state->number);
+ node.title = name;
+ print_core (state, &node_obstack);
+ obstack_1grow (&node_obstack, '\0');
+ node.label = obstack_finish (&node_obstack);
+
+ open_node (fgraph);
+ output_node (&node, fgraph);
+ close_node (fgraph);
+
+ /* Output the edges. */
+ print_actions (state, name);
+
+ obstack_free (&node_obstack, 0);