use of org.eclipse.n4js.flowgraphs.dataflow.DataFlowVisitor in project n4js by eclipse.
the class GraphVisitorAnalysis method getGraphVisitors.
private List<GraphVisitorInternal> getGraphVisitors(FlowAnalyser[] flowAnalysers, TraverseDirection direction) {
List<GraphVisitorInternal> graphVisitors = new LinkedList<>();
List<DataFlowVisitor> dataflowVisitorList = new LinkedList<>();
for (FlowAnalyser flowAnalyser : flowAnalysers) {
if (flowAnalyser instanceof GraphVisitorInternal) {
GraphVisitorInternal graphVisitor = (GraphVisitorInternal) flowAnalyser;
if (graphVisitor.getDirection() == direction) {
graphVisitors.add(graphVisitor);
}
}
if (flowAnalyser instanceof DataFlowVisitor) {
DataFlowVisitor dataflowVisitor = (DataFlowVisitor) flowAnalyser;
if (dataflowVisitor.getDirection() == direction) {
dataflowVisitorList.add(dataflowVisitor);
}
}
}
if (!dataflowVisitorList.isEmpty()) {
DataFlowVisitorHost dfvh = new DataFlowVisitorHost(direction, dataflowVisitorList);
graphVisitors.add(dfvh);
}
return graphVisitors;
}
Aggregations