@Override protected void acceptInner(TreeVisitor visitor) { if (visitor.visit(this)) { name.accept(visitor); initializer.accept(visitor); } visitor.endVisit(this); }
@Override protected void acceptInner(TreeVisitor visitor) { if (visitor.visit(this)) { javadoc.accept(visitor); // annotations should be empty. } visitor.endVisit(this); }
@Override protected void acceptInner(TreeVisitor visitor) { if (visitor.visit(this)) { initializers.accept(visitor); expression.accept(visitor); updaters.accept(visitor); body.accept(visitor); } visitor.endVisit(this); }
public void accept(final TreeVisitor tv, final int flags) throws IOException { if ((MODIFIED_ONLY & flags) == MODIFIED_ONLY && !isModified()) { return; } tv.visitFile(this); }
public void visitForceChildren(final TreeVisitor visitor) { if (visitor.reverse()) { expr.visit(visitor); } else { expr.visit(visitor); } }
public void visitForceChildren(final TreeVisitor visitor) { if (visitor.reverse()) { target.visit(visitor); } final Iterator e = operands().iterator(); while (e.hasNext()) { final Expr operand = (Expr) e.next(); operand.visit(visitor); } if (!visitor.reverse()) { target.visit(visitor); } }
public int execute() throws Exception { if (QueryInfo.get__dbInfo() == null) { throw new Exception("No choosed database"); } String tableName = tree.getChild(2).getText(); tableInfo = DictCenterManager.findTableWithName(QueryInfo.get__dbInfo(), tableName); int ret = 0; if (!chooseAll) { table = DataTableManager.loadTable(tableInfo); int len = table.getRecords().size(); for (cur = 0; cur < len; cur++) { visitor.visitTree((sqlParser.ExprContext) tree.getChild(3).getChild(1)); if (((ValueTree) tree.getChild(3).getChild(1)).getValue().getValue().equals(true)) { ret++; } else { resTable.getRecords().add(table.getRecords().get(cur)); } } table.setRecords(resTable.getRecords()); } else { ret = table.getRecords().size(); table.getRecords().clear(); } DataTableManager.storeTable(table); return ret; }
public void visitForceChildren(final TreeVisitor visitor) { if (visitor.reverse()) { right.visit(visitor); left.visit(visitor); } else { left.visit(visitor); right.visit(visitor); } }
/** * Applies the TreeVisitor to to all trees in the Treebank. * * @param tv A class that can process trees. */ public void apply(TreeVisitor tv) { for (Tree t : tb) { if (VERBOSE) System.out.println("TfTbApply transforming " + t); Tree tmpT = t.deeperCopy(); if (transformer != null) { tmpT = transformer.transformTree(tmpT); } if (VERBOSE) System.out.println(" to " + tmpT); tv.visitTree(tmpT); } }
/** * Apply the TreeVisitor tp to all trees in the Treebank. * * @param tp A class that implements the TreeVisitor interface */ @Override public void apply(TreeVisitor tp) { for (int i = 0, size = parseTrees.size(); i < size; i++) { tp.visitTree(parseTrees.get(i)); } // or could do as Iterator but slower // Iterator iter = parseTrees.iterator(); // while (iter.hasNext()) { // tp.visitTree((Tree) iter.next()); // } }
/* applies a TreeVisitor to all projections (including the node itself) of a node in a Tree. * Does nothing if head is not in root. * @return the maximal projection of head in root. */ public static Tree applyToProjections(TreeVisitor v, Tree head, Tree root, HeadFinder hf) { Tree projection = head; Tree parent = projection.parent(root); if (parent == null && projection != root) { return null; } v.visitTree(projection); if (projection == root) { return root; } while (hf.determineHead(parent) == projection) { projection = parent; v.visitTree(projection); if (projection == root) { return root; } parent = projection.parent(root); } return projection; }
public void visit(final TreeVisitor visitor) { visitor.visitIfCmpStmt(this); }
public void visit(final TreeVisitor visitor) { visitor.visitCastExpr(this); }
@Override protected void accept(TreeVisitor visitor) throws MetaException { visitor.visit(this); }
public void accept(TreeVisitor tv) { tv.visitDiscardStmt(this); }
public void visit(final TreeVisitor visitor) { visitor.visitNewArrayExpr(this); }
@Override public void apply(TreeVisitor tp) { for (Tree tree : this) { tp.visitTree(tree); } }
public void visit(final TreeVisitor visitor) { visitor.visitPhiJoinStmt(this); }
@Override protected void acceptInner(TreeVisitor visitor) { visitor.visit(this); visitor.endVisit(this); }
@Override public void simpleVisit(TreeVisitor visitor) { visitor.endType(); }
public void visit(final TreeVisitor visitor) { visitor.visitExprStmt(this); }
@Override public void visit(TreeVisitor visitor) { visitor.visit(this); block.visit(visitor); }
@Override public <R, D> R accept(final TreeVisitor<R, D> visitor, final D data) { return visitor.visitVariable(this, data); }
public void accept(TreeVisitor tv) { tv.visitVariableExpr(this); }