Search in sources :

Example 1 with MplVar

use of catdata.mpl.Mpl.MplExp.MplVar in project fql by CategoricalData.

the class MplParser method toExp.

private static MplExp<String, String> toExp(Object o) {
    if (o instanceof String) {
        return new MplVar<>((String) o);
    }
    if (o instanceof Tuple3) {
        Tuple3 t = (Tuple3) o;
        return new MplEval<>((String) t.b, toTerm(t.c));
    }
    if (o instanceof org.jparsec.functors.Pair) {
        org.jparsec.functors.Pair p = (org.jparsec.functors.Pair) o;
        if (p.a.toString().equals("theory")) {
            return toTheory(p.b);
        }
        MplEval<String, String> ret = new MplEval<>((String) p.a, toTerm(p.b));
        return ret;
    }
    throw new RuntimeException();
// }
// return toTheory(o);
}
Also used : MplEval(catdata.mpl.Mpl.MplExp.MplEval) Tuple3(org.jparsec.functors.Tuple3) MplVar(catdata.mpl.Mpl.MplExp.MplVar) MplPair(catdata.mpl.Mpl.MplTerm.MplPair) Pair(catdata.Pair)

Aggregations

Pair (catdata.Pair)1 MplEval (catdata.mpl.Mpl.MplExp.MplEval)1 MplVar (catdata.mpl.Mpl.MplExp.MplVar)1 MplPair (catdata.mpl.Mpl.MplTerm.MplPair)1 Tuple3 (org.jparsec.functors.Tuple3)1