Search in sources :

Example 1 with XBool

use of catdata.fpql.XExp.XBool in project fql by CategoricalData.

the class XParser method toWhere.

private static XBool toWhere(Object o) {
    if (o instanceof Tuple5) {
        Tuple5 o2 = (Tuple5) o;
        boolean isAnd = o2.c.toString().equals("and");
        return new XBool(toWhere(o2.b), toWhere(o2.d), isAnd);
    }
    if (o instanceof Tuple3) {
        Tuple3 o2 = (Tuple3) o;
        return new XBool((List<Object>) o2.a, (List<Object>) o2.c);
    }
    if (o instanceof org.jparsec.functors.Pair) {
        org.jparsec.functors.Pair x = (org.jparsec.functors.Pair) o;
        return new XBool(toWhere(x.b));
    }
    if (o.toString().equals("true")) {
        return new XBool(true);
    }
    if (o.toString().equals("false")) {
        return new XBool(false);
    }
    throw new RuntimeException();
}
Also used : Tuple5(org.jparsec.functors.Tuple5) XBool(catdata.fpql.XExp.XBool) Tuple3(org.jparsec.functors.Tuple3) Pair(catdata.Pair) XPair(catdata.fpql.XExp.XPair)

Aggregations

Pair (catdata.Pair)1 XBool (catdata.fpql.XExp.XBool)1 XPair (catdata.fpql.XExp.XPair)1 Tuple3 (org.jparsec.functors.Tuple3)1 Tuple5 (org.jparsec.functors.Tuple5)1