if (pos>0) child.reduce(r, pos-1, target, null);
else new Reduction(child, r, r.rewrite(child.phase().getLocation().createRegion(target.getLocation())), target);
}
-
holder[pos] = old;
}
// GraphViz //////////////////////////////////////////////////////////////////////////////
public GraphViz.Node toGraphViz(GraphViz gv) {
+ if (results.size()==0) return null;
if (gv.hasNode(this)) return gv.createNode(this);
GraphViz.Node n = gv.createNode(this);
n.label = ""+state.toStringx();
n.shape = "rectangle";
boolean hasparents = false;
- //for(Node parent : parents()) { hasparents = true; n.edge(parent, ""); }
- //for(Forest result : resultMap) n.edge(result, "");
- n.color = !hasparents ? "blue" : /*state.evil ? "red" :*/ "green";
+ for(Result r : results) n.edge(r, "");
+ n.color = state.doomed ? "red" : "green";
((GraphViz.Group)phase().toGraphViz(gv)).add(n);
return n;
}