/** * Delegates to the visit method used for this class. * If the visitor is a ClassGenerator, then * {@link ClassGenerator#visitBytecodeSequence(BytecodeSequence)} * is called with this instance. If the visitor is no * ClassGenerator, then this method will call visit on * each ASTNode element sorted by this class. If one * element is a BytecodeInstruction, then it will be skipped * as it is no ASTNode. * * @param visitor the visitor * @see ClassGenerator */ public void visit(GroovyCodeVisitor visitor) { if (visitor instanceof ClassGenerator) { ClassGenerator gen = (ClassGenerator) visitor; gen.visitBytecodeSequence(this); return; } for (Iterator iterator = instructions.iterator(); iterator.hasNext();) { Object part = (Object) iterator.next(); if (part instanceof ASTNode) { ((ASTNode)part).visit(visitor); } } }
for (ASTNode it : nodes) { if (!(it instanceof AnnotationNode) && !(it instanceof ClassNode)) { it.visit(transformer);
/** * Delegates to the visit method used for this class. * If the visitor is a ClassGenerator, then * {@link ClassGenerator#visitBytecodeSequence(BytecodeSequence)} * is called with this instance. If the visitor is no * ClassGenerator, then this method will call visit on * each ASTNode element sorted by this class. If one * element is a BytecodeInstruction, then it will be skipped * as it is no ASTNode. * * @param visitor the visitor * @see ClassGenerator */ public void visit(GroovyCodeVisitor visitor) { if (visitor instanceof ClassGenerator) { ClassGenerator gen = (ClassGenerator) visitor; gen.visitBytecodeSequence(this); return; } for (Iterator iterator = instructions.iterator(); iterator.hasNext();) { Object part = (Object) iterator.next(); if (part instanceof ASTNode) { ((ASTNode)part).visit(visitor); } } }
/** * Delegates to the visit method used for this class. * If the visitor is a ClassGenerator, then * {@link ClassGenerator#visitBytecodeSequence(BytecodeSequence)} * is called with this instance. If the visitor is no * ClassGenerator, then this method will call visit on * each ASTNode element sotred by this class. If one * element is a BytecodeInstruction, then it will be skipped * as it is no ASTNode. * * @param visitor the visitor * @see ClassGenerator */ public void visit(GroovyCodeVisitor visitor) { if (visitor instanceof ClassGenerator) { ClassGenerator gen = (ClassGenerator) visitor; gen.visitBytecodeSequence(this); return; } for (Iterator iterator = instructions.iterator(); iterator.hasNext();) { Object part = (Object) iterator.next(); if (part instanceof ASTNode) { ((ASTNode)part).visit(visitor); } } }
/** * Delegates to the visit method used for this class. * If the visitor is a ClassGenerator, then * {@link ClassGenerator#visitBytecodeSequence(BytecodeSequence)} * is called with this instance. If the visitor is no * ClassGenerator, then this method will call visit on * each ASTNode element sotred by this class. If one * element is a BytecodeInstruction, then it will be skipped * as it is no ASTNode. * * @param visitor the visitor * @see ClassGenerator */ public void visit(GroovyCodeVisitor visitor) { if (visitor instanceof ClassGenerator) { ClassGenerator gen = (ClassGenerator) visitor; gen.visitBytecodeSequence(this); return; } for (Iterator iterator = instructions.iterator(); iterator.hasNext();) { Object part = (Object) iterator.next(); if (part instanceof ASTNode) { ((ASTNode)part).visit(visitor); } } }
/** * Delegates to the visit method used for this class. * If the visitor is a ClassGenerator, then * {@link ClassGenerator#visitBytecodeSequence(BytecodeSequence)} * is called with this instance. If the visitor is no * ClassGenerator, then this method will call visit on * each ASTNode element sotred by this class. If one * element is a BytecodeInstruction, then it will be skipped * as it is no ASTNode. * * @param visitor the visitor * @see ClassGenerator */ public void visit(GroovyCodeVisitor visitor) { if (visitor instanceof ClassGenerator) { ClassGenerator gen = (ClassGenerator) visitor; gen.visitBytecodeSequence(this); return; } for (Iterator iterator = instructions.iterator(); iterator.hasNext();) { Object part = (Object) iterator.next(); if (part instanceof ASTNode) { ((ASTNode)part).visit(visitor); } } }
protected void visit(ASTNode e) { LOGGER.log(Level.FINER, "visiting {0}:{1}", new Object[] {sourceUnit.getName(), e.getLineNumber()}); if (e instanceof EmptyExpression) { // working around a bug in EmptyExpression.visit() that doesn't call any method visitEmptyExpression((EmptyExpression) e); } else if (e instanceof EmptyStatement) { // working around a bug in EmptyStatement.visit() that doesn't call any method visitEmptyStatement((EmptyStatement) e); } else { e.visit(this); } }
visitor.visitClass((ClassNode) expr); } else { expr.visit(visitor);
node.visit(visitor);
root.visit(astChildrenSupport); children = astChildrenSupport.children();
node.visit(visitor);
for (ASTNode it : nodes) { if (!(it instanceof AnnotationNode) && !(it instanceof ClassNode)) { it.visit(transformer);