throw new RuntimeException("not implemented"); //TODO
}
}
private Proposition visitNullPredicate(NullPredicateContext nullPredicate) throws WrappedException, TypeCheckException, RuntimeException {
final Expression operand = visitRowValueConstructor(nullPredicate.rowValueConstructor());
final boolean isNegated = nullPredicate.NOT() != null;
// final String predicateCode;
// if (isNegated) {
// // TODO is this a correct check for IS NOT NULL?
//// predicateCode = "IFERROR(ERROR.TYPE(%s)<>ERROR.TYPE(#REF!),TRUE)";
// predicateCode = Terms.isNotNoValueNull(value)
// } else {
// // TODO extract magic constant to {@link Terms}
// // TODO also extract occurrences in {@link NullTest}
//// predicateCode = "IFERROR(ERROR.TYPE(%s)=ERROR.TYPE(#REF!),FALSE)";
// }
return c(new PropositionalLogic.Elementary.Coded() {
@Override
public String code(ColumnIndexes columnIndexes) {
// return String.format(predicateCode, operand.code(columnIndexes));
if (isNegated) {
return Terms.isNotNoValueNull(operand.code(columnIndexes));
} else {
return Terms.isNoValueNull(operand.code(columnIndexes));
}
}
});
}