]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/ERuleset.java
(refs #7375) Replace collectRefs by CollectRefsVisitor
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / elaboration / expressions / ERuleset.java
index e784813d69fec37c9793ccae98a5ccd38fcc2756..1a133b6f9dc61e7b0ee283c4e8ed77614d15939a 100644 (file)
@@ -32,7 +32,6 @@ import org.simantics.scl.compiler.elaboration.query.compilation.DerivateExceptio
 import org.simantics.scl.compiler.elaboration.relations.LocalRelation;
 import org.simantics.scl.compiler.elaboration.relations.SCLRelation;
 import org.simantics.scl.compiler.errors.Locations;
-import org.simantics.scl.compiler.internal.elaboration.utils.ExpressionDecorator;
 import org.simantics.scl.compiler.internal.elaboration.utils.ForcedClosure;
 import org.simantics.scl.compiler.internal.elaboration.utils.StronglyConnectedComponents;
 import org.simantics.scl.compiler.top.SCLCompilerConfiguration;
@@ -95,12 +94,6 @@ public class ERuleset extends SimplifiableExpression {
             visitor.visit(this);
             return b.toString();
         }
-
-        public void forVariables(VariableProcedure procedure) {
-            for(Expression headParameter : headParameters)
-                headParameter.forVariables(procedure);
-            body.forVariables(procedure);
-        }
     }
     
     private void checkRuleTypes(TypingContext context) {
@@ -148,18 +141,7 @@ public class ERuleset extends SimplifiableExpression {
         }
         in.collectFreeVariables(vars);
     }
-    
-    @Override
-    public void collectRefs(TObjectIntHashMap<Object> allRefs,
-            TIntHashSet refs) {
-        for(DatalogRule rule : rules) {
-            for(Expression parameter : rule.headParameters)
-                parameter.collectRefs(allRefs, refs);
-            rule.body.collectRefs(allRefs, refs);
-        }
-        in.collectRefs(allRefs, refs);
-    }
-    
+
     @Override
     public void collectVars(TObjectIntHashMap<Variable> allVars,
             TIntHashSet vars) {
@@ -170,17 +152,12 @@ public class ERuleset extends SimplifiableExpression {
         }
         in.collectVars(allVars, vars);
     }
-    
+
     @Override
     public void collectEffects(THashSet<Type> effects) {
         throw new InternalCompilerError(location, getClass().getSimpleName() + " does not support collectEffects.");
     }
     
-    @Override
-    public Expression decorate(ExpressionDecorator decorator) {
-        return decorator.decorate(this);
-    }
-    
     @Override
     public Expression resolve(TranslationContext context) {
         throw new InternalCompilerError();
@@ -406,13 +383,6 @@ public class ERuleset extends SimplifiableExpression {
     public Expression getIn() {
         return in;
     }
-
-    @Override
-    public void forVariables(VariableProcedure procedure) {
-        for(DatalogRule rule : rules)
-            rule.forVariables(procedure);
-        in.forVariables(procedure);
-    }
     
     @Override
     public Expression accept(ExpressionTransformer transformer) {