All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.intelie.pipes.ast.CallVisitor Maven / Gradle / Ivy

There is a newer version: 0.25.5
Show newest version
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);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy