]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/ESelect.java
(refs #7375) Replaced collectFreeVariables method by a visitor
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / elaboration / expressions / ESelect.java
index 42fdc6f106536465ad0350fbbd66c794392074ee..09079377f0a0a11afe61147fb0827865300c4ba1 100644 (file)
@@ -27,7 +27,6 @@ import org.simantics.scl.compiler.types.exceptions.MatchException;
 import org.simantics.scl.compiler.types.kinds.Kinds;
 
 import gnu.trove.map.hash.TObjectIntHashMap;
-import gnu.trove.set.hash.THashSet;
 import gnu.trove.set.hash.TIntHashSet;
 
 public class ESelect extends SimplifiableExpression {
@@ -35,9 +34,9 @@ public class ESelect extends SimplifiableExpression {
     private final Type ARRAY_LIST = Types.con("ArrayList", "T"); 
     
     int selectVariant;
-    Expression expression;
-    Query query;
-    Variable[] variables;
+    public Expression expression;
+    public Query query;
+    public Variable[] variables;
     
     public ESelect(int selectVariant, Expression expression, Query query) {
         this.selectVariant = selectVariant;
@@ -45,24 +44,12 @@ public class ESelect extends SimplifiableExpression {
         this.query = query;
     }
 
-    @Override
-    public void collectRefs(TObjectIntHashMap<Object> allRefs,
-            TIntHashSet refs) {
-        expression.collectRefs(allRefs, refs);
-        query.collectRefs(allRefs, refs);
-    }
-
     @Override
     public void collectVars(TObjectIntHashMap<Variable> allVars,
             TIntHashSet vars) {
         expression.collectVars(allVars, vars);
         query.collectVars(allVars, vars);
     }
-    
-    @Override
-    public void collectEffects(THashSet<Type> effects) {
-        throw new InternalCompilerError(location, getClass().getSimpleName() + " does not support collectEffects.");
-    }
 
     @Override
     protected void updateType() throws MatchException {
@@ -140,14 +127,6 @@ public class ESelect extends SimplifiableExpression {
         return loc(location, result);
     }
 
-    @Override
-    public void collectFreeVariables(THashSet<Variable> vars) {
-        expression.collectFreeVariables(vars);
-        query.collectFreeVariables(vars);
-        for(Variable variable : variables)
-            vars.remove(variable);
-    }
-
     @Override
     public Expression resolve(TranslationContext context) {
         context.pushExistentialFrame();