]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/relations/SCLRelation.java
Merge "Resolve some dependency problems with SDK features"
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / elaboration / relations / SCLRelation.java
index 7b2f2a19e840e6f8dbde246e8631f99925ae3353..e93ff6e8fe16a7b5eb1aeb5a45164a86302c0be2 100644 (file)
@@ -1,9 +1,12 @@
 package org.simantics.scl.compiler.elaboration.relations;
 
+import org.simantics.scl.compiler.elaboration.chr.plan.PlanContext;
 import org.simantics.scl.compiler.elaboration.expressions.Expression;
 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.internal.codegen.writer.CodeWriter;
+import org.simantics.scl.compiler.types.TPred;
 import org.simantics.scl.compiler.types.TVar;
 import org.simantics.scl.compiler.types.Type;
 
@@ -28,8 +31,11 @@ public interface SCLRelation {
     
     TVar[] getTypeVariables();
     Type[] getParameterTypes();
+    default TPred[] getTypeConstraints() {
+        return TPred.EMPTY_ARRAY;
+    }
     int getPhase();
-    
+
     double getSelectivity(int boundVariables);
     int getRequiredVariablesMask();
     void generate(long location,
@@ -39,5 +45,22 @@ public interface SCLRelation {
     Expression generateEnforce(long location, EnforcingContext context,
             Type[] typeParameters,
             Variable[] parameters);
-
+    default String[] getFieldNames() {
+        return null;
+    }
+    
+    void generateIterate(
+            PlanContext context,
+            CodeWriter w,
+            long location,
+            int boundMask,
+            Variable[] variables,
+            Expression[] expressions,
+            Expression[] typeConstraintEvidenceParameters);
+    void generateEnforce(
+            PlanContext context,
+            CodeWriter w,
+            long location,
+            Expression[] parameters,
+            Expression[] typeConstraintEvidenceParameters);
 }