Search in sources :

Example 1 with BinaryPredicate

use of com.intellij.structuralsearch.impl.matcher.predicates.BinaryPredicate in project intellij-community by JetBrains.

the class MatchingHandler method findRegExpPredicate.

private static MatchPredicate findRegExpPredicate(MatchPredicate start) {
    if (start == null)
        return null;
    if (start instanceof RegExpPredicate)
        return start;
    if (start instanceof BinaryPredicate) {
        BinaryPredicate binary = (BinaryPredicate) start;
        final MatchPredicate result = findRegExpPredicate(binary.getFirst());
        if (result != null)
            return result;
        return findRegExpPredicate(binary.getSecond());
    } else if (start instanceof NotPredicate) {
        return null;
    }
    return null;
}
Also used : RegExpPredicate(com.intellij.structuralsearch.impl.matcher.predicates.RegExpPredicate) BinaryPredicate(com.intellij.structuralsearch.impl.matcher.predicates.BinaryPredicate) NotPredicate(com.intellij.structuralsearch.impl.matcher.predicates.NotPredicate)

Aggregations

BinaryPredicate (com.intellij.structuralsearch.impl.matcher.predicates.BinaryPredicate)1 NotPredicate (com.intellij.structuralsearch.impl.matcher.predicates.NotPredicate)1 RegExpPredicate (com.intellij.structuralsearch.impl.matcher.predicates.RegExpPredicate)1