private static final Expr THIS_COL_VALUE = new Expr() {
- @Override public boolean isPure() {
+ @Override public boolean isConstant() {
return false;
}
@Override public Value eval(EvalContext ctx) {
}
Expr expr = parseExpression(new TokBuf(exprType, tokens, context), false);
- return (expr.isPure() ?
+ return (expr.isConstant() ?
// for now, just cache at top-level for speed (could in theory cache
// intermediate values?)
new MemoizedExprWrapper(exprType, expr) :
return paramVals;
}
- private static boolean arePure(List<Expr> exprs) {
+ private static boolean areConstant(List<Expr> exprs) {
for(Expr expr : exprs) {
- if(!expr.isPure()) {
+ if(!expr.isConstant()) {
return false;
}
}
return true;
}
- private static boolean arePure(Expr... exprs) {
+ private static boolean areConstant(Expr... exprs) {
for(Expr expr : exprs) {
- if(!expr.isPure()) {
+ if(!expr.isConstant()) {
return false;
}
}
return outerExpr;
}
- public abstract boolean isPure();
+ public abstract boolean isConstant();
public abstract Value eval(EvalContext ctx);
}
@Override
- public boolean isPure() {
+ public boolean isConstant() {
return true;
}
}
@Override
- public boolean isPure() {
+ public boolean isConstant() {
return true;
}
}
@Override
- public boolean isPure() {
+ public boolean isConstant() {
return false;
}
}
@Override
- public boolean isPure() {
- return _expr.isPure();
+ public boolean isConstant() {
+ return _expr.isConstant();
}
@Override
}
@Override
- public boolean isPure() {
- return _func.isPure() && arePure(_params);
+ public boolean isConstant() {
+ return _func.isPure() && areConstant(_params);
}
@Override
}
@Override
- public boolean isPure() {
- return arePure(_left, _right);
+ public boolean isConstant() {
+ return areConstant(_left, _right);
}
public OpType getOp() {
}
@Override
- public boolean isPure() {
- return _expr.isPure();
+ public boolean isConstant() {
+ return _expr.isConstant();
}
public OpType getOp() {
}
@Override
- public boolean isPure() {
- return _expr.isPure();
+ public boolean isConstant() {
+ return _expr.isConstant();
}
public OpType getOp() {
}
@Override
- public boolean isPure() {
- return super.isPure() && arePure(_exprs);
+ public boolean isConstant() {
+ return super.isConstant() && areConstant(_exprs);
}
@Override
}
@Override
- public boolean isPure() {
- return _expr.isPure() && arePure(_startRangeExpr, _endRangeExpr);
+ public boolean isConstant() {
+ return _expr.isConstant() && areConstant(_startRangeExpr, _endRangeExpr);
}
public Expr getRight() {
return _expr.toDebugString();
}
- public boolean isPure() {
- return _expr.isPure();
+ public boolean isConstant() {
+ return _expr.isConstant();
}
@Override