@Override public WhereClause visit(WhereClause whereClause, Void arg) throws CompilationException { WhereClause copy = new WhereClause((Expression) whereClause.getWhereExpr().accept(this, arg)); copy.setSourceLocation(whereClause.getSourceLocation()); return copy; }
@Override public LimitClause visit(LimitClause limitClause, Void arg) throws CompilationException { Expression limitExpr = (Expression) limitClause.getLimitExpr().accept(this, arg); Expression offsetExpr = limitClause.hasOffset() ? (Expression) limitClause.getOffset().accept(this, arg) : null; LimitClause copy = new LimitClause(limitExpr, offsetExpr); copy.setSourceLocation(limitClause.getSourceLocation()); return copy; }
@Override public boolean equals(Object object) { if (this == object) { return true; } if (!(object instanceof WhereClause)) { return false; } WhereClause whereClause = (WhereClause) object; return whereExpr.equals(whereClause.getWhereExpr()); } }
@Override public Expression visit(LimitClause limitClause, ILangExpression arg) throws CompilationException { limitClause.setLimitExpr(visit(limitClause.getLimitExpr(), limitClause)); if (limitClause.hasOffset()) { limitClause.setOffset(visit(limitClause.getOffset(), limitClause)); } return null; }
@Override public Expression visit(WhereClause whereClause, ILangExpression arg) throws CompilationException { whereClause.setWhereExpr(visit(whereClause.getWhereExpr(), whereClause)); return null; }
@Override public Expression visit(LetClause letClause, ILangExpression arg) throws CompilationException { letClause.setBindingExpr(visit(letClause.getBindingExpr(), letClause)); return null; }
@Override public Expression visit(OrderbyClause oc, ILangExpression arg) throws CompilationException { oc.setOrderbyList(visit(oc.getOrderbyList(), arg)); return null; }
@Override public Void visit(LimitClause lc, Void arg) throws CompilationException { lc.getLimitExpr().accept(this, arg); if (lc.getOffset() != null) { lc.getOffset().accept(this, arg); } return null; }
@Override public Void visit(LetClause lc, Void arg) throws CompilationException { lc.getBindingExpr().accept(this, arg); return null; }
@Override public Void visit(OrderbyClause oc, Void arg) throws CompilationException { for (Expression e : oc.getOrderbyList()) { e.accept(this, arg); } return null; }
@Override public Void visit(SelectExpression selectStatement, Void arg) throws CompilationException { selectStatement.getSelectSetOperation().accept(this, arg); if (selectStatement.hasOrderby()) { selectStatement.getOrderbyClause().accept(this, arg); } if (selectStatement.hasLimit()) { selectStatement.getLimitClause().accept(this, arg); } return null; }
@Override public Expression visit(LimitClause limitClause, ILangExpression arg) throws CompilationException { limitClause.setLimitExpr(visit(limitClause.getLimitExpr(), limitClause)); if (limitClause.hasOffset()) { limitClause.setOffset(visit(limitClause.getOffset(), limitClause)); } return null; }
@Override public Expression visit(WhereClause whereClause, ILangExpression arg) throws CompilationException { whereClause.setWhereExpr(visit(whereClause.getWhereExpr(), whereClause)); return null; }
@Override public Boolean visit(LetClause lc, List<FunctionDecl> arg) throws CompilationException { Pair<Boolean, Expression> p = inlineUdfsInExpr(lc.getBindingExpr(), arg); lc.setBindingExpr(p.second); return p.first; }
@Override public Expression visit(OrderbyClause oc, ILangExpression arg) throws CompilationException { oc.setOrderbyList(visit(oc.getOrderbyList(), arg)); return null; }
@Override public Void visit(LetClause letClause, Collection<VariableExpr> freeVars) throws CompilationException { letClause.getBindingExpr().accept(this, freeVars); return null; }
@Override public Void visit(WhereClause whereClause, Collection<VariableExpr> freeVars) throws CompilationException { whereClause.getWhereExpr().accept(this, freeVars); return null; }
@Override public Boolean visit(LimitClause lc, List<FunctionDecl> arg) throws CompilationException { Pair<Boolean, Expression> p1 = inlineUdfsInExpr(lc.getLimitExpr(), arg); lc.setLimitExpr(p1.second); boolean changed = p1.first; if (lc.getOffset() != null) { Pair<Boolean, Expression> p2 = inlineUdfsInExpr(lc.getOffset(), arg); lc.setOffset(p2.second); changed = changed || p2.first; } return changed; }
@Override public Boolean visit(WhereClause wc, List<FunctionDecl> arg) throws CompilationException { Pair<Boolean, Expression> p = inlineUdfsInExpr(wc.getWhereExpr(), arg); wc.setWhereExpr(p.second); return p.first; }
@Override public Void visit(LetClause lc, Void arg) throws CompilationException { lc.getBindingExpr().accept(this, arg); return null; }