PsiMatcher (PsiMatcherExpression e) { while (myElement != null) { Boolean res = e == null ? Boolean.TRUE : e.match(myElement); if (res == Boolean.TRUE) break; if (res == null) return NullPsiMatcherImpl.INSTANCE; myElement = myElement.getParent(); } if (myElement == null) return NullPsiMatcherImpl.INSTANCE; return this; }