use of uk.me.parabola.mkgmap.osmstyle.eval.NodeType in project mkgmap by openstreetmap.
the class RulesTest method checkNotLength.
public static boolean checkNotLength(Op expr, boolean hasNot) {
if (expr == null)
return false;
Op f = expr.getFirst();
if (hasNot && f != null && f.isType(FUNCTION) && Objects.equals(f.toString(), "length()"))
return true;
boolean invalid = false;
NodeType t = expr.getType();
if (expr instanceof BinaryOp) {
if (checkNotLength(expr.getFirst(), hasNot))
invalid = true;
if (checkNotLength(expr.getSecond(), hasNot))
invalid = true;
} else if (t == NOT) {
if (checkNotLength(expr.getFirst(), true))
invalid = true;
}
return invalid;
}
Aggregations