for (Iterator iterator = statements.iterator(); iterator.hasNext();) {
ASTNode node = (ASTNode) iterator.next();
if (node instanceof RutaStatement) {
checkStatement(code, offset, result, (Statement) node);
} else if (node instanceof TypeDeclaration) {
TypeDeclaration statement = (TypeDeclaration) node;
result.add(new CodeBlock(statement, new Region(offset + statement.sourceStart(), statement
.sourceEnd() - statement.sourceStart())));
traverse(result, statement.getStatements(), offset, code);
} else if (node instanceof MethodDeclaration) {
MethodDeclaration statement = (MethodDeclaration) node;
result.add(new CodeBlock(statement, new Region(offset + statement.sourceStart(), statement
.sourceEnd() - statement.sourceStart())));
traverse(result, statement.getStatements(), offset, code);
}
}
}