1 package org.simantics.scl.compiler.elaboration.expressions;
\r
3 import gnu.trove.map.hash.TObjectIntHashMap;
\r
4 import gnu.trove.set.hash.THashSet;
\r
5 import gnu.trove.set.hash.TIntHashSet;
\r
7 import org.simantics.scl.compiler.common.exceptions.InternalCompilerError;
\r
8 import org.simantics.scl.compiler.elaboration.contexts.SimplificationContext;
\r
9 import org.simantics.scl.compiler.elaboration.contexts.TypingContext;
\r
10 import org.simantics.scl.compiler.internal.elaboration.utils.ExpressionDecorator;
\r
11 import org.simantics.scl.compiler.types.Type;
\r
12 import org.simantics.scl.compiler.types.exceptions.MatchException;
\r
14 public abstract class ASTExpression extends SimplifiableExpression {
\r
15 public ASTExpression() {
\r
19 final public Expression simplify(SimplificationContext context) {
\r
20 throw new InternalCompilerError(getClass().getSimpleName() + " does not support simplify.");
\r
24 final public void collectFreeVariables(THashSet<Variable> vars) {
\r
25 throw new InternalCompilerError(getClass().getSimpleName() + " does not support collectFreeVariables.");
\r
30 final public void collectRefs(TObjectIntHashMap<Object> allRefs,
\r
32 throw new InternalCompilerError(getClass().getSimpleName() + " does not support collectRefs.");
\r
36 final public void collectVars(TObjectIntHashMap<Variable> allVars,
\r
38 throw new InternalCompilerError(getClass().getSimpleName() + " does not support collectVars.");
\r
42 final protected void updateType() throws MatchException {
\r
43 throw new InternalCompilerError(getClass().getSimpleName() + " does not support updateType.");
\r
47 final public Expression decorate(ExpressionDecorator decorator) {
\r
48 throw new InternalCompilerError(getClass().getSimpleName() + " does not support decorate.");
\r
52 final public void collectEffects(THashSet<Type> effects) {
\r
53 throw new InternalCompilerError(getClass().getSimpleName() + " does not support collectEffects.");
\r
57 final public void accept(ExpressionVisitor visitor) {
\r
58 throw new InternalCompilerError(getClass().getSimpleName() + " does not support accept.");
\r
62 public Expression checkBasicType(TypingContext context, Type requiredType) {
\r
63 throw new InternalCompilerError("Class " +
\r
64 getClass().getSimpleName() + " does not implement method checkBasicType.");
\r
68 public Expression inferType(TypingContext context) {
\r
69 throw new InternalCompilerError("Class " +
\r
70 getClass().getSimpleName() + " does not implement method inferType.");
\r
74 public void forVariables(VariableProcedure procedure) {
\r
75 throw new InternalCompilerError("Class " +
\r
76 getClass().getSimpleName() + " does not implement method forVariables.");
\r