boolean (PrattBuilder builder) { ListIterator<IElementType> iterator = null; for (final ElementPattern pattern : myPath) { if (builder == null) return false; if (iterator == null) { iterator = builder.getBackResultIterator(); } if (pattern == null) { if (iterator.hasPrevious()) return false; builder = builder.getParent(); iterator = null; } else { if (!iterator.hasPrevious()) return false; if (!pattern.accepts(iterator.previous())) return false; } } return true; }