public void visitIfElse(IfStatement ifElse) {
    ifElse.getBooleanExpression().visit(this);
    ifElse.getIfBlock().visit(this);

    Statement elseBlock = ifElse.getElseBlock();
    if (elseBlock instanceof EmptyStatement) {
      // dispatching to EmptyStatement will not call back visitor,
      // must call our visitEmptyStatement explicitly
      visitEmptyStatement((EmptyStatement) elseBlock);
    } else {
      elseBlock.visit(this);
    }
  }
 public void visitTryCatchFinally(TryCatchStatement statement) {
   statement.getTryStatement().visit(this);
   for (CatchStatement catchStatement : statement.getCatchStatements()) {
     catchStatement.visit(this);
   }
   Statement finallyStatement = statement.getFinallyStatement();
   if (finallyStatement instanceof EmptyStatement) {
     // dispatching to EmptyStatement will not call back visitor,
     // must call our visitEmptyStatement explicitly
     visitEmptyStatement((EmptyStatement) finallyStatement);
   } else {
     finallyStatement.visit(this);
   }
 }
 public void visitBlockStatement(BlockStatement block) {
   for (Statement statement : block.getStatements()) {
     if (statement != null) // GRECLIPSE
     statement.visit(this);
   }
 }
Пример #4
0
 public void visitBlockStatement(BlockStatement block) {
   for (Statement statement : block.getStatements()) {
     statement.visit(this);
   }
 }