use of org.apache.asterix.lang.sqlpp.clause.FromTerm in project asterixdb by apache.
the class FreeVariableVisitor method visit.
@Override
public Void visit(FromClause fromClause, Collection<VariableExpr> freeVars) throws CompilationException {
Collection<VariableExpr> bindingVars = new HashSet<>();
for (FromTerm fromTerm : fromClause.getFromTerms()) {
Collection<VariableExpr> fromTermFreeVars = new HashSet<>();
fromTerm.accept(this, fromTermFreeVars);
// Since a right from term can refer to variables defined in a left from term,
// we remove binding variables from the free variables.
fromTermFreeVars.removeAll(bindingVars);
// Adds binding variables.
bindingVars.addAll(SqlppVariableUtil.getBindingVariables(fromTerm));
// Adds into freeVars.
freeVars.addAll(fromTermFreeVars);
}
return null;
}
Aggregations