Example #1
0
 public void visit(ArrayInitializerExpr n, Object arg) {
   if (n.getValues() != null) {
     for (Iterator<Expression> i = n.getValues().iterator(); i.hasNext(); ) {
       Expression expr = i.next();
       expr.accept(this, arg);
       if (i.hasNext()) {}
     }
   }
 }
Example #2
0
 public void visit(MethodCallExpr n, Object arg) {
   if (n.getScope() != null) {
     n.getScope().accept(this, arg);
   }
   printTypeArgs(n.getTypeArgs(), arg);
   if (n.getArgs() != null) {
     for (Iterator<Expression> i = n.getArgs().iterator(); i.hasNext(); ) {
       Expression e = i.next();
       e.accept(this, arg);
       if (i.hasNext()) {}
     }
   }
 }
Example #3
0
  public void visit(ArrayCreationExpr n, Object arg) {
    n.getType().accept(this, arg);
    printTypeArgs(n.getTypeArgs(), arg);

    if (n.getDimensions() != null) {
      for (Expression dim : n.getDimensions()) {
        dim.accept(this, arg);
      }
      for (int i = 0; i < n.getArrayCount(); i++) {}
    } else {
      for (int i = 0; i < n.getArrayCount(); i++) {}
      n.getInitializer().accept(this, arg);
    }
  }
Example #4
0
 public void visit(ExplicitConstructorInvocationStmt n, Object arg) {
   if (n.isThis()) {
     printTypeArgs(n.getTypeArgs(), arg);
   } else {
     if (n.getExpr() != null) {
       n.getExpr().accept(this, arg);
     }
     printTypeArgs(n.getTypeArgs(), arg);
   }
   if (n.getArgs() != null) {
     for (Iterator<Expression> i = n.getArgs().iterator(); i.hasNext(); ) {
       Expression e = i.next();
       e.accept(this, arg);
       if (i.hasNext()) {}
     }
   }
 }
Example #5
0
  public void visit(EnumConstantDeclaration n, Object arg) {
    if (n.getJavaDoc() != null) {
      n.getJavaDoc().accept(this, arg);
    }
    printMemberAnnotations(n.getAnnotations(), arg);

    if (n.getArgs() != null) {
      for (Iterator<Expression> i = n.getArgs().iterator(); i.hasNext(); ) {
        Expression e = i.next();
        e.accept(this, arg);
        if (i.hasNext()) {}
      }
    }

    if (n.getClassBody() != null) {
      printMembers(n.getClassBody(), arg);
    }
  }
Example #6
0
 public void visit(ForStmt n, Object arg) {
   if (n.getInit() != null) {
     for (Iterator<Expression> i = n.getInit().iterator(); i.hasNext(); ) {
       Expression e = i.next();
       e.accept(this, arg);
       if (i.hasNext()) {}
     }
   }
   if (n.getCompare() != null) {
     n.getCompare().accept(this, arg);
   }
   if (n.getUpdate() != null) {
     for (Iterator<Expression> i = n.getUpdate().iterator(); i.hasNext(); ) {
       Expression e = i.next();
       e.accept(this, arg);
       if (i.hasNext()) {}
     }
   }
   n.getBody().accept(this, arg);
 }
Example #7
0
  public void visit(ObjectCreationExpr n, Object arg) {
    if (n.getScope() != null) {
      n.getScope().accept(this, arg);
    }

    printTypeArgs(n.getTypeArgs(), arg);
    n.getType().accept(this, arg);

    if (n.getArgs() != null) {
      for (Iterator<Expression> i = n.getArgs().iterator(); i.hasNext(); ) {
        Expression e = i.next();
        e.accept(this, arg);
        if (i.hasNext()) {}
      }
    }

    if (n.getAnonymousClassBody() != null) {
      printMembers(n.getAnonymousClassBody(), arg);
    }
  }