]> gerrit.simantics Code Review - simantics/platform.git/blob
2cb0d64fd072e10d32b89858c28d6623acd1908f
[simantics/platform.git] /
1 package org.simantics.scl.compiler.elaboration.chr.relations;
2
3 import org.simantics.scl.compiler.elaboration.chr.CHRRelation;
4 import org.simantics.scl.compiler.types.TVar;
5 import org.simantics.scl.compiler.types.Type;
6 import org.simantics.scl.compiler.types.Types;
7
8 public enum SpecialCHRRelation implements CHRRelation {    
9     EQUALS(A, A),
10     MEMBER(A, Types.list(A)),
11     CHECK(Types.BOOLEAN),
12     EXECUTE(Types.UNIT);
13     
14     private final TVar[] typeVariables;
15     private final Type[] parameterTypes;
16     
17     private SpecialCHRRelation(Type ... parameterTypes) {
18         this.typeVariables = Types.freeVarsArray(parameterTypes);
19         this.parameterTypes = parameterTypes;
20     }
21
22     @Override
23     public TVar[] getTypeVariables() {
24         return typeVariables;
25     }
26     
27     @Override
28     public Type[] getParameterTypes() {
29         return parameterTypes;
30     }
31 }