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