]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/query/QIf.java
(refs #7375) Replaced collectVars method by a visitor
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / elaboration / query / QIf.java
index 62ff9583ce97317519fe2074254f818b61cf6027..03bcec3e9b6f322f3b426829f30c7d814095a1d2 100644 (file)
@@ -4,17 +4,11 @@ import org.simantics.scl.compiler.elaboration.contexts.ReplaceContext;
 import org.simantics.scl.compiler.elaboration.contexts.TypingContext;
 import org.simantics.scl.compiler.elaboration.expressions.Expression;
 import org.simantics.scl.compiler.elaboration.expressions.QueryTransformer;
-import org.simantics.scl.compiler.elaboration.expressions.Variable;
-import org.simantics.scl.compiler.elaboration.expressions.VariableProcedure;
 import org.simantics.scl.compiler.elaboration.query.compilation.ConstraintCollectionContext;
 import org.simantics.scl.compiler.elaboration.query.compilation.UnsolvableQueryException;
 import org.simantics.scl.compiler.errors.Locations;
 import org.simantics.scl.compiler.types.Types;
 
-import gnu.trove.map.hash.TObjectIntHashMap;
-import gnu.trove.set.hash.THashSet;
-import gnu.trove.set.hash.TIntHashSet;
-
 public class QIf extends Query {
     public Expression condition;
     public Query thenQuery;
@@ -25,28 +19,7 @@ public class QIf extends Query {
         this.thenQuery = thenQuery;
         this.elseQuery = elseQuery;
     }
-
-    @Override
-    public void collectFreeVariables(THashSet<Variable> vars) {
-        condition.collectFreeVariables(vars);
-        thenQuery.collectFreeVariables(vars);
-        elseQuery.collectFreeVariables(vars);
-    }
-
-    @Override
-    public void collectRefs(TObjectIntHashMap<Object> allRefs, TIntHashSet refs) {
-        condition.collectRefs(allRefs, refs);
-        thenQuery.collectRefs(allRefs, refs);
-        elseQuery.collectRefs(allRefs, refs);
-    }
-
-    @Override
-    public void collectVars(TObjectIntHashMap<Variable> allVars, TIntHashSet vars) {
-        condition.collectVars(allVars, vars);
-        thenQuery.collectVars(allVars, vars);
-        elseQuery.collectVars(allVars, vars);
-    }
-
+    
     @Override
     public void checkType(TypingContext context) {
         condition.checkType(context, Types.BOOLEAN);
@@ -82,13 +55,6 @@ public class QIf extends Query {
     public void accept(QueryVisitor visitor) {
         visitor.visit(this);
     }
-
-    @Override
-    public void forVariables(VariableProcedure procedure) {
-        condition.forVariables(procedure);
-        elseQuery.forVariables(procedure);
-        thenQuery.forVariables(procedure);
-    }
     
     @Override
     public Query accept(QueryTransformer transformer) {