use of org.eclipse.n4js.flowgraphs.FlowEdge in project n4js by eclipse.
the class PathWalkerGuide method visitNode.
@Override
public void visitNode(Node node) {
if (node instanceof RepresentingNode) {
ControlFlowElement cfeEnd = node.getRepresentedControlFlowElement();
if (lastVisitedNode != null) {
ControlFlowElement cfeStart = lastVisitedNode.getRepresentedControlFlowElement();
FlowEdge edge = new FlowEdge(cfeStart, cfeEnd, cfTypes);
walker.visit(edge);
}
cfTypes.clear();
walker.visit(cfeEnd);
lastVisitedNode = node;
}
}
use of org.eclipse.n4js.flowgraphs.FlowEdge in project n4js by eclipse.
the class BranchWalker method visit.
@Override
protected final void visit(Node start, Node end, ControlFlowEdge edge) {
pEdgeTypes.add(edge.cfType);
if (end instanceof RepresentingNode || this.getContainer() == end.getControlFlowElement()) {
ControlFlowElement endCFE = end.getRepresentedControlFlowElement();
endCFE = endCFE == null ? end.getControlFlowElement() : endCFE;
if (lastRN != null) {
ControlFlowElement startCFE = lastRN.getRepresentedControlFlowElement();
startCFE = startCFE == null ? lastRN.getControlFlowElement() : startCFE;
FlowEdge flowEdge = new FlowEdge(startCFE, endCFE, pEdgeTypes);
visit(flowEdge);
pEdgeTypes.clear();
} else {
HashSet<EdgeInfo> edgeInfos = new HashSet<>();
addPredecedingRepNodes(this, edgeInfos, new EdgeInfo(this));
for (EdgeInfo edgeInfo : edgeInfos) {
ControlFlowElement startCFE = edgeInfo.startNode.getRepresentedControlFlowElement();
startCFE = startCFE == null ? edgeInfo.startNode.getControlFlowElement() : startCFE;
FlowEdge flowEdge = new FlowEdge(startCFE, endCFE, edgeInfo.pEdgeTypes);
edgeInfo.edgeOwner.visit(flowEdge);
}
pEdgeTypes.clear();
}
}
}
Aggregations