]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/EViewPattern.java
(refs #7375) Replaced collectVars method by a visitor
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / elaboration / expressions / EViewPattern.java
index 2561e63b979fefef95900181133391600f8de844..4957f7c856360ac1b19fc15a5fff5bdc1bd24954 100644 (file)
@@ -8,15 +8,10 @@ import org.simantics.scl.compiler.elaboration.contexts.TypingContext;
 import org.simantics.scl.compiler.errors.Locations;
 import org.simantics.scl.compiler.internal.codegen.references.IVal;
 import org.simantics.scl.compiler.internal.codegen.writer.CodeWriter;
-import org.simantics.scl.compiler.types.Type;
 import org.simantics.scl.compiler.types.Types;
 import org.simantics.scl.compiler.types.exceptions.MatchException;
 import org.simantics.scl.compiler.types.util.MultiFunction;
 
-import gnu.trove.map.hash.TObjectIntHashMap;
-import gnu.trove.set.hash.THashSet;
-import gnu.trove.set.hash.TIntHashSet;
-
 public class EViewPattern extends Expression {
     public Expression expression;
     public Expression pattern;
@@ -25,18 +20,6 @@ public class EViewPattern extends Expression {
         this.expression = expression;
         this.pattern = pattern;
     }
-
-    @Override
-    public void collectRefs(TObjectIntHashMap<Object> allRefs, TIntHashSet refs) {
-        expression.collectRefs(allRefs, refs);
-        pattern.collectRefs(allRefs, refs);
-    }
-
-    @Override
-    public void collectVars(TObjectIntHashMap<Variable> allVars, TIntHashSet vars) {
-        expression.collectVars(allVars, vars);
-        pattern.collectVars(allVars, vars);
-    }
     
     @Override
     public Expression inferType(TypingContext context) {
@@ -66,17 +49,6 @@ public class EViewPattern extends Expression {
         throw new InternalCompilerError(location, "EViewPattern.toVal should not be invoked.");
     }
 
-    @Override
-    public void collectFreeVariables(THashSet<Variable> vars) {
-        throw new InternalCompilerError(location, "Cannot collect free variables for a pattern.");
-    }
-    
-    @Override
-    public void removeFreeVariables(THashSet<Variable> vars) {
-        expression.collectFreeVariables(vars);
-        pattern.removeFreeVariables(vars);
-    }
-
     @Override
     public Expression resolve(TranslationContext context) {
         context.getErrorLog().log("View pattern cannot occur only in patterns. Maybe you are missing '\\' in front of a lambda experssion?");
@@ -99,11 +71,6 @@ public class EViewPattern extends Expression {
         }
     }
 
-    @Override
-    public void collectEffects(THashSet<Type> effects) {
-        expression.collectEffects(effects);
-    }
-
     @Override
     public void accept(ExpressionVisitor visitor) {
         visitor.visit(this);