\r
import org.simantics.db.Resource;\r
import org.simantics.scl.compiler.common.names.Name;\r
+import org.simantics.scl.compiler.common.names.Names;\r
+import org.simantics.scl.compiler.elaboration.chr.plan.PlanContext;\r
import org.simantics.scl.compiler.elaboration.expressions.EApply;\r
import org.simantics.scl.compiler.elaboration.expressions.EExternalConstant;\r
import org.simantics.scl.compiler.elaboration.expressions.EVariable;\r
import org.simantics.scl.compiler.elaboration.query.compilation.EnforcingContext;\r
import org.simantics.scl.compiler.elaboration.query.compilation.QueryCompilationContext;\r
import org.simantics.scl.compiler.elaboration.relations.SCLRelation;\r
+import org.simantics.scl.compiler.environment.Environment;\r
import org.simantics.scl.compiler.errors.Locations;\r
+import org.simantics.scl.compiler.internal.codegen.writer.CodeWriter;\r
import org.simantics.scl.compiler.types.TVar;\r
import org.simantics.scl.compiler.types.Type;\r
import org.simantics.scl.compiler.types.Types;\r
Expression possibleValue = new EApply(\r
Locations.NO_LOCATION,\r
Types.READ_GRAPH,\r
- context.getTypingContext().getConstant(POSSIBLE_RELATED_VALUE, valueType),\r
+ context.getCompilationContext().getConstant(POSSIBLE_RELATED_VALUE, valueType),\r
context.getEvidence(location, Types.pred(Types.SERIALIZABLE, valueType)),\r
new EVariable(parameters[0]),\r
new EExternalConstant(propertyRelation, RESOURCE)\r
case BB: {\r
Variable temp = new Variable("temp", valueType);\r
context.condition(new EApply(\r
- context.getTypingContext().getConstant(Name.create("Prelude", "=="), valueType),\r
+ context.getCompilationContext().getConstant(Names.Builtin_equals, valueType),\r
new Expression[] {\r
- context.getEvidence(location, Types.pred(Types.EQ, valueType)),\r
new EVariable(temp),\r
new EVariable(parameters[1])\r
}\r
return new EApply(\r
Locations.NO_LOCATION,\r
Types.WRITE_GRAPH,\r
- context.getTypingContext().getConstant(CLAIM_RELATED_VALUE, valueType),\r
+ context.getCompilationContext().getConstant(CLAIM_RELATED_VALUE, valueType),\r
context.getEvidence(location, Types.pred(Types.SERIALIZABLE, valueType)),\r
new EVariable(parameters[0]),\r
new EExternalConstant(propertyRelation, RESOURCE),\r
return 0;\r
}\r
\r
+ @Override\r
+ public void generateEnforce(PlanContext context, CodeWriter w, long location, Expression[] parameters) {\r
+ throw new UnsupportedOperationException(getClass().getSimpleName() + " does not support enforce.");\r
+ }\r
+ \r
+ @Override\r
+ public void generateIterate(PlanContext context, CodeWriter w, long location, int boundMask, Variable[] variables,\r
+ Expression[] expressions) {\r
+ throw new UnsupportedOperationException(getClass().getSimpleName() + " does not support iterate.");\r
+ }\r
}\r