boolean (@NotNull XmlFile element) { final Grammar g = GrammarFactory.getGrammar(element); if (g != null) { g.acceptChildren(new CommonElement.Visitor() { @Override public void visitElement(CommonElement pattern) { if (myResult == null) { super.visitElement(pattern); } } @Override public void visitDefine(Define define) { if (myValue.equals(define.getName())) { myResult = define; } } @Override public void visitInclude(Include include) { final PsiFile file = include.getInclude(); if (file != null && myVisitedPsiFiles.add(file)) { doVisitRncOrRngFile(file, this); } } }); } return myResult == null; }