1
/* Collapse all nodes with group = X into a single node */
4
graph_t g = graph ("metagraph", "S");
9
/* create only one node with given name/value */
12
metaN = node (g, $.name);
16
/* duplicate all others */
17
N[group != "X"] { node (g, $.name); }
19
/* Create an edge only if at least one of the nodes
20
* is not a collapsed node */
24
if ($.tail.group == "X") {
25
if ($.head.group == "X") return;
27
h = node (g, $.head.name);
29
else if ($.head.group == "X") {
30
t = node (g, $.tail.name);
34
t = node (g, $.tail.name);
35
h = node (g, $.head.name);
40
/* set g to be output graph */