use of org.eclipse.n4js.flowgraphs.dataflow.PartialResult in project n4js by eclipse.
the class NullDereferenceResult method getFailedSymbol.
private Symbol getFailedSymbol(IsNotNull inn) {
if (inn.failedBranches.isEmpty()) {
return null;
}
Set<Symbol> failedSymbols = new HashSet<>();
for (PartialResult result : inn.failedBranches) {
NullDerefernceFailed ndFailed = (NullDerefernceFailed) result;
failedSymbols.add(ndFailed.symbol);
}
if (failedSymbols.size() == 1) {
return failedSymbols.iterator().next();
}
return null;
}
use of org.eclipse.n4js.flowgraphs.dataflow.PartialResult in project n4js by eclipse.
the class UsedBeforeDeclaredAnalyserOnDataflow method getUsedButNotDeclaredIdentifierRefs.
/**
* @return all {@link IdentifierRef}s that are used before declared
*/
public List<ControlFlowElement> getUsedButNotDeclaredIdentifierRefs() {
List<ControlFlowElement> idRefs = new LinkedList<>();
for (Assumption ass : failedAssumptions.values()) {
for (PartialResult result : ass.failedBranches) {
UsedBeforeFailed ubf = (UsedBeforeFailed) result;
idRefs.add(ubf.useLocation);
}
}
return idRefs;
}
Aggregations