use of catdata.aql.exp.ColimSchExp.ColimSchExpWrap in project fql by CategoricalData.
the class CombinatorParser method colimSchExp.
@SuppressWarnings({ "rawtypes", "unchecked" })
private static void colimSchExp() {
Parser<List<catdata.Pair<LocStr, SchExp<?, ?, ?, ?, ?>>>> nodes = Parsers.tuple(token("nodes"), env(sch_ref.lazy(), "->")).map(x -> x.b);
Parser<List<catdata.Pair<LocStr, MapExp<?, ?, ?, ?, ?, ?, ?, ?>>>> edges = Parsers.tuple(token("edges"), env(map_ref.lazy(), "->")).map(x -> x.b);
Parser<Tuple4<Object, List<catdata.Pair<LocStr, SchExp<?, ?, ?, ?, ?>>>, List<catdata.Pair<LocStr, MapExp<?, ?, ?, ?, ?, ?, ?, ?>>>, List<catdata.Pair<String, String>>>> pa = Parsers.tuple(Parsers.always(), nodes.optional(), edges.optional(), options);
Parser<Tuple5<Token, GraphExp<?, ?>, Token, TyExp<?, ?>, Token>> l = Parsers.tuple(token("literal"), graph_ref.lazy(), token(":"), ty_ref.lazy(), token("{"));
Parser<ColimSchExp<?>> ret = Parsers.tuple(l, pa, token("}")).map(x -> {
// schema graph nodes edges options imports
return new ColimSchExpRaw(x.a.b, x.a.d, Util.newIfNull(x.b.b), Util.newIfNull(x.b.c), x.b.d);
});
Parser<ColimSchExp<?>> ret2 = ident.map(x -> new ColimSchExpVar(x)), ret3 = Parsers.tuple(token("wrap"), colim_ref.lazy(), map_ref.lazy(), map_ref.lazy()).map(x -> new ColimSchExpWrap(x.b, x.c, x.d));
Parser<ColimSchExp<?>> retX = Parsers.or(ret, ret2, ret3, colimExpModify(), colimSchExpQuotient(), parens(colim_ref));
colim_ref.set(retX);
}
Aggregations