Search in sources :

Example 1 with NodeType

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;
}
Also used : NotExistsOp(uk.me.parabola.mkgmap.osmstyle.eval.NotExistsOp) Op(uk.me.parabola.mkgmap.osmstyle.eval.Op) GTEOp(uk.me.parabola.mkgmap.osmstyle.eval.GTEOp) LTOp(uk.me.parabola.mkgmap.osmstyle.eval.LTOp) NotEqualOp(uk.me.parabola.mkgmap.osmstyle.eval.NotEqualOp) BinaryOp(uk.me.parabola.mkgmap.osmstyle.eval.BinaryOp) OrOp(uk.me.parabola.mkgmap.osmstyle.eval.OrOp) NotOp(uk.me.parabola.mkgmap.osmstyle.eval.NotOp) ValueOp(uk.me.parabola.mkgmap.osmstyle.eval.ValueOp) EqualsOp(uk.me.parabola.mkgmap.osmstyle.eval.EqualsOp) RegexOp(uk.me.parabola.mkgmap.osmstyle.eval.RegexOp) ExistsOp(uk.me.parabola.mkgmap.osmstyle.eval.ExistsOp) AndOp(uk.me.parabola.mkgmap.osmstyle.eval.AndOp) NodeType(uk.me.parabola.mkgmap.osmstyle.eval.NodeType) BinaryOp(uk.me.parabola.mkgmap.osmstyle.eval.BinaryOp)

Aggregations

AndOp (uk.me.parabola.mkgmap.osmstyle.eval.AndOp)1 BinaryOp (uk.me.parabola.mkgmap.osmstyle.eval.BinaryOp)1 EqualsOp (uk.me.parabola.mkgmap.osmstyle.eval.EqualsOp)1 ExistsOp (uk.me.parabola.mkgmap.osmstyle.eval.ExistsOp)1 GTEOp (uk.me.parabola.mkgmap.osmstyle.eval.GTEOp)1 LTOp (uk.me.parabola.mkgmap.osmstyle.eval.LTOp)1 NodeType (uk.me.parabola.mkgmap.osmstyle.eval.NodeType)1 NotEqualOp (uk.me.parabola.mkgmap.osmstyle.eval.NotEqualOp)1 NotExistsOp (uk.me.parabola.mkgmap.osmstyle.eval.NotExistsOp)1 NotOp (uk.me.parabola.mkgmap.osmstyle.eval.NotOp)1 Op (uk.me.parabola.mkgmap.osmstyle.eval.Op)1 OrOp (uk.me.parabola.mkgmap.osmstyle.eval.OrOp)1 RegexOp (uk.me.parabola.mkgmap.osmstyle.eval.RegexOp)1 ValueOp (uk.me.parabola.mkgmap.osmstyle.eval.ValueOp)1