blob: 9c667942362e025c336d3548767984b739dd1c2e [file] [log] [blame]
rule Tree2Node
transform t : Tree!Tree
to n : Graph!Node {
n.name = t.label;
// If t is not the top tree
// create an edge connecting n
// with the Node created from t's parent
if (t.parent.isDefined()) {
var e : new Graph!Edge;
e.source ::= t.parent;
e.target = n;
}
}