X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.modeling%2Fsrc%2Forg%2Fsimantics%2Fmodeling%2Fscl%2FGraphPropertyRelation.java;h=4e450005b24b100f13b90b2bdeeb576f46a0aca9;hp=45ac24f1c7ad4f5913e933f3448b90f82d9d483f;hb=a8758de5bc19e5adb3f618d3038743a164f09912;hpb=12d9af17384d960b75d58c3935d2b7b46d93e87b diff --git a/bundles/org.simantics.modeling/src/org/simantics/modeling/scl/GraphPropertyRelation.java b/bundles/org.simantics.modeling/src/org/simantics/modeling/scl/GraphPropertyRelation.java index 45ac24f1c..4e450005b 100644 --- a/bundles/org.simantics.modeling/src/org/simantics/modeling/scl/GraphPropertyRelation.java +++ b/bundles/org.simantics.modeling/src/org/simantics/modeling/scl/GraphPropertyRelation.java @@ -2,6 +2,8 @@ package org.simantics.modeling.scl; import org.simantics.db.Resource; import org.simantics.scl.compiler.common.names.Name; +import org.simantics.scl.compiler.common.names.Names; +import org.simantics.scl.compiler.elaboration.chr.plan.PlanContext; import org.simantics.scl.compiler.elaboration.expressions.EApply; import org.simantics.scl.compiler.elaboration.expressions.EExternalConstant; import org.simantics.scl.compiler.elaboration.expressions.EVariable; @@ -10,7 +12,9 @@ import org.simantics.scl.compiler.elaboration.expressions.Variable; import org.simantics.scl.compiler.elaboration.query.compilation.EnforcingContext; import org.simantics.scl.compiler.elaboration.query.compilation.QueryCompilationContext; import org.simantics.scl.compiler.elaboration.relations.SCLRelation; +import org.simantics.scl.compiler.environment.Environment; import org.simantics.scl.compiler.errors.Locations; +import org.simantics.scl.compiler.internal.codegen.writer.CodeWriter; import org.simantics.scl.compiler.types.TVar; import org.simantics.scl.compiler.types.Type; import org.simantics.scl.compiler.types.Types; @@ -63,7 +67,7 @@ public class GraphPropertyRelation implements SCLRelation { Expression possibleValue = new EApply( Locations.NO_LOCATION, Types.READ_GRAPH, - context.getTypingContext().getConstant(POSSIBLE_RELATED_VALUE, valueType), + context.getCompilationContext().getConstant(POSSIBLE_RELATED_VALUE, valueType), context.getEvidence(location, Types.pred(Types.SERIALIZABLE, valueType)), new EVariable(parameters[0]), new EExternalConstant(propertyRelation, RESOURCE) @@ -72,9 +76,8 @@ public class GraphPropertyRelation implements SCLRelation { case BB: { Variable temp = new Variable("temp", valueType); context.condition(new EApply( - context.getTypingContext().getConstant(Name.create("Prelude", "=="), valueType), + context.getCompilationContext().getConstant(Names.Builtin_equals, valueType), new Expression[] { - context.getEvidence(location, Types.pred(Types.EQ, valueType)), new EVariable(temp), new EVariable(parameters[1]) } @@ -95,7 +98,7 @@ public class GraphPropertyRelation implements SCLRelation { return new EApply( Locations.NO_LOCATION, Types.WRITE_GRAPH, - context.getTypingContext().getConstant(CLAIM_RELATED_VALUE, valueType), + context.getCompilationContext().getConstant(CLAIM_RELATED_VALUE, valueType), context.getEvidence(location, Types.pred(Types.SERIALIZABLE, valueType)), new EVariable(parameters[0]), new EExternalConstant(propertyRelation, RESOURCE), @@ -108,4 +111,14 @@ public class GraphPropertyRelation implements SCLRelation { return 0; } + @Override + public void generateEnforce(PlanContext context, CodeWriter w, long location, Expression[] parameters) { + throw new UnsupportedOperationException(getClass().getSimpleName() + " does not support enforce."); + } + + @Override + public void generateIterate(PlanContext context, CodeWriter w, long location, int boundMask, Variable[] variables, + Expression[] expressions) { + throw new UnsupportedOperationException(getClass().getSimpleName() + " does not support iterate."); + } }