Search in sources :

Example 1 with FreeVariableVisitor

use of org.apache.asterix.lang.sqlpp.visitor.FreeVariableVisitor in project asterixdb by apache.

the class SqlppRewriteUtil method getFreeVariable.

public static Set<VariableExpr> getFreeVariable(Expression expr) throws CompilationException {
    Set<VariableExpr> vars = new HashSet<>();
    FreeVariableVisitor visitor = new FreeVariableVisitor();
    expr.accept(visitor, vars);
    return vars;
}
Also used : VariableExpr(org.apache.asterix.lang.common.expression.VariableExpr) FreeVariableVisitor(org.apache.asterix.lang.sqlpp.visitor.FreeVariableVisitor) HashSet(java.util.HashSet)

Example 2 with FreeVariableVisitor

use of org.apache.asterix.lang.sqlpp.visitor.FreeVariableVisitor in project asterixdb by apache.

the class SqlppVariableUtil method getFreeVariables.

public static Collection<VariableExpr> getFreeVariables(ILangExpression langExpr) throws CompilationException {
    Collection<VariableExpr> freeVars = new HashSet<>();
    FreeVariableVisitor visitor = new FreeVariableVisitor();
    langExpr.accept(visitor, freeVars);
    return freeVars;
}
Also used : VariableExpr(org.apache.asterix.lang.common.expression.VariableExpr) FreeVariableVisitor(org.apache.asterix.lang.sqlpp.visitor.FreeVariableVisitor) HashSet(java.util.HashSet)

Aggregations

HashSet (java.util.HashSet)2 VariableExpr (org.apache.asterix.lang.common.expression.VariableExpr)2 FreeVariableVisitor (org.apache.asterix.lang.sqlpp.visitor.FreeVariableVisitor)2