net.intelie.pipes.ast.CallVisitor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pipes-api Show documentation
Show all versions of pipes-api Show documentation
Intelie Pipes' API classes and interfaces
package net.intelie.pipes.ast;
import net.intelie.pipes.Function;
import net.intelie.pipes.PipeException;
import java.util.LinkedHashSet;
import java.util.Set;
public class CallVisitor extends AstVisitorBase {
public static Set listFunctions(AstNode query) throws PipeException {
CallVisitor visitor = new CallVisitor();
visitor.visit(query);
return visitor.set;
}
private final Set set;
private CallVisitor() {
this.set = new LinkedHashSet<>();
}
@Override
public AstNode visitCall(CallNode node) throws PipeException {
set.add(node.getName());
return super.visitCall(node);
}
}