@Override
 protected void acceptInner(TreeVisitor visitor) {
   if (visitor.visit(this)) {
     name.accept(visitor);
     initializer.accept(visitor);
   }
   visitor.endVisit(this);
 }
Ejemplo n.º 2
0
 @Override
 protected void acceptInner(TreeVisitor visitor) {
   if (visitor.visit(this)) {
     javadoc.accept(visitor);
     // annotations should be empty.
   }
   visitor.endVisit(this);
 }
Ejemplo n.º 3
0
 @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);
 }
Ejemplo n.º 4
0
  public void accept(final TreeVisitor tv, final int flags) throws IOException {
    if ((MODIFIED_ONLY & flags) == MODIFIED_ONLY && !isModified()) {
      return;
    }

    tv.visitFile(this);
  }
Ejemplo n.º 5
0
 public void visitForceChildren(final TreeVisitor visitor) {
   if (visitor.reverse()) {
     expr.visit(visitor);
   } else {
     expr.visit(visitor);
   }
 }
Ejemplo n.º 6
0
  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);
    }
  }
Ejemplo n.º 7
0
 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;
 }
Ejemplo n.º 8
0
 public void visitForceChildren(final TreeVisitor visitor) {
   if (visitor.reverse()) {
     right.visit(visitor);
     left.visit(visitor);
   } else {
     left.visit(visitor);
     right.visit(visitor);
   }
 }
Ejemplo n.º 9
0
 /**
  * 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);
   }
 }
Ejemplo n.º 10
0
 /**
  * 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());
   // }
 }
Ejemplo n.º 11
0
 /* 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;
 }
Ejemplo n.º 12
0
 public void visit(final TreeVisitor visitor) {
   visitor.visitIfCmpStmt(this);
 }
Ejemplo n.º 13
0
 public void visit(final TreeVisitor visitor) {
   visitor.visitCastExpr(this);
 }
Ejemplo n.º 14
0
 @Override
 protected void accept(TreeVisitor visitor) throws MetaException {
   visitor.visit(this);
 }
 public void accept(TreeVisitor tv) {
   tv.visitDiscardStmt(this);
 }
Ejemplo n.º 16
0
 public void visit(final TreeVisitor visitor) {
   visitor.visitNewArrayExpr(this);
 }
Ejemplo n.º 17
0
 @Override
 public void apply(TreeVisitor tp) {
   for (Tree tree : this) {
     tp.visitTree(tree);
   }
 }
Ejemplo n.º 18
0
 public void visit(final TreeVisitor visitor) {
   visitor.visitPhiJoinStmt(this);
 }
Ejemplo n.º 19
0
 @Override
 protected void acceptInner(TreeVisitor visitor) {
   visitor.visit(this);
   visitor.endVisit(this);
 }
Ejemplo n.º 20
0
 @Override
 public void simpleVisit(TreeVisitor visitor) {
   visitor.endType();
 }
Ejemplo n.º 21
0
 public void visit(final TreeVisitor visitor) {
   visitor.visitExprStmt(this);
 }
Ejemplo n.º 22
0
 @Override
 public void visit(TreeVisitor visitor) {
   visitor.visit(this);
   block.visit(visitor);
 }
Ejemplo n.º 23
0
 @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);
 }