]> gerrit.simantics Code Review - simantics/platform.git/blob
9642762cb220cfa5a247ea7a2a3119e1aadb33aa
[simantics/platform.git] /
1 package org.simantics.scl.compiler.elaboration.relations;
2
3 import org.simantics.scl.compiler.elaboration.chr.plan.PlanContext;
4 import org.simantics.scl.compiler.elaboration.expressions.Expression;
5 import org.simantics.scl.compiler.elaboration.expressions.Variable;
6 import org.simantics.scl.compiler.elaboration.query.compilation.EnforcingContext;
7 import org.simantics.scl.compiler.elaboration.query.compilation.QueryCompilationContext;
8 import org.simantics.scl.compiler.internal.codegen.writer.CodeWriter;
9 import org.simantics.scl.compiler.types.TVar;
10 import org.simantics.scl.compiler.types.Type;
11
12 public interface SCLRelation {
13     
14     public static final int F = 0;
15     public static final int B = 1;
16     
17     public static final int FF = 0;
18     public static final int BF = 1;
19     public static final int FB = 2;
20     public static final int BB = 3;
21     
22     public static final int FFF = 0;
23     public static final int BFF = 1;
24     public static final int FBF = 2;
25     public static final int BBF = 3;
26     public static final int FFB = 4;
27     public static final int BFB = 5;
28     public static final int FBB = 6;
29     public static final int BBB = 7;
30     
31     TVar[] getTypeVariables();
32     Type[] getParameterTypes();
33     int getPhase();
34     
35     double getSelectivity(int boundVariables);
36     int getRequiredVariablesMask();
37     void generate(long location,
38             QueryCompilationContext context,
39             Type[] typeParameters,
40             Variable[] parameters, int boundVariables);
41     Expression generateEnforce(long location, EnforcingContext context,
42             Type[] typeParameters,
43             Variable[] parameters);
44
45     void generateIterate(
46             PlanContext context,
47             CodeWriter w,
48             long location,
49             int boundMask,
50             Variable[] variables,
51             Expression[] expressions);
52     void generateEnforce(
53             PlanContext context,
54             CodeWriter w,
55             long location,
56             Expression[] parameters);
57 }