use of edu.rice.cs.caper.bayou.core.dsl.DSubTree in project bayou by capergroup.
the class DOMWhileStatement method handle.
@Override
public DSubTree handle() {
DSubTree tree = new DSubTree();
DSubTree cond = new DOMExpression(statement.getExpression(), visitor).handle();
DSubTree body = new DOMStatement(statement.getBody(), visitor).handle();
boolean loop = cond.isValid();
if (loop)
tree.addNode(new DLoop(cond.getNodesAsCalls(), body.getNodes()));
else {
// only one of these will add nodes
tree.addNodes(cond.getNodes());
tree.addNodes(body.getNodes());
}
return tree;
}
Aggregations