]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/ASTExpression.java
(refs #7371) Support for select keyword for CHR constraints
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / elaboration / expressions / ASTExpression.java
index fbc0a79014dcb107c3b17842ef5bbb06fddaac8b..02db9bdec3356e18d151a92bc342acefa8cc8831 100644 (file)
@@ -3,6 +3,7 @@ package org.simantics.scl.compiler.elaboration.expressions;
 import org.simantics.scl.compiler.common.exceptions.InternalCompilerError;
 import org.simantics.scl.compiler.elaboration.contexts.SimplificationContext;
 import org.simantics.scl.compiler.elaboration.contexts.TypingContext;
 import org.simantics.scl.compiler.common.exceptions.InternalCompilerError;
 import org.simantics.scl.compiler.elaboration.contexts.SimplificationContext;
 import org.simantics.scl.compiler.elaboration.contexts.TypingContext;
+import org.simantics.scl.compiler.errors.Locations;
 import org.simantics.scl.compiler.internal.elaboration.utils.ExpressionDecorator;
 import org.simantics.scl.compiler.types.Type;
 import org.simantics.scl.compiler.types.exceptions.MatchException;
 import org.simantics.scl.compiler.internal.elaboration.utils.ExpressionDecorator;
 import org.simantics.scl.compiler.types.Type;
 import org.simantics.scl.compiler.types.exceptions.MatchException;
@@ -23,7 +24,6 @@ public abstract class ASTExpression extends SimplifiableExpression {
     @Override
     final public void collectFreeVariables(THashSet<Variable> vars) {
         throw new InternalCompilerError(getClass().getSimpleName() + " does not support collectFreeVariables.");
     @Override
     final public void collectFreeVariables(THashSet<Variable> vars) {
         throw new InternalCompilerError(getClass().getSimpleName() + " does not support collectFreeVariables.");
-
     }
     
     @Override
     }
     
     @Override
@@ -58,6 +58,11 @@ public abstract class ASTExpression extends SimplifiableExpression {
         throw new InternalCompilerError(getClass().getSimpleName() + " does not support accept.");
     }
     
         throw new InternalCompilerError(getClass().getSimpleName() + " does not support accept.");
     }
     
+    @Override
+    public Expression accept(ExpressionTransformer transformer) {
+        throw new InternalCompilerError(getClass().getSimpleName() + " does not support accept.");
+    }
+    
     @Override
     public Expression checkBasicType(TypingContext context, Type requiredType) {
         throw new InternalCompilerError("Class " + 
     @Override
     public Expression checkBasicType(TypingContext context, Type requiredType) {
         throw new InternalCompilerError("Class " + 
@@ -75,4 +80,10 @@ public abstract class ASTExpression extends SimplifiableExpression {
         throw new InternalCompilerError("Class " + 
                 getClass().getSimpleName() + " does not implement method forVariables.");
     }
         throw new InternalCompilerError("Class " + 
                 getClass().getSimpleName() + " does not implement method forVariables.");
     }
+    
+    @Override
+    public void setLocationDeep(long loc) {
+        if(location == Locations.NO_LOCATION)
+            location = loc;
+    }
 }
 }