Search in sources :

Example 1 with GuardStructure

use of org.eclipse.n4js.flowgraphs.dataflow.guards.GuardStructure in project n4js by eclipse.

the class DataFlowBranchWalker method visit.

@Override
protected void visit(Node lastVisitNodes, Node end, ControlFlowEdge edge) {
    GuardStructure guardStructure = GuardStructureFactory.create(edge);
    if (guardStructure == null) {
        return;
    }
    guardStructure.initSymbols(getSymbolFactory());
    for (Iterator<Assumption> assIter = assumptions.values().iterator(); assIter.hasNext(); ) {
        Assumption ass = assIter.next();
        if (ass.isOpen()) {
            for (Symbol alias : ass.aliases) {
                if (!guardStructure.hasGuards(alias)) {
                    continue;
                }
                Collection<Guard> guards = guardStructure.getGuards(alias);
                for (Guard guard : guards) {
                    ass.callHoldsOnGuards(guard);
                }
            }
        }
    }
    for (DataFlowVisitor dfv : getDataFlowVisitorHost().dfVisitors) {
        for (Guard guard : guardStructure.allGuards()) {
            dfv.visitGuard(guard);
        }
    }
}
Also used : GuardStructure(org.eclipse.n4js.flowgraphs.dataflow.guards.GuardStructure) Symbol(org.eclipse.n4js.flowgraphs.dataflow.symbols.Symbol) Guard(org.eclipse.n4js.flowgraphs.dataflow.guards.Guard)

Aggregations

Guard (org.eclipse.n4js.flowgraphs.dataflow.guards.Guard)1 GuardStructure (org.eclipse.n4js.flowgraphs.dataflow.guards.GuardStructure)1 Symbol (org.eclipse.n4js.flowgraphs.dataflow.symbols.Symbol)1