use of org.apache.asterix.lang.common.base.ILangExpression in project asterixdb by apache.
the class CloneAndSubstituteVariablesVisitor method visit.
@Override
public Pair<ILangExpression, VariableSubstitutionEnvironment> visit(ListConstructor lc, VariableSubstitutionEnvironment env) throws CompilationException {
List<Expression> oldExprList = lc.getExprList();
List<Expression> exprs = VariableCloneAndSubstitutionUtil.visitAndCloneExprList(oldExprList, env, this);
ListConstructor c = new ListConstructor(lc.getType(), exprs);
return new Pair<>(c, env);
}
use of org.apache.asterix.lang.common.base.ILangExpression in project asterixdb by apache.
the class CloneAndSubstituteVariablesVisitor method visit.
@Override
public Pair<ILangExpression, VariableSubstitutionEnvironment> visit(OperatorExpr op, VariableSubstitutionEnvironment env) throws CompilationException {
List<Expression> oldExprList = op.getExprList();
List<Expression> exprs = new ArrayList<>(oldExprList.size());
for (Expression e : oldExprList) {
Pair<ILangExpression, VariableSubstitutionEnvironment> p1 = e.accept(this, env);
exprs.add((Expression) p1.first);
}
OperatorExpr oe = new OperatorExpr(exprs, op.getExprBroadcastIdx(), op.getOpList(), op.isCurrentop());
return new Pair<>(oe, env);
}
use of org.apache.asterix.lang.common.base.ILangExpression in project asterixdb by apache.
the class CloneAndSubstituteVariablesVisitor method visit.
@Override
public Pair<ILangExpression, VariableSubstitutionEnvironment> visit(FieldAccessor fa, VariableSubstitutionEnvironment env) throws CompilationException {
Pair<ILangExpression, VariableSubstitutionEnvironment> p = fa.getExpr().accept(this, env);
FieldAccessor newF = new FieldAccessor((Expression) p.first, fa.getIdent());
return new Pair<>(newF, p.second);
}
use of org.apache.asterix.lang.common.base.ILangExpression in project asterixdb by apache.
the class VariableCloneAndSubstitutionUtil method visitAndCloneExprList.
public static List<Expression> visitAndCloneExprList(List<Expression> oldExprList, VariableSubstitutionEnvironment arg, CloneAndSubstituteVariablesVisitor visitor) throws CompilationException {
List<Expression> exprs = new ArrayList<>(oldExprList.size());
for (Expression e : oldExprList) {
Pair<ILangExpression, VariableSubstitutionEnvironment> p1 = e.accept(visitor, arg);
exprs.add((Expression) p1.first);
}
return exprs;
}
use of org.apache.asterix.lang.common.base.ILangExpression in project asterixdb by apache.
the class AQLCloneAndSubstituteVariablesVisitor method visit.
@Override
public Pair<ILangExpression, VariableSubstitutionEnvironment> visit(UnionExpr u, VariableSubstitutionEnvironment env) throws CompilationException {
List<Expression> exprList = VariableCloneAndSubstitutionUtil.visitAndCloneExprList(u.getExprs(), env, this);
UnionExpr newU = new UnionExpr(exprList);
return new Pair<ILangExpression, VariableSubstitutionEnvironment>(newU, env);
}
Aggregations