Search in sources :

Example 1 with TypeListener

use of de.fraunhofer.aisec.cpg.graph.HasType.TypeListener in project cpg by Fraunhofer-AISEC.

the class UnaryOperator method getsDataFromInput.

private boolean getsDataFromInput(TypeListener curr, TypeListener target) {
    List<TypeListener> worklist = new ArrayList<>();
    worklist.add(curr);
    while (!worklist.isEmpty()) {
        TypeListener tl = worklist.remove(0);
        if (!checked.contains(tl)) {
            checked.add(tl);
            if (tl == target) {
                return true;
            }
            if (curr instanceof HasType) {
                worklist.addAll(((HasType) curr).getTypeListeners());
            }
        }
    }
    return false;
}
Also used : TypeListener(de.fraunhofer.aisec.cpg.graph.HasType.TypeListener) HasType(de.fraunhofer.aisec.cpg.graph.HasType)

Aggregations

HasType (de.fraunhofer.aisec.cpg.graph.HasType)1 TypeListener (de.fraunhofer.aisec.cpg.graph.HasType.TypeListener)1