Example usage for org.eclipse.jdt.internal.compiler.ast ASTNode traverse

List of usage examples for org.eclipse.jdt.internal.compiler.ast ASTNode traverse

Introduction

In this page you can find the example usage for org.eclipse.jdt.internal.compiler.ast ASTNode traverse.

Prototype

public void traverse(ASTVisitor visitor, BlockScope scope) 

Source Link

Usage

From source file:ch.uzh.ifi.seal.changedistiller.ast.java.JavaDeclarationConverter.java

License:Apache License

private void visitList(ASTNode[] list) {
    for (ASTNode node : list) {
        node.traverse(this, null);
    }
}

From source file:ch.uzh.ifi.seal.changedistiller.ast.java.JavaMethodBodyConverter.java

License:Apache License

private void visitNodes(ASTNode[] nodes, BlockScope scope) {
    for (ASTNode element : nodes) {
        element.traverse(this, scope);
    }/*w w w  .j a  va  2s.c  o  m*/
}

From source file:lombok.eclipse.handlers.replace.ReplaceVisitor.java

License:Open Source License

public void visit(final ASTNode astNode) {
    if (astNode instanceof MethodDeclaration) {
        ((MethodDeclaration) astNode).traverse(this, (ClassScope) null);
    } else {/* www . ja va2s  .  com*/
        astNode.traverse(this, null);
    }
}

From source file:org.eclipse.objectteams.otdt.internal.core.compiler.statemachine.transformer.ReplaceSingleNameVisitor.java

License:Open Source License

/**
 *
 * @param node/* www.j  av  a2s .c om*/
 * @param scope
 * @param oldName
 * @param newName
 * @return        Has any replacement been performed?
 */
public static boolean performReplacement(ASTNode node, BlockScope scope, char[] oldName, final char[] newName) {
    final int start = node.sourceStart;
    IExpressionProvider provider = new IExpressionProvider() {
        public Expression newExpression() {
            return new SingleNameReference(newName, start);
        }
    };
    ReplaceSingleNameVisitor replaceSingleNameVisitor = new ReplaceSingleNameVisitor(oldName, provider);
    node.traverse(replaceSingleNameVisitor, scope);
    return replaceSingleNameVisitor._hasChanges;
}