@Override public void visit(OpFilter opFilter) { Op subOp = null ; if ( opFilter.getSubOp() != null ) subOp = pop(opStack) ; ExprList ex = opFilter.getExprs() ; if ( ex == null || ex.isEmpty() ) { // No expressions. // Doesn't normally happen but this code is safe in these cases. push(opStack, opFilter.apply(opTransform, subOp)) ; return ; } // ex2 is the same length as ex. ExprList ex2 = collect(ex) ; OpFilter f = opFilter ; if ( ex != ex2 || opFilter.getSubOp() != subOp ) { f = OpFilter.filterAlways(ex2, subOp) ; // If we removed a layer of filter, then subOp needs changing // else f-subOp is subOp anyway. subOp = f.getSubOp() ; } push(opStack, f.apply(opTransform, subOp)) ; }