1 package org.simantics.scl.compiler.elaboration.expressions;
3 import org.simantics.scl.compiler.common.exceptions.InternalCompilerError;
4 import org.simantics.scl.compiler.elaboration.contexts.SimplificationContext;
5 import org.simantics.scl.compiler.elaboration.contexts.TypingContext;
6 import org.simantics.scl.compiler.errors.Locations;
7 import org.simantics.scl.compiler.types.Type;
8 import org.simantics.scl.compiler.types.exceptions.MatchException;
10 public abstract class ASTExpression extends SimplifiableExpression {
11 public ASTExpression() {
15 final public Expression simplify(SimplificationContext context) {
16 throw new InternalCompilerError(getClass().getSimpleName() + " does not support simplify.");
20 final protected void updateType() throws MatchException {
21 throw new InternalCompilerError(getClass().getSimpleName() + " does not support updateType.");
25 public void accept(ExpressionVisitor visitor) {
26 throw new InternalCompilerError(getClass().getSimpleName() + " does not support accept.");
30 public Expression accept(ExpressionTransformer transformer) {
31 throw new InternalCompilerError(getClass().getSimpleName() + " does not support accept.");
35 public Expression checkBasicType(TypingContext context, Type requiredType) {
36 throw new InternalCompilerError("Class " +
37 getClass().getSimpleName() + " does not implement method checkBasicType.");
41 public Expression inferType(TypingContext context) {
42 throw new InternalCompilerError("Class " +
43 getClass().getSimpleName() + " does not implement method inferType.");
47 public void setLocationDeep(long loc) {
48 if(location == Locations.NO_LOCATION)