@Override public boolean accept(final ASTVisitor visitor) { if (root == null) { if (!visitor.lock(DBLocking.CTX)) return false; } else if (!root.accept(visitor)) { return false; } visitor.enterFocus(); if (!visitAll(visitor, steps)) return false; visitor.exitFocus(); return true; }
@Override public final boolean accept(final ASTVisitor visitor) { if (exprs.length == 0) { if (oneOf(func, COLLECTION, URI_COLLECTION) && !visitor.lock(DBLocking.COLL)) return false; } else if (!(exprs[0] instanceof Str)) { if (!visitor.lock(null)) return false; } else { final QueryInput qi = new QueryInput(string(((Str) exprs[0]).string())); if (qi.db == null && !visitor.lock(null)) return false; if (!visitor.lock(qi.db)) return false; } return super.accept(visitor); }