use of catdata.aql.exp.TransExp.TransExpCoEvalEvalCoUnit in project fql by CategoricalData.
the class CombinatorParser method transExp.
// TODO aql revisit parser type safety
@SuppressWarnings({ "rawtypes", "unchecked" })
private static void transExp() {
Parser<TransExp<?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?>> var = ident.map(TransExpVar::new), id = Parsers.tuple(token("identity"), inst_ref.lazy()).map(x -> new TransExpId<>(x.b)), sigma = Parsers.tuple(token("sigma"), map_ref.lazy(), trans_ref.lazy(), options.between(token("{"), token("}")).optional(), options.between(token("{"), token("}")).optional()).map(x -> new TransExpSigma(x.b, x.c, x.d == null ? new HashMap<>() : Util.toMapSafely(x.d), x.e == null ? new HashMap<>() : Util.toMapSafely(x.e))), delta = Parsers.tuple(token("delta"), map_ref.lazy(), trans_ref.lazy()).map(x -> new TransExpDelta(x.b, x.c)), unit = Parsers.tuple(token("unit"), map_ref.lazy(), inst_ref.lazy(), options.between(token("{"), token("}")).optional(), options.between(token("{"), token("}")).optional()).map(x -> new TransExpSigmaDeltaUnit(x.b, x.c, x.d == null ? new HashMap<>() : Util.toMapSafely(x.d))), counit = Parsers.tuple(token("counit"), map_ref.lazy(), inst_ref.lazy(), options.between(token("{"), token("}")).optional(), options.between(token("{"), token("}")).optional()).map(x -> new TransExpSigmaDeltaCounit(x.b, x.c, x.d == null ? new HashMap<>() : Util.toMapSafely(x.d))), distinct = Parsers.tuple(token("distinct"), trans_ref.lazy()).map(x -> new TransExpDistinct(x.b)), eval = Parsers.tuple(token("eval"), query_ref.lazy(), trans_ref.lazy()).map(x -> new TransExpEval(x.b, x.c)), coeval = Parsers.tuple(token("coeval"), query_ref.lazy(), trans_ref.lazy(), options.between(token("{"), token("}")).optional(), options.between(token("{"), token("}")).optional()).map(x -> new TransExpCoEval(x.b, x.c, x.d == null ? new LinkedList<>() : x.d, x.e == null ? new LinkedList<>() : x.e)), unitq = Parsers.tuple(token("unit_query"), query_ref.lazy(), inst_ref.lazy(), // token("}")).optional(),
options.between(token("{"), token("}")).optional()).map(x -> new TransExpCoEvalEvalUnit(x.b, x.c, x.d == null ? new HashMap<>() : Util.toMapSafely(x.d))), counitq = Parsers.tuple(token("counit_query"), query_ref.lazy(), inst_ref.lazy(), // token("}")).optional(),
options.between(token("{"), token("}")).optional()).map(x -> new TransExpCoEvalEvalCoUnit(x.b, x.c, x.d == null ? new HashMap<>() : Util.toMapSafely(x.d))), comp = Parsers.tuple(token("["), trans_ref.lazy(), token(";"), trans_ref.lazy(), token("]")).map(x -> new TransExpCompose(x.b, x.d));
Parser ret = Parsers.or(id, transExpRaw(), var, sigma, delta, unit, counit, distinct, eval, coeval, transExpCsv(), unitq, counitq, transExpJdbc(), comp, parens(trans_ref));
trans_ref.set(ret);
}
Aggregations