]> gerrit.simantics Code Review - simantics/platform.git/blob
fc92190a9c5657034cb7e7e9bae0cc203a5cb27e
[simantics/platform.git] /
1 package org.simantics.scl.compiler.elaboration.expressions.block;
2
3 import org.simantics.scl.compiler.elaboration.contexts.EnvironmentalContext;
4 import org.simantics.scl.compiler.elaboration.contexts.TranslationContext;
5 import org.simantics.scl.compiler.elaboration.expressions.Expression;
6 import org.simantics.scl.compiler.errors.Locations;
7 import org.simantics.scl.compiler.internal.parsing.Token;
8 import org.simantics.scl.compiler.internal.parsing.types.TypeAst;
9
10 public class ConstraintStatement extends Statement {
11
12     public Token name;
13     public TypeAst[] parameterTypes;
14     
15     public ConstraintStatement(Token name, TypeAst[] parameterTypes) {
16         this.name = name;
17         this.parameterTypes = parameterTypes;
18     }
19     
20     @Override
21     public void setLocationDeep(long loc) {
22         if(location == Locations.NO_LOCATION) {
23             location = loc;
24             for(TypeAst parameterType : parameterTypes)
25                 if(parameterType.location == Locations.NO_LOCATION)
26                     parameterType.location = location;
27         }
28     }
29
30     @Override
31     public Expression toExpression(EnvironmentalContext context, boolean monadic, Expression in) {
32         throw new UnsupportedOperationException();
33     }
34
35     @Override
36     public void resolvePattern(TranslationContext context) {
37         throw new UnsupportedOperationException();
38     }
39
40     @Override
41     public boolean mayBeRecursive() {
42         throw new UnsupportedOperationException();
43     }
44
45     @Override
46     public void accept(StatementVisitor visitor) {
47         throw new UnsupportedOperationException();
48     }
49
50     @Override
51     public StatementGroup getStatementGroup() {
52         return StatementGroup.CHR;
53     }
54 }