Search in sources :

Example 1 with InstExpCoProdSigma

use of catdata.aql.exp.InstExp.InstExpCoProdSigma in project fql by CategoricalData.

the class CombinatorParser method instExpCoProd.

@SuppressWarnings({ "rawtypes", "unchecked" })
private static Parser<InstExpCoProdSigma> instExpCoProd() {
    Parser<catdata.Pair<MapExp, InstExp>> p = Parsers.tuple(map_ref.lazy(), inst_ref.lazy()).map(x -> new catdata.Pair<>(x.a, x.b));
    Parser<InstExpCoProdSigma> ret = Parsers.tuple(token("coproduct_sigma"), p.many(), token(":"), sch_ref.lazy(), options.between(token("{"), token("}")).optional()).map(x -> new InstExpCoProdSigma(x.b, x.d, Util.newIfNull(x.e)));
    // 
    Parser<InstExpCoProdSigma> ret2 = Parsers.tuple(token("union"), inst_ref.lazy().sepBy(token("+")), token(":"), sch_ref.lazy(), options.between(token("{"), token("}")).optional()).map(x -> new InstExpCoProdSigma(x.b.stream().map(y -> new catdata.Pair<>(new MapExpId(x.d), y)).collect(Collectors.toList()), x.d, Util.newIfNull(x.e)));
    return Parsers.or(ret, ret2);
}
Also used : InstExpCoProdSigma(catdata.aql.exp.InstExp.InstExpCoProdSigma) AqlOptions(catdata.aql.AqlOptions) PragmaExpProc(catdata.aql.exp.PragmaExp.PragmaExpProc) Scanners(org.jparsec.Scanners) InstExpDelta(catdata.aql.exp.InstExp.InstExpDelta) GraphExpVar(catdata.aql.exp.GraphExp.GraphExpVar) GraphExpRaw(catdata.aql.exp.GraphExp.GraphExpRaw) StringLiteral(org.jparsec.Terminals.StringLiteral) EdsExpVar(catdata.aql.exp.EdsExp.EdsExpVar) SchExpInst(catdata.aql.exp.SchExp.SchExpInst) Pair(org.jparsec.functors.Pair) TransExpSigmaDeltaCounit(catdata.aql.exp.TransExp.TransExpSigmaDeltaCounit) QueryExpCompose(catdata.aql.exp.QueryExp.QueryExpCompose) PragmaExpConsistent(catdata.aql.exp.PragmaExp.PragmaExpConsistent) ParseException(catdata.ParseException) Quad(catdata.Quad) PragmaExpSql(catdata.aql.exp.PragmaExp.PragmaExpSql) SchExpVar(catdata.aql.exp.SchExp.SchExpVar) Parser(org.jparsec.Parser) InstExpColim(catdata.aql.exp.InstExp.InstExpColim) QueryExpDeltaCoEval(catdata.aql.exp.QueryExp.QueryExpDeltaCoEval) IntegerLiteral(org.jparsec.Terminals.IntegerLiteral) Program(catdata.Program) Triple(catdata.Triple) PragmaExpJs(catdata.aql.exp.PragmaExp.PragmaExpJs) PragmaExpCheck(catdata.aql.exp.PragmaExp.PragmaExpCheck) Ty(catdata.aql.exp.TyExpRaw.Ty) Terminals(org.jparsec.Terminals) PragmaExpMatch(catdata.aql.exp.PragmaExp.PragmaExpMatch) MapExpVar(catdata.aql.exp.MapExp.MapExpVar) TransExpDistinct(catdata.aql.exp.TransExp.TransExpDistinct) TyExpEmpty(catdata.aql.exp.TyExp.TyExpEmpty) TransExpVar(catdata.aql.exp.TransExp.TransExpVar) ColimSchExpQuotient(catdata.aql.exp.ColimSchExp.ColimSchExpQuotient) Token(org.jparsec.Token) PragmaExpToCsvInst(catdata.aql.exp.PragmaExp.PragmaExpToCsvInst) MapExpComp(catdata.aql.exp.MapExp.MapExpComp) InstExpCoEq(catdata.aql.exp.InstExp.InstExpCoEq) InstExpCod(catdata.aql.exp.InstExp.InstExpCod) InstExpCoProdFull(catdata.aql.exp.InstExp.InstExpCoProdFull) Att(catdata.aql.exp.SchExpRaw.Att) TransExpCoEvalEvalCoUnit(catdata.aql.exp.TransExp.TransExpCoEvalEvalCoUnit) TransExpDelta(catdata.aql.exp.TransExp.TransExpDelta) SchExpEmpty(catdata.aql.exp.SchExp.SchExpEmpty) ParserException(org.jparsec.error.ParserException) PragmaExpToJdbcTrans(catdata.aql.exp.PragmaExp.PragmaExpToJdbcTrans) Trans(catdata.aql.exp.QueryExpRaw.Trans) SchExpCod(catdata.aql.exp.SchExp.SchExpCod) InstExpChase(catdata.aql.exp.InstExp.InstExpChase) PragmaExpToJdbcQuery(catdata.aql.exp.PragmaExp.PragmaExpToJdbcQuery) InstExpFrozen(catdata.aql.exp.InstExp.InstExpFrozen) Sym(catdata.aql.exp.TyExpRaw.Sym) Tuple3(org.jparsec.functors.Tuple3) PragmaExpVar(catdata.aql.exp.PragmaExp.PragmaExpVar) Tuple4(org.jparsec.functors.Tuple4) Tuple5(org.jparsec.functors.Tuple5) InstExpAnonymize(catdata.aql.exp.InstExp.InstExpAnonymize) InstExpSigma(catdata.aql.exp.InstExp.InstExpSigma) TransExpEval(catdata.aql.exp.TransExp.TransExpEval) InstExpCoProdSigma(catdata.aql.exp.InstExp.InstExpCoProdSigma) InstExpVar(catdata.aql.exp.InstExp.InstExpVar) PreBlock(catdata.aql.exp.QueryExpRaw.PreBlock) TransExpSigmaDeltaUnit(catdata.aql.exp.TransExp.TransExpSigmaDeltaUnit) EdExpRaw(catdata.aql.exp.EdsExpRaw.EdExpRaw) Collectors(java.util.stream.Collectors) List(java.util.List) InstExpDom(catdata.aql.exp.InstExp.InstExpDom) Parsers(org.jparsec.Parsers) InstExpCoEval(catdata.aql.exp.InstExp.InstExpCoEval) TransExpSigma(catdata.aql.exp.TransExp.TransExpSigma) TransExpId(catdata.aql.exp.TransExp.TransExpId) MapExpId(catdata.aql.exp.MapExp.MapExpId) RawTerm(catdata.aql.RawTerm) En(catdata.aql.exp.SchExpRaw.En) InstExpSigmaChase(catdata.aql.exp.InstExp.InstExpSigmaChase) HashMap(java.util.HashMap) QueryExpDeltaEval(catdata.aql.exp.QueryExp.QueryExpDeltaEval) InstExpPi(catdata.aql.exp.InstExp.InstExpPi) ColimSchExpVar(catdata.aql.exp.ColimSchExp.ColimSchExpVar) ColimSchExpRaw(catdata.aql.exp.ColimSchExp.ColimSchExpRaw) PragmaExpLoadJars(catdata.aql.exp.PragmaExp.PragmaExpLoadJars) LinkedList(java.util.LinkedList) PragmaExpToCsvTrans(catdata.aql.exp.PragmaExp.PragmaExpToCsvTrans) Fk(catdata.aql.exp.SchExpRaw.Fk) TyExpSch(catdata.aql.exp.TyExp.TyExpSch) Reference(org.jparsec.Parser.Reference) ColimSchExpWrap(catdata.aql.exp.ColimSchExp.ColimSchExpWrap) Util(catdata.Util) QueryExpId(catdata.aql.exp.QueryExp.QueryExpId) QueryExpVar(catdata.aql.exp.QueryExp.QueryExpVar) InstExpEval(catdata.aql.exp.InstExp.InstExpEval) TransExpCoEval(catdata.aql.exp.TransExp.TransExpCoEval) TyExpVar(catdata.aql.exp.TyExp.TyExpVar) Identifier(org.jparsec.Terminals.Identifier) InstExpDistinct(catdata.aql.exp.InstExp.InstExpDistinct) PragmaExpToJdbcInst(catdata.aql.exp.PragmaExp.PragmaExpToJdbcInst) TransExpCoEvalEvalUnit(catdata.aql.exp.TransExp.TransExpCoEvalEvalUnit) Collections(java.util.Collections) InstExpEmpty(catdata.aql.exp.InstExp.InstExpEmpty) MapExpId(catdata.aql.exp.MapExp.MapExpId) Pair(org.jparsec.functors.Pair)

Aggregations

ParseException (catdata.ParseException)1 Program (catdata.Program)1 Quad (catdata.Quad)1 Triple (catdata.Triple)1 Util (catdata.Util)1 AqlOptions (catdata.aql.AqlOptions)1 RawTerm (catdata.aql.RawTerm)1 ColimSchExpQuotient (catdata.aql.exp.ColimSchExp.ColimSchExpQuotient)1 ColimSchExpRaw (catdata.aql.exp.ColimSchExp.ColimSchExpRaw)1 ColimSchExpVar (catdata.aql.exp.ColimSchExp.ColimSchExpVar)1 ColimSchExpWrap (catdata.aql.exp.ColimSchExp.ColimSchExpWrap)1 EdsExpVar (catdata.aql.exp.EdsExp.EdsExpVar)1 EdExpRaw (catdata.aql.exp.EdsExpRaw.EdExpRaw)1 GraphExpRaw (catdata.aql.exp.GraphExp.GraphExpRaw)1 GraphExpVar (catdata.aql.exp.GraphExp.GraphExpVar)1 InstExpAnonymize (catdata.aql.exp.InstExp.InstExpAnonymize)1 InstExpChase (catdata.aql.exp.InstExp.InstExpChase)1 InstExpCoEq (catdata.aql.exp.InstExp.InstExpCoEq)1 InstExpCoEval (catdata.aql.exp.InstExp.InstExpCoEval)1 InstExpCoProdFull (catdata.aql.exp.InstExp.InstExpCoProdFull)1